201026_3
authorhgs
Fri, 16 Jul 2010 11:45:55 +0300
changeset 116 171fae344dd4
parent 103 2717213c588a
201026_3
egl/eglinterface/include/1.4/eglext.h
egl/eglrefimpl/group/egl_ref.iby
egl/egltest/group/egltest_helium.pkg
egl/egltest/inc/egltest_oom_sgimage.h
egl/egltest/scripts/egltest_t_oom_sgimage.script
egl/egltest/src/egltest_image.cpp
egl/egltest/src/egltest_image_multiprocess.cpp
egl/egltest/src/egltest_oom_sgimage.cpp
egl/egltest/src/eglteststep.cpp
fbs/fontandbitmapserver/bwins/FBSCLI2U.DEF
fbs/fontandbitmapserver/bwins/fbservu.def
fbs/fontandbitmapserver/eabi/FBSCLI2U.DEF
fbs/fontandbitmapserver/eabi/fbservu.def
fbs/fontandbitmapserver/group/FBSCLI.MMP
fbs/fontandbitmapserver/group/FBSERV.MMP
fbs/fontandbitmapserver/group/FbservTest.iby
fbs/fontandbitmapserver/group/TFbsServer.mmp
fbs/fontandbitmapserver/group/bld.inf
fbs/fontandbitmapserver/group/fbscli_fmm.mmp
fbs/fontandbitmapserver/group/fbserv.iby
fbs/fontandbitmapserver/group/fbserv_fmm.mmp
fbs/fontandbitmapserver/group/fbservtest_helium.pkg
fbs/fontandbitmapserver/group/fbsoogmplugin.iby
fbs/fontandbitmapserver/group/fbsoogmplugin.mmp
fbs/fontandbitmapserver/inc/FBS.H
fbs/fontandbitmapserver/inc/FbsMessage.H
fbs/fontandbitmapserver/sfbs/FBSCLI.CPP
fbs/fontandbitmapserver/sfbs/FBSFONT.CPP
fbs/fontandbitmapserver/sfbs/FBSTOP.CPP
fbs/fontandbitmapserver/sfbs/SERVER.CPP
fbs/fontandbitmapserver/sfbs/SERVER.H
fbs/fontandbitmapserver/sfbs/SESSION.CPP
fbs/fontandbitmapserver/sfbs/UTILS.H
fbs/fontandbitmapserver/sfbs/fbsglyphdataiterator.cpp
fbs/fontandbitmapserver/sfbs/fbsglyphdataiterator.h
fbs/fontandbitmapserver/sfbs/fbsglyphmetricsarray.cpp
fbs/fontandbitmapserver/sfbs/fbsglyphmetricsarray.h
fbs/fontandbitmapserver/sfbs/fbsoogmmessage.h
fbs/fontandbitmapserver/sfbs/fbsoogmmessage.inl
fbs/fontandbitmapserver/sfbs/fbsoogmplugin.cpp
fbs/fontandbitmapserver/sfbs/fbsoogmplugin.h
fbs/fontandbitmapserver/sfbs/fbsoogmplugin.rss
fbs/fontandbitmapserver/sfbs/glyphatlas.cpp
fbs/fontandbitmapserver/sfbs/glyphatlas.h
fbs/fontandbitmapserver/sfbs/patchableconstants.cpp
fbs/fontandbitmapserver/tfbs/TALLOC.H
fbs/fontandbitmapserver/tfbs/TBitmap.h
fbs/fontandbitmapserver/tfbs/TCLEAN.H
fbs/fontandbitmapserver/tfbs/TFBS.CPP
fbs/fontandbitmapserver/tfbs/TFBS.H
fbs/fontandbitmapserver/tfbs/TFBSDefect.h
fbs/fontandbitmapserver/tfbs/TFbsServer.cpp
fbs/fontandbitmapserver/tfbs/TGetAllBitmapsCapability.h
fbs/fontandbitmapserver/tfbs/TRalc.h
fbs/fontandbitmapserver/tfbs/TSecureFBS.h
fbs/fontandbitmapserver/tfbs/TStreamIdCache.h
fbs/fontandbitmapserver/tfbs/glyphatlastestwrapper.cpp
fbs/fontandbitmapserver/tfbs/glyphatlastestwrapper.h
fbs/fontandbitmapserver/tfbs/mbmfiles/dummyrscfile3.rsc
fbs/fontandbitmapserver/tfbs/scripts/fbstest_T_IPCTest.script
fbs/fontandbitmapserver/tfbs/scripts/fbstest_run.bat
fbs/fontandbitmapserver/tfbs/scripts/fbstest_t_fonttable.script
fbs/fontandbitmapserver/tfbs/scripts/fbstest_t_glyphdata.script
fbs/fontandbitmapserver/tfbs/scripts/fbstest_t_glyphdataoutlineshadow.script
fbs/fontandbitmapserver/tfbs/scripts/fbstest_t_oogm.script
fbs/fontandbitmapserver/tfbs/scripts/glyphdata_config.ini
fbs/fontandbitmapserver/tfbs/scripts/ipctest_config.ini
fbs/fontandbitmapserver/tfbs/tcompressed.h
fbs/fontandbitmapserver/tfbs/textendedbitmapcommon.h
fbs/fontandbitmapserver/tfbs/tfbsbase.h
fbs/fontandbitmapserver/tfbs/tfbsglyphdata.cpp
fbs/fontandbitmapserver/tfbs/tfbsglyphdata.h
fbs/fontandbitmapserver/tfbs/tfbsglyphdataoutlineshadow.cpp
fbs/fontandbitmapserver/tfbs/tfbsglyphdataoutlineshadow.h
fbs/fontandbitmapserver/tfbs/tfbsglyphdatapanic.cpp
fbs/fontandbitmapserver/tfbs/tfbsglyphdatapanic.h
fbs/fontandbitmapserver/tfbs/tfbsoogm.cpp
fbs/fontandbitmapserver/tfbs/tfbsoogm.h
fbs/fontandbitmapserver/tfbs/tfonttableandglyph.h
fbs/fontandbitmapserver/tfbs/tglyphatlas.cpp
fbs/fontandbitmapserver/tfbs/tglyphatlas.h
fbs/fontandbitmapserver/tfbs/tipctest.CPP
fbs/fontandbitmapserver/tfbs/tipctest.h
fbs/fontandbitmapserver/tfbs/trfile.h
fbs/fontandbitmapserver/tfbs/twdp.h
fbs/fontandbitmapserver/traces/OstTraceDefinitions.h
fbs/fontandbitmapserver/traces/fixed_id.definitions
graphicsaccelaration/vgi/group/libvgi.mmp
graphicsaccelaration/vgi/inc/vg/vgcontext.h
graphicscomposition/openwfcinterface/bwins/libWFCu.def
graphicscomposition/openwfcinterface/eabi/libWFCu.def
graphicscomposition/openwfcinterface/include/wfcplatform.h
graphicscomposition/surfaceupdate/group/surfaceupdateserver.mmh
graphicscomposition/surfaceupdate/group/surfaceupdateserver.mmp
graphicscomposition/surfaceupdate/inc/surfaceupdate.h
graphicscomposition/surfaceupdate/inc/surfaceupdateserver.h
graphicscomposition/surfaceupdate/src/surfaceupdateserver.cpp
graphicscomposition/surfaceupdate/tsrc/tsurfaceupdate.cpp
graphicscomposition/surfaceupdate/tsrc/tsurfaceupdate.h
graphicsdeviceinterface/bitgdi/group/BitgdiTest.iby
graphicsdeviceinterface/bitgdi/group/bitgdi.pkg
graphicsdeviceinterface/bitgdi/sbit/FONTBMP.CPP
graphicsdeviceinterface/bitgdi/sbit/MAIN.CPP
graphicsdeviceinterface/bitgdi/tbit/TDefect2.cpp
graphicsdeviceinterface/bitgdi/tbit/mbmfiles/dummyrscfile.rsc
graphicsdeviceinterface/gdi/bwins/GDI2U.def
graphicsdeviceinterface/gdi/eabi/GDI2U.def
graphicsdeviceinterface/gdi/group/GDI.MMP
graphicsdeviceinterface/gdi/inc/GDI.H
graphicsdeviceinterface/gdi/inc/gdiconsts.h
graphicsdeviceinterface/gdi/inc/gdiplatapi.h
graphicsdeviceinterface/screendriver/sbit/Cdsb.cpp
graphicsdeviceinterface/screendriver/sgeneric/scdraw.h
graphicsdeviceinterface/screendriver/sgeneric/scdraw.inl
graphicsdeviceinterface/screendriver/sgeneric/scnew.cpp
graphicshwdrivers/surfacemgr/inc/surface_hints.h
graphicshwdrivers/surfacemgr/test/src/tsurfacemanager.cpp
graphicstest/graphicstestharness/automation/h4/tests_00b.txt
graphicstest/graphicstestharness/automation/h4/tests_01.txt
graphicstest/graphicstestharness/automation/h4/tests_01a.txt
graphicstest/graphicstestharness/automation/h4/tests_29b.txt
graphicstest/graphicstestharness/automation/h6/tests_00b.txt
graphicstest/graphicstestharness/automation/h6/tests_01.txt
graphicstest/graphicstestharness/automation/h6/tests_01a.txt
graphicstest/graphicstestharness/automation/ne1/tests_01.txt
graphicstest/graphicstestharness/automation/ne1/tests_01a.txt
graphicstest/graphicstestharness/automation/winscw/tests.txt
graphicstest/graphicstestharness/automation/winscw/tests_smoke.txt
graphicstest/graphicstestharness/bwins/tprofileru.def
graphicstest/graphicstestharness/eabi/tprofileru.def
graphicstest/graphicstestharness/group/bld.inf
graphicstest/graphicstestharness/inc/TGraphicsHarness.h
graphicstest/graphicstestharness/inc/tprofiler.h
graphicstest/graphicstestharness/rom/graphics_sirocco_ne_wsini.iby
graphicstest/graphicstestharness/rom/minigui_chassis_bats.oby
graphicstest/graphicstestharness/rom/minigui_naviengine_smp.oby
graphicstest/graphicstestharness/src/tprofiler.cpp
graphicstest/graphicstestharness/wsini/wsini_naviengine.ini
graphicstest/uibench/group/bld.inf
graphicstest/uibench/group/te_uibench.iby
graphicstest/uibench/group/te_uibench.mmp
graphicstest/uibench/group/te_uibench_gce.mmp
graphicstest/uibench/group/te_uibench_helium.pkg
graphicstest/uibench/s60/group/te_uibench_s60.mmp
graphicstest/uibench/s60/sis/rd-key.pem
graphicstest/uibench/s60/sis/rd.cer
graphicstest/uibench/scripts/te_uibench.ini
graphicstest/uibench/scripts/te_uibench.script
graphicstest/uibench/scripts/te_uibench_gce.ini
graphicstest/uibench/scripts/te_uibench_gce.script
graphicstest/uibench/src/te_graphicsperformanceSuiteDefs.h
graphicstest/uibench/src/te_graphicsperformanceSuiteServer.cpp
graphicstest/uibench/src/tfbsglyphdata.cpp
graphicstest/uibench/src/tfbsglyphdata.h
graphicstest/uibench/src/tgcesuiteserver.cpp
graphicstest/uibench/src/trenderorientation.cpp
graphicstest/uibench/src/trenderorientation.h
graphicstools/gdi_tools/fontcomp/GDSFCOMP.CPP
m3g/m3gcore11/src/m3g_loader.c
m3g/m3gcore11/src/m3g_sprite.c
m3g/m3gcore11/src/m3g_vertexarray.c
m3g/m3gcore11/src/m3g_vertexbuffer.c
printingservices/printerdriversupport/src/PDRBODY.H
printingservices/printerdriversupport/tps/T_PDR.CPP
windowing/windowserver/DES/CLIENT.MDL
windowing/windowserver/DES/CLIENT2.MDL
windowing/windowserver/DES/GDI.MDL
windowing/windowserver/DES/WSERV.MDL
windowing/windowserver/DES/WSERV2.MDL
windowing/windowserver/DES/WSV4.MDL
windowing/windowserver/SERVER/openwfc/panics.h
windowing/windowserver/SERVER/w32cmd.h
windowing/windowserver/TClick/CLICK.CPP
windowing/windowserver/TClick/CLICK.H
windowing/windowserver/TClick/LOGWIN.CPP
windowing/windowserver/TClick/LOGWIN.H
windowing/windowserver/TClick/multiptrclick.cpp
windowing/windowserver/TClick/multiptrclick.h
windowing/windowserver/bwins/WS322U.DEF
windowing/windowserver/bwins/ws32switchu.def
windowing/windowserver/debuglog/DECODER.CPP
windowing/windowserver/eabi/WS322U.DEF
windowing/windowserver/group/ANIM.MMP
windowing/windowserver/group/ANIMDLL.MMP
windowing/windowserver/group/AUTODLL_nga.MMP
windowing/windowserver/group/AUTODLL_nonnga.MMP
windowing/windowserver/group/Click.MMP
windowing/windowserver/group/INC113743.MMP
windowing/windowserver/group/TCAP1.MMP
windowing/windowserver/group/TCAP2.MMP
windowing/windowserver/group/TCAP3.MMP
windowing/windowserver/group/TCAP_ALL.MMP
windowing/windowserver/group/TCAP_NONE.MMP
windowing/windowserver/group/TLIB.MMP
windowing/windowserver/group/TMAN.MMP
windowing/windowserver/group/TTIMERS.MMP
windowing/windowserver/group/TWSGRAPHIC.MMP
windowing/windowserver/group/TWSGRAPHICSHARE.MMP
windowing/windowserver/group/TWSGRAPHICSHAREGLOBAL.MMP
windowing/windowserver/group/TWSGRAPHICSHARESECURE.MMP
windowing/windowserver/group/TWSGRAPHICUNSHAREGLOBAL.MMP
windowing/windowserver/group/TWSGRAPHICUNSHARESECURE.MMP
windowing/windowserver/group/bufferdrawer.mmp
windowing/windowserver/group/containdrawer.mmp
windowing/windowserver/group/eventdd.mmp
windowing/windowserver/group/framerate.mmp
windowing/windowserver/group/listener.mmp
windowing/windowserver/group/multiptrclick.mmp
windowing/windowserver/group/openwfc/WServ_nga.MMP
windowing/windowserver/group/openwfc/bld.inf
windowing/windowserver/group/redirector.mmp
windowing/windowserver/group/tclosepanicwindow.mmp
windowing/windowserver/group/tcrx.mmp
windowing/windowserver/group/tcsc.mmp
windowing/windowserver/group/twsthemeserverpropertydefine.mmp
windowing/windowserver/group/wsbufferdrawer.mmp
windowing/windowserver/group/wscons.mmp
windowing/windowserver/group/wscontaindrawer.mmp
windowing/windowserver/group/wservu_multiscreen.ini
windowing/windowserver/group/wservu_multiscreen_changetracking.ini
windowing/windowserver/group/wsframerate.mmp
windowing/windowserver/group/wslisten.mmp
windowing/windowserver/group/wsredir.mmp
windowing/windowserver/inc/Graphics/openwfc/WSGRAPHICDRAWERINTERFACE.H
windowing/windowserver/inc/Graphics/wskeyrouter.h
windowing/windowserver/inc/W32STD.H
windowing/windowserver/inc/wspublishandsubscribedata.h
windowing/windowserver/nga/CLIENT/RDirect.CPP
windowing/windowserver/nga/CLIENT/RWINDOW.CPP
windowing/windowserver/nga/CLIENT/RWS.CPP
windowing/windowserver/nga/SERVER/CAPKEY.CPP
windowing/windowserver/nga/SERVER/EVENT.CPP
windowing/windowserver/nga/SERVER/EVENT.H
windowing/windowserver/nga/SERVER/POINTER.CPP
windowing/windowserver/nga/SERVER/PRIKEY.CPP
windowing/windowserver/nga/SERVER/PRIKEY.H
windowing/windowserver/nga/SERVER/REDRAWQ.CPP
windowing/windowserver/nga/SERVER/SERVER.CPP
windowing/windowserver/nga/SERVER/openwfc/CLIENT.CPP
windowing/windowserver/nga/SERVER/openwfc/CLIENT.H
windowing/windowserver/nga/SERVER/openwfc/GROUPWIN.CPP
windowing/windowserver/nga/SERVER/openwfc/ScreenRedraw.h
windowing/windowserver/nga/SERVER/openwfc/WINDOW.CPP
windowing/windowserver/nga/SERVER/openwfc/WSTOP.CPP
windowing/windowserver/nga/SERVER/openwfc/cliwin.cpp
windowing/windowserver/nga/SERVER/openwfc/screen.cpp
windowing/windowserver/nga/SERVER/openwfc/screen.h
windowing/windowserver/nga/SERVER/openwfc/server.h
windowing/windowserver/nga/SERVER/openwfc/wstop.h
windowing/windowserver/nga/SERVER/renderorientationtracker.cpp
windowing/windowserver/nga/SERVER/renderorientationtracker.h
windowing/windowserver/nga/SERVER/windowgroup.h
windowing/windowserver/nga/SERVER/wsdisplaychangeao.cpp
windowing/windowserver/nga/SERVER/wsdisplaychangeao.h
windowing/windowserver/nga/graphicdrawer/graphicdrawerenvironment.cpp
windowing/windowserver/nonnga/CLIENT/RWS.CPP
windowing/windowserver/nonnga/SERVER/EVENT.CPP
windowing/windowserver/nonnga/SERVER/SERVER.CPP
windowing/windowserver/nonnga/SERVER/ScreenRedraw.h
windowing/windowserver/nonnga/SERVER/WSTOP.CPP
windowing/windowserver/nonnga/SERVER/server.h
windowing/windowserver/nonnga/graphicdrawer/graphicdrawerenvironment.cpp
windowing/windowserver/tanim/ANIM.CPP
windowing/windowserver/tanim/ANIM1.PBM
windowing/windowserver/tanim/ANIM2.PBM
windowing/windowserver/tanim/ANIMDLL.H
windowing/windowserver/tanim/MASK.PBM
windowing/windowserver/tanim/TANIM.H
windowing/windowserver/tanim/TANIMDLL.CPP
windowing/windowserver/tanim/tanim.mbm
windowing/windowserver/tauto/AUTO.CPP
windowing/windowserver/tauto/AUTODLL.CPP
windowing/windowserver/tauto/AUTODLL.H
windowing/windowserver/tauto/AUTOTEST.TXT
windowing/windowserver/tauto/BLUEHASH.PBM
windowing/windowserver/tauto/DLLDRAW.H
windowing/windowserver/tauto/Dither.MBM
windowing/windowserver/tauto/GREYLINE.PBM
windowing/windowserver/tauto/MASK0.PBM
windowing/windowserver/tauto/MASK1.PBM
windowing/windowserver/tauto/MASK2.PBM
windowing/windowserver/tauto/TALPHAWIN.H
windowing/windowserver/tauto/TAUTO.H
windowing/windowserver/tauto/TAUTODLL.CPP
windowing/windowserver/tauto/TAUTODLL.H
windowing/windowserver/tauto/TAlphaChannel.CPP
windowing/windowserver/tauto/TAlphaChannel.H
windowing/windowserver/tauto/TAnimDraw.h
windowing/windowserver/tauto/TAnimdraw.cpp
windowing/windowserver/tauto/TBACKUPW.CPP
windowing/windowserver/tauto/TBACKUPW.H
windowing/windowserver/tauto/TBITMAP.CPP
windowing/windowserver/tauto/TBITMAP.H
windowing/windowserver/tauto/TBLANK.CPP
windowing/windowserver/tauto/TBLANK.H
windowing/windowserver/tauto/TBUFFERSECURITY.CPP
windowing/windowserver/tauto/TBUFFERSECURITY.H
windowing/windowserver/tauto/TCAPABILITY.CPP
windowing/windowserver/tauto/TCAPABILITY.H
windowing/windowserver/tauto/TCapKey.CPP
windowing/windowserver/tauto/TCapKey.H
windowing/windowserver/tauto/TDERIVED.CPP
windowing/windowserver/tauto/TDERIVED.H
windowing/windowserver/tauto/TDirectA.CPP
windowing/windowserver/tauto/TEVENT.H
windowing/windowserver/tauto/TEvent.CPP
windowing/windowserver/tauto/TFADE.CPP
windowing/windowserver/tauto/TFADE.H
windowing/windowserver/tauto/TFADINGBITMAP.CPP
windowing/windowserver/tauto/TFADINGBITMAP.H
windowing/windowserver/tauto/TFLICKERFREE.CPP
windowing/windowserver/tauto/TFLICKERFREE.H
windowing/windowserver/tauto/TGDI.CPP
windowing/windowserver/tauto/TGDI.H
windowing/windowserver/tauto/TGETPIXEL.CPP
windowing/windowserver/tauto/TGETPIXEL.H
windowing/windowserver/tauto/TGRAPHICSDRAWER.CPP
windowing/windowserver/tauto/TGRAPHICSDRAWER.H
windowing/windowserver/tauto/TGWHANDLE.CPP
windowing/windowserver/tauto/TGWHANDLE.H
windowing/windowserver/tauto/THeartBeat.CPP
windowing/windowserver/tauto/THeartBeat.h
windowing/windowserver/tauto/TKEY.CPP
windowing/windowserver/tauto/TKEY.H
windowing/windowserver/tauto/TKRepeat.CPP
windowing/windowserver/tauto/TKRepeat.H
windowing/windowserver/tauto/TMDISPLAY.CPP
windowing/windowserver/tauto/TMDISPLAY.H
windowing/windowserver/tauto/TMESSAGE.CPP
windowing/windowserver/tauto/TMESSAGE.H
windowing/windowserver/tauto/TMODCHG.CPP
windowing/windowserver/tauto/TMODCHG.H
windowing/windowserver/tauto/TMULSCREENS.CPP
windowing/windowserver/tauto/TMULSCREENS.h
windowing/windowserver/tauto/TMULTCON.CPP
windowing/windowserver/tauto/TMULTCON.H
windowing/windowserver/tauto/TMemLeakMode.cpp
windowing/windowserver/tauto/TMemLeakMode.h
windowing/windowserver/tauto/TMulTran.CPP
windowing/windowserver/tauto/TMulTran.H
windowing/windowserver/tauto/TOOM.CPP
windowing/windowserver/tauto/TOOM.H
windowing/windowserver/tauto/TOOMDRAW.CPP
windowing/windowserver/tauto/TOOMDRAW.H
windowing/windowserver/tauto/TORDINAL.CPP
windowing/windowserver/tauto/TORDINAL.H
windowing/windowserver/tauto/TPANIC.CPP
windowing/windowserver/tauto/TPANIC.H
windowing/windowserver/tauto/TPNTCAP.CPP
windowing/windowserver/tauto/TPNTCAP.H
windowing/windowserver/tauto/TPNTKEY.H
windowing/windowserver/tauto/TPROCPRI.CPP
windowing/windowserver/tauto/TPROCPRI.H
windowing/windowserver/tauto/TPntKey.CPP
windowing/windowserver/tauto/TPointer.CPP
windowing/windowserver/tauto/TPointer.H
windowing/windowserver/tauto/TRECTLIST.CPP
windowing/windowserver/tauto/TRECTLIST.H
windowing/windowserver/tauto/TREDRAW.CPP
windowing/windowserver/tauto/TREDRAW.H
windowing/windowserver/tauto/TREDRSTR.CPP
windowing/windowserver/tauto/TREDRSTR.H
windowing/windowserver/tauto/TRegion.H
windowing/windowserver/tauto/TRegion.cpp
windowing/windowserver/tauto/TSCRDEV.CPP
windowing/windowserver/tauto/TSCRDEV.H
windowing/windowserver/tauto/TSCRDEVRESSWITCH.CPP
windowing/windowserver/tauto/TSCRDEVRESSWITCH.H
windowing/windowserver/tauto/TSCREENMODEPOSITIONING.CPP
windowing/windowserver/tauto/TSCREENMODEPOSITIONING.H
windowing/windowserver/tauto/TSCRMODE.CPP
windowing/windowserver/tauto/TSCRMODE.H
windowing/windowserver/tauto/TSCROLL.CPP
windowing/windowserver/tauto/TSCROLL.H
windowing/windowserver/tauto/TSPRITE.CPP
windowing/windowserver/tauto/TSPRITE.H
windowing/windowserver/tauto/TScreenModeScaling.cpp
windowing/windowserver/tauto/TScreenModeScaling.h
windowing/windowserver/tauto/TTEXTCURS.CPP
windowing/windowserver/tauto/TTEXTCURS.H
windowing/windowserver/tauto/TTransptAnim.cpp
windowing/windowserver/tauto/TTransptAnim.h
windowing/windowserver/tauto/TWINDOW.CPP
windowing/windowserver/tauto/TWINDOW.H
windowing/windowserver/tauto/TWSGRAPHS.CPP
windowing/windowserver/tauto/TWSGRAPHS.H
windowing/windowserver/tauto/colorblender.cpp
windowing/windowserver/tauto/colorblender.h
windowing/windowserver/tauto/config/graphics-wserv-autotest.ini
windowing/windowserver/tauto/directgdigcwrapper.cpp
windowing/windowserver/tauto/directgdigcwrapper.h
windowing/windowserver/tauto/eventdd.cpp
windowing/windowserver/tauto/eventdd.h
windowing/windowserver/tauto/mwsgraphicscontexttodirectgdimappings.h
windowing/windowserver/tauto/mytest.mbm
windowing/windowserver/tauto/openwfc/AUTO.H
windowing/windowserver/tauto/stdpanic.h
windowing/windowserver/tauto/symball.gif
windowing/windowserver/tauto/tadvancedpointerevent.cpp
windowing/windowserver/tauto/tadvancedpointerevent.h
windowing/windowserver/tauto/talphawin.cpp
windowing/windowserver/tauto/tauto.mbm
windowing/windowserver/tauto/tclosepanicwindowprocess.cpp
windowing/windowserver/tauto/tcrpanim.cpp
windowing/windowserver/tauto/tcrpanim.h
windowing/windowserver/tauto/tdirecta.h
windowing/windowserver/tauto/tdirecta2.cpp
windowing/windowserver/tauto/tdirecta2.h
windowing/windowserver/tauto/tdrawresource.cpp
windowing/windowserver/tauto/tdrawresource.h
windowing/windowserver/tauto/tgc.cpp
windowing/windowserver/tauto/tgc.h
windowing/windowserver/tauto/tmultiptrevent.cpp
windowing/windowserver/tauto/tmultiptrevent.h
windowing/windowserver/tauto/topaquechild.cpp
windowing/windowserver/tauto/tw32cmdbuf.cpp
windowing/windowserver/tauto/tw32cmdbuf.h
windowing/windowserver/tauto/twindowsizecache.cpp
windowing/windowserver/tauto/twindowsizecache.h
windowing/windowserver/tauto/wscons.cpp
windowing/windowserver/tbufferdrawer/bufferdrawer.cpp
windowing/windowserver/tbufferdrawer/bufferdrawer.h
windowing/windowserver/tbufferdrawer/bufferdrawer.rss
windowing/windowserver/tbufferdrawer/proxy.cpp
windowing/windowserver/tbufferdrawer/wsbufferdrawer.cpp
windowing/windowserver/tbufferdrawer/wsbufferdrawer.h
windowing/windowserver/tcapability/TCapTest.CPP
windowing/windowserver/tcontaindrawer/containdrawer.cpp
windowing/windowserver/tcontaindrawer/containdrawer.h
windowing/windowserver/tcontaindrawer/containdrawer.rss
windowing/windowserver/tcontaindrawer/proxy.cpp
windowing/windowserver/tcontaindrawer/simpledrawer.cpp
windowing/windowserver/tcontaindrawer/simpledrawer.h
windowing/windowserver/tcontaindrawer/wscontaindrawer.cpp
windowing/windowserver/tcontaindrawer/wscontaindrawer.h
windowing/windowserver/tcontaindrawer/wsgraphicdrawercontext.h
windowing/windowserver/tcontaindrawer/wsgraphicdrawerngacontext.cpp
windowing/windowserver/tcontaindrawer/wsgraphicdrawernonngacontext.cpp
windowing/windowserver/tcontaindrawer/wssimpledrawer.cpp
windowing/windowserver/tcontaindrawer/wssimpledrawer.h
windowing/windowserver/tcrx/tcrx.cpp
windowing/windowserver/tcrx/tcrx.h
windowing/windowserver/tcsc/cwsgcecsc.cpp
windowing/windowserver/tcsc/cwsgcecsc.h
windowing/windowserver/tcsc/cwsgcecscbase.cpp
windowing/windowserver/tcsc/cwsgcecscbase.h
windowing/windowserver/tcsc/resources/wsini_csc_classic.ini
windowing/windowserver/tcsc/resources/wsini_csc_classic_naviengine.ini
windowing/windowserver/tcsc/resources/wsini_csc_classic_qvga.ini
windowing/windowserver/tcsc/resources/wsini_csc_classic_vga.ini
windowing/windowserver/tcsc/resources/wsini_csc_nga.ini
windowing/windowserver/tcsc/resources/wsini_csc_nga_changetracking.ini
windowing/windowserver/tcsc/resources/wsini_csc_nga_h6.ini
windowing/windowserver/tcsc/resources/wsini_csc_nga_naviengine.ini
windowing/windowserver/tcsc/resources/wsini_csc_nga_qvga.ini
windowing/windowserver/tcsc/resources/wsini_csc_nga_qvga_changetracking.ini
windowing/windowserver/tcsc/resources/wsini_csc_nga_vga.ini
windowing/windowserver/tcsc/resources/wsini_csc_nga_vga_changetracking.ini
windowing/windowserver/tcsc/t_gcecscserver.cpp
windowing/windowserver/tcsc/tcsc.iby
windowing/windowserver/tcsc/wscsc.script
windowing/windowserver/tcsc/wscscclassic.script
windowing/windowserver/tdynamicres/group/bld.inf
windowing/windowserver/tdynamicres/group/tdynamicres.mmp
windowing/windowserver/tdynamicres/group/tdynamicresclassic.mmp
windowing/windowserver/tdynamicres/group/wstestdynamicres.iby
windowing/windowserver/tdynamicres/inc/globalsettings.h
windowing/windowserver/tdynamicres/inc/screenselect.h
windowing/windowserver/tdynamicres/inc/surfaceutility.h
windowing/windowserver/tdynamicres/inc/t_wsdynamicreswinbase.h
windowing/windowserver/tdynamicres/inc/teflogextensions.h
windowing/windowserver/tdynamicres/inc/wsdynamicresbase.h
windowing/windowserver/tdynamicres/inc/wsdynamicresbasic.h
windowing/windowserver/tdynamicres/inc/wsdynamicresclassic.h
windowing/windowserver/tdynamicres/inc/wsgcedebugsession.h
windowing/windowserver/tdynamicres/scripts/wsdynamicresbasic_anisotropic_scaling.script
windowing/windowserver/tdynamicres/scripts/wsdynamicresbasic_integer_scaling.script
windowing/windowserver/tdynamicres/scripts/wsdynamicresbasic_isotropic_scaling.script
windowing/windowserver/tdynamicres/scripts/wsdynamicresbasic_no_scaling.script
windowing/windowserver/tdynamicres/scripts/wsdynamicresbasic_openvg_isotropic.script
windowing/windowserver/tdynamicres/scripts/wsdynamicresclassic.script
windowing/windowserver/tdynamicres/src/globalsettings.cpp
windowing/windowserver/tdynamicres/src/screenselect.cpp
windowing/windowserver/tdynamicres/src/surfaceutility.cpp
windowing/windowserver/tdynamicres/src/t_wsdynamicresclassictestserver.cpp
windowing/windowserver/tdynamicres/src/t_wsdynamicrestestserver.cpp
windowing/windowserver/tdynamicres/src/t_wsdynamicreswinbase.cpp
windowing/windowserver/tdynamicres/src/wsdynamicresbase.cpp
windowing/windowserver/tdynamicres/src/wsdynamicresbasic.cpp
windowing/windowserver/tdynamicres/src/wsdynamicresclassic.cpp
windowing/windowserver/tdynamicres/src/wsgcedebugsession.cpp
windowing/windowserver/test/ANIMWIN.H
windowing/windowserver/test/CONNECT.CPP
windowing/windowserver/test/FadeCount.cpp
windowing/windowserver/test/SHELL.CPP
windowing/windowserver/test/TAutoServer/TAutoServer.cpp
windowing/windowserver/test/TAutoServer/openwfc/TAutoServer_nga.mmp
windowing/windowserver/test/TAutoServer/openwfc/TAutoServer_nonnga.mmp
windowing/windowserver/test/TAutoServer/tevent_captureapp.mmp
windowing/windowserver/test/scripts/wstest_config.cmd
windowing/windowserver/test/scripts/wstest_t_devicerotation_s0_nga.script
windowing/windowserver/test/t_genericplugin/group/bld.inf
windowing/windowserver/test/t_genericplugin/rom/t_wservgenericplugin.iby
windowing/windowserver/test/t_ratelimiter/group/bld.inf
windowing/windowserver/test/t_ratelimiter/rom/t_ratelimiter.iby
windowing/windowserver/test/tauto/TCapKey.CPP
windowing/windowserver/test/tauto/TCapKey.H
windowing/windowserver/test/tauto/TEVENT.H
windowing/windowserver/test/tauto/TEvent.CPP
windowing/windowserver/test/tauto/TOOM.CPP
windowing/windowserver/test/tauto/TOOM.H
windowing/windowserver/test/tauto/talphawin.cpp
windowing/windowserver/test/tauto/tdevicerotation.cpp
windowing/windowserver/test/tauto/tdevicerotation.h
windowing/windowserver/test/tauto/tevent_captureapp.cpp
windowing/windowserver/test/tauto/tgc.cpp
windowing/windowserver/test/tauto/themeserverpropertydefine.cpp
windowing/windowserver/test/tauto/themeserverpropertydefine.h
windowing/windowserver/test/tdynamicres/group/bld.inf
windowing/windowserver/test/tdynamicres/group/wstestdynamicres.iby
windowing/windowserver/test/tdynamicres/group/wstestdynamicres_helium.pkg
windowing/windowserver/test/tdynamicres/inc/wsdynamicresbase.h
windowing/windowserver/test/tdynamicres/scripts/wsdynamicresbasic_sirocco.script
windowing/windowserver/test/tdynamicres/src/t_wsdynamicreswinbase.cpp
windowing/windowserver/test/tdynamicres/src/wsdynamicresbase.cpp
windowing/windowserver/test/tdynamicres/src/wsdynamicresbasic.cpp
windowing/windowserver/tframerate/framerate.RSS
windowing/windowserver/tframerate/framerate.cpp
windowing/windowserver/tframerate/framerate.h
windowing/windowserver/tframerate/proxy.cpp
windowing/windowserver/tframerate/wsframerate.cpp
windowing/windowserver/tframerate/wsframerate.h
windowing/windowserver/tframerate/wsgraphicdrawercontext.h
windowing/windowserver/tframerate/wsgraphicdrawerngacontext.cpp
windowing/windowserver/tframerate/wsgraphicdrawernonngacontext.cpp
windowing/windowserver/tlib/TESTBASE.CPP
windowing/windowserver/tlib/TLDIALOG.CPP
windowing/windowserver/tlib/TLEVENT.CPP
windowing/windowserver/tlib/TLIB.H
windowing/windowserver/tlib/TLSPRITE.CPP
windowing/windowserver/tlib/testbase.h
windowing/windowserver/tlisten/listener.cpp
windowing/windowserver/tlisten/listener.h
windowing/windowserver/tlisten/listener.rss
windowing/windowserver/tlisten/proxy.cpp
windowing/windowserver/tlisten/wsgraphicdrawercontext.h
windowing/windowserver/tlisten/wsgraphicdrawerngacontext.cpp
windowing/windowserver/tlisten/wsgraphicdrawernonngacontext.cpp
windowing/windowserver/tlisten/wslisten.cpp
windowing/windowserver/tlisten/wslisten.h
windowing/windowserver/tman/DUMMYM.CPP
windowing/windowserver/tman/HOTKEY2.CPP
windowing/windowserver/tman/MULTICON.CPP
windowing/windowserver/tman/SCALE.CPP
windowing/windowserver/tman/TKREPEAT.CPP
windowing/windowserver/tman/TMAN.CPP
windowing/windowserver/tman/TMAN.H
windowing/windowserver/tman/TMCAPKEY.CPP
windowing/windowserver/tman/TMMODCHG.CPP
windowing/windowserver/tman/TMPNTBUF.CPP
windowing/windowserver/tman/TMPNTCAP.CPP
windowing/windowserver/tman/TMPNTCUR.CPP
windowing/windowserver/tman/TMPNTKEY.CPP
windowing/windowserver/tman/TMPOINTR.CPP
windowing/windowserver/tman/TMSCRMOD.CPP
windowing/windowserver/tman/TMTScrMd.CPP
windowing/windowserver/tman/TPASSWRD.CPP
windowing/windowserver/tman/TTEXT.CPP
windowing/windowserver/tredir/proxy.cpp
windowing/windowserver/tredir/redirector.cpp
windowing/windowserver/tredir/redirector.h
windowing/windowserver/tredir/redirector.rss
windowing/windowserver/tredir/wsredir.cpp
windowing/windowserver/tredir/wsredir.h
windowing/windowserver/ttime/TTDRWBIT.CPP
windowing/windowserver/ttime/TTGENRAL.CPP
windowing/windowserver/ttime/TTGRAPH.CPP
windowing/windowserver/ttime/TTIME.CPP
windowing/windowserver/ttime/TTIME.H
windowing/windowserver/ttime/TTMOVWIN.CPP
windowing/windowserver/ttime/TTTEXT.CPP
windowing/windowserver/twsgraphic/TWsGraphicShareTest.CPP
windowing/windowserver/twsgraphic/TWsGraphicTest.CPP
windowing/windowserver/wins_switching/ws32_stubs.h
windowing/windowserverplugins/group/bld.inf
windowing/windowserverplugins/keyeventrouting/bwins/keyrouteru.def
windowing/windowserverplugins/keyeventrouting/eabi/keyrouteru.def
windowing/windowserverplugins/keyeventrouting/group/bld.inf
windowing/windowserverplugins/keyeventrouting/group/keyeventrouting.iby
windowing/windowserverplugins/keyeventrouting/group/keyeventrouting.mmp
windowing/windowserverplugins/keyeventrouting/group/keyeventrouting_test.iby
windowing/windowserverplugins/keyeventrouting/group/keyeventrouting_test.mmp
windowing/windowserverplugins/keyeventrouting/src/keyaliases.h
windowing/windowserverplugins/keyeventrouting/src/keyrouter.cpp
windowing/windowserverplugins/keyeventrouting/src/keyrouterimpl.h
windowing/windowserverplugins/openwfc/group/stdplugin.mmp
windowing/windowserverplugins/openwfc/group/wserv_std_plugins.iby
windowing/windowserverplugins/openwfc/src/displayrenderstage.cpp
windowing/windowserverplugins/openwfc/src/fbrenderstage.cpp
--- a/egl/eglinterface/include/1.4/eglext.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/egl/eglinterface/include/1.4/eglext.h	Fri Jul 16 11:45:55 2010 +0300
@@ -263,17 +263,17 @@
 EGLAPI EGLBoolean EGLAPIENTRY eglEndpointCancelNotificationNOK(EGLDisplay dpy, EGLEndpointNOK endpoint);
 #endif
 
-typedef EGLEndpointNOK ( *PFNEGLCREATEENDPOINTNOKPROC) (EGLDisplay dpy, EGLenum type, EGLenum source_type, EGLEndpointSourceNOK source, const EGLint* attrib_list);
-typedef EGLBoolean ( *PFNEGLDESTROYENDPOINTNOKPROC) (EGLDisplay dpy, EGLEndpointNOK endpoint);
-typedef EGLint ( *PFNEGLGETENDPOINTATTRIBNOKPROC) (EGLDisplay dpy, EGLEndpointNOK endpoint, EGLint attrib);
-typedef EGLBoolean ( *PFNEGLSETENDPOINTATTRIBNOKPROC) (EGLDisplay dpy, EGLEndpointNOK endpoint, EGLint attrib, EGLint value);
-typedef EGLBoolean ( *PFNEGLENDPOINTBEGINSTREAMINGNOKPROC) (EGLDisplay dpy, EGLEndpointNOK endpoint);
-typedef EGLBoolean ( *PFNEGLENDPOINTENDSTREAMINGNOKPROC) (EGLDisplay dpy, EGLEndpointNOK endpoint);
-typedef EGLImageKHR  ( *PFNEGLACQUIREIMAGENOKPROC)(EGLDisplay dpy, EGLEndpointNOK endpoint);
-typedef EGLBoolean ( *PFNEGLRELEASEIMAGENOKPROC) (EGLDisplay dpy, EGLEndpointNOK endpoint, EGLImageKHR image, EGLenum api);
-typedef EGLint ( *PFNEGLGETENDPOINTDIRTYAREANOKPROC) (EGLDisplay dpy,  EGLEndpointNOK endpoint, EGLint* rects, EGLint start_rect, EGLint max_rects,  EGLBoolean collapse); 
-typedef EGLBoolean ( *PFNEGLENDPOINTREQUESTNOTIFICATIONNOKPROC) (EGLDisplay dpy, EGLEndpointNOK endpoint, EGLTRequestStatusNOK sync);
-typedef EGLBoolean ( *PFNEGLENDPOINTCANCELNOTIFICATIONNOKPROC) (EGLDisplay dpy, EGLEndpointNOK endpoint);
+typedef EGLEndpointNOK (EGLAPIENTRYP PFNEGLCREATEENDPOINTNOKPROC) (EGLDisplay dpy, EGLenum type, EGLenum source_type, EGLEndpointSourceNOK source, const EGLint* attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYENDPOINTNOKPROC) (EGLDisplay dpy, EGLEndpointNOK endpoint);
+typedef EGLint (EGLAPIENTRYP PFNEGLGETENDPOINTATTRIBNOKPROC) (EGLDisplay dpy, EGLEndpointNOK endpoint, EGLint attrib);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETENDPOINTATTRIBNOKPROC) (EGLDisplay dpy, EGLEndpointNOK endpoint, EGLint attrib, EGLint value);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLENDPOINTBEGINSTREAMINGNOKPROC) (EGLDisplay dpy, EGLEndpointNOK endpoint);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLENDPOINTENDSTREAMINGNOKPROC) (EGLDisplay dpy, EGLEndpointNOK endpoint);
+typedef EGLImageKHR  (EGLAPIENTRYP PFNEGLACQUIREIMAGENOKPROC)(EGLDisplay dpy, EGLEndpointNOK endpoint);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLRELEASEIMAGENOKPROC) (EGLDisplay dpy, EGLEndpointNOK endpoint, EGLImageKHR image, EGLenum api);
+typedef EGLint (EGLAPIENTRYP PFNEGLGETENDPOINTDIRTYAREANOKPROC) (EGLDisplay dpy,  EGLEndpointNOK endpoint, EGLint* rects, EGLint start_rect, EGLint max_rects,  EGLBoolean collapse); 
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLENDPOINTREQUESTNOTIFICATIONNOKPROC) (EGLDisplay dpy, EGLEndpointNOK endpoint, EGLTRequestStatusNOK sync);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLENDPOINTCANCELNOTIFICATIONNOKPROC) (EGLDisplay dpy, EGLEndpointNOK endpoint);
 #endif
 
 #ifndef EGL_SYMBIAN_COMPOSITION
--- a/egl/eglrefimpl/group/egl_ref.iby	Tue Jun 22 15:21:29 2010 +0300
+++ b/egl/eglrefimpl/group/egl_ref.iby	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -16,6 +16,6 @@
 #ifndef EGL_REF_IBY
 #define EGL_REF_IBY
 
-file=ABI_DIR\DEBUG_DIR\libegl_ref.dll	\sys\bin\libEGL.dll
+file=ABI_DIR\BUILD_DIR\libegl_ref.dll	\sys\bin\libEGL.dll
 
 #endif
--- a/egl/egltest/group/egltest_helium.pkg	Tue Jun 22 15:21:29 2010 +0300
+++ b/egl/egltest/group/egltest_helium.pkg	Fri Jul 16 11:45:55 2010 +0300
@@ -49,4 +49,6 @@
 "\epoc32\data\z\egltest\egltest_t_image_negative.script"-"c:\egltest\egltest_t_image_negative.script"
 "\epoc32\data\z\egltest\egltest_t_benchmark_sgimage.script"-"c:\egltest\egltest_t_benchmark_sgimage.script"
 "\epoc32\data\z\egltest\egltest_t_benchmark_swapbuffers.script"-"c:\egltest\egltest_t_benchmark_swapbuffers.script"
+"\epoc32\data\z\egltest\egltest_t_oom_sgimage.script"-"c:\egltest\egltest_t_oom_sgimage.script"
+"\epoc32\data\z\egltest\egltest_t_stress_sgimage.script"-"c:\egltest\egltest_t_stress_sgimage.script"
 
--- a/egl/egltest/inc/egltest_oom_sgimage.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/egl/egltest/inc/egltest_oom_sgimage.h	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -122,4 +122,24 @@
     void doProcessFunctionL(TInt aIdx);
    };
 
+_LIT(KOOM_CloseSgImageDifferentProcess, "OOM_CloseSgImageDifferentProcess");
+NONSHARABLE_CLASS(CEglTest_OOM_CloseSgImageDifferentProcess) : public CEglTest_OOM_Base
+    {
+public:
+    // from CTestStep
+    TVerdict doTestStepL();
+    
+protected:
+    // from CEglTestStep
+    void doProcessFunctionL(TInt aIdx);
+   };
+
+_LIT(KOOM_CloseSgImageSameThread, "OOM_CloseSgImageSameThread");
+NONSHARABLE_CLASS(CEglTest_OOM_CloseSgImageSameThread) : public CEglTest_OOM_Base
+    {
+public:
+    // from CTestStep
+    TVerdict doTestStepL();
+    };
+
 #endif // __EGLTEST_OOM_SGIMAGE_H__
--- a/egl/egltest/scripts/egltest_t_oom_sgimage.script	Tue Jun 22 15:21:29 2010 +0300
+++ b/egl/egltest/scripts/egltest_t_oom_sgimage.script	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -22,3 +22,5 @@
 RUN_TEST_STEP 400 egltestserver OOM_CloseVGImage
 RUN_TEST_STEP 400 egltestserver OOM_ClosePixmapSurfaceWithTermination
 RUN_TEST_STEP 400 egltestserver OOM_ClosePixmapSurface
+RUN_TEST_STEP 400 egltestserver OOM_CloseSgImageSameThread
+RUN_TEST_STEP 400 egltestserver OOM_CloseSgImageDifferentProcess
--- a/egl/egltest/src/egltest_image.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/egl/egltest/src/egltest_image.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -146,6 +146,7 @@
 	address += (bitmapSize.iHeight - 1) * stride;
 	vgWritePixels(address, -stride, KDefaultSurfaceFormat,0,0, bitmapSize.iWidth, bitmapSize.iHeight);
 	ASSERT_TRUE(vgGetError()==VG_NO_ERROR);
+	eglWaitClient();   // wait for writing to finish
    	ASSERT_EGL_TRUE(eglDestroySurface(iDisplay, surface));				//Destroying Surface handle
 
 	INFO_PRINTF1(_L("Create a EGLImage out of the SgImage"));
--- a/egl/egltest/src/egltest_image_multiprocess.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/egl/egltest/src/egltest_image_multiprocess.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -1468,6 +1468,7 @@
     	TInt stride = bitmap->DataStride();
     	address += (bitmapSize.iHeight - 1) * stride;
     	vgWritePixels(address, -stride, iSurfaceFormat, 0,0, bitmapSize.iWidth, bitmapSize.iHeight);
+   	    eglWaitClient();   // wait for writing to finish
 		delete bitmap;
 		bitmap = NULL;
 		ASSERT_TRUE(vgGetError()==VG_NO_ERROR);
--- a/egl/egltest/src/egltest_oom_sgimage.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/egl/egltest/src/egltest_oom_sgimage.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -34,6 +34,9 @@
 //There is no need to put it into INI file
 const TUidPixelFormat KOOMPixelFormat = EUidPixelFormatARGB_8888; 
 
+// Deviation in per cent for test 0442 and 0443
+const TInt KOOMSgImageDeviation = 5; 
+
 
 CEglTest_OOM_Base::~CEglTest_OOM_Base()
     {
@@ -192,14 +195,14 @@
     if(iGPUUsedMemory.Count() > 0)
         {
         res = Deviation(iGPUUsedMemory);
-        TEST(iThresholdGPUUsedMemory >= res);
+        ASSERT_TRUE(iThresholdGPUUsedMemory >= res);
         INFO_PRINTF3(_L("GPU used memory deviation %d %%, threshold %d %%"), res, iThresholdGPUUsedMemory);
         }
     
     if(iLastIterations.Count() > 0)
         {
         res = Deviation(iLastIterations);
-        TEST(iThresholdLastIteration >= res);
+        ASSERT_TRUE(iThresholdLastIteration >= res);
         INFO_PRINTF3(_L("Last iteration deviation %d %%, threshold %d %%"), res, iThresholdLastIteration);
         }
     }
@@ -445,7 +448,7 @@
             if(res != KErrNone || sgImage.IsNull())
                 {
                 INFO_PRINTF5(_L("***Fail to create RSgImage after %d attempts, error: %d, expected %d or %d"), index, res, KErrNoMemory, KErrNoGraphicsMemory);
-                TEST((res == KErrNoMemory) || (res == KErrNoGraphicsMemory));
+                ASSERT_TRUE((res == KErrNoMemory) || (res == KErrNoGraphicsMemory));
                 break;
                 }
             EGLImageKHR eglImages = iEglSess->eglCreateImageKhrL(iDisplay,EGL_NO_CONTEXT,EGL_NATIVE_PIXMAP_KHR,&sgImage,const_cast<EGLint *> (KEglImageAttribsPreservedTrue));
@@ -453,7 +456,7 @@
             if((eglImages == EGL_NO_IMAGE_KHR) || (eglError != EGL_SUCCESS))
                 {
                 INFO_PRINTF4(_L("***Fail to create EGLImage after %d attempts, error: %d, expected: %d"), index, eglError, EGL_BAD_ALLOC);
-                TEST(eglError == EGL_BAD_ALLOC);
+                ASSERT_TRUE(eglError == EGL_BAD_ALLOC);
                 break;
                 }
 
@@ -462,7 +465,7 @@
             if(vgImage == VG_INVALID_HANDLE || (vgError != VG_NO_ERROR))
                 {
                 INFO_PRINTF4(_L("***Fail to create VGImage after %d attempts, error: %d, expected: %d"), index, vgError, VG_OUT_OF_MEMORY_ERROR);
-                TEST(vgError == VG_OUT_OF_MEMORY_ERROR);
+                ASSERT_TRUE(vgError == VG_OUT_OF_MEMORY_ERROR);
                 break;
                 }
             } //for
@@ -491,7 +494,7 @@
         CleanupStack::PopAndDestroy(&messageQueueProcId);
 
         RProcess process;
-        TESTL(process.Open(procId) == KErrNone);
+        ASSERT_TRUE(process.Open(procId) == KErrNone);
         process.Kill(KErrNone);
         process.Close();
         
@@ -598,7 +601,7 @@
 
 void CEglTest_OOM_CloseVGImage::doProcessFunctionL(TInt aIdx)
     {
-    INFO_PRINTF2(_L("CEglTest_OOM_CloseVGImageWithTermination::doProcessFunctionL, Process %d"),aIdx);
+    INFO_PRINTF2(_L("CEglTest_OOM_CloseVGImage::doProcessFunctionL, Process %d"),aIdx);
 #ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
     GetDisplayL();
     CreateEglSessionL(aIdx);
@@ -625,7 +628,7 @@
         if(res != KErrNone || sgImage.IsNull())
             {
             INFO_PRINTF5(_L("***Fail to create RSgImage after %d attempts, error: %d, expected: %d or %d"), index, res, KErrNoMemory, KErrNoGraphicsMemory);
-            TEST((res == KErrNoMemory) || (res == KErrNoGraphicsMemory));
+            ASSERT_TRUE((res == KErrNoMemory) || (res == KErrNoGraphicsMemory));
             break;
             }
         iSgImages.AppendL(sgImage);
@@ -635,7 +638,7 @@
         if((eglImage == EGL_NO_IMAGE_KHR) || (eglError != EGL_SUCCESS))
             {
             INFO_PRINTF4(_L("***Fail to create EGLImage after %d attempts, error: %d, expected: %d"), index, eglError, EGL_BAD_ALLOC);
-            TEST(eglError == EGL_BAD_ALLOC);
+            ASSERT_TRUE(eglError == EGL_BAD_ALLOC);
             break;
             }
         iEglImages.AppendL(eglImage);
@@ -645,7 +648,7 @@
         if(vgImage == VG_INVALID_HANDLE || (vgError != VG_NO_ERROR))
             {
             INFO_PRINTF4(_L("***Fail to create VGImage after %d attempts, error: %d, expected: %d"), index, vgError, VG_OUT_OF_MEMORY_ERROR);
-            TEST(vgError == VG_OUT_OF_MEMORY_ERROR);
+            ASSERT_TRUE(vgError == VG_OUT_OF_MEMORY_ERROR);
             break;
             }
         iVgImages.AppendL(vgImage);
@@ -777,7 +780,7 @@
             if(res != KErrNone || sgImage.IsNull())
                 {
                 INFO_PRINTF5(_L("***Fail to create RSgImage after %d attempts, error: %d, expected: %d or %d"), index, res, KErrNoMemory, KErrNoGraphicsMemory);
-                TEST((res == KErrNoMemory) || (res == KErrNoGraphicsMemory));
+                ASSERT_TRUE((res == KErrNoMemory) || (res == KErrNoGraphicsMemory));
                 break;
                 }
             
@@ -797,7 +800,7 @@
             if((surface == EGL_NO_SURFACE) || (eglError != EGL_SUCCESS))
                 {
                 INFO_PRINTF4(_L("***Fail to create Pixmap surface after %d attempts, error: %d, expected: %d"), index, eglError, EGL_BAD_ALLOC);
-                TEST(eglError == EGL_BAD_ALLOC);
+                ASSERT_TRUE(eglError == EGL_BAD_ALLOC);
                 break;
                 }            
             } //for
@@ -826,7 +829,7 @@
         CleanupStack::PopAndDestroy(&messageQueueProcId);
 
         RProcess process;
-        TESTL(process.Open(procId) == KErrNone);
+        ASSERT_TRUE(process.Open(procId) == KErrNone);
         process.Kill(KErrNone);
 		process.Close();
 
@@ -946,7 +949,7 @@
         if(res != KErrNone || sgImage.IsNull())
             {
             INFO_PRINTF5(_L("***Fail to create RSgImage after %d attempts, error: %d, expected: %d or %d"), index, res, KErrNoMemory, KErrNoGraphicsMemory);
-            TEST((res == KErrNoMemory) || (res == KErrNoGraphicsMemory));
+            ASSERT_TRUE((res == KErrNoMemory) || (res == KErrNoGraphicsMemory));
             break;
             }
         iSgImages.AppendL(sgImage);
@@ -967,7 +970,7 @@
         if((surface == EGL_NO_SURFACE) || (eglError != EGL_SUCCESS))
             {
             INFO_PRINTF4(_L("***Fail to create Pixmap surface after %d attempts, error: %d, expected: %d "), index, eglError, EGL_BAD_ALLOC);
-            TEST(eglError == EGL_BAD_ALLOC);
+            ASSERT_TRUE(eglError == EGL_BAD_ALLOC);
             break;
             }       
         iSurfaces.AppendL(surface);
@@ -980,3 +983,353 @@
 #endif    
     }    
 
+/**
+@SYMTestCaseID GRAPHICS-EGL-0442
+
+@SYMTestPriority 1
+
+@SYMPREQ 2637
+
+@SYMTestCaseDesc
+    OOM test – Check SgImages are removed when SgImage handles in multiple processes are closed
+
+@SYMTestActions
+Environmental settings:
+•   Image Size: as per ini file
+•   List of simulated load: 0%
+•   List of pixel formats
+ESgPixelFormatARGB_8888
+•   Client process priorities - all the same
+•   Client process random parameters:
+-   None
+
+The creation of RSgImages and launching of processes is along the lines of the method outlined in GRAPHICS-EGL-RSGIMAGE_LITE-0406
+
+    From the main process:
+        Spawn 2 client processes A and B.
+        Wait until client processes exit
+    If the test fails not due to the memory allocation record an error code to the log file then set a test result as a failure and skip further actions.
+    End loop
+    Exit
+
+    From client process A:
+    Get EGL display
+    Initialize EGL
+    Open RSgDriver
+    Loop until exit condition met
+    Start loop:
+        Create SgImage
+        Exit condition – SgImage surface creation has failed.
+    End loop:
+    Make the process busy by putting it into the indefinite loop.
+    
+    From client process B:
+    Start loop:
+        Open SgImage
+        Close SgImage
+    End loop:
+
+    From client process A:
+    Start loop:
+        Close SgImage
+    End loop:
+    Check all memory has been deallocated by starting a second loop
+        Start loop 2:
+            Create SgImage
+            Exit condition – SgImage surface creation has failed.
+        End loop:
+    Check that the amount of images created within this loop 2 is similar to loop 1,
+    meaning that all images were correctly freed.
+    Cleanup everything
+    
+    Terminate process A
+    Terminate process B
+    
+@SYMTestExpectedResults
+For each step from 0 to N in the main process, 
+-   Image or surface allocation failure must happen at approximately the same iteration 
+    in process A.  
+*/
+TVerdict CEglTest_OOM_CloseSgImageDifferentProcess::doTestStepL()
+    {
+    SetTestStepID(_L("GRAPHICS-EGL-0442"));
+    SetTestStepName(KOOM_CloseSgImageDifferentProcess);
+    INFO_PRINTF1(_L("CEglTest_OOM_CloseSgImageDifferentProcess::doTestStepL"));
+
+#ifndef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
+    INFO_PRINTF1(_L("CEglTest_OOM_CloseSgImageDifferentProcess can only be run with SgImage-Lite"));
+#else
+    TBool ret = CheckForExtensionL(KEGL_RSgimage | KEGL_KHR_image_base | KVG_KHR_EGL_image | KEGL_KHR_image_pixmap);
+    if(ret)
+        {
+        // launch 2 processes
+        Test_MultiProcessL(KEglTestStepDllName, 2, TestStepName());
+        }
+    INFO_PRINTF1(_L("Exit: CEglTest_OOM_CloseSgImageDifferentProcess::doTestStepL"));
+#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
+    RecordTestResultL();
+    CloseTMSGraphicsStep();
+    return TestStepResult();
+    }
+
+void CEglTest_OOM_CloseSgImageDifferentProcess::doProcessFunctionL(TInt aIdx)
+    {
+    INFO_PRINTF2(_L("CEglTest_OOM_CloseSgImageDifferentProcess::doProcessFunctionL, Process %d"),aIdx);
+#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
+
+    GetDisplayL();
+    CreateEglSessionL(aIdx);
+    iEglSess->InitializeL();
+    iEglSess->OpenSgDriverL();
+
+    //create the queue to send/receive SgImage ID between processes
+    RMsgQueue<TSgDrawableId> messageQueueSgId;
+    User::LeaveIfError(messageQueueSgId.Open(EProcSlotMsgQueueSgId, EOwnerProcess));
+    CleanupClosePushL(messageQueueSgId);
+
+    // create as many sgimages until it reaches out of memory
+    TInt numImages = 0;
+    if(aIdx == 0)
+        {
+        for(;;++numImages)
+            {
+            RSgImage sgImage;
+            TInt res = sgImage.Create(TSgImageInfo(iImageSize, KOOMPixelFormat, ESgUsageBitOpenVgImage));
+            if(res != KErrNone || sgImage.IsNull())
+                {
+                INFO_PRINTF5(_L("***Fail to create RSgImage after %d attempts, error: %d, expected: %d or %d"), numImages, res, KErrNoMemory, KErrNoGraphicsMemory);
+                ASSERT_TRUE((res == KErrNoMemory) || (res == KErrNoGraphicsMemory));
+                break;
+                }
+            iSgImages.AppendL(sgImage);
+            }
+        }
+    
+    // Send to process B how many images it needs to wait for
+    if(aIdx == 0)
+        {
+       // send a TInt as a  fake SgImage Id
+        messageQueueSgId.SendBlocking(reinterpret_cast<TSgDrawableId&>(numImages));
+        }
+    else if (aIdx == 1)
+        {
+        // receive the fake SgImage Id and convert it to a TInt
+        TSgDrawableId fakeId;
+        messageQueueSgId.ReceiveBlocking(fakeId);
+        numImages = reinterpret_cast<TInt&>(fakeId);
+        }
+    
+    // Wait for both processes to reach this point
+    Rendezvous(aIdx);
+    
+    // Now process B knows how many images needs to wait for
+    if(aIdx == 0)
+        {
+        for(TInt index = 0; index<numImages; ++index)
+            {
+            // send Id to other process
+            messageQueueSgId.SendBlocking(iSgImages[index].Id());
+            }
+        }
+    else if(aIdx == 1)
+        {
+        for(TInt index = 0; index<numImages; ++index)
+            {
+            // receive Id from other process
+            TSgDrawableId sgImageId;
+            messageQueueSgId.ReceiveBlocking(sgImageId);
+            
+            // open sgImage with received Id
+            RSgImage sgImage;
+            ASSERT_EQUALS(sgImage.Open(sgImageId), KErrNone);
+
+            // close SgImage just created
+            sgImage.Close();
+            }
+        }
+
+    // Wait for both processes to reach this point
+    Rendezvous(aIdx);
+
+    // delete all sgImages created in first process
+    if(aIdx == 0)
+        {
+        CleanGraphicsResources();
+        }
+
+    // create (again) as many sgimages until it reaches out of memory
+    // note that process B needs to be alive (hence the Rendezvous further down)
+    if(aIdx == 0)
+        {
+        TInt numImages2 = 0;
+        for(;;++numImages2)
+            {
+            RSgImage sgImage;
+            TInt res = sgImage.Create(TSgImageInfo(iImageSize, KOOMPixelFormat, ESgUsageBitOpenVgImage));
+            if(res != KErrNone || sgImage.IsNull())
+                {
+                INFO_PRINTF5(_L("***Fail to create RSgImage after %d attempts, error: %d, expected: %d or %d"), numImages2, res, KErrNoMemory, KErrNoGraphicsMemory);
+                ASSERT_TRUE((res == KErrNoMemory) || (res == KErrNoGraphicsMemory));
+                break;
+                }
+            iSgImages.AppendL(sgImage);
+            }
+        // clean up these images, we don't really need them
+        CleanGraphicsResources();
+        
+        // check numbers...
+        INFO_PRINTF2(_L("***Num sgImages created first time: %d."), numImages);
+        INFO_PRINTF2(_L("***Num sgImages created second time: %d."), numImages2);
+        TInt deviation = Abs(((numImages2*100) / numImages) - 100);
+        ASSERT_TRUE(deviation < KOOMSgImageDeviation);
+        INFO_PRINTF3(_L("***Deviation: %d%% (must be less than %d%%)"), deviation, KOOMSgImageDeviation);
+
+        // This test does not need to send anything, but since OOM test framework expects something
+        // we can send a fake index so that the test is not waiting for it forever.
+        const TInt KTestNotUsedData = 0;
+        SendIndexToMainProcessL(KTestNotUsedData); 
+        }
+
+    // Wait for both processes to reach this point
+    Rendezvous(aIdx);
+
+    //now clean everything
+    CleanupStack::PopAndDestroy(&messageQueueSgId);
+    CleanGraphicsResources();
+    iEglSess->CloseSgDriver();
+    CleanAll();
+#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
+    }
+
+/**
+@SYMTestCaseID GRAPHICS-EGL-0443
+
+@SYMTestPriority 1
+
+@SYMPREQ 2637
+
+@SYMTestCaseDesc
+    OOM test – Check SgImages are removed when SgImage handles in multiple processes are closed
+
+@SYMTestActions
+Environmental settings:
+•   Image Size: as per ini file
+•   List of simulated load: 0%
+•   List of pixel formats
+ESgPixelFormatARGB_8888
+•   Client process priorities - all the same
+•   Client process random parameters:
+-   None
+
+The creation of RSgImages and launching of processes is along the lines of the method outlined in GRAPHICS-EGL-RSGIMAGE_LITE-0406
+
+    From the main process:
+    From client process A:
+    Get EGL display
+    Initialize EGL
+    Open RSgDriver
+    Loop until exit condition met
+    Start loop:
+        Create SgImage
+        Exit condition – SgImage surface creation has failed.
+    End loop:
+    Start loop:
+        Open SgImage
+        Close SgImage
+    End loop:
+    Start loop:
+        Close SgImage
+    End loop:
+    Check all memory has been deallocated by starting a second loop
+        Start loop 2:
+            Create SgImage
+            Exit condition – SgImage surface creation has failed.
+        End loop:
+    Check that the amount of images created within this loop 2 is similar to loop 1,
+    meaning that all images were correctly freed.
+    Cleanup everything
+    
+@SYMTestExpectedResults
+For each step from 0 to N in the main process, 
+-   Image or surface allocation failure must happen at approximately the same iteration 
+    in process A.  
+*/
+TVerdict CEglTest_OOM_CloseSgImageSameThread::doTestStepL()
+    {
+    SetTestStepID(_L("GRAPHICS-EGL-0443"));
+    SetTestStepName(KOOM_CloseSgImageSameThread);
+    INFO_PRINTF1(_L("CEglTest_OOM_CloseSgImageSameThread::doTestStepL"));
+
+#ifndef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
+    INFO_PRINTF1(_L("CEglTest_OOM_CloseSgImageSameThread can only be run with SgImage-Lite"));
+#else
+    TBool ret = CheckForExtensionL(KEGL_RSgimage | KEGL_KHR_image_base | KVG_KHR_EGL_image | KEGL_KHR_image_pixmap);
+    if(ret)
+        {
+        GetDisplayL();
+        CreateEglSessionL(0);
+        iEglSess->InitializeL();
+        iEglSess->OpenSgDriverL();
+    
+        // create as many sgimages until it reaches out of memory
+        TInt numImages = 0;
+        for(;;++numImages)
+            {
+            RSgImage sgImage;
+            TInt res = sgImage.Create(TSgImageInfo(iImageSize, KOOMPixelFormat, ESgUsageBitOpenVgImage));
+            if(res != KErrNone || sgImage.IsNull())
+                {
+                INFO_PRINTF5(_L("***Fail to create RSgImage after %d attempts, error: %d, expected: %d or %d"), numImages, res, KErrNoMemory, KErrNoGraphicsMemory);
+                ASSERT_TRUE((res == KErrNoMemory) || (res == KErrNoGraphicsMemory));
+                break;
+                }
+            iSgImages.AppendL(sgImage);
+            }
+
+        //open a duplicate handle for the created images (can close straightaway)
+        for(TInt index = 0; index<numImages; ++index)
+            {
+            RSgImage sgImage;
+            ASSERT_EQUALS(sgImage.Open(iSgImages[index].Id()), KErrNone);
+            // close SgImage just created
+            sgImage.Close();
+            }
+
+        // clean up all (original) images
+        CleanGraphicsResources();
+
+        // create (again) as many sgimages until it reaches out of memory
+        TInt numImages2 = 0;
+        for(;;++numImages2)
+            {
+            RSgImage sgImage;
+            TInt res = sgImage.Create(TSgImageInfo(iImageSize, KOOMPixelFormat, ESgUsageBitOpenVgImage));
+            if(res != KErrNone || sgImage.IsNull())
+                {
+                INFO_PRINTF5(_L("***Fail to create RSgImage after %d attempts, error: %d, expected: %d or %d"), numImages2, res, KErrNoMemory, KErrNoGraphicsMemory);
+                ASSERT_TRUE((res == KErrNoMemory) || (res == KErrNoGraphicsMemory));
+                break;
+                }
+            iSgImages.AppendL(sgImage);
+            }
+            
+        // clean up everything now
+        CleanGraphicsResources();
+        iEglSess->CloseSgDriver();
+        CleanAll();
+
+        // check numbers...
+        INFO_PRINTF2(_L("***Num sgImages created first time: %d."), numImages);
+        INFO_PRINTF2(_L("***Num sgImages created second time: %d."), numImages2);
+        TInt deviation = Abs(((numImages2*100) / numImages) - 100);
+        ASSERT_TRUE(deviation < KOOMSgImageDeviation);
+        INFO_PRINTF3(_L("***Deviation: %d%% (must be less than %d%%)"), deviation, KOOMSgImageDeviation);
+        }
+    INFO_PRINTF1(_L("Exit: CEglTest_OOM_CloseSgImageSameThread::doTestStepL"));
+#endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
+
+    RecordTestResultL();
+    CloseTMSGraphicsStep();
+    return TestStepResult();
+    }
+
--- a/egl/egltest/src/eglteststep.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/egl/egltest/src/eglteststep.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -160,13 +160,15 @@
 	// Benchmark - SwapBuffers
     else if (aStepName == KBenchmark_SwapBuffers)                                                   testStep = new CEglTest_Benchmark_SwapBuffers;
 
-	//OOM
+	//OOM - SgImage
     else if (aStepName == KOOM_CloseVGImageWithTermination)                                         testStep = new CEglTest_OOM_CloseVGImageWithTermination;
     else if (aStepName == KOOM_CloseVGImage)                                                        testStep = new CEglTest_OOM_CloseVGImage;
     else if (aStepName == KOOM_ClosePixmapSurfaceWithTermination)                                   testStep = new CEglTest_OOM_ClosePixmapSurfaceWithTermination;
-    else if (aStepName == KOOM_ClosePixmapSurface)                                                  testStep = new CEglTest_OOM_ClosePixmapSurface;	
+    else if (aStepName == KOOM_ClosePixmapSurface)                                                  testStep = new CEglTest_OOM_ClosePixmapSurface; 
+    else if (aStepName == KOOM_CloseSgImageDifferentProcess)                                        testStep = new CEglTest_OOM_CloseSgImageDifferentProcess; 
+    else if (aStepName == KOOM_CloseSgImageSameThread)                                              testStep = new CEglTest_OOM_CloseSgImageSameThread; 
 
-    //Stress
+    //Stress - SgImage
     else if (aStepName == KStress)                                                                  testStep = new CEglTest_Stress;
 
 	return testStep;
--- a/fbs/fontandbitmapserver/bwins/FBSCLI2U.DEF	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/bwins/FBSCLI2U.DEF	Fri Jul 16 11:45:55 2010 +0300
@@ -229,4 +229,19 @@
 	?CreateExtendedBitmap@CFbsBitmap@@QAEHABVTSize@@W4TDisplayMode@@VTUid@@PBXH@Z @ 228 NONAME ; int CFbsBitmap::CreateExtendedBitmap(class TSize const &, enum TDisplayMode, class TUid, void const *, int)
 	?UpdateLinkedTypeface@CFbsTypefaceStore@@QAEHABVCLinkedTypefaceSpecification@@@Z @ 229 NONAME ; int CFbsTypefaceStore::UpdateLinkedTypeface(class CLinkedTypefaceSpecification const &)
 	?GetExtraBuffer@CFbsBitmap@@SAPAVHBufC8@@H@Z @ 230 NONAME ; class HBufC8 * CFbsBitmap::GetExtraBuffer(int)
+	?Rect@RFbsGlyphDataIterator@@QBEABVTRect@@XZ @ 231 NONAME ; class TRect const & RFbsGlyphDataIterator::Rect(void) const
+	?Image@RFbsGlyphDataIterator@@QBEABVRSgImage@@XZ @ 232 NONAME ; class RSgImage const & RFbsGlyphDataIterator::Image(void) const
+	??0RFbsGlyphMetricsArray@@QAE@XZ @ 233 NONAME ; RFbsGlyphMetricsArray::RFbsGlyphMetricsArray(void)
+	?Count@RFbsGlyphMetricsArray@@QBEHXZ @ 234 NONAME ; int RFbsGlyphMetricsArray::Count(void) const
+	?Next@RFbsGlyphDataIterator@@QAEHXZ @ 235 NONAME ; int RFbsGlyphDataIterator::Next(void)
+	?Metrics@RFbsGlyphDataIterator@@QBEABVTOpenFontCharMetrics@@XZ @ 236 NONAME ; class TOpenFontCharMetrics const & RFbsGlyphDataIterator::Metrics(void) const
+	?Close@RFbsGlyphMetricsArray@@QAEXXZ @ 237 NONAME ; void RFbsGlyphMetricsArray::Close(void)
+	??0RFbsGlyphDataIterator@@QAE@XZ @ 238 NONAME ; RFbsGlyphDataIterator::RFbsGlyphDataIterator(void)
+	??ARFbsGlyphMetricsArray@@QBEABVTOpenFontCharMetrics@@H@Z @ 239 NONAME ; class TOpenFontCharMetrics const & RFbsGlyphMetricsArray::operator[](int) const
+	?GlyphCode@RFbsGlyphDataIterator@@QBEIXZ @ 240 NONAME ; unsigned int RFbsGlyphDataIterator::GlyphCode(void) const
+	?Close@RFbsGlyphDataIterator@@QAEXXZ @ 241 NONAME ; void RFbsGlyphDataIterator::Close(void)
+	?Get@RFbsGlyphMetricsArray@@QAEHAAVCFbsFont@@PBIH@Z @ 242 NONAME ; int RFbsGlyphMetricsArray::Get(class CFbsFont &, unsigned int const *, int)
+	?Open@RFbsGlyphDataIterator@@QAEHAAVCFbsFont@@PBIH@Z @ 243 NONAME ; int RFbsGlyphDataIterator::Open(class CFbsFont &, unsigned int const *, int)
+	?GetGlyphCacheMetrics@RFbsSession@@QAEHAAVTGlyphCacheMetrics@@@Z @ 244 NONAME ; int RFbsSession::GetGlyphCacheMetrics(class TGlyphCacheMetrics &)
+	?ConveyOogmMessage@RFbsSession@@QAEHAAVTFbsOogmMessage@@@Z @ 245 NONAME ; int RFbsSession::ConveyOogmMessage(class TFbsOogmMessage &)
 
--- a/fbs/fontandbitmapserver/bwins/fbservu.def	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/bwins/fbservu.def	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,5 @@
 EXPORTS
 	?KFbServSharedHeapMaxSize@@3HB @ 1 NONAME ; int const KFbServSharedHeapMaxSize
 	?KFbServWritableDataPagingMode@@3HB @ 2 NONAME ; int const KFbServWritableDataPagingMode
+	?KFbServGlyphAtlasCacheLimit@@3HB @ 3 NONAME ; int const KFbServGlyphAtlasCacheLimit
 
--- a/fbs/fontandbitmapserver/eabi/FBSCLI2U.DEF	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/eabi/FBSCLI2U.DEF	Fri Jul 16 11:45:55 2010 +0300
@@ -264,4 +264,21 @@
 	_ZNK10CFbsBitmap8DataSizeEv @ 263 NONAME
 	_ZN17CFbsTypefaceStore20UpdateLinkedTypefaceERK28CLinkedTypefaceSpecification @ 264 NONAME
 	_ZN10CFbsBitmap14GetExtraBufferEi @ 265 NONAME
+	_ZN21RFbsGlyphDataIterator4NextEv @ 266 NONAME
+	_ZN21RFbsGlyphDataIterator4OpenER8CFbsFontPKji @ 267 NONAME
+	_ZN21RFbsGlyphDataIterator5CloseEv @ 268 NONAME
+	_ZN21RFbsGlyphDataIteratorC1Ev @ 269 NONAME
+	_ZN21RFbsGlyphDataIteratorC2Ev @ 270 NONAME
+	_ZN21RFbsGlyphMetricsArray3GetER8CFbsFontPKji @ 271 NONAME
+	_ZN21RFbsGlyphMetricsArray5CloseEv @ 272 NONAME
+	_ZN21RFbsGlyphMetricsArrayC1Ev @ 273 NONAME
+	_ZN21RFbsGlyphMetricsArrayC2Ev @ 274 NONAME
+	_ZNK21RFbsGlyphDataIterator4RectEv @ 275 NONAME
+	_ZNK21RFbsGlyphDataIterator5ImageEv @ 276 NONAME
+	_ZNK21RFbsGlyphDataIterator7MetricsEv @ 277 NONAME
+	_ZNK21RFbsGlyphDataIterator9GlyphCodeEv @ 278 NONAME
+	_ZNK21RFbsGlyphMetricsArray5CountEv @ 279 NONAME
+	_ZNK21RFbsGlyphMetricsArrayixEi @ 280 NONAME
+	_ZN11RFbsSession20GetGlyphCacheMetricsER18TGlyphCacheMetrics @ 281 NONAME
+	_ZN11RFbsSession17ConveyOogmMessageER15TFbsOogmMessage @ 282 NONAME
 
--- a/fbs/fontandbitmapserver/eabi/fbservu.def	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/eabi/fbservu.def	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,5 @@
 EXPORTS
 	KFbServSharedHeapMaxSize @ 1 NONAME DATA 4
 	KFbServWritableDataPagingMode @ 2 NONAME DATA 4
+	KFbServGlyphAtlasCacheLimit @ 3 NONAME DATA 4
 
--- a/fbs/fontandbitmapserver/group/FBSCLI.MMP	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/group/FBSCLI.MMP	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -28,8 +28,9 @@
 SOURCEPATH      ../sfbs
 
 userinclude     ../inc
-userinclude		../../../../textandloc/fontservices/fontstore/src
+userinclude     ../traces
 
+OS_LAYER_SYSTEMINCLUDE
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 source          BITBMP.CPP
@@ -47,6 +48,8 @@
 source          ShiftedFileStore.cpp
 source          BitmapCompr.cpp
 source          patchableconstantscli.cpp
+source          fbsglyphdataiterator.cpp
+source          fbsglyphmetricsarray.cpp
 
 library         euser.lib
 library         efsrv.lib
@@ -57,6 +60,7 @@
 library         palette.lib
 library         lookuptable.lib
 library         hal.lib
+library         sgresource.lib
 #if !defined(WINS)
 library         fbsrasterizer.lib
 #endif
--- a/fbs/fontandbitmapserver/group/FBSERV.MMP	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/group/FBSERV.MMP	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -35,7 +35,9 @@
 
 userinclude     ../inc
 userinclude     ../sfbs
+userinclude     ../traces
 
+OS_LAYER_SYSTEMINCLUDE
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 OS_LAYER_ESTLIB_SYSTEMINCLUDE
 
@@ -49,7 +51,8 @@
 source          FBSMBMC.CPP
 source          ShiftedFileStore.cpp
 source          HASHMAP.CPP
-source			patchableconstants.cpp
+source		patchableconstants.cpp
+source          glyphatlas.cpp
 
 library         euser.lib
 library         efsrv.lib
@@ -59,6 +62,7 @@
 library         estor.lib
 library         ecom.lib
 library         hal.lib
+library         sgresource.lib
 
 start wins
 baseaddress     0x41500000
--- a/fbs/fontandbitmapserver/group/FbservTest.iby	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/group/FbservTest.iby	Fri Jul 16 11:45:55 2010 +0300
@@ -19,36 +19,44 @@
 #define __FBSERVTEST_IBY__
 
 #include <graphics_testharness.iby>
-#include <internaltestfonts.iby>  
+#include <internaltestfonts.iby>
+#include <egl.iby>
+#include <openvg.iby>
 
 // batch file that runs all automatic fbserv tests
 data=DATAZ_\fbstest\fbstest_run.bat		\fbstest_run.bat
 data=DATAZ_\fbstest\fbstest.bat			\fbstest.bat
 
 //script files
-data=DATAZ_\fbstest\fbstest_T_All.script						\fbstest\fbstest_T_All.script
-data=DATAZ_\fbstest\fbstest_T_Alloc.script						\fbstest\fbstest_T_Alloc.script
+data=DATAZ_\fbstest\fbstest_T_All.script					\fbstest\fbstest_T_All.script
+data=DATAZ_\fbstest\fbstest_T_Alloc.script					\fbstest\fbstest_T_Alloc.script
 data=DATAZ_\fbstest\fbstest_T_Alloc.ini						\fbstest\fbstest_T_Alloc.ini
-data=DATAZ_\fbstest\fbstest_T_Bitmap.script						\fbstest\fbstest_T_Bitmap.script
-data=DATAZ_\fbstest\fbstest_T_Fbs.script						\fbstest\fbstest_T_Fbs.script
+data=DATAZ_\fbstest\fbstest_T_Bitmap.script					\fbstest\fbstest_T_Bitmap.script
+data=DATAZ_\fbstest\fbstest_T_Fbs.script					\fbstest\fbstest_T_Fbs.script
 data=DATAZ_\fbstest\fbstest_T_Compressed.script					\fbstest\fbstest_T_Compressed.script
-data=DATAZ_\fbstest\fbstest_T_Ralc.script						\fbstest\fbstest_T_Ralc.script
-data=DATAZ_\fbstest\fbstest_T_Defect.script						\fbstest\fbstest_T_Defect.script
+data=DATAZ_\fbstest\fbstest_T_Ralc.script					\fbstest\fbstest_T_Ralc.script
+data=DATAZ_\fbstest\fbstest_T_Defect.script					\fbstest\fbstest_T_Defect.script
 data=DATAZ_\fbstest\fbstest_T_StreamIdCache.script				\fbstest\fbstest_T_StreamIdCache.script
-data=DATAZ_\fbstest\fbstest_T_Secure.script						\fbstest\fbstest_T_Secure.script
-data=DATAZ_\fbstest\fbstest_T_File.script						\fbstest\fbstest_T_File.script
-data=DATAZ_\fbstest\fbstest_t_getallbitmapscapability.script	\fbstest\fbstest_t_getallbitmapscapability.script
-data=DATAZ_\fbstest\fbstest_T_Clean.script						\fbstest\fbstest_T_Clean.script
+data=DATAZ_\fbstest\fbstest_T_Secure.script					\fbstest\fbstest_T_Secure.script
+data=DATAZ_\fbstest\fbstest_T_File.script					\fbstest\fbstest_T_File.script
+data=DATAZ_\fbstest\fbstest_t_getallbitmapscapability.script			\fbstest\fbstest_t_getallbitmapscapability.script
+data=DATAZ_\fbstest\fbstest_T_Clean.script					\fbstest\fbstest_T_Clean.script
 data=DATAZ_\fbstest\fbstest_t_fonttable.script					\fbstest\fbstest_t_fonttable.script
 data=DATAZ_\fbstest\fbstest_T_IPCTest.script					\fbstest\fbstest_T_IPCTest.script
-data=DATAZ_\fbstest\ipctest_config.ini							\fbstest\ipctest_config.ini
+data=DATAZ_\fbstest\ipctest_config.ini						\fbstest\ipctest_config.ini
 data=DATAZ_\fbstest\fbstest_t_extendedbitmap.script				\fbstest\fbstest_t_extendedbitmap.script
 data=DATAZ_\fbstest\extendedbitmap_config.ini					\fbstest\extendedbitmap_config.ini
 data=DATAZ_\fbstest\fbstest_T_WDP_pagedata.script				\fbstest\fbstest_T_WDP_pagedata.script
 data=DATAZ_\fbstest\fbstest_T_WDP_unpagedata.script				\fbstest\fbstest_T_WDP_unpagedata.script
-data=DATAZ_\fbstest\fbstest_T_WDP_page_bitmap_data_only.script	\fbstest\fbstest_T_WDP_page_bitmap_data_only.script
-data=DATAZ_\fbstest\fbstest_T_WDP_page_bitmap_data_and_shared_heap_only.script		\fbstest\fbstest_T_WDP_page_bitmap_data_and_shared_heap_only.script
-data=DATAZ_\fbstest\wdptest_config.ini						    \fbstest\wdptest_config.ini
+data=DATAZ_\fbstest\fbstest_T_WDP_page_bitmap_data_only.script			\fbstest\fbstest_T_WDP_page_bitmap_data_only.script
+data=DATAZ_\fbstest\fbstest_t_oogm.script					\fbstest\fbstest_t_oogm.script
+data=DATAZ_\fbstest\fbstest_T_WDP_page_bitmap_data_and_shared_heap_only.script	\fbstest\fbstest_T_WDP_page_bitmap_data_and_shared_heap_only.script
+data=DATAZ_\fbstest\wdptest_config.ini						\fbstest\wdptest_config.ini
+
+REM GPU Glyph caching tests
+data=DATAZ_\fbstest\fbstest_t_glyphdata.script		\fbstest\fbstest_t_glyphdata.script
+data=DATAZ_\fbstest\glyphdata_config.ini					\fbstest\glyphdata_config.ini
+data=DATAZ_\fbstest\fbstest_t_glyphdataoutlineshadow.script		\fbstest\fbstest_t_glyphdataoutlineshadow.script
 
 // Fbserv WDP Alloc stress test
 data=DATAZ_\fbstest\fbstest_T_WDP_Alloc_Stress.script				\fbstest\fbstest_T_WDP_Alloc_Stress.script
--- a/fbs/fontandbitmapserver/group/TFbsServer.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/group/TFbsServer.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -27,14 +27,15 @@
 
 CAPABILITY       All -Tcb -AllFiles
 
-userinclude		../../../graphicstest/graphicstestharness/inc
-userinclude		../tfbs ../sfbs ../inc 
+userinclude		../tfbs 
+userinclude		../sfbs 
+userinclude		../inc 
 userinclude		../trasterizer/src
+userinclude		../traces
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 OS_LAYER_ESTLIB_SYSTEMINCLUDE
 
-SOURCEPATH  .
 SOURCEPATH  ../tfbs
 SOURCE		TFbsServer.cpp
 SOURCE		TALLOC.CPP
@@ -56,12 +57,19 @@
 SOURCE 		textendedbitmappanic.cpp
 SOURCE 		twdp.cpp
 SOURCE		tfonttableandglyph.cpp
+SOURCE  	tfbsglyphdata.cpp
+SOURCE 		tfbsglyphdatapanic.cpp 
+SOURCE 		tfbsglyphdataoutlineshadow.cpp
+SOURCE  	tglyphatlas.cpp
+SOURCE		tfbsoogm.cpp
+SOURCE  	glyphatlastestwrapper.cpp
 
 
 SOURCEPATH		../sfbs
 SOURCE			FbsRalc.cpp
 SOURCE			FBSMBMC.CPP
 SOURCE			ShiftedFileStore.cpp
+SOURCE			glyphatlas.cpp
 
 
 LIBRARY			euser.lib
@@ -78,6 +86,9 @@
 LIBRARY	    	testexecutelogclient.lib
 library			lookuptable.lib
 LIBRARY			hal.lib
+LIBRARY			sgresource.lib
+LIBRARY			libEGL.lib
+LIBRARY			libOpenVG.lib
 
 #if defined(WINS)
 LIBRARY			fontinjector.lib
@@ -87,3 +98,5 @@
 EPOCSTACKSIZE	0xf000
 
 SMPSAFE
+
+
--- a/fbs/fontandbitmapserver/group/bld.inf	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/group/bld.inf	Fri Jul 16 11:45:55 2010 +0300
@@ -34,13 +34,18 @@
 ../inc/fbsrasterizerclearcache.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/fbsrasterizerclearcache.h)
 ../inc/bitmapuid.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/bitmapuid.h)
 ../inc/fbsdefs.h    SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(graphics/fbsdefs.h)
+../sfbs/fbsglyphdataiterator.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/fbsglyphdataiterator.h)
+../sfbs/fbsglyphmetricsarray.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/fbsglyphmetricsarray.h)
+../sfbs/fbsoogmmessage.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/fbsoogmmessage.h)
+../sfbs/fbsoogmmessage.inl SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/fbsoogmmessage.inl)
+
 
 ../bwins/fbsrasterizeru.def /epoc32/include/graphics/def/bwins/fbsrasterizeru.def
 ../eabi/fbsrasterizeru.def /epoc32/include/graphics/def/eabi/fbsrasterizeru.def
 
 ../group/fbserv.iby        	/epoc32/rom/include/fbserv.iby
 ../group/fbsrasterizer_stub.iby	/epoc32/rom/include/fbsrasterizer_stub.iby
-
+../group/fbsoogmplugin.iby	/epoc32/rom/include/fbsoogmplugin.iby
 
 PRJ_MMPFILES
 
@@ -48,6 +53,7 @@
 ../group/FBSERV.MMP
 ../group/fbsrasterizerlib.mmp
 ../group/stubrasterizer.mmp
+//../group/fbsoogmplugin.mmp
 
 PRJ_TESTEXPORTS
 
@@ -84,6 +90,11 @@
 ../tfbs/scripts/fbstest_T_WDP_page_bitmap_data_and_shared_heap_only.script	z:/fbstest/fbstest_t_wdp_page_bitmap_data_and_shared_heap_only.script
 ../tfbs/scripts/extendedbitmap_config.ini						z:/fbstest/extendedbitmap_config.ini
 ../tfbs/scripts/wdptest_config.ini								z:/fbstest/wdptest_config.ini
+../tfbs/scripts/fbstest_t_glyphdata.script						z:/fbstest/fbstest_t_glyphdata.script
+../tfbs/scripts/glyphdata_config.ini						z:/fbstest/glyphdata_config.ini
+../tfbs/scripts/fbstest_t_glyphdataoutlineshadow.script				z:/fbstest/fbstest_t_glyphdataoutlineshadow.script
+../tfbs/scripts/fbstest_t_oogm.script						z:/fbstest/fbstest_t_oogm.script
+
 
 // Fbserv WDP Alloc stress test
 ../tfbs/scripts/fbstest_T_WDP_Alloc_Stress.script			z:/fbstest/fbstest_t_wdp_alloc_stress.script
--- a/fbs/fontandbitmapserver/group/fbscli_fmm.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// fbscli.dll Font & Bitmap server client-side library
-// 
-//
-
-/**
- @file
-*/
-
-target          fbscli_fmm.dll
-CAPABILITY All -Tcb
-targettype      DLL
-
-UID             0x1000008D 0x10003A15
-VENDORID 0x70000001
-SOURCEPATH      ../sfbs
-
-userinclude     ../inc
-userinclude		../../../../textandloc/fontservices/fontstore/src
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-source          BITBMP.CPP
-source          BITCOMP.CPP
-source          BITBMPEX.CPP
-source          BMPASTR.CPP
-source          BMPUTIL.CPP
-source          FBSBMP.CPP
-source          FBSFONT.CPP
-source          PILE.CPP
-source          SESSION.CPP
-source          TFSTORE.CPP
-source          FbsRalc.cpp
-source          fbshelper.cpp
-source          ShiftedFileStore.cpp
-source          BitmapCompr.cpp
-source          patchableconstantscli.cpp
-
-library         euser.lib
-library         efsrv.lib
-library         estor.lib
-library         gdi.lib
-library         fntstr.lib
-library         scdv.lib
-library         palette.lib
-library         lookuptable.lib
-library         hal.lib
-#if !defined(WINS)
-library         fbsrasterizer.lib
-#endif
-
-deffile         FBSCLI2.DEF
-
-
-START WINS
-BASEADDRESS     0x41400000
-END
-//configurable value to control bitmap heap management by setting
-//large bitmap threshold (requires rebuild)
-MACRO KMaxLargeBitmapAlloc=0x4000
-//MACRO SYMBIAN_DISABLE_HARDWARE_BITMAP_WHITEFILL // Uncomment this macro to disable whitefill of hardware bitmaps on creation
-
-// KCompressionThreshold is used to determine whether a bitmap gets compressed.  Values of 0 -> 256 represent 0% to 100% 
-// where 0% = no compression.  A value of 205 means that bitmaps are only compressed when the resulting size is 80% or 
-// less of the original size.
-MACRO KCompressionThreshold=205
-
-MACRO FNTSTORE_SUPPORT_FMM
-
-UNPAGED
-
-
-SMPSAFE
-
--- a/fbs/fontandbitmapserver/group/fbserv.iby	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/group/fbserv.iby	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -47,8 +47,8 @@
 		#define FBSERV_PAGEDDATA_CONFIG unpageddata
 	#endif
 
-	file=ABI_DIR\BUILD_DIR\fbserv_fmm.exe 	\sys\bin\fbserv.exe	FBSERV_PAGEDDATA_CONFIG
-	file=ABI_DIR\BUILD_DIR\fbscli_fmm.dll 	\sys\bin\fbscli.dll
+	file=ABI_DIR\BUILD_DIR\fbserv.exe 	\sys\bin\fbserv.exe	FBSERV_PAGEDDATA_CONFIG
+	file=ABI_DIR\BUILD_DIR\fbscli.dll 	\sys\bin\fbscli.dll
 #else
 	file=ABI_DIR\DEBUG_DIR\fbserv.exe 	sys\bin\fbserv.exe
 	file=ABI_DIR\DEBUG_DIR\fbscli.dll 	sys\bin\fbscli.dll
@@ -58,4 +58,6 @@
 #include <graphics_adaptation.hby>
 #include FBSRASTERIZER_DRV
 
+//#include <fbsoogmplugin.iby>
+
 #endif //__FBSERV_IBY__
--- a/fbs/fontandbitmapserver/group/fbserv_fmm.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// fbserv.exe Font & Bitmap server
-// 
-//
-
-/**
- @file
-*/
-
-// Default stack size(8K) is too small and causes stack overflow
-// in the hardware test udeb
-EPOCSTACKSIZE   16384
-EPOCHEAPSIZE    0x10000 0x200000		
-					
-target          fbserv_fmm.exe
-
-EPOCFIXEDPROCESS
-CAPABILITY      ProtServ
-targettype      exexp
-
-uid             0x1000008C 0x10003A16
-VENDORID        0x70000001
-
-userinclude     ../inc
-userinclude     ../sfbs
-userinclude		../../../../textandloc/fontservices/fontstore/src
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-OS_LAYER_ESTLIB_SYSTEMINCLUDE
-
-sourcepath      ../sfbs
-
-source          FBSCLI.CPP
-source          FBSMAIN.CPP
-source          FBSTOP.CPP
-source          BackGroundCompression.CPP
-source          SERVER.CPP
-source          FBSMBMC.CPP
-source          ShiftedFileStore.cpp
-source          HASHMAP.CPP
-source			patchableconstants.cpp
-
-library         euser.lib
-library         efsrv.lib
-library         gdi.lib
-library         fntstr.lib
-library         fbscli.lib
-library         estor.lib
-library         ecom.lib
-library         hal.lib
-
-start wins
-baseaddress     0x41500000
-end
-
-deffile 		fbserv.def
-
-MACRO KFBSERVInitialHeapSize=0x10000
-MACRO KFBSERVHeapGrowByMultiplier=4
-MACRO KFBSERVSharedBitmapHashTableSizeInBits=12
-MACRO FNTSTORE_SUPPORT_FMM
-UNPAGEDCODE //Configure data paging via fbserv.iby
-
-
-SMPSAFE
--- a/fbs/fontandbitmapserver/group/fbservtest_helium.pkg	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/group/fbservtest_helium.pkg	Fri Jul 16 11:45:55 2010 +0300
@@ -49,4 +49,7 @@
 "\epoc32\data\z\fbstest\ipctest_config.ini"-"c:\fbstest\ipctest_config.ini"
 "\epoc32\data\z\fbstest\fbstest_t_extendedbitmap.script"-"c:\fbstest\fbstest_t_extendedbitmap.script"
 "\epoc32\data\z\fbstest\extendedbitmap_config.ini"-"c:\fbstest\extendedbitmap_config.ini"
+"\epoc32\data\z\fbstest\fbstest_t_glyphdata.script"-"c:\fbstest\fbstest_t_glyphdata.script"
+"\epoc32\data\z\fbstest\glyphdata_config.ini"-"c:\fbstest\glyphdata_config.ini"
+"\epoc32\data\z\fbstest\fbstest_t_glyphdataoutlineshadow.script"-"c:\fbstest\fbstest_t_glyphdataoutlineshadow.script"
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/group/fbsoogmplugin.iby	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,23 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef __FBSOOGMPLUGIN_IBY__
+#define __FBSOOGMPLUGIN_IBY__
+
+ECOM_PLUGIN(fbsoogmplugin.dll, fbsoogmplugin.rsc)
+
+#endif // __FBSOOGMPLUGIN_IBY__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/group/fbsoogmplugin.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This is the .mmp for building font and bitmap server  out-of-graphics-memory Plugin
+*/
+
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+
+TARGET      		fbsoogmplugin.dll
+TARGETTYPE 		PLUGIN
+UID			0x10009d8d 0x2002B638
+
+CAPABILITY  		CAP_ECOM_PLUGIN 
+VENDORID    		0x70000001
+
+// This is a SYSTEMINCLUDE macro containing the middleware
+// layer specific include directories
+MW_LAYER_SYSTEMINCLUDE
+
+USERINCLUDE		.
+USERINCLUDE		../inc
+USERINCLUDE		../sfbs 
+USERINCLUDE		../traces
+
+TARGETPATH		 /sys/bin  
+SOURCEPATH		../sfbs
+
+SOURCE			fbsoogmplugin.cpp
+
+START RESOURCE		fbsoogmplugin.rss
+TARGET			fbsoogmplugin.rsc
+END
+
+LIBRARY			ecom.lib
+LIBRARY			euser.lib
+LIBRARY			goommonitor.lib
+LIBRARY			fbscli.lib
+
--- a/fbs/fontandbitmapserver/inc/FBS.H	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/inc/FBS.H	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1995-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -40,6 +40,15 @@
 */
 #define SYMBIAN_FBSERV_V2
 
+/**
+Indicates version of FBS that provides the CFbsFont extension 
+interfaces RFbsGlyphDataIterator for using hardware glyphs, and
+RFbsGlyphMetricsArray.
+@publishedAll
+@prototype
+*/
+//#define SYMBIAN_FBSERV_GLYPHDATA
+
 /** 
 Character width and adjustment information. 
 @publishedAll
@@ -61,6 +70,8 @@
 class CFbsRalCache;
 class CFbsSessionHelper;
 class CFbsRasterizer;
+class TGlyphCacheMetrics;
+class TFbsOogmMessage;
 
 /** 
 A session with the font and bitmap server. 
@@ -101,6 +112,9 @@
 	HBufC8* GetDecompressionBuffer(TInt aSize);
 	HBufC8* GetExtraBuffer(TInt aSize);
     TInt ServerSessionHandle() const;
+    IMPORT_C TInt GetGlyphCacheMetrics(TGlyphCacheMetrics& aGlyphCacheMetrics);
+    IMPORT_C TInt ConveyOogmMessage( TFbsOogmMessage& aOogmMessage );
+
 public:
 	/** WARNING: For internal use ONLY.  Compatibility is not guaranteed in future releases.	 
 	Used for testing server side out of memory failures.	
@@ -149,6 +163,8 @@
 class CFbsFont: public CFont
 	{
 	friend class CFbsTypefaceStore;
+	friend class RFbsGlyphDataIterator;
+	friend class RFbsGlyphMetricsArray;
 
 private:
 	// From CFont
@@ -208,7 +224,7 @@
 	RFbsSession* iFbs;
 	CBitmapFont* iAddressPointer;
 	TInt iHandle;
-	TInt iServerHandle;
+    TInt iServerHandle;
 	};
 
 /**
@@ -505,4 +521,22 @@
 	CDitherColor256* iDither;
 	};
 
-#endif
+
+/**
+ A class encapsulating the current state of the glyph cache.
+
+ @publishedAll
+ @released
+*/
+class TGlyphCacheMetrics
+    {
+public:
+    TInt iMaxCacheSizeInBytes;
+    TInt iMaxCacheSizeHigh;
+    TInt iMaxCacheSizeLow;
+    TInt iCacheSizeInBytes;
+    TBool iGpuCacheSizeLimitIsMax;
+    };
+
+#endif // __FBS_H__
+
--- a/fbs/fontandbitmapserver/inc/FbsMessage.H	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/inc/FbsMessage.H	Fri Jul 16 11:45:55 2010 +0300
@@ -74,7 +74,7 @@
 	EFbsMessSetHeapReset, //for memory testing only
 	EFbsMessSetHeapCheck, //for memory testing only
 	EFbsMessHeap, //for memory testing only
-	EFbsMessUnused2, //to put a character in the linked fonts cache
+	EFbsMessUnused2, //Implementation removed
 	EFbsMessBitmapClean, // replace a dirty bitmap with the clean one
 	EFbsMessBitmapLoadFast, // for loading bitmap from mbm or rsc file not opened by the client
 	EFbsMessBitmapNotifyDirty, // notify when any bitmap becomes dirty
@@ -87,6 +87,13 @@
 	EFbsMessReleaseFontTable,
 	EFbsMessGetGlyphOutline,
 	EFbsMessReleaseGlyphOutline,
+	EFbsMessGetGlyphs, // Retrieve rasterised glyphs from glyph atlas and closes last glyph retrieved
+	EFbsMessNoOp, // No-op call; used to ensure that the RSgImage of the last glyph retrieved from glyph atlas has been closed
+	EFbsMessGetGlyphMetrics, // Retrieve metrics of multiple glyph codes in one message
+	EFbsMessAtlasFontCount, // (Debug-only) Retrieve the number of fonts with glyphs in the H/W Glyph cache
+	EFbsMessAtlasGlyphCount, // (Debug-only) Retrieve the number of glyphs (optionally, given a specific font) stored in the H/W Glyph cache
+	EFbsMessOogmNotification, // An action requested by the GOoM framework. Reduce or re-instate graphics memory usage.
+	EFbsMessGetGlyphCacheMetrics, // Retrieve the glyph-cache size, its maximum limit and whether the maximum is the reduced value used in OoGm situations.
 	// If you are adding new messages don't forget to check that the 
 	// security permissions are set correctly (KRanges & KElementsIndex in server.cpp)
 	};
--- a/fbs/fontandbitmapserver/sfbs/FBSCLI.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/sfbs/FBSCLI.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -16,11 +16,20 @@
 #include <fntstore.h>
 #include <bitmap.h>
 #include <openfont.h>
+#include <graphics/fbsoogmmessage.h>
 #include "FbsMessage.H"
 #include "SERVER.H"
 #include "BackGroundCompression.h"
 #include <shapeinfo.h>
 #include <graphics/shaperparams.h>
+#include "glyphatlas.h"
+
+
+/**
+Bitwise mask that sets the MSB to indicate to a font rasterizer
+that a code is a glyphcode and not a character code
+*/
+const TUint32 KTreatAsGlyphCodeFlag = 1UL << 31;
 
 /** Helper function for converting a pointer to an offset from the passed
 heap base. Use OffsetToPointer() to convert the returned offset back to a
@@ -33,11 +42,12 @@
  */
 LOCAL_C TInt PointerToOffset(const TAny* aAny, TInt aHeapBase)
 	{
+	TInt offset = 0;
 	if (aAny && aHeapBase)
 		{
-		return reinterpret_cast<TInt>(aAny) - aHeapBase;
+		offset = reinterpret_cast<TInt>(aAny) - aHeapBase;
 		}
-	return 0;
+	return offset;
 	}
 
 /** Helper function for converting an offset (that was calculated using
@@ -58,9 +68,6 @@
 
 CFbClient::CFbClient(RHeap* aHeap):
 	CSession2(),
-	iConnectionHandle(0),
-	iIx(NULL),
-	iResourceCount(0),
 	iHeap(aHeap)
 #ifdef _DEBUG
 	,iOwnHeapFailNumber(-1),
@@ -71,14 +78,24 @@
 
 CFbClient* CFbClient::NewL(RHeap* aHeap)
 	{
-	CFbClient* c = new(ELeave) CFbClient(aHeap);
-	c->iOpenFontGlyphData = TOpenFontGlyphData::New(aHeap,4 * 1024);
-	if (!c->iOpenFontGlyphData)
+	CFbClient* self = new (ELeave) CFbClient(aHeap);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(); // self;
+	return self;
+	}
+
+/**
+Two-phase constructor.
+@leave KErrNoMemory if TOpenFontGlyphData construction failed.
+*/
+void CFbClient::ConstructL()
+	{
+	iOpenFontGlyphData = TOpenFontGlyphData::New(iHeap, 4 * 1024);
+	if (!iOpenFontGlyphData)
 		{
-		delete c;
 		User::Leave(KErrNoMemory);
 		}
-	return c;
 	}
 
 CFbClient::~CFbClient()
@@ -103,24 +120,32 @@
 		iHeap->Free(iOpenFontGlyphData);
 		}
 	
-	// delete fonts hold by the client
+	// delete fonts held by the client
 	delete iIx;
 	
-	// delete font files hold by the client
+	// delete font files held by the client
 	if (iFontFileIndex)
 		{
 		TInt count = iFontFileIndex->Count();
 		for (TInt index = 0;index < count; index++)
 			{
 			if (font_store)
+				{
 				font_store->RemoveFile(iFontFileIndex->At(0).iUid);
+				}
 			iFontFileIndex->Delete(0);
 			}
 		delete iFontFileIndex;
 		}
 
-	// Close the buffer used to hold the text thats needs shaping.
+	// Close the buffer used to hold the text that needs shaping.
 	iTextToShape.Close();
+
+	for (TInt i = iGlyphImagesInTransit.Count() - 1; i >= 0; --i)
+		{
+		iGlyphImagesInTransit[i].Close();
+		}
+	iGlyphImagesInTransit.Close();
 	}
 
 void CFbClient::Init(TUint aConnectionHandle)
@@ -143,9 +168,13 @@
 	{
 	CFontBitmapServer* server = FontBitmapServer();
 	if (server)
+		{
 		return server->TopLevelStore();
+		}
 	else
+		{
 		return NULL;
+		}
 	}
 
 void CFbClient::CopyFontInfo(CFontObject* aFontObjPtr,TInt aHandle,TFontInfo& aFontInfo)
@@ -158,6 +187,7 @@
 
 void CFbClient::ServiceL(const RMessage2& aMessage)
 	{
+
 #ifdef _DEBUG
 	TBool resetOwnHeap=EFalse;
 	TBool resetSharedHeap=EFalse;
@@ -189,6 +219,14 @@
 		__RHEAP_MARK(iHeap);
 		}		
 #endif		
+	//Call close on RSgImage handles being used to share glyph data with clients.
+	//The glyph images are held open to prevent the GlyphAtlas from closing them
+	//before a client can use them.
+	for (TInt i = iGlyphImagesInTransit.Count() - 1; i >= 0; --i)
+		{
+		iGlyphImagesInTransit[i].Close();
+		iGlyphImagesInTransit.Remove(i);
+		}
 	
 	switch(aMessage.Function())
 		{
@@ -246,6 +284,7 @@
 	case EFbsMessFetchLinkedTypeface:
 	case EFbsMessRegisterLinkedTypeface:
 	case EFbsMessUpdateLinkedTypeface:
+
 #ifdef _DEBUG
 		FontBitmapServer()->ProcMessage(aMessage,iSessionHandle,iRet);
 #else
@@ -277,6 +316,8 @@
 #if (_DEBUG)
 	case EFbsMessSetDuplicateFail:
 #endif
+	case EFbsMessGetGlyphs:
+	case EFbsMessGetGlyphMetrics:
 		ProcFontMessage(aMessage);
 		break;
 // bitmap messages
@@ -305,6 +346,31 @@
 		aMessage.Complete(KErrNone);
 #endif	
 		break;
+// Glyph Atlas messages (debug-only)
+	case EFbsMessAtlasFontCount:
+	case EFbsMessAtlasGlyphCount:
+#ifdef _DEBUG
+		ProcAtlasMessage(aMessage);
+#else
+		aMessage.Complete(KErrNotSupported);
+#endif
+		break;
+    case EFbsMessOogmNotification:
+
+        aMessage.Complete( HandleMesgOogmStatus( aMessage ) );
+        break;
+    case EFbsMessGetGlyphCacheMetrics:
+
+        HandleMesgGlyphCacheMetrics( aMessage );
+        break;
+
+//No-op message
+	case EFbsMessNoOp:
+#ifdef _DEBUG
+		iRet = KErrNone;
+#endif
+		aMessage.Complete(KErrNone);
+		break;
 	default:
 		aMessage.Panic(KFBSERVPanicCategory,KErrArgument);
 		break;
@@ -372,7 +438,9 @@
 	{
 #if _DEBUG
 	if (iFontDuplicateToFail)
+		{
 		return KErrNoMemory; //return with this error since this error is possible
+		}
 #endif
 	CFontObject* fontptr = (CFontObject*) aMessage.Int0();
 	if(!TopLevelStore()->ValidFontHandle((TInt)fontptr))
@@ -380,7 +448,7 @@
 		return KErrUnknown;
 		}
 
-	TPckgBuf<TFontInfo> foninfo;
+	TPckgBuf<TFontInfo> fontinfo;
 	TInt localhandle = 0;
 	TInt ret = fontptr->Open();
 	if (ret != KErrNone)
@@ -393,9 +461,9 @@
 		fontptr->Close();
 		return ret;
 		}
-	CopyFontInfo(fontptr,localhandle,foninfo());
+	CopyFontInfo(fontptr,localhandle,fontinfo());
 	fontptr->iHeightInTwips = ((fontptr->iAddressPointer->HeightInPixels() * fontptr->iFontStore->iKPixelHeightInTwips) + 667) / 1000;
-	ret = aMessage.Write(1, foninfo);
+	ret = aMessage.Write(1, fontinfo);
 	if(ret != KErrNone)
 		{
 		iIx->Remove(localhandle);
@@ -422,14 +490,14 @@
 	TInt pckgMaxHeight;
 	TPckgBuf<TSizeInfo> info;
 
-	const TFbsMessage	fbsMessage = static_cast<TFbsMessage>(aMessage.Function());
+	const TFbsMessage fbsMessage = static_cast<TFbsMessage>(aMessage.Function());
 
 	TInt ret = aMessage.Read(0, pckgFontSpec);
 	TFontSpec& fontSpec = pckgFontSpec();
 	if (ret == KErrNone )
 		{
 		TInt length = fontSpec.iTypeface.iName.Length();
-		if(length < 0 || length > TOpenFontFaceAttribBase::ENameLength)
+		if((length < 0) || (length > TOpenFontFaceAttribBase::ENameLength))
 			{
 			aPanicRequired = ETrue;
 			return KErrArgument;
@@ -644,6 +712,183 @@
 	return EFalse;
 	}
 
+/** Handler for EFbsMessGetGlyphs message.
+Reads a batch of up to KMaxGlyphBatchSize glyph codes, and on success returns
+the corresponding TGlyphImageInfo objects.
+ @param aMessage input parameters
+ @param aPanicRequired flag that is set if a client panic is required
+ @return KErrNone if successful, otherwise any system-wide error code.
+ */
+TInt CFbClient::HandleMesgGetGlyphs(const RMessage2& aMessage, TBool& aPanicRequired)
+	{
+	CFbTop* fbtop = TopLevelStore();
+	// Previously requested glyphs were closed in ServiceL()
+	CGlyphAtlas* glyphAtlas = fbtop->GlyphAtlas();
+	if (!glyphAtlas)
+		{
+		return KErrNotSupported;
+		}
+	CFontObject* fontptr = static_cast<CFontObject*>(iIx->At(aMessage.Int0(), fbtop->FontConUniqueID()));
+	if(!fontptr)
+		{
+		aPanicRequired = ETrue;
+		return KErrBadHandle;
+		}
+
+	TUint glyphCodes[KMaxGlyphBatchSize];
+	TGlyphImageInfo glyphImageInfo[KMaxGlyphBatchSize];
+	TPckg<TUint[KMaxGlyphBatchSize]> glyphBatchPckg(glyphCodes);
+
+	TInt err = aMessage.Read(1, glyphBatchPckg);
+	if (err != KErrNone)
+		{
+		aPanicRequired = ETrue;
+		return err;
+		}
+	TInt glyphCodesCount = glyphBatchPckg.Length() / sizeof(TUint);
+	if (glyphCodesCount > KMaxGlyphBatchSize)
+		{
+		aPanicRequired = ETrue;
+		return KErrOverflow;
+		}
+
+	TInt glyphsProcessed = 0;
+	CBitmapFont* font = fontptr->iAddressPointer;
+	for (; (glyphsProcessed < glyphCodesCount); ++glyphsProcessed)
+		{
+		TUint32 glyphCode = glyphCodes[glyphsProcessed];
+		err = glyphAtlas->GetGlyph(*font, glyphCode, glyphImageInfo[glyphsProcessed]);
+		// Search for glyph in glyph atlas
+		if (KErrNone != err)
+			{
+			const TUint8* bitmapData = NULL;
+			TOpenFontCharMetrics metrics;
+			// search for glyph in font glyph cache and session cache.
+			if (!font->GetCharacterData(iSessionHandle, glyphCode | KTreatAsGlyphCodeFlag, metrics, bitmapData))
+				{
+				// Rasterize the glyph
+				if(!font->Rasterize(iSessionHandle, glyphCode | KTreatAsGlyphCodeFlag, iOpenFontGlyphData))
+					{
+					err = KErrNoMemory;
+					break;
+					}
+				metrics = *(iOpenFontGlyphData->Metrics());
+				bitmapData = iOpenFontGlyphData->BitmapPointer();
+				}
+			CGlyphAtlas::TAddGlyphArgs args(bitmapData, glyphCode, metrics);
+			err = glyphAtlas->AddGlyph(*font, args, glyphImageInfo[glyphsProcessed]);
+			}
+		if ((err == KErrNone) && (glyphImageInfo[glyphsProcessed].iImageId != KSgNullDrawableId))
+			{
+			// To prevent other threads closing the glyph image in the glyph atlas 
+			// before client has had chance to open the drawable id, open a local
+			// handle to the glyph image for the session, which will be closed either
+			// next time a request is made or when EFbsMessCloseGlyphs is handled.
+			RSgImage glyphImage;
+			err = glyphImage.Open(glyphImageInfo[glyphsProcessed].iImageId);
+			if (err == KErrNone)
+				{
+				err = iGlyphImagesInTransit.Append(glyphImage);
+				}
+			}
+		// If an error occurred during this iteration, abort now before the glyphsProcessed
+		// counter is incremented, which would give one too many processed glyphs.
+		if (KErrNone != err)
+			{
+			break;
+			}
+		}
+
+	// Even if there was an error, if at least one glyph was processed successfully
+	// send that back to the client, and reset the error code.
+	if (glyphsProcessed > 0)
+		{
+		TPckg<TGlyphImageInfo[KMaxGlyphBatchSize]> glyphImageInfoPckg(glyphImageInfo);
+		glyphImageInfoPckg.SetLength(glyphsProcessed * sizeof(TGlyphImageInfo));
+		err = aMessage.Write(2, glyphImageInfoPckg);
+		if (err != KErrNone)
+			{
+			aPanicRequired = ETrue;
+			return err;
+			}
+		}
+	else
+		{
+		// No glyphs being returned, so an error code must be returned.
+		__ASSERT_DEBUG(err != KErrNone, User::Panic(KFBSERVPanicCategory, err));
+		}
+	return err;
+	}
+
+/**
+Handler for EFbsMessGetGlyphMetrics message.
+Reads an array of glyph codes, and returns the offset from the heap base for the 
+corresponding metrics object.
+@pre The glyph codes have already been searched client-side in the font glyph
+	cache and the session cache.
+@param aMessage input parameters
+@param aPanicRequired flag that is set if a client panic is required
+@return KErrNone if successful, otherwise any system-wide error code.
+ */
+TInt CFbClient::HandleMesgGetGlyphMetrics(const RMessage2& aMessage, TBool& aPanicRequired)
+	{
+	CFbTop* fbtop = TopLevelStore();
+	CFontObject* fontptr = static_cast<CFontObject*>(iIx->At(aMessage.Int0(), fbtop->FontConUniqueID()));
+	if(!fontptr)
+		{
+		aPanicRequired = ETrue;
+		return KErrBadHandle;
+		}
+	
+	TInt err = KErrNone;
+	TUint glyphCodes[KMaxMetricsBatchSize];
+	TPckg<TUint[KMaxMetricsBatchSize]> glyphBatchPckg(glyphCodes);
+	err = aMessage.Read(1, glyphBatchPckg);
+	if (err != KErrNone)
+		{
+		aPanicRequired = ETrue;
+		return err;
+		}
+	
+	TInt numGlyphCodes = glyphBatchPckg.Length() / sizeof(TUint);	
+	if (numGlyphCodes > KMaxMetricsBatchSize)
+		{
+		aPanicRequired = ETrue;
+		return KErrOverflow;
+		}
+	
+	CBitmapFont* font = fontptr->iAddressPointer;
+	const TInt heapbase = fbtop->HeapBase();
+
+	TInt glyphProcessed;
+	TInt glyphMetricsOffsets[KMaxMetricsBatchSize];
+	for (glyphProcessed = 0; (glyphProcessed < numGlyphCodes) && (err == KErrNone); ++glyphProcessed)
+		{
+		if (font->Rasterize(iSessionHandle, glyphCodes[glyphProcessed] | KTreatAsGlyphCodeFlag, iOpenFontGlyphData))
+			{
+			// Convert all pointers to be passed back to the client to offsets from
+			// the heap base so that they can be recreated client side relative to the
+			// client's heap base
+			glyphMetricsOffsets[glyphProcessed] = PointerToOffset(iOpenFontGlyphData->Metrics(), heapbase);
+			}
+		else
+			{
+			err = KErrNoMemory;
+			}
+		}
+
+	if (err == KErrNone)
+		{
+		TPckg<TInt[KMaxMetricsBatchSize]> glyphMetricsOffsetsPckg(glyphMetricsOffsets);
+		glyphMetricsOffsetsPckg.SetLength(glyphProcessed * sizeof(TInt));
+		err = aMessage.Write(2, glyphMetricsOffsetsPckg);
+		if (err != KErrNone)
+			{
+			aPanicRequired = ETrue;
+			}
+		}	
+	return err;
+	}
 
 /** Handler for EFbsMessFaceAttrib message
  @param aMessage Input and output parameters
@@ -661,21 +906,21 @@
 		}
 	CBitmapFont* bitmapFont = fontptr->iAddressPointer;
 
+	TInt ret = EFalse;
 	TPckgBuf<TOpenFontFaceAttrib> package;
 	if ( (bitmapFont != NULL) && (bitmapFont->GetFaceAttrib(package())) )
 		{
-		TInt ret = aMessage.Write(1,package);
+		ret = aMessage.Write(1,package);
 		if (ret == KErrNone)
 			{
-			return ETrue;
+			ret = ETrue;
 			}
 		else
 			{
 			aPanicRequired = ETrue;
-			return ret;
 			}
 		}
-	return EFalse;
+	return ret;
 	}
 
 
@@ -717,7 +962,6 @@
 	{
 	TInt error = KErrNone;
 	TShapeHeader* shape = 0;
-	TPckgBuf<TShapeMessageParameters> sp;
 	if (aMessage.GetDesLength(2) != sizeof(TShapeMessageParameters))
 		{
 		aPanicRequired = ETrue;
@@ -731,7 +975,6 @@
 		aPanicRequired = ETrue;
 		return KErrArgument;
 		}
-	CBitmapFont* bitmapFont = fontptr->iAddressPointer;
 
 	TInt inputTextLength = aMessage.GetDesLength(1);
 	if (inputTextLength < 0)
@@ -744,7 +987,9 @@
 		{
 		iTextToShape.Zero();
 		if (iTextToShape.MaxLength() < inputTextLength)
+			{
 			error = iTextToShape.ReAlloc(inputTextLength);
+			}
 		}
 	if (error == KErrNone)
 		{
@@ -754,12 +999,14 @@
 			aPanicRequired = ETrue;
 			return error;
 			}
+		TPckgBuf<TShapeMessageParameters> sp;
 		error = aMessage.Read(2, sp);
 		if (error != KErrNone)
 			{
 			aPanicRequired = ETrue;
 			return error;
 			}
+		CBitmapFont* bitmapFont = fontptr->iAddressPointer;
 		TRAP(error, shape = bitmapFont->ShapeTextL(iTextToShape, iSessionHandle, sp()) );
 		if (error == KErrNone)
 			{
@@ -953,9 +1200,70 @@
 	return ret;
 	}
 
+
+/**
+ Called in response to the GoomMonitor framework's call into FbsOogmPlugin.
+ We wish to either free some GPU memory, or reinstate its normal usage.
+
+@param  aMessage The IPC message.
+@return KErrNone If the value contained in the TFbsOogmMessage enumeration member is meaningful and the glyph atlas is present.
+        KErrNotSupported if there is no glyph atlas.
+        KErrUnknown if the value contained in the TFbsOogmMessage enumeration member is not meaningful.
+ */
+TInt CFbClient::HandleMesgOogmStatus( const RMessage2& aMessage )
+    {
+    TInt ret = KErrNone;
+    CGlyphAtlas* glyphAtlas = TopLevelStore()->GlyphAtlas();
+
+    if ( NULL == glyphAtlas )
+        {
+        return KErrNotSupported;
+        }
+
+
+    TPckgBuf<TFbsOogmMessage> oogmMessage;
+    aMessage.Read( 0, oogmMessage );
+
+    switch( oogmMessage().iOogmNotification )
+        {
+    case TFbsOogmMessage::EFbsOogmNoAction:
+        break;
+
+    case TFbsOogmMessage::EFbsOogmLowNotification:
+        {
+        glyphAtlas->ReleaseGpuMemory( oogmMessage().iBytesToFree, oogmMessage().iFlags );
+        }
+         break;
+
+    case TFbsOogmMessage::EFbsOogmOkayNotification:
+        {
+        glyphAtlas->InstateGpuMemory( oogmMessage().iFlags );
+        }
+        break;
+
+    default:
+        ret = KErrUnknown;
+        break;
+        }
+
+    return ret;
+    }
+
+
+void CFbClient::HandleMesgGlyphCacheMetrics( const RMessage2& aMessage )
+    {
+    CGlyphAtlas* glyphAtlas = TopLevelStore()->GlyphAtlas();
+    TPckgBuf<TGlyphCacheMetrics>  metrics;
+
+    glyphAtlas->GetGlyphCacheMetrics( metrics() );
+
+    aMessage.Complete( aMessage.Write(0, metrics) );
+    }
+
+
 void CFbClient::ProcFontMessage(const RMessage2& aMessage)
 	{
-	TInt ret = KErrUnknown;
+	TInt ret = KErrNone;
 	TBool panicRequired = EFalse;
 
 	switch(aMessage.Function())
@@ -1082,9 +1390,20 @@
 			ret = HandleMesgReleaseFontTable(aMessage, panicRequired);
 			break;
 			}
+		case EFbsMessGetGlyphs:
+			{
+			ret = HandleMesgGetGlyphs(aMessage, panicRequired);
+			break;
+			}
+		case EFbsMessGetGlyphMetrics:
+			{
+			ret = HandleMesgGetGlyphMetrics(aMessage, panicRequired);
+			break;
+			}
 
 #ifdef _DEBUG
 		case EFbsMessSetDuplicateFail:
+			{
 			TInt argument =aMessage.Int0();
 			if (argument)
 				{
@@ -1096,7 +1415,10 @@
 				}
 			ret=KErrNone;
 			break;
+			}
 #endif
+		default:
+			ret = KErrUnknown;
 		}
 
 	// either have a result or an error code to panic the client with
@@ -1120,7 +1442,7 @@
 	{
 	CBitmapObject* bmpptr=NULL;
 	TInt localhandle=0;
-	TInt ret=KErrUnknown;
+	TInt ret = KErrNone;
 	switch(aMessage.Function())
 		{
 	case EFbsMessBitmapCreate:
@@ -1283,14 +1605,18 @@
 			}
 		ret = fbtop->GetCleanBitmap(bmpptr);
 		if (ret != KErrNone)
+			{
 			break;
+			}
 		TSize newsize(aMessage.Int1(),aMessage.Int2());
  		const TBool compressedInRam = bmpptr->Address()->IsCompressedInRAM();  //It must be set before the resizing is done.
 		const TDisplayMode dispMode = bmpptr->Address()->DisplayMode();
 		CBitmapObject* newbmpptr = NULL;
 		TRAP(ret, newbmpptr = fbtop->CreateBitmapL(newsize, dispMode, KUidCFbsBitmapCreation, ETrue));
 		if (ret != KErrNone)
+			{
 			break;
+			}
 		ret = newbmpptr->Address()->CopyData(*bmpptr->Address());
 		if (ret != KErrNone)
 			{
@@ -1325,7 +1651,9 @@
 			}
 		bmpptr->SetCleanBitmap(newbmpptr);
 		if (bmpptr->AccessCount() >= 2)
+			{
 			fbtop->NotifyDirtyBitmap(*bmpptr, this);
+			}
 		iIx->Remove(localhandle);
 		TPckgBuf<TBmpHandles> handlebuffer;
 		handlebuffer().iHandle = newlocalhandle;
@@ -1353,7 +1681,9 @@
 		TopLevelStore()->GetCleanBitmap(bmpptr);
 		ret = bmpptr->Open();
 		if (ret != KErrNone)
+			{
 			break;
+			}
 		TPckgBuf<TBmpHandles> handlebuffer;
 		TRAP(ret,localhandle=iIx->AddL(bmpptr));
 		if(ret!=KErrNone)
@@ -1386,13 +1716,17 @@
 			}
 		ret = fbtop->GetCleanBitmap(bmpptr);
 		if (ret != KErrNone)
+			{
 			break;
+			}
 		const TSize size = bmpptr->Address()->SizeInPixels();
 		const TDisplayMode dispMode = bmpptr->Address()->DisplayMode();
 		CBitmapObject* newbmpptr = NULL;
 		TRAP(ret, newbmpptr = fbtop->CreateBitmapL(size, dispMode, KUidCFbsBitmapCreation, ETrue));
 		if (ret != KErrNone)
+			{
 			break;
+			}
 		ret = newbmpptr->Address()->CopyData(*bmpptr->Address());
 		if (ret != KErrNone)
 			{
@@ -1420,7 +1754,9 @@
 			}
 		bmpptr->SetCleanBitmap(newbmpptr);
 		if (bmpptr->AccessCount() >= 2)
+			{
 			fbtop->NotifyDirtyBitmap(*bmpptr, this);
+			}
 		iIx->Remove(localhandle);
 		TPckgBuf<TBmpHandles> handlebuffer;
 		handlebuffer().iHandle = newlocalhandle;
@@ -1451,7 +1787,9 @@
 		if (ret != KErrNone)
 			{
 			if (!async)
+				{
 				ret = KErrNone;
+				}
 			break;
 			}
 		ret = bmpptr->Address()->CheckBackgroundCompressData();
@@ -1459,10 +1797,14 @@
 			{
 			ret = fbtop->BackgroundCompression()->AddToCompressionQueue(bmpptr, scheme, async ? &aMessage : NULL);
 			if (ret == KErrNone && async)
+				{
 				return; // do not complete the client's request - that will be done by the background compression thread
+				}
 			}
 		if (KErrAlreadyExists == ret)
+			{
 			ret = KErrNone;
+			}
 		break;
 		}
 	case EFbsMessBitmapClean:
@@ -1477,10 +1819,14 @@
 			}
 		ret = fbtop->GetCleanBitmap(bmpptr);
 		if (ret != KErrNone)
+			{
 			break;
+			}
 		ret = bmpptr->Open();
 		if (ret != KErrNone)
+			{
 			break;
+			}
 		TInt cleanlocalhandle = 0;
 		TRAP(ret, cleanlocalhandle = iIx->AddL(bmpptr));
 		if (ret != KErrNone)
@@ -1530,17 +1876,19 @@
 			iHelper->iMessage = aMessage;
 			return; // do not complete the client's request yet - that will be done when a bitmap becomes dirty
 			}
-		ret = KErrNone;
 		iHelper->iDirty = EFalse;
 		}
 		break;
 	case EFbsMessBitmapCancelNotifyDirty:
 		{
 		if (iHelper != NULL && !iHelper->iMessage.IsNull())
+			{
 			iHelper->iMessage.Complete(KErrCancel);
-		ret = KErrNone;
+			}
 		}
 		break;
+	default:
+		ret = KErrUnknown;
 		}
 		
 	if(!aMessage.IsNull())
@@ -1616,7 +1964,9 @@
 	if (iHelper)
 		{
 		if (!iHelper->iMessage.IsNull())
+			{
 			iHelper->iMessage.Complete(KErrDisconnected);
+			}
 		iHelper->Deque();
 		delete iHelper;
 		iHelper = NULL;
@@ -1678,7 +2028,58 @@
 			break;
 		case EFbsMessHeap:
 			ret=(TInt)iHeap;
-			break;			
+			break;
+		default:
+			ret = KErrUnknown;
+		}
+	aMessage.Complete(ret);
+	iRet=ret;
+	}
+
+/**
+Processes messages associated with the Glyph Atlas.
+@param aMessage The message used to perform IPC to the client.
+ */
+void CFbClient::ProcAtlasMessage(const RMessage2 &aMessage)
+	{
+	TInt ret = KErrNone;
+	CFbTop* fbtop = TopLevelStore();
+	CGlyphAtlas* glyphAtlas = fbtop->GlyphAtlas();
+	if (!glyphAtlas)
+		{
+		ret = KErrNotSupported;
+		}
+	else
+		{
+		switch(aMessage.Function())
+			{
+			case EFbsMessAtlasFontCount:
+				ret = glyphAtlas->FontCount();
+				break;
+			case EFbsMessAtlasGlyphCount:
+				{
+				TInt fontHandle = aMessage.Int0();
+				if (fontHandle != 0)
+					{
+					if (fbtop->ValidFontHandle(fontHandle))
+						{
+						CFontObject* fontptr = reinterpret_cast<CFontObject*>(fontHandle);
+						ret = glyphAtlas->GlyphCount(static_cast<CBitmapFont&>(*(fontptr->iAddressPointer)));
+						}
+					else
+						{
+						ret = KErrNotFound;
+						}
+					}
+				else
+					{
+					ret = glyphAtlas->GlyphCount();
+					}
+				}
+				break;
+			default:
+				ret = KErrUnknown;
+			}
 		}
 	aMessage.Complete(ret);
 	iRet=ret;
--- a/fbs/fontandbitmapserver/sfbs/FBSFONT.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/sfbs/FBSFONT.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -85,7 +85,9 @@
 EXPORT_C void CFbsFont::Reset()
 	{
 	if (iHandle)
+	    {
 		iFbs->SendCommand(EFbsMessClose,iHandle);
+	    }
 	iHandle = 0;
 	}
 	
@@ -115,7 +117,7 @@
 	if (!aFontHandle)
 		return KErrUnknown;
 	// close any existing handle
-	Reset();
+	Reset();	
 	// ask server to create the duplicate handle
 	TPckgBuf<TFontInfo> tfpckg;
 	TIpcArgs args(aFontHandle,&tfpckg);
@@ -137,7 +139,9 @@
 EXPORT_C TInt CFbsFont::Handle() const
 	{
 	if (!iHandle)
+		{
 		return 0;
+		}
 	return iServerHandle;
 	}
 
@@ -727,6 +731,9 @@
 provide and/or return information to/from the particular extension function,
 defaults to NULL.
 @return Integer return value from extension function, a system wide error code.
+@panic FBSCLI 31, in debug builds only, if iExtra is NULL when it must not be.
+@panic FBSCLI 38, in debug builds only, if a reserved error code is returned 
+	from an extended function.
 @internalTechnology
 @released
 */
--- a/fbs/fontandbitmapserver/sfbs/FBSTOP.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/sfbs/FBSTOP.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1995-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -18,7 +18,6 @@
 #include <fntstore.h>
 #include <bitmap.h>
 #include <ecom/ecom.h>
-#include "FbsMessage.H"
 #include <graphics/bitmapuid.h>
 #include "SERVER.H"
 #include "BackGroundCompression.h"
@@ -27,6 +26,8 @@
 #include <graphics/openfontconstants.h>
 #include <graphics/openfontrasterizer.h>
 #include <graphics/gdi/glyphsample.h>
+#include "glyphatlas.h"
+#include "FbsMessage.H"
 
 // Local utility functions
 void ListImplementationsWithRetry(TUid& aInterfaceUid, RImplInfoPtrArray &aImplementationArray, TBool aRomOnly);
@@ -61,6 +62,7 @@
 #endif
 	iFontNameAlias.ResetAndDestroy();
 	iBitmapObjectIndex.Reset();
+	delete iGlyphAtlas;
 	REComSession::FinalClose();
 	}
 
@@ -140,9 +142,15 @@
 	iMBMCache=new (ELeave) CFbTopStreamIdCache(30,30,5);
 
 	LoadOpenFontLibraries();
-	
 	iFontStore->LoadFontsAtStartupL();
 	LoadShaperFactories();
+	TRAP_IGNORE(iGlyphAtlas = CGlyphAtlas::NewL(KFbServGlyphAtlasCacheLimit);)
+#ifdef _DEBUG
+	if (!iGlyphAtlas)
+	    {
+        RDebug::Printf("FBSERV failed to initialize Glyph Atlas");
+	    }
+#endif
 
 	// start a new thread for background compression after all the other objects have been created
 	iBackgroundCompression = CFbsBackgroundCompression::NewL(*this);
@@ -307,8 +315,8 @@
 		{
 		return ret;
 		}
-
-	return CreateFontObjectFromFont(aFontObjPtr, font);
+	
+	return GetFontObjectFromFont(aFontObjPtr, font);
 	}
 	
 /**
@@ -349,9 +357,27 @@
 	return ret;
 	}
 
-TInt CFbTop::CreateFontObjectFromFont(CFontObject*& aFontObjPtr, CFont* aFont)
+TInt CFbTop::GetFontObjectFromFont(CFontObject*& aFontObjPtr, CFont* aFont)
 	{
-	CFontObject* fontObjPtr = new CFontObject(iFontStore);
+	// First, check if a CFontObject exists for this CFont.
+	// If so, increment its reference count and return it.
+	for (TInt ii = iFontCon->Count() - 1; ii >= 0; --ii)
+		{
+		CFontObject* fontObjPtr = reinterpret_cast<CFontObject*>((*iFontCon)[ii]);
+		if (fontObjPtr->iAddressPointer == reinterpret_cast<CBitmapFont*>(aFont))
+			{
+			aFontObjPtr = fontObjPtr;
+			// The CFontObject instance keeps the reference count of the CBitmapFont, 
+			// not the font store. There is only one CFontObject instance
+			// per CBitmapFont, so to keep the reference count at 1 in the fontstore
+			// call ReleaseFont(). 
+			iFontStore->ReleaseFont(aFont);
+			return fontObjPtr->Open();
+			}
+		}
+	
+	// Existing FontObject not found, so create new one.
+	CFontObject* fontObjPtr = new CFontObject(iFontStore, iGlyphAtlas);
 	if (!fontObjPtr)
 		{
 		iFontStore->ReleaseFont(aFont);
@@ -389,7 +415,7 @@
 		{
 		return ret;
 		}
-	return CreateFontObjectFromFont(aFontObjPtr, font);
+	return GetFontObjectFromFont(aFontObjPtr, font);
 	}
 
 
@@ -561,18 +587,6 @@
 	return(EFalse);
 	}
 	
-TBool CFbTop::ValidBitmapFont(TInt aHandle)
-	{
-	TInt limit=iFontCon->Count();
-	for(TInt count=0;count<limit;count++)
-		{
-		CFontObject* fontObjPtr = reinterpret_cast<CFontObject*>((*iFontCon)[count]);
-		if(aHandle==(TInt)(fontObjPtr->iAddressPointer))
-			return(ETrue);
-		}
-	return(EFalse);
-	}
-
 CFontStore* CFbTop::FontStore() const
 	{
 	return(iFontStore);
@@ -724,3 +738,8 @@
 	{
 	return iFontCon->UniqueID();
 	}
+
+CGlyphAtlas* CFbTop::GlyphAtlas() const
+	{
+	return iGlyphAtlas;
+	}
--- a/fbs/fontandbitmapserver/sfbs/SERVER.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/sfbs/SERVER.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -22,7 +22,7 @@
 #include "BitwiseBitmap.inl"
 
 const TInt KFbsPriority = 0;
-
+const TInt KFbsGoomMonitorSid = 0x10207218;
 // Setup security policies
 const TInt KRanges[] = 
 	{
@@ -37,7 +37,10 @@
 	EFbsMessFetchLinkedTypeface,
 	EFbsMessUpdateLinkedTypeface,
 	EFbsMessGetFontTable,
+    EFbsMessOogmNotification,
+    EFbsMessGetGlyphCacheMetrics,
 	};
+
 const TUint KRangeCount = sizeof(KRanges)/sizeof(TInt);
 const TUint8 KElementsIndex[KRangeCount] = 
 	{
@@ -52,14 +55,19 @@
 	2, // ECapabilityReadDeviceData for EFbsMessFetchLinkedTypeface
 	1, // ECapabilityWriteDeviceData for EFbsMessUpdateLinkedTypeface
 	0, // ECapability_None for EFbsMessGetFontTable and beyond
+    4, // SID for EFbsMessOogmNotification.
+    0, // For EFbsMessGetGlyphCacheMetrics and on.
 	};
+
 const CPolicyServer::TPolicyElement KElements[] = 
 	{
 	{_INIT_SECURITY_POLICY_C1(ECapability_None), CPolicyServer::EFailClient},
 	{_INIT_SECURITY_POLICY_C1(ECapabilityWriteDeviceData), CPolicyServer::EFailClient},
 	{_INIT_SECURITY_POLICY_C1(ECapabilityReadDeviceData), CPolicyServer::EFailClient},
-	{_INIT_SECURITY_POLICY_C1(ECapabilityPowerMgmt), CPolicyServer::EFailClient},	
+	{_INIT_SECURITY_POLICY_C1(ECapabilityPowerMgmt), CPolicyServer::EFailClient},
+	{_INIT_SECURITY_POLICY_S0(KFbsGoomMonitorSid), CPolicyServer::EFailClient}
  	};
+
 const CPolicyServer::TPolicy KFbsPolicy =
 	{
 	CPolicyServer::EAlwaysPass, //specifies all connect attempts should pass
@@ -70,9 +78,7 @@
 	};
 
 CFontBitmapServer::CFontBitmapServer():
-	CPolicyServer(KFbsPriority, KFbsPolicy),
-	iConnectionId(0),
-	iTopLevelStore(NULL)
+	CPolicyServer(KFbsPriority, KFbsPolicy)
 	{
 	}
 
@@ -85,25 +91,33 @@
 
 CFontBitmapServer* CFontBitmapServer::NewL()
 	{
-	CFontBitmapServer* fbs=new(ELeave) CFontBitmapServer;
-	CleanupStack::PushL(fbs);
-	fbs->iTopLevelStore=CFbTop::NewL();
+	CFontBitmapServer* self = new(ELeave) CFontBitmapServer;
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(); //self
+	return self;
+	}
+
+/**
+Two-phase constructor.
+*/
+void CFontBitmapServer::ConstructL()
+	{
+	iTopLevelStore=CFbTop::NewL();
 	
 	// If fbserv data paging is configured as unpaged, automatically pin client descriptors 
 	if(!RProcess().DefaultDataPaged())
 		{
-		fbs->SetPinClientDescriptors(ETrue);
+		SetPinClientDescriptors(ETrue);
 		}
-
-	fbs->StartL(KFBSERVGlobalThreadName);
-	CleanupStack::Pop();
-	return(fbs);
+	StartL(KFBSERVGlobalThreadName);
 	}
 
 CFbTop* CFontBitmapServer::TopLevelStore()
 	{
 	return(iTopLevelStore);
 	}
+
 CSession2* CFontBitmapServer::NewSessionL(const TVersion& aVersion,const RMessage2& /*aMessage*/ ) const
 	{
 	TVersion v(KFbsMajorVersionNumber,KFbsMinorVersionNumber,KFbsBuildVersionNumber);
@@ -127,7 +141,7 @@
 	TPckgBuf<TSize> pixelSize;
 	TInt index=aMessage.Int0();
 	TInt limit=iTopLevelStore->FontStore()->NumTypefaces();
-	if(index<0 || index>limit)
+	if(index < 0 || index > limit)
 		{
 		return KErrArgument;
 		}
@@ -195,7 +209,7 @@
 void CFontBitmapServer::ProcMessage(const RMessage2& aMessage, TInt aSession)
 #endif
 	{
-	TInt ret=KErrNone;
+    TInt ret=KErrNone;
 	TBool clientPanicRequired = EFalse;
 #ifdef _DEBUG
 	TInt num=0;
@@ -346,6 +360,7 @@
 #ifdef _DEBUG
 	aRet=ret;
 #endif	
+
 	}
 
 /**
@@ -363,9 +378,9 @@
 void CFontBitmapServer::GetHeapSizesL(const RMessage2& aMessage)
 	{
 	TPckgBuf<THeapSizes> data;
-	TInt defaultHeapSize;
-	TInt smallBmpHeapSize;		
-	TInt bigBmpHeapSize;		
+	TInt defaultHeapSize = 0;
+	TInt smallBmpHeapSize = 0;		
+	TInt bigBmpHeapSize = 0;		
 	
 	User::Heap().AllocSize(defaultHeapSize);
 	bigBmpHeapSize = iTopLevelStore->iLargeBitmapChunk.Size();
@@ -385,18 +400,24 @@
 #endif
 
 
-CFontObject::CFontObject(CFontStore* aFontStore):
+CFontObject::CFontObject(CFontStore* aFontStore, CGlyphAtlas* aGlyphAtlas):
 	CObject(),
-	iAddressPointer(NULL),
-	iFontStore(aFontStore)
+	iFontStore(aFontStore),
+	iGlyphAtlas(aGlyphAtlas)
 	{
 	}
 
 CFontObject::~CFontObject()
 	{
 	if (AccessCount()==1)
+		{
 		Dec();
+		}
 	iFontStore->ReleaseFont(iAddressPointer);
+	if (iGlyphAtlas)
+		{
+		iGlyphAtlas->FontReleased(*iAddressPointer);
+		}
 	}
 
 // CBitmapObject constructor - takes ownership of aBmp
@@ -426,7 +447,9 @@
 		{
 		iHandle = reinterpret_cast<TInt>(this);
 		while (iFbTop->iBitmapObjectIndex.FindInOrder(this, Compare) != KErrNotFound)
+			{
 			++iHandle;
+			}
 		User::LeaveIfError(iFbTop->iBitmapObjectIndex.InsertInOrder(this, Compare));
 		}
 	}
@@ -471,9 +494,13 @@
 			if (index != KErrNotFound)
 				{
 				if (iCleanBitmap)
+					{
 					iFbTop->iBitmapObjectIndex[index] = iCleanBitmap;
+					}
 				else
+					{
 					iFbTop->iBitmapObjectIndex.Remove(index);
+					}
 				}
 			}
 		if (iCleanBitmap != NULL)
@@ -502,7 +529,7 @@
 
 void CBitmapObject::Close()
 	{
-	if (iCleanBitmap != NULL && Owner() != NULL && AccessCount() == 2)
+	if ((iCleanBitmap != NULL) && (Owner() != NULL) && (AccessCount() == 2))
 		{
 		static_cast<CBitmapObject*>(Owner())->iCleanBitmap = iCleanBitmap;
 		iCleanBitmap->SetOwner(Owner());
@@ -525,8 +552,7 @@
 // CSharedBitmapObject constructor - takes ownership of aBmp and aKey
 CSharedBitmapObject::CSharedBitmapObject(CFbTop& aFbTop, CBitwiseBitmap* aBmp, TDesC* aKey):
 	CBitmapObject(aFbTop, aBmp),
-	iKey(aKey),
-	iNext(NULL)
+	iKey(aKey)
 	{
 	__ASSERT_DEBUG(iKey, User::Invariant());	
 	}
--- a/fbs/fontandbitmapserver/sfbs/SERVER.H	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/sfbs/SERVER.H	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1995-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -13,33 +13,37 @@
 // Description:
 //
 
-#ifndef __FBSERV_H__
-#define __FBSERV_H__
+#ifndef SERVER_H
+#define SERVER_H
 
 #include <e32base.h>
 #include <f32file.h>
 #include <fbs.h>
+#include <sgresource/sgimage.h>
 #include "UTILS.H"
 #include "FBSMBMC.H"
 #include "FbsMessage.H"
+#include "glyphatlas.h"
 
 class CFbTop;
 class CFbsBackgroundCompression;
 class CFbsBackgroundCompressionQueueElement;
 class TOpenFontGlyphData;
 
+
 NONSHARABLE_CLASS(CFontObject): public CObject
 /**
 @internalComponent
 */
 	{
 public:
-	CFontObject(CFontStore* aFontStore);
+	CFontObject(CFontStore* aFontStore, CGlyphAtlas* aGlyphAtlas);
 	~CFontObject();
 public:
 	CBitmapFont* iAddressPointer;
 	CFontStore* iFontStore;
 	TInt iHeightInTwips;
+	CGlyphAtlas* iGlyphAtlas;
 	};
 
 NONSHARABLE_CLASS(CBitmapObject): public CObject
@@ -113,6 +117,7 @@
 	CFbTop* TopLevelStore();
 
 private:
+	void ConstructL();
 	void GetHeapSizesL(const RMessage2& aMessage);
 	TInt HandleMesgTypefaceSupport(const RMessage2& aMessage, TBool& aClientPanicRequired);
 	TInt HandleMesgFontHeight(const RMessage2& aMessage, TBool aInTwips);
@@ -171,8 +176,10 @@
 	void Disconnect(const RMessage2 &aMessage);
 #ifdef _DEBUG
 	void ProcMemMessage (const RMessage2& aMessage);
+	void ProcAtlasMessage (const RMessage2& aMessage);
 #endif	
 private:
+	void ConstructL();
 	CFbClient(RHeap* aHeap);
 	TInt HandleMesgFontDuplicate(const RMessage2& aMessage, TBool& aPanicRequired);
 	TInt HandleMesgGetNearestFont(const RMessage2& aMessage, TBool& aPanicRequired);
@@ -189,6 +196,10 @@
 	TInt HandleMesgGetGlyphOutline(const RMessage2& aMessage, TBool& aPanicRequired);
 	TInt HandleMesgReleaseGlyphOutline(const RMessage2& aMessage, TBool& aPanicRequired);
 	TInt HandleMesgReleaseFontTable(const RMessage2& aMessage, TBool& aPanicRequired);
+	TInt HandleMesgGetGlyphs(const RMessage2& aMessage, TBool& aPanicRequired);
+	TInt HandleMesgGetGlyphMetrics(const RMessage2& aMessage, TBool& aPanicRequired);
+	TInt HandleMesgOogmStatus(const RMessage2& aMessage);
+	void HandleMesgGlyphCacheMetrics(const RMessage2& aMessage);
 
 protected:
 	TUint iConnectionHandle;
@@ -202,6 +213,7 @@
 
 private:
 	RBuf16 iTextToShape;						// buffer used to hold incoming text that needs shaping
+	RArray<RSgImage> iGlyphImagesInTransit;	// last glyph images retrieved from glyph atlas
 #ifdef _DEBUG	
 	TBool iOwnHeapCheck; //for the process heap - current state
 	TBool iHeapCheck;	//for iHeap - current state
@@ -250,6 +262,7 @@
 
 
 IMPORT_C extern const TInt KFbServSharedHeapMaxSize;
+IMPORT_C extern const TInt KFbServGlyphAtlasCacheLimit;
 
 
 NONSHARABLE_CLASS(CFbTop): public CBase
@@ -271,7 +284,6 @@
 	TInt GetCleanBitmap(CBitmapObject*& aBmpObjPtr);
 	CBitmapObject* FindBitmap(TInt aHandle);
 	TBool ValidFontHandle(TInt aHandle);
-	TBool ValidBitmapFont(TInt aHandle);
 	CFontStore* FontStore() const;
 	RHeap* Heap() const;
 	CChunkPile* Pile() const;
@@ -287,6 +299,7 @@
 	void NotifyDirtyBitmap(CBitmapObject& aBmpObj, CFbClient* aClient);
 	TInt BitmapConUniqueID() const;
 	TInt FontConUniqueID() const;
+	CGlyphAtlas* GlyphAtlas() const;
 private:
 	CFbTop();
 	void ConstructL();
@@ -296,7 +309,7 @@
 	TInt FindFontNameAlias(const TDesC& aAlias);
 	void LoadShaperFactories();
 	void SafeInstallOfShaperFactoryL(TUid aInterfaceImplUid);
-	TInt CreateFontObjectFromFont(CFontObject*& aFontObjPtr, CFont* aFont);
+	TInt GetFontObjectFromFont(CFontObject*& aFontObjPtr, CFont* aFont);
 	TInt GetNearestNonAliasedFont(CFont*& aFont, TFbsMessage aMessage, const TFontSpec&	aFontSpec, TInt	aMaxHeight);
 private:
 	RFs iFilesys;
@@ -318,6 +331,7 @@
 	TBuf<KMaxTypefaceNameLength> iSystemDefaultFontTypefaceName;
 	TDblQue<TFbClientHelper> iClientHelpers;
 	TInt64 iNextAvailableSerialNumber;
+	CGlyphAtlas* iGlyphAtlas;
 	};
 
 inline CBitwiseBitmap* CBitmapObject::Address() const
@@ -360,5 +374,5 @@
 	return iFilesys;
 	}
 
-#endif
+#endif // SERVER_H
 
--- a/fbs/fontandbitmapserver/sfbs/SESSION.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/sfbs/SESSION.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -20,6 +20,7 @@
 #include "FbsRalc.h"
 #include "fbshelper.h"
 #include "FbsMessage.H"
+#include <graphics/fbsoogmmessage.h>
 
 GLDEF_C void Panic(TFbsPanic aPanic)
 	{
@@ -238,6 +239,7 @@
 EXPORT_C TInt RFbsSession::SendCommand(TInt aMessage,TInt aInt0,TInt aInt1,TInt aInt2,TInt aInt3) const
    {
 	__ASSERT_ALWAYS(iConnections>0,Panic(EFbsPanicBadConnection));
+
 	switch(aMessage)
 		{
 	case EFbsMessShutdown:
@@ -247,7 +249,9 @@
 	default:
 		break;
 		}
+
 	TInt ret = SendReceive(aMessage, TIpcArgs(aInt0,aInt1,aInt2,aInt3));
+
 	return(ret);
 	}
 
@@ -486,6 +490,36 @@
 	return iHelper->iServerSessionHandle;
 	}
 
+EXPORT_C TInt RFbsSession::GetGlyphCacheMetrics( TGlyphCacheMetrics& aGlyphCacheMetrics )
+    {
+    TPckgBuf<TGlyphCacheMetrics> metrics;
+    TIpcArgs args( &metrics );
+
+    TInt ret = SendReceive( EFbsMessGetGlyphCacheMetrics, args );
+    aGlyphCacheMetrics = metrics();
+
+    return ret;
+    }
+
+/**
+ Perform the IPC to convey the desired OoGM action to the glyph atlas.
+
+ @return KErrNone if IPC was successful. One of the system-wide error
+         codes, as described for RSessionBase::SendReceive(), if not.
+
+ @note The server-side platform security policy applied to this method is such that it is only useable by the GOoM framework.
+
+ @param aOogmMessage. A reference to the class encapsulating the OoGM action required of the glyph atlas.
+*/
+EXPORT_C TInt RFbsSession::ConveyOogmMessage( TFbsOogmMessage& aOogmMessage )
+    {
+    TPckgBuf<TFbsOogmMessage> oogmMessage;
+    oogmMessage() = aOogmMessage;
+    TIpcArgs args( &oogmMessage );
+
+    return SendReceive( EFbsMessOogmNotification, args );
+    }
+
 /**
 Returns the current sizes of the FBServ default heap, the heap for large bitmaps, 
 and the heap for small bitmaps.
--- a/fbs/fontandbitmapserver/sfbs/UTILS.H	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/sfbs/UTILS.H	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -20,8 +20,9 @@
 #include <gdi.h>
 #include <fntstore.h>
 #include <bitmap.h>
+#include <sgresource/sgimage.h>
 
-
+class RFbsSession;
 
 /**
 @internalComponent
@@ -43,35 +44,43 @@
 */
 enum TFbsPanic
 	{
-	EFbsPanicNoConnection=1,
-	EFbsPanicBadConnection,
-	EFbsPanicUnknownMessage,
-	EFbsPanicActiveSchedulerError,
-	EFbsPanicStartupFailed,
-	EFbsTypefaceStoreError,
-	EFbsFontCreateFailed,
-	EFbsFontAddressViolation,
-	EFbsBitmapInvalidFormat,
-	EFbsBitmapInvalidMode,
-	EFbsBitmapInvalidCompression,
-	EFbsBitmapDecompressionError,
-	EFbsPanicChunkError,
-	EFbsColor256UtilError,
-	EFbsHardwareBitmapError,
-	EFbsNotSupportedForCompression,
-	EFbsBitmapAlignment,
-	EFbsBitmapInvalidScanLinePtr,
-	EFbsBitmapInvalidMode2,
-	EFbsBitmapInvalidMode3,
-	EFbsBitmapSwappingImpossible,
-	EFbsPanicBadHeapLock,
-	EFbsShaperNotYetCalled,
-	EFbsShaperInvalidArguments,
-	EFbsInvalidCompressionThreshold,
-	EFbsTypefaceIndexOutOfRange,
-	EFbsPanicBitmapDataCopy,
-	EFbsPanicBitmapReadOnly,
-	EFbsPanicInvalidBitmapType
+	EFbsPanicNoConnection = 1,
+	EFbsPanicBadConnection = 2,
+	EFbsPanicUnknownMessage = 3,
+	EFbsPanicActiveSchedulerError = 4,
+	EFbsPanicStartupFailed = 5,
+	EFbsTypefaceStoreError = 6,
+	EFbsFontCreateFailed = 7,
+	EFbsFontAddressViolation = 8,
+	EFbsBitmapInvalidFormat = 9,
+	EFbsBitmapInvalidMode = 10,
+	EFbsBitmapInvalidCompression = 11,
+	EFbsBitmapDecompressionError = 12,
+	EFbsPanicChunkError = 13,
+	EFbsColor256UtilError = 14,
+	EFbsHardwareBitmapError = 15,
+	EFbsNotSupportedForCompression = 16,
+	EFbsBitmapAlignment = 17,
+	EFbsBitmapInvalidScanLinePtr = 18,
+	EFbsBitmapInvalidMode2 = 19,
+	EFbsBitmapInvalidMode3 = 20,
+	EFbsBitmapSwappingImpossible = 21,
+	EFbsPanicBadHeapLock = 22,
+	EFbsShaperNotYetCalled = 23,
+	EFbsShaperInvalidArguments = 24,
+	EFbsInvalidCompressionThreshold = 25,
+	EFbsTypefaceIndexOutOfRange = 26,
+	EFbsPanicBitmapDataCopy = 27,
+	EFbsPanicBitmapReadOnly = 28,
+	EFbsPanicFontNullHandle = 29,
+    EFbsPanicGlyphDataIteratorClosed = 31,
+	EFbsPanicGlyphMetricsArrayOutOfBounds = 32,
+	EFbsPanicGlyphDataIteratorIndexOutOfRange = 33,
+	EFbsPanicInvalidBitmapType = 35,
+	EFbsPanicGlyphAtlasInconsistentState = 36,
+	EFbsPanicGlyphDataIteratorFailedToOpenImage = 37,
+	EFbsPanicGlyphDataIteratorInvalidState = 39,
+	EFbsPanicGlyphMetricsArrayInvalidState = 40,
 	};
 
 class TScanLine
@@ -125,9 +134,9 @@
 @internalComponent
 */
 	{
-	public:
-		TSizeInfo(){}
-		TSizeInfo(TInt aMaxHeight,TSize aDevSize):iMaxHeight(aMaxHeight),iDevSize(aDevSize) {}
+public:
+	TSizeInfo(){}
+	TSizeInfo(TInt aMaxHeight,TSize aDevSize):iMaxHeight(aMaxHeight),iDevSize(aDevSize) {}
 
 	TInt iMaxHeight;
 	TSize iDevSize;
@@ -182,7 +191,8 @@
 	void ShrinkSmallSection(TInt aShrinkBy);
 private:
 	RChunk iChunk;
-	TInt iPageSize, iPageMask;
+	TInt iPageSize;
+	TInt iPageMask;
 	RPointerArray<TUint8> iSmallCells; // last address is not a cell but the top of the small section
 	RArray<TInt> iFreeSmallCellLinks; // index of Nth free small cell is element 0 + element 1 + ... + element N-1
 	TInt iLargeSectionBottom; // boundary between small & large sections
@@ -264,6 +274,74 @@
     TInt iLen;
     };
 
-#endif
+/**
+Maximum number of glyphs to be sent to server/received from client at a time, 
+when retrieval of glyphs is necessary for implementation of RFbsGlyphDataIterator.
+*/
+const TInt KMaxGlyphBatchSize = 8;
+
+/**
+Maximum number of TOpenFontCharMetrics structures to be sent to server/received
+from client at a time, when retrieval of glyph metrics is necessary for
+implementation of RFbsGlyphMetricsArray.
+*/
+const TInt KMaxMetricsBatchSize = 16;
+
+/**
+Used by RFbsGlyphDataIterator for client/server communication of glyph info.
+Contains all the data necessary to retrieve a glyph from server and recreate
+glyph in client process.
+@internalComponent 
+ */
+class TGlyphImageInfo
+    {
+public:
+    inline TGlyphImageInfo() : iImageId(KSgNullDrawableId), iPosX(0), iPosY(0) {}
+public:
+    TSgDrawableId iImageId;
+    TInt16 iPosX;
+    TInt16 iPosY;
+    TOpenFontCharMetrics iMetrics;
+    };
 
+/**
+Used by CGlyphDataIteratorImpl. It is a container to group the 
+metadata and the image data of an individual glyph recevied from the
+server, all together. A collection of these is stored in the font,
+received from the server in batches.
+@internalComponent 
+*/
+struct TGlyphBatchItem
+    {
+    TSglQueLink iLink;
+    RSgImage iImage;
+    TGlyphImageInfo iInfo;
+    };
 
+/**
+Implementor class of RFbsGlyphDataIterator. This class contains all
+state information and contains much of the implementation of the
+behaviour.
+@internalComponent 
+ */
+NONSHARABLE_CLASS(CGlyphDataIteratorImpl) : public CBase
+    {
+public:
+    CGlyphDataIteratorImpl(TInt aFbsFontHandle, const TUint* aGlyphCodes, TInt aCount);
+    ~CGlyphDataIteratorImpl();
+    TInt Initialise();
+    TInt Next();
+    void UpdateGlyphRect();
+    TInt UpdateGlyphBatch(TInt aIndex);
+    
+public:    
+    TSglQue<TGlyphBatchItem> iGlyphBatch;   // Linked-list of the current batch of received glyphs.
+    const TUint* iGlyphDataIterCodes;       // An array of glyph codes
+    TInt  iGlyphDataIterCodeCount;          // The number of glyph codes in the array
+    TInt  iGlyphDataIterCodeIndex;          // The index of the current glyph code in the array
+    TRect iGlyphDataIterRect;               // The current glyph rectangle.
+    TInt  iFbsFontHandle;                   // The Font Handle the iterator was opened with  
+    RFbsSession* iFbs;
+    };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/sfbs/fbsglyphdataiterator.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,465 @@
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include <e32def.h>
+#include <gdi.h>
+#include <graphics/gdi/gdistructs.h>
+#include <graphics/gdi/gdiconsts.h>
+#include <graphics/fbsglyphdataiterator.h>
+#include "FbsMessage.h"
+#include "UTILS.H"
+
+const TInt KFbsGlyphDataIterCodeInvalid = -1;
+
+extern void Panic(TFbsPanic aPanic);
+
+/**
+The default constructor sets the iterator to a closed and empty state. It 
+is the only way of constructing an iterator as instances cannot be copied by 
+assignment or passed by value.
+ */
+EXPORT_C RFbsGlyphDataIterator::RFbsGlyphDataIterator() :
+    iImpl(NULL)
+    {
+    }
+
+/**
+For a given font (aFont), this method retrieves the glyph data for a list of 
+glyph codes (aGlyphCodes), containing a number (aCount) of codes. On success, 
+the iterator is initialised with the data for the first glyph in aGlyphCodes.
+
+The memory allocated to aGlyphCodes must not be freed or altered while the 
+iterator is in use (i.e. until the iterator has been closed). 
+
+Open() may not be called on an already open iterator. In order to re-open an 
+iterator, it must first be closed by a call tor Close().
+
+If a glyph code is passed in that is not a recognised glyph code for the 
+associated font, an empty-box glyph will be returned. This behaviour is 
+consistent with CFbsFont::GetCharacterData().
+
+@pre The iterator is not already open. 
+
+@param aFont The font to provide the glyph code data for.
+@param aGlyphCodes An array of glyph codes that the iterator will 
+	provide data for. This memory allocated for this array must not be 
+	freed before the iterator is closed.
+@param aCount The number of glyph codes in aGlyphCodes.
+
+@return 
+	KErrNone, if the iterator is successfully initialised to retrieve 
+		the glyph data;
+	KErrInUse, if the iterator is already open, in which case the state of
+        the iterator is left unchanged;
+	KErrNoMemory, if the iterator cannot be opened due to insufficient 
+		system memory;
+	KErrNotSupported, if aFont refers to a bitmap font or an outline & shadow
+        font, if the required version of the hardware driver is not available
+        (EGL 1.3 or later is required), or if RSgImages are not supported by
+        the system;
+	KErrArgument, if aCount is negative or zero, or if aGlyphCodes is null.
+ */
+EXPORT_C TInt RFbsGlyphDataIterator::Open(CFbsFont& aFont, const TUint* aGlyphCodes, TInt aCount)
+	{  
+	if (iImpl)
+		{
+		return KErrInUse;
+		}
+	if ((aCount <= 0) || !aGlyphCodes)
+		{
+		return KErrArgument;
+		}
+	if (!aFont.Address()->IsOpenFont())
+        {
+        return KErrNotSupported;
+        }
+    TInt glyphBitmapType = aFont.Address()->GlyphBitmapType();
+    if (!( (glyphBitmapType == EMonochromeGlyphBitmap) || (glyphBitmapType == EAntiAliasedGlyphBitmap) ))
+        {
+        //Only supported bitmap types can be used i.e. EMonochromeGlyphBitmap or EAntiAliasedGlyphBitmap
+        return KErrNotSupported;
+        }
+    // Check that the max width and height of the font are both no more than 2048.
+    // This is the smallest maximum size an RSgImage can be created with.
+    // This limit is arbitrarily set as it should cover nearly all use cases.
+    const TInt KMaxFontSizeInPixels = 2048;
+    TInt maxHeight = aFont.FontMaxHeight();
+    TInt maxWidth = aFont.MaxCharWidthInPixels();
+    if ( (KMaxFontSizeInPixels < maxHeight) || (KMaxFontSizeInPixels < maxWidth) )
+        {
+        return KErrTooBig;
+        }
+    // Construct implementor object that holds the state for the iterator.
+	iImpl = new CGlyphDataIteratorImpl(aFont.iHandle, aGlyphCodes, aCount);
+	if (!iImpl)
+	    {
+	    return KErrNoMemory;
+	    }
+	TInt err = iImpl->Initialise();
+	if (err != KErrNone)
+	    {
+        Close();
+	    }
+	return err;   
+	}
+
+/**
+Moves the iterator to the data for the next glyph code in the array passed 
+into RFbsGlyphDataIterator::Open(). Data for the glyph can then be accessed 
+using the Image(), Rect() and Metrics() methods.
+
+Once Next() has been called, the references returned by Image(), Rect() and 
+Metrics() methods during the previous iteration should be considered invalid 
+and must be discarded. 
+
+Calling Next() repeatedly will iterate through the glyph data for all the glyph
+codes, until it has reached the last glyph code in the array (assuming no errors
+are encountered), at which point KErrNotFound is returned, and the array of glyph
+codes passed to RFbsGlyphDataIterator::Open() can safely be deleted.
+
+If the call was successful, KErrNone is returned. If an error is encountered an
+error code will be returned and the state of the iterator is left unchanged.
+
+@pre The iterator has been opened by a successful call to Open().
+@post The properties of the iterator are of the glyph corresponding
+	to the next code passed in the array to Open().	However, if an error code 
+	was returned, the state of the iterator	is unchanged.
+	
+@return 
+	KErrNone, if the iterator was successfully advanced;
+	KErrNotFound, if the iterator is already at the last element and cannot
+		be advanced any further;
+	KErrNoMemory, if there is insufficient system memory available;
+	KErrNoGraphicsMemory, if there is insufficient graphics memory available.
+	
+@panic FBSCLI 31, if the iterator is not open.
+@panic FBSERV -8, if as a result of this call, communication with the 
+    server is invoked, and the associated CFbsFont has been destroyed.
+ */
+EXPORT_C TInt RFbsGlyphDataIterator::Next()
+    {
+    __ASSERT_ALWAYS(iImpl, Panic(EFbsPanicGlyphDataIteratorClosed));
+    return iImpl->Next();
+    }
+
+/**
+Closes the iterator and releases its internal resources. After calling, all data 
+retrieved by the iterator is no longer safe to use. Once closed, this iterator 
+can be re-opened. Calling Close() on an already closed iterator has no effect.
+
+Once an iterator is closed, the array of glyphs (aGlyphCodes) passed to
+RFbsGlyphDataIterator::Open() can safely be deleted.
+
+@post The iterator is closed.
+ */
+EXPORT_C void RFbsGlyphDataIterator::Close()
+    {
+    delete iImpl;
+    iImpl = NULL;
+    }
+
+/**
+Returns a reference to the RSgImage that contains the glyph for the current 
+iteration. The image representation of the glyph is the same as the image 
+returned by the existing CFbsFont::GetCharacterData() method (i.e. an alpha mask). 
+
+The RSgImage should only be considered a temporary handle for use in this 
+iteration, and should not be used after a call to Next() or Close() has 
+been made.
+
+Note: For glyphs such as space which have no visible representation, Image() 
+will return a null image handle (i.e. RSgImage::IsNull() returns ETrue). This 
+cannot be used for drawing. In this case Rect() will be empty however 
+Metrics() will still be valid. 
+
+@pre The iterator has been initialised by successfully calling Open().
+     
+@return A handle to the image where the glyph for this iteration is stored.
+     
+@panic FBSCLI 31, if the iterator is not open.
+ */
+EXPORT_C const RSgImage& RFbsGlyphDataIterator::Image() const
+    {
+    __ASSERT_ALWAYS(iImpl, Panic(EFbsPanicGlyphDataIteratorClosed));
+    __ASSERT_DEBUG(!iImpl->iGlyphBatch.IsEmpty(), Panic(EFbsPanicGlyphDataIteratorInvalidState));
+    return iImpl->iGlyphBatch.First()->iImage;
+    }
+
+/**
+Returns the area within the RSgImage where the glyph for the current
+iteration is located. The reference returned by Rect() should be considered 
+temporary for use within this iteration and should not be used after a call to 
+Next() or Close() has been made.
+ 
+@pre The iterator has been initialised by successfully calling Open().
+     
+@return A rectangle representing the position and size in pixels, 
+	of the glyph for this iteration on the RSgImage provided by Image().
+     
+@panic FBSCLI 31, if the iterator is not open.
+ */
+EXPORT_C const TRect& RFbsGlyphDataIterator::Rect() const
+    {
+    __ASSERT_ALWAYS(iImpl, Panic(EFbsPanicGlyphDataIteratorClosed));
+    __ASSERT_DEBUG(!iImpl->iGlyphBatch.IsEmpty(), Panic(EFbsPanicGlyphDataIteratorInvalidState));
+    return iImpl->iGlyphDataIterRect;
+    }
+
+/**
+Returns the glyph metrics for the current iteration. The reference returned by 
+Metrics() should be considered temporary for use within this iteration and 
+should not be used after a call to Next() or Close() has been made.
+
+@pre The iterator has been initialised by successfully calling Open().
+ 
+@return The metrics for the glyph at the current iteration.
+
+@panic FBSCLI 31, if the iterator is not open.
+ */
+EXPORT_C const TOpenFontCharMetrics& RFbsGlyphDataIterator::Metrics() const
+    {
+    __ASSERT_ALWAYS(iImpl, Panic(EFbsPanicGlyphDataIteratorClosed));
+    __ASSERT_DEBUG(!iImpl->iGlyphBatch.IsEmpty(), Panic(EFbsPanicGlyphDataIteratorInvalidState));
+    return iImpl->iGlyphBatch.First()->iInfo.iMetrics;
+    }
+
+/**
+Returns the glyph code associated with the data for the current iteration.
+
+@pre The iterator has been initialised by successfully calling Open().
+ 
+@return The glyph code of the glyph at the current iteration.
+
+@panic FBSCLI 31, if the iterator is not open.
+ */
+EXPORT_C TUint RFbsGlyphDataIterator::GlyphCode() const
+    {
+    __ASSERT_ALWAYS(iImpl, Panic(EFbsPanicGlyphDataIteratorClosed));
+    __ASSERT_DEBUG(!iImpl->iGlyphBatch.IsEmpty(), Panic(EFbsPanicGlyphDataIteratorInvalidState));
+    return iImpl->iGlyphDataIterCodes[iImpl->iGlyphDataIterCodeIndex];
+    }
+
+
+/**
+Constructs a CGlyphDataIteratorImpl. 
+@param aFbsFontHandle The handle of the FbsFont that the iterator is working with.
+@param aGlyphCodes The array of glyph codes sent to RFbsGlyphDataIterator::Open()
+@param aCount The number of glyph codes in aGlyphCodes.
+ */
+CGlyphDataIteratorImpl::CGlyphDataIteratorImpl(TInt aFbsFontHandle, const TUint* aGlyphCodes, TInt aCount) :
+    iGlyphBatch(_FOFF(TGlyphBatchItem, iLink)),
+    iGlyphDataIterCodes(aGlyphCodes),
+    iGlyphDataIterCodeCount(aCount),
+    iGlyphDataIterCodeIndex(KFbsGlyphDataIterCodeInvalid),
+    iFbsFontHandle(aFbsFontHandle)
+    {
+    }
+
+/** 
+Destructor. Releases all resources, disconnects from server and frees any
+items in the list of batched items.
+ */
+CGlyphDataIteratorImpl::~CGlyphDataIteratorImpl()
+    {
+    if (iFbs)
+        {
+        if (iGlyphDataIterCodeIndex != KFbsGlyphDataIterCodeInvalid)
+            {
+            //Send the No-Op command to ensure that the "In Transit" RSgImage(s) are closed.
+            iFbs->SendCommand(EFbsMessNoOp);
+            }
+        RFbsSession::Disconnect();
+        iFbs = NULL;
+        }
+    while (!iGlyphBatch.IsEmpty())
+        {
+        TGlyphBatchItem* item = iGlyphBatch.First();
+        item->iImage.Close();
+        iGlyphBatch.Remove(*item);
+        delete item;
+        }
+    iGlyphBatch.Reset();
+    }
+
+/**
+Sets up the CGlyphDataIteratorImpl, populating the first batch of glyphs.
+Should only be called once, immediately after construction.
+ */
+TInt CGlyphDataIteratorImpl::Initialise()
+    {
+    __ASSERT_DEBUG(iFbsFontHandle, Panic(EFbsPanicGlyphDataIteratorInvalidState));    
+    __ASSERT_DEBUG(iGlyphDataIterCodes, Panic(EFbsPanicGlyphDataIteratorInvalidState));
+    __ASSERT_DEBUG(iGlyphDataIterCodeCount, Panic(EFbsPanicGlyphDataIteratorInvalidState));
+    __ASSERT_DEBUG(iGlyphDataIterCodeIndex == KFbsGlyphDataIterCodeInvalid, Panic(EFbsPanicGlyphDataIteratorInvalidState));
+    
+    // If the client already has a session open, this is just a reference counting exercise and should incur no performance impact.
+    TInt err = RFbsSession::Connect();
+    if (err == KErrNone)
+        {
+        iFbs = RFbsSession::GetSession();
+        err = UpdateGlyphBatch(0);
+        }
+    if (err == KErrNone)
+        {
+        iGlyphDataIterCodeIndex = 0;
+        UpdateGlyphRect();
+        }
+    return err;
+    }
+
+/**
+Increments the current iteration if possible, re-sending the request
+for more glyphs if the current batch of glyphs is down to the last
+item.
+@see RFbsGlyphDataIterator::Next()
+ */
+TInt CGlyphDataIteratorImpl::Next()
+    {
+    __ASSERT_DEBUG(!iGlyphBatch.IsEmpty(), Panic(EFbsPanicGlyphDataIteratorInvalidState));
+    if ( (iGlyphDataIterCodeIndex + 1) >= iGlyphDataIterCodeCount) 
+        {
+        return KErrNotFound; 
+        }
+    TInt err = UpdateGlyphBatch(iGlyphDataIterCodeIndex + 1);
+    if (err == KErrNone)
+        {
+        ++iGlyphDataIterCodeIndex;
+        // Close the current image and pop the head of the batch.
+        TGlyphBatchItem* item = iGlyphBatch.First();
+        item->iImage.Close();
+        iGlyphBatch.Remove(*item);
+        delete item;
+        __ASSERT_DEBUG(!iGlyphBatch.IsEmpty(), Panic(EFbsPanicGlyphDataIteratorInvalidState));
+        UpdateGlyphRect();
+        }
+    return err;
+    }
+
+/**
+Checks whether a call to the server is required to get a new batch of glyph 
+info, and processes the response from the server as necessary.
+
+@param aIndex Specifies the index into the glyph array which needs to be in
+the active glyph batch. If it is not there, a request is made to the server
+to get it.
+@return KErrNone if getting at least one glyph succeeded or a call to the
+    server was not necessary, otherwise one of the system wide error codes.
+@panic FBSCLI 31 (debug only), if the iterator is not open
+@panic FBSCLI 33 (debug only), if an unexpected number of glyphs was received
+    as a result of requesting glyphs from the server, or if the current batch
+    of glyphs is empty when there should be at least one item.
+ */
+TInt CGlyphDataIteratorImpl::UpdateGlyphBatch(TInt aIndex)
+    {
+    __ASSERT_DEBUG(Rng(0, aIndex, iGlyphDataIterCodeCount - 1), Panic(EFbsPanicGlyphDataIteratorIndexOutOfRange));
+
+    TInt err = KErrNone;
+    
+    TBool needMoreGlyphs = EFalse;
+    if (iGlyphBatch.IsEmpty())
+        {
+        // Current batch is empty, must request more. Should only get here when the iterator 
+        // is first opened, since one item should always be in the list from then on.
+        __ASSERT_DEBUG(aIndex == 0, Panic(EFbsPanicGlyphDataIteratorInvalidState));
+        needMoreGlyphs = ETrue;
+        }
+    else if (iGlyphBatch.IsLast(iGlyphBatch.First()))
+        {
+        // Only one item in the list. 
+        needMoreGlyphs = ETrue;
+        }
+    
+    if (needMoreGlyphs)
+        {
+        // If the array of batched images is empty OR only one left, means we need to request a new batch.
+        // We make sure there is at least one glyph in the batch so the iterator is always usable even
+        // when a failure to move to the next iteration occurs.
+    
+        TBool glyphAddedToBatch = EFalse;
+        TUint glyphCodes[KMaxGlyphBatchSize];
+        
+        TInt numGlyphsToRequest = Min(iGlyphDataIterCodeCount - aIndex, KMaxGlyphBatchSize);        
+        (void)Mem::Copy(glyphCodes, &(iGlyphDataIterCodes[aIndex]), sizeof(TUint) * numGlyphsToRequest);
+        TPckg<TUint[KMaxGlyphBatchSize]> argGlyphCodes(glyphCodes);
+        
+        TGlyphImageInfo rcvdGlyphInfo[KMaxGlyphBatchSize];
+        TPckg<TGlyphImageInfo[KMaxGlyphBatchSize]> argGlyphInfo(rcvdGlyphInfo);
+        
+        if (numGlyphsToRequest < KMaxGlyphBatchSize)
+            {
+            argGlyphCodes.SetLength(numGlyphsToRequest * sizeof(TUint));
+            argGlyphInfo.SetLength(numGlyphsToRequest * sizeof(TGlyphImageInfo));
+            }
+        
+        err = iFbs->SendCommand(EFbsMessGetGlyphs, TIpcArgs(iFbsFontHandle, &argGlyphCodes, &argGlyphInfo));
+        if (err == KErrNone)
+            {
+            __ASSERT_DEBUG(argGlyphInfo.Length() % sizeof(TGlyphImageInfo) == 0, Panic(EFbsPanicGlyphDataIteratorInvalidState));
+            TInt numRcvdGlyphs = argGlyphInfo.Length() / sizeof(TGlyphImageInfo);
+            __ASSERT_DEBUG(numRcvdGlyphs > 0, Panic(EFbsPanicGlyphDataIteratorInvalidState));
+            __ASSERT_DEBUG(numRcvdGlyphs <= KMaxGlyphBatchSize, Panic(EFbsPanicGlyphDataIteratorInvalidState));
+            
+            // Store the received glyph data, and open the image handles so that the IDs
+            // will not be released by FbServ between now and the client using them.
+            // If a failure occurs while processing one of the recevied glyphs,
+            // abort the rest but keep the ones that succeeded.
+            for (TInt i = 0; (i < numRcvdGlyphs) && (err == KErrNone); ++i)
+                {
+                TGlyphBatchItem* glyphEntry = new TGlyphBatchItem;
+                if (!glyphEntry)
+                    {
+                    err = KErrNoMemory;
+                    }
+                else
+                    {
+                    glyphEntry->iInfo = rcvdGlyphInfo[i];
+                    
+                    RSgImage glyphImage;
+                    if (rcvdGlyphInfo[i].iImageId != KSgNullDrawableId)
+                        {
+                        err = glyphEntry->iImage.Open(rcvdGlyphInfo[i].iImageId);
+                        }
+                    if (err == KErrNone)
+                        {
+                        iGlyphBatch.AddLast(*glyphEntry);
+                        glyphAddedToBatch = ETrue;
+                        }
+                    else
+                        {
+                        delete glyphEntry;
+                        }
+                    }
+                }
+            }
+        if (err != KErrNone && glyphAddedToBatch)
+            {
+            // There was an error adding an item to the batch. Rather than return the
+            // error to the client, ignore it and use what glyphs we successfully batched.
+            err = KErrNone; 
+            }
+        }    
+    return err;
+    }
+
+/**
+Updates the glyph rectangle member based on the current glyph metrics.
+@post The iGlyphDataIterRect member is updated to reflect the position
+    and size of the currently active glyph.
+ */
+void CGlyphDataIteratorImpl::UpdateGlyphRect()
+    {
+    iGlyphDataIterRect.iTl = TPoint(iGlyphBatch.First()->iInfo.iPosX, iGlyphBatch.First()->iInfo.iPosY);
+    iGlyphDataIterRect.SetSize(TSize(iGlyphBatch.First()->iInfo.iMetrics.Width(), iGlyphBatch.First()->iInfo.iMetrics.Height()));
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/sfbs/fbsglyphdataiterator.h	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,53 @@
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+#ifndef FBSGLYPHDATAITERATOR_H
+#define FBSGLYPHDATAITERATOR_H
+
+#include <e32def.h>
+#include <fbs.h>
+#include <sgresource/sgimage.h>
+
+class CGlyphDataIteratorImpl;
+class TOpenFontCharMetrics;
+
+/**
+An iterator class to provide access to glyph image data and metrics, 
+one glyph per iteration.
+@publishedPartner
+@prototype
+*/
+NONSHARABLE_CLASS(RFbsGlyphDataIterator)
+	{
+public:
+	IMPORT_C RFbsGlyphDataIterator();
+	IMPORT_C TInt Open(CFbsFont& aFont, const TUint* aGlyphCodes, TInt aCount);
+	IMPORT_C TInt Next();
+	IMPORT_C void Close();
+	IMPORT_C const RSgImage& Image() const;
+	IMPORT_C const TRect& Rect() const;
+	IMPORT_C const TOpenFontCharMetrics& Metrics() const;
+	IMPORT_C TUint GlyphCode() const;
+	
+private:
+	RFbsGlyphDataIterator(const RFbsGlyphDataIterator&);
+	const RFbsGlyphDataIterator& operator =(const RFbsGlyphDataIterator&);
+	
+private:
+    CGlyphDataIteratorImpl* iImpl;
+	};
+
+#endif /* FBSGLYPHDATAITERATOR_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/sfbs/fbsglyphmetricsarray.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,274 @@
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+
+#include <e32def.h>
+#include <gdi.h>
+#include <graphics/gdi/gdistructs.h>
+#include <graphics/gdi/gdiconsts.h>
+#include <graphics/fbsglyphmetricsarray.h>
+#include "UTILS.H"
+#include "FbsMessage.h"
+
+// 'most significant bit' flag to ensure value is interpreted as a glyph code rather than an ascii code
+const TUint KGlyphCodeFlag = 0x80000000;      
+
+extern void Panic(TFbsPanic aPanic);
+
+/** Helper function for converting an offset (that was calculated using
+PointerToOffset()) back to a pointer relative to the passed heap base.
+@param aOffset The offset to be converted to a pointer.
+@param aHeapBase A pointer to the heap base of the current process.
+@return A pointer relative to the passed heap base.
+*/
+static TAny* OffsetToPointer(const TInt aOffset, TUint8* aHeapBase)
+    {
+    if ( (aOffset != 0) && (aHeapBase != NULL) )
+        {
+        return (TAny*)(aOffset + aHeapBase);
+        }
+    return NULL;
+    }
+
+/**
+Constructs an empty RFbsGlyphMetricsArray instance. This will not allocate any memory.
+ */
+EXPORT_C RFbsGlyphMetricsArray::RFbsGlyphMetricsArray() :
+    iGlyphCodes(NULL)
+    {
+    }
+
+/**
+Allocates the memory for the array if it has not already been allocated, and 
+populates the RFbsGlyphMetricsArray with the metrics information for aCount glyph 
+codes passed in as the array aGlyphCodes, for the font aFont. If the operation 
+is successful, KErrNone is returned and the array is populated with glyph 
+metrics data. Each entry in the array will be in the same order as the 
+corresponding codes in aGlyphCodes.
+
+The memory allocated to aGlyphCodes can be freed after the call to Get().
+
+Get() can be called on an RFbsGlyphMetricsArray multiple times without calling 
+Close(), since the memory for the array is not de-allocated until a call to 
+Close(). Calls to Get() will cause the previous content of the array to be 
+overwritten.
+
+In the event of an error code other than KErrNone, the state of the array
+will remain unchanged.
+ 
+@param aFont A font which to retrieve the glyph metrics for.
+@param aGlyphCodes An array of glyph codes to retrieve the metrics for.
+@param aCount The number of glyph codes in aGlyphCodes.
+
+@return
+	KErrNone, if the array is successfully populated with glyph metrics;
+	KErrNoMemory, if insufficient system memory is available;
+	KErrArgument, if aCount is negative or zero, or if aGlyphCodes is null;
+	KErrNotSupported, if aFont is a bitmap font.
+*/
+EXPORT_C TInt RFbsGlyphMetricsArray::Get(CFbsFont& aFont, const TUint* aGlyphCodes, TInt aCount)
+	{
+    if ((aCount <= 0) || !aGlyphCodes)
+        {
+        return KErrArgument;
+        }
+    if (iMetrics.Reserve(aCount) != KErrNone)
+        {
+        return KErrNoMemory;
+        }
+    if (!aFont.Address()->IsOpenFont())
+        {
+        return KErrNotSupported;
+        }
+    
+    iGlyphCodes = aGlyphCodes;
+    iCount = aCount;
+    TInt err = KErrNone;
+    
+    
+    // If iMetrics array already has a count greater than aCount, remove entries
+    // until count is same as aCount so that we can reuse the existing entries.
+    TInt numEntriesToRemove = iMetrics.Count() - aCount;
+    while (0 < numEntriesToRemove)
+        {
+        --numEntriesToRemove;
+        iMetrics.Remove(aCount + numEntriesToRemove);
+        }
+    const TInt indexToGrowArrayAt = iMetrics.Count();
+    
+    CBitmapFont* font = aFont.Address();
+    TUint ipcGlyphArrayIndex[KMaxMetricsBatchSize];
+    TInt ipcGlyphArrayIndexCount = 0;   
+    const TUint8* dummyBitmap;
+    TOpenFontCharMetrics charDataMetrics;
+            
+    for (TInt i = 0; i < aCount && (err == KErrNone); ++i)
+        {
+        // First check the cache in shared memory - if present it will avoid using IPC.
+        if (font->GetCharacterData(aFont.iFbs->ServerSessionHandle(), aGlyphCodes[i] | KGlyphCodeFlag, charDataMetrics, dummyBitmap))
+            {
+            if (i < indexToGrowArrayAt)
+                {
+                iMetrics[i] = charDataMetrics;
+                }
+            else
+                {
+                // Extending the size of the array, but memory is already reserved.
+                (void) iMetrics.Append(charDataMetrics);    
+                }
+            }            
+        else
+            {
+            // Not found in shared memory - instead add the index to index array, which will
+            // be processed when the array is full or at the end of the loop.
+            ipcGlyphArrayIndex[ipcGlyphArrayIndexCount++] = i;
+            if (ipcGlyphArrayIndexCount == KMaxMetricsBatchSize)
+                {
+                err = SendRecvGlyphMetrics(aFont, ipcGlyphArrayIndex, ipcGlyphArrayIndexCount, &iMetrics);
+                ipcGlyphArrayIndexCount = 0;
+                }
+            else if (i >= indexToGrowArrayAt)
+                {
+                // Add a metrics placeholder to keep the size of the array and the currently
+                // processed glyph in sync. It will later get overwritten when it is received
+                // from the server.
+                (void) iMetrics.Append(charDataMetrics);
+                }
+            }
+        }
+    if ((err == KErrNone) && (ipcGlyphArrayIndexCount != 0))
+        {
+        err = SendRecvGlyphMetrics(aFont, ipcGlyphArrayIndex, ipcGlyphArrayIndexCount, &iMetrics);
+        }
+    
+    __ASSERT_DEBUG((err != KErrNone) || (aCount == iMetrics.Count()), Panic(EFbsPanicGlyphMetricsArrayInvalidState));  
+    
+    return err;    
+	}
+/**
+Helper function for Get(). 
+Given a list of indices into a glyph code array, the corresponding glyph
+codes are made into a single list sent to the server, and the received glyph
+metrics are set in the array of metrics at the corresponding indices.
+
+@param aFont The font to receive the glyph metrics of.
+@param aArrayIndices An array of indices into the glyphcode array which
+    will be sent for requesting of metrics to the server.
+@param aArrayIndicesCount The number of glyphs in aGlyphArrayIndices.
+@param aMetrics The array which will store the resulting metrics objects upon
+    completion.
+@return KErrNone if successful, otherwise one of the system-wide error codes. 
+
+@panic FBSCLI 39 in debug builds only, if the parameters to this method are
+    invalid, or if the output array is of the wrong size when appending to it.
+ */
+TInt RFbsGlyphMetricsArray::SendRecvGlyphMetrics(CFbsFont& aFont, TUint* aArrayIndices, TInt aArrayIndicesCount, RArray<TOpenFontCharMetrics>* aMetrics) const
+    {
+    __ASSERT_DEBUG(aArrayIndicesCount > 0, Panic(EFbsPanicGlyphDataIteratorInvalidState)); 
+    __ASSERT_DEBUG(aArrayIndicesCount <= KMaxMetricsBatchSize, Panic(EFbsPanicGlyphDataIteratorInvalidState)); 
+    __ASSERT_DEBUG(aArrayIndices, Panic(EFbsPanicGlyphDataIteratorInvalidState));
+    TInt err = KErrNone;
+    
+    TUint glyphCodes[KMaxMetricsBatchSize];
+    for (TInt i = 0; i < aArrayIndicesCount; ++i)
+        {
+        glyphCodes[i] = iGlyphCodes[aArrayIndices[i]];
+        }
+    
+    TInt rcvdGlyphMetricsOffsets[KMaxMetricsBatchSize];
+    TPckg<TUint[KMaxMetricsBatchSize]> argGlyphCodes(glyphCodes);
+    TPckg<TInt[KMaxMetricsBatchSize]> argGlyphMetricsOffsets(rcvdGlyphMetricsOffsets);
+    if (aArrayIndicesCount < KMaxMetricsBatchSize)
+        {
+        argGlyphCodes.SetLength(aArrayIndicesCount * sizeof(TUint));
+        argGlyphMetricsOffsets.SetLength(aArrayIndicesCount * sizeof(TInt));
+        }   
+    err = aFont.iFbs->SendCommand(EFbsMessGetGlyphMetrics, TIpcArgs(aFont.iHandle, &argGlyphCodes, &argGlyphMetricsOffsets));
+    
+    if (err == KErrNone)
+        {
+        TInt numRcvdMetrics = argGlyphMetricsOffsets.Length() / sizeof(TInt);
+        __ASSERT_DEBUG(argGlyphMetricsOffsets.Length() % sizeof(TInt) == 0, Panic(EFbsPanicGlyphMetricsArrayInvalidState));
+        __ASSERT_DEBUG(numRcvdMetrics == aArrayIndicesCount, Panic(EFbsPanicGlyphMetricsArrayInvalidState));
+        
+        if (numRcvdMetrics == aArrayIndicesCount)
+            {
+            TInt arrayCount = aMetrics->Count();
+            TUint8* heapBase = aFont.iFbs->HeapBase();
+            for (TInt rcvdMetricsItem = 0; rcvdMetricsItem < numRcvdMetrics; ++rcvdMetricsItem)
+                {
+                TInt arrayIndex = aArrayIndices[rcvdMetricsItem];
+                // The array should never need to grow more than one item. If the difference is larger, 
+                // it means the glyph and the metrics are not in sync.
+                __ASSERT_DEBUG(arrayIndex <= arrayCount, Panic(EFbsPanicGlyphMetricsArrayInvalidState));
+                
+                TInt metricsOffset = rcvdGlyphMetricsOffsets[rcvdMetricsItem];              
+                const TOpenFontCharMetrics* metrics = (const TOpenFontCharMetrics*)(OffsetToPointer(metricsOffset, heapBase));
+                
+                if (arrayIndex < arrayCount)
+                    {
+                    // Copy metrics into existing element
+                    (*aMetrics)[arrayIndex] = *metrics;
+                    }
+                else if (arrayIndex == arrayCount)
+                    {
+                    // Memory should already be reserved by GetGlyphMetricsArray()
+                    (void) aMetrics->Append(*metrics);    
+                    ++arrayCount;
+                    }
+                }
+            }
+        else
+            {
+            // did not receive the same number of glyphs as was asked.
+            err = KErrGeneral;
+            }
+        }
+    return err;
+    }
+
+/**
+Closes the array, and releases the memory for the array. Calling Close() on an 
+already closed RFbsGlyphMetricsArray has no effect. 
+
+In the typical case where the array is a member of a class, Close() should only 
+be called in the destructor of that class.
+ */
+EXPORT_C void RFbsGlyphMetricsArray::Close()
+	{
+	iMetrics.Close();
+	}
+
+/**
+Retrieves the glyph metrics for the glyph which was at position aIndex in the 
+array passed to Get().
+
+@param aIndex The index of the entry in the array to access.
+@return The metrics for the glyph at the requested index.
+@panic FBSCLI 32, if aIndex is out of bounds.
+ */
+EXPORT_C const TOpenFontCharMetrics& RFbsGlyphMetricsArray::operator[](TInt aIndex) const
+	{
+	__ASSERT_ALWAYS(aIndex >= 0 && aIndex < iMetrics.Count(), Panic(EFbsPanicGlyphMetricsArrayOutOfBounds));
+	return (iMetrics)[aIndex];
+	}
+
+/**
+@return The number of glyph metrics held in the array.
+ */
+EXPORT_C TInt RFbsGlyphMetricsArray::Count() const
+	{
+	return iMetrics.Count();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/sfbs/fbsglyphmetricsarray.h	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,47 @@
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef FBSGLYPHMETRICSARRAY_H
+#define FBSGLYPHMETRICSARRAY_H
+
+#include <e32def.h>
+#include <openfont.h>
+#include <fbs.h>
+
+/**
+@publishedPartner
+@prototype
+*/
+NONSHARABLE_CLASS(RFbsGlyphMetricsArray)
+	{
+public:
+	IMPORT_C RFbsGlyphMetricsArray();
+	IMPORT_C TInt Get(CFbsFont& aFont, const TUint* aGlyphCodes, TInt aCount);
+	IMPORT_C void Close();
+	IMPORT_C TInt Count() const;
+	IMPORT_C const TOpenFontCharMetrics& operator[](TInt aIndex) const;
+	
+private:
+	RFbsGlyphMetricsArray(const RFbsGlyphMetricsArray&);
+	const RFbsGlyphMetricsArray& operator =(const RFbsGlyphMetricsArray&);
+	TInt SendRecvGlyphMetrics(CFbsFont& aFont, TUint* aArrayIndices, TInt aArrayIndicesCount, RArray<TOpenFontCharMetrics>* aMetrics) const;    
+	
+private:
+	RArray<TOpenFontCharMetrics> iMetrics;
+	const TUint* iGlyphCodes;
+	TInt iCount;
+	};
+
+#endif /* FBSGLYPHMETRICSARRAY_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/sfbs/fbsoogmmessage.h	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,45 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+// Message class defining the action desired in response to a notification from
+// FBserv's Out-of-Graphics-Memory plug-in.
+//
+#ifndef FBSOOGMMESSAGE_H
+#define FBSOOGMMESSAGE_H
+
+
+class TFbsOogmMessage
+    {
+public:
+
+    enum TOogmAction
+        {
+        EFbsOogmNoAction = 0,
+        EFbsOogmLowNotification,
+        EFbsOogmOkayNotification
+        };
+
+public:
+    inline TFbsOogmMessage();
+    inline TFbsOogmMessage( TOogmAction aOogmAction, TInt aBytesToFree, TInt aFlags );
+
+public:
+    TOogmAction iOogmNotification;
+    TInt iBytesToFree;
+    TInt iFlags;
+    };
+
+
+#include <graphics/fbsoogmmessage.inl>
+#endif // FBSOOGMMESSAGE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/sfbs/fbsoogmmessage.inl	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,33 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+#ifndef FBSOOGMMESSAGE_INL
+#define FBSOOGMMESSAGE_INL
+
+const TInt KFbsOogmBytesToFreeNone = 0;
+const TInt KFbsOogmFlagsClear = 0;
+
+
+inline TFbsOogmMessage::TFbsOogmMessage()
+: iOogmNotification( EFbsOogmNoAction ), iBytesToFree( KFbsOogmBytesToFreeNone ), iFlags( KFbsOogmFlagsClear )
+    {
+    }
+
+
+inline TFbsOogmMessage::TFbsOogmMessage( TOogmAction aOogmAction, TInt aBytesToFree, TInt aFlags )
+: iOogmNotification( aOogmAction ), iBytesToFree( aBytesToFree), iFlags( aFlags )
+    {
+    }
+
+#endif // FBSOOGMMESSAGE_INL
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/sfbs/fbsoogmplugin.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,162 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Graphics-Out-Of-Memory plugin for Font and Bitmap server.
+*
+*/
+
+#include <ecom/ecom.h>
+#include <ecom/implementationproxy.h>
+#include <graphics/fbsoogmmessage.h>
+#include <w32std.h>
+#include <FBS.H>
+
+#include "fbsoogmplugin.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "fbsoogmpluginTraces.h"
+#endif
+
+
+/**
+ Called by the GOoM monitor framework in the case of low GPU memory.
+
+ Note: In the case of failure, this framework method will do so silently.
+
+ @param aBytesToFree The amount of GPU memory to be freed.
+ */
+void CFbsOogmMonitorPlugin::FreeRam( TInt aBytesToFree, TInt aFlags )
+    {
+    OstTrace0( TRACE_NORMAL, CFBSOOGMMONITORPLUGIN_FREERAM, "> " );
+
+    if ( (NULL == RFbsSession::GetSession()) )
+         {
+         if ( KErrNone != RFbsSession::Connect() )
+             {
+             OstTrace0( TRACE_NORMAL, DUP2_CFBSOOGMMONITORPLUGIN_FREERAM, "< No FbsSession" );
+
+             return;
+             }
+
+         }
+
+    TFbsOogmMessage oogmMessage( TFbsOogmMessage::EFbsOogmLowNotification, aBytesToFree, aFlags );
+    (void)RFbsSession::GetSession()->ConveyOogmMessage( oogmMessage );
+
+    OstTrace0( TRACE_NORMAL, DUP1_CFBSOOGMMONITORPLUGIN_FREERAM, "< " );
+    }
+
+
+
+/**
+ Called by the GOoM monitor framework in the case of normal GPU memory-usage being permissible.
+
+ Note: In the case of failure, this framework method will do so silently.
+ */
+void CFbsOogmMonitorPlugin::MemoryGood( TInt aFlags )
+    {
+    OstTrace0( TRACE_NORMAL, CFBSOOGMMONITORPLUGIN_MEMORYGOOD, ">" );
+
+    if ( (NULL == RFbsSession::GetSession()) )
+         {
+        if ( KErrNone != RFbsSession::Connect() )
+            {
+            OstTrace0( TRACE_NORMAL, DUP2_CFBSOOGMMONITORPLUGIN_MEMORYGOOD, "< No FbsSession" );
+
+            return;
+            }
+
+         }
+
+    const TInt KOogmDummyIntegerArgument = 0;
+    TFbsOogmMessage oogmMessage( TFbsOogmMessage::EFbsOogmOkayNotification, KOogmDummyIntegerArgument, aFlags );
+    (void)RFbsSession::GetSession()->ConveyOogmMessage( oogmMessage );
+
+	OstTrace0( TRACE_NORMAL, DUP1_CFBSOOGMMONITORPLUGIN_MEMORYGOOD, "<" );
+    }
+
+
+
+/**
+
+ */
+CFbsOogmMonitorPlugin::CFbsOogmMonitorPlugin()
+    {
+    }
+
+
+
+/**
+
+ */
+CFbsOogmMonitorPlugin::~CFbsOogmMonitorPlugin()
+    {
+    RFbsSession::Disconnect();
+    }
+
+
+
+/**
+
+ */
+void CFbsOogmMonitorPlugin::ConstructL()
+    {
+    CGOomMonitorPluginBase::ConstructL();
+    }
+
+
+
+/**
+
+ */
+TAny* CreatePlugin()
+    {
+    CFbsOogmMonitorPlugin* self = new CFbsOogmMonitorPlugin;
+    if ( self )
+        {
+        TRAPD( err, self->ConstructL() );
+        if ( err != KErrNone )
+            {
+            delete self;
+            self = NULL;
+            }
+        }
+
+    return self;
+    }
+
+
+
+/**
+
+ */
+const TImplementationProxy ImplementationTable[] =
+    {
+    { {0x2002B638}, ::CreatePlugin }
+    };
+
+
+
+/**
+
+ */
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
+    {
+    OstTrace0( TRACE_NORMAL, _IMPLEMENTATIONGROUPPROXY, "> ::ImplementationGroupProxy" );
+    
+    aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ) ;
+    return ImplementationTable;
+    }
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/sfbs/fbsoogmplugin.h	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Graphics-Out-Of-Memory plugin for Font and Bitmap server.
+*
+*/
+
+#ifndef FBSOOGMPLUGIN_H
+#define FBSOOGMPLUGIN_H
+
+#include <goommonitorplugin.h>
+
+class CFbsOogmMonitorPlugin : public CGOomMonitorPlugin
+    {
+public:
+    CFbsOogmMonitorPlugin();
+    ~CFbsOogmMonitorPlugin();
+    void ConstructL();
+
+public:
+    void FreeRam( TInt aBytesToFree, TInt aFlags );
+    void MemoryGood( TInt aFlags );
+    };
+
+#endif /* FBSOOGMPLUGIN_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/sfbs/fbsoogmplugin.rss	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,53 @@
+/*
+* ============================================================================
+*  Name        : FbsOogmPlugin.rss
+*  Part of     : FbSrv OOGM Plugin
+*  Interface   :  
+*  Description : ECOM Resource file for Font and bitmap server OOGM Framework Plugin
+*
+*  Copyright © 2010 Nokia.  All rights reserved.
+*  This material, including documentation and any related computer
+*  programs, is protected by copyright controlled by Nokia.  All
+*  rights are reserved.  Copying, including reproducing, storing,
+*  adapting or translating, any or all of this material requires the
+*  prior written consent of Nokia.  This material also contains
+*  confidential information which may not be disclosed to others
+*  without the prior written consent of Nokia.
+* ============================================================================
+* Template version: 4.0
+*/
+
+#include <ecom/registryinfov2.rh>
+#include <goommonitorplugin.hrh>
+
+
+
+
+// ---------------------------------------------------------------------------
+// Registration info for ECOM framework.
+// ---------------------------------------------------------------------------
+//
+RESOURCE REGISTRY_INFO theInfo
+    {
+    resource_format_version = RESOURCE_FORMAT_VERSION_2; 
+    dll_uid = 0x2002B638;
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = KGOomPluginInterfaceUidValue;
+            implementations = 
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x2002B638;
+                    version_no = 1;
+                    display_name = "FbsOogmPlugin";
+                    opaque_data = "";
+					default_data = "FbsOogmPlugin";
+                    }
+                };       
+            }
+        };
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/sfbs/glyphatlas.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,1060 @@
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "glyphatlas.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "glyphatlasTraces.h"
+#endif
+
+
+extern void Panic(TFbsPanic aPanic);
+
+static TInt16 Load16(const TUint8* aPtr);
+static void DecodeBinaryData(const TSize& aGlyphSize, const TUint8* aEncodedData, TUint8* aByteData);
+static void DecodeBinaryDataExLarge(const TSize& aGlyphSize, const TUint8* aEncodedData, TUint8* aByteData);
+static void Convert1BppTo8Bpp(TUint32 aSrcData, TUint8*& aDestDataPtr, const TUint8* aDestDataPtrLimit);
+static void CopyCharLine(TUint8*& aByteDataPtr, TInt aWidthInBytes, const TUint8* aSrcData, TInt aBitShift, TInt16 aRepeatCount);
+
+// === CGlyphAtlas Functions ===
+
+/**
+Glyph Atlas constructor.
+@param aMaxCacheSizeInBytes The maximum amount of specialised graphics memory 
+	that the glyph atlas should use. If this value is KGlyphAtlasNoCacheLimit,
+	then there is no limit and the atlas will use as much memory as is available
+	in the system.
+*/
+CGlyphAtlas::CGlyphAtlas(TInt aMaxCacheSizeInBytes)
+	:iLruPageList(_FOFF(CGlyphAtlasPage, iLink)),
+	 iFontEntryArray(32, _FOFF(TFontEntryMap, iFont)),
+	 iMaxCacheSizeInBytes(aMaxCacheSizeInBytes),
+	 iMaxCacheSizeHigh(aMaxCacheSizeInBytes),
+	 iGpuCacheSizeLimitIsMax(ETrue)
+	{
+    iMaxCacheSizeLow = ( KGlyphAtlasNoCacheLimit == aMaxCacheSizeInBytes )
+                     ? KGlyphAtlasLowMemCacheLimitDefault
+                     : ( aMaxCacheSizeInBytes / KGlyphAtlasLowMemCacheLimitDivisor );
+	}
+
+/**
+Glyph Atlas destructor.
+Frees all the RSgImage handles, frees all the allocated system memory, and
+closes the Graphics Resource driver. 
+*/
+CGlyphAtlas::~CGlyphAtlas()
+	{
+	// cycle through all the font entries and destroy them
+	for (TInt ii = iFontEntryArray.Count()-1; ii >= 0; --ii)
+		{
+		DeleteFontEntry(iFontEntryArray[ii].iEntry);
+		}
+	iFontEntryArray.Close();
+	__ASSERT_DEBUG(iLruPageList.IsEmpty(), Panic(EFbsPanicGlyphAtlasInconsistentState));
+	
+	// there shouldn't be any remaining pages, but if there are, destroy them.
+	while (!iLruPageList.IsEmpty())
+		{
+		delete iLruPageList.First();
+		}
+	iSgDriver.Close();
+	}
+
+/**
+Factory constructor method. Creates a new glyph atlas.
+
+@param aMaxCacheSizeInBytes The size in bytes, to use as the upper limit
+	for the size of memory used by the glyph images in the atlas. If this
+	value is KGlyphAtlasNoCacheLimit, then there is no limit and the atlas
+	will use as much memory as is available in the system.
+
+@return A pointer to the newly-constructed atlas
+
+@leave KErrNoMemory if there was insufficient memory to create the atlas, 
+	or a system wide error code if its RSgDriver failed to open.
+*/
+CGlyphAtlas* CGlyphAtlas::NewL(TInt aMaxCacheSizeInBytes)
+	{
+	CGlyphAtlas* self = new (ELeave) CGlyphAtlas(aMaxCacheSizeInBytes);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(); // self;
+	return self;
+	}
+
+/**
+Two-phase constructor.
+@leave A system wide error code if RSgDriver failed to open.
+*/
+void CGlyphAtlas::ConstructL()
+	{
+	User::LeaveIfError(iSgDriver.Open());
+	}
+
+/**
+Retrieves a glyph from the atlas.
+If the glyph is found, the glyph data passed in is populated.
+
+@param[in] aFont The font the glyph belongs to.
+@param[in] aGlyphCode The glyph code for the glyph being requested.
+@param[out] aGlyphImageInfo The glyph image information if this function is successful.
+@return KErrNone if the glyph is found, KErrNotFound if not. 
+*/
+TInt CGlyphAtlas::GetGlyph(const CBitmapFont& aFont, TUint aGlyphCode, TGlyphImageInfo& aGlyphImageInfo)
+	{
+    OstTraceExt2( TRACE_NORMAL, CGLYPHATLAS_GETGLYPH, "> f=%x; gc=%04x",(TUint)&aFont, aGlyphCode);
+    
+	CGlyphAtlasFontEntry* fontEntry = FindFontEntry(aFont);
+	if (!fontEntry)
+		{
+        OstTrace0( TRACE_NORMAL, CGLYPHATLAS_GETGLYPH_END2, "< KErrNotFound");
+		return KErrNotFound;
+		}
+	TInt err = fontEntry->GetGlyph(aGlyphCode, aGlyphImageInfo);
+	
+	OstTraceExt5( TRACE_NORMAL, CGLYPHATLAS_GETGLYPH_END1, "< id=%08x%08x; w=%u; h=%u; err=%d", 
+	        (TUint)I64HIGH(aGlyphImageInfo.iImageId.iId), (TUint)I64LOW(aGlyphImageInfo.iImageId.iId),
+	        (TUint)aGlyphImageInfo.iMetrics.Width(), (TUint)aGlyphImageInfo.iMetrics.Height(), (TInt)err);
+	
+	return err;
+	}
+
+/**
+Adds a glyph to the atlas from a bitmap glyph and retrieves the glyph data.
+If there is insufficient memory to create a RSgImage, then the least recently 
+used pages (and all the glyphs contained within) are removed until there is 
+enough memory to continue.
+
+@param[in] aFont The font the glyph belongs to.
+@param[in] aArgs The information needed to create a glyph.
+@param[out] aGlyphImageInfo Upon return contains all the glyph image information needed to use the 
+		glyph in another process.
+@return KErrNone if the glyph was successfully added or other system-wide error.
+*/
+TInt CGlyphAtlas::AddGlyph(const CBitmapFont& aFont, const TAddGlyphArgs& aArgs, TGlyphImageInfo& aGlyphImageInfo)
+	{
+	OstTraceDefExt5( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, CGLYPHATLAS_ADDGLYPH, "> f=%x; bp=%08x; gc=%04x; w=%u; h=%u", 
+	        (TUint)&aFont, (TUint)aArgs.iBitmapPointer, aArgs.iGlyphCode, 
+	        aArgs.iMetrics->Width(), aArgs.iMetrics->Height());
+	
+    // Find font entry and create if none found
+	CGlyphAtlasFontEntry* fontEntry = FindFontEntry(aFont);
+	TBool isNewFont = EFalse;
+	if (!fontEntry)
+		{
+		// Create a new font.
+		fontEntry = CreateFontEntry(aFont);
+		if (!fontEntry)
+			{
+            OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, CGLYPHATLAS_ADDGLYPH_END2, "< KErrNoMemory");
+			return KErrNoMemory;
+			}
+		isNewFont = ETrue;
+		}
+	TInt glyphSizeInBytes = 0;
+	TInt err = fontEntry->AddGlyph(aArgs, aGlyphImageInfo, glyphSizeInBytes);
+	if (KErrNone != err)
+		{
+		if (isNewFont)
+			{
+			DeleteFontEntry(fontEntry);
+			}
+		OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, CGLYPHATLAS_ADDGLYPH_END3, "< err=%d", err);
+		return err;
+		}
+	iCacheSizeInBytes += glyphSizeInBytes;
+
+	// If there is a cache limit and it is now exceeded, remove the least
+	// recently used pages until the cache size is within the upper limit. Do 
+	// not remove the page relating to the glyph which is being added, which is 
+	// now at the head of the LRU array.
+	if (iMaxCacheSizeInBytes != KGlyphAtlasNoCacheLimit)
+		{
+		TBool morePagesToDelete = ETrue;
+		while ((iCacheSizeInBytes > iMaxCacheSizeInBytes) && morePagesToDelete)
+			{
+			morePagesToDelete = DeleteLeastRecentlyUsedPage(EFalse);
+			}
+		}
+	
+	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, CGLYPHATLAS_ADDGLYPH_END1, "< id=%08x%08x", 
+	            I64HIGH(aGlyphImageInfo.iImageId.iId), I64LOW(aGlyphImageInfo.iImageId.iId));
+    
+	return KErrNone;
+	}
+
+/**
+Releases all glyphs associated with a particular font when it has been
+released by the font system.
+
+@param aFont The font which is released.
+ */
+void CGlyphAtlas::FontReleased(const CBitmapFont& aFont)
+	{
+	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, CGLYPHATLAS_FONTRELEASED, "> f=%x", (TUint)&aFont);
+	
+    TInt index = iFontEntryArray.FindInUnsignedKeyOrder(TFontEntryMap(&aFont, NULL));
+	if (KErrNotFound == index)
+		{
+        OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, CGLYPHATLAS_FONTRELEASED_END2, "< KErrNotFound");
+		return;
+		}
+	CGlyphAtlasFontEntry* fontEntry = iFontEntryArray[index].iEntry;
+	iCacheSizeInBytes -= fontEntry->SizeInBytes();
+	delete fontEntry;
+	iFontEntryArray.Remove(index);
+	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, CGLYPHATLAS_FONTRELEASED_END3, "< KErrNone");
+	}
+
+/**
+Searches the array of font entries to find the entry for the given font.
+If the font entry is found, the entry is returned. If not a NULL pointer is 
+returned.
+
+@param aFont The font to match an entry with.
+@return The font entry if a match is found, NULL if not. 
+*/
+CGlyphAtlasFontEntry* CGlyphAtlas::FindFontEntry(const CBitmapFont& aFont) const
+	{
+	TFontEntryMap entryToMatch(&aFont, NULL);
+	TInt index = iFontEntryArray.FindInUnsignedKeyOrder(entryToMatch);
+	if (KErrNotFound == index)
+		{
+		return NULL;
+		}
+	return iFontEntryArray[index].iEntry;
+	}
+
+/**
+Deletes the given font entry.
+The mapping from the font to the font entry is removed.
+
+@param aFontEntry The entry to delete.
+*/
+void CGlyphAtlas::DeleteFontEntry(CGlyphAtlasFontEntry* aFontEntry)
+	{
+    __ASSERT_DEBUG(aFontEntry, Panic(EFbsPanicGlyphAtlasInconsistentState));
+    TInt index = iFontEntryArray.FindInUnsignedKeyOrder(TFontEntryMap(&aFontEntry->Font(), NULL));
+    __ASSERT_DEBUG(KErrNotFound != index, Panic(EFbsPanicGlyphAtlasInconsistentState));
+    if (KErrNotFound != index)
+        {
+        iFontEntryArray.Remove(index);
+        }
+    iCacheSizeInBytes -= aFontEntry->SizeInBytes();
+    delete aFontEntry;
+	}
+
+/**
+Moves the given page to the front (the position of the most recently used page) 
+of the usage order list.
+
+@param aPage The most recently used page.
+*/
+void CGlyphAtlas::MovePageToFront(CGlyphAtlasPage& aPage)
+	{
+	aPage.MoveToFirstInQueue(iLruPageList);
+	}
+
+/**
+Creates a font entry from the given font and adds a mapping from the font 
+to the font entry.
+If successful, the font entry is returned.
+If either the creation of the font entry or the adding the mapping fails, then 
+a NULL pointer is returned.
+
+@param aFont The font used to create a font entry from.
+@return A new font entry if successful, NULL if not.
+*/
+CGlyphAtlasFontEntry* CGlyphAtlas::CreateFontEntry(const CBitmapFont& aFont)
+	{
+	CGlyphAtlasFontEntry* fontEntry = new CGlyphAtlasFontEntry(aFont, *this);
+	if (!fontEntry)
+		{
+		return NULL;
+		}
+	// Add font entry to font entry array
+	TFontEntryMap fontEntryMap(&aFont, fontEntry);
+	TInt err = iFontEntryArray.InsertInUnsignedKeyOrder(fontEntryMap);
+	__ASSERT_DEBUG(KErrAlreadyExists != err, Panic(EFbsPanicGlyphAtlasInconsistentState));
+	if (KErrNone != err)
+		{
+		delete fontEntry;
+		fontEntry = NULL;
+		}
+	return fontEntry;
+	}
+
+/**
+Deletes the least recently used page and removes it from the list of pages
+held by the atlas.
+
+@param aAllowMruPageDeletion ETrue if the most recently used page can be deleted, 
+	EFalse otherwise.
+@return ETrue, if there are pages remaining in the atlas after the deletion, EFalse
+	otherwise. If there is only one page in the atlas and aAllowMruPageDeletion is EFalse,
+	EFalse is returned. 
+*/
+TBool CGlyphAtlas::DeleteLeastRecentlyUsedPage(TBool aAllowMruPageDeletion)
+	{
+    OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, CGLYPHATLAS_DELETELEASTRECENTLYUSEDPAGE, "> mru=%d", aAllowMruPageDeletion );
+    
+	CGlyphAtlasPage* lruPage = NULL;
+	if (!iLruPageList.IsEmpty())
+		{
+		lruPage = iLruPageList.Last();
+		if (!aAllowMruPageDeletion && (lruPage == iLruPageList.First()))
+			{
+			lruPage = NULL;
+			}
+		}
+	TBool canDeleteMorePages = EFalse;
+	if (lruPage)
+		{
+		iCacheSizeInBytes -= lruPage->SizeInBytes();
+		CGlyphAtlasFontEntry& fontEntry = lruPage->FontEntry();
+		fontEntry.DeletePage(lruPage);
+		lruPage = NULL;
+		if (fontEntry.IsEmpty())
+			{
+			DeleteFontEntry(&fontEntry);
+			}
+		canDeleteMorePages = !iLruPageList.IsEmpty();
+		}
+	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, CGLYPHATLAS_DELETELEASTRECENTLYUSEDPAGE_END, "< more=%u; size=%u", (TUint)canDeleteMorePages, iCacheSizeInBytes);
+	return canDeleteMorePages;
+	}
+
+/**
+Utility function that calculates the number of unique fonts associated with the atlas.
+@return Number of fonts in the atlas.
+ */
+TInt CGlyphAtlas::FontCount() const
+	{
+	return iFontEntryArray.Count();
+	}
+
+/**
+Utility function that calculates the number of glyphs across all fonts stored in
+the atlas.
+@return Number of glyphs in the atlas.
+ */
+TInt CGlyphAtlas::GlyphCount() const
+	{
+	TInt glyphCount = 0;
+	for (TInt ii = iFontEntryArray.Count() - 1; ii >= 0; --ii)
+		{
+		glyphCount += iFontEntryArray[ii].iEntry->GlyphCount();
+		}
+	return glyphCount;
+	}
+
+/**
+Utility function that calculates the number of glyphs for a given font in the atlas.
+@param The font to return the number of glyphs for.
+@return Number of glyphs in the atlas.
+ */
+TInt CGlyphAtlas::GlyphCount(const CBitmapFont& aFont) const
+	{
+	CGlyphAtlasFontEntry* fontEntry = FindFontEntry(aFont);
+	return (fontEntry) ? fontEntry->GlyphCount() : 0;
+	}
+
+void CGlyphAtlas::GetGlyphCacheMetrics( TGlyphCacheMetrics& aGlyphCacheMetrics )
+    {
+    aGlyphCacheMetrics.iMaxCacheSizeInBytes = iMaxCacheSizeInBytes;
+    aGlyphCacheMetrics.iMaxCacheSizeHigh = iMaxCacheSizeHigh;
+    aGlyphCacheMetrics.iMaxCacheSizeLow = iMaxCacheSizeLow;
+    aGlyphCacheMetrics.iCacheSizeInBytes = iCacheSizeInBytes;
+    aGlyphCacheMetrics.iGpuCacheSizeLimitIsMax = iGpuCacheSizeLimitIsMax;
+    }
+
+/**
+ Function to release the GPU cache. Called in response to the GoomMonitor's
+ requirement to reduce GPU memory use.
+
+ @param aBytes. The amount of memory the GOoM framework would like us to relinquish.
+ @param aFlags. The flags conveyed from the GOoM monitor framework.
+*/
+void CGlyphAtlas::ReleaseGpuMemory( TInt /*aBytes*/, TInt /*aFlags*/ )
+    {
+    OstTraceDefExt2( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, CGLYPHATLAS_RELEASEGPUMEMORY, "> max=%d; size=%d", iMaxCacheSizeInBytes, iCacheSizeInBytes);
+
+    if ( iCacheSizeInBytes > 0 )
+        {
+        while( DeleteLeastRecentlyUsedPage(ETrue) )
+            {
+            // Do nothing
+            }
+        }
+
+    // If appropriate, reduce the cache-size limit.
+    if ( GpuCacheSizeLimitIsMax() )
+        {
+        SwitchGpuCacheSizeLimit();
+        }
+
+    OstTraceDefExt2( OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, CGLYPHATLAS_RELEASEGPUMEMORY_EXIT, "< max=%d; size=%d", iMaxCacheSizeInBytes, iCacheSizeInBytes);
+    }
+
+/**
+ Function to establish GPU memory use. Called in response to the GoomMonitor's
+ notification that GPU memory may once more be utilised in the usual manner.
+
+ @param aFlags. The flags conveyed from the GOoM monitor framework.
+ */
+void CGlyphAtlas::InstateGpuMemory( TInt /*aFlags*/ )
+    {
+    OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, CGLYPHATLAS_INSTATEGPUMEMORY, "> max=%d", iMaxCacheSizeInBytes );
+
+    // If appropriate, reinstate the full cache-size limit.
+    if ( !GpuCacheSizeLimitIsMax() )
+        {
+        SwitchGpuCacheSizeLimit();
+        }
+
+    OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_NORMAL, CGLYPHATLAS_INSTATEGPUMEMORY_EXIT, "< max=%d", iMaxCacheSizeInBytes );
+    }
+
+/**
+ Utility function to toggle between full and reduced GPU cache-size limits.
+
+ Use in conjunction with TBool GpuCacheSizeLimitIsMax()
+ */
+void CGlyphAtlas::SwitchGpuCacheSizeLimit()
+    {
+    if ( GpuCacheSizeLimitIsMax() )
+        {
+        // The short-circuit operator obviates tautological conditionals.
+        while ( (iCacheSizeInBytes >= iMaxCacheSizeLow) && DeleteLeastRecentlyUsedPage(ETrue) )
+            {
+            // Do Nothing...
+            }
+
+        iMaxCacheSizeInBytes = iMaxCacheSizeLow;
+        iGpuCacheSizeLimitIsMax = EFalse;
+        }
+    else
+        {
+        iMaxCacheSizeInBytes = iMaxCacheSizeHigh;
+        iGpuCacheSizeLimitIsMax = ETrue;
+        }
+    }
+
+
+/**
+ Utility function to report whether the GPU cache-size limit is set to the maximum permissible
+ level, or to its reduced level.
+
+ @return ETrue if the cache-size is set to the maximum permissible limit.
+         EFalse if it is set to the reduced limit.
+ */
+TBool CGlyphAtlas::GpuCacheSizeLimitIsMax() const
+    {
+    return iGpuCacheSizeLimitIsMax;
+    }
+
+// === CGlyphAtlasFontEntry Functions ===
+/**
+Font entry constructor.
+
+@param aFont The font to which this font entry should be associated.
+@param aGlyphAtlas The glyph atlas to which this font entry belongs.
+*/
+CGlyphAtlasFontEntry::CGlyphAtlasFontEntry(const CBitmapFont& aFont, CGlyphAtlas& aGlyphAtlas)
+	:iFont(aFont),
+	 iPageArray(32, _FOFF(TPageMap, iGlyphCode)),
+	 iAtlas(aGlyphAtlas)
+	{
+	}
+
+/**
+Font entry destructor.
+Destroys the pages owned by the font entry.
+*/
+CGlyphAtlasFontEntry::~CGlyphAtlasFontEntry()
+	{
+	// cycle through all the font entries and destroy them
+	for (TInt ii = iPageArray.Count()-1; ii >= 0; --ii)
+		{
+		DeletePage(iPageArray[ii].iPage);
+		}
+	__ASSERT_DEBUG(iSizeInBytes == 0, Panic(EFbsPanicGlyphAtlasInconsistentState));
+	iPageArray.Close();
+	}
+
+/**
+Deletes the given page.
+The page mapping is removed and the page is deleted.
+
+@param aPage The page to delete.
+*/
+void CGlyphAtlasFontEntry::DeletePage(CGlyphAtlasPage* aPage)
+	{
+    __ASSERT_DEBUG(aPage, Panic(EFbsPanicGlyphAtlasInconsistentState));
+    __ASSERT_DEBUG(iPageArray.Count() > 0, Panic(EFbsPanicGlyphAtlasInconsistentState));
+		
+    TInt numGlyphsInPage = aPage->GlyphCount();
+
+    for (TInt ii = 0; ii < numGlyphsInPage; ++ii)
+        {
+        TInt index = iPageArray.FindInUnsignedKeyOrder(TPageMap(aPage->GlyphCodeAt(ii), NULL));
+
+        __ASSERT_DEBUG(KErrNotFound != index, Panic(EFbsPanicGlyphAtlasInconsistentState));
+
+        if (KErrNotFound != index)
+            {
+            iPageArray.Remove(index);
+            iPageArray.GranularCompress();
+            }
+        }
+    iSizeInBytes -= aPage->SizeInBytes();
+    delete aPage;
+
+	}
+
+/**
+Adds a glyph to the font from a bitmap glyph and gets the glyph image info back.
+
+@param[in] aArgs The information needed to create a glyph.
+@param[out] aGlyphImageInfo Upon return contains all the glyph image information needed to use the 
+		glyph in another process.
+@param[out] aSizeInBytes Upon return contains the size of the added glyph's image data in bytes.
+@return KErrNone if the glyph was successfully added or other system-wide error.
+*/
+TInt CGlyphAtlasFontEntry::AddGlyph(const CGlyphAtlas::TAddGlyphArgs& aArgs, TGlyphImageInfo& aGlyphImageInfo, TInt& aSizeInBytes)
+	{
+    CGlyphAtlasPage* newPage = new CGlyphAtlasPage(*this);
+	if (!newPage)
+		{
+		return KErrNoMemory;
+		}
+	
+	TInt err = newPage->AddGlyph(aArgs, aGlyphImageInfo, aSizeInBytes);
+	if (KErrNone != err)
+		{
+		delete newPage;
+		return err;
+		}
+
+	err = iPageArray.InsertInUnsignedKeyOrder(TPageMap(aArgs.iGlyphCode, newPage));
+	__ASSERT_DEBUG(KErrAlreadyExists != err, Panic(EFbsPanicGlyphAtlasInconsistentState));
+	if (KErrNone != err)
+		{
+		delete newPage;
+		return err;
+		}
+	iSizeInBytes += aSizeInBytes;
+	iAtlas.MovePageToFront(*newPage);
+	return err;
+	}
+
+/**
+Searches the array of pages to find the page containing the given glyph.
+If the page is found, the glyph image info is populated and the page is moved 
+to the front of the Glyph Atlas' LRU page array.
+
+@param[in] aGlyphCode The glyph code for the glyph being requested.
+@param[out] aGlyphImageInfo Upon return contains all the glyph image information needed to use the 
+		glyph in another process.
+@return KErrNone if the glyph was found, KErrNotFound if not. 
+*/
+TInt CGlyphAtlasFontEntry::GetGlyph(TUint aGlyphCode, TGlyphImageInfo& aGlyphImageInfo)
+	{
+	TInt index = iPageArray.FindInUnsignedKeyOrder(TPageMap(aGlyphCode, NULL));
+	if (KErrNotFound == index)
+		{
+		return KErrNotFound;
+		}
+	CGlyphAtlasPage* page = iPageArray[index].iPage;
+	page->GetGlyph(aGlyphCode, aGlyphImageInfo);
+	iAtlas.MovePageToFront(*page);
+	return KErrNone;
+	}
+
+/**
+Gets the font associated with the font entry.
+
+@return The font associated with this entry. 
+*/
+const CBitmapFont& CGlyphAtlasFontEntry::Font() const
+	{
+	return iFont;
+	}
+
+/**
+Gets the amount of memory allocated for all the image data for this font.
+
+@return The size of the font's image data in bytes.
+*/
+TInt CGlyphAtlasFontEntry::SizeInBytes() const
+	{
+	return iSizeInBytes;
+	}
+
+/**
+Tests whether the font entry has any pages.
+
+@return ETrue if the font entry does not contain any pages, EFalse if it does..
+*/
+TBool CGlyphAtlasFontEntry::IsEmpty() const
+	{
+	if (iPageArray.Count() == 0)
+		{
+		__ASSERT_DEBUG(iSizeInBytes == 0, Panic(EFbsPanicGlyphAtlasInconsistentState));
+		return ETrue;
+		}
+	return EFalse;
+	}
+
+/**
+Gets the glyph atlas the font entry belongs to.
+
+@return The font entry's glyph atlas.
+*/
+CGlyphAtlas& CGlyphAtlasFontEntry::GlyphAtlas() const
+	{
+	return iAtlas;
+	}
+
+/** 
+@return The number of glyphs this font entry has.
+ */
+TInt CGlyphAtlasFontEntry::GlyphCount() const
+	{
+	TInt glyphCount = 0;
+	for (TInt ii = iPageArray.Count() - 1; ii >= 0; --ii)
+		{
+		glyphCount += iPageArray[ii].iPage->GlyphCount();
+		}
+	return glyphCount;
+	}
+
+
+// === CGlyphAtlasPage Functions ===
+
+/**
+Page constructor.
+
+@param aFontEntry The font entry to which the page is associated.
+*/
+CGlyphAtlasPage::CGlyphAtlasPage(CGlyphAtlasFontEntry& aFontEntry)
+	:iFontEntry(aFontEntry)
+	{
+	}
+
+/**
+Page destructor.
+Releases the RSgImage handles held by the page.
+Removes the page from the Glyph Atlas' LRU page array. 
+*/
+CGlyphAtlasPage::~CGlyphAtlasPage()
+	{
+	iLink.Deque();
+	iGlyphImage.Close();
+	}
+
+/**
+Adds a glyph to the page from a bitmap glyph and gets the glyph image info back.
+An RSgImage handle is acquired for the glyph. 
+If there is not enough specialised graphics memory to create a RSgImage, then the
+least recently used pages are deleted until there there is either enough memory 
+for the creation to be successful or if there are no more pages to delete (in 
+which case an appropriate out of memory error message is returned). 
+
+@param[in] aArgs The information needed to create a glyph.
+@param[out] aGlyphImageInfo Upon return contains all the glyph image information needed to use the 
+		glyph in another process.
+@param[out] aSizeInBytes Upon return contains the size of the added glyph's image data in bytes.
+@return KErrNone if the glyph was successfully added; 
+	KErrNoMemory if there is not enough system memory available;
+	KErrNoGraphicsMemory if there is not enough specialised graphics memory available.
+*/
+TInt CGlyphAtlasPage::AddGlyph(const CGlyphAtlas::TAddGlyphArgs& aArgs, TGlyphImageInfo& aGlyphImageInfo, TInt& aSizeInBytes)
+	{
+	const TSize glyphSize(aArgs.iMetrics->Width(), aArgs.iMetrics->Height());
+	// If glyph has zero size (e.g. space), set glyph data and return 
+	if (glyphSize.iWidth == 0 || glyphSize.iHeight == 0)
+		{
+		iPosX = 0;
+		iPosY = 0;
+		iMetrics = *aArgs.iMetrics;
+		iGlyphCode = aArgs.iGlyphCode;
+		iSizeInBytes = 0;
+		iNumGlyphs++;
+		aGlyphImageInfo.iImageId = KSgNullDrawableId;
+		aGlyphImageInfo.iPosX = iPosX;
+		aGlyphImageInfo.iPosY = iPosY;
+		aGlyphImageInfo.iMetrics = iMetrics;
+		return KErrNone;
+		}
+	TUint8* buf = NULL;
+	TSgImageInfo info;
+	info.iSizeInPixels = glyphSize;
+	info.iUsage = ESgUsageBitOpenVgImage;
+	info.iPixelFormat = EUidPixelFormatA_8;
+	TInt dataStride = 0;
+	const TInt KDataArraySize = 256;
+	TUint8 byteDataArray[KDataArraySize];
+	TUint8* tempBuf = NULL;
+	TUint8* byteDataBuf = NULL;
+	TGlyphBitmapType glyphBitmapType = iFontEntry.Font().GlyphBitmapType(); 
+
+	switch (glyphBitmapType)
+		{
+		case EMonochromeGlyphBitmap:
+			// Decompress to 8bpp buffer
+			dataStride = glyphSize.iWidth;
+			byteDataBuf = byteDataArray;
+			// If data too big to fit in byteDataArray, allocate memory on the heap
+			if (glyphSize.iHeight * glyphSize.iWidth > KDataArraySize)
+				{
+				tempBuf = (TUint8*) User::AllocZ(dataStride * glyphSize.iHeight);
+				if (!tempBuf)
+					{
+					return KErrNoMemory;
+					}
+				byteDataBuf = tempBuf;
+				}
+			else
+				{
+				// fill array with zeros.
+				Mem::FillZ(&byteDataArray, KDataArraySize);
+				}
+			
+			if (glyphSize.iWidth >32)
+				{
+				DecodeBinaryDataExLarge(glyphSize, aArgs.iBitmapPointer, byteDataBuf);
+				}
+			else
+				{
+				DecodeBinaryData(glyphSize, aArgs.iBitmapPointer, byteDataBuf);
+				}
+			buf = byteDataBuf;
+			break;
+		case EAntiAliasedGlyphBitmap:
+			buf = const_cast<TUint8*>(aArgs.iBitmapPointer);
+			dataStride = glyphSize.iWidth;
+			break;
+		default:
+			return KErrNotSupported;
+		}
+
+	TInt err = iGlyphImage.Create(info, buf, dataStride);
+
+	// If RSgImage creation fails due to out of memory, delete the least
+	// recently used pages to free up memory until either creation succeeds or 
+	// there are no more pages to remove.
+	TBool morePagesToDelete = ETrue;
+	while ((KErrNoGraphicsMemory == err || KErrNoMemory == err) && morePagesToDelete)
+		{
+		// Delete least used page.  Can delete all pages if necessary as this  
+		// page has not been added to the LRU array yet.
+		morePagesToDelete = iFontEntry.GlyphAtlas().DeleteLeastRecentlyUsedPage(ETrue);
+		err = iGlyphImage.Create(info, buf, dataStride);
+		}
+
+	User::Free(tempBuf);
+	
+	if (KErrNone != err)
+		{
+		return err;
+		}
+	aSizeInBytes = glyphSize.iHeight * glyphSize.iWidth;
+	iGlyphCode = aArgs.iGlyphCode;
+	iPosX = 0;
+	iPosY = 0;
+	iMetrics = *aArgs.iMetrics;
+	// As the image is stored as one byte per pixel, the size in bytes is 
+	// just the number of pixels.
+	// TODO: Replace estimating size with call to SgImage/SgDriver to get accurate size.
+	iSizeInBytes += aSizeInBytes;
+	iNumGlyphs++;
+	aGlyphImageInfo.iPosX = iPosX;
+	aGlyphImageInfo.iPosY = iPosY;
+	aGlyphImageInfo.iImageId = iGlyphImage.Id();
+	aGlyphImageInfo.iMetrics = iMetrics;
+	return err;
+	}
+
+/**
+Retrieves the glyph image information for the given glyph code necessary to be 
+able to use the glyph in another process.
+
+@param aGlyphCode The glyph code for the glyph being requested
+@param aGlyphImageInfo Upon return contains all the glyph image information needed to use the 
+		glyph in another process if the glyph is contained in the page.
+*/
+void CGlyphAtlasPage::GetGlyph(TUint aGlyphCode, TGlyphImageInfo& aGlyphImageInfo) const
+	{
+	__ASSERT_DEBUG(iGlyphCode == aGlyphCode, Panic(EFbsPanicGlyphAtlasInconsistentState));
+	aGlyphImageInfo.iMetrics = iMetrics;
+	aGlyphImageInfo.iPosX = iPosX;
+	aGlyphImageInfo.iPosY = iPosY;
+	aGlyphImageInfo.iImageId = iGlyphImage.Id();
+	}
+
+/**
+Gets the amount of memory allocated for the image data for this page.
+
+@return The size of the page's image data in bytes.
+*/
+TInt CGlyphAtlasPage::SizeInBytes() const
+	{
+	return iSizeInBytes;
+	}
+
+/**
+Gets the glyph code at the given index associated with the page.
+
+@param aIndex The index of the glyph code within the page.
+@return The glyph code at the given index.
+*/
+TUint CGlyphAtlasPage::GlyphCodeAt(TInt aIndex) const
+	{
+	__ASSERT_DEBUG(0 == aIndex, Panic(EFbsPanicGlyphAtlasInconsistentState));
+	return iGlyphCode;
+	}
+
+/**
+Gets the number of glyphs stored in the page.
+
+@return The number of glyphs in the page.
+*/
+TInt CGlyphAtlasPage::GlyphCount() const
+	{
+	return iNumGlyphs;
+	}
+
+/**
+Gets the font entry which owns the page.
+
+@return The font entry which owns the page. 
+*/
+CGlyphAtlasFontEntry& CGlyphAtlasPage::FontEntry() const
+	{
+	return iFontEntry;
+	}
+
+
+void CGlyphAtlasPage::MoveToFirstInQueue(TDblQue<CGlyphAtlasPage>& aList)
+	{
+	if(!aList.IsFirst(this))
+		{
+		iLink.Deque();
+		aList.AddFirst(*this);
+		}
+	}
+
+// === Static Utility Functions ===
+
+/**
+Combines 2 8-bit unsigned integers into a 16-bit integer.
+@param aPtr A pointer to a source buffer of 2 8-bit unsigned integers.
+@return The two 8-bit integers combined into a 16-bit integer.
+*/
+static TInt16 Load16(const TUint8* aPtr)
+	{
+	return TInt16(aPtr[0]+(aPtr[1]<<8)); 
+	}
+
+/**
+Decodes binary data for monochrome glyph bitmap.
+
+@param aGlyphSize size of glyph in pixels.
+@param aEncodedData Pointer to an encoded source buffer.
+@param aByteData Pointer to a destination buffer (8 bits per pixel).
+*/
+void DecodeBinaryData(const TSize& aGlyphSize, const TUint8* aEncodedData, TUint8* aByteData)
+	{
+	const TInt dataHeight = aGlyphSize.iHeight;
+	const TInt dataWidth = aGlyphSize.iWidth;
+	TUint32 binaryData = 0;
+	
+	// The data is encoded as follows:
+	// 1 bit for a multiple lines flag (1=yes)
+	// 4 bits for a repeat count which represents:
+	// -if the multiple line flag is 0 the number of lines whose data is repeated
+	// -if the flag is 1, the number of lines which differ from line to line.
+	// n bits representing the data at 1 bit per pixel, where:
+	// -if the multiple line flag is 0, n is the width of the glyph.
+	// -if the flag is 1, n is width of glyph multiplied by the repeat count for this block of data.
+	// This information presented in continuous packed blocks of:
+	// [data][reps][multiLineFlag]
+	TInt bitIndex = 0;
+	TInt16 repeatCount = 0;
+	TUint8* byteDataPtr = aByteData;
+	TUint8* byteDataPtrLimit = NULL;
+	for (TInt charLine = 0; charLine < dataHeight; charLine += repeatCount) // for lines in the character...
+		{
+		// Get first 5 bits of block
+		repeatCount = Load16(aEncodedData + (bitIndex >> 3));
+		repeatCount >>= bitIndex & 7;
+		// strip out multiple line flag (1st bit)
+		TInt multiLineFlag = repeatCount & 1;
+		// Get repeat count (last 4 bits)
+		repeatCount >>= 1;
+		repeatCount &= 0xf;
+		// move bit index to point to first bit of image data
+		bitIndex += 5;
+		// end pointer of destination buffer for this block of data to fill 
+		byteDataPtrLimit = aByteData + dataWidth * (charLine + repeatCount);
+		if (multiLineFlag)
+			{
+			while (byteDataPtr < byteDataPtrLimit)
+				{
+				// Pointer to beginning of data in source buffer for current scanline
+				TInt charDataOffsetPtr = TInt(aEncodedData) + (bitIndex >> 3);
+				// Pointer to beginning of current word.
+				TUint32* charDataWord = (TUint32*)(charDataOffsetPtr &~ 3);
+				// Number of bits to shift in current word to get to beginning of scanline
+				TInt bitShift = bitIndex & 7;
+				bitShift += (charDataOffsetPtr & 3) << 3;
+				// Copy scanline data into temporary buffer
+				binaryData = (*charDataWord++) >> bitShift;
+				// If data crosses a word boundary, get the rest of the data from next word.
+				if (bitShift)
+					{
+					binaryData |= (*charDataWord << (32-bitShift));
+					}
+				Convert1BppTo8Bpp(binaryData, byteDataPtr, byteDataPtr + dataWidth);
+				// Move bit index to beginning of next block
+				bitIndex += dataWidth;
+				}
+			}
+		else
+			{
+			TInt charDataOffsetPtr = TInt(aEncodedData) + (bitIndex >> 3);
+			TUint32* charDataWord = (TUint32*)(charDataOffsetPtr &~ 3);
+			TInt bitShift = bitIndex & 7;
+			bitShift += (charDataOffsetPtr & 3) << 3;
+			binaryData = (*charDataWord++) >> bitShift;
+			if (bitShift)
+				{
+				binaryData |= (*charDataWord << (32-bitShift));
+				}
+			TUint8* startByteDataPtr = byteDataPtr;
+			Convert1BppTo8Bpp(binaryData, byteDataPtr, byteDataPtr + dataWidth);
+			
+			while (byteDataPtr < byteDataPtrLimit)
+				{
+				Mem::Copy(byteDataPtr, startByteDataPtr, dataWidth);
+				byteDataPtr += dataWidth;
+				}
+			bitIndex += dataWidth;
+			}
+		}
+	}
+
+/**
+Converts binary data in 1 bit per pixel format to 8 bits per pixel format, where
+0 is converted to 0x00 and 1 is converted to 0xFF.
+
+@param aSrcData Pointer to a 1bpp source buffer.
+@param aDestDataPtr Pointer to a 8bpp destination buffer.
+@param aDestDataPtrLimit Pointer to the end position in destination buffer to convert to.
+*/
+void Convert1BppTo8Bpp(TUint32 aSrcData, TUint8*& aDestDataPtr, const TUint8* aDestDataPtrLimit)
+	{
+	for (; aDestDataPtr < aDestDataPtrLimit; ++aDestDataPtr, aSrcData >>= 1)
+		{
+		if (aSrcData&1)
+			{
+			*aDestDataPtr = 0xFF;
+			}
+		}
+	}
+
+/**
+Decodes binary data for extra large monochrome glyph bitmap.
+
+@param aGlyphSize Size of glyph in pixels.
+@param aEncodedData Pointer to an encoded source buffer.
+@param aByteData Pointer to a destination buffer (8 bits per pixel).
+*/
+void DecodeBinaryDataExLarge(const TSize& aGlyphSize, const TUint8* aEncodedData, TUint8* aByteData)
+	{
+	const TInt dataWidth = aGlyphSize.iWidth;
+	const TInt dataHeight = aGlyphSize.iHeight;
+	TInt bitIndex = 0;
+	TInt16 repeatCount = 0;
+
+	for (TInt charLine = 0; charLine < dataHeight; charLine += repeatCount) // for lines in the character...
+		{
+		repeatCount = Load16(aEncodedData + (bitIndex >> 3));
+		repeatCount >>= bitIndex & 7;
+		const TInt multiLineFlag = repeatCount & 1;
+		repeatCount >>= 1;
+		repeatCount &= 0xf;
+		bitIndex += 5;
+		if (multiLineFlag)
+			{
+			for (TInt currentline = 0; currentline < repeatCount; currentline++)
+				{
+				CopyCharLine(aByteData, dataWidth, aEncodedData + (bitIndex >> 3), bitIndex & 7, 1);
+				bitIndex += dataWidth;
+				}
+			}
+		else
+			{
+			CopyCharLine(aByteData, dataWidth, aEncodedData + (bitIndex >> 3), bitIndex & 7, repeatCount);
+			bitIndex += dataWidth;
+			}
+		}
+	}
+
+/**
+Copies glyph image data line(s)(1 bit per pixel) to an 8 bit per pixel
+destination buffer.
+
+@param aByteDataPtr Pointer to a destination buffer (8bpp).
+@param aWidthInBytes Stride of the image.
+@param aSrcData Pointer to a source buffer (1bpp).
+@param aBitShift Number of bits the source data pointer will be shifted. 
+@param aRepeatCount Number of lines to copy.
+*/
+void CopyCharLine(TUint8*& aByteDataPtr, TInt aWidthInBytes, const TUint8* aSrcData, TInt aBitShift, TInt16 aRepeatCount)
+	{
+	aBitShift &= 7;
+	TUint8* ptrLimit = aByteDataPtr + aWidthInBytes;
+	TUint32* dataWord = (TUint32*)(TInt(aSrcData) &~ 3);
+	aBitShift += (TInt(aSrcData) - TInt(dataWord)) << 3;
+
+	TUint8* startByteDataPtr = aByteDataPtr;
+	TUint32 binaryData = 0;
+	while (aByteDataPtr < ptrLimit)
+		{
+		binaryData = *dataWord++;
+		binaryData >>= aBitShift;
+		if (aBitShift)
+			{
+			binaryData |= (*dataWord << (32-aBitShift));
+			}
+		TUint8* wordLimit = aByteDataPtr + 32;
+		if (wordLimit > ptrLimit)
+			{
+			wordLimit = ptrLimit;
+			}
+		Convert1BppTo8Bpp(binaryData, aByteDataPtr, wordLimit);
+		}
+
+	while (aRepeatCount > 1)
+		{
+		Mem::Copy(aByteDataPtr, startByteDataPtr, aWidthInBytes);
+		aByteDataPtr += aWidthInBytes;
+		--aRepeatCount;
+		}
+	}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/sfbs/glyphatlas.h	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,185 @@
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Font & Bitmap Server Glyph Atlas
+//
+
+#ifndef GLYPHATLAS_H
+#define GLYPHATLAS_H
+
+#include <e32base.h>
+#include <sgresource/sgimage.h>
+#include <fbs.h>
+#include "UTILS.H"
+
+class CGlyphAtlasFontEntry;
+class CGlyphAtlasPage;
+class TGlyphCacheMetrics;
+
+/**
+The Glyph Atlas manages the storing and retrieval of glyphs stored in GPU 
+memory as RSgImages.
+
+CGlyphAtlas is the main class which processes requests to add and retrieve
+glyphs. Only one instance of this class will exist throughout the lifetime of 
+the Font and Bitmap Server.
+@internalComponent
+*/
+NONSHARABLE_CLASS(CGlyphAtlas) : public CBase
+	{
+friend class CGlyphAtlasTestWrapper;
+public:
+	/**
+	Structure used to pass information required to create a new glyph so that it can 
+	be added to the glyph atlas.
+	@internalComponent 
+	*/
+	class TAddGlyphArgs
+		{
+	public:
+		inline TAddGlyphArgs(const TUint8* aBitmapPointer, TUint aGlyphCode, const TOpenFontCharMetrics& aMetrics)
+			: iBitmapPointer(aBitmapPointer), iGlyphCode(aGlyphCode), iMetrics(&aMetrics) {}
+	public:
+		const TUint8* iBitmapPointer;	/**< The address of the bitmap glyph. No ownership.*/
+		TUint iGlyphCode;	/**< The glyph code for the glyph being added. No ownership.*/
+		const TOpenFontCharMetrics* iMetrics;	/**< The metrics for the glyph being added. No ownership.*/
+		};
+
+public:
+	~CGlyphAtlas();
+	static CGlyphAtlas* NewL(TInt aMaxCacheSizeInBytes);
+	TInt GetGlyph(const CBitmapFont& aFont, TUint aGlyphCode, TGlyphImageInfo& aGlyphImageInfo);
+	TInt AddGlyph(const CBitmapFont& aFont, const TAddGlyphArgs& aArgs, TGlyphImageInfo& aGlyphImageInfo);
+	void FontReleased(const CBitmapFont& aFont);
+	void MovePageToFront(CGlyphAtlasPage& aPage);
+	TBool DeleteLeastRecentlyUsedPage(TBool aAllowMruPageDeletion);
+	TInt FontCount() const;
+	TInt GlyphCount() const;
+	TInt GlyphCount(const CBitmapFont& aFont) const;
+	void GlyphCacheMetrics(TInt& aSizeInBytes, TInt& aMaxSizeInBytes, TBool& aGpuCacheSizeLimitIsMax);
+	void ReleaseGpuMemory( TInt /*aBytes*/, TInt /*aFlags*/ );
+	void InstateGpuMemory( TInt /*aFlags*/ );
+	void GetGlyphCacheMetrics( TGlyphCacheMetrics& aGlyphCacheMetrics );
+
+private:
+	CGlyphAtlas(TInt aMaxCacheSizeInBytes);
+	void ConstructL();
+	CGlyphAtlasFontEntry* CreateFontEntry(const CBitmapFont& aFont);
+	CGlyphAtlasFontEntry* FindFontEntry(const CBitmapFont& aFont) const;
+	void DeleteFontEntry(CGlyphAtlasFontEntry* aFontEntry);
+    void SwitchGpuCacheSizeLimit();
+    TBool GpuCacheSizeLimitIsMax() const;
+
+private:
+	class TFontEntryMap
+		{
+	public:
+		inline TFontEntryMap(const CBitmapFont* aFont, CGlyphAtlasFontEntry* aEntry)
+				: iFont(aFont),iEntry(aEntry) {}
+	public:			
+		const CBitmapFont* iFont;
+		CGlyphAtlasFontEntry* iEntry;
+		};
+private:
+	RSgDriver iSgDriver;
+	TDblQue<CGlyphAtlasPage> iLruPageList; /**< Least-recently used ordered queue (most-recently used at head).*/
+	RArray<TFontEntryMap> iFontEntryArray; /**< Array of font entries maintained in unsigned ordered by font pointer.*/
+	TUint iMaxCacheSizeInBytes;	/**< Maximum specialised graphics memory the cache should use. If zero, there is no limit.*/
+	TInt iMaxCacheSizeHigh;                /**< The high cach-size threshold.*/
+	TInt iMaxCacheSizeLow;                 /**< The low cach-size threshold.*/
+	TUint iCacheSizeInBytes; 	/**< Actual amount of specialised graphics memory used by the entire atlas.*/
+	TBool iGpuCacheSizeLimitIsMax;         /**< Is the cache-size limit set to it's maximum value? */
+	};
+
+
+/**
+Each font entry manages the storing and retrieval of glyphs belonging to a font.
+@internalComponent
+*/
+NONSHARABLE_CLASS(CGlyphAtlasFontEntry): public CBase
+	{
+public:
+	CGlyphAtlasFontEntry(const CBitmapFont& aFont, CGlyphAtlas& aGlyphAtlas);
+	~CGlyphAtlasFontEntry();
+	const CBitmapFont& Font() const;
+	void DeletePage(CGlyphAtlasPage* aPage);
+	TInt GetGlyph(TUint aGlyphCode, TGlyphImageInfo& aGlyphImageInfo);
+	TInt AddGlyph(const CGlyphAtlas::TAddGlyphArgs& aArgs, TGlyphImageInfo& aGlyphImageInfo, TInt& aSizeInBytes);
+	TInt SizeInBytes() const;
+	TBool IsEmpty() const;
+	CGlyphAtlas& GlyphAtlas() const;
+	TInt GlyphCount() const;
+
+private:
+	// Class that handles association between glyph code and page the 
+	// image that glyph code resides on. Used in pointer arrays.
+	class TPageMap
+		{
+	public:
+		inline TPageMap(TUint aGlyphCode, CGlyphAtlasPage* aPage)
+				: iGlyphCode(aGlyphCode),iPage(aPage) {}
+	public:			
+		TUint iGlyphCode;
+		CGlyphAtlasPage* iPage;
+		};
+private:
+	const CBitmapFont& iFont;	/**< The font which the stored glyph belongs to.*/
+	RArray<TPageMap> iPageArray;	/**< Array of pages maintained in unsigned ordered by glyph code.*/
+	CGlyphAtlas& iAtlas;		/**< The glyph atlas the font entry belongs to.*/
+	TInt iSizeInBytes;			/**< The amount of specialised graphics memory used by all owned pages.*/
+	};
+
+
+/**
+Each page in the glyph atlas stores one glyph in one RSgImage.
+@internalComponent
+*/
+NONSHARABLE_CLASS(CGlyphAtlasPage): public CBase
+	{
+friend CGlyphAtlas::CGlyphAtlas(TInt);
+public:
+	CGlyphAtlasPage(CGlyphAtlasFontEntry& aFontEntry);
+	~CGlyphAtlasPage();
+	TInt AddGlyph(const CGlyphAtlas::TAddGlyphArgs& aArgs, TGlyphImageInfo& aGlyphImageInfo, TInt& aSizeInBytes);
+	void GetGlyph(TUint aGlyphCode, TGlyphImageInfo& aGlyphImageInfo) const;
+	TUint GlyphCodeAt(TInt aIndex) const;
+	TInt GlyphCount() const;
+	CGlyphAtlasFontEntry& FontEntry() const;
+	TInt SizeInBytes() const;
+	void MoveToFirstInQueue(TDblQue<CGlyphAtlasPage>& aList);
+
+private:
+	TDblQueLink iLink;
+	// Data for the stored glyph
+	CGlyphAtlasFontEntry& iFontEntry;	/**< The font entry asssociated with the page.*/
+	RSgImage iGlyphImage;		/**< The image which contains the stored glyph.*/
+	TInt16 iPosX;				/**< The x-coord of the position of the stored glyph within the image.*/
+	TInt16 iPosY;				/**< The y-coord of the position of the stored glyph within the image.*/
+	TOpenFontCharMetrics iMetrics;	/**< The character metrics for the stored glyph.*/
+	TUint iGlyphCode;			/**< The glyph code for the stored glyph.*/
+	TInt iSizeInBytes;			/**< The amount of specialised graphics memory used by this page.*/
+	TInt iNumGlyphs;			/**< The number of glyphs contained in the page.*/
+	};
+
+
+// If no limit to the size of the glyph atlas cache is desired, this
+// constant must be passed to CGlyphCache::NewL()
+// In this case the cache lower maximum limit, deployed in response to GooM,
+// will be set to KGlyphAtlasLowMemCacheLimitDefault
+const TInt KGlyphAtlasNoCacheLimit = 0;
+const TInt KGlyphAtlasLowMemCacheLimitDivisor = 2;
+const TInt KGlyphAtlasLowMemCacheLimitDefault = 0x40000;
+
+
+#endif // GLYPHATLAS_H
+
--- a/fbs/fontandbitmapserver/sfbs/patchableconstants.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/sfbs/patchableconstants.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -54,6 +54,19 @@
 */
 EXPORT_C extern const TInt KFbServWritableDataPagingMode = 0x00;
 
+/**
+@SYMPatchable
+@publishedPartner
+@prototype
+
+This constant determines the maximum size of the GPU memory that the font and 
+bitmap server's glyph atlas can use.
+The glyph atlas will store glyphs in this memory.  When the glyph atlas reaches 
+this limit, old glyphs will be evicted from the cache to make space for new glyphs.
+@note	Default value: 0.5 MB (0x00080000).
+*/
+EXPORT_C extern const TInt KFbServGlyphAtlasCacheLimit = 0x00080000;
+
 // Header files declaring these constants are included to confirm that the definition matches.
 // They are included at the end because otherwise the ARM compiler refuses to initialise the values.
 #if (__ARMCC_VERSION >= 310000)
--- a/fbs/fontandbitmapserver/tfbs/TALLOC.H	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/tfbs/TALLOC.H	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -17,7 +17,7 @@
 #define __TALLOC_H__
 
 #include <fbs.h>
-#include "TGraphicsHarness.h"
+#include "test/TGraphicsHarness.h"
 
 class CTAlloc : public CTGraphicsBase
 	{
--- a/fbs/fontandbitmapserver/tfbs/TBitmap.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/tfbs/TBitmap.h	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -20,8 +20,8 @@
 
 #include <gdi.h>
 #include "TFBS.H"
-#include "TGraphicsHarness.h"
-#include "../sfbs/fbsbitmapasyncstreamer.h"
+#include "test/TGraphicsHarness.h"
+#include "fbsbitmapasyncstreamer.h"
 
 
 //The main test class. Add your test methods here.
--- a/fbs/fontandbitmapserver/tfbs/TCLEAN.H	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/tfbs/TCLEAN.H	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1996-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -17,7 +17,7 @@
 #define __TCLEAN_H__
 
 #include <fbs.h>
-#include "TGraphicsHarness.h"
+#include "test/TGraphicsHarness.h"
 
 enum TTestType
 	{
--- a/fbs/fontandbitmapserver/tfbs/TFBS.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/tfbs/TFBS.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1995-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -84,7 +84,7 @@
 void CTFbs::ConstructL()
 	{
 	ExpandCleanupStackL();
-	
+	User::LeaveIfError(Logger().ShareAuto());
 	TestConstruction();
 	AllocScanLineBuf();
 	
@@ -187,7 +187,7 @@
 		TestSingletonServer();
 		break;
 	case 21:
-		((CTFbsStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0620"));
+		((CTFbsStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0623"));
 		TestFontSessionCacheLookupL();
 		break;
 	case 22:
@@ -649,7 +649,7 @@
 	CheckResourceCount();
 	TEST(fbsalt->ResourceCount()==iResourceCount);
 	font3->Reset();
-	User::Free(font3);
+	delete font3;
 	iResourceCount--;
 	CheckResourceCount();
 	TEST(fbsalt->ResourceCount()==iResourceCount);
@@ -2133,7 +2133,7 @@
 	}
 
 /**
-@SYMTestCaseID      GRAPHICS-FBSERV-0620
+@SYMTestCaseID      GRAPHICS-FBSERV-0623
 @SYMTestPriority    High
 @SYMTestStatus      Implemented
 @SYMDEF             DEF140138
@@ -2145,6 +2145,8 @@
 	are the same, thereby avoiding any unneccessary IPC calls.
 
 @SYMTestActions
+	Try to open a global semaphore called "FBSSessionCacheSemaphore" (this is a temporary measure to
+		ensure successful propagation of ou1cimx1#250526).
 	Create a large font which consumes a lot of memory.
 	Create a CFbsBitGc and a CFbsBitmap target.
 	Use the CFbsBitGc to render some text, thereby filling the font glyph cache. 
@@ -2156,6 +2158,7 @@
 		returned from CBitmapFont::GetCharacterData().
 
 @SYMTestExpectedResults
+	No global semaphore called "FBSSessionCacheSemaphore" should exist.
 	When using KNullHandle, CharacterNeedsToBeRasterized() with the first character, is expected to pass
 		proving that the font cache is working as expected when glyphs can fit into it.
 	When using KNullHandle, CharacterNeedsToBeRasterized() with the last character, it expected to fail, 
@@ -2172,6 +2175,11 @@
 	{
 	INFO_PRINTF1(_L("Test Font Session-cache Lookup"));
 
+	// Make sure the global semaphore is gone for good
+	_LIT(KSessionCacheSemaphoreName, "FBSSessionCacheSemaphore");
+	RSemaphore sem;
+	TEST(sem.OpenGlobal(KSessionCacheSemaphoreName) == KErrNotFound);
+
 	User::LeaveIfError(RFbsSession::Connect());    
 	RFbsSession* fbsSession = RFbsSession::GetSession();
 	CFbsTypefaceStore* ts = CFbsTypefaceStore::NewL(NULL);
@@ -2273,170 +2281,96 @@
 	TEST(KErrNone == iFbs->SendCommand(EFbsMessSetTwipsHeight, fontHandle, 49));
 	// In a second thread, send a IPC command to set the font's height with the 
 	// bitmap's handle.  Should panic with FBServ -6.
-	TFbsTestThreadInfo threadInfo = {EFbsSecondThreadInvalidHandleInIpcCall};
- 	TExitCategoryName exitCategoryName(KFbsPanicCategory);
 	_LIT(KTestName, "TestInvalidHandlesInIpcCall");
- 	CreateSecondThreadAndCheckPanicL(threadInfo, -6, exitCategoryName, KTestName);
+ 	CreateSecondThreadAndCheckPanicL(SecondThreadPanicInvalidHandleInIpcCallL, KErrArgument, KFbsPanicCategory, KTestName);
 
 	iTs->ReleaseFont(font);
 	delete bmp;
 	}
 
 /**
-Creates a second thread and do some panic tests in it.
-@param aTestInfo The information for the tests
-@param aPanicCode The expected panic code
-@param aExitCategory The expected panic category
-@param aThreadName The name of the new thread
-@leave Gets system wide error code
+Second thread function for test GRAPHICS-FBSERV-0650. It should panic with FBSERV -6 if the test is successful.
+ */
+void CTFbs::SecondThreadPanicInvalidHandleInIpcCallL()
+	{
+	User::LeaveIfError(RFbsSession::Connect());
+	RFbsSession* fbs = RFbsSession::GetSession();
+	CFbsBitmapEx* bmp = new(ELeave) CFbsBitmapEx();
+	CleanupStack::PushL(bmp);
+	User::LeaveIfError(bmp->Create(TSize(1,1), EGray2));
+	CFbsTypefaceStore* ts = CFbsTypefaceStore::NewL(NULL);
+	CleanupStack::PushL(ts);
+	CFbsFont* font=NULL;
+	User::LeaveIfError(ts->GetNearestFontToDesignHeightInPixels((CFont*&)font, TFontSpec(KTypefaceName, 15)));
+	TInt bitmapHandle = bmp->BitmapHandle();
+
+	// Send a IPC command to set twips height of font with a bitmap handle
+	(void)fbs->SendCommand(EFbsMessSetTwipsHeight, bitmapHandle, 49);
+
+	ts->ReleaseFont(font);
+	CleanupStack::PopAndDestroy(2);
+	RFbsSession::Disconnect();
+	}
+
+
+struct TFbsTestDelegator
+	{
+	CTFbs* iTestBase;
+	void (CTFbs::*iMethodPtr)();
+	};
+
+/**
+Creates a second thread and checks that it panics.
+@param aMethodL The leaving method of CTFbs that the second thread is going to execute.
+@param aPanicCode The expected panic code.
+@param aPanicCategory The expected panic category.
+@param aThreadName The name of the new thread.
 */
-void CTFbs::CreateSecondThreadAndCheckPanicL(TFbsTestThreadInfo& aTestInfo, TInt aPanicCode, TExitCategoryName aExitCategory, const TDesC &aThreadName)
+void CTFbs::CreateSecondThreadAndCheckPanicL(void (CTFbs::*aMethodL)(), TInt aPanicCode, const TDesC& aPanicCategory, const TDesC& aThreadName)
 	{
 	RThread secondThread;
-	User::LeaveIfError(secondThread.Create(aThreadName, SecondThreadStart, KDefaultStackSize, 0x1000, 0x1000, &aTestInfo));
+	TFbsTestDelegator delegator;
+	delegator.iTestBase = this;
+	delegator.iMethodPtr = aMethodL;
+	User::LeaveIfError(secondThread.Create(aThreadName, MethodDelegatorThreadFunction, KDefaultStackSize, 0x1000, 0x1000, &delegator));
 	// Launch second thread
 	TRequestStatus statusSecondThread;
 	secondThread.Logon(statusSecondThread);
-	secondThread.SetPriority(EPriorityLess);
-	secondThread.Resume();	
-	
+	secondThread.Resume();
+	// Wait until second thread is finished
 	User::WaitForRequest(statusSecondThread);
-	
-	if(EExitPanic != secondThread.ExitType())
+	// Check results
+	if (EExitPanic != secondThread.ExitType())
 		{
-		ERR_PRINTF3(_L("Expected exit type: %d, Actual exit type: %d"), EExitPanic, secondThread.ExitType());
+		ERR_PRINTF2(_L("Expected exit type: EExitPanic, actual exit type: %d"), secondThread.ExitType());
 		TEST(EFalse);
 		}
-	
-	if(aPanicCode != secondThread.ExitReason())
+	if (aPanicCode != secondThread.ExitReason())
 		{
-		ERR_PRINTF3(_L("Expected panic code: %d, Actual panic code: %d"), aPanicCode, secondThread.ExitReason());
+		ERR_PRINTF3(_L("Expected exit reason: %d, actual exit reason: %d"), aPanicCode, secondThread.ExitReason());
         TEST(EFalse);
 		}
-	
 	TExitCategoryName secondThreadExitCategory = secondThread.ExitCategory();
-	if(aExitCategory != secondThreadExitCategory)
+	if (aPanicCategory != secondThreadExitCategory)
 		{
-		ERR_PRINTF3(_L("Expected panic category: %S, Actual panic category: %S"), &aExitCategory, &secondThreadExitCategory);
+		ERR_PRINTF3(_L("Expected exit category: %S, actual exit category: %S"), &aPanicCategory, &secondThreadExitCategory);
         TEST(EFalse);
 		}
-	
-	//Close the handle
+	// Dispose of the remains of the second thread
 	secondThread.Close();
 	}
 
-/**
-Second thread entry function.
-*/
-TInt CTFbs::SecondThreadStart(TAny* aTestInfo)
+TInt CTFbs::MethodDelegatorThreadFunction(TAny* aDelegator)
 	{
-	
-	__UHEAP_MARK;
-    TInt procHandles1  =0;
-    TInt threadHandles1=0;
-    RThread().HandleCount(procHandles1, threadHandles1);
 	CTrapCleanup* cleanupStack = CTrapCleanup::New();
-	
 	if (!cleanupStack)
 	    {
-	    __UHEAP_MARKEND;
 	    return KErrNoMemory;
 	    }
-	
-	TInt result = KErrNone;
-	TRAP(result, SecondThreadMainL(static_cast<TFbsTestThreadInfo*>(aTestInfo)));
-	
+	TFbsTestDelegator* delegator = static_cast<TFbsTestDelegator*>(aDelegator);
+	TRAPD(err, (delegator->iTestBase->*delegator->iMethodPtr)());
 	delete cleanupStack;
-
-    TInt procHandles2  =0;
-    TInt threadHandles2=0;
-    RThread().HandleCount(procHandles2,threadHandles2);
-    if (threadHandles1 != threadHandles2)
-        {
-        result = KErrGeneral;  // Thread-owned handles not closed
-        }
-	__UHEAP_MARKEND;
-
-	return result;
-	}
-
-/**
-Run the test contained within the TFbsTestThreadInfo object. A new thread is
-created for each test and only one of the cases in the switch statements
-below will be used.
-
-@param aTestInfo The parameters for the test
-@return One of the system wide error codes or an enumeration of passed tests.
- */
-TInt CTFbs::SecondThreadMainL(TFbsTestThreadInfo* aTestInfo)
-    {
-    TInt result = 0;
-    TFbsMultiThreadTestCase testcase = aTestInfo->iTestCase;
-
-    //test cases without the need of an initialised driver
-    switch (testcase)
-    	{
-    case EFbsSecondThreadInvalidHandleInIpcCall:
-    	result = SecondThreadPanicInvalidHandleInIpcCall();
-        break;
-    	}
-    return result;
-    }
-
-/**
-Implementation of SecondThread test EFbsSecondThreadInvalidHandleInIpcCall
-
-@panic FBSERV -6 If the test is successful
-
-@return One of the system wide error codes.
- */
-TInt CTFbs::SecondThreadPanicInvalidHandleInIpcCall()
-	{
-	TInt result = RFbsSession::Connect();
-	if (KErrNone != result)
-		{
-		return result;
-		}
-	RFbsSession* fbs = RFbsSession::GetSession();
-	CFbsBitmapEx* bmp = new CFbsBitmapEx();
-	if (!bmp)
-		{
-		return KErrGeneral;
-		}
-	result = bmp->Create(TSize(1,1),EGray2);
-	if(KErrNone != result)
-		{
-		delete bmp;
-		return KErrGeneral;
-		}
-
-	CFbsTypefaceStore* ts = NULL;
-	ts = (CFbsTypefaceStore*)CFbsTypefaceStore::NewL(NULL);
-	if (!ts)
-		{
-		delete bmp;
-		return KErrGeneral;
-		}
-
-	CFbsFontEx* font=NULL;
-	result = ts->GetNearestFontToDesignHeightInPixels((CFont*&)font, TFontSpec(KTypefaceName, 15));
-	if (!font)
-		{
-		delete bmp;
-		delete ts;
-		return KErrGeneral;
-		}
-
-	TInt fontHandle = font->FontHandle();
-	TInt bitmapHandle = bmp->BitmapHandle();
-
-	// Send a IPC command to set twips height of font with a bitmap handle
-	result = fbs->SendCommand(EFbsMessSetTwipsHeight, bitmapHandle, 49);
-
-	ts->ReleaseFont(font);
-	delete bmp;
-	delete ts;
-	return result;
+	return err;
 	}
 
 /**
--- a/fbs/fontandbitmapserver/tfbs/TFBS.H	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/tfbs/TFBS.H	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1995-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -20,7 +20,6 @@
 #include <gdi.h>
 #include <test/fontinjector.h>
 #include <test/TGraphicsHarness.h>
-#include "tfbsmultithread.h"
 
 _LIT(KTempFilename,"c:\\temp.mbm");
 _LIT(KTestBitmapOnZ,"z:\\system\\data\\tfbs.mbm");
@@ -138,10 +137,9 @@
 	TInt LoadOpenFontLibraries();
 	TBool CheckTypefacesSupport(const TTypefaceSupport& aInfo1, const TTypefaceSupport& aInfo2);
 	void LoadFontsL(const TDesC& aFontsDir);
-	void CreateSecondThreadAndCheckPanicL(TFbsTestThreadInfo& aTestCase, TInt aPanicCode, TExitCategoryName aExitCategory, const TDesC &aThreadName);
-	static TInt SecondThreadStart(TAny* aTestInfo);
-	static TInt SecondThreadMainL(TFbsTestThreadInfo* aTestInfo);
-	static TInt SecondThreadPanicInvalidHandleInIpcCall();
+	void SecondThreadPanicInvalidHandleInIpcCallL();
+	void CreateSecondThreadAndCheckPanicL(void (CTFbs::*aMethodL)(), TInt aPanicCode, const TDesC& aPanicCategory, const TDesC &aThreadName);
+	static TInt MethodDelegatorThreadFunction(TAny* aDelegator);
 
 private:
 	TInt iHandle;
--- a/fbs/fontandbitmapserver/tfbs/TFBSDefect.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/tfbs/TFBSDefect.h	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -17,7 +17,7 @@
 #define __TFBSDEFECT_H__
 
 #include <fbs.h>
-#include "TGraphicsHarness.h"
+#include "test/TGraphicsHarness.h"
 
 class CTFbsDefect : public CTGraphicsBase
 	{
--- a/fbs/fontandbitmapserver/tfbs/TFbsServer.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/tfbs/TFbsServer.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -38,8 +38,12 @@
 #include "textendedbitmappanic.h"
 #include "twdp.h"
 #include "tfonttableandglyph.h"
+#include "tfbsglyphdata.h"
+#include "tfbsglyphdatapanic.h"
+#include "tfbsglyphdataoutlineshadow.h"
+#include "tglyphatlas.h"
+#include "tfbsoogm.h"
 
- 
 /* Path to the script
 
 z:\GraphicsTest\fbstest.script
@@ -196,9 +200,29 @@
 		testStep = new CTWDPStep();
 		}
    	else if(aStepName == KTFontTableAndGlyphStep)
-        	{
-        	testStep = new CTFontAndGlyphStep();
-        	}
-	
+        {
+        testStep = new CTFontAndGlyphStep();
+        }
+	else if(aStepName == KTFbsGlyphDataStep)
+		{
+		testStep = new CTFbsGlyphDataStep();
+		}
+    else if(aStepName == KTFbsGlyphDataPanicStep)
+        {
+        testStep = new CTFbsGlyphDataPanicStep();
+        }
+    else if(aStepName == KTFbsGlyphDataOutlineAndShadowStep)
+        {
+        testStep = new CTFbsGlyphDataOutlineAndShadowStep();
+        }
+    else if(aStepName == KTGlyphAtlasStep)
+    	{
+		testStep = new CTGlyphAtlasStep();
+    	}
+    else if(aStepName == KTFbsOogmStep)
+        {
+        testStep = new CTFbsOogmStep();
+        }
+
 	return testStep;
 	}
--- a/fbs/fontandbitmapserver/tfbs/TGetAllBitmapsCapability.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/tfbs/TGetAllBitmapsCapability.h	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -16,7 +16,7 @@
 #ifndef __TGETALLBITMAPSCAPABILITY_H__
 #define __TGETALLBITMAPSCAPABILITY_H__
 
-#include "TGraphicsHarness.h"
+#include "test/TGraphicsHarness.h"
 
 // The main test class. Add your test methods here.
 class CTGetAllBitmapsCapability : public CTGraphicsBase
--- a/fbs/fontandbitmapserver/tfbs/TRalc.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/tfbs/TRalc.h	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -17,7 +17,7 @@
 #define __TRALC_H__
 
 #include <fbs.h>
-#include "TGraphicsHarness.h"
+#include "test/TGraphicsHarness.h"
 
 class CTRalc : public CTGraphicsBase
 	{
--- a/fbs/fontandbitmapserver/tfbs/TSecureFBS.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/tfbs/TSecureFBS.h	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -17,7 +17,7 @@
 #define __TSECUREFBS_H__
 
 #include <fbs.h>
-#include "TGraphicsHarness.h"
+#include "test/TGraphicsHarness.h"
 
 class CTFbsSecure : public CTGraphicsBase
 	{
--- a/fbs/fontandbitmapserver/tfbs/TStreamIdCache.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/tfbs/TStreamIdCache.h	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -17,7 +17,7 @@
 #define __TSTREAMIDCACHE_H__
 
 #include <fbs.h>
-#include "TGraphicsHarness.h"
+#include "test/TGraphicsHarness.h"
 
 class CTStreamIdCache : public CTGraphicsBase
 	{
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/tfbs/glyphatlastestwrapper.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,167 @@
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include "glyphatlastestwrapper.h"
+
+/**
+Panic function required for glyphatlas.cpp to compile in the test project.
+*/
+GLDEF_C void Panic(TFbsPanic aPanic)
+	{
+	_LIT(KFBSERVClientPanicCategory,"FBSCLI");
+	User::Panic(KFBSERVClientPanicCategory,aPanic);
+	}
+
+
+/**
+Glyph Atlas test wrapper constructor.
+*/
+CGlyphAtlasTestWrapper::CGlyphAtlasTestWrapper()
+	{
+	}
+
+/**
+Two-phase constructor.
+@leave A system wide error code if RSgDriver failed to open.
+*/
+void CGlyphAtlasTestWrapper::ConstructL(TInt aMaxCacheSizeInBytes)
+	{
+	iAtlas = CGlyphAtlas::NewL(aMaxCacheSizeInBytes);
+	}
+
+/**
+Factory constructor method. Creates a new glyph atlas test wrapper.
+
+@param aMaxCacheSizeInBytes The size in bytes, to use as the upper limit
+	for the size of memory used by the glyph images in the atlas. If this
+	value is KGlyphAtlasNoCacheLimit, then there is no limit and the atlas
+	will use as much memory as is available in the system.
+
+@return A pointer to the newly-constructed atlas test wrapper
+
+@leave KErrNoMemory if there was insufficient memory to create the atlas, 
+	or a system wide error code if its RSgDriver failed to open.
+*/
+CGlyphAtlasTestWrapper* CGlyphAtlasTestWrapper::NewL(TInt aMaxCacheSizeInBytes)
+    {
+    CGlyphAtlasTestWrapper* self = CGlyphAtlasTestWrapper::NewLC( aMaxCacheSizeInBytes );
+    CleanupStack::Pop(); // self;
+
+    return self;
+    }
+
+CGlyphAtlasTestWrapper* CGlyphAtlasTestWrapper::NewLC(TInt aMaxCacheSizeInBytes)
+    {
+    CGlyphAtlasTestWrapper* self = new (ELeave) CGlyphAtlasTestWrapper();
+    CleanupStack::PushL(self);
+    self->ConstructL(aMaxCacheSizeInBytes);
+
+    return self;
+    }
+
+TInt CGlyphAtlasTestWrapper::GetGlyph(const CBitmapFont& aFont, TUint aGlyphCode, TGlyphImageInfo& aGlyphImageInfo)
+	{
+	return iAtlas->GetGlyph(aFont, aGlyphCode, aGlyphImageInfo);
+	}
+
+TInt CGlyphAtlasTestWrapper::AddGlyph(const CBitmapFont& aFont, const CGlyphAtlas::TAddGlyphArgs& aArgs, TGlyphImageInfo& aGlyphImageInfo)
+	{
+	return iAtlas->AddGlyph(aFont, aArgs, aGlyphImageInfo);
+	}
+
+void CGlyphAtlasTestWrapper::FontReleased(const CBitmapFont& aFont)
+	{
+	iAtlas->FontReleased(aFont);
+	}
+
+/**
+Returns the current size of the glyph image memory used by the atlas in bytes.
+*/
+TInt CGlyphAtlasTestWrapper::SizeInBytes() const
+	{
+	return iAtlas->iCacheSizeInBytes;
+	}
+
+/**
+Tests whether the least recently used page contains the given glyph.
+@param aGlyphCode The glyph code to match.
+@return ETrue if the lru page contains the given glyph, EFalse if not.
+*/
+TBool CGlyphAtlasTestWrapper::LruPageContainsGlyph(TUint aGlyphCode) const
+	{
+	CGlyphAtlasPage* page = iAtlas->iLruPageList.Last();
+	TInt numGlyphsInPage = page->GlyphCount();
+	TBool glyphFound = EFalse;
+	for (TInt ii = 0; ii < numGlyphsInPage && !glyphFound; ++ii)
+		{
+		glyphFound = (aGlyphCode == page->GlyphCodeAt(ii));
+		}
+	return glyphFound;
+	}
+
+/**
+Returns the number of glyphs associated to the given font in the atlas.
+*/
+TInt CGlyphAtlasTestWrapper::GlyphCountByFont(const CBitmapFont* aFont)
+	{
+	TInt glyphCount = 0;
+	TDblQueIter<CGlyphAtlasPage> iter(iAtlas->iLruPageList);
+	CGlyphAtlasPage* page;
+	while((page=iter++) != NULL)
+		{
+		if (&page->FontEntry().Font() == aFont)
+			{
+			glyphCount += page->GlyphCount();
+			}
+		}
+	return glyphCount;
+	}
+
+/**
+Returns the number of glyphs in the atlas.
+*/
+TInt CGlyphAtlasTestWrapper::GlyphCount()
+	{
+	TInt glyphCount = 0;
+	TDblQueIter<CGlyphAtlasPage> iter(iAtlas->iLruPageList);
+	CGlyphAtlasPage* page;
+	while((page=iter++) != NULL)
+		{
+		glyphCount += page->GlyphCount();
+		}
+	return glyphCount;
+	}
+
+/**
+Returns the number of fonts in the atlas.
+*/
+TInt CGlyphAtlasTestWrapper::FontCount() const
+	{
+	return iAtlas->iFontEntryArray.Count();
+	}
+
+/**
+Glyph Atlas test wrapper destructor.
+*/
+CGlyphAtlasTestWrapper::~CGlyphAtlasTestWrapper()
+	{
+	delete iAtlas;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/tfbs/glyphatlastestwrapper.h	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,48 @@
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef GLYPHATLASTESTWRAPPER_H
+#define GLYPHATLASTESTWRAPPER_H
+
+#include "glyphatlas.h"
+
+
+/**
+Class to provide access to glyph atlas metrics for test purposes
+*/
+NONSHARABLE_CLASS(CGlyphAtlasTestWrapper)
+    {
+public:
+	~CGlyphAtlasTestWrapper();
+	static CGlyphAtlasTestWrapper* NewL(TInt aMaxCacheSizeInBytes);
+	static CGlyphAtlasTestWrapper* NewLC(TInt aMaxCacheSizeInBytes);
+	TInt GetGlyph(const CBitmapFont& aFont, TUint aGlyphCode, TGlyphImageInfo& aGlyphImageInfo);
+	TInt AddGlyph(const CBitmapFont& aFont, const CGlyphAtlas::TAddGlyphArgs& aArgs, TGlyphImageInfo& aGlyphImageInfo);
+	void FontReleased(const CBitmapFont& aFont);
+	
+	// Utility functions providing access to internals of glyph atlas
+	TInt SizeInBytes() const;
+	TInt GlyphCountByFont(const CBitmapFont* aFont);
+	TInt GlyphCount();
+	TInt FontCount() const;
+	TBool LruPageContainsGlyph(TUint aGlyphCode) const;
+private:
+	CGlyphAtlasTestWrapper();
+	void ConstructL(TInt aMaxCacheSizeInBytes);
+private:
+	CGlyphAtlas* iAtlas;
+    };
+
+#endif /* GLYPHATLASTESTWRAPPER_H */
--- a/fbs/fontandbitmapserver/tfbs/mbmfiles/dummyrscfile3.rsc	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/tfbs/mbmfiles/dummyrscfile3.rsc	Fri Jul 16 11:45:55 2010 +0300
@@ -1,10 +1,10 @@
-11111111111111111111111111111111111111111111111111111111111111111111111111111
-22222222222222222222222222222222222222222222222222222222222222222222222222222
-33333333333333333333333333333333333333333333333333333333333333333333333333333
-44444444444444444444444444444444444444444444444444444444444444444444444444444
-55555555555555555555555555555555555555555555555555555555555555555555555555555
-66666666666666666666666666666666666666666666666666666666666666666666666666666
-77777777777777777777777777777777777777777777777777777777777777777777777777777
-88888888888888888888888888888888888888888888888888888888888888888888888888888
-99999999999999999999999999999999999999999999999999999999999999999999999999999
+11111111111111111111111111111111111111111111111111111111111111111111111111111
+22222222222222222222222222222222222222222222222222222222222222222222222222222
+33333333333333333333333333333333333333333333333333333333333333333333333333333
+44444444444444444444444444444444444444444444444444444444444444444444444444444
+55555555555555555555555555555555555555555555555555555555555555555555555555555
+66666666666666666666666666666666666666666666666666666666666666666666666666666
+77777777777777777777777777777777777777777777777777777777777777777777777777777
+88888888888888888888888888888888888888888888888888888888888888888888888888888
+99999999999999999999999999999999999999999999999999999999999999999999999999999
 00000000000000000000000000000000000000000000000000000000000000000000000000000
\ No newline at end of file
--- a/fbs/fontandbitmapserver/tfbs/scripts/fbstest_T_IPCTest.script	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/tfbs/scripts/fbstest_T_IPCTest.script	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -46,7 +46,10 @@
 RUN_TEST_STEP !PanicCode=-6 100 TFbsServer TIPCTest z:\fbstest\ipctest_config.ini ShapeDelete
 RUN_TEST_STEP !PanicCode=-6 100 TFbsServer TIPCTest z:\fbstest\ipctest_config.ini SetTwipsHeight
 RUN_TEST_STEP !PanicCode=-6 100 TFbsServer TIPCTest z:\fbstest\ipctest_config.ini GetTwipsHeight
+RUN_TEST_STEP !PanicCode=-8 100 TFbsServer TIPCTest z:\fbstest\ipctest_config.ini GetGlyphs
+RUN_TEST_STEP !PanicCode=-8 100 TFbsServer TIPCTest z:\fbstest\ipctest_config.ini GetGlyphMetrics
 RUN_TEST_STEP !PanicCode=-6 100 TFbsServer TIPCTest z:\fbstest\ipctest_config.ini GetFontTableWrongMsg
 RUN_TEST_STEP !PanicCode=-6 100 TFbsServer TIPCTest z:\fbstest\ipctest_config.ini ReleaseFontTableWrongMsg
 RUN_TEST_STEP !PanicCode=-38 100 TFbsServer TIPCTest z:\fbstest\ipctest_config.ini GetGlyphOutlineWrongMsg
 RUN_TEST_STEP !PanicCode=-38 100 TFbsServer TIPCTest z:\fbstest\ipctest_config.ini ReleaseGlyphOutlineWrongMsg
+
--- a/fbs/fontandbitmapserver/tfbs/scripts/fbstest_run.bat	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/tfbs/scripts/fbstest_run.bat	Fri Jul 16 11:45:55 2010 +0300
@@ -26,6 +26,9 @@
 testexecute.exe  z:\fbstest\fbstest_t_ipctest.script
 testexecute.exe  z:\fbstest\fbstest_t_extendedbitmap.script
 testexecute.exe  z:\fbstest\fbstest_t_fonttable.script
+testexecute.exe  z:\fbstest\fbstest_t_glyphdata.script		
+testexecute.exe  z:\fbstest\fbstest_t_glyphdataoutlineshadow.script	
+testexecute.exe  z:\fbstest\fbstest_t_oogm.script
 
 @echo off
 md e:\logs
--- a/fbs/fontandbitmapserver/tfbs/scripts/fbstest_t_fonttable.script	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/tfbs/scripts/fbstest_t_fonttable.script	Fri Jul 16 11:45:55 2010 +0300
@@ -16,10 +16,10 @@
 PRINT Run TFontTableAndGlyphOutline Fbserv test 
 
 RUN_UTILS MakeReadWrite C:\DejaVuSans.ttf
-RUN_UTILS CopyFile z:\RESOURCE\FONTS\DejaVuSans.ttf C:\DejaVuSans.ttf
+RUN_UTILS CopyFile z:\RESOURCE\FONTS\DejaVuSansCondensed.ttf C:\DejaVuSans.ttf
 RUN_UTILS MakeReadWrite C:\DejaVuSans.TTF 
 RUN_UTILS MakeReadWrite C:\DejaVuSerif.ttf
-RUN_UTILS CopyFile z:\RESOURCE\FONTS\DejaVuSerif.ttf C:\DejaVuSerif.ttf
+RUN_UTILS CopyFile z:\RESOURCE\FONTS\DejaVuSerifCondensed.ttf C:\DejaVuSerif.ttf
 RUN_UTILS MakeReadWrite C:\DejaVuSerif.ttf
 
 // Set test server to have no Capabilitities
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/tfbs/scripts/fbstest_t_glyphdata.script	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,32 @@
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+PRINT Run TGlyphAtlas & TFbsGlyphData Fbserv tests 
+//
+LOAD_SUITE TFbsServer
+RUN_TEST_STEP 100 TFbsServer TGlyphAtlas
+RUN_TEST_STEP 800 TFbsServer TFbsGlyphData
+RUN_PANIC_STEP_RESULT 31 FBSCLI 100 TFbsServer TFbsGlyphDataPanic z:\fbstest\glyphdata_config.ini NotInitializedNext
+RUN_PANIC_STEP_RESULT 31 FBSCLI 100 TFbsServer TFbsGlyphDataPanic z:\fbstest\glyphdata_config.ini NotInitializedImage
+RUN_PANIC_STEP_RESULT 31 FBSCLI 100 TFbsServer TFbsGlyphDataPanic z:\fbstest\glyphdata_config.ini NotInitializedMetrics
+RUN_PANIC_STEP_RESULT 31 FBSCLI 100 TFbsServer TFbsGlyphDataPanic z:\fbstest\glyphdata_config.ini NotInitializedGlyphCode
+RUN_PANIC_STEP_RESULT 31 FBSCLI 100 TFbsServer TFbsGlyphDataPanic z:\fbstest\glyphdata_config.ini ClosedNext
+RUN_PANIC_STEP_RESULT 31 FBSCLI 100 TFbsServer TFbsGlyphDataPanic z:\fbstest\glyphdata_config.ini ClosedImage
+RUN_PANIC_STEP_RESULT 31 FBSCLI 100 TFbsServer TFbsGlyphDataPanic z:\fbstest\glyphdata_config.ini ClosedMetrics
+RUN_PANIC_STEP_RESULT 31 FBSCLI 100 TFbsServer TFbsGlyphDataPanic z:\fbstest\glyphdata_config.ini ClosedGlyphCode
+RUN_PANIC_STEP_RESULT -8 FBSERV 100 TFbsServer TFbsGlyphDataPanic z:\fbstest\glyphdata_config.ini DiscardUsedFont
+RUN_PANIC_STEP_RESULT 32 FBSCLI 100 TFbsServer TFbsGlyphDataPanic z:\fbstest\glyphdata_config.ini IndexNegative
+RUN_PANIC_STEP_RESULT 32 FBSCLI 100 TFbsServer TFbsGlyphDataPanic z:\fbstest\glyphdata_config.ini IndexTooHigh
+RUN_PANIC_STEP_RESULT 31 FBSCLI 100 TFbsServer TFbsGlyphDataPanic z:\fbstest\glyphdata_config.ini IteratorOpenFailed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/tfbs/scripts/fbstest_t_glyphdataoutlineshadow.script	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,20 @@
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+PRINT Run TFbsGlyphData Fbserv test 
+//
+LOAD_SUITE TFbsServer
+//the following test must be run with a rasterizer which supports outline and shadow
+RUN_TEST_STEP 300 TFbsServer TFbsGlyphDataOutlineAndShadow
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/tfbs/scripts/fbstest_t_oogm.script	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,19 @@
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+PRINT Run TFbsOogm Fbserv tests 
+//
+LOAD_SUITE TFbsServer
+RUN_TEST_STEP 100 TFbsServer TFbsOogm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/tfbs/scripts/glyphdata_config.ini	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,36 @@
+[NotInitializedNext]
+CaseNumber = 1
+
+[NotInitializedImage]
+CaseNumber = 2
+
+[NotInitializedMetrics]
+CaseNumber = 3
+
+[NotInitializedGlyphCode]
+CaseNumber = 4
+
+[ClosedNext]
+CaseNumber = 5
+
+[ClosedImage]
+CaseNumber = 6
+
+[ClosedMetrics]
+CaseNumber = 7
+
+[ClosedGlyphCode]
+CaseNumber = 8
+
+[DiscardUsedFont]
+CaseNumber = 9
+
+[IndexNegative]
+CaseNumber = 10
+
+[IndexTooHigh]
+CaseNumber = 11
+
+[IteratorOpenFailed]
+CaseNumber = 12
+
--- a/fbs/fontandbitmapserver/tfbs/scripts/ipctest_config.ini	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/tfbs/scripts/ipctest_config.ini	Fri Jul 16 11:45:55 2010 +0300
@@ -67,14 +67,21 @@
 [GetTwipsHeight]
 CaseNumber = 23
 
-[GetFontTableWrongMsg]
+[GetGlyphs]
 CaseNumber = 24
 
-[ReleaseFontTableWrongMsg]
+[GetGlyphMetrics]
 CaseNumber = 25
 
-[GetGlyphOutlineWrongMsg]
+[GetFontTableWrongMsg]
 CaseNumber = 26
 
+[ReleaseFontTableWrongMsg]
+CaseNumber = 27
+
+[GetGlyphOutlineWrongMsg]
+CaseNumber = 28
+
 [ReleaseGlyphOutlineWrongMsg]
-CaseNumber = 27
+CaseNumber = 29
+
--- a/fbs/fontandbitmapserver/tfbs/tcompressed.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/tfbs/tcompressed.h	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -18,7 +18,7 @@
 
 #include <fbs.h>
 #include "TFBS.H"
-#include "TGraphicsHarness.h"
+#include "test/TGraphicsHarness.h"
 
 class CTCompressed : public CTGraphicsBase
 	{
--- a/fbs/fontandbitmapserver/tfbs/textendedbitmapcommon.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/tfbs/textendedbitmapcommon.h	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -16,7 +16,7 @@
 #ifndef TEXTENDEDBITMAPCOMMON_H
 #define TEXTENDEDBITMAPCOMMON_H
 
-#include "TGraphicsHarness.h"
+#include "test/TGraphicsHarness.h"
 
 // Uid for use when testing an extended bitmap that does not need to be
 // drawn using the example rasterizer.
--- a/fbs/fontandbitmapserver/tfbs/tfbsbase.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/tfbs/tfbsbase.h	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -16,7 +16,7 @@
 #ifndef TFBSBASE_H
 #define TFBSBASE_H
 
-#include "TGraphicsHarness.h"
+#include "test/TGraphicsHarness.h"
 #include <f32file.h>
 
 #define INFO_PRINTF9(p1, p2, p3, p4, p5, p6, p7, p8, p9) \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/tfbs/tfbsglyphdata.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,3229 @@
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <EGL/egl.h>
+#include <VG/openvg.h>
+#include <graphics/fbsglyphmetricsarray.h> 
+#include <graphics/fbsglyphdataiterator.h>
+#include <sgresource/sgimage.h>
+#include <sgresource/sgdriver_test.h>
+#include <sgresource/sgdriver_profiling.h>
+#include "FbsMessage.h"
+#include "tfbsglyphdata.h"
+
+_LIT(KTypefaceName, "DejaVu Sans Condensed");
+//_LIT(KMonoTypefaceName, "DejaVu Sans Mono");
+const TInt KNumGlyphCodesLatin = 96;
+const TUint KDejaVuInvalidGlyphCode = 0;
+
+// Currently only used in debug. When TestMultithreadStressAtlas() test is enabled, #ifdef to be removed. 
+#ifdef _DEBUG
+const TInt KTestThreadMinHeapSize = 0x20000;
+const TInt KTestThreadMaxHeapSize = 0x20000;
+#endif
+
+// 'most significant bit' flag to ensure value is interpreted as a glyph code rather than an ascii code
+const TUint KGlyphCodeFlag = 0x80000000;      
+
+
+// Please note the following macros which enable helper functions, and are declared in the header.
+// SAVEGLYPHSTOMBMDURINGCOMPARISON and
+// SAVEGLYPHSTOMBMDEBUGFUNCTION
+
+/*
+Lookup table to convert from ascii code to
+glyph code for the Deja Vu family of fonts.
+ */
+const TUint DejaVuASCIIToGlyphCode[] = 
+	{
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+	0, 0, 3, 4, 5, 6, 7, 8, 9, 10,
+	11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
+	21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
+	31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+	41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
+	51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
+	61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
+	71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
+	81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
+	91, 92, 93, 94, 95, 96, 97, 98,
+	};
+
+// Utility function declations - utilities used by the tests
+static TFontSpec GenerateDejaVuFontSpec(TInt aSeed);
+static void CopyCharLine(TUint32*& aBinaryDataPtr,TInt aBufferWords,const TUint8* aData,TInt aBitShift,TInt aCharWidth, TInt16 aRepeatCount);
+static void DecodeBinaryData(const TSize& aDataSize, const TUint8* aData, TInt aStride,	TUint32* aBinaryData);
+static TInt CreateSgImageFromCharacterData(const TUint8* aData, const TSize& aSize, TGlyphBitmapType aType, RSgImage& aImage);
+static TInt CreateSgImageFromCharacterData(const TUint8* aData, const TSize& aSize, TGlyphBitmapType aType, RSgImage& aImage, TUint8* aBuffer1, TUint8* aBuffer2);
+// Following functions commented out because the tests which use these functions 
+// are currently commented out due to Broadcom defect 
+// ESLM-85LDV7 - TB10.1 Closing of RSgImage with duplicate handle used in same thread does not release GPU RAM
+//static TInt FillGraphicsMemoryWithImages(const TSize& aSize, RArray<RSgImage>& aImages);
+//static TInt NearlyFillGraphicsMemoryWithImages(const TSize& aSize, RArray<RSgImage>& aImages);
+
+#if defined (SAVEGLYPHSTOMBMDEBUGFUNCTION) || defined (SAVEGLYPHSTOMBMDURINGCOMPARISON)
+/**
+Static utility function. Converts an A8 RSgImage into a CFbsBitmap.
+To do this, the RSgImage is converted to an EGLImage, then to a VGImage,
+where the image memory is read into a CFbsBitmap.
+
+@param aEGL The EGL helper object that will read the SgImage into a memory buffer.
+@param aSgImage The RSgImage to convert.
+@param aRect A rectangular region of the RSgImage to convert.
+@param aBitmap On success, holds a pointer to a CFbsBitmap which contains the image
+	data of the RSgImage.
+@return One of the system-wide error codes.
+*/
+static TInt CreateBitmapFromSgImage(CEGLHelper* aEGL, const RSgImage& aSgImage, const TRect& aRect, CFbsBitmap*& aBitmap)
+	{
+	TInt err = KErrNone;
+	const TSize bufferSize = aRect.Size();
+	const TInt dataStride = bufferSize.iWidth;
+
+	TUint8* imageBuffer = reinterpret_cast<TUint8*>(User::AllocZ(bufferSize.iHeight * dataStride));
+	if (!imageBuffer)
+		{
+		return KErrNoMemory;
+		}
+	err = aEGL->GetSgImageData(aSgImage, aRect, imageBuffer);
+	if (err != KErrNone)
+		{
+		User::Free(imageBuffer);
+		return err;
+		}
+	aBitmap = new CFbsBitmap();
+	if (!aBitmap)
+		{
+		User::Free(imageBuffer);
+		return KErrNoMemory;
+		}
+
+	err = aBitmap->Create(bufferSize, EGray256);
+	if (KErrNone == err)
+		{
+		TUint8* buf = imageBuffer;
+		aBitmap->BeginDataAccess();
+		TUint8* dataAddress = reinterpret_cast<TUint8*>(aBitmap->DataAddress());
+		const TInt dataStride = aBitmap->DataStride();	
+		for (TInt scanline = 0; scanline < bufferSize.iHeight; scanline++)
+			{
+			Mem::Copy(dataAddress, buf, bufferSize.iWidth);
+			dataAddress += dataStride;
+			buf += bufferSize.iWidth;
+			}
+		aBitmap->EndDataAccess(EFalse);
+		}
+	else
+		{
+		delete aBitmap;
+		aBitmap = NULL;
+		}
+
+	User::Free(imageBuffer);
+	return err;
+	}
+
+/**
+Utility function to aid with debugging.
+Saves a bitmap to file.
+
+@param aBmp Bitmap to save
+@param aMeta Optional. If specified, it is added to the name of the bitmap file.
+@param aRef Flag to show whether bitmap is a reference bitmap (ETrue) or test bitmap (EFalse).
+*/
+static void SaveBmp(CFbsBitmap* aBmp, TPtrC* aMeta, TBool aRef)
+	{
+	if (!aBmp)
+		{
+		return;
+		}
+	
+	TBuf<256> testFileName;
+	if (aRef)
+		{
+		testFileName.Append(_L("Ref"));
+		}
+	else
+		{
+		testFileName.Append(_L("Test"));
+		}
+	if (aMeta)
+		{
+		testFileName.Append(*aMeta);
+		}
+
+	TFileName mbmFile;
+	TBuf<20> testPathName;
+	#ifdef __WINS__
+		testPathName.Append(_L("c:\\%S.mbm"));
+	#else
+		testPathName.Append(_L("e:\\%S.mbm"));
+	#endif
+	mbmFile.Format(testPathName, &testFileName);
+
+	// As this is for debugging purposes only, doesn't matter reporting whether
+	// saving succeeded or not.
+	aBmp->Save(mbmFile);
+	}
+#endif // SAVEGLYPHSTOMBMDEBUGFUNCTION OR SAVEGLYPHSTOMBMDURINGCOMPARISON
+
+
+#ifdef SAVEGLYPHSTOMBMDEBUGFUNCTION
+void CTFbsGlyphData::SaveRSgImagesAsMbms(CEGLHelper* aEGL, const RSgImage& aImageA, const TRect& aRectA, const RSgImage& aImageB, const TRect& aRectB )
+	{
+	static TInt countToAppend = 0;
+
+	CFbsBitmap* bitmap = NULL;
+	if (KErrNone == CreateBitmapFromSgImage(aEGL, aImageA, aRectA, bitmap))
+		{
+		TBuf<KMaxFileName> buf( _L("String") );
+		buf.AppendNum( countToAppend );
+		TPtrC nameAppend( buf );
+
+		SaveBmp(bitmap, &nameAppend, EFalse);
+		}
+	delete bitmap;  
+	bitmap = NULL;
+
+	if (KErrNone == CreateBitmapFromSgImage(aEGL, aImageB, aRectB, bitmap))
+		{
+		TBuf<KMaxFileName> buf( _L("String") );
+		buf.AppendNum( countToAppend );
+		TPtrC nameAppend( buf );
+
+		SaveBmp(bitmap, &nameAppend, ETrue);
+		}
+	delete bitmap;
+	bitmap = NULL;
+
+	countToAppend++;
+	}
+
+/**
+Static debug utility method that outputs the glyph images of the given glyph
+codes for the given font to a file.
+ */
+static void DumpFontGlyphs(CEGLHelper* aEGL, CFont* aFont, TInt aCodesCount)
+	{
+	TFontSpec fontSpec = aFont->FontSpecInTwips();
+	TOpenFontCharMetrics charMetrics;
+	TSize bitmapSize;
+	const TUint8* bitmapData = NULL;
+	
+	for (TInt glyphCode = 0; glyphCode < aCodesCount; glyphCode++)
+		{
+		CFont::TCharacterDataAvailability availability = aFont->GetCharacterData(glyphCode | KGlyphCodeFlag, charMetrics, bitmapData, bitmapSize);
+		if (availability == CFont::EAllCharacterData)
+			{
+			RSgImage characterDataImage;
+			TInt err = CreateSgImageFromCharacterData(bitmapData, bitmapSize, fontSpec.iFontStyle.BitmapType(), characterDataImage);
+			if (err == KErrNone)
+				{
+				CFbsBitmap* bitmap = NULL;
+				err = CreateBitmapFromSgImage(aEGL, characterDataImage, TRect(TPoint(0, 0), bitmapSize), bitmap);
+				if (err == KErrNone)
+					{
+					TBuf<256> bitmapName;
+					bitmapName.AppendFormat(_L("%S-%i"), &(fontSpec.iTypeface.Name()), glyphCode);
+					TPtrC bitmapNamePtr(bitmapName);
+					SaveBmp(bitmap, &bitmapNamePtr, EFalse);
+					delete bitmap;
+					}
+				}
+			characterDataImage.Close();
+			}
+		}
+	}
+#endif // SAVEGLYPHSTOMBMDEBUGFUNCTION
+
+
+/**
+Utility to return a fontspec such that the font created from it will
+not match any other font generated by a different seed. The font
+will be useable by RFbsGlyphDataIterator and RFbsGlyphMetricsArray.
+It will always return a font based on the DejaVu fontspec, this is 
+so that the glyphcodes in DejaVuASCIIToGlyphCode are guaranteed to
+work.
+
+@param aSeed Specifies a variant of the fontspec to create. Passing the
+	same seed will cause the same TFontSpec to be returned.
+@return The generated fontspec. 
+ */
+static TFontSpec GenerateDejaVuFontSpec(TInt aSeed)
+	{
+	const TInt KFontHeightStep = 4;
+	const TInt KFontInitialHeight = 8;
+	
+	const TInt KNumFontTypefaces = 3;
+	const TInt KNumFontBitmapTypes = 2;
+	const TInt KNumFontStyles = 4;
+	
+	TInt fontBitmapTypeVariant = aSeed % KNumFontBitmapTypes;
+	TInt fontStyleVariant = (aSeed / KNumFontBitmapTypes) % KNumFontStyles;
+	TInt fontTypefaceVariant = (aSeed / ( KNumFontStyles * KNumFontBitmapTypes)) % KNumFontTypefaces;
+	TInt fontHeightVariant = aSeed / (KNumFontStyles * KNumFontTypefaces * KNumFontBitmapTypes);
+	
+	TFontSpec fontSpec;	
+	fontSpec.iHeight = KFontInitialHeight + (fontHeightVariant * KFontHeightStep);
+	// Set the typeface name
+	// Set the style.
+	switch (fontStyleVariant)
+		{
+		case 1: // italic
+			fontSpec.iFontStyle.SetPosture(EPostureItalic);
+			fontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightNormal);
+			break;
+		case 2: // bold
+			fontSpec.iFontStyle.SetPosture(EPostureUpright);
+			fontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightBold);
+			break;
+		case 3: // bold italic
+			fontSpec.iFontStyle.SetPosture(EPostureItalic);
+			fontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightBold);
+			break;
+		default: // normal 
+			fontSpec.iFontStyle.SetPosture(EPostureUpright);
+			fontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightNormal);
+			break;
+		}
+	switch (fontTypefaceVariant)
+		{
+		case 1:
+			fontSpec.iTypeface.SetName(_L("DejaVu Sans Mono"));
+			break;
+		case 2:
+			fontSpec.iTypeface.SetName(_L("DejaVu Serif Condensed"));
+			break;
+		case 3:
+			fontSpec.iTypeface.SetName(_L("DejaVu Sans Condensed"));
+			break;
+		}
+	switch(fontBitmapTypeVariant)
+		{
+		case 1:
+			fontSpec.iFontStyle.SetBitmapType(EMonochromeGlyphBitmap);
+			break;
+		default:
+			fontSpec.iFontStyle.SetBitmapType(EAntiAliasedGlyphBitmap);
+			break;
+		}
+
+	return fontSpec;
+	}
+
+
+/**
+ * 
+ EGL helper class to retrieve image data from an SgImage into a memory buffer.
+ */
+CEGLHelper::CEGLHelper() :
+	iDisplay(EGL_NO_DISPLAY),
+	iContext(EGL_NO_CONTEXT),
+	iSurface(EGL_NO_SURFACE)
+	{
+	}
+CEGLHelper::~CEGLHelper()
+	{
+	iMutex.Close();
+	eglMakeCurrent(iDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+	eglDestroyContext(iDisplay, iContext);
+	eglDestroySurface(iDisplay, iSurface);
+	eglTerminate(iDisplay);
+	eglReleaseThread();
+	iSgDriver.Close();
+	}
+
+/**
+Factory method to create CEGLHelper.
+@return A pointer to an instance of CEGLHelper.
+ */
+CEGLHelper* CEGLHelper::NewL()
+	{
+	CEGLHelper* self = new CEGLHelper();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(1); // self
+	return self;
+	}
+
+/**
+Opens handle to the process-wide synchronisation semaphore,
+loads EGL and VG extension function pointers,
+sets up EGL resources so that EGLImages can be constructed. 
+ */
+void CEGLHelper::ConstructL()
+	{
+	_LIT(KEGLMutex, "TFbsGlyphDataEGLMutex");
+	User::LeaveIfError(iMutex.CreateGlobal(KEGLMutex, EOwnerProcess));
+	User::LeaveIfError(iSgDriver.Open());
+
+	iDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+	if (iDisplay == EGL_NO_DISPLAY)
+		{
+		User::Leave(KErrNotSupported);
+		}
+	if (EGL_TRUE != eglInitialize(iDisplay, NULL, NULL))
+		{
+		User::Leave(KErrNotSupported);
+		}
+	eglBindAPI(EGL_OPENVG_API);
+
+	// Load the necessary EGL extensions...
+	eglCreateImageKHR = reinterpret_cast<PFNEGLCREATEIMAGEKHRPROC>(eglGetProcAddress("eglCreateImageKHR"));
+	eglDestroyImageKHR = reinterpret_cast<PFNEGLDESTROYIMAGEKHRPROC>(eglGetProcAddress("eglDestroyImageKHR"));
+	vgCreateImageTargetKHR = reinterpret_cast<TvgCreateEGLImageTargetKHRTypefPtr>(eglGetProcAddress("vgCreateEGLImageTargetKHR"));
+	if (!eglCreateImageKHR || !eglDestroyImageKHR || !vgCreateImageTargetKHR)
+		{
+		User::Leave(KErrExtensionNotSupported);
+		}
+
+	// In order to create VGImages from EGLImages, a context must be current.
+	// Therefore create an EGLContext and EGLSurface to make current, using
+	// a dummy RSgImage.
+
+	RSgImage dummySurface;
+	TSgImageInfo dummySurfaceInfo(TSize(1, 1), ESgPixelFormatRGB_565, ESgUsageBitOpenVgSurface);
+	User::LeaveIfError(dummySurface.Create(dummySurfaceInfo, NULL, 0));
+	CleanupClosePushL(dummySurface);
+
+	EGLint configAttribs[] = 
+		{
+		EGL_MATCH_NATIVE_PIXMAP, (EGLint)&dummySurface,
+		EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT,
+		EGL_NONE
+		};
+
+	EGLint configId = 0;
+	EGLint numConfigs = 0;
+	if (EGL_FALSE == eglChooseConfig(iDisplay, configAttribs, &configId, 1, &numConfigs) || numConfigs == 0)
+		{
+		User::Leave(KErrGeneral);
+		}
+	iContext = eglCreateContext(iDisplay, configId, EGL_NO_CONTEXT, NULL);
+	if (iContext == EGL_NO_CONTEXT)
+		{
+		User::Leave(KErrGeneral);
+		}
+	iSurface = eglCreatePixmapSurface(iDisplay, configId, &dummySurface, NULL);
+	if (iSurface == EGL_NO_SURFACE)
+		{
+		User::Leave(KErrGeneral);
+		}
+	CleanupStack::PopAndDestroy(1); // dummySurface
+	}
+
+/**
+Retrieves the data from an A8 RSgImage into a buffer.
+To do this, the RSgImage is converted to an EGLImage, then to a VGImage,
+where the image memory is read into the given buffer.
+The function can be called from multiple threads and synchronisation
+with EGL is controlled via a mutex.
+
+@param aSgImage The RSgImage to convert.
+@param aRect A rectangular region of the RSgImage to convert.
+@param aBuf On success, contains the image data of the RSgImage.
+@return One of the system-wide error codes.
+ */
+TInt CEGLHelper::GetSgImageData(const RSgImage& aSgImage, const TRect& aRect, TUint8*& aBuf)
+	{
+	const TSize bufferSize = aRect.Size();
+	const TInt dataStride = bufferSize.iWidth;
+
+	if (bufferSize == TSize(0,0))
+		{
+		return KErrNone;
+		}
+	iMutex.Wait();
+
+	TInt err = KErrNone;
+	EGLImageKHR eglImage;
+	if (EGL_FALSE == eglBindAPI(EGL_OPENVG_API))
+		{
+		err = KErrGeneral;
+		}
+	else if (EGL_FALSE == eglMakeCurrent(iDisplay, iSurface, iSurface, iContext))
+		{
+		err = KErrGeneral;
+		}
+	else
+		{
+		// Create EGLImages from the RSgImage.
+		EGLint imageAttribs[] =
+			{
+			EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, 
+			EGL_NONE
+			};
+		eglImage = eglCreateImageKHR(iDisplay, EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, reinterpret_cast<EGLClientBuffer>(&aSgImage), imageAttribs);
+		if (eglImage == EGL_NO_IMAGE_KHR)
+			{
+			err = KErrArgument;
+			}
+		}
+	if (err == KErrNone)
+		{
+		// Create VGImages from the EGLImage.
+		VGImage vgImage = vgCreateImageTargetKHR(eglImage);
+		eglDestroyImageKHR(iDisplay, eglImage);
+		if (vgImage == VG_INVALID_HANDLE)
+			{
+			err = KErrArgument;
+			}
+		else
+			{
+			// Get the image data in 8bpp format
+			vgGetImageSubData(vgImage, aBuf, dataStride, VG_A_8, aRect.iTl.iX, aRect.iTl.iY, bufferSize.iWidth, bufferSize.iHeight);
+			vgDestroyImage(vgImage);
+			}
+		}
+	eglReleaseThread();
+	iMutex.Signal();
+	return err;
+	}
+
+CTFbsGlyphData::CTFbsGlyphData(CTestStep* aStep):
+	CTGraphicsBase(aStep)
+	{
+	}
+
+void CTFbsGlyphData::ConstructL()
+	{
+	User::LeaveIfError(Logger().ShareAuto());
+	User::LeaveIfError(RFbsSession::Connect());
+	iFbs = RFbsSession::GetSession();
+	iTs = (CFbsTypefaceStore*)CFbsTypefaceStore::NewL(NULL);
+	User::LeaveIfError(iTs->GetNearestFontToDesignHeightInPixels((CFont*&)iFont, TFontSpec(KTypefaceName, 15)));
+	User::LeaveIfError(iTs->GetNearestFontToDesignHeightInPixels((CFont*&)iFont2, TFontSpec(KTypefaceName, 8)));
+	
+	iGlyphCodesLatin = new(ELeave) TUint[KNumGlyphCodesLatin];
+	for (TInt ii = 0; ii < KNumGlyphCodesLatin; ++ii)
+		{
+		TUint asciiCode = ii+0x20; // ASCII characters from 0020 to 007F
+		iGlyphCodesLatin[ii] = DejaVuASCIIToGlyphCode[asciiCode];
+		}
+	
+	User::LeaveIfError(iSgDriver.Open());
+	iEGL = CEGLHelper::NewL();
+	
+	// Creating a CFbsBitmap will force the RFbsSession to allocate a scanline buffer
+	// now rather than in the middle of a test, thus avoiding heap check failure. 
+	CFbsBitmap* dummyBitmap = new (ELeave) CFbsBitmap;
+	CleanupStack::PushL(dummyBitmap);
+	User::LeaveIfError(dummyBitmap->Create(TSize(512, 1), EGray256));
+	CleanupStack::PopAndDestroy(dummyBitmap);
+
+	INFO_PRINTF1(_L("FBSERV Glyph Data Testing"));
+	}
+
+
+
+
+CTFbsGlyphData::~CTFbsGlyphData()
+	{
+	delete iEGL;
+	iSgDriver.Close();
+	if (iTs)
+		{
+		iTs->ReleaseFont(iFont);
+		iTs->ReleaseFont(iFont2);
+		}
+	delete iTs;
+	delete[] iGlyphCodesLatin;
+	User::Free(iTempBuf1);
+	User::Free(iTempBuf2);
+	RFbsSession::Disconnect();
+	}
+
+void CTFbsGlyphData::RunTestCaseL(TInt aCurTestCase)
+	{
+	((CTFbsGlyphDataStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
+	
+	TRAPD(leave, 
+
+	switch(aCurTestCase)
+		{
+	case 1:
+		((CTFbsGlyphDataStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0624"));
+		TestConsistencyWithGetCharacterData();
+		break;
+	case 2:
+		((CTFbsGlyphDataStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0625"));
+		TestInvalidGlyphCode();
+		break;
+	case 3:
+		((CTFbsGlyphDataStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0626"));
+		TestGlyphMetricsArrayParameters();
+		break;
+	case 4:
+		((CTFbsGlyphDataStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0627"));
+		TestGlyphMetricsArrayReuse();
+		break;
+	case 5:
+		((CTFbsGlyphDataStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0628"));
+		TestGlyphDataIteratorClose();
+		break;
+	case 6:
+		((CTFbsGlyphDataStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0629"));
+		TestGlyphDataIteratorSequence();
+		break;	
+	case 7:
+		((CTFbsGlyphDataStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0632"));
+		TestGlyphDataIteratorMultipleUsesOnMultipleFonts();
+		break;
+	case 8:
+		((CTFbsGlyphDataStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0633"));
+		TestGlyphDataIteratorImageValidity();
+		break;
+	case 9:
+		((CTFbsGlyphDataStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0634"));
+		TestGlyphDataIteratorOpenInvalidCode();
+		break;
+	case 10:
+		((CTFbsGlyphDataStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0636"));
+		TestGlyphDataIteratorOpenTwice();
+		break;
+	case 11:
+		((CTFbsGlyphDataStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0637"));
+		TestGlyphDataIteratorOpenTwiceWithDifferentFonts();
+		break;
+	case 12:
+		((CTFbsGlyphDataStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0638"));
+		TestGlyphDataIteratorOpenTooBigFont();
+		break;
+	case 13:
+		((CTFbsGlyphDataStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0640"));
+		TestGlyphDataIteratorOpenWithWrongArgument();
+		break;
+	case 14:
+		((CTFbsGlyphDataStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0641"));
+		TestGlyphDataIteratorImageMemoryLeak();
+		break;
+	case 15:
+		((CTFbsGlyphDataStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0662"));
+		TestGlyphDataIteratorNoGraphicsMemory();
+		break;
+	case 16: 
+		((CTFbsGlyphDataStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0659"));
+		TestGlyphDataIteratorLargeFontStress();
+		break;
+	case 17: 
+		((CTFbsGlyphDataStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0660"));
+		TestGlyphDataIteratorManyFontsStressL();
+		break;
+	case 18:
+		((CTFbsGlyphDataStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0666"));
+		TestGlyphDataIteratorNextIsAtomic();
+		break;
+	case 19:
+		((CTFbsGlyphDataStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0665"));
+		TestGlyphDataIteratorSameGlyphCodes();
+		break;
+	case 20:
+		((CTFbsGlyphDataStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0668"));
+		TestGlyphDataIteratorManyArraySizes();
+		break;
+	case 21:
+		((CTFbsGlyphDataStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0669"));
+		TestBitmapFontSupport();
+		break;
+	case 22:
+		((CTFbsGlyphDataStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0671"));
+		TestMultithreadShareSingleFont();
+		break;
+	case 23:
+		((CTFbsGlyphDataStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0672"));
+		TestMultithreadStressAtlas();
+		break;
+    case 24:
+        ((CTFbsGlyphDataStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0673"));
+        TestGlyphMetricsArrayHeapOOML();
+        break;
+    case 25:
+        ((CTFbsGlyphDataStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0674"));
+        TestGlyphDataIteratorHeapOOML();
+        break;
+	default:
+		((CTFbsGlyphDataStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
+		((CTFbsGlyphDataStep*)iStep)->CloseTMSGraphicsStep();
+		TestComplete();
+		break;
+		}
+	
+	); // TRAPD
+
+	if (leave != KErrNone)
+		{
+		ERR_PRINTF2(_L("Leave %d occurred during test"), leave);
+		iStep->SetTestStepResult(EFail);
+		}
+
+	((CTFbsGlyphDataStep*)iStep)->RecordTestResultL();
+	}
+
+
+/**
+@SYMTestCaseID		GRAPHICS-FBSERV-0624
+@SYMTestPriority	High
+@SYMTestType		UT
+@SYMTestStatus		Implemented
+@SYMPREQ			PREQ2678
+
+@SYMTestCaseDesc
+	Shows that RFbsGlyphMetricsArray::Get() and CFont::GetCharacterData() all 
+	provide the same metrics for the same set of glyph codes when using a CFbsFont.
+	Shows that RFbsGlyphDataIterator::Metrics() and CFont::GetCharacterData()
+	provide the same metrics for the same set of glyph codes.
+
+@SYMTestActions
+	i. Call RFbsGlyphMetricsArray::Get() for a set of glyph codes with 1 glyph code per call.
+	ii. Call RFbsGlyphMetricsArray::Get() for a set of glyph codes all in 1 call.
+	iii. Call RFbsGlyphDataIterator::Open() for a set of glyph codes.
+	iv. Call CFont::GetCharacterData() for the same set of glyph codes.
+	v. Compare the metrics for each glyph code from all calls.
+
+@SYMTestExpectedResults
+	For each glyph code, metrics received from RFbsGlyphMetricsArray::Get() and
+	CFont::GetCharacterData() and RFbsGlyphDataIterator are all the same.
+*/
+void CTFbsGlyphData::TestConsistencyWithGetCharacterData()
+	{
+	INFO_PRINTF1(_L("Test RFbsGlyphMetricsArray::Get() with GetCharacterData()"));
+	
+	__UHEAP_MARK;
+
+	RFbsGlyphDataIterator iter;
+	RFbsGlyphMetricsArray glyphMetricsArray;
+	RFbsGlyphMetricsArray glyphMetricsArraySingle;
+	
+	TInt numMismatches = 0;
+	TOpenFontCharMetrics charMetrics;
+	TSize bitmapSize;
+	const TUint8* bitmapData = NULL;
+	
+	// Retrieve list of metrics for all glyph codes in one call
+	TInt err = glyphMetricsArray.Get(*iFont, iGlyphCodesLatin, KNumGlyphCodesLatin);
+	TESTNOERROR(err);
+	if (err == KErrNone)
+		{
+		TEST(KNumGlyphCodesLatin == glyphMetricsArray.Count());
+		
+		TInt index = 0;
+		TInt iterErr = iter.Open(*iFont, iGlyphCodesLatin, KNumGlyphCodesLatin);
+		TESTNOERROR(iterErr);
+		for (; iterErr == KErrNone; iterErr = iter.Next(), index++)
+			{
+			iFont->GetCharacterData(iGlyphCodesLatin[index] | KGlyphCodeFlag, charMetrics, bitmapData, bitmapSize);
+			
+			// Retrieve the metrics for each glyph code, one at a time
+			TESTNOERROR(err = glyphMetricsArraySingle.Get(*iFont, &iGlyphCodesLatin[index], 1));
+			if (KErrNone == err)
+				{
+				// Compare GetCharacterData() metrics with single RFbsGlyphMetricsArray.
+				TUint32 comparison1 = CompareMetrics(charMetrics, glyphMetricsArraySingle[0]); 
+				// Compare GetCharacterData() metrics with large RFbsGlyphMetricsArray.
+				TUint32 comparison2 = CompareMetrics(charMetrics, glyphMetricsArray[index]);
+				// Compare GetCharacterData() metrics with RFbsGlyphDataIterator.
+				TUint32 comparison3 = CompareMetrics(charMetrics, iter.Metrics());
+				if (comparison1 != 0 || comparison2 != 0 || comparison3 != 0)
+					{
+					ERR_PRINTF5(_L("Glyphcode %i : Metrics mismatch: %d/%d/%d"), iGlyphCodesLatin[index], comparison1, comparison2, comparison3);
+					++numMismatches;
+					}
+				}
+			}
+			iter.Close();
+			glyphMetricsArray.Close();
+			glyphMetricsArraySingle.Close();
+			TESTE(iterErr == KErrNotFound, iterErr);
+			TEST(numMismatches == 0);
+			TEST(index == KNumGlyphCodesLatin);
+		}		
+	
+	__UHEAP_MARKEND;
+	}
+
+/**
+@return A series of success/fail booleans as a bitmask. A return value of zero
+	indicates all tests passed, a result of 1 indicates the first test case failed, 
+	a return of 3 indicates the first and second test failed, and so on.
+*/
+TUint32 CTFbsGlyphData::CompareMetrics(const TOpenFontCharMetrics& aMetrics1, const TOpenFontCharMetrics& aMetrics2)
+	{
+	TUint32 result = 0;
+	result |= (aMetrics1.Width() == aMetrics2.Width()) ? 0 : (1 << 0);
+	result |= (aMetrics1.Height() == aMetrics2.Height()) ? 0 : (1 << 1);
+	result |= (aMetrics1.HorizBearingX() == aMetrics2.HorizBearingX()) ? 0 : (1 << 2);
+	result |= (aMetrics1.HorizBearingY() == aMetrics2.HorizBearingY()) ? 0 : (1 << 3);
+	result |= (aMetrics1.HorizAdvance() == aMetrics2.HorizAdvance()) ? 0 : (1 << 4);
+	result |= (aMetrics1.VertBearingX() == aMetrics2.VertBearingX()) ? 0 : (1 << 5);
+	result |= (aMetrics1.VertBearingY() == aMetrics2.VertBearingY()) ? 0 : (1 << 6);
+	result |= (aMetrics1.VertAdvance() == aMetrics2.VertAdvance()) ? 0 : (1 << 7);
+	TRect rect1;
+	aMetrics1.GetHorizBounds(rect1);
+	TRect rect2;
+	aMetrics2.GetHorizBounds(rect2);
+	result |= (rect1 == rect2) ? 0 : (1 << 8);
+	aMetrics1.GetVertBounds(rect1);
+	aMetrics2.GetVertBounds(rect2);
+	result |= (rect1 == rect2) ? 0 : (1 << 9);
+	return result;
+	}
+
+
+/**
+@SYMTestCaseID		GRAPHICS-FBSERV-0625
+@SYMTestPriority	High
+@SYMTestType		UT
+@SYMTestStatus		Implemented
+@SYMPREQ			PREQ2678
+
+@SYMTestCaseDesc
+	Shows that RFbsGlyphMetricsArray::Get(), and CFont::GetCharacterData() show the same 
+	behaviour when asked for metrics for an invalid glyph code when using a	CFbsFont. 
+	An invalid glyph code is one for which there is no character equivalent, such as 
+	0.
+
+@SYMTestActions
+	i. Call CFont::GetCharacterData() for an invalid glyph code.
+	ii. Call RFbsGlyphMetricsArray::Get() for the same invalid glyph code, and either 
+		compare the metrics if i. was successful, or check an error code was returned
+	
+@SYMTestExpectedResults
+	If GetCharacterData() is successful, the metrics received from
+	RFbsGlyphMetricsArray::Get() and CFont::GetCharacterData()	are the same, otherwise
+	RFbsGlyphMetricsArray::Get() should return an error code.
+*/
+
+void CTFbsGlyphData::TestInvalidGlyphCode()
+	{
+	INFO_PRINTF1(_L("Test behaviour of RFbsGlyphMetricsArray::Get() with invalid glyph code is consistent with GetCharacterData"));
+	
+	__UHEAP_MARK;
+	TInt arrayErr = KErrNone;
+	RFbsGlyphMetricsArray glyphMetricsArray;
+	TOpenFontCharMetrics charMetrics;
+	TSize bitmapSize;
+	const TUint8* bitmapData = NULL;
+	
+	CFont::TCharacterDataAvailability availability = iFont->GetCharacterData(KDejaVuInvalidGlyphCode | KGlyphCodeFlag, charMetrics, bitmapData, bitmapSize);
+	if (availability == CFont::ENoCharacterData)
+		{
+		// Some rasterizers fail to return any data for KDejaVuInvalidGlyphCode, therefore
+		// rather than compare metrics, make sure RFbsGlyphDataIterator returns an error code.
+		WARN_PRINTF1(_L("Rasterizer failed to return data for invalid glyph code; not comparing glyph metrics"));
+		arrayErr = glyphMetricsArray.Get(*iFont, &KDejaVuInvalidGlyphCode, 1);
+		TESTE(arrayErr != KErrNone, arrayErr);
+		}
+	else
+		{
+		TESTNOERROR(arrayErr = glyphMetricsArray.Get(*iFont, &KDejaVuInvalidGlyphCode, 1));
+		if (KErrNone == arrayErr)
+			{
+			iFont->GetCharacterData(KDejaVuInvalidGlyphCode | KGlyphCodeFlag, charMetrics, bitmapData, bitmapSize);
+			TUint comparisonResult = CompareMetrics(charMetrics, glyphMetricsArray[0]);
+			TESTNOERROR( comparisonResult );
+			}
+		}
+	glyphMetricsArray.Close();
+
+	__UHEAP_MARKEND;
+	}
+
+/**
+@SYMTestCaseID		GRAPHICS-FBSERV-0626
+@SYMTestPriority	High
+@SYMTestType		UT
+@SYMTestStatus		Implemented
+@SYMPREQ			PREQ2678
+
+@SYMTestCaseDesc
+	Shows that RFbsGlyphMetricsArray::Get() returns with the correct error code when passed
+	various combinations of parameters, and preserves the state of the array.
+
+@SYMTestActions
+	Populate the array with a single metrics entry.
+	Call RFbsGlyphMetricsArray::Get with the following parameter combinations:
+		1. A negative count
+		2. A positive count and null glyph code array pointer
+		3. A zero count and non-null glyph code array pointer
+		4. A zero count and null glyph code array pointer
+
+@SYMTestExpectedResults
+	The following return codes are expected for each call:
+		1. KErrArgument
+		2. KErrArgument
+		3. KErrArgument
+		4. KErrArgument	
+	For each case the glyph metrics array remains unchanged.
+*/
+void CTFbsGlyphData::TestGlyphMetricsArrayParameters()
+	{
+	INFO_PRINTF1(_L("Test the return values of GetGlyphMetrics with different parameters"));
+	__UHEAP_MARK;
+	TInt arrayErr = KErrNone;
+	TOpenFontCharMetrics dummyMetrics;
+	
+	RFbsGlyphMetricsArray glyphMetricsArray;
+	arrayErr = glyphMetricsArray.Get(*iFont, iGlyphCodesLatin, 1);
+	TESTNOERROR(arrayErr);
+	TEST(1 == glyphMetricsArray.Count());
+	
+	// 1. Negative Count
+	arrayErr = glyphMetricsArray.Get(*iFont, iGlyphCodesLatin, -1);
+	TESTE(KErrArgument == arrayErr, arrayErr);
+	TEST(1 == glyphMetricsArray.Count());
+	
+	// 2. Positive Count and NULL Array Pointer
+	arrayErr = glyphMetricsArray.Get(*iFont, NULL, 1);
+	TESTE(KErrArgument == arrayErr, arrayErr);
+	TEST(1 == glyphMetricsArray.Count());
+
+	// 3. Zero Count & Valid Array Pointer
+	arrayErr = glyphMetricsArray.Get(*iFont, iGlyphCodesLatin, 0);
+	TESTE(KErrArgument == arrayErr, arrayErr);
+
+	// 4. Zero Count & NULL Array Pointer
+	arrayErr = glyphMetricsArray.Get(*iFont, NULL, 0);
+	TESTE(KErrArgument == arrayErr, arrayErr);
+
+	glyphMetricsArray.Close();
+	__UHEAP_MARKEND;
+	}
+
+/**
+@SYMTestCaseID		GRAPHICS-FBSERV-0627
+@SYMTestPriority	High
+@SYMTestType		UT
+@SYMTestStatus		Implemented
+@SYMPREQ			PREQ2678
+
+@SYMTestCaseDesc
+	Shows that reusing an RFbsGlyphMetricsArray works correctly.
+	In particular when the array is reused and filled with fewer entries
+	and when the array is reused and filled with more entries than previously.
+	It also shows that when re-using an array that has been populated, memory 
+	is not de-allocated if the new array of glyphs is smaller.
+
+@SYMTestActions
+	i. Call RFbsGlyphMetricsArray::Get() for a set of 10 glyph codes.
+	ii. Check that the RFbsGlyphMetricsArray has 10 entries.
+	iii. Find the size of the heap-cell allocated to the array.
+	iii. Call RFbsGlyphMetricsArray::Get() for a set of 5 glyph codes.
+	iv. Check that the RFbsGlyphMetricsArray has 5 entries.
+	v. Call RFbsGlyphMetricsArray::Get() for a set of 20 glyph codes.
+	vi. Check that the RFbsGlyphMetricsArray has 20 entries.
+	vii. Call RFbsGlyphMetricsArray::Get() for a set of 0 glyph codes.
+	viii. Check that the RFbsGlyphMetricsArray has 0 entries.
+	ix. Call RFbsGlyphMetricsArray::Get() for 1 glyph code.
+	x. Check that the RFbsGlyphMetricsArray has 1 entries.
+	xi. Close the RFbsGlyphMetricsArray.
+	xii. Check that the RFbsGlyphMetricsArray has 0 entries.
+	During the test check that the size of the heap cell allocated to the array
+	does not shrink.
+
+@SYMTestExpectedResults
+	After each call to RFbsGlyphMetricsArray::Get(), the array has the expected number of entries.
+*/
+void CTFbsGlyphData::TestGlyphMetricsArrayReuse()
+	{
+	INFO_PRINTF1(_L("Test reuse of array with RFbsGlyphMetricsArray"));
+	__UHEAP_MARK;
+	
+	RFbsGlyphMetricsArray glyphMetricsArray;
+
+	// Retrieve list of metrics for 10 glyph codes
+	TESTNOERROR(glyphMetricsArray.Get(*iFont, iGlyphCodesLatin, 10));
+	TEST(10 == glyphMetricsArray.Count());
+	
+	// Find the size of the heap cell allocated for the array.
+	TInt arrayHeapCellSize = User::Heap().AllocLen(&glyphMetricsArray[0]);
+	
+	// Retrieve list of metrics for 5 glyph codes.
+	// To ensure that different metrics are returned, use different glyph codes
+	TESTNOERROR(glyphMetricsArray.Get(*iFont, &iGlyphCodesLatin[10], 5));
+	TEST(5 == glyphMetricsArray.Count());
+	// Check that memory has not been de-allocated for a smaller array.
+	TEST(User::Heap().AllocLen(&glyphMetricsArray[0]) == arrayHeapCellSize);
+
+	// Retrieve list of metrics for 20 glyph codes.
+	// To ensure that different metrics are returned, use different glyph codes
+	TESTNOERROR(glyphMetricsArray.Get(*iFont, &iGlyphCodesLatin[15], 20));
+	TEST(20 == glyphMetricsArray.Count());
+	arrayHeapCellSize = User::Heap().AllocLen(&glyphMetricsArray[0]);
+		
+	// Retrieve list of metrics for 0 glyph codes.
+	TEST(KErrArgument == glyphMetricsArray.Get(*iFont, &iGlyphCodesLatin[35], 0));
+	// We can't check whether memory has been de-allocated as glyphMetricsArray[0]
+	// is null, therefore dereferencing it causes a panic.
+
+	// Retrieve list of metrics for 1 glyph code.
+	// To ensure that different metrics are returned, use different glyph code
+	TESTNOERROR(glyphMetricsArray.Get(*iFont, &iGlyphCodesLatin[35], 1));
+	TEST(1 == glyphMetricsArray.Count());
+	TEST(User::Heap().AllocLen(&glyphMetricsArray[0]) == arrayHeapCellSize);
+	
+	// Test that after closing a non-empty array, the array has 0 size.
+	glyphMetricsArray.Close();
+	TEST(0 == glyphMetricsArray.Count());
+	
+	__UHEAP_MARKEND;
+	}
+
+/**
+@SYMTestCaseID		GRAPHICS-FBSERV-0628
+@SYMTestPriority	High
+@SYMTestType		UT
+@SYMTestStatus		Implemented
+@SYMPREQ			PREQ2678
+
+@SYMTestCaseDesc
+	Validates the behaviour of RFbsGlyphDataIterator::Close() in the following use cases:
+		1. When called on an iterator instance which has not been opened, has no effect.
+		2. When called on an open iterator closes the iterator 
+
+@SYMTestActions
+	Use case 1:
+		i. Create an RFbsGlyphDataIterator instance but do not open.
+		ii. Call RFbsGlyphDataIterator::Close().
+		
+	Use case 2:
+		i. Create an RFbsGlyphDataIterator instance and call RFbsGlyphDataIterator::Open().
+		ii. Call RFbsGlyphDataIterator::Next() to prove the iterator is open.
+		iii. Call RFbsGlyphDataIterator::Close().
+		iv. Check that RFbsGlyphDataIterator::IsOpen() returns false.
+	
+@SYMTestExpectedResults
+	Each call to RFbsGlyphDataIterator::IsOpen() returns the expected value.
+*/
+void CTFbsGlyphData::TestGlyphDataIteratorClose()
+	{
+	INFO_PRINTF1(_L("Test closing an RFbsGlyphDataIterator"));
+	__UHEAP_MARK;
+
+	// Use case 1
+	RFbsGlyphDataIterator iter1;
+	iter1.Close();
+
+	// Use case 2
+	RFbsGlyphDataIterator iter2;
+	TESTNOERROR(iter2.Open(*iFont, iGlyphCodesLatin, 1));
+	TInt iterErr = iter2.Next();
+	TESTE(KErrNotFound == iterErr, iterErr);
+	iter2.Close();
+	
+	__UHEAP_MARKEND;
+	}
+
+/**
+@SYMTestCaseID		GRAPHICS-FBSERV-0629
+@SYMTestPriority	High
+@SYMTestType		UT
+@SYMTestStatus		Implemented
+@SYMPREQ			PREQ2678
+
+@SYMTestCaseDesc
+	Show that the sequence of iterations when calling RFbsGlyphDataIterator::Next()
+	matches the order of the array of glyph codes.
+
+@SYMTestActions
+	i. Create an RFbsGlyphDataIterator instance and call RFbsGlyphDataIterator::Open()
+		with an array of different glyph codes.
+	ii. Iterate through all the glyph data.
+		For each iteration check that the glyph code returned from 
+		RFbsGlyphDataIterator::GlyphCode() matches the corresponding glyph code
+		passed into Open().
+
+@SYMTestExpectedResults
+	Each comparison of glyph code should match.
+*/
+void CTFbsGlyphData::TestGlyphDataIteratorSequence()
+	{
+	INFO_PRINTF1(_L("Test the iterator sequence of RFbsGlyphDataIterator"));
+	__UHEAP_MARK;
+	
+	TBool matches = ETrue;
+	TInt index = 0;
+
+	RFbsGlyphDataIterator iter;
+	TInt iterErr = iter.Open(*iFont, iGlyphCodesLatin, KNumGlyphCodesLatin);
+	TESTNOERROR(iterErr);
+	for (; index < KNumGlyphCodesLatin && matches && (iterErr == KErrNone); iterErr = iter.Next(), index++)
+		{
+		if (iter.GlyphCode() != iGlyphCodesLatin[index])
+			{
+			ERR_PRINTF4(_L("Failed at iteration %d: wanted %d, got %d"), index, iGlyphCodesLatin[index], iter.GlyphCode());
+			matches = EFalse;
+			}
+		}
+	iter.Close();
+	TESTE(iterErr == KErrNotFound, iterErr);
+	TEST(matches);
+	TEST(index == KNumGlyphCodesLatin);
+	iter.Close();
+
+	__UHEAP_MARKEND;
+	}
+
+/**
+@SYMTestCaseID		GRAPHICS-FBSERV-0632
+@SYMTestPriority	High
+@SYMTestType		UT
+@SYMTestStatus		Implemented
+@SYMPREQ			PREQ2678
+
+@SYMTestCaseDesc
+	Ensure it is possible to reuse a closed iterator on another CFbsFont.
+	
+@SYMTestActions
+	i. Open an RFbsGlyphDataIterator with sample data.
+	ii. Iterate through until the end of the iterator has been reached by calling 
+		Next() on the final element.
+	iii. Re-open the same RFbsGlyphDataIterator with sample data on a different CFbsFont.
+	iv. Iterate through a second time until the end has been reached by calling Next()
+		on the final element.
+	v. Close the iterator.
+	vi. During both iterations the bitmap data returned and metrics are compared with
+		the equivalent from GetCharacterData().
+
+@SYMTestExpectedResults
+	The iterator should be opened successfully for both fonts and the data returned
+	should match the data from GetCharacterData().
+*/
+void CTFbsGlyphData::TestGlyphDataIteratorMultipleUsesOnMultipleFonts()
+	{
+	INFO_PRINTF1(_L("Reuse a closed iterator on a second CFbsFont"));
+	__UHEAP_MARK;
+	
+	const TUint8* bitmapData;
+	TSize bitmapSize;
+	TOpenFontCharMetrics charMetrics;
+	RFbsGlyphDataIterator iter;
+	
+	// Array of fonts to iterate through.
+	CFbsFont* font[2] = {iFont, iFont2};
+	
+	for (TInt fontId = 0; fontId < 2; fontId++)
+		{
+		// On the first iteration, open and use a font until all glyphs have been iterated through.
+		// On second iteration, use the same iterator on a different font and repeat.
+        CFbsFont* currentFont = font[fontId];
+
+		//Open the iterator on the first font and compare the returned bitmaps against GetCharacterData
+		TInt iterErr = iter.Open(*currentFont, iGlyphCodesLatin, KNumGlyphCodesLatin);
+		TESTNOERROR(iterErr);
+		TFontSpec fontSpec = currentFont->FontSpecInTwips();
+		
+		TInt index = 0;
+		for (; (iterErr == KErrNone) && (index < KNumGlyphCodesLatin); iterErr = iter.Next(), ++index)
+			{
+			currentFont->GetCharacterData(iGlyphCodesLatin[index] | KGlyphCodeFlag, charMetrics, bitmapData, bitmapSize);
+			
+			TESTNOERROR(CompareMetrics(charMetrics, iter.Metrics()));
+			if (bitmapSize == TSize(0, 0))
+				{
+				TEST(bitmapSize == iter.Rect().Size());
+				}
+			else
+				{
+				// Compare images.
+				TBool match = EFalse;
+				RSgImage characterDataImage;
+				TInt err = CreateSgImageFromCharacterData(bitmapData, bitmapSize, fontSpec.iFontStyle.BitmapType(), characterDataImage);
+				if (err == KErrNone)
+					{
+					err = CompareSgImages(iEGL, iter.Image(), iter.Rect(), characterDataImage, TRect(bitmapSize), match);
+					}
+				characterDataImage.Close();
+				if (err != KErrNone)
+					{
+					TESTNOERROR(err);
+					break;
+					}
+				TEST(match);
+				}		
+			}
+		iter.Close();
+		TESTE(iterErr == KErrNotFound, iterErr);
+		TEST(index == KNumGlyphCodesLatin);
+		}
+	
+	__UHEAP_MARKEND;
+	}
+
+/**
+@SYMTestCaseID		GRAPHICS-FBSERV-0633
+@SYMTestPriority	High
+@SYMTestType		UT
+@SYMTestStatus		Implemented
+@SYMPREQ			PREQ2678
+
+@SYMTestCaseDesc
+	Check that for various Latin fonts, the images of the glyphs stored on the 
+	RSgImage matches those provided by GetCharacterData().
+
+@SYMTestActions
+	Create a selection of fonts, using various typefaces, sizes and bitmap types.
+	For each font:
+	i. Open the RFbsGlyphDataIterator and iterate each glyph.
+	ii. For each glyph, call GetCharacterData() with the expected glyph code.
+	iii. Convert the character data to an RSgImage.
+	iv. Perform a comparison between the character RSgImage and the iterator 
+		image. 
+	v. After all iterations, close the iterator and check all expected glyphs
+		were iterated through.
+
+@SYMTestExpectedResults
+	All glyph images should match.
+*/
+void CTFbsGlyphData::TestGlyphDataIteratorImageValidity()
+	{
+	INFO_PRINTF1(_L("Test the glyph images of the iterator match GetCharacterData()"));
+	__UHEAP_MARK;
+	
+	const TInt KNumFonts = 20;
+	
+	// Create a new typeface store for this test so that heap checking will not
+	// be affected by cached CFbsFonts.
+	CFbsTypefaceStore* typefaceStore = NULL;
+	TRAPD(err, typefaceStore = CFbsTypefaceStore::NewL(NULL));
+	if (err != KErrNone)
+		{
+		ERR_PRINTF1(_L("Failed to construct typeface store. Test aborted."));
+		__UHEAP_RESET;
+		iStep->SetTestStepResult(EFail);
+		return;
+		}
+	
+	for (TInt font = 0; font < KNumFonts; ++font)
+		{
+		// Use either a pre-created bitmap-font TFontSpec, or generate a Deja-vu one.
+		TFontSpec fontSpec = GenerateDejaVuFontSpec(font);
+		CFbsFont* latinFont = NULL;
+		TESTNOERROR(typefaceStore->GetNearestFontToDesignHeightInPixels((CFont*&)latinFont, fontSpec));	
+		
+		fontSpec = latinFont->FontSpecInTwips();
+		InfoPrintFontSpec(*latinFont);
+				
+		RFbsGlyphDataIterator iter;
+		TInt iterErr = iter.Open(*latinFont, iGlyphCodesLatin, KNumGlyphCodesLatin);
+		TESTNOERROR(iterErr);
+
+		err = KErrNone;
+		TInt index = 0;
+		TInt numMismatches = 0;
+		// For each iteration, get the character data of the expected glyph.
+		// Create RSgImage from character data, and compare iter image with constructed image.
+		for (; (iterErr == KErrNone) && (err == KErrNone) && (index < KNumGlyphCodesLatin); (iterErr = iter.Next()), ++index)
+			{
+			TBool glyphMatches = ETrue;
+			const RSgImage& iteratorImage = iter.Image();
+
+			const TUint8* bitmapData = NULL;
+			TSize bitmapSize;
+			TOpenFontCharMetrics metrics;
+			TInt characterDataAvailability = latinFont->GetCharacterData(iGlyphCodesLatin[index] | KGlyphCodeFlag, metrics, bitmapData, bitmapSize);
+			if (bitmapSize == TSize(0, 0))
+				{
+				glyphMatches = (bitmapSize == iter.Rect().Size());
+				}
+			else
+				{
+				RSgImage characterDataImage;
+				TESTNOERROR(CreateSgImageFromCharacterData(bitmapData, bitmapSize, fontSpec.iFontStyle.BitmapType(), characterDataImage));
+				err = CompareSgImages(iEGL, iteratorImage, iter.Rect(), characterDataImage, TRect(bitmapSize), glyphMatches);
+				characterDataImage.Close();
+				}
+			if (err == KErrNone && !glyphMatches)
+				{
+				ERR_PRINTF2(_L("Glyphcode %i : Image mismatch"), iGlyphCodesLatin[index]);
+				++numMismatches;
+				}
+			}
+		iter.Close();
+		TESTNOERROR(err);
+		TESTE(iterErr == KErrNotFound, iterErr);
+		TEST(index == KNumGlyphCodesLatin);	
+		TEST(numMismatches == 0);
+		typefaceStore->ReleaseFont(latinFont);
+		}
+	delete typefaceStore;
+	__UHEAP_MARKEND;
+	}
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0634
+@SYMTestPriority    High
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+	To ensure that if the glyph image iterator has a current invalid 
+	character code, the SgImage returned by the iterator will match 
+	to the image obtained from the GetCharacterData() function
+@SYMTestActions
+	i. Retrieve bitmap data and metrics by using GetCharacterData().
+	ii. Open a glyph data iterator passing an invalid character code.
+	iii. If i. was unsuccessful, check that opening the iterator returned
+		an error code and skip to ix.
+	iv. Create SgImage from bitmap data.
+	v. Get SgImage from the glyph data iterator.
+	vi. Compare SgImages obtained on iv and v steps.
+	vii. Get font metrics from the glyph data iterator.
+	viii. Compare metrics obtained on i and vii steps.
+	vii. Close the iterator.
+
+@SYMTestExpectedResults
+	If the request to get the character data failed, the return value of 
+	RFbsGlyphDataIterator::Open() must not be KErrNone.
+	Otherwise, images obtained from the iterator and GetCharacterData() should
+	match.
+*/
+void CTFbsGlyphData::TestGlyphDataIteratorOpenInvalidCode()
+	{
+	INFO_PRINTF1(_L("Ensure that the image returned by the iterator will \
+match to the image obtained from GetCharacterData() if character code is invalid"));
+	__UHEAP_MARK;
+
+	const TUint8* bitmapData = NULL;
+	TSize bitmapSize;
+	TOpenFontCharMetrics metrics;
+	const TFontSpec fontSpec = iFont->FontSpecInTwips();
+	CFont::TCharacterDataAvailability availability = iFont->GetCharacterData(KDejaVuInvalidGlyphCode | KGlyphCodeFlag, metrics, bitmapData, bitmapSize);
+
+	RFbsGlyphDataIterator iter;
+	TInt err = iter.Open(*iFont, &KDejaVuInvalidGlyphCode, 1);
+	if (availability == CFont::ENoCharacterData)
+		{
+		// Some rasterizers fail to return any data for KDejaVuInvalidGlyphCode, therefore
+		// rather than compare image contents, make sure RFbsGlyphDataIterator returns an error code.
+		WARN_PRINTF1(_L("Rasterizer failed to return data for invalid glyph code; not comparing image contents"));
+		TESTE(err != KErrNone, err);
+		}
+	else
+		{
+		TESTNOERROR(err);
+		if (err == KErrNone)
+			{
+			TBool glyphMatches = EFalse;
+			if (bitmapSize == TSize(0, 0))
+				{
+				glyphMatches = (bitmapSize == iter.Rect().Size());
+				}
+			else
+				{
+				RSgImage characterDataImage;
+				TESTNOERROR(CreateSgImageFromCharacterData(bitmapData, bitmapSize, fontSpec.iFontStyle.BitmapType(), characterDataImage));
+				TESTNOERROR(CompareSgImages(iEGL, iter.Image(), iter.Rect(), characterDataImage, TRect(bitmapSize), glyphMatches));
+				characterDataImage.Close();
+				}
+			TESTNOERROR(CompareMetrics(metrics, iter.Metrics()));
+			TEST(glyphMatches);
+			}
+		}
+	iter.Close();
+
+	__UHEAP_MARKEND;
+	}
+
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0636
+@SYMTestPriority    High
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+	To ensure that opening the glyph data iterator which has already been opened with the same font
+	has no effect on the state of the iterator.
+@SYMTestActions
+	i. Open glyph data iterator on 2 glyph codes.
+	ii. Try to open the glyph data iterator again on the same font.
+	iii. Call RFbsGlyphDataIterator::Next() on the iterator and check error code, making the last
+		glyph code the current iteration.
+	iv. Call RFbsGlyphDataIterator::Next() again.
+@SYMTestExpectedResults
+	The second attempt to open the glyph data iterator will result an error with code KErrInUse.
+	The last two calls to RFbsGlyphDataIterator::Next() should return KErrNone and KErrNotFound
+	respectively, showing the iterator was not modified when the call to Open() failed.
+*/
+void CTFbsGlyphData::TestGlyphDataIteratorOpenTwice()
+	{
+	INFO_PRINTF1(_L("Ensure that opening the glyph data iterator which has already been opened with the same font has no effect"));
+	__UHEAP_MARK;
+
+	RFbsGlyphDataIterator iter;
+	TInt iterErr = iter.Open(*iFont, iGlyphCodesLatin, 2);
+	TESTNOERROR(iterErr);
+	
+	iterErr = iter.Open(*iFont, iGlyphCodesLatin, KNumGlyphCodesLatin);
+	TESTE(iterErr == KErrInUse, iterErr);
+	iterErr = iter.Next();
+	TESTNOERROR(iterErr);
+	iterErr = iter.Next();
+	TESTE(iterErr == KErrNotFound, iterErr);
+	iter.Close();
+
+	__UHEAP_MARKEND;
+	}
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0637
+@SYMTestPriority    High
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+	To ensure that opening the glyph data iterator which has already been opened with different font
+	has no effect on the state of the iterator.
+@SYMTestActions
+	i. Open glyph data iterator on an 2 glyph codes
+	ii. Try to open the glyph data iterator again with a different font.
+	iii. Call RFbsGlyphDataIterator::Next() on the iterator and check error code, making the last
+		glyph code the current iteration.
+	iv. Call RFbsGlyphDataIterator::Next() again.
+@SYMTestExpectedResults
+	The second attempt to open the glyph data iterator will result an error with code KErrInUse.
+	The Next() call after this should return KErrNone, signifying the iterator is still open.
+	The last Next() call should return KErrNotFound, signifying the iterator has iterated 
+	through the two original glyph codes.
+*/
+void CTFbsGlyphData::TestGlyphDataIteratorOpenTwiceWithDifferentFonts()
+	{
+	INFO_PRINTF1(_L("Ensure that opening the glyph data iterator which has already been opened with different font has no effect"));
+	__UHEAP_MARK;
+
+	RFbsGlyphDataIterator iter;
+	TInt iterErr = iter.Open(*iFont, iGlyphCodesLatin, 2);
+	TESTNOERROR(iterErr);
+
+	iterErr = iter.Open(*iFont2, iGlyphCodesLatin, 2);
+	TESTE(iterErr == KErrInUse, iterErr);
+	iterErr = iter.Next();
+	TESTNOERROR(iterErr);
+	iterErr = iter.Next();
+	TESTE(iterErr == KErrNotFound, iterErr);
+	iter.Close();
+
+	__UHEAP_MARKEND;
+	}
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0638
+@SYMTestPriority    High
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+	To ensure that opening of glyph data iterator with the font greater than 
+	2048 by 2048 will not be supported 
+@SYMTestActions
+	i. Create font with the height greater than 2048
+	ii. Try to open the glyph data iterator with the font created on previous step
+	iii Release the font
+@SYMTestExpectedResults
+	Must fail with error code KErrTooBig
+*/
+void CTFbsGlyphData::TestGlyphDataIteratorOpenTooBigFont()
+	{
+	INFO_PRINTF1(_L("To ensure that opening of glyph data iterator with the font greater than 2048X2048 will not be supported"));
+	__UHEAP_MARK;
+
+	CFbsFont* bigFont;
+	const TInt maxHeight = 2048;
+	const TInt maxHeightLimit = maxHeight + 20; //max size after we stop trying to create the font
+	// the loop below will guarantee that if the font with the size greater than 2048 is available it will be created
+	for(TInt height = maxHeight + 1; height < maxHeightLimit; height++)
+		{
+		TESTNOERROR(iTs->GetNearestFontToDesignHeightInPixels((CFont*&)bigFont, TFontSpec(KTypefaceName, height)));
+		TInt realHeight = bigFont->FontMaxHeight();
+		if(realHeight > maxHeight)
+			{
+			break;
+			}
+		iTs->ReleaseFont(bigFont);
+		bigFont = NULL;
+		}
+
+	if (bigFont)
+		{
+		RFbsGlyphDataIterator iter;
+		TInt iterErr = iter.Open(*bigFont, iGlyphCodesLatin, KNumGlyphCodesLatin);
+		TESTE(iterErr == KErrTooBig, iterErr);
+		iTs->ReleaseFont(bigFont); 
+		}
+	else
+		{
+		//It is legitimate to fail to create the font, as there are no requirements for the rasterizer here to support such big font. 
+		//In this case we will skip the test.
+		WARN_PRINTF1(_L("Failed to create font with height greater than 2048"));
+		}
+
+	__UHEAP_MARKEND;
+	}
+
+
+
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0640
+@SYMTestPriority    High
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+	To ensure that the glyph data iterator processes wrong arguments correctly
+@SYMTestActions
+	i. Try to open the glyph data iterator with the negative count passed in
+	ii. Try to open the glyph data iterator with the positive count and NULL 
+	glyph code array pointer passed in
+	iii. Try to open the glyph data iterator with a valid glyph code array and 
+	count equal to zero
+@SYMTestExpectedResults
+	At all steps the returned value is set to KErrArgument.
+*/
+void CTFbsGlyphData::TestGlyphDataIteratorOpenWithWrongArgument()
+	{
+	INFO_PRINTF1(_L("To ensure that the glyph data iterator processes wrong arguments correctly"));
+	__UHEAP_MARK;
+
+	RFbsGlyphDataIterator iter;
+	TInt iterErr = iter.Open(*iFont, iGlyphCodesLatin, -1);
+	TESTE(iterErr == KErrArgument, iterErr);
+	
+	iterErr = iter.Open(*iFont, NULL, 1);
+	TESTE(iterErr == KErrArgument, iterErr);
+	
+	iterErr = iter.Open(*iFont, iGlyphCodesLatin, 0);
+	TESTE(iterErr == KErrArgument, iterErr);
+	
+	__UHEAP_MARKEND;
+	}
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0641
+@SYMTestPriority    High
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+	To ensure that all allocated RSgImages were released after the
+	glyph data iterator has been opened and closed multiple times.
+
+@SYMTestActions
+	i. Retrieve MSgDriver_Test interface from the SgDriver
+	ii. Mark alloc start and obtain resorce count from the interface
+	iii. Iterate through glyph data by calling RFbsGlyphDataIterator::Next() 
+	iv. Retrieve SgImage from the glyph data iterator instance
+	v. Repeate steps iii and iv multiple times
+	vi. Release font
+	vii.  Mark alloc end and obtain resorce count from the interface
+
+@SYMTestExpectedResults
+	Resorce count at the end matches resorce count at the beginning. 
+*/
+void CTFbsGlyphData::TestGlyphDataIteratorImageMemoryLeak()
+	{
+	__UHEAP_MARK;
+	
+	MSgDriver_Test* sgDriverTestInterface = NULL; 
+	TInt err = iSgDriver.GetInterface(sgDriverTestInterface);
+	if(err != KErrNone)
+		{
+		__UHEAP_MARKEND;
+		WARN_PRINTF2(_L("Failed to obtain MSgDriver_Test interface with error code: %d, the test will be skipped"), err);
+		return;
+		}
+
+	TEST(sgDriverTestInterface != NULL);
+	sgDriverTestInterface->AllocMarkStart();
+
+	MSgDriver_Profiling* sgDriverProfilInterface = NULL;
+	err = iSgDriver.GetInterface(sgDriverProfilInterface);
+	if(err != KErrNone)
+		{
+		sgDriverTestInterface->AllocMarkEnd(0);
+		__UHEAP_MARKEND;
+		WARN_PRINTF2(_L("Failed to obtain MSgDriver_Profiling interface with error code: %d, the test will be skipped"), err);
+		return;
+		}
+	const TInt resCount = sgDriverProfilInterface->LocalResourceCount();
+
+	CFbsFont* font = NULL;
+	err = iTs->GetNearestFontToDesignHeightInPixels((CFont*&)font, TFontSpec(KTypefaceName, 15));
+	TESTNOERROR(err);
+	if(err != KErrNone)
+		{
+		__UHEAP_MARKEND;
+		return;
+		}
+
+	for (TInt ii = 0; ii < 10; ii++)
+		{
+		TInt index = 0;
+		RFbsGlyphDataIterator iter;
+		TInt iterErr = iter.Open(*font, iGlyphCodesLatin, KNumGlyphCodesLatin);
+		TESTNOERROR(iterErr);
+		for (; (iterErr == KErrNone) && (index < KNumGlyphCodesLatin); iterErr = iter.Next(), ++index)
+			{
+			const RSgImage& image = iter.Image();
+			}
+		iter.Close();
+		TEST(index == KNumGlyphCodesLatin);
+		TESTE(iterErr == KErrNotFound, iterErr);
+		}
+	iTs->ReleaseFont(font);
+	const TInt resCountEnd = sgDriverProfilInterface->LocalResourceCount();
+	TEST(resCountEnd == resCount);
+	sgDriverTestInterface->AllocMarkEnd(0);
+
+	__UHEAP_MARKEND;
+	}
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0659
+@SYMTestPriority    Med
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+	Uses the RFbsGlyphDataIterator to render a large amount of unique glyphs, at a very large 
+	size, to ensure that if graphics memory runs out while the iterator is in use, eviction 
+	takes place and does not corrupt the glyph images in any way.
+
+@SYMTestActions
+	i. Create a large CFbsFont from the typeface store (size 100+)
+	ii. Simulate a low graphics-memory situation by creating enough RSgImages to fill the memory,
+		releasing one image in order to allow some small amount for the test.
+	iii. Open a RFbsGlyphDataIterator on the font, using a large array of unique glyph codes.
+	iv. Iterate through the glyphs, comparing each returned SgImage against the system-memory
+		representation of the glyph as returned by CFont::GetCharacterData().
+	v. Check for errors and mismatches, and release all images created by ii.
+	
+@SYMTestExpectedResults
+	At each iteration, each glyph should match in size and contents. 
+*/
+void CTFbsGlyphData::TestGlyphDataIteratorLargeFontStress()
+	{
+	INFO_PRINTF1(_L("Stress test using a RFbsGlyphDataIterator with a large font"));
+#ifdef __WINS__
+	// Cannot run test on emulator reliably - this is because on emulator
+	// system-memory is used for RSgImages, so using up RSgImage memory may 
+	// cause heap-allocation failures unrelated to the area being tested. 
+	// This test is specifically testing the behaviour when running out of
+	// RSgImage-based memory (i.e. graphics memory), but on emulator this 
+	// will cause a failed allocation anywhere.
+	INFO_PRINTF1(_L("Skipping test on emulator..."));
+#else
+	WARN_PRINTF1(_L("---Stress test TO BE REVISITED due to Broadcom defect ESLM-85LDV7 - TB10.1 Closing of RSgImage with duplicate handle used in same thread does not release GPU RAM"));
+	TEST(EFalse);
+/*	__UHEAP_MARK;
+
+	const TInt KFontSize = 128;
+
+	CFbsFont* font;
+	TInt err = iTs->GetNearestFontToDesignHeightInPixels((CFont*&)font, TFontSpec(KMonoTypefaceName, KFontSize));
+	TESTNOERROR(err);
+	// Output the actual fontspec used in the test.
+	InfoPrintFontSpec(*font);
+	
+	// Create 2 buffers for use in comparing SgImages so that we don't run out 
+	// of system memory through allocating memory in the test
+	TInt maxFontWidth = font->MaxCharWidthInPixels();
+	TInt maxFontHeight = font->HeightInPixels();
+	iTempBuf1 = (TUint8*) User::AllocZ(maxFontWidth * maxFontHeight);
+	iTempBuf2 = (TUint8*) User::AllocZ(maxFontWidth * maxFontHeight);
+
+	// In order for the image comparisons to have enough memory to perform, keep 
+	// one large RSgImage which is created before the rest of the graphics memory 
+	// is filled.  This image can then be closed before doing the image comparison 
+	// and recreated after the image comparison to ensure that the graphics 
+	// memory is full.  Without this image, the image comparison could fail with 
+	// out of memory and the test would fail. 
+	RSgImage tempImage;
+	TESTNOERROR(tempImage.Create(TSgImageInfo(TSize(1000, 1000), ESgPixelFormatA_8, ESgUsageBitOpenVgImage)));
+
+	TFontSpec actualFontSpec;
+	actualFontSpec = font->FontSpecInTwips();
+	
+	// Create RSgImages from character data independently from using iterator.
+	// These will be used for comparing with RSgImages retrieved from iterator.
+	RArray <RSgImage> sgImageFromCharDataArray;
+	TInt index = 0;
+	for(; (index < KNumGlyphCodesLatin) && (err == KErrNone); ++index)
+		{
+		RSgImage characterDataSgImage;
+		TInt err = KErrNone;
+		const TUint8* bitmapData = NULL;
+		TSize bitmapSize;
+		TOpenFontCharMetrics metrics;
+		font->GetCharacterData(iGlyphCodesLatin[index] | KGlyphCodeFlag, metrics, bitmapData, bitmapSize);
+
+		if (bitmapSize != TSize(0, 0))
+			{
+			err = CreateSgImageFromCharacterData(bitmapData, bitmapSize, actualFontSpec.iFontStyle.BitmapType(), characterDataSgImage, iTempBuf1, iTempBuf2);
+			}
+		if (KErrNone == err)
+			{
+			err = sgImageFromCharDataArray.Append(characterDataSgImage);
+			}
+		}
+	TESTNOERROR(err);
+	TEST(index == KNumGlyphCodesLatin);
+
+	// Simulate low OOGM situation by creating many RSgImages until out of memory.
+	RArray <RSgImage> sgImageArray;
+	if (err == KErrNone)
+		{
+		TESTNOERROR(NearlyFillGraphicsMemoryWithImages(TSize(256, 256), sgImageArray));
+		}
+	
+	// Open Iterator on long string of data...
+	RFbsGlyphDataIterator iter;
+	TInt iterErr = KErrNone;
+	if (err == KErrNone)
+		{
+		iterErr = iter.Open(*font, iGlyphCodesLatin, KNumGlyphCodesLatin);
+		TESTNOERROR(iterErr);
+		}
+
+	// For each glyph, compare it to the system-memory version from GetCharacterData().
+	TInt numMismatches = 0;
+	for(index = 0; (iterErr == KErrNone) && (index < sgImageFromCharDataArray.Count()) && (err == KErrNone); iterErr = iter.Next(), ++index)
+		{
+		const TUint8* bitmapData = NULL;
+		TSize bitmapSize;
+		TOpenFontCharMetrics metrics;
+		font->GetCharacterData(iter.GlyphCode() | KGlyphCodeFlag, metrics, bitmapData, bitmapSize);
+
+		if (iter.Rect().Size() == TSize(0, 0))
+			{
+			numMismatches += (bitmapSize != TSize(0, 0)) ? 1 : 0;
+			}
+		else
+			{
+			// Free up memory so that the image compariso succeeds
+			// Release all the images used to simulate OOGM.
+			for (TInt i = sgImageArray.Count() - 1; i >= 0; --i)
+				{
+				sgImageArray[i].Close();
+				sgImageArray.Remove(i);
+				}
+			
+			TBool match = ETrue;
+			err = CompareSgImages(iEGL, sgImageFromCharDataArray[index], TRect(bitmapSize), iTempBuf1, iter.Image(), iter.Rect(), iTempBuf2, match);
+			if (err == KErrNone && !match)
+				{
+				++numMismatches;
+				}
+			TInt result = FillGraphicsMemoryWithImages(TSize(256, 256), sgImageArray);
+			TESTE(result == KErrNoMemory || result == KErrNoGraphicsMemory, result);
+			}
+		}
+	iter.Close();
+
+	// Release all images created from character data.
+	for (TInt i = sgImageFromCharDataArray.Count()-1; i >= 0; --i)
+		{
+		sgImageFromCharDataArray[i].Close();
+		}
+	sgImageFromCharDataArray.Close();
+
+	// Release all the images used to simulate OOGM.
+	for (TInt i = sgImageArray.Count() - 1; i >= 0; --i)
+		{
+		sgImageArray[i].Close();
+		}
+	sgImageArray.Close();
+	tempImage.Close();
+	iTs->ReleaseFont(font);
+	User::Free(iTempBuf1);
+	User::Free(iTempBuf2);
+	iTempBuf1 = NULL;
+	iTempBuf2 = NULL;
+
+	// Log any errors only after memory is freed - this ensures there is enough
+	// memory for the logger.
+	TESTNOERROR(err);
+	TESTE(iterErr == KErrNotFound, iterErr);
+	TEST(index == KNumGlyphCodesLatin);
+	TEST(numMismatches == 0);
+
+	__UHEAP_MARKEND;*/
+#endif
+	}
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0660
+@SYMTestPriority    Med
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+	Opens an RFbsGlyphDataIterator on many different fonts of different sizes and typefaces
+	and uses many fonts, in order to test that the iterator can cope with being used on many
+	fonts with many glyphs.
+
+@SYMTestActions
+	i. Perform test of 100 iterations, where:
+		1. A new Latin font is created every iteration in order to force the Typeface Store
+			to create a brand-new server-side font at each iteration. 
+		2. For this font, open an RFbsGlyphDataIterator and cycle through all Latin glyphs.
+		3. For each glyph, compare against the glyph image returned by CFont::GetCharacterData().
+		4. Keep a record of the number of mismatches, and carry on to next font.
+	ii. Perform i. again, but using the existing fonts.
+	iii. Check that there are no mismatches, all glyphs and fonts were successfully checked, 
+		and no error codes returned during the test.
+	iv. Clean up all resources.
+	
+@SYMTestExpectedResults
+	The glyphs provided by the iterator should match that returned by GetCharacterData()
+	for every font and every iteration. 
+*/
+void CTFbsGlyphData::TestGlyphDataIteratorManyFontsStressL()
+	{
+	INFO_PRINTF1(_L("Stress test using a RFbsGlyphDataIterator with hundreds of fonts"));
+	WARN_PRINTF1(_L("---Stress test TO BE REVISITED due to Broadcom defect ESLM-85LDV7 - TB10.1 Closing of RSgImage with duplicate handle used in same thread does not release GPU RAM"));
+	TEST(EFalse);
+	/*__UHEAP_MARK;
+
+	const TInt KNumFonts = 100;
+	const TInt KNumRepeatsPerFont = 2;
+	TInt err = KErrNone;
+	TInt numGlyphMismatches = 0;
+
+	CFbsFont** font = new (ELeave) CFbsFont*[KNumFonts];
+	Mem::FillZ(font, sizeof(CFbsFont*) * KNumFonts);
+
+	// Do the whole thing KNumRepeatsPerFont times. The second+ repeats will 
+	// re-use the fonts created in the first repeat, to ensure that fonts that 
+	// may have been evicted are able to be re-used with the iterator.
+	for (TInt rep = 0; (rep < KNumRepeatsPerFont) && (err == KErrNone); ++rep)
+		{
+		// Iterate through all the font variants:
+		// Iterate all font styles, for all latin typefaces, at increasing sizes.
+		TInt i = 0;
+		for (; (i < KNumFonts) && (err == KErrNone); ++i)
+			{
+			// Only create this font if this font isn't already valid (i.e. when this is the 
+			// first rep) otherwise re-use it.
+			if (!font[i])
+				{
+				TFontSpec requestedFontSpec = GenerateDejaVuFontSpec(i);
+				err = iTs->GetNearestFontToDesignHeightInPixels((CFont*&)font[i], requestedFontSpec);
+				}
+			if (err == KErrNone)
+				{
+				RFbsGlyphDataIterator iter;
+				TInt iterErr = iter.Open(*(font[i]), iGlyphCodesLatin, KNumGlyphCodesLatin);
+				if (iterErr != KErrNone)
+					{
+					ERR_PRINTF2(_L("Failed to open RFbsGlyphDataIterator [err=%d]"), iterErr);
+					InfoPrintFontSpec(*(font[i]));
+					iStep->SetTestStepResult(EFail);
+					}
+				else
+					{
+					TInt index = 0;
+					for(; (iterErr == KErrNone) && (index < KNumGlyphCodesLatin) && (err == KErrNone) ; iterErr = iter.Next(), index++)
+						{
+						const TUint8* bitmapData = NULL;
+						TSize bitmapSize;
+						TOpenFontCharMetrics metrics;
+						font[i]->GetCharacterData(iter.GlyphCode() | KGlyphCodeFlag, metrics, bitmapData, bitmapSize);
+						if (iter.Rect().Size() == TSize(0, 0))
+							{
+							numGlyphMismatches += (bitmapSize != TSize(0, 0)) ? 1 : 0;
+							}
+						else
+							{
+							TBool match = EFalse;
+							const TFontSpec fontSpec = font[i]->FontSpecInTwips();							
+							// Compare to system-memory version of glyph
+							RSgImage characterDataImage;
+							err = CreateSgImageFromCharacterData(bitmapData, bitmapSize, fontSpec.iFontStyle.BitmapType(), characterDataImage);
+							if (err == KErrNone) 
+								{
+								err = CompareSgImages(iEGL, iter.Image(), iter.Rect(), characterDataImage, TRect(bitmapSize), match);
+								}
+							if (err == KErrNone && !match)
+								{
+								++numGlyphMismatches;
+								}
+							characterDataImage.Close();
+							}					
+						}
+					iter.Close();
+					TESTE(iterErr == KErrNotFound, iterErr);
+					TEST(index == KNumGlyphCodesLatin);					
+					}
+				}
+			}
+		// Check all the fonts were iterated through.
+		TEST(i == KNumFonts);
+		}
+	TESTNOERROR(err);
+	TEST(numGlyphMismatches == 0);
+
+	// Cleanup
+	for (TInt ii = 0; ii < KNumFonts; ii++)
+		{
+		iTs->ReleaseFont(font[ii]);
+		}
+	delete [] font;
+	__UHEAP_MARKEND;*/
+	}
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0662
+@SYMTestPriority    Low
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+	Uses a RFbsGlyphDataIterator when there is no graphics memory available in the system.
+	It shows that when under low graphics memory, Next() returns the correct error code
+	as per the API (either KErrNoMemory or KErrNoGraphicsMemory, depending on the implementation 
+	of Graphics Resource being used).
+
+@SYMTestActions
+	i. Create a CFbsFont from the typeface store.
+	ii. Simulate a low graphics-memory situation by creating enough RSgImages to fill the memory,
+	iii. Open a RFbsGlyphDataIterator on the font.
+	iv. Attempt to use the iterator, calling Next(), checking the returned code.
+	v. Close the iterator and release all graphics memory from ii.
+
+@SYMTestExpectedResults
+	Next() should return either KErrNoMemory or KErrNoGraphicsMemory depending on the implmentation
+	of Graphics Resource used. It should return the same error as is returned when filling
+	the graphics memory reaches the limit.
+*/
+void CTFbsGlyphData::TestGlyphDataIteratorNoGraphicsMemory()
+	{
+	INFO_PRINTF1(_L("Test that when there is no GPU memory available, Next() returns correct error"));
+	WARN_PRINTF1(_L("---Stress test TO BE REVISITED due to Broadcom defect ESLM-85LDV7 - TB10.1 Closing of RSgImage with duplicate handle used in same thread does not release GPU RAM"));
+	TEST(EFalse);
+	/*__UHEAP_MARK;
+	
+	const TInt KFontSize = 128;
+	CFbsFont* font = NULL;
+	RFbsGlyphDataIterator iter;
+	
+	TInt err = iTs->GetNearestFontToDesignHeightInPixels((CFont*&)font, TFontSpec(KMonoTypefaceName, KFontSize));
+	TESTNOERROR(err);
+	
+	// Simulate low OOGM situation by creating many RSgImages until out of memory.
+	if (err == KErrNone)
+		{
+		InfoPrintFontSpec(*font);
+		RArray <RSgImage> sgImageArray;
+		TInt iterErr = KErrNone;
+		TInt gfxMemErr = FillGraphicsMemoryWithImages(TSize(KFontSize, KFontSize), sgImageArray);
+		TESTE(gfxMemErr == KErrNoMemory || gfxMemErr == KErrNoGraphicsMemory, gfxMemErr);
+		if (gfxMemErr == KErrNoMemory || gfxMemErr == KErrNoGraphicsMemory)
+			{
+			// Next() could either fail with KErrNoMemory or KErrNoGraphicsMemory, but should
+			// be the same error code as the last attempted creation of an SgImage, done in 
+			// FillGraphicsMemoryWithImages() so compare against that code.
+			iterErr = iter.Open(*font, iGlyphCodesLatin, KNumGlyphCodesLatin);
+			for (; iterErr == KErrNone; iterErr = iter.Next())
+				{
+				// no operation
+				}
+			iter.Close();
+			}
+	
+		// Release all the images used to simulate OOGM.
+		for (TInt i = sgImageArray.Count() - 1; i >= 0; --i)
+			{
+			sgImageArray[i].Close();
+			}
+		sgImageArray.Close();
+		
+		// Log any errors only after memory is freed - this ensures there is enough
+		// memory for the logger.
+		TESTE(iterErr == gfxMemErr, iterErr);
+		}
+
+	iTs->ReleaseFont(font);
+	
+	__UHEAP_MARKEND;*/
+	}
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0666
+@SYMTestPriority    Low
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+	Uses a RFbsGlyphDataIterator after Next() returns an error, in order to show that 
+	an error does not invalidate the state of the iterator and it is still usable. 
+
+@SYMTestActions
+	i. Open the RFbsGlyphDataIterator on 1 glyph code.
+	ii. Store the data of the iterator and call Next() to reach the end of the iterator
+	iii. Access the glyph data repeatedly and check that the iterator members
+		 still match those in ii.
+
+@SYMTestExpectedResults
+	The calls to Next() should cause KErrNotFound since it is past the final glyph.
+	The iterator data should match at all times since the iterator is never moved.
+*/
+void CTFbsGlyphData::TestGlyphDataIteratorNextIsAtomic()
+	{
+	INFO_PRINTF1(_L("To ensure that Next() is atomic, if it returns an error it is still useable"));
+	__UHEAP_MARK;
+
+	RFbsGlyphDataIterator iter;
+	TInt iterErr = iter.Open(*iFont, iGlyphCodesLatin, 1);
+	TESTNOERROR(iterErr);
+	
+	TSgDrawableId id = iter.Image().Id();
+	TOpenFontCharMetrics metrics = iter.Metrics();
+	TUint glyphCode = iter.GlyphCode();
+	TRect rect = iter.Rect();
+	
+	for (TInt i = 0; i < 2; i++)
+		{
+		iterErr = iter.Next();
+		TESTE(iterErr == KErrNotFound, iterErr);
+		
+		TEST(id == iter.Image().Id());
+		TEST(glyphCode == iter.GlyphCode());
+		TEST(rect == iter.Rect());
+		TEST(CompareMetrics(metrics, iter.Metrics()) == 0);
+		}
+	iter.Close();
+		
+	__UHEAP_MARKEND;
+	}
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0665
+@SYMTestPriority    High
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+	Glyph Atlas white-box test.
+	To ensure that the same RSgImage is used for repeated requests for the 
+	same glyph in the same call to RFbsGlyphDataIterator:Open().
+@SYMTestActions
+	i Open the glyph data iterator with a list of glyph codes which are all the same
+	ii Retrieve the drawable id of each iteration 
+	iii Check that the same drawable id is retrieved in each iteration  
+@SYMTestExpectedResults
+	Each iteration returns the same drawable id. 
+*/
+void CTFbsGlyphData::TestGlyphDataIteratorSameGlyphCodes()
+	{
+	INFO_PRINTF1(_L("White box test - Ensure that the same RSgImage is used for repeated requests for the same glyph in the same call to Open()"));
+	__UHEAP_MARK;
+
+	const TUint KSameRepeatedGlyphCode = DejaVuASCIIToGlyphCode[0x004B]; // 'K'
+	const TInt KNumGlyphs = 10;
+	TUint* sameRepeatedGlyphCodes = new TUint[KNumGlyphs];
+	for (TInt ii = 0; ii < KNumGlyphs; ++ii)
+		{
+		sameRepeatedGlyphCodes[ii] = KSameRepeatedGlyphCode;
+		}
+	RFbsGlyphDataIterator iter;
+	TInt err = iter.Open(*iFont, sameRepeatedGlyphCodes, KNumGlyphs);
+	
+	TESTNOERROR(err);
+	if (KErrNone == err)
+		{
+		// get the drawable id of the first glyph and check that the id is valid
+		TSgDrawableId referenceId = iter.Image().Id();
+		RSgImage image;
+		TESTNOERROR(image.Open(referenceId));
+		image.Close();
+		TESTNOERROR(iter.Next());
+
+		for (;KErrNone == err; err = iter.Next())
+			{
+			TEST(referenceId == iter.Image().Id());
+			}
+		TESTE(KErrNotFound == err, err);
+		}
+
+	iter.Close();
+	delete[] sameRepeatedGlyphCodes;
+
+	__UHEAP_MARKEND;
+	}
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0668
+@SYMTestPriority    High
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+	To ensure that the iterator can successfully be opened on an array
+	of glyph codes of various array sizes. 
+@SYMTestActions
+	Perform many iterations of opening an array and cycling through the glyphs,
+	increasing the size of the array after each iteration. Some simple sanity-checking
+	of the glyphs is performed.
+@SYMTestExpectedResults
+	KErrNone should be returned at all times. 
+*/
+void CTFbsGlyphData::TestGlyphDataIteratorManyArraySizes()
+	{
+	INFO_PRINTF1(_L("Ensure that the RFbsGlyphDataIterator successfully opens glyph code arrays of many sizes"));
+	__UHEAP_MARK;
+	
+	RFbsGlyphMetricsArray glyphMetricsArray;
+	
+	TESTNOERROR(glyphMetricsArray.Get(*iFont, iGlyphCodesLatin, KNumGlyphCodesLatin));
+	TInt iterErr = KErrNone;
+	
+	for (TInt arraySize = 1; (arraySize < KNumGlyphCodesLatin) && (iterErr == KErrNone); ++arraySize)
+		{
+		RFbsGlyphDataIterator iter;
+		TInt iterErr = iter.Open(*iFont, iGlyphCodesLatin, arraySize);
+		TESTNOERROR(iterErr);
+		
+		for (TInt index = 0; iterErr == KErrNone; iterErr = iter.Next(), ++index)
+			{
+			// sanity checking...
+			if (iter.GlyphCode() != iGlyphCodesLatin[index])
+				{
+				ERR_PRINTF4(_L("Test failed at array size %d - Wanted glyphcode %d, got %d"), arraySize, iGlyphCodesLatin[index], iter.GlyphCode());
+				iStep->SetTestStepResult(EFail);
+				}
+			if (CompareMetrics(iter.Metrics(), glyphMetricsArray[index]) != 0)
+				{
+				ERR_PRINTF3(_L("Test failed at array size %d, metrics check failed at glyphcode %d"), arraySize, iGlyphCodesLatin[index]);
+				iStep->SetTestStepResult(EFail);
+				}			
+			}
+		iter.Close();
+		}
+
+	glyphMetricsArray.Close();
+	TESTNOERROR(iterErr);
+
+	__UHEAP_MARKEND;
+	}
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0669
+@SYMTestPriority    Low
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+	Negative test case to show that RFbsGlyphDataIterator and RFbsGlyphMetricsArray
+	do not support bitmap fonts.
+@SYMTestActions
+	i. Load a bitmap font.
+	ii. Attempt to open an RFbsGlyphDataIterator and RFbsGlyphMetricsArray with the font.
+@SYMTestExpectedResults
+	KErrNotSupported should be returned in both instances. 
+*/
+ void CTFbsGlyphData::TestBitmapFontSupport()
+	{
+	INFO_PRINTF1(_L("Test bitmap font not supported"));
+	__UHEAP_MARK;
+	
+	CFbsFont* bitmapFont = NULL;
+	TInt err = iTs->GetNearestFontToDesignHeightInPixels((CFont*&)bitmapFont, TFontSpec(_L("Digital"), 14));
+	TESTNOERROR(err);
+	TEST(!bitmapFont->IsOpenFont());
+	
+	RFbsGlyphDataIterator iter;
+	err = iter.Open(*bitmapFont, iGlyphCodesLatin, KNumGlyphCodesLatin);
+	TEST(err == KErrNotSupported);
+	iter.Close();
+	
+	RFbsGlyphMetricsArray array;
+	err = array.Get(*bitmapFont, iGlyphCodesLatin, KNumGlyphCodesLatin);
+	TEST(err == KErrNotSupported);
+	array.Close();
+	
+	iTs->ReleaseFont(bitmapFont);
+	__UHEAP_MARKEND;
+	}
+ 
+/**
+@SYMTestCaseID		GRAPHICS-FBSERV-0671
+@SYMTestPriority	High
+@SYMTestType		UT
+@SYMTestStatus		Implemented
+@SYMPREQ			PREQ2678
+
+@SYMTestCaseDesc
+	Shows that different threads (and therefore RFbsSessions) using fonts with the same
+	TFontSpec share the same glyphs	in the atlas and do not create duplicate entries
+	in the Glyph Atlas, and that releasing a font clears all associated glyphs in the
+	atlas.
+
+@SYMTestActions
+	i. Create a handle to a test font in the current process.
+	ii. Spawn a test thread and wait for it to complete. Within the thread :
+		1. Create a font with the same fontspec as the parent process.
+		2. Use the RFbsGlyphDataIterator API to force rasterization into the glyph atlas.
+		3. Release the iterator.
+	iii. Check there were no leaves from the thread.
+	iv. Repeat ii. and iii. several times. Before using RFbsGlyphDataIterator,
+		the thread checks that the glyphs are still in the atlas from the first thread.
+	v. Check that the number of fonts in the atlas has increased by one only.
+	vi. Check that the number of glyphs in the atlas has increased by the size of the 
+		glyph code array.
+	vii. Release the font in the parent process, thereby releasing the font and glyphs
+		in the glyph atlas, and check that the state of the atlas is the same as before
+		the test is run.
+
+@SYMTestExpectedResults
+	All threads should return no errors or leaves or panics.
+	After all threads have finished:
+		The glyph count should have increased by the size of the glyph code array used
+		in the RFbsGlyphDataIterator, showing that	glyphs are only being added to the atlas
+		once. The number of fonts in the atlas should have increased by one, showing
+		that only the single underlying font object is being added to the atlas, despite
+		different RFbsSessions and CFbsFont instances used.
+	After the test font is released in the main process:
+		The glyph count and font count return to the pre-test value, showing that when
+		the last handle to a TFontSpec is released, the atlas frees its associated data.
+*/
+void CTFbsGlyphData::TestMultithreadShareSingleFont()
+	{
+	INFO_PRINTF1(_L("Test glyphs shared between RFbsSessions/threads/processes"));
+#ifndef _DEBUG
+	// Test relies on debug-only FBS messages EFbsMessAtlasGlyphCount and EFbsMessAtlasFontCount
+	INFO_PRINTF1(_L("Skipping test in release mode"));
+#else	
+	__UHEAP_MARK;
+
+	_LIT(KThreadName, "GlyphDataTestThread");
+	const TInt KNumTestThreads = 5;
+	const TFontSpec KTestFontSpec(KTypefaceName, 50);	
+	const TInt atlasFontCountStart = iFbs->SendCommand(EFbsMessAtlasFontCount);
+	const TInt atlasGlyphCountStart = iFbs->SendCommand(EFbsMessAtlasGlyphCount);
+
+	CFbsFont* testFont;
+	TInt err = iTs->GetNearestFontToDesignHeightInPixels( (CFont*&)testFont, KTestFontSpec);
+	if (err != KErrNone)
+		{
+		ERR_PRINTF2(_L("Could not load font, err = %d"), err);
+		iStep->SetTestStepResult(EFail);
+		return;
+		}
+	
+	// Check there are no glyphs belonging to the test font before the test starts.
+	TInt atlasFontGlyphCount = iFbs->SendCommand(EFbsMessAtlasGlyphCount, testFont->Handle());
+	TEST(atlasFontGlyphCount == 0);
+
+	TGlyphDataMultithreadParams params = {KTestFontSpec, iGlyphCodesLatin, KNumGlyphCodesLatin, NULL};
+
+	// Run the test threads sequentially, and check its exit status.
+	RThread testThread;
+	TInt numThreadsPassed = 0;
+	for (TInt i = 0; i < KNumTestThreads; i++)
+		{
+		TBool threadPassed = ETrue;
+		TGlyphDataThreadInfo info = {EGlyphDataMultiSessionTestShareGlyphs, params, i, iStep};
+		err = testThread.Create(KThreadName, CTFbsGlyphData::ThreadFunction, KDefaultStackSize, KTestThreadMinHeapSize, KTestThreadMaxHeapSize, &info);
+		TESTNOERROR(err);
+
+		TRequestStatus statusThread;
+		testThread.Logon(statusThread);
+		testThread.Resume();
+		
+		User::WaitForRequest(statusThread);
+		TInt threadResult = testThread.ExitReason();
+		if (threadResult != KErrNone)
+			{
+			ERR_PRINTF3(_L("Thread %i: Terminated with reason %d"), i, threadResult);
+			threadPassed = EFalse; 
+			}
+		TExitCategoryName exitCategory = testThread.ExitCategory();
+		if (exitCategory.Compare(_L("Kill")) != 0)
+			{
+			ERR_PRINTF3(_L("Thread %i: Terminated with reason category '%S'"), i, &exitCategory);
+			threadPassed = EFalse;
+			}
+		testThread.Close();
+		numThreadsPassed += (threadPassed) ? 1 : 0;
+		}
+	TEST(numThreadsPassed == KNumTestThreads);
+
+	// Check that the atlas still contains the glyphs and the font created by the threads
+	// after they have died, since the font is still open in this process.
+	atlasFontGlyphCount = iFbs->SendCommand(EFbsMessAtlasGlyphCount, testFont->Handle());
+	TEST(atlasFontGlyphCount == params.iGlyphCodesCount);
+	TInt atlasFontCount = iFbs->SendCommand(EFbsMessAtlasFontCount);
+	TEST(atlasFontCount == (atlasFontCountStart + 1));
+
+	iTs->ReleaseFont(testFont);
+	testFont = NULL;
+
+	// Check the atlas state is now the same as it was before the test started,
+	// now that the last remaining handle to the font used in the threads is released.
+	TInt atlasGlyphCountEnd = iFbs->SendCommand(EFbsMessAtlasGlyphCount);
+	TEST(atlasGlyphCountStart == atlasGlyphCountEnd);
+	TInt atlasFontCountEnd = iFbs->SendCommand(EFbsMessAtlasFontCount);
+	TEST(atlasFontCountStart == atlasFontCountEnd);
+	__UHEAP_MARKEND;
+#endif
+	}
+
+/**
+Worker thread for TestMultithreadShareSingleFont().
+The thread uses RFbsGlyphDataIterator on a CFbsFont of the given TFontSpec.
+Once complete the atlas is queried for the number of associated glyphs.
+ */
+void CTFbsGlyphData::ThreadShareGlyphsL(TInt aThreadNum, TGlyphDataMultithreadParams& aParam, CTestStep* aStep)
+	{
+	User::LeaveIfError(RFbsSession::Connect());
+	CFbsTypefaceStore* ts = CFbsTypefaceStore::NewL(NULL);
+	CleanupStack::PushL(ts);
+	RFbsSession* fbs = RFbsSession::GetSession();
+
+	CFbsFont* font;
+	TInt err = ts->GetNearestFontToDesignHeightInPixels((CFont*&)font, aParam.iFontSpec);
+	User::LeaveIfError(err);
+
+	if (aThreadNum > 0)
+		{
+		// If this is not the first thread, it means the first thread has already executed and 
+		// populated the glyph atlas with the glyphs. The font created by this thread 
+		// should already have its glyphs in the atlas.
+		TInt fontGlyphCount = fbs->SendCommand(EFbsMessAtlasGlyphCount, font->Handle());
+		if (fontGlyphCount != aParam.iGlyphCodesCount)
+			{
+			aStep->ERR_PRINTF4(_L("Thread %d: Only %d glyphs in atlas before first iteration, expected %d"), aThreadNum, fontGlyphCount, aParam.iGlyphCodesCount);
+			aStep->SetTestStepResult(EFail);
+			}
+		}
+
+	RFbsGlyphDataIterator iter;
+	for (err = iter.Open(*font, aParam.iGlyphCodes, aParam.iGlyphCodesCount); err == KErrNone; err = iter.Next())
+		{
+		// no-op
+		}
+	iter.Close();
+
+	// Check that the glyphs of this font have been added to the atlas
+	TInt fontGlyphCount = fbs->SendCommand(EFbsMessAtlasGlyphCount, font->Handle());
+	if (fontGlyphCount != aParam.iGlyphCodesCount)
+		{
+		aStep->ERR_PRINTF5(_L("Thread %d: Only %d glyphs in atlas after last iteration, expected %d (err=%d)"), aThreadNum, fontGlyphCount, aParam.iGlyphCodesCount, err);
+		aStep->SetTestStepResult(EFail);
+		}
+	if (err != KErrNotFound)
+		{
+		aStep->ERR_PRINTF3(_L("Thread %d: Error during test = %d"), aThreadNum, err);
+		aStep->SetTestStepResult(EFail);
+		}
+
+	ts->ReleaseFont(font);
+	CleanupStack::PopAndDestroy(1); // ts
+	RFbsSession::Disconnect();
+	}
+
+
+/**
+@SYMTestCaseID		GRAPHICS-FBSERV-0672
+@SYMTestPriority	Medium
+@SYMTestType		UT
+@SYMTestStatus		Implemented
+@SYMPREQ			PREQ2678
+
+@SYMTestCaseDesc
+	Tests that with many concurrent sessions connected to Fbserv, the atlas successfully
+	returns the correct glyph images even if the atlas becomes full and has to evict glyphs.
+
+@SYMTestActions
+	i. Create 25 threads, each a unique session with Fbserv.
+	ii. Launch the threads simultaneously. In each thread:
+		1. Create a FBS typeface store and create a font which is unique in the process.
+		2. Use RFbsGlyphDataIterator to iterate through the latin glyph codes.
+		3. Check the image is correct for each glyph against the image returned by 
+			CFont::GetCharacterData().
+		4. Close the iterator.
+		5. Release the font and close the typeface store. 
+	iii. Once all threads have finished, check the exit status of each thread
+
+@SYMTestExpectedResults
+	Every glyph for every thread should match the image returned by GetCharacterData()
+	All threads should exit normally with no Leave code.
+*/
+_LIT(KTestMultithreadStressFinishSemaphore, "TestMultithreadStressAtlasFinish");
+
+void CTFbsGlyphData::TestMultithreadStressAtlas()
+	{
+	INFO_PRINTF1(_L("Stress test glyph atlas with multiple RFbsSessions"));
+	WARN_PRINTF1(_L("---Stress test TO BE REVISITED due to Broadcom defect ESLM-85NEFT - TB10.1 eglCreateImageKHR hangs during multithreading"));
+	TEST(EFalse);
+	/*__UHEAP_MARK;
+
+	TInt err = KErrNone;
+	const TInt KNumTestThreads = 25;
+	_LIT(KThreadNameFormat, "GlyphDataTestThread%i");
+
+	// Create a semaphore that is signalled by each test thread when it has finished.
+	RSemaphore threadFinishSemaphore;
+	err = threadFinishSemaphore.CreateGlobal(KTestMultithreadStressFinishSemaphore, 0, EOwnerThread);
+	TESTNOERROR(err);
+
+	// Prepare the testdata for the threads
+	// Each thread will have a TFontSpec which will cause unique CFbsFonts
+	// to be created in the server, and therefore the atlas.
+	RThread testThread[KNumTestThreads];
+	TGlyphDataThreadInfo testInfo[KNumTestThreads];	
+	for (TInt i = 0; i < KNumTestThreads; ++i)
+		{
+		testInfo[i].iStep = iStep;
+		testInfo[i].iTest = EGlyphDataMultiSessionTestStressAtlas;
+		testInfo[i].iParams.iFontSpec = GenerateDejaVuFontSpec(i);
+		testInfo[i].iParams.iGlyphCodes = iGlyphCodesLatin;
+		testInfo[i].iParams.iGlyphCodesCount = KNumGlyphCodesLatin;
+		testInfo[i].iParams.iEGL = iEGL;
+		testInfo[i].iThreadNum = i;	
+		TBuf<128> threadName;
+		threadName.AppendFormat(KThreadNameFormat, i);
+		err = testThread[i].Create(threadName, CTFbsGlyphData::ThreadFunction, KDefaultStackSize, KTestThreadMinHeapSize, KTestThreadMaxHeapSize, &testInfo[i]);
+		TESTNOERROR(err);
+		}
+
+	// All threads are created, start them simultaneously.
+	for (TInt i = 0; i < KNumTestThreads; ++i)
+		{
+		testThread[i].Resume();
+		}
+	// Wait for all threads to finish.
+	for (TInt i = 0; i < KNumTestThreads; ++i)
+		{
+		threadFinishSemaphore.Wait();
+		}
+	// Allow some time for remaining threads to finish tidy-up.
+	User::After(100000);
+	threadFinishSemaphore.Close();
+
+	TInt numThreadsPassed = 0;
+	for (TInt i = 0; i < KNumTestThreads; ++i)
+		{
+		TBool threadPassed = ETrue;
+		TInt threadResult = testThread[i].ExitReason();
+		if (threadResult != KErrNone)
+			{
+			ERR_PRINTF3(_L("Thread %i: Terminated with reason %d"), i, threadResult);
+			threadPassed = EFalse; 
+			}
+		TExitCategoryName exitCategory = testThread[i].ExitCategory();
+		if (exitCategory.Compare(_L("Kill")) != 0)
+			{
+			ERR_PRINTF3(_L("Thread %i: Terminated with reason category '%S'"), i, &exitCategory);
+			threadPassed = EFalse;
+			}
+		testThread[i].Close();
+		numThreadsPassed += (threadPassed) ? 1 : 0;
+		}
+	TEST(numThreadsPassed == KNumTestThreads);
+
+	__UHEAP_MARKEND;*/
+	}
+/**
+Worker thread for TestMultithreadStressAtlas().
+The thread uses RFbsGlyphDataIterator on a CFbsFont of the given TFontSpec.
+For each glyph, the image returned by the iterator is compared to the image 
+returned from CFont::GetCharacterData().
+Once complete, the semaphore is signalled to tell the parent process it has
+finished.
+ */
+void CleanupFinishSemaphore(TAny* aItem)
+    {
+    RSemaphore* semaphore = reinterpret_cast<RSemaphore*>(aItem);
+    semaphore->Signal();
+    semaphore->Close();
+    }
+void CTFbsGlyphData::ThreadStressAtlasL(TInt aThreadNum, TGlyphDataMultithreadParams& aParam, CTestStep* aStep)
+	{
+	TOpenFontCharMetrics charMetrics;
+	const TUint8* bitmapData;
+	TSize bitmapSize;
+	RSgImage charDataImage;
+
+	RSemaphore threadFinishSemaphore;
+	User::LeaveIfError(threadFinishSemaphore.OpenGlobal(KTestMultithreadStressFinishSemaphore));
+	CleanupStack::PushL(TCleanupItem(CleanupFinishSemaphore, &threadFinishSemaphore));
+
+	User::LeaveIfError(RFbsSession::Connect());
+	CFbsTypefaceStore* ts = CFbsTypefaceStore::NewL(NULL);
+	CleanupStack::PushL(ts);
+	
+	CFbsFont* font;
+	User::LeaveIfError(ts->GetNearestFontToDesignHeightInPixels((CFont*&)font, aParam.iFontSpec));
+
+	TInt numGlyphMatches = 0;
+	TInt index = 0;
+	TInt err = KErrNone;
+	RFbsGlyphDataIterator iter;
+	for (err = iter.Open(*font, aParam.iGlyphCodes, aParam.iGlyphCodesCount); err == KErrNone; err = iter.Next(), ++index)
+		{
+		TBool glyphMatch = EFalse;
+		font->GetCharacterData(aParam.iGlyphCodes[index] | KGlyphCodeFlag, charMetrics, bitmapData, bitmapSize);
+		if (bitmapSize == TSize(0, 0))
+			{
+			glyphMatch = (bitmapSize == iter.Rect().Size());
+			}
+		else
+			{
+			err = CreateSgImageFromCharacterData(bitmapData, bitmapSize, font->FontSpecInTwips().iFontStyle.BitmapType(), charDataImage);
+			if (err == KErrNone)
+				{
+				err = CompareSgImages(aParam.iEGL, iter.Image(), iter.Rect(), charDataImage, TRect(bitmapSize), glyphMatch);
+				}
+			charDataImage.Close();
+			}
+		if (err != KErrNone)
+			{
+			break;
+			}
+		numGlyphMatches += (glyphMatch) ? 1 : 0;
+		}
+	iter.Close();
+	
+	if (index != aParam.iGlyphCodesCount)
+		{
+		aStep->ERR_PRINTF5(_L("Thread %d: Iterator terminated early - %d out of %d glyphs (err=%d)"), aThreadNum, index, aParam.iGlyphCodesCount, err);
+		aStep->SetTestStepResult(EFail);
+		}
+	if (index != numGlyphMatches)
+		{
+		aStep->ERR_PRINTF4(_L("Thread %d: Matched %d out of %d glyphs"), aThreadNum, numGlyphMatches, aParam.iGlyphCodesCount);
+		aStep->SetTestStepResult(EFail);
+		}
+
+	ts->ReleaseFont(font);
+	CleanupStack::PopAndDestroy(2); // ts, threadFinishSemaphore
+	RFbsSession::Disconnect();
+	}
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0673
+@SYMTestPriority    Medium
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+    Tests the robustness of using RFbsGlyphMetricsArray when the client heap and the
+    FbServ private heap experience failures allocating memory, causing no panics 
+    or leaves.
+
+@SYMTestActions
+    i. Set the default heap failure for the next heap allocation.
+    ii. Create a new CFbsFont using a TFontSpec not already in the glyph atlas.
+    iii. Call RFbsGlyphMetricsArray::Get(), and close the array.
+    iv. Release the font so that nothing is left in the cache as a result of
+        attempting to use it, and reset the heap failure state.
+    v. While iii returns KErrNoMemory, increment the failure count and repeat
+        step ii.
+    vi. Using a separate font so that the test is not affected by the earlier
+        run, repeat ii. to v., but rather than setting the default heap to 
+        fail, the FbServ private heap is set to fail, via IPC messages to Fbs.
+
+@SYMTestExpectedResults
+    If no errors occur, KErrNone should be returned after a certain number of
+    repetitions. Any other error code denotes a problem handling low-memory 
+    situtations.
+*/
+void CTFbsGlyphData::TestGlyphMetricsArrayHeapOOML()
+    {
+    INFO_PRINTF1(_L("Test RFbsGlyphMetricsArray during heap alloc failure"));
+    __UHEAP_MARK;
+
+    // Create a font that wont be in the cache already...
+    TInt rep = 0;
+    TInt err = KErrNoMemory;
+    CFbsFont* font = NULL;
+    
+    while (err == KErrNoMemory)
+        {
+        User::LeaveIfError(iTs->GetNearestFontInPixels((CFont*&)font, GenerateDejaVuFontSpec(10)));
+        __UHEAP_FAILNEXT(rep);
+        RFbsGlyphMetricsArray array;
+        err = array.Get(*font, iGlyphCodesLatin, KNumGlyphCodesLatin);
+        array.Close();
+        __UHEAP_RESET;
+        iTs->ReleaseFont(font);
+        font = NULL;
+        ++rep;
+        }
+
+	TESTE(err == KErrNone, err);
+    if (err == KErrNone)
+        {
+        INFO_PRINTF2(_L("Client Heap OOM : Test passed after rep %d"), rep);
+        }
+    else
+        {
+        ERR_PRINTF3(_L("Client Heap OOM : Test failed with err=%d, after rep %d"), err, rep);
+        }
+
+    // Now test when the server-side FbServ heap fails...
+    rep = 0;
+    err = KErrNoMemory;
+    
+    while (err == KErrNoMemory)
+        {
+        User::LeaveIfError(iTs->GetNearestFontInPixels((CFont*&)font, GenerateDejaVuFontSpec(11)));
+        iFbs->SendCommand(EFbsMessSetHeapFail, RFbsSession::EHeapFailTypeServerMemory, rep);
+        RFbsGlyphMetricsArray array;
+        err = array.Get(*font, iGlyphCodesLatin, KNumGlyphCodesLatin);
+        array.Close();
+        iFbs->SendCommand(EFbsMessSetHeapReset, RFbsSession::EHeapFailTypeServerMemory);
+        iTs->ReleaseFont(font);
+        font = NULL;
+        ++rep;
+        }
+
+	TESTE(err == KErrNone, err);
+    if (err == KErrNone)
+        {
+        INFO_PRINTF2(_L("FBServ Heap OOM : Test passed after rep %d"), rep);
+        }
+    else
+        {
+        ERR_PRINTF3(_L("FBServ Heap OOM : Test failed with err=%d, after rep %d"), err, rep);      
+        }
+    __UHEAP_MARKEND;
+    }
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0674
+@SYMTestPriority    Medium
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+    Tests the robustness of using RFbsGlyphDataIterator when the client heap and the
+    FbServ private heap experience failures allocating memory, causing no panics 
+    or leaves.
+
+@SYMTestActions
+    i. Set the default heap failure for the next heap allocation.
+    ii. Create a new CFbsFont using a TFontSpec not already in the glyph atlas.
+    iii. Call RFbsGlyphDataIterator::Open(), and close the array.
+    iv. Release the font so that nothing is left in the cache as a result of
+        attempting to use it, and reset the heap failure state.
+    v. While iii returns KErrNoMemory, increment the failure count and repeat
+        step ii.
+    vi. Using a separate font so that the test is not affected by the earlier
+        run, repeat ii. to v., but rather than setting the default heap to 
+        fail, the FbServ private heap is set to fail, via IPC messages to Fbs.
+
+@SYMTestExpectedResults
+    If no errors occur, KErrNone should be returned after a certain number of
+    repetitions. Any other error code denotes a problem handling low-memory 
+    situtations.
+*/
+void CTFbsGlyphData::TestGlyphDataIteratorHeapOOML()
+    {
+    INFO_PRINTF1(_L("Test RFbsGlyphDataIterator during heap alloc failure"));    
+    __UHEAP_MARK;
+
+    // Create a font that wont be in the cache already...
+    TInt rep = 0;
+    TInt err = KErrNoMemory;
+    CFbsFont* font = NULL;
+    
+    while (err == KErrNoMemory)
+        {
+        User::LeaveIfError(iTs->GetNearestFontInPixels((CFont*&)font, GenerateDejaVuFontSpec(10)));
+        __UHEAP_FAILNEXT(rep);
+        RFbsGlyphDataIterator iter;
+        err = iter.Open(*font, iGlyphCodesLatin, KNumGlyphCodesLatin);
+        if (err == KErrNone)
+            {
+            while (err == KErrNone) 
+               {
+               err = iter.Next();
+               }
+            err = (err == KErrNotFound) ? KErrNone : err;
+            }
+        iter.Close();
+        __UHEAP_RESET;
+        iTs->ReleaseFont(font);
+        font = NULL;
+        ++rep;
+        }
+
+	TESTE(err == KErrNone, err);
+    if (err == KErrNone)
+        {
+        INFO_PRINTF2(_L("Client Heap OOM : Test passed after rep %d"), rep);
+        }
+    else
+        {
+        ERR_PRINTF3(_L("Client Heap OOM : Test failed with err=%d, after rep %d"), err, rep);
+        }
+
+    // Now test when the server-side FbServ heap fails...
+    rep = 0;
+    err = KErrNoMemory;
+    
+    while (err == KErrNoMemory)
+        {
+        User::LeaveIfError(iTs->GetNearestFontInPixels((CFont*&)font, GenerateDejaVuFontSpec(11)));
+        iFbs->SendCommand(EFbsMessSetHeapFail, RFbsSession::EHeapFailTypeServerMemory, rep);
+        RFbsGlyphDataIterator iter;
+        err = iter.Open(*font, iGlyphCodesLatin, KNumGlyphCodesLatin);
+        if (err == KErrNone)
+            {
+            while (err == KErrNone) 
+               {
+               err = iter.Next();
+               }
+            err = (err == KErrNotFound) ? KErrNone : err;
+            }
+        iter.Close();
+        iFbs->SendCommand(EFbsMessSetHeapReset, RFbsSession::EHeapFailTypeServerMemory);
+        iTs->ReleaseFont(font);
+        font = NULL;
+        ++rep;
+        }
+
+	TESTE(err == KErrNone, err);
+    if (err == KErrNone)
+        {
+        INFO_PRINTF2(_L("FBServ Heap OOM : Test passed after rep %d"), rep);
+        }
+    else
+        {
+        ERR_PRINTF3(_L("FBServ Heap OOM : Test failed with err=%d, after rep %d"), err, rep);
+        }
+    __UHEAP_MARKEND;
+    }
+
+/**
+Utility function. Prints out a description of the font's fontspec to the log.
+ */
+void CTFbsGlyphData::InfoPrintFontSpec(const CFont& aFont)
+	{
+	_LIT(KMonochromeBitmap, "Mono");
+	_LIT(KAntiAliasedBitmap, "AA");
+	_LIT(KStyleItalic, "Italic");
+	_LIT(KStyleBold, "Bold");
+	_LIT(KStyleNormal, "Normal");
+	_LIT(KUnknown, "Unknown");
+	TBufC<9> bitmapType;
+	TBuf<12> fontStyle;
+	TFontSpec fontSpec = aFont.FontSpecInTwips();
+	switch(fontSpec.iFontStyle.BitmapType())
+		{
+		case EMonochromeGlyphBitmap:
+			bitmapType = KMonochromeBitmap;
+			break;
+		case EAntiAliasedGlyphBitmap:
+			bitmapType = KAntiAliasedBitmap;
+			break;
+		default:
+			bitmapType = KUnknown;
+		}
+
+	if (fontSpec.iFontStyle.StrokeWeight() == EStrokeWeightBold)
+		{
+		fontStyle.Append(KStyleBold);
+		}
+	if (fontSpec.iFontStyle.Posture() == EPostureItalic)
+		{
+		fontStyle.Append(KStyleItalic);
+		}
+	if (fontStyle.Length() == 0)
+		{
+		fontStyle = KStyleNormal;
+		}
+
+	INFO_PRINTF5(_L("Font: name=%S size=%dtw type=%S style=%S"), &(fontSpec.iTypeface.iName), fontSpec.iHeight, &bitmapType, &fontStyle);
+	}
+
+
+/**
+Static utility function. Performs a per-pixel comparison of two open RSgImages.
+To do this requires access to the binary data of the images, only accessable
+via EGL and Khronos APIs. This function will bind the RSgImages to VGImages 
+and uses OpenVG to retrieve the image data in 8bpp.
+@param aEGL An EGL Helper to read the SgImages into system memory.
+@param aImageA The first image to compare.
+@param aRectA A rectangular portion in pixels of the first image to compare.
+@param aImageB The second image to compare.
+@param aRectB A rectangular portion in pixels fo the second image to compare.
+@param aMatch A boolean value, which on return tells the caller whether the two
+	images were deemed to match.
+@return KErrNone, if the comparison took place, otherwise one of the system-wide
+	error codes.
+*/
+TInt CTFbsGlyphData::CompareSgImages(CEGLHelper* aEGL, const RSgImage& aImageA, const TRect& aRectA, const RSgImage& aImageB, const TRect& aRectB, TBool& aMatch)
+	{
+	return CTFbsGlyphData::CompareSgImages(aEGL, aImageA, aRectA, NULL, aImageB, aRectB, NULL, aMatch);
+	}
+
+/**
+Static utility function. Performs a per-pixel comparison of two open RSgImages.
+To do this requires access to the binary data of the images, only accessable
+via EGL and Khronos APIs. This function will bind the RSgImages to VGImages 
+and uses OpenVG to retrieve the image data in 8bpp.
+This version allows pre-created memory to be used in the comparison, to avoid
+allocation failure in low memory testing.
+@param aEGL An EGL Helper to read the SgImages into system memory buffers.
+@param aImageA The first image to compare.
+@param aRectA A rectangular portion in pixels of the first image to compare.
+@param aBufferA If non-NULL, specifies a memory buffer to read the data of
+	aImageA into, otherwise a buffer is dynamically allocated.
+@param aImageB The second image to compare.
+@param aRectB A rectangular portion in pixels fo the second image to compare.
+@param aBufferB If non-NULL, specifies a memory buffer to read the data of
+	aImageB into, otherwise a buffer is dynamically allocated.
+@param aMatch A boolean value, which on return tells the caller whether the two
+	images were deemed to match.
+@return KErrNone, if the comparison took place, otherwise one of the system-wide
+	error codes.
+*/
+TInt CTFbsGlyphData::CompareSgImages(CEGLHelper* aEGL, const RSgImage& aImageA, const TRect& aRectA, TUint8* aBufferA, const RSgImage& aImageB, const TRect& aRectB, TUint8* aBufferB, TBool& aMatch)
+	{
+	// By default, assume they do not match.
+	aMatch = EFalse;
+	
+#ifdef SAVEGLYPHSTOMBMDURINGCOMPARISON
+	
+	static TInt countToAppend = 0;
+	
+	CFbsBitmap* bitmap = NULL;
+	if (KErrNone == CreateBitmapFromSgImage(aEGL, aImageA, aRectA, bitmap))
+		{
+		TBuf<KMaxFileName> buf;
+		buf.AppendNum( countToAppend );
+		TPtrC nameAppend( buf );
+		
+		SaveBmp(bitmap, &nameAppend, EFalse);
+		}
+	delete bitmap;	
+	if (KErrNone == CreateBitmapFromSgImage(aEGL, aImageB, aRectB, bitmap))
+		{
+		TBuf<KMaxFileName> buf;
+		buf.AppendNum( countToAppend );
+		TPtrC nameAppend( buf );
+	
+		SaveBmp(bitmap, &nameAppend, ETrue);
+		}
+	delete bitmap;
+	
+	countToAppend++;
+	
+#endif // SAVEGLYPHSTOMBMDURINGCOMPARISON
+	
+	TSgImageInfo imageInfoA;
+	TSgImageInfo imageInfoB;
+	if (aImageA.GetInfo(imageInfoA) != KErrNone ||
+		aImageB.GetInfo(imageInfoB) != KErrNone)
+		{
+		return KErrBadHandle;
+		}
+		
+	// Check the sizes of the images match, and the rects reside on the images.
+	if (aRectA.Size() != aRectB.Size() ||
+		!TRect(imageInfoA.iSizeInPixels).Intersects(aRectA) ||
+		!TRect(imageInfoB.iSizeInPixels).Intersects(aRectB))
+		{
+		return KErrNone;		
+		}
+	const TSize KBufferSize = aRectA.Size();
+	const TInt KDataStride = KBufferSize.iWidth;
+
+	TBool freeTempBufA = EFalse;
+	TBool freeTempBufB = EFalse;
+	if (!aBufferA)
+		{
+		aBufferA = (TUint8*) User::AllocZ(KDataStride * KBufferSize.iHeight);
+		freeTempBufA = ETrue;
+		}
+	if (!aBufferA)
+		{
+		return KErrNoMemory;
+		}
+	TInt err = aEGL->GetSgImageData(aImageA, aRectA, aBufferA);
+	if (err != KErrNone)
+		{
+		if (freeTempBufA)
+			{
+			User::Free(aBufferA);
+			aBufferA = NULL;
+			}
+		return err;
+		}
+	if (!aBufferB)
+		{
+		aBufferB = (TUint8*) User::AllocZ(KDataStride * KBufferSize.iHeight);
+		freeTempBufB = ETrue;
+		}
+	if (!aBufferB)
+		{
+		if (freeTempBufA)
+			{
+			User::Free(aBufferA);
+			aBufferA = NULL;
+			}
+		return KErrNoMemory;
+		}
+	err = aEGL->GetSgImageData(aImageB, aRectB, aBufferB);
+	if (err != KErrNone)
+		{
+		if (freeTempBufA)
+			{
+			User::Free(aBufferA);
+			aBufferA = NULL;
+			}
+		if (freeTempBufB)
+			{
+			User::Free(aBufferB);
+			aBufferB = NULL;
+			}
+		return err;
+		}	
+
+	// Perform a per-pixel comparison, scanline by scanline.
+	// The loop will break as soon as a mismatch is detected.
+	aMatch = ETrue;
+	for (TInt scanline = 0; (scanline < KBufferSize.iHeight) && aMatch; ++scanline)
+		{
+		TUint8* scanlineImageA = aBufferA + (scanline * KDataStride);
+		TUint8* scanlineImageB = aBufferB + (scanline * KDataStride);
+		aMatch = (Mem::Compare(scanlineImageA, KBufferSize.iWidth, scanlineImageB, KBufferSize.iWidth) == 0);
+		}
+
+	if (freeTempBufA)
+		{
+		User::Free(aBufferA);
+		aBufferA = NULL;
+		}
+	if (freeTempBufB)
+		{
+		User::Free(aBufferB);
+		aBufferB = NULL;
+		}
+	
+	return KErrNone;
+	}
+
+/**
+Second thread entry function for multi-threaded tests.
+*/
+TInt CTFbsGlyphData::ThreadFunction(TAny* aParam)
+	{
+	__UHEAP_MARK;
+	CTrapCleanup* cleanupStack = CTrapCleanup::New();
+	if (!cleanupStack)
+		{
+		return KErrNoMemory;
+		}
+
+	TGlyphDataThreadInfo* info = static_cast<TGlyphDataThreadInfo*>(aParam);
+	TRAPD(result,
+	switch(info->iTest)
+		{
+		case EGlyphDataMultiSessionTestShareGlyphs:
+			CTFbsGlyphData::ThreadShareGlyphsL(info->iThreadNum, info->iParams, info->iStep);
+			break;
+		case EGlyphDataMultiSessionTestStressAtlas:
+			CTFbsGlyphData::ThreadStressAtlasL(info->iThreadNum, info->iParams, info->iStep);
+			break;
+		default:
+			User::Leave(KErrArgument);
+		}
+	);
+
+	delete cleanupStack;
+	__UHEAP_MARKEND;
+	return result;
+	}
+
+
+
+/*
+	-----------------------------------------
+	Static utility Methods used by the tests.
+	-----------------------------------------
+*/
+
+
+
+/**
+Utility method that fills the RSgImage memory with RSgImages until either KErrNoMemory
+or KErrNoGraphicsMemory is returned.
+
+@param aSize The size of the image used to fill the graphics memory - a form of granularity
+@param aImages Returns the array of the images used to fill the graphics memory.
+@return KErrNoGraphicsMemory or KErrNoMemory if successful, otherwise one of the system
+	wide error codes.
+ */
+/*static TInt FillGraphicsMemoryWithImages(const TSize& aSize, RArray<RSgImage>& aImages)
+	{
+	TInt err = KErrNone;
+	while (KErrNone == err)
+		{
+		RSgImage sgImage;
+		err = sgImage.Create(TSgImageInfo(aSize, ESgPixelFormatA_8, ESgUsageBitOpenVgImage));
+		if (KErrNone == err)
+			{
+			err = aImages.Append(sgImage);
+			}
+		}
+	return err;
+	}*/
+
+/**
+Utility method that fills the RSgImage memory with RSgImages until either KErrNoMemory
+or KErrNoGraphicsMemory is returned and then closes one RSgImage to free up some memory.
+
+@param aSize The size of the image used to fill the graphics memory - a form of granularity
+@param aImages Returns the array of the images used to fill the graphics memory.
+@return KErrNone if successful, otherwise one of the system	wide error codes.
+ */
+/*static TInt NearlyFillGraphicsMemoryWithImages(const TSize& aSize, RArray<RSgImage>& aImages)
+	{
+	TInt err = FillGraphicsMemoryWithImages(aSize, aImages);
+	if (err == KErrNoMemory || err == KErrNoGraphicsMemory)
+		{
+		if (aImages.Count() > 0)
+			{
+			// Remove an image to free up some memory.
+			TInt lastIndex = aImages.Count() - 1;
+			aImages[lastIndex].Close();
+			aImages.Remove(lastIndex);
+			}
+		err = KErrNone;
+		}
+	return err;
+	}*/
+
+/**
+Static utility function. Creates an 8bpp RSgImage from 1bpp or 8bpp character
+data, with VGImage usage flag set.
+@param aData The character image data. Either in 8bpp or 1bpp RLE format.
+@param aSize The size of the character image in pixels.
+@param aType The type of glyph - Monochrome or Antialiased. 
+@param aSgImage A closed image which will be populated with 8bpp image data.
+*/
+static TInt CreateSgImageFromCharacterData(const TUint8* aData, const TSize& aSize, TGlyphBitmapType aType, RSgImage& aImage)
+	{
+	return CreateSgImageFromCharacterData(aData, aSize, aType, aImage, NULL, NULL);
+	}
+
+/**
+Static utility function. Creates an 8bpp RSgImage from 1bpp or 8bpp character
+data, with VGImage usage flag set. 
+This overload allows the memory for the buffers to be pre-created to avoid
+memory allocation failure during low-memory testing.
+@param aData The character image data. Either in 8bpp or 1bpp RLE format.
+@param aSize The size of the character image in pixels.
+@param aType The type of glyph - Monochrome or Antialiased. 
+@param aSgImage A closed image which will be populated with 8bpp image data.
+@param aBuffer1 If non-NULL, used as a memory buffer for reading the decoded 
+	image data into for monochrome images.
+@param aBuffer2 If non-NULL, used as a memory buffer for the decoded image
+	data for monochrome images.
+*/
+static TInt CreateSgImageFromCharacterData(const TUint8* aData, const TSize& aSize, TGlyphBitmapType aType, RSgImage& aImage, TUint8* aBuffer1, TUint8* aBuffer2)
+	{
+	TInt err = KErrNone;	
+	if (aSize == TSize(0, 0))
+		{
+		return KErrArgument;
+		}
+	TUint8* dataBuf = NULL;
+	TInt dataStride = 0;
+	TBool freeDataBuf = EFalse;
+	if (aType == EAntiAliasedGlyphBitmap)
+		{
+		dataBuf = const_cast<TUint8*>(aData);
+		dataStride = aSize.iWidth;
+		}
+	else if (aType == EMonochromeGlyphBitmap)
+		{
+		TUint8* binaryData = NULL;
+		TUint8* tempBuf = NULL;
+		TInt binaryDataStride = ((aSize.iWidth + 31) / 32) << 2;
+		TInt binaryDataSize = binaryDataStride * aSize.iHeight;
+		if (aBuffer1 && User::AllocLen(aBuffer1) >= binaryDataSize)
+			{
+			binaryData = aBuffer1;
+			}
+		else
+			{
+			tempBuf = (TUint8*) User::AllocZ(binaryDataSize);
+			if (!tempBuf)
+				{
+				return KErrNoMemory;
+				}
+			binaryData = tempBuf;
+			}
+		// Unpack the run length encoded data into 1bpp
+		DecodeBinaryData(aSize, aData, binaryDataStride, reinterpret_cast<TUint32*&>(binaryData));
+		dataStride = aSize.iWidth;
+		TInt byteDataSize = dataStride * aSize.iHeight;
+		TUint8* byteData = NULL;
+		// If aByteBuf supplied, use that instead of allocating a new buffer here.
+		if (aBuffer2 && User::AllocLen(aBuffer2) >= byteDataSize)
+			{
+			byteData = aBuffer2;
+			}
+		else
+			{
+			byteData = (TUint8*) User::AllocZ(byteDataSize);
+			if (!byteData)
+				{
+				User::Free(tempBuf);
+				return KErrNoMemory;
+				}
+			freeDataBuf = ETrue;
+			}
+		dataBuf = byteData;
+		for (TInt scanline = 0; scanline < aSize.iHeight; ++scanline)
+			{
+			TUint8* srcByte = binaryData;
+			for (TInt pixel = 0; pixel < aSize.iWidth; pixel++)
+				{
+				*(byteData+pixel) = ((*srcByte & (1 << (pixel % 8))) == 0) ? 0 : 0xFF;
+				if (((pixel + 1) % 8) == 0) srcByte++;
+				}
+			byteData += dataStride;
+			binaryData += binaryDataStride;
+			}
+		User::Free(tempBuf);
+		}
+	else
+		{
+		return KErrArgument;
+		}
+
+	// Create RSgImage from CFbsBitmap.
+	TSgImageInfo sgImageInfo(aSize, ESgPixelFormatA_8, ESgUsageBitOpenVgImage);
+	err = aImage.Create(sgImageInfo, dataBuf, dataStride);
+	if (freeDataBuf)
+		{
+		User::Free(dataBuf);
+		}
+	return err;
+	}
+
+
+/**
+Static utility function, Copies image data line(s) to a destination.
+@param aBinaryDataPtr pointer to a destination buffer.
+@param aBufferWords Stride of the image.
+@param aData Pointer to a source buffer.
+@param aBitShift Number of bits, binary data will be shifted. 
+@param aCharWidth Width of the image.
+@param aRepeatCount Number of lines to copy.
+*/
+static void CopyCharLine(TUint32*& aBinaryDataPtr,TInt aBufferWords,const TUint8* aData,TInt aBitShift,TInt aCharWidth, TInt16 aRepeatCount)
+	{
+	aBitShift&=7;
+	TInt wordstocopy=(aCharWidth+31)>>5;
+	if(wordstocopy>aBufferWords) wordstocopy=aBufferWords;
+	TUint32* ptrlimit=aBinaryDataPtr+wordstocopy;
+	TUint32* dataword=(TUint32*)(TInt(aData)&~3);
+	aBitShift+=(TInt(aData)-TInt(dataword))<<3;
+	
+	TUint32* startBinaryDataPtr = aBinaryDataPtr;
+	while(aBinaryDataPtr<ptrlimit)
+		{
+		*aBinaryDataPtr=*dataword++;
+		*aBinaryDataPtr>>=aBitShift;
+		if(aBitShift) *aBinaryDataPtr|=(*dataword<<(32-aBitShift));
+		aBinaryDataPtr++;
+		}
+	
+	TUint32* curStartBinaryDataPtr = aBinaryDataPtr;
+	TInt byteToCopy = wordstocopy << 2;
+	while(aRepeatCount > 1)
+		{
+		Mem::Copy(curStartBinaryDataPtr, startBinaryDataPtr, byteToCopy);
+		curStartBinaryDataPtr += wordstocopy;
+		
+		aRepeatCount--;
+		}
+	aBinaryDataPtr = curStartBinaryDataPtr;
+	}
+
+/**
+Static utility function. Decodes a monochrome glyph whose data is run length encoded, 
+into a 1bpp bitmap.
+@param aDataSize Image size in pixels.
+@param aData Pointer to a source buffer.
+@param aStride Image data stride.
+@param aBinaryData Pointer to a destination buffer. This buffer must be allocated 
+	by the caller.
+*/
+static void DecodeBinaryData(const TSize& aDataSize, const TUint8* aData, TInt aStride,
+											TUint32* aBinaryData)
+	{
+	const TInt datalength = aDataSize.iWidth;
+	const TInt dataheight = aDataSize.iHeight;
+	TInt bitindex=0;
+	TInt16 repeatcount=0;
+	TUint32* slbuffer=aBinaryData;
+	const TInt slwords=aStride;
+
+	for(TInt charline=0;charline<dataheight;charline+=repeatcount) // for lines in the character...
+		{
+		repeatcount=CFbsBitGc::Load16(aData+(bitindex>>3));
+		repeatcount>>=bitindex&7;
+		const TInt multilineflag=repeatcount&1;
+		repeatcount>>=1;
+		repeatcount&=0xf;
+		bitindex+=5;
+		if(multilineflag)
+			{
+			for(TInt currentline=0;currentline<repeatcount;currentline++)
+				{
+				CopyCharLine(slbuffer,slwords,aData+(bitindex>>3),bitindex&7,datalength, 1);
+				bitindex+=datalength;
+				}
+			}
+		else
+			{
+			CopyCharLine(slbuffer,slwords,aData+(bitindex>>3),bitindex&7,datalength, repeatcount);
+			bitindex+=datalength;
+			}
+		}
+	}
+//--------------
+__CONSTRUCT_STEP__(FbsGlyphData)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/tfbs/tfbsglyphdata.h	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,199 @@
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef TFBSGLYPHDATA_H
+#define TFBSGLYPHDATA_H
+
+#include <EGL/eglext.h>
+#include <VG/openvg.h>
+#include <sgresource/sgresource.h>
+#include "test/TGraphicsHarness.h"
+class RSgImage;
+class CEGLHelper;
+
+//#define SAVEGLYPHSTOMBMDURINGCOMPARISON // Enable saving of glyphs in the CompareSgImages()function
+//#define SAVEGLYPHSTOMBMDEBUGFUNCTION //  Enable compilation of the member function SaveRSgImagesAsMbms(). Occasionally useful.
+
+typedef EGLBoolean (*TvgCreateEGLImageTargetKHRTypefPtr) (VGeglImageKHR image);
+
+/**
+Multi-thread test enum.
+ */
+enum EGlyphDataMultithreadTest
+	{
+	EGlyphDataMultiSessionTestShareGlyphs,
+	EGlyphDataMultiSessionTestStressAtlas
+	};
+
+/**
+Struct passed to multi-thread test functions.
+ */
+struct TGlyphDataMultithreadParams
+	{
+	TFontSpec iFontSpec;
+	TUint* iGlyphCodes;
+	TInt iGlyphCodesCount;
+	CEGLHelper* iEGL;
+	};
+
+/**
+Struct used to define the mutlithreaded test to run when launching a new thread.
+ */
+struct TGlyphDataThreadInfo
+	{
+	EGlyphDataMultithreadTest iTest;
+	TGlyphDataMultithreadParams iParams;
+	TInt iThreadNum;
+	CTestStep* iStep;
+	};
+
+
+/**
+ *
+ * Class to provide a dummy font for test purposes
+ * See CTFbsGlyphData::TestGlyphDataIteratorNotSupportedFontL()
+ */
+class CTestFont : public CFont
+	{
+public:
+	TUid DoTypeUid() const {return TUid::Uid(12345);}
+	TInt DoHeightInPixels() const {return 12;}
+	TInt DoAscentInPixels() const {return 10;}
+	TInt DoCharWidthInPixels(TChar /*aChar*/) const  {return 0;}
+	TInt DoTextWidthInPixels(const TDesC& /*aText*/) const {return 0;}
+	TInt DoBaselineOffsetInPixels() const {return 0;}
+	TInt DoTextCount(const TDesC& /*aText*/,TInt /*aWidthInPixels*/) const {return 0;}
+	TInt DoTextCount(const TDesC& /*aText*/,TInt /*aWidthInPixels*/,TInt& /*aExcessWidthInPixels*/) const {return 0;}
+	TInt DoMaxCharWidthInPixels() const  {return 0;}
+	TInt DoMaxNormalCharWidthInPixels() const  {return 0;}
+	TFontSpec DoFontSpecInTwips() const  {return TFontSpec();}
+	};
+
+/**
+Created by each process/thread that needs to do RSgImage image comparison.
+The class can be shared in a process between threads and handles synchronisation
+with EGL itself.
+ */
+class CEGLHelper : public CBase
+	{
+public:
+	~CEGLHelper();
+	static CEGLHelper* NewL();
+		
+	TInt GetSgImageData(const RSgImage& aSgImage, const TRect& aRect, TUint8*& aBuf);
+	
+private:
+	CEGLHelper();
+	void ConstructL();
+
+private:
+	RMutex iMutex;
+	RSgDriver iSgDriver;
+	EGLDisplay iDisplay;
+	EGLContext iContext;
+	EGLSurface iSurface;
+	// Function pointer for creation and destruction of EGLImages, and the creation
+	// of VGImages from EGLImages.
+	TvgCreateEGLImageTargetKHRTypefPtr vgCreateImageTargetKHR;
+	PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR;
+	PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR;
+	};
+
+/**
+Test class for the glyph data extensions RFbsGlyphDataIterator and 
+RFbsGlyphMetricsArray. Positive and negative tests
+*/
+class CTFbsGlyphData : public CTGraphicsBase
+	{
+public:
+	CTFbsGlyphData(CTestStep* aStep);
+	~CTFbsGlyphData();
+protected:
+//from 	CTGraphicsBase
+	virtual void RunTestCaseL(TInt aCurTestCase);
+	void ConstructL();
+	
+private:
+	// Test Cases
+	void TestConsistencyWithGetCharacterData();
+	void TestInvalidGlyphCode();
+	void TestGlyphMetricsArrayParameters();
+	void TestGlyphMetricsArrayReuse();
+	void TestGlyphDataIteratorClose();
+	void TestGlyphDataIteratorSequence();
+	void TestGlyphDataIteratorMultipleUsesOnMultipleFonts();
+	void TestGlyphDataIteratorImageValidity();
+	void TestGlyphDataIteratorOpenInvalidCode();
+	void TestGlyphDataIteratorOpenTwice();
+	void TestGlyphDataIteratorOpenTwiceWithDifferentFonts();
+	void TestGlyphDataIteratorOpenTooBigFont();
+	void TestGlyphDataIteratorOpenWithWrongArgument();
+	void TestGlyphDataIteratorImageMemoryLeak();
+	void TestGlyphDataIteratorLargeFontStress();
+	void TestGlyphDataIteratorManyFontsStressL();
+	void TestGlyphDataIteratorNoGraphicsMemory();
+	void TestGlyphDataIteratorNextIsAtomic();
+	void TestGlyphDataIteratorManyArraySizes();
+	void TestBitmapFontSupport();
+	// White-Box Test Cases
+	void TestGlyphDataIteratorSameGlyphCodes();
+	void TestMultithreadShareSingleFont();
+	void TestMultithreadStressAtlas();
+	// Out-of-system-memory tests
+	void TestGlyphMetricsArrayHeapOOML();
+	void TestGlyphDataIteratorHeapOOML();
+	// Multithread funtions
+	static void ThreadShareGlyphsL(TInt aThreadNum, TGlyphDataMultithreadParams& aParam, CTestStep* aStep);
+	static void ThreadStressAtlasL(TInt aThreadNum, TGlyphDataMultithreadParams& aParam, CTestStep* aStep);	
+
+	// Utility functions for the test cases.
+	static TInt ThreadFunction(TAny* aParam); 
+	TInt GetImageDataFromSgImage(const RSgImage& aSgImage, const TRect& aRect, TUint8*& aBuf);
+	TUint32 CompareMetrics(const TOpenFontCharMetrics& aMetrics1, const TOpenFontCharMetrics& aMetrics2);
+	static TInt CompareSgImages(CEGLHelper* aEGL, const RSgImage& aImageA, const TRect& aRectA, const RSgImage& aImageB, const TRect& aRectB, TBool& aMatch);
+	static TInt CompareSgImages(CEGLHelper* aEGL, const RSgImage& aImageA, const TRect& aRectA, TUint8* aBufferA, const RSgImage& aImageB, const TRect& aRectB, TUint8* aBufferB, TBool& aMatch);
+#ifdef SAVEGLYPHSTOMBMDEBUGFUNCTION
+	void SaveRSgImagesAsMbms( CEGLHelper* aEGL, const RSgImage& aImageA, const TRect& aRectA, const RSgImage& aImageB, const TRect& aRectB );
+#endif // SAVEGLYPHSTOMBMDEBUGFUNCTION
+	void InfoPrintFontSpec(const CFont& aFont);
+	void SetupEglL();
+	
+private:
+	RFbsSession* iFbs;
+	CFbsTypefaceStore* iTs;
+	TUint* iGlyphCodesLatin;
+	
+	CFbsFont* iFont;
+	CFbsFont* iFont2;
+
+	TUint8* iTempBuf1;
+	TUint8* iTempBuf2;
+	RSgDriver iSgDriver;
+	CEGLHelper* iEGL;
+	};
+
+
+class CTFbsGlyphDataStep : public CTGraphicsStep
+	{
+public:
+	CTFbsGlyphDataStep();
+protected:	
+	//from CTGraphicsStep
+	virtual CTGraphicsBase* CreateTestL();
+	};
+
+_LIT(KTFbsGlyphDataStep,"TFbsGlyphData");
+
+#endif /* TFBSGLYPHDATA_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/tfbs/tfbsglyphdataoutlineshadow.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,93 @@
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <graphics/fbsglyphdataiterator.h>
+#include <sgresource/sgimage.h>
+
+#include "tfbsglyphdataoutlineshadow.h"
+
+_LIT(KTypefaceName, "DejaVu Sans Condensed");
+
+//Note: This test must be run with a rasterizer which supports EFourColourBlendGlyphBitmap (e.g. iType)
+//otherwise the test will fail.
+CTFbsGlyphDataOutlineAndShadow::CTFbsGlyphDataOutlineAndShadow(CTestStep* aStep) :
+    CTGraphicsBase(aStep)
+    {
+    }
+
+CTFbsGlyphDataOutlineAndShadow::~CTFbsGlyphDataOutlineAndShadow()
+    {
+    if (iTs)
+       {
+       iTs->ReleaseFont(iFont);
+       delete iTs;
+       }
+    }
+
+void CTFbsGlyphDataOutlineAndShadow::ConstructL()
+    {
+    iTs = (CFbsTypefaceStore*)CFbsTypefaceStore::NewL(NULL);
+    TFontSpec fontSpec;
+    fontSpec.iTypeface.iName = KTypefaceName;
+    fontSpec.iHeight = 15;
+    fontSpec.iFontStyle.SetBitmapType(EAntiAliasedGlyphBitmap);
+    fontSpec.iFontStyle.SetEffects(FontEffect::EDropShadow, EDropShadowOn);
+    fontSpec.iFontStyle.SetEffects(FontEffect::EOutline, EOutlineOn);
+    User::LeaveIfError(iTs->GetNearestFontToDesignHeightInPixels((CFont*&)iFont, fontSpec));
+    //now check if the font is what we requested
+    if(iFont->FontSpecInTwips().iFontStyle.BitmapType()!=EFourColourBlendGlyphBitmap)
+        {
+        WARN_PRINTF1(_L("Monotype font is not installed, run iType\\binaries\\ityperast.cmd to install it"));
+        User::Leave(KErrNotSupported);
+        }
+    }
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0646
+@SYMTestPriority    High
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+    To ensure that glyph iterator doesn't support outline-and-shadow font
+@SYMTestActions
+    i. Call RFbsGlyphDataIterator::Open() with an outline-and-shadow font.
+
+@SYMTestExpectedResults
+    RFbsGlyphDataIterator::Open() returns KErrNotSupported.
+*/
+void CTFbsGlyphDataOutlineAndShadow::RunTestCaseL(TInt /*aCurTestCase*/)
+    {
+    INFO_PRINTF1(_L("Ensure that glyph iterator doesn't support outline-and-shadow font"));
+    ((CTFbsGlyphDataOutlineAndShadowStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0646"));
+    RFbsGlyphDataIterator iter;
+    const TUint glyphCode = 50;
+    TInt err = iter.Open(*iFont, &glyphCode, 1);
+    TESTE(err == KErrNotSupported, err);
+    iter.Close();
+
+    ((CTFbsGlyphDataOutlineAndShadowStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);//_L("GRAPHICS-FBSERV-0645"));
+    ((CTFbsGlyphDataOutlineAndShadowStep*)iStep)->CloseTMSGraphicsStep();
+    TestComplete();     
+    ((CTFbsGlyphDataOutlineAndShadowStep*)iStep)->RecordTestResultL();
+    }
+
+__CONSTRUCT_STEP__(FbsGlyphDataOutlineAndShadow)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/tfbs/tfbsglyphdataoutlineshadow.h	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,69 @@
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef TFBSGLYPHDATAOUTLINESHADOW_H
+#define TFBSGLYPHDATAOUTLINESHADOW_H
+
+#include "test/TGraphicsHarness.h"
+
+
+/** 
+Enumeration for the attributes to be set in fontspec and gc.
+See CTFbsGlyphDataOutlineAndShadow::ConstructL()
+*/
+enum TFontEffectsFlags
+    {
+    EDropShadowOn = 0x1,
+    EOutlineOn = 0x2,
+    };
+
+/**
+Test class which checks that glyph data extensions 
+RFbsGlyphDataIterator processes and returns correct error if outline-and-shadow
+font is supplied. 
+
+This test must be run with a rasterizer which supports EFourColourBlendGlyphBitmap (e.g. iType)
+otherwise the test will fail.
+
+Negative test
+*/
+class CTFbsGlyphDataOutlineAndShadow : public CTGraphicsBase
+    {
+public:
+    CTFbsGlyphDataOutlineAndShadow(CTestStep* aStep);
+    ~CTFbsGlyphDataOutlineAndShadow();
+protected:
+//from  CTGraphicsBase
+    virtual void RunTestCaseL(TInt aCurTestCase);
+    void ConstructL();
+    
+private:
+    CFbsTypefaceStore* iTs;
+    CFbsFont* iFont;
+   };
+
+class CTFbsGlyphDataOutlineAndShadowStep : public CTGraphicsStep
+    {
+public:
+    CTFbsGlyphDataOutlineAndShadowStep();
+protected:  
+    //from CTGraphicsStep
+    virtual CTGraphicsBase* CreateTestL();
+    };
+
+_LIT(KTFbsGlyphDataOutlineAndShadowStep,"TFbsGlyphDataOutlineAndShadow");
+
+
+#endif /* TFBSGLYPHDATAOUTLINESHADOW_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/tfbs/tfbsglyphdatapanic.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,487 @@
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include <graphics/fbsglyphmetricsarray.h> 
+#include <graphics/fbsglyphdataiterator.h>
+#include "tfbsglyphdatapanic.h"
+
+_LIT(KTypefaceName, "DejaVu Sans Condensed");
+const TInt KNumGlyphCodes = 96;
+
+/*
+Lookup table to convert from ascii code to
+glyph code for the Deja Vu family of fonts.
+ */
+const TUint DejaVuASCIIToGlyphCode[] = 
+    {
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0,   
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 3, 4, 5, 6, 7, 8, 9, 10, 
+    11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 
+    21, 22, 23, 24, 25, 26, 27, 28, 29, 30,     
+    31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+    41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
+    51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 
+    61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
+    71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
+    81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
+    91, 92, 93, 94, 95, 96, 97, 98, 
+    };
+
+CTFbsGlyphDataPanic::CTFbsGlyphDataPanic(CTestStep* aStep):
+    CTGraphicsBase(aStep)
+    {
+    }
+
+CTFbsGlyphDataPanic::~CTFbsGlyphDataPanic()
+    {
+    iSgDriver.Close();
+    if (iTs)
+         {
+         iTs->ReleaseFont(iFont);
+         delete iTs;
+         }
+    }
+
+void CTFbsGlyphDataPanic::ConstructL()
+    {
+    User::LeaveIfNull(iFbs = RFbsSession::GetSession());
+    User::LeaveIfNull(iTs = (CFbsTypefaceStore*)CFbsTypefaceStore::NewL(NULL));
+    User::LeaveIfError(iTs->GetNearestFontToDesignHeightInPixels((CFont*&)iFont, TFontSpec(KTypefaceName, 15)));
+    User::LeaveIfError(iSgDriver.Open());
+    
+    //initialize the array with ASCII characters from 0020 to 007F
+    iGlyphCodes = new(ELeave) TUint[KNumGlyphCodes];
+    for (TInt i = 0; i < KNumGlyphCodes; ++i)
+        {
+        TUint asciiCode = i+0x20; 
+        iGlyphCodes[i] = DejaVuASCIIToGlyphCode[asciiCode];
+        }
+    }
+
+void CTFbsGlyphDataPanic::RunTestCaseL(TInt /*aCurTestCase*/)
+    {
+    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
+    TInt testCase = -1;
+    _LIT(KCaseNumber, "CaseNumber");
+    TEST(iStep->GetIntFromConfig(iStep->ConfigSection(), KCaseNumber, testCase));
+    
+    switch(testCase)
+        {
+    case 1:
+        TestGlyphDataIteratorNotInitializedNext();
+        break;
+    case 2:
+        TestGlyphDataIteratorNotInitializedImage();
+        break;
+    case 3:
+        TestGlyphDataIteratorNotInitializedMetrics();
+        break;
+    case 4:
+        TestGlyphDataIteratorNotInitializedGlyphCode();
+        break;
+    case 5:
+        TestGlyphDataIteratorClosedNext();
+        break;
+    case 6:
+        TestGlyphDataIteratorClosedImage();
+        break;
+    case 7:
+        TestGlyphDataIteratorClosedMetrics();
+        break;
+    case 8:
+        TestGlyphDataIteratorClosedGlyphCode();
+        break;
+    case 9:
+        TestGlyphDataIteratorDiscardUsedFont();
+        break;
+    case 10:
+        TestGlyphMetricsArrayIndexNegative();
+        break;
+    case 11:
+    	TestGlyphMetricsArrayIndexTooHigh();
+        break;
+    case 12:
+    	TestGlyphDataIteratorOpenFailed();
+    	break;
+    default:
+        break;
+        }
+    TEST(EFalse); // shouldn't reach this point as the test will panic at the end of each test case function
+    
+    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
+    ((CTFbsGlyphDataPanicStep*)iStep)->CloseTMSGraphicsStep();
+    TestComplete();     
+    ((CTFbsGlyphDataPanicStep*)iStep)->RecordTestResultL();
+    }
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0651
+@SYMTestPriority    High
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+	To ensure that calling Next() on an unopened iterator will panic.
+
+@SYMTestActions
+	Call Next() on an RFbsGlyphDataIterator instance without opening it.
+
+@SYMTestExpectedResults
+	The call to Next() should panic with GDI 4.
+*/
+void CTFbsGlyphDataPanic::TestGlyphDataIteratorNotInitializedNext()
+    {
+    INFO_PRINTF1(_L("Ensure that Next() operation applied on null iterator will panic"));
+    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0651"));
+    RFbsGlyphDataIterator iter;
+    iter.Next(); //expect to panic here
+    }
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0652
+@SYMTestPriority    High
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+	To ensure that Image() function applied on an unopened iterator will panic.
+
+@SYMTestActions
+	Call Image() on an RFbsGlyphDataIterator instance without opening it.
+
+@SYMTestExpectedResults
+	The call to Image() should panic with GDI 4.
+*/
+void CTFbsGlyphDataPanic::TestGlyphDataIteratorNotInitializedImage()
+    {
+    INFO_PRINTF1(_L("Ensure that Image() operation applied on null iterator will panic"));
+    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0652"));
+    RFbsGlyphDataIterator iter;
+    iter.Image(); //expect to panic here
+    }
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0653
+@SYMTestPriority    High
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+	To ensure that Metrics() function applied on null iterator will panic.
+
+@SYMTestActions
+	Call Metrics() on an RFbsGlyphDataIterator instance without opening it.
+
+@SYMTestExpectedResults
+	The call to Metrics() should panic with GDI 4.
+*/
+void CTFbsGlyphDataPanic::TestGlyphDataIteratorNotInitializedMetrics()
+    {
+    INFO_PRINTF1(_L("Ensure that Metrics() operation applied on null iterator will panic"));
+    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0653"));
+    RFbsGlyphDataIterator iter;
+    iter.Metrics(); //expect to panic here
+    }
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0654
+@SYMTestPriority    High
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+	To ensure that calling GlyphCode() on an unopened iterator will panic.
+
+@SYMTestActions
+	Call GlyphCode() on an RFbsGlyphDataIterator instance without opening it.
+
+@SYMTestExpectedResults
+	The call to GlyphCode() should panic with GDI 4.
+*/
+void CTFbsGlyphDataPanic::TestGlyphDataIteratorNotInitializedGlyphCode()
+    {
+    INFO_PRINTF1(_L("Ensure that GlyphCode() operation applied on null iterator will panic"));
+    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0654"));
+    RFbsGlyphDataIterator iter;
+    iter.GlyphCode(); //expect to panic here
+    }
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0655
+@SYMTestPriority    High
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+	To ensure that calling Next() on an iterator which has been closed will panic.
+
+@SYMTestActions
+	i. Open the glyph data iterator with 1 glyph code.
+	ii. Call Next() to attempt to move the iterator past the end of the array of glyph codes.
+	iii. Call Close() and repeat ii.
+
+@SYMTestExpectedResults
+	The call to Next() should fail with KErrNotFound, signifying the iterator is still open.
+	The final call to Next() should panic with GDI 4.
+*/
+void CTFbsGlyphDataPanic::TestGlyphDataIteratorClosedNext()
+    {
+    INFO_PRINTF1(_L("Ensure that Next() operation applied on iterator which has been closed will panic"));
+    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0655"));
+    RFbsGlyphDataIterator iter;
+    TESTNOERROR(iter.Open(*iFont, iGlyphCodes, 1));
+    TInt iterErr = iter.Next();
+    TESTE(iterErr == KErrNotFound, iterErr);
+    iter.Close();
+    iter.Next(); //expect to panic here
+    }
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0656
+@SYMTestPriority    High
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+	To ensure that calling Image() on an iterator which has been closed will panic.
+
+@SYMTestActions
+	i. Open the glyph data iterator.
+	ii. Close the glyph data iterator.
+	iii. Call Image() on an RFbsGlyphDataIterator instance which has been closed.
+
+@SYMTestExpectedResults
+	The call to Image() should panic with GDI 4.
+*/
+void CTFbsGlyphDataPanic::TestGlyphDataIteratorClosedImage()
+    {
+    INFO_PRINTF1(_L("Ensure that Image() operation applied on iterator which has been closed will panic"));
+    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0656"));
+    RFbsGlyphDataIterator iter;
+    OpenAndCloseIterator(iter);
+    iter.Image(); //expect to panic here
+    }
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0657
+@SYMTestPriority    High
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+	To ensure that calling Metrics() on an iterator which has been closed will panic.
+
+@SYMTestActions
+	i. Open the glyph data iterator.
+	ii. Close the glyph data iterator.
+	iii. Call Metrics() on an RFbsGlyphDataIterator instance which has been closed.
+
+@SYMTestExpectedResults
+	The call to Metrics() should panic with GDI 4.
+*/
+void CTFbsGlyphDataPanic::TestGlyphDataIteratorClosedMetrics()
+    {
+    INFO_PRINTF1(_L("Ensure that Metrics()operation applied on iterator which has been closed will panic"));
+    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0657"));
+    RFbsGlyphDataIterator iter;
+    OpenAndCloseIterator(iter);
+    iter.Metrics(); //expect to panic here
+    }
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0658
+@SYMTestPriority    High
+@SYMTestType        UT
+@SYMTestStatus      In development
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+	To ensure that calling GlyphCode() on an iterator which has been closed will panic.
+
+@SYMTestActions
+	i. Open the glyph data iterator.
+	ii. Close the glyph data iterator.
+	iii. Call GlyphCode() on an RFbsGlyphDataIterator instance which has been closed.
+
+@SYMTestExpectedResults
+	The call to GlyphCode() should panic with GDI 4.
+*/
+void CTFbsGlyphDataPanic::TestGlyphDataIteratorClosedGlyphCode()
+    {
+    INFO_PRINTF1(_L("Ensure that GlyphCode() operation applied on iterator which has been closed will panic"));
+    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0658"));
+    RFbsGlyphDataIterator iter;
+    OpenAndCloseIterator(iter);
+    iter.GlyphCode(); //expect to panic here
+    }
+
+// the function opens and then closes an iterator
+void CTFbsGlyphDataPanic::OpenAndCloseIterator(RFbsGlyphDataIterator& aIterator) 
+    {
+    TESTNOERROR(aIterator.Open(*iFont, iGlyphCodes, 1));
+    aIterator.Close();
+    }
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0647
+@SYMTestPriority    High
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+	To ensure that attempting to use an invalid Font handle will cause a panic when iterating through an RFbsGlyphDataIterator. 
+
+@SYMTestActions
+	i. Open the glyph data iterator.
+	ii. Release the font associated with the iterator.
+	iii. Attempt to use invalid Font handle by iterating through the iterator.
+
+@SYMTestExpectedResults
+	The call to Next() after the associated Font has been released should cause panic FBSERV -8 when the invalid Font handle is passed to FBServ.
+*/
+void CTFbsGlyphDataPanic::TestGlyphDataIteratorDiscardUsedFont()
+    {
+    INFO_PRINTF1(_L("Ensure that attempting to use an invalid Font handle will cause a panic when iterating through an RFbsGlyphDataIterator"));
+    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0647"));
+    
+    RFbsGlyphDataIterator iter;
+    TESTNOERROR(iter.Open(*iFont, iGlyphCodes, KNumGlyphCodes));
+    iTs->ReleaseFont(iFont);
+    
+    for (TInt i = 0; i < KNumGlyphCodes; i++)
+        {
+        //should panic when attempt is made to use invalid Font handle
+        iter.Next();
+        }
+
+    iter.Close(); //shouldn't reach this line. If for some reason the code doesn't panic test should fail.
+    TEST(EFalse);  
+    }
+    
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0648
+@SYMTestPriority    High
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+	To ensure that accessing the glyph metrics entry with negative index will cause a panic.
+
+@SYMTestActions
+	i. Retrieve glyph metrics array.
+	ii. Try to access glyph metrics entry with a negative index.
+
+@SYMTestExpectedResults
+	Should panic with GDI 5.
+*/
+void CTFbsGlyphDataPanic::TestGlyphMetricsArrayIndexNegative()
+    {
+    INFO_PRINTF1(_L("Ensure that accessing the glyph metrics entry with negative index will cause a panic"));
+    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0648"));
+    RFbsGlyphMetricsArray glyphMetricsArray;
+
+    // Retrieve list of metrics
+    TESTNOERROR(glyphMetricsArray.Get(*iFont, iGlyphCodes, 2));
+    TEST(2 == glyphMetricsArray.Count());
+    glyphMetricsArray[-1];
+    }
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0649
+@SYMTestPriority    High
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+	To ensure that accessing the glyph metrics entry with an index greater than number
+	of elements in array will cause a panic.
+
+@SYMTestActions
+	i. Retrieve a glyph metrics array with total number of elements equals 2 
+	ii. Try to access glyph metrics entry with index equals 2.
+
+@SYMTestExpectedResults
+	Should panic with GDI 5.
+*/
+void CTFbsGlyphDataPanic::TestGlyphMetricsArrayIndexTooHigh()
+    {
+    INFO_PRINTF1(_L("Ensure that accessing the glyph metrics entry with index greater than number of elemnets in array will cause a panic"));
+    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0649"));
+    RFbsGlyphMetricsArray glyphMetricsArray;
+
+    // Retrieve list of metrics
+    TESTNOERROR(glyphMetricsArray.Get(*iFont, iGlyphCodes, 2));
+    TEST(2 == glyphMetricsArray.Count());
+    glyphMetricsArray[2]; //expect to panic here as index varies 0..1
+    }
+
+/**
+@SYMTestCaseID      GRAPHICS-FBSERV-0667
+@SYMTestPriority    High
+@SYMTestType        UT
+@SYMTestStatus      Implemented
+@SYMPREQ            PREQ2678
+
+@SYMTestCaseDesc
+	To ensure that if RFbsGlyphDataIterator::Open() fails, it is still in the closed state
+	and cannot be used.
+
+@SYMTestActions
+	i. Open an RFbsGlyphDataIterator on a font.  
+	ii. Attempt to open a second RFbsGlyphDataIterator on the same font.
+	ii. Attempt to use the properties of the iterator.
+
+@SYMTestExpectedResults
+	The call to GlyphCode() should panic with FBSCLI 31 since the iterator should be in a closed state.
+*/
+void CTFbsGlyphDataPanic::TestGlyphDataIteratorOpenFailed()
+	{
+    INFO_PRINTF1(_L("Ensure that if RFbsGlyphDataIterator::Open() fails, it is still in the closed state and cannot be used"));
+    ((CTFbsGlyphDataPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0667"));
+   
+    CFbsFont* bitmapFont = NULL;
+    TInt err = iTs->GetNearestFontToDesignHeightInPixels((CFont*&)bitmapFont, TFontSpec(_L("Digital"), 14));
+    TESTNOERROR(err);
+    TEST(!bitmapFont->IsOpenFont());
+    
+    RFbsGlyphDataIterator iter;
+    err = iter.Open(*bitmapFont, iGlyphCodes, 2);
+    TEST(err == KErrNotSupported);
+        
+    iter.GlyphCode(); // Should panic here as iter should be closed.
+    TEST(EFalse);     //shouldn't reach this line. If for some reason the code doesn't panic test should fail.
+    
+	}
+//--------------
+__CONSTRUCT_STEP__(FbsGlyphDataPanic)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/tfbs/tfbsglyphdatapanic.h	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,74 @@
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef TFBSGLYPHDATAPANIC_H
+#define TFBSGLYPHDATAPANIC_H
+
+#include <sgresource/sgresource.h>
+#include "test/TGraphicsHarness.h"
+class RFbsGlyphDataIterator;
+
+/**
+Test class which exercises all panics for the glyph data extensions 
+RFbsGlyphDataIterator and RFbsGlyphMetricsArray. 
+Negative tests
+*/
+class CTFbsGlyphDataPanic : public CTGraphicsBase
+    {
+public:
+    CTFbsGlyphDataPanic(CTestStep* aStep);
+    ~CTFbsGlyphDataPanic();
+protected:
+//from  CTGraphicsBase
+    virtual void RunTestCaseL(TInt aCurTestCase);
+    void ConstructL();
+    
+//test cases
+    void TestGlyphDataIteratorNotInitializedNext();
+    void TestGlyphDataIteratorNotInitializedImage();
+    void TestGlyphDataIteratorNotInitializedMetrics();
+    void TestGlyphDataIteratorNotInitializedGlyphCode();
+    void TestGlyphDataIteratorClosedNext();
+    void TestGlyphDataIteratorClosedImage();
+    void TestGlyphDataIteratorClosedMetrics();
+    void TestGlyphDataIteratorClosedGlyphCode();
+    void TestGlyphDataIteratorDiscardUsedFont();
+    void TestGlyphMetricsArrayIndexNegative();
+    void TestGlyphMetricsArrayIndexTooHigh();
+    void TestGlyphDataIteratorOpenFailed();
+
+    //helper function
+    void OpenAndCloseIterator(RFbsGlyphDataIterator& aIterator); // the function opens and then closes an iterator
+private:
+    RFbsSession* iFbs;
+    CFbsTypefaceStore* iTs;
+    CFbsFont* iFont;
+    RSgDriver iSgDriver;
+    TUint* iGlyphCodes;
+   };
+
+class CTFbsGlyphDataPanicStep : public CTGraphicsStep
+    {
+public:
+    CTFbsGlyphDataPanicStep();
+protected:  
+    //from CTGraphicsStep
+    virtual CTGraphicsBase* CreateTestL();
+    };
+
+_LIT(KTFbsGlyphDataPanicStep,"TFbsGlyphDataPanic");
+
+
+#endif /* TFBSGLYPHDATAPANIC_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/tfbs/tfbsoogm.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,370 @@
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: Test the operation of the Font and Bitmap Server's GOoM plug-in
+//
+
+
+#include <gdi.h>
+#include "tfbsoogm.h"
+
+
+
+const TInt KTFbsOogmFrameworkPause = 500000; // How long does this need to be in order to be reliable?
+const TInt KTFbsOogmImageSizeX = 2048;
+const TInt KTFbsOogmImageSizeY = 2048;
+
+
+void CTFbsOogm::RunTestCaseL( TInt aCurTestCase )
+    {
+    ( (CTFbsOogmStep*)iStep )->SetTestStepID( KUnknownSYMTestCaseIDName );
+
+    switch( aCurTestCase )
+        {
+    case 1:
+        ( (CTFbsOogmStep*)iStep )->SetTestStepID( _L("GRAPHICS-FBSERV-0675") );
+
+        CacheClearanceAndLimitAdjustments();
+        break;
+
+    default:
+        ( (CTFbsOogmStep*)iStep )->SetTestStepID( KNotATestSYMTestCaseIDName );
+        ( (CTFbsOogmStep*)iStep )->CloseTMSGraphicsStep();
+        TestComplete();
+
+        break;
+        }
+
+    ( (CTFbsOogmStep*)iStep )->RecordTestResultL();
+
+    }
+
+
+
+/**
+ 	@SYMTestCaseID
+	GRAPHICS-FBSERV-0675
+
+	@SYMTestCaseDesc
+	Tests the operation of Font and Bitmap server's  Out-Of-Graphics-Memory plugin.
+	ie Ensure that the hardware glyph cache is cleared in response to a low graphics 
+	memory notification, and that the cache's maximum size limit is reduced.
+
+
+	@SYMTestActions
+	Acquire the glyph cache's usage and other metrics.
+	
+	Populate the glyph-cache.
+
+	Acquire the glyph-cache's usage and other metrics.
+
+	Precipitate an Out-of-Graphics-Memory condition, triggering the GOOM monitor.
+
+	Acquire the glyph cache's usage and other metrics.
+
+	Ensure the glyph-cache has been cleared and its maximum limit reduced.
+
+	Precipitate a MemoryGood() call from the GOoM framework.
+
+	Establish that the cache-size limit has been reinstated.
+
+	@SYMTestExpectedResults
+    The glyph-cache should be cleared in response to OoGM condition and its upper limit reduced.
+
+    The Glyph-cache's upper limit should be reinstated in response to a memory-good notification.
+ */
+void CTFbsOogm::CacheClearanceAndLimitAdjustments()
+    {
+    __UHEAP_MARK;
+
+    RArray <RSgImage> sgImageArray;
+    RSgDriver sgDriver;
+    TInt err = sgDriver.Open();
+
+    if( KErrNone != err )
+        {
+		TEST( KErrNone == err );
+		INFO_PRINTF2( _L("SgDriver Open() returned error %d"), err );
+
+        return;
+        }
+
+    if( (NULL == RFbsSession::GetSession()) )
+         {
+        if( KErrNone != RFbsSession::Connect() )
+            {
+ 			TEST( -1 );
+			INFO_PRINTF1(_L("Failed to connect to FbServ"));
+
+            goto CleanupAndGo;
+            }
+         }
+
+
+	// Establish the initial condition of the glyph-cache.
+    TGlyphCacheMetrics initialGlyphCacheMetrics;
+    err = RFbsSession::GetSession()->GetGlyphCacheMetrics( initialGlyphCacheMetrics );
+    if( KErrNone != err )
+        {
+		TEST( KErrNone == err );
+		INFO_PRINTF2( _L("GetGlyphCacheMetrics() returned error %d"), err );
+
+        goto CleanupAndGo;
+        }
+
+	// Check that initial conditions are as expected.
+    // There was a test here for a cache-size of zero, but this was felt to be a hazardous assumption.
+	TEST( initialGlyphCacheMetrics.iGpuCacheSizeLimitIsMax );
+    INFO_PRINTF4( _L("Initial iMaxCacheSizeInBytes %d iCacheSizeInBytes %d iGpuCacheSizeLimitIsMax %d "),
+                      initialGlyphCacheMetrics.iMaxCacheSizeInBytes,
+                      initialGlyphCacheMetrics.iCacheSizeInBytes,
+                      initialGlyphCacheMetrics.iGpuCacheSizeLimitIsMax );
+
+
+    TRAP( err, UseGpuL() ); // Populate the glyph cache then acquire its usage metrics.
+    if( KErrNone != err )
+        {
+        TEST( KErrNone == err );
+        INFO_PRINTF2( _L("UseGpuL() left with %d"), err );
+
+        goto CleanupAndGo;
+        }
+
+
+    TGlyphCacheMetrics usageGlyphCacheMetrics;
+    err = RFbsSession::GetSession()->GetGlyphCacheMetrics( usageGlyphCacheMetrics );
+    if( KErrNone != err )
+        {
+		TEST( KErrNone == err );
+		INFO_PRINTF2( _L("GetGlyphCacheMetrics() returned %d"), err );
+
+        goto CleanupAndGo;
+        }
+
+    // Check that the glyph cache has been populated
+    TEST( usageGlyphCacheMetrics.iCacheSizeInBytes > initialGlyphCacheMetrics.iCacheSizeInBytes);
+    TEST( usageGlyphCacheMetrics.iGpuCacheSizeLimitIsMax );
+    INFO_PRINTF4( _L("Usage iMaxCacheSizeInBytes %d iCacheSizeInBytes %d iGpuCacheSizeLimitIsMax %d "),
+                       usageGlyphCacheMetrics.iMaxCacheSizeInBytes,
+                       usageGlyphCacheMetrics.iCacheSizeInBytes,
+                       usageGlyphCacheMetrics.iGpuCacheSizeLimitIsMax );
+
+
+
+    // Precipitate the GOoM framework's call into the Plug-in's FreeRam() method.
+    err = FillGraphicsMemoryWithImages( TSize(KTFbsOogmImageSizeX, KTFbsOogmImageSizeY), sgImageArray );
+    if( KErrNoGraphicsMemory != err )
+        {
+		TEST( KErrNoGraphicsMemory == err );
+		INFO_PRINTF2( _L("FillGraphicsMemoryWithImages() returned %d"), err );
+
+        goto CleanupAndGo;
+        }
+
+	// Await the GOOM framework's call into FbServ's OoGM plugin,
+    // then establish the cache's usage and other metrics.
+    User::After( KTFbsOogmFrameworkPause );
+    TGlyphCacheMetrics postOogmGlyphCacheMetrics;
+    err = RFbsSession::GetSession()->GetGlyphCacheMetrics( postOogmGlyphCacheMetrics );
+
+    if( KErrNone != err )
+        {
+		TEST( KErrNone == err );
+		INFO_PRINTF2( _L("GetGlyphCacheMetrics() returned %d"), err );
+
+        goto CleanupAndGo;
+        }
+
+    // The cache should have been cleared and the maximum size limit reduced.
+    TEST( 0 == postOogmGlyphCacheMetrics.iCacheSizeInBytes );
+    TEST( !postOogmGlyphCacheMetrics.iGpuCacheSizeLimitIsMax );
+    INFO_PRINTF4( _L("Post-Oogm iMaxCacheSizeInBytes %d iCacheSizeInBytes %d iGpuCacheSizeLimitIsMax %d "),
+                        postOogmGlyphCacheMetrics.iMaxCacheSizeInBytes,
+                        postOogmGlyphCacheMetrics.iCacheSizeInBytes,
+                        postOogmGlyphCacheMetrics.iGpuCacheSizeLimitIsMax );
+
+
+
+   // Remove the images. This should provoke a GOoM monitor call into the plug-in's MemoryGood().
+    for ( TInt i = sgImageArray.Count()-1; i >= 0; --i )
+        {
+        sgImageArray[i].Close();
+        }
+    sgImageArray.Reset();
+
+    // Await activity from the GOoM monitor
+    User::After( KTFbsOogmFrameworkPause );
+    TGlyphCacheMetrics reinstatedGlyphCacheMetrics;
+    err = RFbsSession::GetSession()->GetGlyphCacheMetrics( reinstatedGlyphCacheMetrics );
+    if( KErrNone != err )
+        {
+        TEST( KErrNone == err );
+        INFO_PRINTF2( _L("GetGlyphCacheMetrics() returned error %d"), err );
+
+        goto CleanupAndGo;
+        }
+
+    // Cache size limit should have been increased
+    TEST( reinstatedGlyphCacheMetrics.iGpuCacheSizeLimitIsMax );
+    INFO_PRINTF4( _L("After Mem Clear iMaxCacheSizeInBytes %d iCacheSizeInBytes %d iGpuCacheSizeLimitIsMax %d "),
+                      reinstatedGlyphCacheMetrics.iMaxCacheSizeInBytes,
+                      reinstatedGlyphCacheMetrics.iCacheSizeInBytes,
+                      reinstatedGlyphCacheMetrics.iGpuCacheSizeLimitIsMax );
+
+
+
+  CleanupAndGo:
+    // Release any images before closing the array.
+    // If the test was successful this should already be empty.
+    for (TInt i = sgImageArray.Count()-1; i >= 0; --i)
+        {
+        sgImageArray[i].Close();
+        }
+
+    // Allow GOoM to make any pending adjustments before proceeding with any further tests.
+    User::After( KTFbsOogmFrameworkPause );
+    sgImageArray.Close();
+    sgDriver.Close();
+
+    __UHEAP_MARKEND;
+    }
+
+
+
+CTFbsOogm::CTFbsOogm( CTestStep* aStep )
+: CTGraphicsBase(aStep)
+    {
+    }
+
+
+
+const TInt KNumGlyphCodesLatin = 96;
+/*
+ Lookup table to convert from ascii code to
+glyph code for the Deja Vu family of fonts.
+ */
+const TUint DejaVuASCIIToGlyphCode[] =
+    {
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 3, 4, 5, 6, 7, 8, 9, 10,
+    11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
+    21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
+    31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+    41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
+    51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
+    61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
+    71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
+    81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
+    91, 92, 93, 94, 95, 96, 97, 98,
+    };
+
+
+
+void CTFbsOogm::ConstructL()
+    {
+    }
+
+
+CTFbsOogm::~CTFbsOogm()
+    {
+    RFbsSession::Disconnect();
+    }
+
+
+
+/**
+ Utility function to fill the GPU memory.
+ */
+TInt CTFbsOogm::FillGraphicsMemoryWithImages( const TSize& aSize, RArray<RSgImage>& aImages )
+    {
+    TInt err = KErrNone;
+
+    // Loop should terminate with KErrNoGraphicsMemory
+    while( KErrNone == err )
+        {
+        RSgImage sgImage;
+        err = sgImage.Create( TSgImageInfo(aSize, ESgPixelFormatA_8, ESgUsageBitOpenVgImage) );
+        if( KErrNone == err )
+            {
+            err = aImages.Append( sgImage );
+            }
+        }
+
+    INFO_PRINTF2( _L("Images created %d"), aImages.Count() );
+    return err;
+    }
+
+
+
+/**
+ Utility function to populate the GPU with typeface glyphs.
+ */
+void CTFbsOogm::UseGpuL()
+    {
+    _LIT( KTKASTypefaceName, "DejaVu Sans Condensed" );
+
+    // Need to open one of these "in the context" of this process in order
+    // to manipulate RSgImages. Even though we are only calling 'Open', 'Next' and 'Close' on
+    // RFbsGlyphDataIterator
+    RSgDriver sgDriver;
+    User::LeaveIfError( sgDriver.Open() );
+
+    // CFbsTypefaceStore seems to need an fbserv session open.
+    if( (NULL == RFbsSession::GetSession()) )
+     {
+     User::LeaveIfError( RFbsSession::Connect() );
+     }
+
+    TUint* glyphCodesLatin = new(ELeave) TUint[ KNumGlyphCodesLatin ];
+
+    for ( TInt ii = 0; ii < KNumGlyphCodesLatin; ++ii )
+        {
+        TUint asciiCode = ii+0x20; // ASCII characters from 0020 to 007F
+        glyphCodesLatin[ii] = DejaVuASCIIToGlyphCode[asciiCode];
+        }
+
+    iTs = ( CFbsTypefaceStore* )CFbsTypefaceStore::NewL( NULL );
+    User::LeaveIfError( iTs->GetNearestFontToDesignHeightInPixels((CFont*&)iFont, TFontSpec(KTKASTypefaceName, 15)) );
+
+    TInt iterErr = KErrNone;
+    TInt iterNextErr = KErrNone;
+
+    for( TInt arraySize = 1; (arraySize < KNumGlyphCodesLatin) && (iterErr == KErrNone); ++arraySize )
+        {
+        RFbsGlyphDataIterator iter;
+        iterErr = iter.Open( *iFont, glyphCodesLatin, arraySize );
+
+        if( KErrNone != iterErr )
+            {
+            continue;
+            }
+
+          for ( TInt index = 0; KErrNone == iterNextErr; iterNextErr = iter.Next(), ++index )
+              {
+              // Iterating through the glyphs should introduce them into the cache
+             if(iter.GlyphCode() != glyphCodesLatin[index])
+                {
+                 INFO_PRINTF4( _L("Wanted glyphcode %d, got %d"), arraySize, glyphCodesLatin[index], iter.GlyphCode() );
+                }
+              }
+
+        iterNextErr = KErrNone;
+        iter.Close();
+        }
+
+    sgDriver.Close();
+    }
+
+
+__CONSTRUCT_STEP__( FbsOogm )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/tfbs/tfbsoogm.h	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,75 @@
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef TFBSOOGM_H
+#define TFBSOOGM_H
+#include <EGL/egl.h>
+
+#include <e32cmn.h>
+#include <EGL/eglext.h>
+#include <VG/openvg.h>
+#include <sgresource/sgresource.h>
+#include <sgresource/sgimage.h>
+#include <graphics/fbsglyphdataiterator.h>
+#include "FbsMessage.h"
+
+#include "test/TGraphicsHarness.h"
+
+
+/**
+Test class for the GPU 'Out of Graphics Memory' (OoGM) plug-in
+
+Hardware only as the GoomMonitor framework does not operate under WINSCW
+*/
+class CTFbsOogm : public CTGraphicsBase
+    {
+public:
+    CTFbsOogm( CTestStep* aStep );
+    ~CTFbsOogm();
+protected:
+    //from  CTGraphicsBase
+    virtual void RunTestCaseL( TInt aCurTestCase );
+    void ConstructL();
+
+private:
+    // Test Cases
+    void CacheClearanceAndLimitAdjustments();
+
+private:
+    void UseGpuL();
+    TInt FillGraphicsMemoryWithImages( const TSize& aSize, RArray<RSgImage>& aImages );
+
+private:
+    CFbsFont* iFont;
+    CFbsTypefaceStore* iTs;
+    };
+
+
+
+class CTFbsOogmStep : public CTGraphicsStep
+    {
+public:
+    CTFbsOogmStep();
+
+protected:
+    //from CTGraphicsStep
+    virtual CTGraphicsBase* CreateTestL();
+    };
+
+_LIT( KTFbsOogmStep,"TFbsOogm" );
+
+
+
+#endif // TFBSOOGM_H
--- a/fbs/fontandbitmapserver/tfbs/tfonttableandglyph.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/tfbs/tfonttableandglyph.h	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -17,7 +17,7 @@
 #define TFONTTABLEANDGLYPH_H_
 
 #include <gdi.h>
-#include "TGraphicsHarness.h"
+#include "test/TGraphicsHarness.h"
 
 class CTFontAndGlyphStep : public CTGraphicsStep
     {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/tfbs/tglyphatlas.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,284 @@
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+/**
+ @file
+ @internalComponent - Internal Symbian test code
+*/
+
+#include "tglyphatlas.h"
+#include "TFBS.H"
+#include "glyphatlastestwrapper.h"
+
+_LIT(KTypefaceName, "DejaVu Sans Condensed");
+_LIT(KMonoTypefaceName, "DejaVu Sans Mono");
+const TInt KNumGlyphCodesLatin = 96;
+
+
+CTGlyphAtlas::CTGlyphAtlas(CTestStep* aStep):
+	CTGraphicsBase(aStep),
+	iFbs(NULL),
+	iTs(NULL),
+	iGlyphCodesLatin(NULL),
+	iFont(NULL)
+	{
+	}
+
+void CTGlyphAtlas::ConstructL()
+	{
+	iFbs = RFbsSession::GetSession();
+	iTs = (CFbsTypefaceStore*)CFbsTypefaceStore::NewL(NULL);
+	User::LeaveIfError(iTs->GetNearestFontToDesignHeightInPixels((CFont*&)iFont, TFontSpec(KTypefaceName, 15)));
+	User::LeaveIfError(iTs->GetNearestFontToDesignHeightInPixels((CFont*&)iFont2, TFontSpec(KMonoTypefaceName, 8)));
+	
+	iGlyphCodesLatin = new(ELeave) TUint[KNumGlyphCodesLatin];
+	for (TInt ii = 0; ii < KNumGlyphCodesLatin; ++ii)
+		{
+		iGlyphCodesLatin[ii] = ii+32; // ASCII characters from 0020 to 007F
+		}
+
+	INFO_PRINTF1(_L("FBSERV Glyph Atlas Testing"));
+	}
+
+CTGlyphAtlas::~CTGlyphAtlas()
+	{
+	if (iTs)
+		{
+		iTs->ReleaseFont(iFont);
+		}
+	delete iTs;
+	delete[] iGlyphCodesLatin;
+	}
+
+void CTGlyphAtlas::RunTestCaseL(TInt aCurTestCase)
+	{
+	((CTGlyphAtlasStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
+	switch(aCurTestCase)
+		{
+	case 1:
+		((CTGlyphAtlasStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0663"));
+		TestFullCache();
+		break;
+	case 2:
+		((CTGlyphAtlasStep*)iStep)->SetTestStepID(_L("GRAPHICS-FBSERV-0664"));
+		TestFontReleased();
+		break;
+	default:
+		((CTGlyphAtlasStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
+		((CTGlyphAtlasStep*)iStep)->CloseTMSGraphicsStep();
+		TestComplete();		
+		break;
+		}
+	((CTGlyphAtlasStep*)iStep)->RecordTestResultL();
+	}
+
+/**
+@SYMTestCaseID		GRAPHICS-FBSERV-0663
+@SYMTestPriority	High
+@SYMTestType		UT
+@SYMTestStatus		Implemented
+@SYMPREQ			PREQ2678
+
+@SYMTestCaseDesc
+	Shows that when the glyph atlas reaches its memory limit, any new added 
+	glyphs will cause the eviction of the least recently used glyphs.
+	The new glyph will be added successfully.
+
+@SYMTestActions
+	i. Create a glyph atlas with a memory limit of 1000 bytes.
+	ii. Add glyphs to the atlas such that its memory consumption reaches the limit.
+	iii. Add one more glyph.
+	iv. Call CGlyphAtlas::GetGlyph() for the last glyph added.
+	v. Call CGlyphAtlas::GetGlyph() for the least recently used glyphs to check 
+		that it has been evicted.
+	vi. Delete glyph atlas
+
+@SYMTestExpectedResults
+	Each glyph is added successfully.
+	CGlyphAtlas::GetGlyph() returns KErrNone for the last glyph added.
+	CGlyphAtlas::GetGlyph() returns KErrNotFound for the least recently used glyph.
+*/
+void CTGlyphAtlas::TestFullCache()
+	{
+	INFO_PRINTF1(_L("Test full cache eviction"));
+
+	__UHEAP_MARK;
+	// Fill cache up using expected size of glyph using AddGlyph.
+	const TInt KMaxAtlasSizeInBytes = 1000;
+	CGlyphAtlasTestWrapper* atlas = NULL;
+	TRAPD(ret, atlas = CGlyphAtlasTestWrapper::NewL(KMaxAtlasSizeInBytes));
+	TESTNOERROR(ret);
+	if (KErrNone != ret)
+		{
+		return;
+		}
+	TOpenFontCharMetrics charMetrics;
+	TGlyphImageInfo imageInfo;
+	TSize bitmapSize;
+	const TUint8* bitmapData = NULL;
+	TInt glyphIndex = 0;
+	TBool atlasFull = EFalse;
+	CBitmapFont* bmFont = CTFbsFont::FontAddress(iFont);
+	// Fill up atlas by adding glyphs.
+	// Next glyph shold tip the atlas over the memory limit.
+	// Glyphs are added in ascending glyph code order.
+	// Leave at least one glyph so that we can guarantee that we can add one more unique glyph.
+	while (glyphIndex < KNumGlyphCodesLatin-1 && !atlasFull)
+		{
+		iFont->GetCharacterData(iGlyphCodesLatin[glyphIndex], charMetrics, bitmapData, bitmapSize);
+		TInt sizeInBytes = charMetrics.Height() * charMetrics.Width();
+		if (atlas->SizeInBytes() + sizeInBytes <= KMaxAtlasSizeInBytes)
+			{
+			CGlyphAtlas::TAddGlyphArgs args(bitmapData, iGlyphCodesLatin[glyphIndex++], charMetrics);
+			TESTNOERROR(atlas->AddGlyph(*bmFont, args, imageInfo));
+			}
+		else
+			{
+			atlasFull = ETrue;
+			}
+		}
+	TEST(atlasFull);
+
+	// check least recently used page contains the first glyph in glyph codes
+	TUint leastUsedGlyphCode = iGlyphCodesLatin[0];
+	TEST(atlas->LruPageContainsGlyph(leastUsedGlyphCode));
+
+	// To ensure that the test does not pass if a FIFO eviction policy occurs,
+	// get the least recently used glyph so that it is moved internally.
+	TESTNOERROR(atlas->GetGlyph(*bmFont, leastUsedGlyphCode, imageInfo));
+
+	// glyphIndex, bitmapData and charMetrics now current for next glyph which 
+	// will take the atlas over the cache limit.
+	CGlyphAtlas::TAddGlyphArgs args(bitmapData, iGlyphCodesLatin[glyphIndex], charMetrics);
+	TESTNOERROR(atlas->AddGlyph(*bmFont, args, imageInfo));
+
+	// check that searching for most recently added glyph is successful
+	TGlyphImageInfo newInfo;
+	TESTNOERROR(atlas->GetGlyph(*bmFont, iGlyphCodesLatin[glyphIndex], newInfo));
+
+	// check atlas size is still under the limit
+	TEST(atlas->SizeInBytes() <= KMaxAtlasSizeInBytes);
+
+	// check that the pages which were evicted contained the least used glyphs
+	// i.e. searching for these returns KErrNotFound
+	TInt err = KErrNotFound;
+	TInt index = 1;
+	for (; KErrNotFound == err && index <= glyphIndex; ++index)
+		{
+		err = atlas->GetGlyph(*bmFont, iGlyphCodesLatin[index], newInfo);
+		}
+	TESTNOERROR(err);
+	// first found glyph should be greater than glyph at index 1
+	TEST(index-1 > 1);
+	
+	// check that the remaining pages contained the least used glyphs
+	for (; index <= glyphIndex; ++index)
+		{
+		TESTNOERROR(atlas->GetGlyph(*bmFont, iGlyphCodesLatin[index], newInfo));
+		}
+
+	delete atlas;
+	__UHEAP_MARKEND;
+	}
+
+
+/**
+@SYMTestCaseID		GRAPHICS-FBSERV-0664
+@SYMTestPriority	High
+@SYMTestType		UT
+@SYMTestStatus		Implemented
+@SYMPREQ			PREQ2678
+
+@SYMTestCaseDesc
+	Shows that CGlyphAtlas::FontReleased() does actually delete all the glyphs 
+	associated with the released font and leaves glyphs associated with other 
+	fonts untouched.
+
+@SYMTestActions
+	i. Create a glyph atlas with no memory limit.
+	ii. Add glyphs for two different fonts to the atlas.
+	iii. Check all glyphs for both fonts were successfully added.
+	iv. Call CGlyphAtlas::ReleaseFont for one of the fonts.
+	v. Check that there are no glyphs associated with the released font.
+	vi. Call CGlyphAtlas::ReleaseFont for the remaining font.
+	vii Check that there are no glyphs associated with the released font and 
+		that the atlas is empty.
+	viii Delete the glyph atlas.
+	
+@SYMTestExpectedResults
+	After each font is released, there are no glyphs associated with that font 
+	left in the atlas.
+*/
+void CTGlyphAtlas::TestFontReleased()
+	{
+	INFO_PRINTF1(_L("Test behaviour of CGlyphAtlas::FontReleased()"));
+
+	__UHEAP_MARK;
+	CGlyphAtlasTestWrapper* atlas = NULL;
+	TRAPD(ret, atlas = CGlyphAtlasTestWrapper::NewL(KGlyphAtlasNoCacheLimit));
+	TESTNOERROR(ret);
+	if (KErrNone != ret)
+		{
+		return;
+		}
+	TOpenFontCharMetrics charMetrics;
+	TGlyphImageInfo imageInfo;
+	TSize bitmapSize;
+	const TUint8* bitmapData = NULL;
+	CBitmapFont* bmFont = CTFbsFont::FontAddress(iFont);
+	CBitmapFont* bmFont2 = CTFbsFont::FontAddress(iFont2);
+	for (TInt glyphIndex = 0; glyphIndex < KNumGlyphCodesLatin; ++glyphIndex)
+		{
+		iFont->GetCharacterData(iGlyphCodesLatin[glyphIndex], charMetrics, bitmapData, bitmapSize);
+		CGlyphAtlas::TAddGlyphArgs args(bitmapData, iGlyphCodesLatin[glyphIndex], charMetrics);
+		TESTNOERROR(atlas->AddGlyph(*bmFont, args, imageInfo));
+
+		iFont2->GetCharacterData(iGlyphCodesLatin[KNumGlyphCodesLatin-1-glyphIndex], charMetrics, bitmapData, bitmapSize);
+		CGlyphAtlas::TAddGlyphArgs args2(bitmapData, iGlyphCodesLatin[glyphIndex], charMetrics);
+		TESTNOERROR(atlas->AddGlyph(*bmFont2, args2, imageInfo));
+		}
+	// check there are font entries for these 2 fonts
+	TEST(2 == atlas->FontCount());
+
+	// check actual number of glyphs in atlas for each font is as expected
+	TEST(KNumGlyphCodesLatin == atlas->GlyphCountByFont(bmFont));
+	TEST(KNumGlyphCodesLatin == atlas->GlyphCountByFont(bmFont2));
+	TEST(2*KNumGlyphCodesLatin == atlas->GlyphCount());
+
+	// release one font and check number of glyphs in atlas for each font 
+	// is as expected
+	atlas->FontReleased(*bmFont);
+	TEST(1 == atlas->FontCount());
+	TEST(0 == atlas->GlyphCountByFont(bmFont));
+	TEST(KNumGlyphCodesLatin == atlas->GlyphCountByFont(bmFont2));
+	TEST(KNumGlyphCodesLatin == atlas->GlyphCount());
+
+	// release one font and check number of glyphs in atlas for each font 
+	// is as expected
+	atlas->FontReleased(*bmFont2);
+	TEST(0 == atlas->FontCount());
+	TEST(0 == atlas->GlyphCountByFont(bmFont));
+	TEST(0 == atlas->GlyphCountByFont(bmFont2));
+	TEST(0 == atlas->GlyphCount());
+
+	delete atlas;
+
+	__UHEAP_MARKEND;
+	}
+
+
+
+//--------------
+__CONSTRUCT_STEP__(GlyphAtlas)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/tfbs/tglyphatlas.h	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,60 @@
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#ifndef TGLYPHATLAS_H
+#define TGLYPHATLAS_H
+
+#include "test/TGraphicsHarness.h"
+
+/**
+Test class for the glyph data extensions RFbsGlyphDataIterator and 
+RFbsGlyphMetricsArray. Positive and negative tests
+*/
+class CTGlyphAtlas : public CTGraphicsBase
+	{
+public:
+	CTGlyphAtlas(CTestStep* aStep);
+	~CTGlyphAtlas();
+protected:
+//from 	CTGraphicsBase
+	virtual void RunTestCaseL(TInt aCurTestCase);
+	void ConstructL();
+	
+private:
+	// Test Cases
+	void TestFullCache();
+	void TestFontReleased();
+	
+private:
+	RFbsSession* iFbs;
+	CFbsTypefaceStore* iTs;
+	TUint* iGlyphCodesLatin;
+	CFbsFont* iFont;
+	CFbsFont* iFont2;
+	};
+
+
+class CTGlyphAtlasStep : public CTGraphicsStep
+	{
+public:
+	CTGlyphAtlasStep();
+protected:	
+	//from CTGraphicsStep
+	virtual CTGraphicsBase* CreateTestL();
+	};
+
+_LIT(KTGlyphAtlasStep,"TGlyphAtlas");
+
+#endif /* TGLYPHATLAS_H */
--- a/fbs/fontandbitmapserver/tfbs/tipctest.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/tfbs/tipctest.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -13,10 +13,10 @@
 // Description:
 //
 
-#include "fbsmessage.h"
 #include "../sfbs/UTILS.H"
 #include "tipctest.h"
 #include "fbsdefs.h"
+#include "fbsmessage.h"
 
 // Invalid parameters to be passed in SendCommand() calls.
 const TInt KInvalidParam1 = 963955448;
@@ -75,59 +75,6 @@
 	
 	}
 
-/**
-	@SYMTestCaseID
-	GRAPHICS-FBSERV-0603
-
-	@SYMTestCaseDesc
-	Tests the sending of commands to a FbsSession 
-	server thru Inter Process Communication. Sends
-	both valid and invalid commands.
-
-	@SYMTestActions
-	Commands sent to the server:
-	1. EFbsMessShutdown
-	2. EFbsMessFontHeightInTwips
-	3. EFbsMessFontHeightInTwips
-	4. EFbsMessFontHeightInPixels
-	5. EFbsMessFontHeightInPixels
-	6. EFbsMessAddFontStoreFile
-	7. EFbsMessAddFontStoreFile
-	8. EFbsMessInstallFontStoreFile
-	9. EFbsMessInstallFontStoreFile
-	10. EFbsMessInstallFontStoreFile
-	11. EFbsMessBitmapCreate
-	12. EFbsMessRasterize
-	13. EFbsMessFaceAttrib
-	14. EFbsMessHasCharacter
-	15. EFbsMessFontNameAlias
-	16. EFbsMessGetNearestFontToDesignHeightInTwips
-	17. EFbsMessGetNearestFontToMaxHeightInTwips
-	18. EFbsMessGetNearestFontToDesignHeightInPixels
-	19. EFbsMessGetNearestFontToMaxHeightInPixels
-	20. EFbsMessShapeText
-	21. EFbsMessShapeDelete
-	22. EFbsMessSetTwipsHeight
-	23. EFbsMessGetTwipsHeight	
-	@SYMTestExpectedResults
-    Test should pass
-
-    @SYMTestCaseID
-    TI18N-GDI-CIT-4086
-
-    @SYMTestCaseDesc
-    Test if FBS can handle invalid messages correctly
-    and panic the client as needed.
-
-    @SYMTestActions
-	24. EFbsMessGetFontTable
-	25. EFbsMessReleaseFontTable
-	26. EFbsMessGetGlyphOutline
-	27.EFbsMessReleaseGlyphOutline
-	
-	@SYMTestExpectedResults
-	Test should pass
-*/
 void CTIPCTest::RunTestCaseL(TInt aCurTestCase)
 	{
 	_LIT(KCaseNumber, "CaseNumber");
@@ -141,172 +88,254 @@
 		
 	switch(aCurTestCase)
 		{
+	/**
+		@SYMTestCaseID
+		GRAPHICS-FBSERV-0603
+
+		@SYMTestCaseDesc
+		Tests the sending of commands to a FbsSession 
+		server thru Inter Process Communication. Sends
+		both valid and invalid commands.
+
+		@SYMTestActions
+		Commands sent to the server:
+		1. EFbsMessShutdown
+		2. EFbsMessFontHeightInTwips
+		3. EFbsMessFontHeightInTwips
+		4. EFbsMessFontHeightInPixels
+		5. EFbsMessFontHeightInPixels
+		6. EFbsMessAddFontStoreFile
+		7. EFbsMessAddFontStoreFile
+		8. EFbsMessInstallFontStoreFile
+		9. EFbsMessInstallFontStoreFile
+		10. EFbsMessInstallFontStoreFile
+		11. EFbsMessBitmapCreate
+		12. EFbsMessRasterize
+		13. EFbsMessFaceAttrib
+		14. EFbsMessHasCharacter
+		15. EFbsMessFontNameAlias
+		16. EFbsMessGetNearestFontToDesignHeightInTwips
+		17. EFbsMessGetNearestFontToMaxHeightInTwips
+		18. EFbsMessGetNearestFontToDesignHeightInPixels
+		19. EFbsMessGetNearestFontToMaxHeightInPixels
+		20. EFbsMessShapeText
+		21. EFbsMessShapeDelete
+		22. EFbsMessSetTwipsHeight
+		23. EFbsMessGetTwipsHeight
+		
+		@SYMTestExpectedResults
+		Test should pass
+	*/
 	case 1:
-		INFO_PRINTF1(_L("Shutdown\r\n"));
+		INFO_PRINTF1(_L("Shutdown"));
 		iFbs->SendCommand(EFbsMessShutdown);
 		TestComplete();
 		break;
 	case 2:
-		INFO_PRINTF1(_L("Height in twips with negative typeface index\r\n"));
+		INFO_PRINTF1(_L("Height in twips with negative typeface index"));
 		iFbs->SendCommand(EFbsMessFontHeightInTwips, -1);	
 		TEST(EFalse); // Previous line should have paniced 
 		TestComplete();
 		break;	
 	case 3:
-		INFO_PRINTF1(_L("Height in twips with invalid size\r\n"));
+		INFO_PRINTF1(_L("Height in twips with invalid size"));
 		iClient.SendInvalidSize(EFbsMessFontHeightInTwips);
 		TEST(EFalse);
 		TestComplete();
 		break;
 	case 4:
-		INFO_PRINTF1(_L("Height in pixels with negative typeface index\r\n"));
+		INFO_PRINTF1(_L("Height in pixels with negative typeface index"));
 		iFbs->SendCommand(EFbsMessFontHeightInPixels, -1);
 		TEST(EFalse);
 		TestComplete();
 		break;
 	case 5:
-		INFO_PRINTF1(_L("Height in pixels with invalid size\r\n"));
+		INFO_PRINTF1(_L("Height in pixels with invalid size"));
 		iClient.SendInvalidSize(EFbsMessFontHeightInPixels);
 		TEST(EFalse);
 		TestComplete();
 		break;
 	case 6:
-		INFO_PRINTF1(_L("Add font store file with negative length\r\n"));
+		INFO_PRINTF1(_L("Add font store file with negative length"));
 		iFbs->SendCommand(EFbsMessAddFontStoreFile, 0, -1);
 		TEST(EFalse);
 		TestComplete();
 		break;
 	case 7:
-		INFO_PRINTF1(_L("Add font store file with huge length\r\n"));
+		INFO_PRINTF1(_L("Add font store file with huge length"));
 		iFbs->SendCommand(EFbsMessAddFontStoreFile, KInvalidParam1, KInvalidParam2, KInvalidParam3, KInvalidParam4);
 		TEST(EFalse);
 		TestComplete();
 		break;
 	case 8:
-		INFO_PRINTF1(_L("Install font store file with negative length\r\n"));
+		INFO_PRINTF1(_L("Install font store file with negative length"));
 		iFbs->SendCommand(EFbsMessInstallFontStoreFile, 0, -1);
 		TEST(EFalse);
 		TestComplete();
 		break;
 	case 9:
-		INFO_PRINTF1(_L("Install font store file with huge length\r\n"));
+		INFO_PRINTF1(_L("Install font store file with huge length"));
 		iFbs->SendCommand(EFbsMessInstallFontStoreFile, KInvalidParam1, KInvalidParam2, KInvalidParam3, KInvalidParam4);
 		TEST(EFalse);
 		TestComplete();
 		break;
 	case 10:
-		INFO_PRINTF1(_L("Remove font store file with active references\r\n"));
+		INFO_PRINTF1(_L("Remove font store file with active references"));
 		iFbs->SendCommand(EFbsMessRemoveFontStoreFile, 11);
 		// With PDEF121246 (INC120690) fix in place, this test will always pass. Without the fix there will be a KERN 4 panic.
 		TEST(ETrue); 
 		TestComplete();
 		break;
 	case 11:
-		INFO_PRINTF1(_L("Bitmap create with invalid display mode\r\n"));
+		INFO_PRINTF1(_L("Bitmap create with invalid display mode"));
 		iClient.SendInvalidDisplayMode(EFbsMessBitmapCreate);
 		TEST(EFalse);
 		TestComplete();
 		break;
 	case 12:
-		INFO_PRINTF1(_L("Rasterize with invalid bitmap handle\r\n"));
+		INFO_PRINTF1(_L("Rasterize with invalid bitmap handle"));
 		iFbs->SendCommand(EFbsMessRasterize, KInvalidParam1, KInvalidParam2, KInvalidParam3, KInvalidParam4);
 		TEST(EFalse);
 		TestComplete();
 		break;
 	case 13:
-		INFO_PRINTF1(_L("Face Attribute with invalid bitmap handle\r\n"));
+		INFO_PRINTF1(_L("Face Attribute with invalid bitmap handle"));
 		iFbs->SendCommand(EFbsMessFaceAttrib, KInvalidParam1, KInvalidParam2, KInvalidParam3, KInvalidParam4);
 		TEST(EFalse);
 		TestComplete();
 		break;
 	case 14:
-		INFO_PRINTF1(_L("Has Character with invalid bitmap handle\r\n"));
+		INFO_PRINTF1(_L("Has Character with invalid bitmap handle"));
 		iFbs->SendCommand(EFbsMessHasCharacter, KInvalidParam1, KInvalidParam2, KInvalidParam3, KInvalidParam4);
 		TEST(EFalse);
 		TestComplete();
 		break;
 	case 15:
-		INFO_PRINTF1(_L("Name Alias with huge alias name length\r\n"));
+		INFO_PRINTF1(_L("Name Alias with huge alias name length"));
 		iFbs->SendCommand(EFbsMessFontNameAlias, KInvalidParam1, KInvalidParam2, KInvalidParam3, KInvalidParam4);
 		TEST(EFalse);
 		TestComplete();
 		break;
 	case 16:
-		INFO_PRINTF1(_L("Get nearest font to design height in twips with invalid typeface name length\r\n"));
+		INFO_PRINTF1(_L("Get nearest font to design height in twips with invalid typeface name length"));
 		iClient.SendInvalidNameLength(EFbsMessGetNearestFontToDesignHeightInTwips);
 		TEST(EFalse);
 		TestComplete();
 		break;
 	case 17:
-		INFO_PRINTF1(_L("Get nearest font to max height in twips with invalid typeface name length\r\n"));
+		INFO_PRINTF1(_L("Get nearest font to max height in twips with invalid typeface name length"));
 		iClient.SendInvalidNameLength(EFbsMessGetNearestFontToMaxHeightInTwips);
 		TEST(EFalse);
 		TestComplete();
 		break;
 	case 18:
-		INFO_PRINTF1(_L("Get nearest font to design height in pixels with invalid typeface name length\r\n"));
+		INFO_PRINTF1(_L("Get nearest font to design height in pixels with invalid typeface name length"));
 		iClient.SendInvalidNameLength(EFbsMessGetNearestFontToDesignHeightInPixels);
 		TEST(EFalse);
 		TestComplete();
 		break;
 	case 19:
-		INFO_PRINTF1(_L("Get nearest font to max height in pixels with invalid typeface name length\r\n"));
+		INFO_PRINTF1(_L("Get nearest font to max height in pixels with invalid typeface name length"));
 		iClient.SendInvalidNameLength(EFbsMessGetNearestFontToMaxHeightInPixels);
 		TEST(EFalse);
 		TestComplete();
 		break;
 	case 20:
-		INFO_PRINTF1(_L("Shape text with invalid bitmap font handle\r\n"));
+		INFO_PRINTF1(_L("Shape text with invalid bitmap font handle"));
 		iFbs->SendCommand(EFbsMessShapeText, KInvalidParam1, KInvalidParam2, KInvalidParam3, KInvalidParam4);
 		TEST(EFalse);
 		TestComplete();
 		break;
 	case 21:
-		INFO_PRINTF1(_L("Shape delete with invalid bitmap font handle\r\n"));
+		INFO_PRINTF1(_L("Shape delete with invalid bitmap font handle"));
 		iFbs->SendCommand(EFbsMessShapeDelete, KInvalidParam1, KInvalidParam2, KInvalidParam3, KInvalidParam4);
 		TEST(EFalse);
 		TestComplete();
 		break;
 	case 22:
-		INFO_PRINTF1(_L("Set twips height with invalid font handle\r\n"));
+		INFO_PRINTF1(_L("Set twips height with invalid font handle"));
 		iFbs->SendCommand(EFbsMessSetTwipsHeight, KInvalidParam1, KInvalidParam2, KInvalidParam3, KInvalidParam4);
 		TEST(EFalse);
 		TestComplete();
 		break;
 	case 23:
-		INFO_PRINTF1(_L("Get twips height with invalid font handle\r\n"));
-		((CTIPCTestStep*)iStep)->SetOverallTestStepID(_L("GRAPHICS-FBSERV-0603"));
-		((CTIPCTestStep*)iStep)->RecordTestResultL();
-		((CTIPCTestStep*)iStep)->CloseTMSGraphicsStep();
+		INFO_PRINTF1(_L("Get twips height with invalid font handle"));
 		iFbs->SendCommand(EFbsMessGetTwipsHeight, KInvalidParam1, KInvalidParam2, KInvalidParam3, KInvalidParam4);
 		TEST(EFalse);
 		TestComplete();
 		break;	
 	case 24:
-		INFO_PRINTF1(_L("Get Font Table with wrong msg\r\n"));
-		iFbs->SendCommand(EFbsMessGetFontTable, KInvalidParam1, KInvalidParam2, KInvalidParam3, KInvalidParam4);   
-		TEST(EFalse); 
+		/**
+			@SYMTestCaseID	GRAPHICS-FBSERV-0630
+
+			@SYMTestCaseDesc
+			Tests that invalid font handle to EFbsMessGetGlyphs causes panic
+
+			@SYMTestExpectedResults
+			Client should panic with FBSERV -8
+		*/
+		INFO_PRINTF1(_L("Get glyphs from glyph atlas with invalid font handle"));
+		iFbs->SendCommand(EFbsMessGetGlyphs, KInvalidParam1, KInvalidParam2, KInvalidParam3, KInvalidParam4);
+		TEST(EFalse);
 		TestComplete();
 		break;
 	case 25:
-		INFO_PRINTF1(_L("Release Font Table with wrong msg\r\n"));
-		iFbs->SendCommand(EFbsMessReleaseFontTable, KInvalidParam1, KInvalidParam2, KInvalidParam3, KInvalidParam4);   
-		TEST(EFalse); 
+		/**
+			@SYMTestCaseID	GRAPHICS-FBSERV-0670
+
+			@SYMTestCaseDesc
+			Tests that invalid font handle to EFbsMessGetGlyphMetrics causes panic
+
+			@SYMTestExpectedResults
+			Client should panic with FBSERV -8
+		*/
+		INFO_PRINTF1(_L("Get glyph metrics with invalid font handle"));
+		iFbs->SendCommand(EFbsMessGetGlyphMetrics, KInvalidParam1, KInvalidParam2, KInvalidParam3, KInvalidParam4);
+		TEST(EFalse);
 		TestComplete();
-		break;    
+		break;
+	/**
+		@SYMTestCaseID
+		TI18N-GDI-CIT-4086
+
+		@SYMTestCaseDesc
+		Test if FBS can handle invalid messages correctly
+		and panic the client as needed.
+
+		@SYMTestActions
+		26. EFbsMessGetFontTable
+		27. EFbsMessReleaseFontTable
+		28. EFbsMessGetGlyphOutline
+		29. EFbsMessReleaseGlyphOutline
+	
+		@SYMTestExpectedResults
+		Test should pass
+	*/
 	case 26:
-		INFO_PRINTF1(_L("Get Glyph outline with wrong msg\r\n"));
-		iFbs->SendCommand(EFbsMessGetGlyphOutline,KInvalidParam1, KInvalidParam2, KInvalidParam3, KInvalidParam4);   
+		INFO_PRINTF1(_L("Get Font Table with wrong msg"));
+		iFbs->SendCommand(EFbsMessGetFontTable, KInvalidParam1, KInvalidParam2, KInvalidParam3, KInvalidParam4);
 		TEST(EFalse); 
 		TestComplete();
 		break;
 	case 27:
-		INFO_PRINTF1(_L("Release Glyph outline with wrong msg\r\n"));
-		iFbs->SendCommand(EFbsMessReleaseGlyphOutline, KInvalidParam1, KInvalidParam2, KInvalidParam3, KInvalidParam4);   
+		INFO_PRINTF1(_L("Release Font Table with wrong msg"));
+		iFbs->SendCommand(EFbsMessReleaseFontTable, KInvalidParam1, KInvalidParam2, KInvalidParam3, KInvalidParam4);
 		TEST(EFalse); 
 		TestComplete();
 		break;
 	case 28:
+		INFO_PRINTF1(_L("Get Glyph outline with wrong msg"));
+		iFbs->SendCommand(EFbsMessGetGlyphOutline,KInvalidParam1, KInvalidParam2, KInvalidParam3, KInvalidParam4);
+		TEST(EFalse); 
+		TestComplete();
+		break;
+	case 29:
+		INFO_PRINTF1(_L("Release Glyph outline with wrong msg"));
+		iFbs->SendCommand(EFbsMessReleaseGlyphOutline, KInvalidParam1, KInvalidParam2, KInvalidParam3, KInvalidParam4);
+		TEST(EFalse); 
+		TestComplete();
+		break;
+	case 30:
 		TestComplete();
 		break;
 		}
--- a/fbs/fontandbitmapserver/tfbs/tipctest.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/tfbs/tipctest.h	Fri Jul 16 11:45:55 2010 +0300
@@ -17,7 +17,7 @@
 #define __TIPCTest_H__
 
 #include <fbs.h>
-#include "TGraphicsHarness.h"
+#include "test/TGraphicsHarness.h"
 
 class RIPCTestFbservClient : public RSessionBase
 	{
--- a/fbs/fontandbitmapserver/tfbs/trfile.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/tfbs/trfile.h	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -20,7 +20,7 @@
 
 #include <fbs.h>
 #include <bitstd.h>
-#include "TGraphicsHarness.h"
+#include "test/TGraphicsHarness.h"
 
 class CTFile : public CTGraphicsBase
 	{
--- a/fbs/fontandbitmapserver/tfbs/twdp.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/fbs/fontandbitmapserver/tfbs/twdp.h	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -17,7 +17,7 @@
 #define __TWDP_H__
 
 #include <fbs.h>
-#include "TGraphicsHarness.h"
+#include "test/TGraphicsHarness.h"
 
 class CTWDP : public CTGraphicsBase
 	{
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/traces/OstTraceDefinitions.h	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,7 @@
+#ifndef __OSTTRACEDEFINITIONS_H__
+#define __OSTTRACEDEFINITIONS_H__
+// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
+// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
+//#define OST_TRACE_COMPILER_IN_USE
+#include <opensystemtrace.h>
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/fbs/fontandbitmapserver/traces/fixed_id.definitions	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,18 @@
+#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt.
+[GROUP]TRACE_NORMAL=0x86
+[TRACE]TRACE_NORMAL[0x86]_CGLYPHATLAS_ADDGLYPH=0x4
+[TRACE]TRACE_NORMAL[0x86]_CGLYPHATLAS_ADDGLYPH_END1=0x7
+[TRACE]TRACE_NORMAL[0x86]_CGLYPHATLAS_ADDGLYPH_END2=0x5
+[TRACE]TRACE_NORMAL[0x86]_CGLYPHATLAS_ADDGLYPH_END3=0x6
+[TRACE]TRACE_NORMAL[0x86]_CGLYPHATLAS_DELETELEASTRECENTLYUSEDPAGE=0xb
+[TRACE]TRACE_NORMAL[0x86]_CGLYPHATLAS_DELETELEASTRECENTLYUSEDPAGE_END=0xc
+[TRACE]TRACE_NORMAL[0x86]_CGLYPHATLAS_FONTRELEASED=0x8
+[TRACE]TRACE_NORMAL[0x86]_CGLYPHATLAS_FONTRELEASED_END2=0x9
+[TRACE]TRACE_NORMAL[0x86]_CGLYPHATLAS_FONTRELEASED_END3=0xa
+[TRACE]TRACE_NORMAL[0x86]_CGLYPHATLAS_GETGLYPH=0x1
+[TRACE]TRACE_NORMAL[0x86]_CGLYPHATLAS_GETGLYPH_END1=0x3
+[TRACE]TRACE_NORMAL[0x86]_CGLYPHATLAS_GETGLYPH_END2=0x2
+[TRACE]TRACE_NORMAL[0x86]_CGLYPHATLAS_INSTATEGPUMEMORY=0x16
+[TRACE]TRACE_NORMAL[0x86]_CGLYPHATLAS_INSTATEGPUMEMORY_EXIT=0x17
+[TRACE]TRACE_NORMAL[0x86]_CGLYPHATLAS_RELEASEGPUMEMORY=0x14
+[TRACE]TRACE_NORMAL[0x86]_CGLYPHATLAS_RELEASEGPUMEMORY_EXIT=0x15
--- a/graphicsaccelaration/vgi/group/libvgi.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicsaccelaration/vgi/group/libvgi.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -34,6 +34,8 @@
 
 OPTION_REPLACE ARMCC --cpu 5TE -O3 -Otime
 
+MACRO GRAPHICS_LIBVGI_DLL
+
 SOURCEPATH 		../src
 SOURCE			vgi.cpp
 
--- a/graphicsaccelaration/vgi/inc/vg/vgcontext.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicsaccelaration/vgi/inc/vg/vgcontext.h	Fri Jul 16 11:45:55 2010 +0300
@@ -53,7 +53,11 @@
    VGI_COPY_TRANSPARENT_PIXELS,
 } VGICopyToTargetHint;
 
-#define VGI_API_CALL		__declspec(dllexport)
+#ifdef GRAPHICS_LIBVGI_DLL
+	#define VGI_API_CALL		__declspec(dllexport)
+#else
+	#define VGI_API_CALL		__declspec(dllimport)
+#endif
 
 #ifdef __cplusplus
 extern "C" {
--- a/graphicscomposition/openwfcinterface/bwins/libWFCu.def	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicscomposition/openwfcinterface/bwins/libWFCu.def	Fri Jul 16 11:45:55 2010 +0300
@@ -26,7 +26,7 @@
 	wfcGetElementAttribiv @ 25 NONAME
 	wfcGetElementBelow @ 26 NONAME
 	wfcGetError @ 27 NONAME
-	wfcGetOnScreenStream @ 28 NONAME
+	extwfcGetOnScreenStream @ 28 NONAME
 	wfcGetStrings @ 29 NONAME
 	wfcInsertElement @ 30 NONAME
 	wfcIsExtensionSupported @ 31 NONAME
--- a/graphicscomposition/openwfcinterface/eabi/libWFCu.def	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicscomposition/openwfcinterface/eabi/libWFCu.def	Fri Jul 16 11:45:55 2010 +0300
@@ -26,7 +26,7 @@
 	wfcGetElementAttribiv @ 25 NONAME
 	wfcGetElementBelow @ 26 NONAME
 	wfcGetError @ 27 NONAME
-	wfcGetOnScreenStream @ 28 NONAME
+	extwfcGetOnScreenStream @ 28 NONAME
 	wfcGetStrings @ 29 NONAME
 	wfcInsertElement @ 30 NONAME
 	wfcIsExtensionSupported @ 31 NONAME
--- a/graphicscomposition/openwfcinterface/include/wfcplatform.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicscomposition/openwfcinterface/include/wfcplatform.h	Fri Jul 16 11:45:55 2010 +0300
@@ -1,8 +1,8 @@
-/*********************************************************************
+/********************************************************************
  *                                                                   *
  * Sample implementation of wfcplatform.h, version 1.0, draft 18     *
  *                                                                   *
- * Copyright � 2007-2009 The Khronos Group                           *
+ * Copyright (c) 2007-2009 The Khronos Group                         *
  *                                                                   *
  *********************************************************************/
 
@@ -30,6 +30,9 @@
 #define WFC_DEFAULT_SCREEN_NUMBER (0)
 #endif
 
+/* for backward compatibility of wfcGetOnScreenStream symbol use */
+#define wfcGetOnScreenStream extwfcGetOnScreenStream
+
 typedef khronos_int32_t     WFCint;
 typedef khronos_float_t     WFCfloat;
 typedef khronos_uint32_t    WFCbitfield;
--- a/graphicscomposition/surfaceupdate/group/surfaceupdateserver.mmh	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicscomposition/surfaceupdate/group/surfaceupdateserver.mmh	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
--- a/graphicscomposition/surfaceupdate/group/surfaceupdateserver.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicscomposition/surfaceupdate/group/surfaceupdateserver.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
--- a/graphicscomposition/surfaceupdate/inc/surfaceupdate.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicscomposition/surfaceupdate/inc/surfaceupdate.h	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -22,7 +22,7 @@
 
 const TUint KSurfaceUpdateServMajorVersionNumber = 1;
 const TUint KSurfaceUpdateServMinorVersionNumber = 1;
-const TUint KSurfaceUpdateServBuildVersionNumber = 2;
+const TUint KSurfaceUpdateServBuildVersionNumber = 3;
 
 
 enum TSurfaceUpdateServRqst
--- a/graphicscomposition/surfaceupdate/inc/surfaceupdateserver.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicscomposition/surfaceupdate/inc/surfaceupdateserver.h	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -33,6 +33,7 @@
 	EUpdateServPanicStartUp,
 	EUpdateServPanicDataIntegrity,
 	EUpdateServPanicRegister,
+	EUpdateServPanicGlobalFastLock,
 	};
 
 enum TSurfaceUpdateEvent
--- a/graphicscomposition/surfaceupdate/src/surfaceupdateserver.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicscomposition/surfaceupdate/src/surfaceupdateserver.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -23,7 +23,6 @@
 #ifdef TEST_SURFACE_UPDATE
 #include "surfaceupdatetest.h"
 #endif
-#include <e32atomics.h>
 
 
 const TUint KDefaultHeapSize=0x10000;
@@ -886,9 +885,18 @@
 	}
 #endif
 
+
+/**
+Set number of UpdateReceivers - called when update receivers are added/removed.
+
+@param aNumUpdateReceivers - new number of update receivers for the batch.
+ */
 void CUpdateReceiverNotificationBatch::SetNumUpdateReceivers(TInt aNumUpdateReceivers)
     {
-    __ASSERT_DEBUG(iType == EUpdateSrvReusable, CSurfaceUpdateServer::PanicServer(EUpdateServPanicDataIntegrity));
+    __ASSERT_DEBUG(aNumUpdateReceivers >= 0 && aNumUpdateReceivers < 1000 /* arbitrary "large" limit */,
+            CSurfaceUpdateServer::PanicServer(EUpdateServPanicDataIntegrity));
+    __ASSERT_DEBUG(iType == EUpdateSrvReusable, 
+            CSurfaceUpdateServer::PanicServer(EUpdateServPanicDataIntegrity));
     iNumUpdateReceivers = aNumUpdateReceivers;
     }
 /**
@@ -964,7 +972,8 @@
 	if(thread.Open(iThreadId) == KErrNone)
 		{
 	    TInt err = gProviderFastLock.CreateLocal();
-		//ignore error on double create.
+	    __ASSERT_ALWAYS(err == KErrNone || err == KErrAlreadyExists, CSurfaceUpdateServer::PanicServer(EUpdateServPanicGlobalFastLock));
+	    
 	    gProviderFastLock.Wait();
 	    gProvider = NULL;
 		if (iServer)
@@ -1026,22 +1035,11 @@
 		thus mustn't delete it. The pointer will be valid until server is operating, 
 		i.e. system is up.
 
-@panic KErrAccessDenied	If is called from process other than WSERV.	
 @return KErrNone if an operation is successful, any other system error codes otherwise
 */
 EXPORT_C TInt StartSurfaceUpdateServer(MSurfaceUpdateServerProvider*& aSurfaceUpdateServerProvider)
 	{
 #ifndef TEST_SURFACE_UPDATE
-	RProcess process;
-	TUidType uidType = process.Type();
-	const TInt32 KWservUid = 268450592;
-	const TUid& uid1 = uidType[2];
-
-	if(uid1.iUid != KWservUid) //only wserv process can start the server
-		{// some malicious client tries to launch the server
-		process.Panic(_L("Access denied"), KErrAccessDenied);
-		return KErrAccessDenied;
-		}	  
 	TPtrC serverName(KSurfaceUpdateServerName);
 #else
 	TPtrC serverName(KTestSurfaceUpdateServerName);
--- a/graphicscomposition/surfaceupdate/tsrc/tsurfaceupdate.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicscomposition/surfaceupdate/tsrc/tsurfaceupdate.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -1758,13 +1758,70 @@
 	session.Close();
 	}
 
+
+/**
+  @SYMTestCaseID GRAPHICS-SURFACEUPDATE-0019
+
+
+  @SYMPREQ 1007
+  
+  @SYMREQ 8223
+
+  @SYMTestCaseDesc Starting the surface update server in two different threads.
+
+  @SYMTestPriority High
+
+  @SYMTestStatus Implemented
+
+  @SYMTestActions Start the surface update server in two different threads.
+    
+  @SYMTestExpectedResults Thread 1: KErrNone
+     Thread 2: KErrNone
+     The "provider" returned to both threads should also be the same value!
+*/
+void CTSurfaceUpdate::TestCase12L()
+    {
+    MSurfaceUpdateServerProvider *surfaceUpdateProvider = NULL;
+    TInt res = StartSurfaceUpdateServer(surfaceUpdateProvider);
+    TEST(res == KErrNone);
+    User::LeaveIfError(res);
+
+    _LIT(KThreadName, "TestServerStartupTwoThreads");
+    TTime tm;
+    TBuf<32> buf;
+    tm.UniversalTime();
+    TRAP(res, tm.FormatL(buf, _L("_%H%T%S%C")));
+    TEST(res == KErrNone);
+    User::LeaveIfError(res);
+    TBuf<128> threadName(KThreadName);
+    threadName.Append(buf); //guarantee uniqueness  of the thread name
+    RThread thread;
+    MSurfaceUpdateServerProvider *surfaceUpdateProvider2 = NULL;
+    res = thread.Create(threadName,
+            TestServerStartupTwoThreads,
+            KDefaultStackSize,
+            &User::Heap(),
+            &surfaceUpdateProvider2);
+    TEST(res == KErrNone);
+    User::LeaveIfError(res);
+    TRequestStatus rendezvousStatus;
+    thread.Rendezvous(rendezvousStatus);
+    thread.Resume();
+    User::WaitForRequest(rendezvousStatus);
+    TEST(KErrNone == rendezvousStatus.Int());
+    // Check that we get the same provider for both threads!
+    TEST(surfaceUpdateProvider2 == surfaceUpdateProvider);
+    }
+
+
 /**
 Starting the update server in another thread - called from TestCase12
 */
-TInt CTSurfaceUpdate::TestServerStartupTwoThreads(TAny*)
+TInt CTSurfaceUpdate::TestServerStartupTwoThreads(TAny *aArgPtr)
 	{
-	MSurfaceUpdateServerProvider *surfaceUpdateProvider = NULL;
-	TInt res = StartSurfaceUpdateServer(surfaceUpdateProvider);
+	MSurfaceUpdateServerProvider **surfaceUpdateProviderPtr = 
+	        reinterpret_cast<MSurfaceUpdateServerProvider **>(aArgPtr);
+	TInt res = StartSurfaceUpdateServer(*surfaceUpdateProviderPtr);
 	return res;
 	}
 
@@ -2200,7 +2257,15 @@
  		TEST(ret == KErrNone);
  		break;
 		}
-	case 12:
+    case 12:
+        {
+        ((CTSurfaceUpdateStep*)iStep)->SetTestStepID(_L("GRAPHICS-SURFACEUPDATE-0019"));
+        INFO_PRINTF1(_L("TestCase12L"));
+        TRAPD(ret, TestCase12L());
+        TEST(ret == KErrNone);
+        break;
+        }
+	case 13:
  		{
  		((CTSurfaceUpdateStep*)iStep)->SetTestStepID(_L("GRAPHICS-SURFACEUPDATE-0020"));
  		INFO_PRINTF1(_L("TestCase13L"));
@@ -2208,14 +2273,14 @@
  		TEST(ret == KErrNone);
  		break;
 		}
-	case 13:
+	case 14:
  		{
  		((CTSurfaceUpdateStep*)iStep)->SetTestStepID(_L("GRAPHICS-SURFACEUPDATE-0022"));
  		INFO_PRINTF1(_L("TestCase14"));
  		TestCase14();
  		break;
 		}
-	case 14:
+	case 15:
  		{
 		((CTSurfaceUpdateStep*)iStep)->SetTestStepID(_L("GRAPHICS-SURFACEUPDATE-0023"));
  		INFO_PRINTF1(_L("TestCase15"));
@@ -2223,7 +2288,7 @@
  		TEST(ret == KErrNone);
  		break;
 		}
-	case 15:
+	case 16:
  		{
 		((CTSurfaceUpdateStep*)iStep)->SetTestStepID(_L("GRAPHICS-SURFACEUPDATE-0024"));
  		INFO_PRINTF1(_L("TestCase16"));
@@ -2231,7 +2296,7 @@
  		TEST(ret == KErrNone);
  		break;
 		}
-	case 16:
+	case 17:
  		{
 		((CTSurfaceUpdateStep*)iStep)->SetTestStepID(_L("GRAPHICS-SURFACEUPDATE-0028"));
  		INFO_PRINTF1(_L("TestCase17"));
@@ -2239,7 +2304,7 @@
  		TEST(ret == KErrNone);
  		break;
 		}
-	case 17:
+	case 18:
  		{
 		((CTSurfaceUpdateStep*)iStep)->SetTestStepID(_L("GRAPHICS-SURFACEUPDATE-0025"));
  		INFO_PRINTF1(_L("TestCase18"));
@@ -2247,7 +2312,7 @@
  		TEST(ret == KErrNone);
  		break;
 		}
-	case 18:
+	case 19:
 		{
 		((CTSurfaceUpdateStep*)iStep)->SetTestStepID(_L("GRAPHICS-SURFACEUPDATE-0027"));
 	 	INFO_PRINTF1(_L("TestCaseNotifyWhenAvailableGlobal"));
@@ -2255,7 +2320,7 @@
  		TEST(ret == KErrNone);
  		break;
 		}
-	case 19:
+	case 20:
 		{
 		((CTSurfaceUpdateStep*)iStep)->SetTestStepID(_L("GRAPHICS-SURFACEUPDATE-0029"));
 	 	INFO_PRINTF1(_L("TestCaseRegisterIdenticalPrioritiesL"));
@@ -2263,7 +2328,7 @@
  		TEST(ret == KErrNone);
  		break;
 		}
-	case 20:
+	case 21:
  		{//should be the last test case
 		((CTSurfaceUpdateStep*)iStep)->SetTestStepID(_L("GRAPHICS-SURFACEUPDATE-0021"));
  		INFO_PRINTF1(_L("TestCaseTerminateServer"));
--- a/graphicscomposition/surfaceupdate/tsrc/tsurfaceupdate.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicscomposition/surfaceupdate/tsrc/tsurfaceupdate.h	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -52,6 +52,7 @@
 	void TestCase9L();
 	void TestCase10();
 	void TestCase11();
+    void TestCase12L();
 	void TestCase13L();
 	void TestCase14();
 	void TestCase15();
--- a/graphicsdeviceinterface/bitgdi/group/BitgdiTest.iby	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicsdeviceinterface/bitgdi/group/BitgdiTest.iby	Fri Jul 16 11:45:55 2010 +0300
@@ -21,6 +21,7 @@
 // batch file that runs all automatic bitgdi tests
 data=DATAZ_\bitgdiTest\bitgdiTest_run.bat			\bitgdiTest_run.bat
 data=DATAZ_\bitgdiTest\bitgditest.bat				\bitgditest.bat
+data=DATAZ_\bitgdiTest\bitgditest_outlineandshadow_run.bat		\bitgditest_out.bat
 
 //script files
 data=DATAZ_\bitgdiTest\bitgdiTest_T_All.script				\bitgdiTest\bitgdiTest_T_All.script
@@ -39,6 +40,10 @@
 data=DATAZ_\bitgdiTest\bitgdiTest_T_Scaling.script			\bitgdiTest\bitgdiTest_T_Scaling.script
 data=DATAZ_\bitgdiTest\bitgdiTest_T_Switch.script			\bitgdiTest\bitgdiTest_T_Switch.script
 data=DATAZ_\bitgdiTest\bitgditest_t_extendedbitmap.script	\bitgditest\bitgditest_t_extendedbitmap.script
+data=DATAZ_\bitgdiTest\bitgditest_t_outlineandshadowfonts.script	\bitgdiTest\bitgditest_t_outlineandshadowfonts.script
+
+data=DATAZ_\bitgdiTest\toutlineandshadow.ini	\bitgdiTest\toutlineandshadow.ini
+
 
 REM BITGDI test programs
 
--- a/graphicsdeviceinterface/bitgdi/group/bitgdi.pkg	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description: 
-;
-;File: bitgdi.pkg;
-;
-;Auto-generated PKG file by Nokia PKG Wizard for CodeWarrior IDE
-
-;*Languages
-&EN
-;
-;*Standard SIS file header. This section specifies the package name,
-;application UID, and version/build numbers. Add the package TYPE here if needed.
-#{"BitGDITest"},(0x101FB3E8),1,0,1;
-;
-
-;*Unique (Non-Localized) Vendor name
-;This is used in combination with signing to prevent the unauthroized
-;upgrade of a a package by someone other than the rightful vendor.
-:"Nokia"
-
-;*Localized Vendor Name
-;This specifies the localized vendor name(s) corresponding to language(s).
-%{"Nokia Test EN"}
-
-;*Files To Copy...<src> <destination>
-"..\tbit\scripts\bitgdiTest_T_Accelerator.script"-"c:\bitgditest\bitgdiTest_T_Accelerator.script"
-"..\tbit\scripts\bitgdiTest_T_AlphaBlending.script"-"c:\bitgditest\bitgdiTest_T_AlphaBlending.script"
-"..\tbit\scripts\bitgdiTest_T_Auto.script"-"c:\bitgditest\bitgdiTest_T_Auto.script"
-"..\tbit\scripts\bitgdiTest_T_BitBlt.script"-"c:\bitgditest\bitgdiTest_T_BitBlt.script"
-"..\tbit\scripts\bitgdiTest_T_Clip.script"-"c:\bitgditest\bitgdiTest_T_Clip.script"
-"..\tbit\scripts\bitgdiTest_T_Clip2.script"-"c:\bitgditest\bitgdiTest_T_Clip2.script"
-"..\tbit\scripts\bitgdiTest_T_Defect.script"-"c:\bitgditest\bitgdiTest_T_Defect.script"
-"..\tbit\scripts\bitgdiTest_T_Defect2.script"-"c:\bitgditest\bitgdiTest_T_Defect2.script"
-"..\tbit\scripts\bitgdiTest_T_Font.script"-"c:\bitgditest\bitgdiTest_T_Font.script"
-"..\tbit\scripts\bitgdiTest_T_FontSelect.script"-"c:\bitgditest\bitgdiTest_T_FontSelect.script"
-"..\tbit\scripts\bitgdiTest_T_Gdi.script"-"c:\bitgditest\bitgdiTest_T_Gdi.script"
-"..\tbit\scripts\bitgdiTest_T_Param.script"-"c:\bitgditest\bitgdiTest_T_Param.script"
-"..\tbit\scripts\bitgdiTest_T_Scaling.script"-"c:\bitgditest\bitgdiTest_T_Scaling.script"
-"..\tbit\scripts\bitgdiTest_T_Switch.script"-"c:\bitgditest\bitgdiTest_T_Switch.script"
-"..\tbit\scripts\bitgditest_t_outlineandshadowfonts.script"-"c:\bitgditest\bitgditest_t_outlineandshadowfonts.script"
-
--- a/graphicsdeviceinterface/bitgdi/sbit/FONTBMP.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicsdeviceinterface/bitgdi/sbit/FONTBMP.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -65,7 +65,9 @@
 EXPORT_C void CFbsBitGcFont::Reset()
 	{
 	if (!iCopy)
+		{
 		CFbsFont::Reset();
+		}
 	else
 		{
 		iAddressPointer = NULL;
--- a/graphicsdeviceinterface/bitgdi/sbit/MAIN.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicsdeviceinterface/bitgdi/sbit/MAIN.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -23,7 +23,6 @@
 #include <shapeinfo.h>
 #include "bitgcextradata.h"
 
-
 #define KDefaultShadowColor KRgbGray
 
 //CFbsBitGc streams - version numbers.
--- a/graphicsdeviceinterface/bitgdi/tbit/TDefect2.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicsdeviceinterface/bitgdi/tbit/TDefect2.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -2125,13 +2125,18 @@
 	DeleteGraphicsContext();
 	DeleteScreenDevice();
 	TRAPD(err, iScrDev = CFbsScreenDevice::NewL(aScreenNo, aDisplayMode));
-	if(err == KErrNotSupported)
+	if ( !iScrDev )
 		{
+		TESTE( err == KErrNotSupported, err );
 		return err;
 		}
 	TEST(err == KErrNone);
 	TEST(iScrDev->ScreenNo() == aScreenNo);
 	err = iScrDev->CreateContext((CGraphicsContext*&)iGc);
+	if ( !iGc )
+		{
+		return err;
+		}
 	TEST(err == KErrNone);
 	iGc->SetUserDisplayMode(aDisplayMode);
 	iScrDev->ChangeScreenDevice(NULL);
--- a/graphicsdeviceinterface/bitgdi/tbit/mbmfiles/dummyrscfile.rsc	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicsdeviceinterface/bitgdi/tbit/mbmfiles/dummyrscfile.rsc	Fri Jul 16 11:45:55 2010 +0300
@@ -1,10 +1,10 @@
-11111111111111111111111111111111111111111111111111111111111111111111111111111
-22222222222222222222222222222222222222222222222222222222222222222222222222222
-33333333333333333333333333333333333333333333333333333333333333333333333333333
-44444444444444444444444444444444444444444444444444444444444444444444444444444
-55555555555555555555555555555555555555555555555555555555555555555555555555555
-66666666666666666666666666666666666666666666666666666666666666666666666666666
-77777777777777777777777777777777777777777777777777777777777777777777777777777
-88888888888888888888888888888888888888888888888888888888888888888888888888888
-99999999999999999999999999999999999999999999999999999999999999999999999999999
+11111111111111111111111111111111111111111111111111111111111111111111111111111
+22222222222222222222222222222222222222222222222222222222222222222222222222222
+33333333333333333333333333333333333333333333333333333333333333333333333333333
+44444444444444444444444444444444444444444444444444444444444444444444444444444
+55555555555555555555555555555555555555555555555555555555555555555555555555555
+66666666666666666666666666666666666666666666666666666666666666666666666666666
+77777777777777777777777777777777777777777777777777777777777777777777777777777
+88888888888888888888888888888888888888888888888888888888888888888888888888888
+99999999999999999999999999999999999999999999999999999999999999999999999999999
 00000000000000000000000000000000000000000000000000000000000000000000000000000
\ No newline at end of file
--- a/graphicsdeviceinterface/gdi/bwins/GDI2U.def	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicsdeviceinterface/gdi/bwins/GDI2U.def	Fri Jul 16 11:45:55 2010 +0300
@@ -301,20 +301,23 @@
 	??0RGlyphOutlineIterator@@QAE@XZ @ 300 NONAME ; RGlyphOutlineIterator::RGlyphOutlineIterator(void)
 	?Open@RGlyphOutlineIterator@@QAEHAAVCFont@@PBIHH@Z @ 301 NONAME ; int RGlyphOutlineIterator::Open(class CFont &, unsigned int const *, int, int)
 	??0RFontTable@@QAE@XZ @ 302 NONAME ; RFontTable::RFontTable(void)
-	?Image@RGlyphDataIterator@@QBEABVRSgImage@@XZ @ 303 NONAME ABSENT ; class RSgImage const & RGlyphDataIterator::Image(void) const
-	??0RGlyphMetricsArray@@QAE@XZ @ 304 NONAME ABSENT ; RGlyphMetricsArray::RGlyphMetricsArray(void)
-	?Count@RGlyphMetricsArray@@QBEHXZ @ 305 NONAME ABSENT ; int RGlyphMetricsArray::Count(void) const
-	?Metrics@RGlyphDataIterator@@QBEABVTOpenFontCharMetrics@@XZ @ 306 NONAME ABSENT ; class TOpenFontCharMetrics const & RGlyphDataIterator::Metrics(void) const
-	??0RGlyphDataIterator@@QAE@XZ @ 307 NONAME ABSENT ; RGlyphDataIterator::RGlyphDataIterator(void)
-	??ARGlyphMetricsArray@@QBEABVTOpenFontCharMetrics@@H@Z @ 308 NONAME ABSENT ; class TOpenFontCharMetrics const & RGlyphMetricsArray::operator[](int) const
-	?GlyphCode@RGlyphDataIterator@@QBEIXZ @ 309 NONAME ABSENT ; unsigned int RGlyphDataIterator::GlyphCode(void) const
-	?Rect@RGlyphDataIterator@@QBEABVTRect@@XZ @ 310 NONAME ABSENT ; class TRect const & RGlyphDataIterator::Rect(void) const
-	?Next@RGlyphDataIterator@@QAEHXZ @ 311 NONAME ABSENT ; int RGlyphDataIterator::Next(void)
-	?Close@RGlyphMetricsArray@@QAEXXZ @ 312 NONAME ABSENT ; void RGlyphMetricsArray::Close(void)
-	?Get@RGlyphMetricsArray@@QAEHAAVCFont@@PBIH@Z @ 313 NONAME ABSENT ; int RGlyphMetricsArray::Get(class CFont &, unsigned int const *, int)
-	?Close@RGlyphDataIterator@@QAEXXZ @ 314 NONAME ABSENT ; void RGlyphDataIterator::Close(void)
-	?Open@RGlyphDataIterator@@QAEHAAVCFont@@PBIH@Z @ 315 NONAME ABSENT ; int RGlyphDataIterator::Open(class CFont &, unsigned int const *, int)
+	?Image@RGlyphDataIterator@@QBEABVRSgImage@@XZ @ 303 NONAME ABSENT
+	??0RGlyphMetricsArray@@QAE@XZ @ 304 NONAME ABSENT
+	?Count@RGlyphMetricsArray@@QBEHXZ @ 305 NONAME ABSENT
+	?Metrics@RGlyphDataIterator@@QBEABVTOpenFontCharMetrics@@XZ @ 306 NONAME ABSENT
+	??0RGlyphDataIterator@@QAE@XZ @ 307 NONAME ABSENT
+	??ARGlyphMetricsArray@@QBEABVTOpenFontCharMetrics@@H@Z @ 308 NONAME ABSENT
+	?GlyphCode@RGlyphDataIterator@@QBEIXZ @ 309 NONAME ABSENT
+	?Rect@RGlyphDataIterator@@QBEABVTRect@@XZ @ 310 NONAME ABSENT
+	?Next@RGlyphDataIterator@@QAEHXZ @ 311 NONAME ABSENT
+	?Close@RGlyphMetricsArray@@QAEXXZ @ 312 NONAME ABSENT
+	?Get@RGlyphMetricsArray@@QAEHAAVCFont@@PBIH@Z @ 313 NONAME ABSENT
+	?Close@RGlyphDataIterator@@QAEXXZ @ 314 NONAME ABSENT
+	?Open@RGlyphDataIterator@@QAEHAAVCFont@@PBIH@Z @ 315 NONAME ABSENT
 	?SetName@TTypeface@@QAEXABVTDesC16@@@Z @ 316 NONAME ; void TTypeface::SetName(class TDesC16 const &)
 	?Name@TTypeface@@QBEABVTDesC16@@XZ @ 317 NONAME ; class TDesC16 const & TTypeface::Name(void) const
-	
+	?At@RHexTreeBase@@IBEPAXI@Z @ 318 NONAME ; void * RHexTreeBase::At(unsigned int) const
+	??0RHexTreeBase@@IAE@PAVRHeap@@@Z @ 319 NONAME ; RHexTreeBase::RHexTreeBase(class RHeap *)
+	?SetAt@RHexTreeBase@@IAEHIPAX@Z @ 320 NONAME ; int RHexTreeBase::SetAt(unsigned int, void *)
+	?ResetAndDestroy@RHexTreeBase@@QAEXXZ @ 321 NONAME ; void RHexTreeBase::ResetAndDestroy(void)
 
--- a/graphicsdeviceinterface/gdi/eabi/GDI2U.def	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicsdeviceinterface/gdi/eabi/GDI2U.def	Fri Jul 16 11:45:55 2010 +0300
@@ -391,4 +391,9 @@
 	_ZNK18RGlyphMetricsArrayixEi @ 390 NONAME ABSENT
 	_ZN9TTypeface7SetNameERK7TDesC16 @ 391 NONAME
 	_ZNK9TTypeface4NameEv @ 392 NONAME
+	_ZN12RHexTreeBase15ResetAndDestroyEv @ 393 NONAME
+	_ZN12RHexTreeBase5SetAtEjPv @ 394 NONAME
+	_ZN12RHexTreeBaseC1EP5RHeap @ 395 NONAME
+	_ZN12RHexTreeBaseC2EP5RHeap @ 396 NONAME
+	_ZNK12RHexTreeBase2AtEj @ 397 NONAME
 
--- a/graphicsdeviceinterface/gdi/group/GDI.MMP	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicsdeviceinterface/gdi/group/GDI.MMP	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -53,6 +53,7 @@
 SOURCE FontIndic.cpp
 SOURCE ShaperCli.cpp
 SOURCE GDI.CPP
+SOURCE hextree.cpp
 
 LIBRARY         euser.lib
 LIBRARY         efsrv.lib
--- a/graphicsdeviceinterface/gdi/inc/GDI.H	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicsdeviceinterface/gdi/inc/GDI.H	Fri Jul 16 11:45:55 2010 +0300
@@ -141,9 +141,9 @@
 	EGdiPanic_OutOfText				= 2,
 	/** Internal failure. */
 	EGdiPanic_Invariant				= 3,
-	/** Reserved panic codes. Not to be used. */
-	EGdiPanic_Reserved1				= 4,
-	EGdiPanic_Reserved2				= 5,
+	/** Unused panic codes. Can be reused if needed. */
+	EGdiPanic_Unused1				= 4,
+	EGdiPanic_Unused2				= 5,
 	/** Setting a typeface name that is too long */
 	EGdiPanic_TypefaceNameOverflow	= 6,
 	};
--- a/graphicsdeviceinterface/gdi/inc/gdiconsts.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicsdeviceinterface/gdi/inc/gdiconsts.h	Fri Jul 16 11:45:55 2010 +0300
@@ -38,5 +38,4 @@
 const TUid KUidIsFbsBitmapGc = {0x10285BBE};
 
 
-
 #endif /* GDICONSTS_H */
--- a/graphicsdeviceinterface/gdi/inc/gdiplatapi.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicsdeviceinterface/gdi/inc/gdiplatapi.h	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
--- a/graphicsdeviceinterface/screendriver/sbit/Cdsb.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicsdeviceinterface/screendriver/sbit/Cdsb.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -348,9 +348,9 @@
 		case 24:
 		case 32:
 			iBitmapInfo.iPixelShift = 5;
-			iBitmapInfo.iDisplayMode = EColor16MAP;
+			iBitmapInfo.iDisplayMode = EColor16MA;
 #ifdef SYMBIAN_GRAPHICS_GCE
-			iPixelFormat = EUidPixelFormatARGB_8888_PRE;
+			iPixelFormat = EUidPixelFormatARGB_8888;
 			iBytesPerPixel = 4;
 #endif
 			break;
--- a/graphicsdeviceinterface/screendriver/sgeneric/scdraw.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicsdeviceinterface/screendriver/sgeneric/scdraw.h	Fri Jul 16 11:45:55 2010 +0300
@@ -63,7 +63,6 @@
 	void Update();
 	void Update(TRequestStatus& aStatus);
 
-	void Update(const TRegion& aRegion);
 	void UpdateRegion(const TRect& aRect);
 	void ResetUpdateRegion();
 	void NotifyWhenAvailable(TRequestStatus& aStatus);
--- a/graphicsdeviceinterface/screendriver/sgeneric/scdraw.inl	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicsdeviceinterface/screendriver/sgeneric/scdraw.inl	Fri Jul 16 11:45:55 2010 +0300
@@ -98,13 +98,30 @@
 
 template <class T> void CGenericScreenDevice<T>::Update(const TRegion& aRegion)
 	{
-	iHelper.Update(aRegion);
+    if(!aRegion.IsEmpty() && !aRegion.CheckError())
+        {
+        if (aRegion.Count()>KMaxUpdateRegionRectangles)
+            {
+            UpdateRegion(aRegion.BoundingRect());
+            }
+        else
+            {
+            TInt rcCnt = aRegion.Count();
+            for (TInt ii=0; ii < rcCnt; ++ii)
+                {  
+                UpdateRegion(aRegion[ii]);  //Applies deorientate (offset, scale, rotate)
+                }
+            }
+        }
+    Update();
 	}
 
 template <class T> void CGenericScreenDevice<T>::UpdateRegion(const TRect& aRect)
-	{
-	iHelper.UpdateRegion(aRect);
-	}
+    {
+    const TRect rect = CDrawXxxBppBitmap::DeOrientate(aRect);//rect - physical coordinates
+    
+    iHelper.UpdateRegion(rect);
+    }
 
 template <class T> TInt CGenericScreenDevice<T>::GetInterface(TInt aInterfaceId, TAny*& aInterface)
 	{
--- a/graphicsdeviceinterface/screendriver/sgeneric/scnew.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicsdeviceinterface/screendriver/sgeneric/scnew.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -276,7 +276,7 @@
 */
 EXPORT_C TDisplayMode CFbsDrawDevice::DisplayMode16M()
 	{
-	return EColor16MAP;
+	return EColor16MA;
 	}
 
 
@@ -372,24 +372,6 @@
 		}
 	}
 
-/**
-Implementation of corresponding function in CDrawDevice, utilizing a tracked
-update region. Adds the given region to the update region and updates the
-screen.
-@param aRegion	Additional region to be updated.
-*/
-void CScreenDeviceHelper::Update(const TRegion& aRegion)
-	{
-	if(!aRegion.IsEmpty() && !aRegion.CheckError())
-		{
-		TInt rcCnt = aRegion.Count();
-		for (TInt ii=0; ii < rcCnt; ++ii)
-			{
-			UpdateRegion(aRegion[ii]);
-			}
-		}
-	Update();
-	}
 
 /**
 Implementation of corresponding function in CDrawDevice, utilizing a tracked
--- a/graphicshwdrivers/surfacemgr/inc/surface_hints.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicshwdrivers/surfacemgr/inc/surface_hints.h	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -47,6 +47,12 @@
 */
 const TInt KSurfaceProtection = 0x3;
 
+/** Hint about the surface’s characteristics or properties,
+   For example if a surface can be persisted by the effects engine.
+   @see TSurfaceCharacteristics for possible values.
+*/
+const TInt KSurfaceCharacteristics = 0x4;
+
 
 /** Values used for the KSurfaceContent key */
 enum TSurfaceContent
@@ -120,6 +126,17 @@
     };
 
 
+/** Values used for the KSurfaceCharacteristics key. The values are bitmasks and can be combined.
+*/
+enum TSurfaceCharacteristics
+    {
+    /**
+    * Surface cannot be persisted once it has been closed by the creator
+    */
+    ENotPersistable = 1,
+    };
+
+
 class TSurfaceUpdate
     {
     /** Constructor.
@@ -185,7 +202,7 @@
     return ( iValue & 0x80000000 ) ? ETrue : EFalse;
     }
 
-}; //namespace surfaceHints
+} //namespace surfaceHints
 
 #endif //__SURFACE_HINTS_H__
 
--- a/graphicshwdrivers/surfacemgr/test/src/tsurfacemanager.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicshwdrivers/surfacemgr/test/src/tsurfacemanager.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -21,6 +21,7 @@
  @internalComponent - Internal Symbian test code
 */
 
+
 #include "tsurfacemanager.h"
 #include <e32base.h>
 #include <e32cons.h>
@@ -29,6 +30,9 @@
 #include <e32cmn.h>	  
 #include <hal.h>
 #include <e32def_private.h>
+#include <graphics/surface_hints.h>
+
+using namespace surfaceHints;
 
 const TInt KCountLimit = 10000;
 
@@ -3188,36 +3192,32 @@
 	
 	//Add HintPair1
 	RSurfaceManager::THintPair hintPair1;
-	hintPair1.iKey.iUid = 0x123257;
-	hintPair1.iValue = 300;
-	hintPair1.iMutable = ETrue;
+	hintPair1.Set(TUid::Uid(KSurfaceContent), EStillImage, ETrue);
 	TEST(KErrNone == iSurfaceManager.AddSurfaceHint(surfaceId, hintPair1));
 	
 	RSurfaceManager::THintPair hintPairCheck1;
-	hintPairCheck1.iKey.iUid = 0x123257;
+	hintPairCheck1.iKey.iUid = KSurfaceContent;
 	CheckHintPair(surfaceId, hintPairCheck1, hintPair1);
 	
 	//Add HintPair2
 	RSurfaceManager::THintPair hintPair2;
-	hintPair2.iKey.iUid = 0x123267;
-	hintPair2.iValue = 100;
+	hintPair2.iKey.iUid = KSurfaceProtection;
+	hintPair2.iValue = EAllowAnalog | EAllowDigital;
 	hintPair2.iMutable = EFalse;
 	TEST(KErrNone == iSurfaceManager.AddSurfaceHint(surfaceId, hintPair2));
 		
 	RSurfaceManager::THintPair hintPairCheck2;
-	hintPairCheck2.iKey.iUid = 0x123267;
+	hintPairCheck2.iKey.iUid = KSurfaceProtection;
 	CheckHintPair(surfaceId, hintPairCheck2, hintPair2);
 	CheckHintPair(surfaceId, hintPairCheck1, hintPair1);
 
 	//Add HintPair3
 	RSurfaceManager::THintPair hintPair3;
-	hintPair3.iKey.iUid = 0x123324;
-	hintPair3.iValue = 500;
-	hintPair3.iMutable = ETrue;
+	hintPair3.Set(TUid::Uid(KSurfaceCharacteristics), ENotPersistable, EFalse);
 	TEST(KErrNone == iSurfaceManager.AddSurfaceHint(surfaceId, hintPair3));
 	
 	RSurfaceManager::THintPair hintPairCheck3;
-	hintPairCheck3.iKey.iUid = 0x123324;
+	hintPairCheck3.iKey.iUid = KSurfaceCharacteristics;
 	CheckHintPair(surfaceId, hintPairCheck3, hintPair3);
 	CheckHintPair(surfaceId, hintPairCheck2, hintPair2);
 	CheckHintPair(surfaceId, hintPairCheck1, hintPair1);
@@ -4439,3 +4439,4 @@
     if(!aCondition)
         User::Leave(TEST_ERROR_CODE);   // leave with standard error code
     }
+
--- a/graphicstest/graphicstestharness/automation/h4/tests_00b.txt	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/graphicstestharness/automation/h4/tests_00b.txt	Fri Jul 16 11:45:55 2010 +0300
@@ -20,4 +20,6 @@
 TESTEXECUTE, \logs\testexecute\fntstoretest_T_LinkedFontUpdateStage2.htm,	, z:\fntstoretest\fntstoretest_T_LinkedFontUpdateStage2.script, 600
 
 # PREQ1543 bitgdi
-TESTEXECUTE, \logs\testexecute\bitgdiTest_T_outlineandshadowfonts.htm,		, z:\bitgdiTest\bitgdiTest_T_outlineandshadowfonts.script,	2000
\ No newline at end of file
+TESTEXECUTE, \logs\testexecute\bitgdiTest_T_outlineandshadowfonts.htm,		, z:\bitgdiTest\bitgdiTest_T_outlineandshadowfonts.script,	2000
+
+TESTEXECUTE, \logs\testexecute\fbstest_t_glyphdataoutlineshadow.htm,		, z:\fbstest\fbstest_t_glyphdataoutlineshadow.script,	600
--- a/graphicstest/graphicstestharness/automation/h4/tests_01.txt	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/graphicstestharness/automation/h4/tests_01.txt	Fri Jul 16 11:45:55 2010 +0300
@@ -32,6 +32,9 @@
 TESTEXECUTE, \logs\testexecute\fbstest_T_StreamIdCache.htm,				, z:\fbstest\fbstest_T_StreamIdCache.script, 800
 TESTEXECUTE, \logs\testexecute\fbstest_t_extendedbitmap.htm,			, z:\fbstest\fbstest_t_extendedbitmap.script, 1200
 TESTEXECUTE, \logs\testexecute\fbstest_t_fonttable.htm,			        , z:\fbstest\fbstest_t_fonttable.script, 800
+TESTEXECUTE, \logs\testexecute\fbstest_t_glyphdata.htm,					, z:\fbstest\fbstest_t_glyphdata.script, 800
+TESTEXECUTE, \logs\testexecute\fbstest_t_glyphdataoutlineshadow.htm,		, z:\fbstest\fbstest_t_glyphdataoutlineshadow.script, 800, ,z\ityperast_config.cmd install, z\ityperast_config.cmd uninstall
+
 
 # See also tests_95_hw00.txt
 # See also tests_95_hw02.txt
--- a/graphicstest/graphicstestharness/automation/h4/tests_01a.txt	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/graphicstestharness/automation/h4/tests_01a.txt	Fri Jul 16 11:45:55 2010 +0300
@@ -32,6 +32,8 @@
 TESTEXECUTE, \logs\testexecute\fbstest_T_StreamIdCache.htm,				, z:\fbstest\fbstest_T_StreamIdCache.script, 800
 TESTEXECUTE, \logs\testexecute\fbstest_t_extendedbitmap.htm,			, z:\fbstest\fbstest_t_extendedbitmap.script, 1200
 TESTEXECUTE, \logs\testexecute\fbstest_t_fonttable.htm,			        , z:\fbstest\fbstest_t_fonttable.script, 800
+TESTEXECUTE, \logs\testexecute\fbstest_t_glyphdata.htm,					, z:\fbstest\fbstest_t_glyphdata.script, 800
+TESTEXECUTE, \logs\testexecute\fbstest_t_glyphdataoutlineshadow.htm,		, z:\fbstest\fbstest_t_glyphdataoutlineshadow.script, 800, ,z\ityperast_config.cmd install, z\ityperast_config.cmd uninstall
 
 # See also tests_95_hw00.txt
 # See also tests_95_hw02.txt
--- a/graphicstest/graphicstestharness/automation/h4/tests_29b.txt	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/graphicstestharness/automation/h4/tests_29b.txt	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,3 @@
-tests_29b.txt
 # Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
 # All rights reserved.
 # This component and the accompanying materials are made available
--- a/graphicstest/graphicstestharness/automation/h6/tests_00b.txt	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/graphicstestharness/automation/h6/tests_00b.txt	Fri Jul 16 11:45:55 2010 +0300
@@ -21,3 +21,5 @@
 
 # PREQ1543 bitgdi
 TESTEXECUTE, \logs\testexecute\bitgdiTest_T_outlineandshadowfonts.htm,		, z:\bitgdiTest\bitgdiTest_T_outlineandshadowfonts.script,	2000
+
+TESTEXECUTE, \logs\testexecute\fbstest_t_glyphdataoutlineshadow.htm,		, z:\fbstest\fbstest_t_glyphdataoutlineshadow.script,	600
--- a/graphicstest/graphicstestharness/automation/h6/tests_01.txt	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/graphicstestharness/automation/h6/tests_01.txt	Fri Jul 16 11:45:55 2010 +0300
@@ -33,6 +33,8 @@
 TESTEXECUTE, \logs\testexecute\fbstest_T_StreamIdCache.htm,				, z:\fbstest\fbstest_T_StreamIdCache.script, 800
 TESTEXECUTE, \logs\testexecute\fbstest_t_extendedbitmap.htm,			, z:\fbstest\fbstest_t_extendedbitmap.script, 1200
 TESTEXECUTE, \logs\testexecute\fbstest_t_fonttable.htm,			        , z:\fbstest\fbstest_t_fonttable.script, 800
+TESTEXECUTE, \logs\testexecute\fbstest_t_glyphdata.htm,					, z:\fbstest\fbstest_t_glyphdata.script, 800
+TESTEXECUTE, \logs\testexecute\fbstest_t_glyphdataoutlineshadow.htm,		, z:\fbstest\fbstest_t_glyphdataoutlineshadow.script, 800, ,z\ityperast_config.cmd install, z\ityperast_config.cmd uninstall
 
 # See also tests_95_hw00.txt
 # See also tests_95_hw02.txt
--- a/graphicstest/graphicstestharness/automation/h6/tests_01a.txt	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/graphicstestharness/automation/h6/tests_01a.txt	Fri Jul 16 11:45:55 2010 +0300
@@ -33,6 +33,8 @@
 TESTEXECUTE, \logs\testexecute\fbstest_T_StreamIdCache.htm,				, z:\fbstest\fbstest_T_StreamIdCache.script, 800
 TESTEXECUTE, \logs\testexecute\fbstest_t_extendedbitmap.htm,			, z:\fbstest\fbstest_t_extendedbitmap.script, 1200
 TESTEXECUTE, \logs\testexecute\fbstest_t_fonttable.htm,			        , z:\fbstest\fbstest_t_fonttable.script, 800
+TESTEXECUTE, \logs\testexecute\fbstest_t_glyphdata.htm,					, z:\fbstest\fbstest_t_glyphdata.script, 800
+TESTEXECUTE, \logs\testexecute\fbstest_t_glyphdataoutlineshadow.htm,		, z:\fbstest\fbstest_t_glyphdataoutlineshadow.script, 800, ,z\ityperast_config.cmd install, z\ityperast_config.cmd uninstall
 
 # See also tests_95_hw00.txt
 # See also tests_95_hw02.txt
--- a/graphicstest/graphicstestharness/automation/ne1/tests_01.txt	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/graphicstestharness/automation/ne1/tests_01.txt	Fri Jul 16 11:45:55 2010 +0300
@@ -32,6 +32,8 @@
 TESTEXECUTE, \logs\testexecute\fbstest_T_StreamIdCache.htm,				, z:\fbstest\fbstest_T_StreamIdCache.script, 800
 TESTEXECUTE, \logs\testexecute\fbstest_t_extendedbitmap.htm,			, z:\fbstest\fbstest_t_extendedbitmap.script, 1200
 TESTEXECUTE, \logs\testexecute\fbstest_t_fonttable.htm,			        , z:\fbstest\fbstest_t_fonttable.script, 800
+TESTEXECUTE, \logs\testexecute\fbstest_t_glyphdata.htm,					, z:\fbstest\fbstest_t_glyphdata.script, 800
+TESTEXECUTE, \logs\testexecute\fbstest_t_glyphdataoutlineshadow.htm,		, z:\fbstest\fbstest_t_glyphdataoutlineshadow.script, 800, ,z\ityperast_config.cmd install, z\ityperast_config.cmd uninstall
 
 # See also tests_95_hw00.txt
 # See also tests_95_hw02.txt
--- a/graphicstest/graphicstestharness/automation/ne1/tests_01a.txt	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/graphicstestharness/automation/ne1/tests_01a.txt	Fri Jul 16 11:45:55 2010 +0300
@@ -32,6 +32,8 @@
 TESTEXECUTE, \logs\testexecute\fbstest_T_StreamIdCache.htm,				, z:\fbstest\fbstest_T_StreamIdCache.script, 800
 TESTEXECUTE, \logs\testexecute\fbstest_t_extendedbitmap.htm,			, z:\fbstest\fbstest_t_extendedbitmap.script, 1200
 TESTEXECUTE, \logs\testexecute\fbstest_t_fonttable.htm,			        , z:\fbstest\fbstest_t_fonttable.script, 800
+TESTEXECUTE, \logs\testexecute\fbstest_t_glyphdata.htm,					, z:\fbstest\fbstest_t_glyphdata.script, 800
+TESTEXECUTE, \logs\testexecute\fbstest_t_glyphdataoutlineshadow.htm,		, z:\fbstest\fbstest_t_glyphdataoutlineshadow.script, 800, ,z\ityperast_config.cmd install, z\ityperast_config.cmd uninstall
 
 # See also tests_95_hw00.txt
 # See also tests_95_hw02.txt
--- a/graphicstest/graphicstestharness/automation/winscw/tests.txt	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/graphicstestharness/automation/winscw/tests.txt	Fri Jul 16 11:45:55 2010 +0300
@@ -155,6 +155,8 @@
 TESTEXECUTE, C:\logs\testexecute\fbstest_T_Secure.htm,					, z:\fbstest\fbstest_T_Secure.script, 600
 TESTEXECUTE, C:\logs\testexecute\fbstest_T_StreamIdCache.htm,			, z:\fbstest\fbstest_T_StreamIdCache.script, 600
 TESTEXECUTE, C:\logs\testexecute\fbstest_T_FontTable.htm,			, z:\fbstest\fbstest_T_FontTable.script, 600
+TESTEXECUTE, C:\logs\testexecute\fbstest_t_glyphdata.htm,			, z:\fbstest\fbstest_t_glyphdata.script, 600, ,z\ityperast_config.cmd install, z\ityperast_config.cmd uninstall
+TESTEXECUTE, C:\logs\testexecute\fbstest_t_glyphdataoutlineshadow.htm,		, z:\fbstest\fbstest_t_glyphdataoutlineshadow.script, 600, ,z\ityperast_config.cmd install, z\ityperast_config.cmd uninstall
 
 # without extended bitmap example rasterizer
 TESTEXECUTE, C:\logs\testexecute\fbstest_t_extendedbitmap.htm,			, z:\fbstest\fbstest_t_extendedbitmap.script,		1200
--- a/graphicstest/graphicstestharness/automation/winscw/tests_smoke.txt	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/graphicstestharness/automation/winscw/tests_smoke.txt	Fri Jul 16 11:45:55 2010 +0300
@@ -71,7 +71,7 @@
 
 # FEP TESTS
 TESTEXECUTE, C:\logs\testexecute\fepbasetest_t_defocusingedwin.htm, , z:\fepbasetest\fepbasetest_t_defocusingedwin.script,    600
-TESTEXECUTE, C:\logs\testexecute\fepbasetest_t_fep1testtarget.htm,  , z:\fepbasetest\fepbasetest_t_fep1testtarget.script,     600
+TESTEXECUTE, C:\logs\testexecute\fepbasetest_t_fep1testtarget.htm,  , z:\fepbasetest\fepbasetest_t_fep1testtarget.script,     600, , z\graphicstest\minigui.cmd, z\graphicstest\unminigui.cmd
 TESTEXECUTE, C:\logs\testexecute\fepbasetest_t_keyboardlogger.htm,  , z:\fepbasetest\fepbasetest_t_keyboardlogger.script,     600
 
 # GFXTRANSEFFECT TESTS
--- a/graphicstest/graphicstestharness/bwins/tprofileru.def	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/graphicstestharness/bwins/tprofileru.def	Fri Jul 16 11:45:55 2010 +0300
@@ -23,4 +23,4 @@
 	?SetStoreResultInTimingOrder@CTProfiler@@QAEXH@Z @ 22 NONAME ; void CTProfiler::SetStoreResultInTimingOrder(int)
 	?ShowResultArrayInTimingOrder@CTProfiler@@QAEXXZ @ 23 NONAME ; void CTProfiler::ShowResultArrayInTimingOrder(void)
 	?SqlInsert@CTProfiler@@QAEXPBVTDesC16@@00J@Z @ 24 NONAME ; void CTProfiler::SqlInsert(class TDesC16 const *, class TDesC16 const *, class TDesC16 const *, long)
-
+	?ResultsAnalysisGlyphRate@CTProfiler@@QAEXABVTDesC16@@HHHHH@Z @ 25 NONAME ; void CTProfiler::ResultsAnalysisGlyphRate(class TDesC16 const &, int, int, int, int, int)
--- a/graphicstest/graphicstestharness/eabi/tprofileru.def	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/graphicstestharness/eabi/tprofileru.def	Fri Jul 16 11:45:55 2010 +0300
@@ -27,4 +27,4 @@
 	_ZN10CTProfiler27SetStoreResultInTimingOrderEi @ 26 NONAME
 	_ZN10CTProfiler28ShowResultArrayInTimingOrderEv @ 27 NONAME
 	_ZN10CTProfiler9SqlInsertEPK7TDesC16S2_S2_l @ 28 NONAME
-
+	_ZN10CTProfiler24ResultsAnalysisGlyphRateERK7TDesC16iiiii @ 29 NONAME
--- a/graphicstest/graphicstestharness/group/bld.inf	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/graphicstestharness/group/bld.inf	Fri Jul 16 11:45:55 2010 +0300
@@ -39,11 +39,15 @@
 ../rom/graphics_imagecomparison.iby	/epoc32/rom/include/graphics_imagecomparison.iby  
 ../rom/graphics_tprofiler.iby  		/epoc32/rom/include/graphics_tprofiler.iby
 ../rom/graphics_simload.iby  		/epoc32/rom/include/graphics_simload.iby
+../rom/minigui_chassis_bats.oby  		/epoc32/rom/include/minigui_chassis_bats.oby
+../rom/minigui_naviengine_smp.oby  		/epoc32/rom/include/minigui_naviengine_smp.oby
 
 // WSINI
 ../rom/graphics_sirocco_wsini.hby  		/epoc32/rom/include/graphics_sirocco_wsini.hby
 ../rom/graphics_sirocco_wsini.iby  		/epoc32/rom/include/graphics_sirocco_wsini.iby
+../rom/graphics_sirocco_ne_wsini.iby  	/epoc32/rom/include/graphics_sirocco_ne_wsini.iby
 ../wsini/wsini_vasco.ini		/epoc32/data/test_wsini/wsini_vasco.ini
+../wsini/wsini_naviengine.ini		/epoc32/data/test_wsini/wsini_naviengine.ini
 
 // ONB batch files
 ../batch/retain_files.cmd z:\graphicstest\retain_files.cmd
--- a/graphicstest/graphicstestharness/inc/TGraphicsHarness.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/graphicstestharness/inc/TGraphicsHarness.h	Fri Jul 16 11:45:55 2010 +0300
@@ -122,7 +122,17 @@
 CTGraphicsBase* CT##a##Step::CreateTestL() \
 	{ \
 	return new (ELeave) CT##a (this); \
-	} 
+	}
+
+// Macros to automatically test error condition and report when test fails.
+// Essentially same as TESTE(a,b) MACRO that CTestStep uses, except error to
+// check is also error that is reported.
+#define TESTNOERROR(a) \
+	{\
+	TInt b = a;\
+	TBool c = (b == KErrNone);\
+	testBooleanTrueWithErrorCode((c), (b), (TText8*)__FILE__, __LINE__);\
+	}
 	
 inline void CTGraphicsBase::testBooleanTrue(TBool aCondition, const TText8* aFile, TInt aLine) 
 	{
--- a/graphicstest/graphicstestharness/inc/tprofiler.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/graphicstestharness/inc/tprofiler.h	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -69,7 +69,7 @@
 	IMPORT_C void ShowResultArrayInTimingOrder();
 	IMPORT_C void SetStoreResultInTimingOrder(TBool aStoreResultInTimingOrder);
 	IMPORT_C void SqlInsert(const TDesC* aTestName, const TDesC* aTestAttribute, const TDesC* aTestUnit, TInt32 aTestResultValue);
-
+	IMPORT_C void ResultsAnalysisGlyphRate(const TDesC & aTestName, TInt aRotation, TInt aSrcScreenMode, TInt aDstScreenMode, TInt aIters, TInt aNumPixels);
 
 private:
     CTProfiler(CTestStep& aTestStep);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphicstest/graphicstestharness/rom/graphics_sirocco_ne_wsini.iby	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,37 @@
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: Config for wsini.ini on NAVIENGINE
+//
+
+#ifndef __GRAPHICS_SIROCCO_NE_WSINI_IBY__
+#define __GRAPHICS_SIROCCO_NE_WSINI_IBY__
+
+#include <graphics_sirocco_wsini.hby>
+
+//#if WSERV_TEST_WSINI == WSERV_TEST_WSINI_ALF
+//	data=DATAZ_\talf\wsini_vasco_alf.ini \system\data\wsini.ini
+//#elif WSERV_TEST_WSINI == WSERV_TEST_WSINI_BITGDIRENDERSTAGE
+//	data=DATAZ_\wstest\tbitgdirenderstage\arm\wsini_bitgdirenderstage_vasco.ini \system\data\wsini.ini
+//#elif WSERV_TEST_WSINI == WSERV_TEST_WSINI_CSC
+//	data=DATAZ_\wstest\wsini_vasco_tcsc.ini \system\data\wsini.ini
+//#elif WSERV_TEST_WSINI == WSERV_TEST_WSINI_GENERICPLUGIN
+//	data=DATAZ_\wstest\genericplugin\wsini_vasco_genericplugin.ini \system\data\wsini.ini
+//#elif WSERV_TEST_WSINI == WSERV_TEST_WSINI_LAYERCOMPOSITION
+//	data=DATAZ_\tlayercomposition\wsini_vasco_layercomposition.ini \system\data\wsini.ini
+//#elif WSERV_TEST_WSINI == WSERV_TEST_WSINI_RATELIMITER
+//	data=DATAZ_\wstest\ratelimiter\wsini_vasco_ratelimiter.ini \system\data\wsini.ini
+//#else
+	data=EPOCROOT##epoc32\data\test_wsini\wsini_naviengine.ini \system\data\wsini.ini
+//#endif
+
+#endif	// __GRAPHICS_SIROCCO_NE_WSINI_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphicstest/graphicstestharness/rom/minigui_chassis_bats.oby	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,185 @@
+#ifndef __MINIGUI_OBY__
+#define __MINIGUI_OBY__
+
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This OBY File is used to build Mini-Gui ROM Images.
+// 
+// Use the following buildrom command line, or similar:
+//	buildrom -orombld.img -DUSE_SDIO_SD_MMC -DWITH_TVOUT -DUSE_24UBPP_DISPLAY_VARIANT_TV -D_INTERNAL_MMC -DUSE_DATA_PAGING h4hrp minigui pagedrom platsec
+// Note there is no need to specify -D_NAND2 
+
+define OBEYFILE minigui
+define ROMDATE	##TODAY##
+
+// We used to define _NAND2 on the commandline to buildrom.  However, it
+// does not make rombuild create a rofs image.  Instead it needs to be
+// specified in the oby file itself.
+//#define _NAND2
+
+// Undefine things in global System Include that stops the NCP rom from working.
+#undef USE_CUSTOM_MMC_PARTITION
+#undef SYMBIAN_EXCLUDE_SCDV
+#undef SYMBIAN_GRAPHICS_USE_GCE 
+#undef SYMBIAN_GRAPHICS_ADAPTATION
+#undef SGA_SW_NO_GRAPHICSRESOURCE 
+#undef SYMBIAN_EXCLUDE_KEYMAP  
+
+
+
+#define NO_METROTRK_APP // don't want metrotrk application
+#define HAS_ETHERNET	// include etherDrv, ether802, DHCP
+#define SYMBIAN_EXCLUDE_FAX
+#undef __IPSEC
+#define SYMBIAN_EXCLUDE_OBEX
+
+#ifdef SYMBIAN_SYSTEM_STATE_MANAGEMENT
+#define _SSMSTARTUPMODE 8	//for ssma boot up.
+#else
+#define _STARTUPMODE8		// for sysstart.iby
+#endif
+
+// Various workarounds to avoid dependencies on UIKON
+
+#define __TLS_IBY__			// exclude TLS
+#define __TLSPROVIDER_IBY__		// exclude TLSPROVIDER 
+#define __OBEXPROTOCOL_IBY__	// exclude obex.dll etc
+#define __WLANEAPMETHODS_IBY__	// exclude eap_tls.msy & friends
+// 
+
+#ifndef SYMBIAN_BASE_USE_GCE
+#define SYMBIAN_BASE_USE_GCE
+#endif
+#ifndef SYMBIAN_GRAPHICS_USE_GCE
+#define SYMBIAN_GRAPHICS_USE_GCE
+#endif
+#include <header.iby>				/* ROM header definitions */
+#include <base.iby>					/* The lowest-level of the operating system */
+
+#ifdef SYMBIAN_SYSTEM_STATE_MANAGEMENT
+
+#include <ssma.iby>			/*System State Management Architecture*/
+#include <ssplugins.iby>		/*System State Management Plugins*/
+
+//Include SSM optional components to enable teams to build a plain textshell rom (on the lines of DEF128306), 
+//following removal of h4_textshell_rom.oby.
+#include <amastart.iby>
+
+#include <shma.iby>
+#include <ssrefplugins.iby>
+#else
+#include <sysstart.iby>
+#include <sysstartconfig.iby>
+#endif // SYMBIAN_SYSTEM_STATE_MANAGEMENT
+
+#include <debug.iby>
+
+#include <eshell.iby>
+
+#include <centralrepository.iby>
+	file=ABI_DIR\BUILD_DIR\abclient.dll			sys\bin\abclient.dll
+
+#include <crypto.iby>
+
+#include <c32.iby>
+#include <ecuart.iby>
+#include <irda.iby>
+#include <stdlib.iby>
+#include <gdi.iby>
+#include <fntstore.iby>
+#include <fbserv.iby>
+#include <bitgdi.iby>
+#include <iculayoutengine.iby>
+#include <freetype.iby>
+#include <directgdi.iby>
+#include <wserv.iby>
+#include <econs_wserv.iby>
+//data=DATAZ_\wsini_minigui.ini	\system\data\wsini.ini
+
+#include <printers.iby>
+
+
+
+#include <traces.iby>
+
+#include <inetprotutil.iby>		/* needed for mmfcontrollerframework.dll */
+#include <sysagent.iby>
+#include <network.iby>	
+#include <dial.iby>		// needed by commsdat
+#include <etel.iby>
+#include <smsstack.iby>
+#include <etelmm.iby>
+#include <etelpckt.iby>
+#include <mmtsy.iby>
+#include <etelsat.iby>
+#include <sysawatcher.iby>
+#include <bafl.iby>
+#include <ecom.iby>
+#include <store.iby>
+#include <dbms.iby>
+#include <pwrcli.iby>
+#include <xml.iby>
+#include <ups.iby>
+#include <securitycommonutils.iby>
+
+/* Feature Management run-time */
+#ifdef SYMBIAN_FEATURE_MANAGER
+
+// Include both old and new components when Feature Manager enabled
+#include <featmgr.iby>
+#include <featreg.iby>
+
+#else 
+
+// Include only the original Feature Registry otherwise
+#include <featreg.iby>
+#ifndef ROM_FEATURE_MANAGEMENT
+/* Provide a default configuration file for the feature registry */ 
+data=EPOCROOT##epoc32\data\config\featreg_default.cfg    private\102744CA\featreg.cfg
+#endif
+#endif
+
+// The following section are all indirect dependencies arising from TEF testexecute depending
+// on apparc
+#include <mmcommon.iby>
+#include <ezlib.iby>
+file=ABI_DIR\BUILD_DIR\Http.dll                 System\Libs\Http.dll
+file=ABI_DIR\BUILD_DIR\httputils.dll			System\Libs\httputils.dll
+#include <asnpkcs.iby>
+#include <filetokens.iby>
+#include <imageconversion.iby>
+#include <ocsp.iby>
+#include <certman.iby>
+#include <swi.iby>
+#include <bluetooth.iby>
+#include <openenv.iby>
+#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
+#include <scr.iby>
+#include <sts.iby>
+#include <sif.iby>
+#endif
+#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
+#include <scr.iby>
+#include <sts.iby>
+#include <sif.iby>
+#endif
+#include <caf.iby>
+#include <apparc.iby>		/* Application architecture DLLs */
+#include <emime.iby>		/* Mime recognition */
+// This is the end of the indirect dependencies arising from TEF testexecute
+// depending on apparc
+
+#include <testexecute.iby>		// TEF
+
+#endif /* __MINIGUI_OBY__ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphicstest/graphicstestharness/rom/minigui_naviengine_smp.oby	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,21 @@
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This OBY File is used to build Minigui NaviEngine SMP ROM Images.
+// 
+//
+
+#define SMP
+#include <naviengine.oby>
+#include <minigui_chassis_bats.oby>
+#include <platsec.oby>
--- a/graphicstest/graphicstestharness/src/tprofiler.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/graphicstestharness/src/tprofiler.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -555,3 +555,27 @@
     {
     iStoreResultInTimingOrder = aStoreResultInTimingOrder;
     }
+
+/**
+Reports analysis results for glyph rates
+
+@param aTestName is the name of the test case
+@param aRotation is the screen rotation being used in the test
+@param aSrcScreenMode is the source screen mode being used, 
+i.e. for bitmap display conversion the source and destinations bitmaps maybe different
+@param aDstScreenMode is the destination screen mode (usually the display screen mode)
+@param aIters is the number of iterations used in the test
+@param aNumGlyphs is the number of glyphs used per iteration
+*/
+
+EXPORT_C void CTProfiler::ResultsAnalysisGlyphRate(const TDesC & aTestName, TInt aRotation, TInt aSrcScreenMode, TInt aDstScreenMode, TInt aIters, TInt aNumGlyphsPerIteration)
+    {
+    PROFILER_TEST(iResultsInitalised);
+
+    TReal time = (iResults.Count() > 0) ? (TReal)iResults[0] / 1000000 : 0;
+    TInt32 glyphRate = aNumGlyphsPerIteration*aIters/time;
+    PROFILER_INFO_PRINTF7(_L("TID:   %S  Rot:    %i  SrcMode:    %i  DestMode:   %i  Iters: %i   TrimmedMean:    %i  glyphs/second"), &aTestName, aRotation, aSrcScreenMode, aDstScreenMode, aIters, glyphRate);
+    PROFILER_INFO_PRINTF3(_L("Max:   %i  Min:    %i  "), TimeMax(), TimeMin());
+    iResultsInitalised = EFalse;
+  }
+
Binary file graphicstest/graphicstestharness/wsini/wsini_naviengine.ini has changed
--- a/graphicstest/uibench/group/bld.inf	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/uibench/group/bld.inf	Fri Jul 16 11:45:55 2010 +0300
@@ -29,6 +29,7 @@
 
 ../scripts/te_uibench_gce.script		z:/uibench/te_uibench_gce.script
 ../scripts/te_uibench_gce.ini			z:/uibench/te_uibench_gce.ini
+
 ../scripts/mysql.pm						z:/uibench/mysql.pm
 ../scripts/uploadsqlfromtestrun.pl		z:/uibench/uploadsqlfromtestrun.pl
 ../scripts/te_uibench_legacy.bat		z:/uibench/te_uibench_legacy.bat
--- a/graphicstest/uibench/group/te_uibench.iby	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/uibench/group/te_uibench.iby	Fri Jul 16 11:45:55 2010 +0300
@@ -19,6 +19,11 @@
 #include <internaltestfonts.iby>
 #include <testexecute.iby>
 #include <graphics_tprofiler.iby>
+
+REM egl and openvg needed for tfbsglyphdata tests
+#include <egl.iby>
+#include <openvg.iby>
+
 #ifndef SMP
 // MCL profiler is not built for SMP
 #include <profiler.iby>
@@ -26,7 +31,6 @@
 #ifdef SYMBIAN_GRAPHICS_USE_GCE
 #include <directgdi.iby>
 #include <directgdiadapter.iby>
-#include <t_halattprovider.iby>
 #endif
 
 file=ABI_DIR\DEBUG_DIR\te_uibench.exe	System\bin\te_uibench.exe
@@ -41,7 +45,6 @@
 #endif
 data=DATAZ_\uibench\te_uibench.ini	uibench\te_uibench.ini
 
-
 data=DATAZ_\uibench\te_uibench_gdi.ini	uibench\te_uibench_gdi.ini
 data=DATAZ_\uibench\te_uibench_gdi.script uibench\te_uibench_gdi.script
 
--- a/graphicstest/uibench/group/te_uibench.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/uibench/group/te_uibench.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -42,6 +42,8 @@
 SOURCE  ttranslucent.cpp
 SOURCE	tspriteperf.cpp
 SOURCE	textendedbitmap.cpp
+SOURCE  tfbsglyphdata.cpp
+SOURCE	trenderorientation.cpp
 
 USERINCLUDE   ../src
 USERINCLUDE   ../../../fbs/fontandbitmapserver/inc
@@ -66,6 +68,11 @@
 LIBRARY		estor.lib
 LIBRARY	    	tgraphicsharness.lib
 LIBRARY	    	tprofiler.lib
+#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
+LIBRARY		sgresource.lib
+LIBRARY		libEGL.lib
+LIBRARY		libOpenVG.lib
+#endif
 
 START BITMAP	16x16icon.mbm
 TARGETPATH		/system/data/
--- a/graphicstest/uibench/group/te_uibench_gce.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/uibench/group/te_uibench_gce.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -31,9 +31,9 @@
 SOURCE	tsimpledrawing_directgdi.cpp
 SOURCE	teventhandlingperf.cpp
 SOURCE  tflipframerate.cpp
+SOURCE	trenderorientation.cpp
 
 USERINCLUDE   ../src
-USERINCLUDE   ../../../fbs/fontandbitmapserver/inc
 
 //system includes
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphicstest/uibench/group/te_uibench_helium.pkg	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,38 @@
+; Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: 
+;
+;File: bitgdi.pkg;
+;
+;*Languages
+&EN
+;
+;*Standard SIS file header. This section specifies the package name,
+;application UID, and version/build numbers. Add the package TYPE here if needed.
+#{"UIBench"},(0x101FB3E8),1,0,1;
+;
+
+;*Unique (Non-Localized) Vendor name
+;This is used in combination with signing to prevent the unauthroized
+;upgrade of a a package by someone other than the rightful vendor.
+:"Nokia"
+
+;*Localized Vendor Name
+;This specifies the localized vendor name(s) corresponding to language(s).
+%{"Nokia Test EN"}
+
+;*Files To Copy...<src> <destination>
+
+"\epoc32\data\z\uibench\te_uibench.script"-"c:\uibench\te_uibench.script"
+"\epoc32\data\z\uibench\te_uibenchoutlineshadow.script"-"c:\uibench\te_uibenchoutlineshadow.script"
+
--- a/graphicstest/uibench/s60/group/te_uibench_s60.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/uibench/s60/group/te_uibench_s60.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -121,7 +121,7 @@
 LIBRARY     libGLESv1_CM.lib
 LIBRARY	    libopenvgu.lib
 LIBRARY	    libopenvg.lib
-LIBRARY     egltesthybrid.lib
+// this shouldn't be needed LIBRARY     egltesthybrid.lib
 LIBRARY     surfacemanager.lib
 LIBRARY     tgraphicsharness.lib
 LIBRARY     tprofiler.lib
--- a/graphicstest/uibench/s60/sis/rd-key.pem	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/uibench/s60/sis/rd-key.pem	Fri Jul 16 11:45:55 2010 +0300
@@ -1,15 +1,15 @@
------BEGIN RSA PRIVATE KEY-----
-MIICXAIBAAKBgQDLRF+r1FGGkCwTrb420kbnAps7gi1yYUcXYUdWeFTuBeQe5eW4
-6Y+LWaA8HMlDdoHRB0FgASisYcFagwno9+oFf4AJka4H1gWEs5XTGwAA1s0d8XGh
-7W7Dt9F5FZij8F7/9Pi6+FhhxZFIf1DD+yry9D7+Sp+BgdNALe4XOpf25QIBAwKB
-gQCHgupyjYuvCsgNHn7PNtnvVxInrB5MQNoPli+O+uNJWUK/Q+57Rl+yO8AoEzDX
-pFaLWiuVVhsdloDnAgabT/FXzYncs6uOHyEUV+dSXb78vtLPJqAX+Fg2i3hOXreB
-yskcZ13/OsKVOu5wgrJkx2baZufkqMwOSytf5y9nwjEIKwJBAP+inobagVNrN62j
-KQva3cC+UN/6XnKdTc0CA6bHyLOaJoH1xiMwG/VS2PGjHI0tiSMNtLn/QPpHJ003
-iabGhdUCQQDLjp/9UjFT6K6CF66Chqf30pZXhx+GTSQZmv/gvZiMly7X9fX9BGX3
-2MbJohBC4yI21XKTbisWywkF73Hwh+TRAkEAqmxprzxWN5zPyRdwspHpKymLP/w+
-9xOJM1atGdqFzRFvAU6EF3Vn+OHl9my9s3OwwgkjJqorUYTE3iUGby8D4wJBAIe0
-aqjhdjfwdFa6dFcEb/qMZDpaFQQzbWZnVUB+ZbMPdI/5TqitmU/l2dvBYCyXbCSO
-TGJJcg8yBgP09qBamIsCQFL7j1tM0XPVQJQ89WpKCld7O9ORxRGVj1eG0tWijrH8
-mGbYh8SGCVoWV3vrKSS8GBrFVgQnqUaHuEdtM7tpCAQ=
------END RSA PRIVATE KEY-----
+-----BEGIN RSA PRIVATE KEY-----
+MIICXAIBAAKBgQDLRF+r1FGGkCwTrb420kbnAps7gi1yYUcXYUdWeFTuBeQe5eW4
+6Y+LWaA8HMlDdoHRB0FgASisYcFagwno9+oFf4AJka4H1gWEs5XTGwAA1s0d8XGh
+7W7Dt9F5FZij8F7/9Pi6+FhhxZFIf1DD+yry9D7+Sp+BgdNALe4XOpf25QIBAwKB
+gQCHgupyjYuvCsgNHn7PNtnvVxInrB5MQNoPli+O+uNJWUK/Q+57Rl+yO8AoEzDX
+pFaLWiuVVhsdloDnAgabT/FXzYncs6uOHyEUV+dSXb78vtLPJqAX+Fg2i3hOXreB
+yskcZ13/OsKVOu5wgrJkx2baZufkqMwOSytf5y9nwjEIKwJBAP+inobagVNrN62j
+KQva3cC+UN/6XnKdTc0CA6bHyLOaJoH1xiMwG/VS2PGjHI0tiSMNtLn/QPpHJ003
+iabGhdUCQQDLjp/9UjFT6K6CF66Chqf30pZXhx+GTSQZmv/gvZiMly7X9fX9BGX3
+2MbJohBC4yI21XKTbisWywkF73Hwh+TRAkEAqmxprzxWN5zPyRdwspHpKymLP/w+
+9xOJM1atGdqFzRFvAU6EF3Vn+OHl9my9s3OwwgkjJqorUYTE3iUGby8D4wJBAIe0
+aqjhdjfwdFa6dFcEb/qMZDpaFQQzbWZnVUB+ZbMPdI/5TqitmU/l2dvBYCyXbCSO
+TGJJcg8yBgP09qBamIsCQFL7j1tM0XPVQJQ89WpKCld7O9ORxRGVj1eG0tWijrH8
+mGbYh8SGCVoWV3vrKSS8GBrFVgQnqUaHuEdtM7tpCAQ=
+-----END RSA PRIVATE KEY-----
--- a/graphicstest/uibench/s60/sis/rd.cer	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/uibench/s60/sis/rd.cer	Fri Jul 16 11:45:55 2010 +0300
@@ -1,17 +1,17 @@
------BEGIN CERTIFICATE-----
-MIICzDCCAjWgAwIBAgIBADANBgkqhkiG9w0BAQUFADArMRAwDgYDVQQKEwdSRCBD
-ZXJ0MRcwFQYDVQQDEw5SRCBDZXJ0aWZpY2F0ZTAeFw0wNDExMTUxMjQyMDZaFw0z
-NzA5MjMxMjQyMDZaMCsxEDAOBgNVBAoTB1JEIENlcnQxFzAVBgNVBAMTDlJEIENl
-cnRpZmljYXRlMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDLRF+r1FGGkCwT
-rb420kbnAps7gi1yYUcXYUdWeFTuBeQe5eW46Y+LWaA8HMlDdoHRB0FgASisYcFa
-gwno9+oFf4AJka4H1gWEs5XTGwAA1s0d8XGh7W7Dt9F5FZij8F7/9Pi6+FhhxZFI
-f1DD+yry9D7+Sp+BgdNALe4XOpf25QIBA6OCAQAwgf0wDAYDVR0TBAUwAwEB/zAL
-BgNVHQ8EBAMCAoQwHQYDVR0OBBYEFFi/kuGzxhVpjGxe9ZwlxC3fH9jFMFMGA1Ud
-IwRMMEqAFFi/kuGzxhVpjGxe9ZwlxC3fH9jFoS+kLTArMRAwDgYDVQQKEwdSRCBD
-ZXJ0MRcwFQYDVQQDEw5SRCBDZXJ0aWZpY2F0ZYIBADBsBgNVHSAEZTBjMGEGBFUd
-IAAwWTATBggrBgEFBQcCARYHaHR0cDovLzBCBggrBgEFBQcCAjA2GjRGb3IgUiZE
-IHVzYWdlIG9ubHkuIFRoaXMgY2VydGlmaWNhdGUgaXMgbm90IHRydXN0ZWQuMA0G
-CSqGSIb3DQEBBQUAA4GBAHGB4RQMAgBdeT2hxfOr6f2nA/dZm+M5yX5daUtZnET9
-Ed0A9sazLawfN2G1KFQT9kxEParAyoAkpbMAsRrnRz/9cM3OHgFm/NiKRnf50DpT
-7oCx0I/65mVD2kt+xXE62/Ii5KPnTufIkPi2uLvURCia1tTS8JmJ8dtxDGyQt8BR
------END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIICzDCCAjWgAwIBAgIBADANBgkqhkiG9w0BAQUFADArMRAwDgYDVQQKEwdSRCBD
+ZXJ0MRcwFQYDVQQDEw5SRCBDZXJ0aWZpY2F0ZTAeFw0wNDExMTUxMjQyMDZaFw0z
+NzA5MjMxMjQyMDZaMCsxEDAOBgNVBAoTB1JEIENlcnQxFzAVBgNVBAMTDlJEIENl
+cnRpZmljYXRlMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDLRF+r1FGGkCwT
+rb420kbnAps7gi1yYUcXYUdWeFTuBeQe5eW46Y+LWaA8HMlDdoHRB0FgASisYcFa
+gwno9+oFf4AJka4H1gWEs5XTGwAA1s0d8XGh7W7Dt9F5FZij8F7/9Pi6+FhhxZFI
+f1DD+yry9D7+Sp+BgdNALe4XOpf25QIBA6OCAQAwgf0wDAYDVR0TBAUwAwEB/zAL
+BgNVHQ8EBAMCAoQwHQYDVR0OBBYEFFi/kuGzxhVpjGxe9ZwlxC3fH9jFMFMGA1Ud
+IwRMMEqAFFi/kuGzxhVpjGxe9ZwlxC3fH9jFoS+kLTArMRAwDgYDVQQKEwdSRCBD
+ZXJ0MRcwFQYDVQQDEw5SRCBDZXJ0aWZpY2F0ZYIBADBsBgNVHSAEZTBjMGEGBFUd
+IAAwWTATBggrBgEFBQcCARYHaHR0cDovLzBCBggrBgEFBQcCAjA2GjRGb3IgUiZE
+IHVzYWdlIG9ubHkuIFRoaXMgY2VydGlmaWNhdGUgaXMgbm90IHRydXN0ZWQuMA0G
+CSqGSIb3DQEBBQUAA4GBAHGB4RQMAgBdeT2hxfOr6f2nA/dZm+M5yX5daUtZnET9
+Ed0A9sazLawfN2G1KFQT9kxEParAyoAkpbMAsRrnRz/9cM3OHgFm/NiKRnf50DpT
+7oCx0I/65mVD2kt+xXE62/Ii5KPnTufIkPi2uLvURCia1tTS8JmJ8dtxDGyQt8BR
+-----END CERTIFICATE-----
Binary file graphicstest/uibench/scripts/te_uibench.ini has changed
--- a/graphicstest/uibench/scripts/te_uibench.script	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/uibench/scripts/te_uibench.script	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -46,6 +46,7 @@
 RUN_TEST_STEP 1000 te_uibench ttranslucent z:\uibench\te_uibench.ini
 RUN_TEST_STEP 200 te_uibench tspriteperf z:\uibench\te_uibench.ini
 RUN_TEST_STEP 1000 te_uibench textendedbitmap z:\uibench\te_uibench.ini
+RUN_TEST_STEP 2000 te_uibench tfbsglyphdata z:\uibench\te_uibench.ini
 
 // Performance tests Script  for Hindi text rendering
 RUN_SCRIPT z:\uibench\te_uibench_gdi.script
Binary file graphicstest/uibench/scripts/te_uibench_gce.ini has changed
--- a/graphicstest/uibench/scripts/te_uibench_gce.script	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/uibench/scripts/te_uibench_gce.script	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -47,6 +47,7 @@
 RUN_TEST_STEP 1000 te_uibench ttranslucent z:\uibench\te_uibench.ini
 RUN_TEST_STEP 200 te_uibench tspriteperf z:\uibench\te_uibench.ini
 RUN_TEST_STEP 1000 te_uibench textendedbitmap z:\uibench\te_uibench.ini
+RUN_TEST_STEP 2000 te_uibench tfbsglyphdata z:\uibench\te_uibench.ini
 
 // Performance tests Script  for Hindi text rendering
 RUN_SCRIPT z:\uibench\te_uibench_gdi.script
@@ -63,5 +64,6 @@
 RUN_TEST_STEP 4000 te_uibench_gce tsimpledrawing_directgdi z:\uibench\te_uibench_gce.ini
 RUN_TEST_STEP 1000 te_uibench_gce teventhandlingperf z:\uibench\te_uibench_gce.ini
 RUN_TEST_STEP 20000 te_uibench_gce tflipframerate z:\uibench\te_uibench_gce.ini
+RUN_TEST_STEP 4000 te_uibench_gce trenderoriention z:\uibench\te_uibench_gce.ini
 
 PRINT Complete_te_uibench_gce_Tests
--- a/graphicstest/uibench/src/te_graphicsperformanceSuiteDefs.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/uibench/src/te_graphicsperformanceSuiteDefs.h	Fri Jul 16 11:45:55 2010 +0300
@@ -54,6 +54,17 @@
 	testBooleanTrueWithErrorCodeL((c), (b), (TText8*)__FILE__, __LINE__);\
 	}
 
+// Redefine TEST/TESTE as TEST1/TESTE1 so that all errors are logged, not
+// just the first error.
+#ifdef TEST
+#undef TEST
+#define TEST(a) TEST1(a, ETrue)
+#endif // TEST
+
+#ifdef TESTE
+#undef TESTE
+#define TESTE(a, b) TESTE1(a, b, ETrue)
+#endif // TESTE
 
 #ifdef _USE_PROFILER
 	#define __PROFILERMEMBERS RProcess iProcess; TInt iPErr; RFs iFSession; TBuf<256> iProfLog; TBuf<256> iProfLoE; CFileMan* iFileMan; 
--- a/graphicstest/uibench/src/te_graphicsperformanceSuiteServer.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/uibench/src/te_graphicsperformanceSuiteServer.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -40,6 +40,7 @@
 #include "ttranslucent.h"
 #include "tspriteperf.h"
 #include "textendedbitmap.h"
+#include "tfbsglyphdata.h"
 
 /**
 Same code for Secure and non-secure variants
@@ -158,5 +159,7 @@
 		testStep = new CTSpritePerf();
 	else if(aStepName == KTExtendedBitmap)
 		testStep = new CTExtendedBitmap();
+	else if(aStepName == KTFbsGlyphData)
+		testStep = new CTFbsGlyphData();
 	return testStep;
 	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphicstest/uibench/src/tfbsglyphdata.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,1003 @@
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+#include <graphics/fbsglyphdataiterator.h>
+#include <graphics/fbsglyphmetricsarray.h>
+#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
+#include <sgresource/sgimage.h>
+#include <egl/egl.h>
+#include <vg/openvg.h>
+typedef EGLBoolean (*TvgCreateEGLImageTargetKHRTypefPtr) (VGeglImageKHR image);
+#endif
+#include "tfbsglyphdata.h"
+
+// When defined Hindi language tests are not run. 
+#define UIBENCH_NO_HINDI
+
+// Size of EGLSurface used for rendering to, in pixels.
+const TSize KEglTargetSize(512, 512);
+
+CTFbsGlyphData::CTFbsGlyphData()
+	{
+	SetTestStepName(KTFbsGlyphData);
+	}
+
+CTFbsGlyphData::~CTFbsGlyphData()
+	{
+	}
+
+TVerdict CTFbsGlyphData::doTestStepPreambleL()
+    {
+#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
+    User::LeaveIfError(iFbs.Connect());
+	User::LeaveIfError(iSgDriver.Open());
+#endif
+    return CTe_graphicsperformanceSuiteStepBase::doTestStepPreambleL();
+    }
+
+TVerdict CTFbsGlyphData::doTestStepPostambleL()
+    {
+#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
+    iSgDriver.Close();
+    iFbs.Disconnect();
+#endif
+    return CTe_graphicsperformanceSuiteStepBase::doTestStepPostambleL();
+    }
+
+TVerdict CTFbsGlyphData::doTestStepL()
+	{
+#ifndef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
+    INFO_PRINTF1(_L("CTFbsGlyphData can only be run with SgImage 'Lite'"));
+    return TestStepResult();
+#else
+	SetTestStepID(_L("GRAPHICS-UI-BENCH-0178"));
+	GlyphMetricsArrayL(ETestLanguageLatin, ETrue, 1000);
+	RecordTestResultL();
+
+	SetTestStepID(_L("GRAPHICS-UI-BENCH-0179"));
+	GlyphMetricsArrayL(ETestLanguageLatin, EFalse, 50000);
+	RecordTestResultL();
+	
+#ifndef UIBENCH_NO_HINDI
+    // Tests 180 and 181 require a CMap table in order to convert CharacterCodes to GlyphCodes.
+	SetTestStepID(_L("GRAPHICS-UI-BENCH-0180"));
+	GlyphMetricsArrayL(ETestLanguageHindi, ETrue, 25);
+	RecordTestResultL();
+	
+	SetTestStepID(_L("GRAPHICS-UI-BENCH-0181"));
+	GlyphMetricsArrayL(ETestLanguageHindi, EFalse, 50000);
+	RecordTestResultL();
+#endif
+	
+	SetTestStepID(_L("GRAPHICS-UI-BENCH-0182"));
+	GlyphMetricsQuerySingleGlyphL();
+	RecordTestResultL();
+	
+	SetTestStepID(_L("GRAPHICS-UI-BENCH-0183"));
+	GlyphDataIteratorOpenL(ETestLanguageLatin, ETrue, 50);
+	RecordTestResultL();
+
+	SetTestStepID(_L("GRAPHICS-UI-BENCH-0184"));
+	GlyphDataIteratorOpenL(ETestLanguageLatin, EFalse, 500);
+	RecordTestResultL();
+	
+#ifndef UIBENCH_NO_HINDI
+    // Tests 185 and 186 require a CMap table in order to convert CharacterCodes to GlyphCodes.
+	SetTestStepID(_L("GRAPHICS-UI-BENCH-0185"));
+	GlyphDataIteratorOpenL(ETestLanguageHindi, ETrue, 10);
+	RecordTestResultL();
+	
+	SetTestStepID(_L("GRAPHICS-UI-BENCH-0186"));
+	GlyphDataIteratorOpenL(ETestLanguageHindi, EFalse, 5000);
+	RecordTestResultL();
+#endif	
+	
+	SetTestStepID(_L("GRAPHICS-UI-BENCH-0187"));
+	GlyphDataIteratorOpenSingleFontL();
+	RecordTestResultL();
+	
+	SetTestStepID(_L("GRAPHICS-UI-BENCH-0188"));
+	GlyphMetricsQueryUnrasterizedL();
+	RecordTestResultL();
+	
+	SetTestStepID(_L("GRAPHICS-UI-BENCH-0189"));
+	GlyphMetricsQueryPreRasterizedL();
+	RecordTestResultL();
+	
+	SetTestStepID(_L("GRAPHICS-UI-BENCH-0190"));
+	GlyphRenderingL();
+	RecordTestResultL();
+
+	return TestStepResult();
+#endif
+    }
+
+#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
+/**
+@SYMTestCaseID GRAPHICS-UI-BENCH-0178...0181
+
+@SYMTestType UT
+
+@SYMPREQ PREQ2678
+
+@SYMTestCaseDesc 
+Measures the performance of calling RFbsGlyphMetricsArray::Get() with different sample data.
+The sample data can be a single word, or a very long array of glyphs, in latin or non-latin
+alphabets. At each repetition a different font is used, cycled over nine fonts, to reduce the
+effect of having cached glyphs.
+
+@SYMTestActions
+i. Create some sample fonts to cycle through. 
+ii. Load sample data from config file, specified by aSampleDataKey.
+iii. Create RFbsGlyphMetricsArray, open on sample data.
+iv. For each repetition, call RFbsGlyphMetricsArray::Get(), adjusting font at each repetition.
+v. Measure time from from first to last repetition.
+
+@param aLanguage The language this test will use.
+@param aLongData If ETrue, tells the test to use the long sample data string for the test, EFalse
+	will make the test use the short string data.
+@param aReps The number of times to repeat the test.
+*/
+void CTFbsGlyphData::GlyphMetricsArrayL(TTestLanguage aLanguage, TBool aLongData, TInt aReps)
+	{
+	TBuf<128> KTestName;
+	TPtrC KTestVariant = ConfigKeyNameL(aLanguage, aLongData);
+	KTestName.Format(_L("GlyphMetricsArray %S"), &KTestVariant);
+	
+	// Create some test fonts using the font factory.
+	CTFontFactory* fontFactory = CTFontFactory::NewLC();
+	fontFactory->CreateFontsL(aLanguage, 9);
+
+	// Load the sample string data from the config file.
+	TInt numGlyphCodes = 0;
+	TUint* glyphCodes;
+	LoadConfigSampleDataL(aLanguage, aLongData, glyphCodes, numGlyphCodes);
+
+	// Run the test.
+	TInt err = KErrNone;
+	RFbsGlyphMetricsArray array;
+	CleanupClosePushL(array);
+	iProfiler->InitResults();
+	for (TInt rep = aReps; (rep != 0) && (err == KErrNone); --rep)
+		{
+		err = array.Get(*(fontFactory->NextFont()), glyphCodes, numGlyphCodes);
+		}
+	iProfiler->MarkResultSetL();
+	TESTE(err == KErrNone, err);
+	iProfiler->ResultsAnalysisGlyphRate(KTestName, 0, 0, 0, aReps, numGlyphCodes);
+	
+	CleanupStack::PopAndDestroy(2); // array, fontFactory
+	delete [] glyphCodes;
+	}
+
+/**
+@SYMTestCaseID GRAPHICS-UI-BENCH-0182
+
+@SYMTestType UT
+
+@SYMPREQ PREQ2678
+
+@SYMTestCaseDesc 
+Measures the performance of calling RFbsGlyphDataIterator::Get() with a single glyph,
+versus CFont::GetCharacterData(). Using a single glyph code is a very common use case.
+The glyph and the font is changed at each iteration.
+
+@SYMTestActions
+i. Create some sample fonts to cycle through. 
+ii. Create RFbsGlyphMetricsArray.
+iii. For each repetition, call RFbsGlyphMetricsArray::Get(), adjusting the glyph at 
+	each iteration.
+iv. Measure time from from first to last iteration.
+v. Repeat steps iii. and iv. with CFont::GetCharacterData().
+*/
+void CTFbsGlyphData::GlyphMetricsQuerySingleGlyphL()
+	{
+	_LIT(KTestName, "GlyphMetricsQuerySingleGlyph");
+	const TInt KNumIterations = 50000;
+	TInt err = KErrNone;
+	TBuf<128> KTestNameVariant;
+
+	// Create some test fonts using the font factory.
+	CTFontFactory* fontFactory = CTFontFactory::NewLC();
+	
+	// Run the test for RFbsGlyphMetricsArray, with a different character 
+	// and font for each iteration.
+	KTestNameVariant.Format(_L("%S RFbsGlyphMetricsArray"), &KTestName);
+	fontFactory->CreateFontsL(ETestLanguageLatin, 9);
+	RFbsGlyphMetricsArray array;
+	CleanupClosePushL(array);
+	iProfiler->InitResults();
+	for (TInt rep = KNumIterations; rep != 0 && (err == KErrNone); --rep)
+		{
+		const TUint KGlyphCode = 32 + (rep % 96);
+		err = array.Get(*(fontFactory->NextFont()), &KGlyphCode, 1);
+		}
+	iProfiler->MarkResultSetL();
+	TESTE(err == KErrNone, err);
+	CleanupStack::PopAndDestroy(1); // array
+	iProfiler->ResultsAnalysisGlyphRate(KTestNameVariant, 0, 0, 0, KNumIterations, 1);
+	fontFactory->ReleaseFonts();
+	
+	// Run the test for GetCharacterData(), with a different character
+	// and font for each iteration.
+	KTestNameVariant.Format(_L("%S GetCharacterData"), &KTestName);
+	fontFactory->CreateFontsL(ETestLanguageLatin, 9);
+	TOpenFontCharMetrics metrics;
+	const TUint8* bitmapData = NULL;
+	TSize bitmapSize;
+	iProfiler->InitResults();
+	for (TInt rep = KNumIterations; rep != 0; --rep)
+		{
+		const TUint KGlyphCode = 32 + (rep % 96);
+		fontFactory->NextFont()->GetCharacterData(KGlyphCode, metrics, bitmapData, bitmapSize);
+		}
+	iProfiler->MarkResultSetL();
+	iProfiler->ResultsAnalysisGlyphRate(KTestNameVariant, 0, 0, 0, KNumIterations, 1);
+	
+	CleanupStack::PopAndDestroy(1); // fontFactory
+	}
+
+/**
+@SYMTestCaseID GRAPHICS-UI-BENCH-0183...0186
+
+@SYMTestType UT
+
+@SYMPREQ PREQ2678
+
+@SYMTestCaseDesc 
+Measures the performance of calling RFbsGlyphDataIterator::Open() with different 
+sample data, and iterating through the data with RFbsGlyphDataIterator::Next(). 
+The sample data can be a single word, or a very long array of glyphs,
+in various languages. At each repetition a different font is used, cycled
+over nine fonts.
+
+@SYMTestActions
+i. Create some sample fonts to cycle through. 
+ii. Create RFbsGlyphDataIterator.
+iii. For each repetition, call RFbsGlyphDataIterator::Open(), adjusting the glyph at each 
+	iteration. The font is changed at each repetition.
+iv. Measure time from from first to last repetition.
+
+@param aLanguage The language this test will use.
+@param aLongData If ETrue, tells the test to use the long sample data string for the test, EFalse
+	will make the test use the short string data.
+@param aReps The number of times to repeat the test.
+ */
+void CTFbsGlyphData::GlyphDataIteratorOpenL(TTestLanguage aLanguage, TBool aLongData, TInt aReps)
+	{
+	TBuf<128> KTestName;
+	TPtrC KTestVariant = ConfigKeyNameL(aLanguage, aLongData);
+	KTestName.Format(_L("GlyphDataIteratorOpen %S"), &KTestVariant);
+	
+	// Create some test fonts using the font factory.
+	CTFontFactory* fontFactory = CTFontFactory::NewLC();
+	fontFactory->CreateFontsL(aLanguage, 9);
+	
+	// Load the sample string data from the config file.
+	TInt numGlyphCodes = 0;
+	TUint* glyphCodes;
+	LoadConfigSampleDataL(aLanguage, aLongData, glyphCodes, numGlyphCodes);
+
+	// Run the test.
+	TInt err = KErrNotFound;
+	RFbsGlyphDataIterator iter;
+	CleanupClosePushL(iter);
+	iProfiler->InitResults();
+	for (TInt rep = aReps; (rep != 0) && (err == KErrNotFound); --rep)
+		{
+		err = iter.Open(*(fontFactory->NextFont()), glyphCodes, numGlyphCodes);
+		for (; err == KErrNone; err = iter.Next())
+			{
+			// no operation
+			}
+		iter.Close();
+		}
+	iProfiler->MarkResultSetL();
+	TESTE(err == KErrNotFound, err);
+
+	CleanupStack::PopAndDestroy(2); // iter, fontFactory
+	iProfiler->ResultsAnalysisGlyphRate(KTestName, 0, 0, 0, aReps, numGlyphCodes);
+	delete [] glyphCodes;
+	}
+
+/**
+@SYMTestCaseID GRAPHICS-UI-BENCH-0187
+
+@SYMTestType UT
+
+@SYMPREQ PREQ2678
+
+@SYMTestCaseDesc 
+Measures the performance of calling RFbsGlyphDataIterator::Open() with different 
+lengthed arrays but the same font. The sample data is a long array of characters.
+
+@SYMTestActions
+i. Create a single test font 
+ii. Create RFbsGlyphDataIterator.
+iii. Pass an array to RFbsGlyphDataIterator::Open(), starting with a single glyph.
+	For each iteration, increase the length of the array by one until the entire
+	string has been opened.
+iv. Measure the time to perform all the iterations.
+
+@param aSampleDataKey The string key to lookup under the GlyphArraySampleText section of the 
+	config file where the sample data is read.
+@param aReps The number of times to repeat the test.
+ */
+void CTFbsGlyphData::GlyphDataIteratorOpenSingleFontL()
+	{
+	_LIT(KTestName, "GlyphDataIteratorOpenSingleFont");
+	// A cap on the max number of iterations to complete.
+	const TInt KMaxNumIterations = 200;
+#ifndef UIBENCH_NO_HINDI
+    const TTestLanguage KTestLanguage = ETestLanguageHindi;
+#else
+    const TTestLanguage KTestLanguage = ETestLanguageLatin;
+#endif
+	
+	// Create some test fonts using the font factory.
+	CTFontFactory* fontFactory = CTFontFactory::NewLC();
+	fontFactory->CreateFontsL(KTestLanguage, 1);
+	CFbsFont* font = fontFactory->NextFont();
+	
+	// Load the sample string data from the config file.
+	TInt numGlyphCodes = 0;
+	TUint* glyphCodes;
+	LoadConfigSampleDataL(KTestLanguage, ETrue, glyphCodes, numGlyphCodes); 
+	
+	const TInt KNumRepetitions = Min<TInt>(numGlyphCodes - 1, KMaxNumIterations);
+	RFbsGlyphDataIterator iter;
+	CleanupClosePushL(iter);
+	TInt iterErr = KErrNone;
+	TInt glyphCount = 0;
+	iProfiler->InitResults();
+	for (glyphCount = 1; (glyphCount < KNumRepetitions); ++glyphCount)
+		{
+		iterErr = iter.Open(*font, glyphCodes, glyphCount);
+		for (; iterErr == KErrNone; iterErr = iter.Next())
+			{
+			// no operation
+			}
+		iter.Close();
+		}
+	iProfiler->MarkResultSetL();
+	TEST(glyphCount == KNumRepetitions);
+	TESTE(iterErr == KErrNotFound, iterErr);
+	
+	const TInt KAvgNumCharsPerIteration = KNumRepetitions/2;
+	iProfiler->ResultsAnalysisGlyphRate(KTestName, 0, 0, 0, KNumRepetitions, KAvgNumCharsPerIteration);
+	
+	CleanupStack::PopAndDestroy(2); // iter, fontFactory
+	delete [] glyphCodes;
+	}
+/**
+@SYMTestCaseID GRAPHICS-UI-BENCH-0188
+
+@SYMTestType UT
+
+@SYMPREQ PREQ2678
+
+@SYMTestCaseDesc 
+Measures the performance of querying the TOpenFontCharMetrics using the different
+available APIs. RFbsGlyphMetricsArray, RFbsGlyphDataIterator, and CFont::GetCharacterData()
+are compared against each other, using the same fonts, and same sample data.
+This test uses glyphs that have not been rasterized before, therefore for certain
+APIs this will mean rasterizing the glyphs.
+
+@SYMTestActions
+i. Load sample text data from config file.
+ii. For each of RFbsGlyphMetricsArray, RFbsGlyphDataIterator, and CFont::GetCharacterData():
+	1. Create 50 new fonts.
+	2. Run the test, calling the necessary API once per font/loop.
+	3. For GetCharacterData() and RFbsGlyphDataIterator(), cycle through each glyph
+		to ensure all metrics have been retrieved. This is not necessary for 
+		RFbsGlyphMetricsArray.
+	4. Measure time between first and last font/loop.
+	5. Destroy test fonts so that next test has to re-rasterize the glyphs.	
+
+@SYMTestExpectedResults
+Since this test uses non-rasterized fonts, RFbsGlyphMetricsArray should be faster than
+GetCharacterData() and RFbsGlyphDataIterator, which both rasterize the glyphs in order to 
+get their metrics information.
+ */
+void CTFbsGlyphData::GlyphMetricsQueryUnrasterizedL()
+	{
+	_LIT(KTestName, "GlyphMetricsQueryUnrasterized");
+	TBuf<128> KTestNameVariant;
+	const TInt KNumFonts = 50;
+	const TTestLanguage KTestLanguage = ETestLanguageLatin;
+	
+	// Load the sample string data from the config file. Both the iterator and the
+	// array will use this same sample data.
+	TInt numGlyphCodes = 0;
+	TUint* glyphCodes;
+	LoadConfigSampleDataL(KTestLanguage, ETrue, glyphCodes, numGlyphCodes); 
+	
+	// Create some test fonts using the font factory.
+	CTFontFactory* fontFactory = CTFontFactory::NewLC();
+	
+	// First do the test for the iterator. To ensure fair comparison with
+	// RFbsGlyphMetricsArray, cycle through each iteration to ensure the metrics
+	// for each glyph is found.
+	KTestNameVariant.Format(_L("%S RFbsGlyphDataIterator"), &KTestName);
+	fontFactory->CreateFontsL(KTestLanguage, KNumFonts);
+	RFbsGlyphDataIterator iter;
+	CleanupClosePushL(iter);
+	TInt iterErr = KErrNone;
+	TInt rep = 0;
+	iProfiler->InitResults();
+	for (rep = KNumFonts; (rep != 0); --rep)
+		{
+		iterErr = iter.Open(*(fontFactory->NextFont()), glyphCodes, numGlyphCodes);
+		for (; iterErr == KErrNone; iterErr = iter.Next())
+			{
+			// no operation
+			}
+		iter.Close();
+		}
+	iProfiler->MarkResultSetL();
+	TEST(rep == 0);
+	TESTE(iterErr == KErrNotFound, iterErr);
+	CleanupStack::PopAndDestroy(1); // iter		
+	iProfiler->ResultsAnalysisGlyphRate(KTestNameVariant, 0, 0, 0, KNumFonts, numGlyphCodes);
+	
+	// Second, do the test for the array. This should be faster.
+	// Destroy the fonts and re-create them so that they have to be re-rasterized
+	// for a fair comparison.
+	TInt arrayErr = KErrNone;
+	KTestNameVariant.Format(_L("%S RFbsGlyphMetricsArray"), &KTestName);
+	fontFactory->ReleaseFonts();
+	fontFactory->CreateFontsL(KTestLanguage, KNumFonts);
+	RFbsGlyphMetricsArray array;
+	CleanupClosePushL(array);
+	iProfiler->InitResults();	
+	for (TInt rep = KNumFonts; (rep != 0) && (arrayErr == KErrNone); --rep)
+		{
+		arrayErr = array.Get(*(fontFactory->NextFont()), glyphCodes, numGlyphCodes);
+		}
+	iProfiler->MarkResultSetL();
+	CleanupStack::PopAndDestroy(1); // array
+	TEST(rep == 0);
+	TESTE(arrayErr == KErrNone, arrayErr);
+	iProfiler->ResultsAnalysisGlyphRate(KTestNameVariant, 0, 0, 0, KNumFonts, numGlyphCodes);
+	
+	// Third, do the test using GetCharacterData() to get the metrics.
+	// Destroy the fonts and re-create them so that they have to be re-rasterized
+	// for a fair comparison.
+	KTestNameVariant.Format(_L("%S GetCharacterData"), &KTestName);
+	fontFactory->ReleaseFonts();
+	fontFactory->CreateFontsL(KTestLanguage, KNumFonts);	
+	iProfiler->InitResults();
+	const TUint8* bitmapData = NULL;
+	TSize bitmapSize;
+	TOpenFontCharMetrics metrics;	
+	for (TInt rep = KNumFonts; (rep != 0); --rep)
+		{
+		CFbsFont* font = fontFactory->NextFont(); 
+		for (TInt glyphIndex = 0; glyphIndex < numGlyphCodes; glyphIndex++)
+			{
+			font->GetCharacterData(glyphCodes[glyphIndex], metrics, bitmapData, bitmapSize);
+			}
+		}
+	iProfiler->MarkResultSetL();
+	iProfiler->ResultsAnalysisGlyphRate(KTestNameVariant, 0, 0, 0, KNumFonts, numGlyphCodes);
+	
+	CleanupStack::PopAndDestroy(1); // fontFactory
+	delete [] glyphCodes;
+	}
+
+/**
+@SYMTestCaseID GRAPHICS-UI-BENCH-0189
+
+@SYMTestType UT
+
+@SYMPREQ PREQ2678
+
+@SYMTestCaseDesc 
+Measures the performance of querying the TOpenFontCharMetrics using the different
+available APIs. RFbsGlyphMetricsArray, RFbsGlyphDataIterator, and CFont::GetCharacterData()
+are compared against each other, using the same fonts, and same sample data.
+This test uses glyphs that have already been rasterized, thereby possibly reducing the 
+extra overhead this has.
+
+@SYMTestActions
+i. Load sample text data from config file.
+ii. Create test font.
+iii. Pre-rasterize glyphs using RFbsGlyphDataIterator. This will rasterize the glyphs 
+	and cause them to be cached for use by all the APIs tested here.
+iv. For each of RFbsGlyphMetricsArray, RFbsGlyphDataIterator, and CFont::GetCharacterData():
+	1. Begin the loop, calling the necessary API once per font/loop.
+	2. For each glyph, request the glyph metrics.
+	3. Measure time between first and last font/loop.
+v. Destroy test font.
+
+@SYMTestExpectedResults
+All results should be improved over GlyphMetricsQueryUnrasterized (GRAPHICS-UI-BENCH-0187).
+since no rasterizing should take place during these tests.
+ */
+void CTFbsGlyphData::GlyphMetricsQueryPreRasterizedL()
+	{
+	_LIT(KTestName, "GlyphMetricsQueryPreRasterized");
+	TBuf<128> KTestNameVariant;
+	const TInt KNumIterations = 500;
+	const TTestLanguage KTestLanguage = ETestLanguageLatin;
+		
+	TInt numGlyphCodes = 0;
+	TUint* glyphCodes;
+	LoadConfigSampleDataL(KTestLanguage, ETrue, glyphCodes, numGlyphCodes); 
+	
+	// Create a test font using the font factory.
+	CTFontFactory* fontFactory = CTFontFactory::NewLC();
+	fontFactory->CreateFontsL(ETestLanguageLatin, 1);	
+	CFbsFont* font = fontFactory->NextFont();
+	
+	TInt iterErr = KErrNone;
+	TInt rep = 0;
+	// Rasterize the glyphs first.
+	RFbsGlyphDataIterator iter;
+	CleanupClosePushL(iter);
+	for (rep = KNumIterations; (rep != 0) ; --rep)
+		{
+		iterErr = iter.Open(*font, glyphCodes, numGlyphCodes);
+		for (; iterErr == KErrNone; iterErr = iter.Next())
+			{
+			// no operation
+			}
+		iter.Close();
+		}
+	TEST(rep == 0);
+	TESTE(iterErr == KErrNotFound, iterErr);
+	
+	TOpenFontCharMetrics metrics;
+		
+	// First do the test for the iterator. To ensure fair comparison with
+	// RFbsGlyphMetricsArray, cycle through each iteration to ensure the metrics
+	// for each glyph is found.
+	iterErr = KErrNone;
+	KTestNameVariant.Format(_L("%S RFbsGlyphDataIterator"), &KTestName);
+	iProfiler->InitResults();
+	for (TInt rep = KNumIterations; (rep != 0); --rep)
+		{
+		for (iterErr = iter.Open(*font, glyphCodes, numGlyphCodes); iterErr == KErrNone; iterErr = iter.Next())
+			{
+			metrics = iter.Metrics();
+			}
+		iter.Close();
+		}
+	iProfiler->MarkResultSetL();
+	TESTE(iterErr == KErrNotFound, iterErr);
+	CleanupStack::PopAndDestroy(1); // iter
+	iProfiler->ResultsAnalysisGlyphRate(KTestNameVariant, 0, 0, 0, KNumIterations, numGlyphCodes);
+	
+	
+	// Second, do the test for the array. This should be faster.
+	TInt arrayErr = KErrNone;
+	KTestNameVariant.Format(_L("%S RFbsGlyphMetricsArray"), &KTestName);
+	RFbsGlyphMetricsArray array;
+	CleanupClosePushL(array);
+	iProfiler->InitResults();
+	for (TInt rep = KNumIterations; (rep != 0) && (arrayErr == KErrNone); --rep)
+		{
+		arrayErr = array.Get(*font, glyphCodes, numGlyphCodes);
+		for (TInt i = 0; i < numGlyphCodes; ++i)
+			{
+			metrics = array[i];
+			}
+		}
+	iProfiler->MarkResultSetL();
+	TESTE(arrayErr == KErrNone, arrayErr);
+	CleanupStack::PopAndDestroy(1); // array
+	iProfiler->ResultsAnalysisGlyphRate(KTestNameVariant, 0, 0, 0, KNumIterations, numGlyphCodes);
+	
+	
+	// Third, do the test using GetCharacterData() to get the metrics.
+	KTestNameVariant.Format(_L("%S GetCharacterData"), &KTestName);
+	const TUint8* bitmapData;
+	TSize bitmapSize;
+
+	iProfiler->InitResults();
+	for (TInt rep = KNumIterations; (rep != 0); --rep)
+		{
+		for (TInt glyphIndex = 0; glyphIndex < numGlyphCodes; glyphIndex++)
+			{
+			font->GetCharacterData(glyphCodes[glyphIndex], metrics, bitmapData, bitmapSize);
+			}
+		}
+	iProfiler->MarkResultSetL();
+	iProfiler->ResultsAnalysisGlyphRate(KTestNameVariant, 0, 0, 0, KNumIterations, numGlyphCodes);
+	
+	CleanupStack::PopAndDestroy(1); // fontFactory
+	delete [] glyphCodes;
+	}
+
+/**
+@SYMTestCaseID GRAPHICS-UI-BENCH-0190
+
+@SYMTestType UT
+
+@SYMPREQ PREQ2678
+
+@SYMTestCaseDesc 
+Measures the end-to-end performance of using Khronos APIs to render glyphs using the
+RFbsGlyphDataIterator API. Positioning is very basic and is not reflective of a production-
+quality text-rendering algorithm, but serves as a useful benchmark of the overall
+text-rendering performance using this API.
+
+@SYMTestActions
+i. Create a sample font to use. 
+ii. Create a RSgImage to be used as a target for Khronos API rendering.
+iii. Set-up EGL and OpenVG.
+iv. Construct RFbsGlyphDataIterator, and open on sample data. At each iteration:
+	1. Create an EGLImage from the RSgImage.
+	2. Create a VGImage from the EGLImage.
+	3. Render the VGImage using vgDrawImage().
+	4. Destroy VGImage.
+	5. Destroy EGLImage.
+	6. Advance the current rendering position for the next glyph, ensuring that every glyph
+	will be within the bounds of the target surface.
+v. Measure time from from first to last iteration.
+*/
+void CTFbsGlyphData::GlyphRenderingL()
+	{
+	_LIT(KTestName, "GlyphRendering");
+	const TInt KNumIterations = 500;
+#ifndef UIBENCH_NO_HINDI
+    const TTestLanguage KTestLanguage = ETestLanguageHindi;
+#else
+    const TTestLanguage KTestLanguage = ETestLanguageLatin;
+#endif
+	
+	// Create some test fonts using the font factory.
+	CTFontFactory* fontFactory = CTFontFactory::NewLC();
+	fontFactory->CreateFontsL(KTestLanguage, 1, 20);
+	CFbsFont* font = fontFactory->NextFont();
+	const TInt KFontHeightInPixels = font->HeightInPixels();
+
+	// Create RSgImage to be used as OpenVG Pixmap Surface
+
+	RSgImage target;
+	TInt err = target.Create(TSgImageInfo(KEglTargetSize, ESgPixelFormatARGB_8888_PRE, ESgUsageBitOpenVgSurface));
+	TESTL(err == KErrNone);
+	CleanupClosePushL(target);
+	
+	// Initialize EGL/OpenVG for rendering.
+	EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+	if (display == EGL_NO_DISPLAY)
+		{
+		ERR_PRINTF2(_L("Failed to get EGLDisplay. [eglError=%X]"), eglGetError());
+		User::Leave(KErrGeneral);
+		}
+	TESTL(display != EGL_NO_DISPLAY);
+	if (EGL_FALSE == eglInitialize(display, NULL, NULL))
+		{
+		ERR_PRINTF2(_L("Failed to initialize EGLDisplay. [eglError=%X]"), eglGetError());
+		User::Leave(KErrGeneral);
+		}
+	eglBindAPI(EGL_OPENVG_API);
+	
+	EGLint imageAttribs[] =
+	    {
+	    EGL_IMAGE_PRESERVED_SYMBIAN, EGL_TRUE, 
+	    EGL_NONE
+	    };
+	EGLint configAttribs[] = 
+		{
+		EGL_MATCH_NATIVE_PIXMAP, (EGLint)&target,
+		EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT,
+		EGL_SURFACE_TYPE, EGL_PIXMAP_BIT | EGL_VG_ALPHA_FORMAT_PRE_BIT, 
+		EGL_NONE
+		};
+	
+	const EGLint KPixmapAttribsVgAlphaFormatPre[] = 
+	    {
+	    EGL_VG_ALPHA_FORMAT, EGL_VG_ALPHA_FORMAT_PRE,
+	    EGL_NONE
+	    };
+		
+	EGLint configId = 0;
+	EGLint numConfigs = 0;
+	if (EGL_FALSE == eglChooseConfig(display, configAttribs, &configId, 1, &numConfigs) || numConfigs == 0)
+		{
+		ERR_PRINTF3(_L("Failed to find suitable EGLConfig. [eglError=%X, configs=%d]"), eglGetError(), numConfigs);
+		User::Leave(KErrGeneral);
+		}
+	EGLContext context = eglCreateContext(display, configId, EGL_NO_CONTEXT, NULL);
+	if (context == EGL_NO_CONTEXT)
+		{
+		ERR_PRINTF2(_L("Failed to create EGLContext. [eglError=%X]"), eglGetError());
+		User::Leave(KErrGeneral);
+		}
+	EGLSurface surface = eglCreatePixmapSurface(display, configId, &target, KPixmapAttribsVgAlphaFormatPre);
+	if (EGL_FALSE == eglMakeCurrent(display, surface, surface, context))
+		{
+		ERR_PRINTF2(_L("Failed to create make surface and context current. [eglError=%X]"), eglGetError());
+		eglDestroyContext(display, context);
+		User::Leave(KErrGeneral);
+		}
+	
+	// Load the necessary EGL extensions...
+	TvgCreateEGLImageTargetKHRTypefPtr vgCreateImageTargetKHR;
+	PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR;
+	PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR;
+	eglCreateImageKHR = reinterpret_cast<PFNEGLCREATEIMAGEKHRPROC>(eglGetProcAddress("eglCreateImageKHR"));
+	eglDestroyImageKHR = reinterpret_cast<PFNEGLDESTROYIMAGEKHRPROC>(eglGetProcAddress("eglDestroyImageKHR"));
+	vgCreateImageTargetKHR = reinterpret_cast<TvgCreateEGLImageTargetKHRTypefPtr>(eglGetProcAddress("vgCreateEGLImageTargetKHR"));
+	if (!eglCreateImageKHR || !eglDestroyImageKHR || !vgCreateImageTargetKHR)
+		{
+		ERR_PRINTF1(_L("Failed to get EGL Image extension functions."));
+		User::Leave(KErrNotSupported);
+		}
+	// Now we have an OpenVG window to render to!
+	
+	TInt numGlyphCodes = 0;
+	TUint* glyphCodes;
+	LoadConfigSampleDataL(KTestLanguage, EFalse, glyphCodes, numGlyphCodes); 
+
+	// Set up an identity matrix compatible with the Symbian co-ordinate system.
+	vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE);
+	vgScale(1.f, -1.f);
+	vgTranslate(0, -KFontHeightInPixels);	
+	VGfloat vgIdentityMatrix[16];
+	vgGetMatrix(vgIdentityMatrix);
+	
+	RFbsGlyphDataIterator iter;
+	CleanupClosePushL(iter);
+		
+	// Render some glyphs.
+	TInt iterErr = KErrNone;
+	TInt rep = 0;
+	vgClear(0, 0, KEglTargetSize.iWidth, KEglTargetSize.iHeight);
+	TPoint glyphOrigin(0, 0);
+	iProfiler->InitResults();
+	for (rep = 0; rep < KNumIterations; rep++)
+		{
+		iterErr = iter.Open(*font, glyphCodes, numGlyphCodes);
+		for (;iterErr == KErrNone; iterErr = iter.Next())
+			{
+			const TOpenFontCharMetrics& metrics = iter.Metrics();
+			const RSgImage& glyphSgImage = iter.Image();
+			EGLImageKHR eglImage = eglCreateImageKHR(display, EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, 
+					reinterpret_cast<EGLClientBuffer>(&glyphSgImage), imageAttribs);
+			VGImage vgImage = vgCreateImageTargetKHR(eglImage);
+			
+			// wrapped text placement.			
+			TInt horizAdvance = metrics.HorizAdvance();
+			if (glyphOrigin.iX + horizAdvance >= KEglTargetSize.iWidth)
+				{
+				vgLoadMatrix(vgIdentityMatrix);
+				glyphOrigin.iX = 0;
+				glyphOrigin.iY -= KFontHeightInPixels;
+				if (glyphOrigin.iY - KFontHeightInPixels < -KEglTargetSize.iHeight)
+					{
+					glyphOrigin.iY = 0;
+					}
+				vgTranslate(glyphOrigin.iX, glyphOrigin.iY);
+				}
+			
+			vgDrawImage(vgImage);
+			vgDestroyImage(vgImage);
+			eglDestroyImageKHR(display, eglImage);
+				
+			// Move to next glyph position.
+			glyphOrigin.iX += horizAdvance;
+			vgTranslate(horizAdvance, 0);
+			}
+		iter.Close();
+		eglSwapBuffers(display, surface);
+		}
+	iProfiler->MarkResultSetL();
+	iProfiler->ResultsAnalysisGlyphRate(KTestName, 0, 0, 0, KNumIterations, numGlyphCodes);
+	TEST(rep == KNumIterations);
+	TESTE(iterErr == KErrNotFound, iterErr);	
+	WriteTargetOutput(KTestName());
+	
+	eglDestroySurface(display, surface);
+	eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+	eglTerminate(display);
+	eglReleaseThread();
+	
+	CleanupStack::PopAndDestroy(3); // iter, target, fontFactory
+	delete [] glyphCodes;
+	}
+#endif
+
+/**
+Captures the EGL Surface (it is assumed to be an OpenVG surface) to a 256-grey CFbsBitmap,
+used when sanity-checking bitmaps are enabled. 
+*/
+CFbsBitmap* CTFbsGlyphData::GetTargetAsBitmapL()
+	{
+#ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
+	// For debugging purposes only.
+	// Capture the final state of the EGL Pixmap surface as an mbm.
+	TSize KTargetSize;
+	const TSize KBufferSize = KEglTargetSize;
+	const TInt KDataStride = KEglTargetSize.iWidth;
+	
+	TUint8* imageBuffer = reinterpret_cast<TUint8*>(User::AllocZ(KBufferSize.iHeight * KDataStride));
+	CFbsBitmap* bitmap = new (ELeave) CFbsBitmap();
+	CleanupStack::PushL(bitmap);
+	User::LeaveIfError(bitmap->Create(KBufferSize, EGray256));
+	vgReadPixels(imageBuffer, KDataStride, VG_A_8, 0, 0, KBufferSize.iWidth, KBufferSize.iHeight);
+	TUint8* buf = imageBuffer;
+	bitmap->BeginDataAccess();
+	TUint8* dataAddress = reinterpret_cast<TUint8*>(bitmap->DataAddress());
+	const TInt dataStride = bitmap->DataStride();	
+	for (TInt scanline = 0; scanline < KBufferSize.iHeight; scanline++)
+		{
+		Mem::Copy(dataAddress, buf, KBufferSize.iWidth);
+		dataAddress += dataStride;
+		buf += KBufferSize.iWidth;
+		}
+	bitmap->EndDataAccess(EFalse);
+	User::Free(imageBuffer);
+	CleanupStack::Pop(1); // bitmap
+	return bitmap;
+#else
+	return NULL;
+#endif
+	}
+
+/**
+Utility method. Loads sample glyph code data from the config ini file
+into a TUint array.
+@param aKey The key string to look for when loading the sample data from the config file
+@param aGlyphCodes On success, holds an array of glyph codes, to be freed by the caller.
+@param aNumGlyphCodes On success, holds the count of the glyph code array.
+@leave KErrNotFound if the test data cannot be found or is empty in the config file.
+ */
+void CTFbsGlyphData::LoadConfigSampleDataL(TTestLanguage aLanguage, TBool aLongData, TUint*& aGlyphCodes, TInt& aNumGlyphCodes)
+	{
+	// The name of the section in the config file to look-up the sample data
+	_LIT(KConfigFileSampleData, "GlyphDataSampleText");
+	
+	TBuf<32> keyName = ConfigKeyNameL(aLanguage, aLongData);
+	
+	// Load the sample string data from the config file.
+	TPtrC sampleText;
+	TESTL(GetStringFromConfig(KConfigFileSampleData, keyName, sampleText));
+	aNumGlyphCodes = sampleText.Length();
+	if (aNumGlyphCodes <= 0)
+		{
+		User::Leave(KErrNotFound);
+		}
+	aGlyphCodes = new(ELeave) TUint[aNumGlyphCodes];
+	for (TInt code = 0; code < aNumGlyphCodes; ++code)
+		{
+		aGlyphCodes[code] = sampleText[code]; 
+		}
+	}
+
+/**
+Creates the name of the key to look for in the config file for the test
+with the specified parameters.
+@param aLanguage The language the test will use.
+@param aLongData Whether to use long or short sample data.
+@return A descriptor value of the language.
+@leave KErrNotSupported if aLanguage is not recognised.
+ */
+TBufC<32> CTFbsGlyphData::ConfigKeyNameL(TTestLanguage aLanguage, TBool aLongData)
+	{
+	if (aLanguage < 0 || aLanguage > 1)
+		{
+		User::Leave(KErrNotSupported);
+		}
+	TBuf<32> langName[2];
+	langName[ETestLanguageLatin].Append(_L("Latin"));
+	langName[ETestLanguageHindi].Append(_L("Hindi"));	
+	langName[aLanguage].Append((aLongData) ? _L("Long") : _L("Short"));
+	return langName[aLanguage];
+	}
+
+/**
+Font factory.
+Utiltiy class for providing fonts for the performance tests.
+*/
+
+CTFontFactory::CTFontFactory()
+	{
+	}
+
+CTFontFactory::~CTFontFactory()
+	{
+	ReleaseFonts();
+	delete iTs;
+	}
+
+/**
+@return A new Font Factory ready to create fonts.
+*/
+CTFontFactory* CTFontFactory::NewLC()
+	{
+	CTFontFactory* fontFactory = new (ELeave) CTFontFactory();
+	CleanupStack::PushL(fontFactory);
+	fontFactory->iTs = static_cast<CFbsTypefaceStore*>(CFbsTypefaceStore::NewL(NULL));
+	return fontFactory;
+	}
+
+/**
+Creates a number of fonts for use by tests. All the fonts are created up-front so 
+that NextFont() can be called as a very lightweight call, so it can be used inside
+tests with minimal impact.
+Once fonts are created, the factory must not be destroyed until the fonts it created
+are finished with.
+@param aLanaugeMask Which language needs to be supported by the returned fonts.
+@param aNumFonts The number of fonts to create
+@param aStartSizeInPixels The lower bound font height of the fonts that are created. All
+	fonts will be at least as big as this value.
+*/
+void CTFontFactory::CreateFontsL(TTestLanguage aLanguageMask, TInt aNumFonts, TInt aStartSizeInPixels)
+	{
+	ReleaseFonts();
+	
+	RArray <TPtrC> typefaceNames;
+	CleanupClosePushL(typefaceNames);
+	switch(aLanguageMask)
+		{
+		case ETestLanguageHindi:	
+			User::LeaveIfError(typefaceNames.Reserve(1));
+			typefaceNames.Append(_L("Devanagari OT Eval"));
+			break;
+		case ETestLanguageLatin:
+			User::LeaveIfError(typefaceNames.Reserve(3));
+			typefaceNames.Append(_L("DejaVu Sans Condensed"));
+			typefaceNames.Append(_L("DejaVu Serif"));
+			typefaceNames.Append(_L("DejaVu Sans Mono"));
+			break;
+		default:
+			User::Leave(KErrNotSupported);
+		}
+	const TInt KNumTypefaces = typefaceNames.Count();
+		
+	iFont = new CFbsFont*[aNumFonts];
+	for (TInt count = 0; count < aNumFonts; ++count)
+		{
+		// After every KNumTypefaces font, increase size by 5.
+		TInt size = aStartSizeInPixels + (5 *(count / KNumTypefaces));
+		TPtrC typefaceName = typefaceNames[count % KNumTypefaces];
+		TFontSpec fontSpec(typefaceName, size);
+		User::LeaveIfError(iTs->GetNearestFontToDesignHeightInPixels((CFont*&)iFont[count], fontSpec));
+		++iNumFonts;
+		}
+	iCurFont = -1;
+	CleanupStack::PopAndDestroy(1); // typefaceNames
+	}
+/**
+Releases all created fonts and frees associated memory.
+*/
+void CTFontFactory::ReleaseFonts()
+	{
+	for (TInt font = 0; font < iNumFonts; ++font)
+		{
+		iTs->ReleaseFont(iFont[font]);
+		}
+	delete [] iFont;
+	iFont = NULL;
+	iNumFonts = 0;
+	}
+
+/**
+@return The next font to be used. If it reaches the last font, the next font will
+	cycle back around to the first font.
+*/
+CFbsFont* CTFontFactory::NextFont()
+	{
+	return iFont[++iCurFont%iNumFonts];
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphicstest/uibench/src/tfbsglyphdata.h	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,98 @@
+// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+#ifndef TFBSGLYPHDATA_H
+#define TFBSGLYPHDATA_H
+
+#include <fbs.h>
+#include <sgresource/sgresource.h>
+#include "te_graphicsperformanceSuiteStepBase.h"
+
+/**
+Enumeration of languages that are supported for testing in this framework.
+ */
+enum TTestLanguage
+	{
+	ETestLanguageLatin,
+	ETestLanguageHindi
+	};
+
+/**
+Test case to test the performance of RFbsGlyphDataIterator and RFbsGlyphMetricsArray.
+*/
+class CTFbsGlyphData : public CTe_graphicsperformanceSuiteStepBase
+    {
+public:
+	CTFbsGlyphData();
+	~CTFbsGlyphData();
+	
+	// From CTe_graphicsperformanceSuiteStepBase
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+	virtual CFbsBitmap* GetTargetAsBitmapL();
+    
+private:
+	// Tests
+	void GlyphMetricsArrayL(TTestLanguage aLanguage, TBool aLongData, TInt aReps);
+	void GlyphMetricsQuerySingleGlyphL();
+	void GlyphDataIteratorOpenL(TTestLanguage aLanguage, TBool aLongData, TInt aReps);
+	void GlyphDataIteratorOpenSingleFontL();
+	void GlyphMetricsQueryUnrasterizedL();
+	void GlyphMetricsQueryPreRasterizedL();
+	void GlyphRenderingL();
+	
+	// Utility methods
+	void LoadConfigSampleDataL(TTestLanguage aLanguage, TBool aLongData, TUint*& aGlyphCodes, TInt& aNumGlyphCodes);
+	static TBufC<32> ConfigKeyNameL(TTestLanguage aLanguage, TBool aLongData);
+	
+private:
+	RFbsSession iFbs;
+	RSgDriver iSgDriver;
+    };
+
+_LIT(KTFbsGlyphData,"tfbsglyphdata");
+
+/**
+Utility class. Provides the tests with a number of different fonts to use.
+Manages their creation and destruction.
+ */
+class CTFontFactory : public CBase
+	{
+public:
+	static CTFontFactory* NewLC();
+	~CTFontFactory();
+	
+	void CreateFontsL(TTestLanguage aLanguageMask, TInt aNumFonts, TInt aStartSizeInPixels = 5);
+	TInt NumFonts() const;
+	CFbsFont* NextFont();
+	void ReleaseFonts();
+private:
+	CTFontFactory();
+private:
+	CFbsFont** iFont;
+	TInt iNumFonts;
+	TInt iCurFont;
+	CFbsTypefaceStore* iTs;
+	};
+
+
+#endif /* TFBSGLYPHDATA_H */
--- a/graphicstest/uibench/src/tgcesuiteserver.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstest/uibench/src/tgcesuiteserver.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -26,6 +26,7 @@
 #include "tdirectgdiperf.h"
 #include "teventhandlingperf.h"
 #include "tflipframerate.h"
+#include "trenderorientation.h"
 
 /**
 Same code for Secure and non-secure variants
@@ -102,6 +103,7 @@
 CTestStep* CGceSuiteServer::CreateTestStep(const TDesC& aStepName)
 	{
 	CTestStep* testStep = NULL;
+	
 	if(aStepName == KTGraphicsResource)
 		testStep = new CTGraphicsResource();
 	else if(aStepName == KTBitBltPerfDirectGdi)
@@ -113,6 +115,9 @@
 	else if(aStepName == KEventHandlingPerfName)
 		testStep = new CTEventHandlingPerf();
 	else if(aStepName == KTFlipFramerate)
-	    testStep = new CTFlipFramerate;
+	    testStep = new CTFlipFramerate();
+	else if(aStepName == KTRenderOrientation)
+	    testStep = new CTRenderOrientation;
+	
 	return testStep;
 	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphicstest/uibench/src/trenderorientation.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,269 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Nokia test code 
+*/
+
+#include <w32std.h>
+
+#include <wspublishandsubscribedata.h>
+#include "trenderorientation.h"
+
+const TInt KPublishTimeout  = 1000000;  // 1 second in microseconds
+const TInt KNumIterations   = 20;
+
+// Values for the device orientation that we receive via P&S from the Theme Server
+// Must match those in renderorientationtracker.h, and, obviously, those used by the real theme server 
+const TUid  KThemeOrientationCategory   = {0x20022E82}; // == KHbPsHardwareCoarseOrientationCategoryUid 
+const TUint KThemeOrientationKey        = 0x4F726965; // == KHbPsHardwareCoarseOrientationKey 
+
+void CWindowStuff::ConstructL()
+    {
+    User::LeaveIfError(iWs.Connect());
+    iWs.SetAutoFlush(ETrue);
+    
+    iWindowGroup = RWindowGroup(iWs);
+    User::LeaveIfError(iWindowGroup.Construct(reinterpret_cast<TUint32>(&iWindowGroup)));
+    
+    iChildWindow = RWindow(iWs);
+    User::LeaveIfError(iChildWindow.Construct(iWindowGroup, reinterpret_cast<TUint32>(&iChildWindow)));
+    }
+
+CWindowStuff::~CWindowStuff()
+    {
+    Destroy();
+    }
+
+void CWindowStuff::Destroy()
+    {
+    iChildWindow.Close();
+    iWindowGroup.Close();
+    iWs.Close();    
+    }
+
+CTRenderOrientation::CTRenderOrientation()
+    {
+    // check that these two enums are aligned
+    __ASSERT_COMPILE(EDisplayOrientationAuto == ENumWindowThings);
+    
+    SetTestStepName(KTRenderOrientation);
+    }
+
+CTRenderOrientation::~CTRenderOrientation()
+    {
+    }
+
+TRenderOrientation CTRenderOrientation::GetRenderOrientationL()
+    {    
+    return GetOrientationL(iWsRenderOrientationProperty);    
+    }
+
+TRenderOrientation CTRenderOrientation::GetThemeOrientationL()
+    {    
+    return GetOrientationL(iThemeOrientationProperty);    
+    }
+
+TRenderOrientation CTRenderOrientation::GetOrientationL(RProperty& aProperty)
+    {
+    TInt orientation=EDisplayOrientationNormal;
+    User::LeaveIfError(aProperty.Get(orientation));
+    
+    TESTL(orientation >= EDisplayOrientationNormal);
+    TESTL(orientation < EDisplayOrientationAuto);    
+    
+    return static_cast<TRenderOrientation>(orientation);    
+    }
+
+void CTRenderOrientation::TestOrientationChangeL(const TDesC& aStepName, TTestPhase aTestPhase)
+    {
+    SetTestStepID(aStepName);
+    
+    if(EThemeOrientationChange == aTestPhase)
+        {               
+        TESTL(EDisplayOrientationNormal == GetThemeOrientationL());
+        iWindowStuff[EFirstWindowThing].Session().IndicateAppOrientation(EDisplayOrientationAuto);        
+        }
+    
+    TInt renderOrientation = GetRenderOrientationL();
+    
+    // For consistancy, check that we are starting from the same orientation
+    TESTL(EDisplayOrientationNormal == renderOrientation);    
+    
+    // Set-up the timer
+    iProfiler->InitResults();
+    iTimingsTaken = 0;    
+    
+    // repeat numerous times to get a decent average
+    for(TInt iterations=0; iterations < KNumIterations; ++iterations)
+        {
+        renderOrientation = GetRenderOrientationL();
+        // For consistancy, check that we are starting from the same orientation
+        TESTL(EDisplayOrientationNormal == renderOrientation);           
+        
+        // loop through the orientations, ending up changing back to normal
+        for(++renderOrientation; renderOrientation <= EDisplayOrientationAuto; ++renderOrientation)
+            {
+            // % can be slow, do it outside of the timing
+            TRenderOrientation testOrientation = static_cast<TRenderOrientation>(renderOrientation%EDisplayOrientationAuto);
+            
+            iWsRenderOrientationProperty.Subscribe(iRenderOrientationStatus);            
+            // start the timeout timer
+            iTimeoutTimer.After(iTimeoutStatus, KPublishTimeout);
+            // start the results timer
+            iProfiler->StartTimer();
+            
+            switch(aTestPhase)
+                {
+                case EIndicatedOrientationChange:
+                    // Do the indicated orientation Change
+                    iWindowStuff[EFirstWindowThing].Session().IndicateAppOrientation(testOrientation);
+                    break;
+                    
+                case EWindowOrdinalChange:
+                    // move the relevant window group to the front
+                    // N.B. this will go wrong if the number of orientations and windows are not equal
+                    iWindowStuff[testOrientation].WindowGroup().SetOrdinalPosition(0);
+                    break;
+                    
+                case EThemeOrientationChange:
+                    // Needs the focus window to be in auto mode
+                    iThemeOrientationProperty.Set(testOrientation);
+                    break;
+                    
+                default:
+                    TESTL(EFalse);
+                }
+        
+            // Wait for the update to have been published ( or time out while waiting )
+            User::WaitForRequest(iRenderOrientationStatus, iTimeoutStatus);
+            
+            iProfiler->MarkResultSetL();
+            ++iTimingsTaken;
+            
+            if(KErrNone != iRenderOrientationStatus.Int())
+                {
+                // timed out
+                iWsRenderOrientationProperty.Cancel();                
+                TESTL(EFalse);
+                }
+            else
+                {
+                // Check that it is actually the expected orientation
+                TESTL(GetRenderOrientationL() == testOrientation);
+                }
+
+            if(KRequestPending == iTimeoutStatus.Int())
+                {
+                // as expected, so cancel the timeout timer
+                iTimeoutTimer.Cancel();
+                }
+            else
+                {
+                // timed out
+                TESTL(EFalse);
+                }
+            }
+        }    
+    
+    // wrap it up    
+    iProfiler->ResultsAnalysis(KTRenderOrientation,KErrNotFound,ENone,ENone,iTimingsTaken);
+    }
+
+TVerdict CTRenderOrientation::doTestStepL()
+    {     
+    INFO_PRINTF1(_L("Testing: Indicated Orientation Change"));
+    TestOrientationChangeL(_L("GRAPHICS-UI-BENCH-0xxx1"), EIndicatedOrientationChange);
+    
+    INFO_PRINTF1(_L("Testing: Window Ordinal Position Change"));
+    TestOrientationChangeL(_L("GRAPHICS-UI-BENCH-0xxx2"), EWindowOrdinalChange);
+    
+    INFO_PRINTF1(_L("Testing: Theme Orientation Change"));
+    TestOrientationChangeL(_L("GRAPHICS-UI-BENCH-0xxx3"), EThemeOrientationChange);
+    
+    return TestStepResult();    
+    }
+
+_LIT(KThemeServerPropertyDefine, "twsthemeserverpropertydefine.exe");
+_LIT(KThemeServerPropertyDefineCmdDefine, "define");
+_LIT(KThemeServerPropertyDefineCmdDelete, "delete");   
+   
+void CTRenderOrientation::ThemeServerProperty(const TDesC& aCmd)
+    {
+    /* This Process called with the argument KThemeServerPropertyDefineCmdDelete, deletes 
+       the theme server RProperty. This is because an RProperty can only be defined and 
+       deleted from within a process with the same UID3 as the RProperty catogory you are 
+       trying to define/delete.*/
+    RProcess themeServerPropertyDefine;
+    TInt err = themeServerPropertyDefine.Create(KThemeServerPropertyDefine, aCmd);
+    if (KErrNone != err)
+        {
+        _LIT(KLog, "themeServerPropertyDefine.Create() failed with error: %d");
+        INFO_PRINTF2(KLog, err);
+        TEST(EFalse);        
+        }
+    
+    //wait for themeServerPropertyDefine process to terminate
+    TRequestStatus themeServerPropertyDefineLogonStatus;
+    themeServerPropertyDefine.Logon(themeServerPropertyDefineLogonStatus);
+    themeServerPropertyDefine.Resume();
+    User::WaitForRequest(themeServerPropertyDefineLogonStatus);
+    if (themeServerPropertyDefineLogonStatus != KErrNone)
+        {
+        _LIT(KLog, "themeServerPropertyDefine.Logon() failed with error: %d");
+        INFO_PRINTF2(KLog, themeServerPropertyDefineLogonStatus);
+        TEST(EFalse);        
+        }
+    themeServerPropertyDefine.Close();    
+    }
+
+TVerdict CTRenderOrientation::doTestStepPreambleL()
+    {
+    // Create in reverse order so that windowThing 0 is at the front
+    for(TInt windowThing = ENumWindowThings - 1; windowThing >= 0 ; --windowThing)
+        {
+        iWindowStuff[windowThing].ConstructL();
+        TRenderOrientation orientation = static_cast<TRenderOrientation>(windowThing%EDisplayOrientationAuto);
+        iWindowStuff[windowThing].Session().IndicateAppOrientation(orientation);
+        iWindowStuff[windowThing].WindowGroup().SetOrdinalPosition(0);
+        }
+    
+    User::LeaveIfError(iWsRenderOrientationProperty.Attach(KRenderOrientationCategory, KRenderOrientationKey));
+    
+    ThemeServerProperty(KThemeServerPropertyDefineCmdDefine);
+    User::LeaveIfError(iThemeOrientationProperty.Attach(KThemeOrientationCategory, KThemeOrientationKey));
+    
+    User::LeaveIfError(iTimeoutTimer.CreateLocal());
+    
+    return CTe_graphicsperformanceSuiteStepBase::doTestStepPreambleL();
+    }
+
+TVerdict CTRenderOrientation::doTestStepPostambleL()
+    {
+    iTimeoutTimer.Close();
+    
+    iThemeOrientationProperty.Close();
+    ThemeServerProperty(KThemeServerPropertyDefineCmdDelete);    
+    iWsRenderOrientationProperty.Close();
+    
+    for(TInt windowThing = 0; windowThing < ENumWindowThings; ++windowThing)
+        {
+        iWindowStuff[windowThing].Destroy();
+        }
+    
+    return CTe_graphicsperformanceSuiteStepBase::doTestStepPostambleL();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphicstest/uibench/src/trenderorientation.h	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,99 @@
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Symbian test code 
+*/
+
+#ifndef TRENDERORIENTATION_H
+#define TRENDERORIENTATION_H
+
+#include <e32property.h>
+#include "te_graphicsperformanceSuiteStepBase.h"
+
+class CWindowStuff : public CBase
+    {
+public:
+    ~CWindowStuff();
+    void ConstructL();
+    void Destroy();
+
+    inline RWsSession&     Session()
+        {return iWs;};
+    inline RWindowGroup&   WindowGroup()
+        {return iWindowGroup;};
+
+private:
+    RWsSession      iWs;
+    RWindowGroup    iWindowGroup;
+    RWindow         iChildWindow;    
+    };
+
+class CTRenderOrientation : public CTe_graphicsperformanceSuiteStepBase
+    {
+public:
+    CTRenderOrientation();
+    ~CTRenderOrientation();
+
+    // From CTestStep
+    virtual TVerdict doTestStepPreambleL();
+    virtual TVerdict doTestStepPostambleL();
+    
+    virtual TVerdict doTestStepL();
+
+private:
+    enum TWindowThing
+        {
+        // One per orientation
+        EFirstWindowThing,
+        ESecondWindowThing,
+        EThirdWindowThing,
+        EFourthWindowThing,
+        
+        ENumWindowThings
+        };
+    
+    enum TTestPhase
+        {
+        EIndicatedOrientationChange,
+        EWindowOrdinalChange,
+        EThemeOrientationChange,
+        
+        ENumTestPhases
+        };    
+    
+    void TestOrientationChangeL(const TDesC& aStepName, TTestPhase aTestPhase);
+    
+    TRenderOrientation  GetRenderOrientationL();
+    TRenderOrientation  GetThemeOrientationL();
+    TRenderOrientation  GetOrientationL(RProperty& aProperty);
+    void                ThemeServerProperty(const TDesC& aCmd);
+    
+private:    
+    CWindowStuff    iWindowStuff[ENumWindowThings];
+    RProperty       iWsRenderOrientationProperty;
+    RProperty       iThemeOrientationProperty;
+    
+    RTimer          iTimeoutTimer;
+    TRequestStatus  iTimeoutStatus;
+    TRequestStatus  iRenderOrientationStatus;
+    TInt            iTimingsTaken;
+    };
+
+_LIT(KTRenderOrientation,"trenderorientation");
+
+#endif /* TRENDERORIENTATION_H */
--- a/graphicstools/gdi_tools/fontcomp/GDSFCOMP.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/graphicstools/gdi_tools/fontcomp/GDSFCOMP.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -14,7 +14,7 @@
 //
 
 #include "GDSFCOMP.H"
-#include "toolsver.h"
+#include "TOOLSVER.H"
 
 int GdsFontCompiler::WriteFont()
 	{
--- a/m3g/m3gcore11/src/m3g_loader.c	Tue Jun 22 15:21:29 2010 +0300
+++ b/m3g/m3gcore11/src/m3g_loader.c	Fri Jul 16 11:45:55 2010 +0300
@@ -781,9 +781,9 @@
             isCompatible = M3G_FALSE;
             break;
         case M3G_CLASS_MESH:
-            isCompatible = (classID == M3G_CLASS_MESH)
-                || (classID == M3G_CLASS_MORPHING_MESH)
-                || (classID == M3G_CLASS_SKINNED_MESH);
+            isCompatible = (objClassID == M3G_CLASS_MESH)
+                || (objClassID == M3G_CLASS_MORPHING_MESH)
+                || (objClassID == M3G_CLASS_SKINNED_MESH);
             break;
         default:
             isCompatible = (classID == objClassID);
--- a/m3g/m3gcore11/src/m3g_sprite.c	Tue Jun 22 15:21:29 2010 +0300
+++ b/m3g/m3gcore11/src/m3g_sprite.c	Fri Jul 16 11:45:55 2010 +0300
@@ -280,7 +280,9 @@
     }
 #ifndef M3G_USE_NGL_API
     /* Store w after projection */
-    eyeSpace->w = ot.w;
+    if (eyeSpace != NULL) {
+        eyeSpace->w = ot.w;
+    }
 #endif
     m3gScaleVec4(&ot, m3gRcp(ot.w));
     m3gScaleVec4(&x, m3gRcp(x.w));
--- a/m3g/m3gcore11/src/m3g_vertexarray.c	Tue Jun 22 15:21:29 2010 +0300
+++ b/m3g/m3gcore11/src/m3g_vertexarray.c	Fri Jul 16 11:45:55 2010 +0300
@@ -643,18 +643,12 @@
 
         switch (type) {
         case M3G_BYTE:
-        case M3G_UBYTE:
             /* always padded to 4 bytes */
             array->stride = 4;
             break;
         case M3G_SHORT:
-        case M3G_USHORT:
             array->stride = size * sizeof(M3Gshort);
             break;
-        default:
-            m3gFree(m3g, array);
-            m3gRaiseError(m3g, M3G_INVALID_ENUM);
-            return NULL;
         }
 
         /* Alloc and initialize all values to zero */
--- a/m3g/m3gcore11/src/m3g_vertexbuffer.c	Tue Jun 22 15:21:29 2010 +0300
+++ b/m3g/m3gcore11/src/m3g_vertexbuffer.c	Fri Jul 16 11:45:55 2010 +0300
@@ -350,8 +350,7 @@
     if (newArray != NULL) {
     	if (buffer->arrayCount == 0 || (buffer->arrayCount == 1
                                         && change == 0)) {
-    		buffer->vertexCount =
-                (newArray != NULL ? m3gGetArrayVertexCount(newArray) : 0);
+    		buffer->vertexCount = m3gGetArrayVertexCount(newArray);
     	}
     	else if (m3gGetArrayVertexCount(newArray) != buffer->vertexCount) {
             m3gRaiseError(M3G_INTERFACE(buffer), M3G_INVALID_VALUE);
--- a/printingservices/printerdriversupport/src/PDRBODY.H	Tue Jun 22 15:21:29 2010 +0300
+++ b/printingservices/printerdriversupport/src/PDRBODY.H	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -18,7 +18,7 @@
 
 #include <e32std.h>
 #include <s32file.h>
-#include <PDRSTORE.H>
+#include <pdrstore.h>
 
 /**
 @internalComponent
--- a/printingservices/printerdriversupport/tps/T_PDR.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/printingservices/printerdriversupport/tps/T_PDR.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -21,6 +21,7 @@
 
 #include "T_PDR.H"
 #include <graphics/fbsdefs.h>
+#include "prnpath.h"
 
 
 #if defined (__WINS__)
@@ -373,10 +374,8 @@
 	RFs fs;
 	ret=fs.Connect();
 	TEST(ret==KErrNone);
-#if defined(__X86GCC__)
 	_LIT(KPath,"C:\\system\\data\\");
 	fs.MkDirAll(KPath);
-#endif	//__X86GCC__
 	ret=file.Replace(fs,_L("C:\\system\\data\\WIDTHS.TMP"),EFileStream|EFileWrite);
 	if (ret!=KErrNone)
 		{
--- a/windowing/windowserver/DES/CLIENT.MDL	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/DES/CLIENT.MDL	Fri Jul 16 11:45:55 2010 +0300
@@ -1,472 +1,472 @@
-
-(object Petal
-    version    	35)
-
-(object Design "<Top Level>"
-    is_unit    	TRUE
-    file_name  	"c:\wserv\des\client.mdl"
-    is_loaded  	TRUE
-    defaults   	(object defaults
-	rightMargin 	0.25
-	leftMargin 	0.25
-	topMargin  	0.25
-	bottomMargin 	0.5
-	pageOverlap 	0.25
-	clipIconLabels 	TRUE
-	autoResize 	FALSE
-	snapToGrid 	TRUE
-	gridX      	0
-	gridY      	0
-	defaultFont 	(object Font
-	    size       	10
-	    face       	"Arial"
-	    bold       	FALSE
-	    italics    	FALSE
-	    underline  	FALSE
-	    strike     	FALSE
-	    color      	0
-	    default_color 	TRUE)
-	showMessageNum 	3)
-    root_category 	(object Class_Category "<Top Level>"
-	exportControl 	"Public"
-	global     	TRUE
-	subsystem  	"<Top Level>"
-	logical_models 	(list unit_reference_list
-	    (object Class "Thread"
-		fields     	(list has_relationship_list
-		    (object Has_Relationship
-			supplier   	"Thread")
-		    (object Has_Relationship
-			supplier   	"Window"
-			supplier_cardinality 	(value cardinality "n")
-			client_cardinality 	(value cardinality "1"))
-		    (object Has_Relationship
-			supplier   	"Pen"
-			supplier_cardinality 	(value cardinality "n")
-			client_cardinality 	(value cardinality "1"))
-		    (object Has_Relationship
-			supplier   	"Clock"
-			supplier_cardinality 	(value cardinality "n")
-			client_cardinality 	(value cardinality "1"))
-		    (object Has_Relationship
-			supplier   	"Sprite"
-			supplier_cardinality 	(value cardinality "n")
-			client_cardinality 	(value cardinality "1"))
-		    (object Has_Relationship
-			supplier   	"Bitmap sequence"
-			supplier_cardinality 	(value cardinality "n"))
-		    (object Has_Relationship
-			supplier   	"Text cursor"
-			supplier_cardinality 	(value cardinality "0..1")
-			client_cardinality 	(value cardinality "1"))
-		    (object Has_Relationship
-			supplier   	"Font"
-			supplier_cardinality 	(value cardinality "n")
-			client_cardinality 	(value cardinality "1"))
-		    (object Has_Relationship
-			supplier   	"Palette"
-			supplier_cardinality 	(value cardinality "n")
-			client_cardinality 	(value cardinality "1"))
-		    (object Has_Relationship
-			supplier   	"Brush"
-			supplier_cardinality 	(value cardinality "n")
-			client_cardinality 	(value cardinality "1"))
-		    (object Has_Relationship
-			supplier   	"Bitmap"
-			supplier_cardinality 	(value cardinality "n")
-			client_cardinality 	(value cardinality "1"))
-		    (object Has_Relationship
-			supplier   	"GC"
-			supplier_cardinality 	(value cardinality "n")
-			client_cardinality 	(value cardinality "1"))
-		    (object Has_Relationship
-			supplier   	"Clipping region"
-			supplier_cardinality 	(value cardinality "n")
-			client_cardinality 	(value cardinality "1"))
-		    (object Has_Relationship
-			supplier   	"Session"
-			supplier_cardinality 	(value cardinality "1")
-			client_cardinality 	(value cardinality "1"))))
-	    (object Class "Connection")
-	    (object Class "Drawable")
-	    (object Class "Window"
-		superclasses 	(list inheritance_relationship_list
-		    (object Inheritance_Relationship
-			supplier   	"Drawable")))
-	    (object Class "Bitmap"
-		superclasses 	(list inheritance_relationship_list
-		    (object Inheritance_Relationship
-			supplier   	"Drawable")))
-	    (object Class "Backed up window"
-		superclasses 	(list inheritance_relationship_list
-		    (object Inheritance_Relationship
-			supplier   	"Window")))
-	    (object Class "GDI Object")
-	    (object Class "AGDI Object"
-		used_nodes 	(list uses_relationship_list
-		    (object Uses_Relationship
-			supplier   	"Window")))
-	    (object Class "Brush"
-		superclasses 	(list inheritance_relationship_list
-		    (object Inheritance_Relationship
-			supplier   	"GDI Object"))
-		used_nodes 	(list uses_relationship_list
-		    (object Uses_Relationship
-			supplier   	"Bitmap")))
-	    (object Class "Font"
-		superclasses 	(list inheritance_relationship_list
-		    (object Inheritance_Relationship
-			supplier   	"GDI Object")))
-	    (object Class "Palette"
-		superclasses 	(list inheritance_relationship_list
-		    (object Inheritance_Relationship
-			supplier   	"GDI Object")))
-	    (object Class "Pen"
-		superclasses 	(list inheritance_relationship_list
-		    (object Inheritance_Relationship
-			supplier   	"GDI Object")))
-	    (object Class "Clock"
-		superclasses 	(list inheritance_relationship_list
-		    (object Inheritance_Relationship
-			supplier   	"AGDI Object")))
-	    (object Class "Sprite"
-		superclasses 	(list inheritance_relationship_list
-		    (object Inheritance_Relationship
-			supplier   	"AGDI Object")))
-	    (object Class "Bitmap sequence"
-		superclasses 	(list inheritance_relationship_list
-		    (object Inheritance_Relationship
-			supplier   	"AGDI Object")))
-	    (object Class "Text cursor"
-		superclasses 	(list inheritance_relationship_list
-		    (object Inheritance_Relationship
-			supplier   	"AGDI Object")))
-	    (object Class "GC"
-		used_nodes 	(list uses_relationship_list
-		    (object Uses_Relationship
-			supplier   	"Drawable")
-		    (object Uses_Relationship
-			supplier   	"Brush")
-		    (object Uses_Relationship
-			supplier   	"Palette")
-		    (object Uses_Relationship
-			supplier   	"Font")
-		    (object Uses_Relationship
-			supplier   	"Pen")
-		    (object Uses_Relationship
-			supplier   	"Clipping region")))
-	    (object Class "Clipping region"
-		superclasses 	(list inheritance_relationship_list
-		    (object Inheritance_Relationship
-			supplier   	"GDI Object")))
-	    (object Class "Pointer Cursor"
-		superclasses 	(list inheritance_relationship_list
-		    (object Inheritance_Relationship
-			supplier   	"AGDI Object")))
-	    (object Class "Session"
-		fields     	(list has_relationship_list
-		    (object Has_Relationship
-			supplier   	"GDI Object"
-			supplier_cardinality 	(value cardinality "n")
-			client_cardinality 	(value cardinality "1"))
-		    (object Has_Relationship
-			supplier   	"Drawable"
-			supplier_cardinality 	(value cardinality "n")
-			client_cardinality 	(value cardinality "1"))
-		    (object Has_Relationship
-			supplier   	"Store")
-		    (object Has_Relationship
-			supplier   	"AGDI Object"
-			supplier_cardinality 	(value cardinality "n")
-			client_cardinality 	(value cardinality "1"))))
-	    (object Class "Store"))
-	logical_presentations 	(list unit_reference_list
-	    (object ClassDiagram "Main"
-		title      	"Main"
-		zoom       	80
-		max_height 	28350
-		max_width  	21600
-		origin_x   	0
-		origin_y   	0
-		items      	(list diagram_item_list
-		    (object ClassView "Class" "Thread" @1
-			location   	(1982, 181)
-			label      	(object ItemLabel
-			    location   	(1878, 97)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Thread")
-			annotation 	8)
-		    (object ClassView "Class" "Drawable" @2
-			location   	(1927, 1363)
-			label      	(object ItemLabel
-			    location   	(1823, 1279)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Drawable")
-			annotation 	8)
-		    (object ClassView "Class" "Window" @3
-			location   	(2103, 1695)
-			label      	(object ItemLabel
-			    location   	(1999, 1611)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Window")
-			annotation 	8)
-		    (object ClassView "Class" "Bitmap" @4
-			location   	(1701, 1720)
-			label      	(object ItemLabel
-			    location   	(1597, 1636)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Bitmap")
-			annotation 	8)
-		    (object InheritView ""
-			client     	@3
-			supplier   	@2)
-		    (object InheritView ""
-			client     	@4
-			supplier   	@2)
-		    (object ClassView "Class" "Backed up window" @5
-			location   	(2286, 2005)
-			label      	(object ItemLabel
-			    location   	(2182, 1921)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Backed up window")
-			annotation 	8)
-		    (object InheritView ""
-			client     	@5
-			supplier   	@3)
-		    (object ClassView "Class" "GDI Object" @6
-			location   	(958, 646)
-			label      	(object ItemLabel
-			    location   	(854, 562)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"GDI Object")
-			annotation 	8)
-		    (object ClassView "Class" "AGDI Object" @7
-			location   	(2496, 1463)
-			label      	(object ItemLabel
-			    location   	(2392, 1380)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"AGDI Object")
-			height     	250
-			annotation 	8)
-		    (object ClassView "Class" "Brush" @8
-			location   	(1666, 1102)
-			label      	(object ItemLabel
-			    location   	(1562, 1018)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Brush")
-			annotation 	8)
-		    (object ClassView "Class" "Font" @9
-			location   	(178, 1103)
-			label      	(object ItemLabel
-			    location   	(74, 1019)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Font")
-			annotation 	8)
-		    (object ClassView "Class" "Palette" @10
-			location   	(542, 1110)
-			label      	(object ItemLabel
-			    location   	(438, 1026)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Palette")
-			annotation 	8)
-		    (object ClassView "Class" "Pen" @11
-			location   	(1284, 1110)
-			label      	(object ItemLabel
-			    location   	(1180, 1026)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Pen")
-			annotation 	8)
-		    (object ClassView "Class" "Clock" @12
-			location   	(3130, 2150)
-			label      	(object ItemLabel
-			    location   	(3026, 2066)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Clock")
-			annotation 	8)
-		    (object ClassView "Class" "Sprite" @13
-			location   	(3458, 1937)
-			label      	(object ItemLabel
-			    location   	(3354, 1853)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Sprite")
-			annotation 	8)
-		    (object ClassView "Class" "Bitmap sequence" @14
-			location   	(3431, 1626)
-			label      	(object ItemLabel
-			    location   	(3327, 1542)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Bitmap sequence")
-			annotation 	8)
-		    (object InheritView ""
-			client     	@8
-			supplier   	@6)
-		    (object InheritView ""
-			client     	@10
-			supplier   	@6)
-		    (object InheritView ""
-			client     	@9
-			supplier   	@6)
-		    (object InheritView ""
-			client     	@11
-			supplier   	@6)
-		    (object ClassView "Class" "Text cursor" @15
-			location   	(3407, 1293)
-			label      	(object ItemLabel
-			    location   	(3303, 1209)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Text cursor")
-			annotation 	8)
-		    (object InheritView ""
-			client     	@12
-			supplier   	@7)
-		    (object InheritView ""
-			client     	@14
-			supplier   	@7)
-		    (object InheritView ""
-			client     	@15
-			supplier   	@7)
-		    (object InheritView ""
-			client     	@13
-			supplier   	@7)
-		    (object ClassView "Class" "GC" @16
-			location   	(964, 1635)
-			label      	(object ItemLabel
-			    location   	(860, 1551)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"GC")
-			annotation 	8)
-		    (object ClassView "Class" "Clipping region" @17
-			location   	(928, 1108)
-			label      	(object ItemLabel
-			    location   	(824, 1024)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Clipping region")
-			annotation 	8)
-		    (object InheritView ""
-			client     	@17
-			supplier   	@6)
-		    (object UsesView ""
-			client     	@7
-			supplier   	@3)
-		    (object UsesView ""
-			client     	@16
-			supplier   	@2)
-		    (object UsesView ""
-			client     	@16
-			supplier   	@8)
-		    (object UsesView ""
-			client     	@16
-			supplier   	@10)
-		    (object UsesView ""
-			client     	@16
-			supplier   	@9)
-		    (object UsesView ""
-			client     	@16
-			supplier   	@11)
-		    (object UsesView ""
-			client     	@16
-			supplier   	@17)
-		    (object ClassView "Class" "Pointer Cursor" @18
-			location   	(2700, 2245)
-			label      	(object ItemLabel
-			    location   	(2596, 2161)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Pointer Cursor")
-			annotation 	8)
-		    (object InheritView ""
-			client     	@18
-			supplier   	@7)
-		    (object ClassView "Class" "Session" @19
-			location   	(2314, 562)
-			label      	(object ItemLabel
-			    location   	(2210, 478)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Session")
-			annotation 	8)
-		    (object HasView ""
-			client     	@1
-			supplier   	@19)
-		    (object ClassView "Class" "Store" @20
-			location   	(2775, 707)
-			label      	(object ItemLabel
-			    location   	(2671, 623)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Store")
-			annotation 	8)
-		    (object UsesView ""
-			client     	@8
-			supplier   	@4)
-		    (object HasView ""
-			client     	@19
-			supplier   	@6)
-		    (object HasView ""
-			client     	@19
-			supplier   	@20)
-		    (object HasView ""
-			client     	@19
-			supplier   	@7)
-		    (object HasView ""
-			client     	@19
-			supplier   	@2)))))
-    root_subsystem 	(object SubSystem "<Top Level>"
-	physical_models 	(list unit_reference_list)
-	physical_presentations 	(list unit_reference_list
-	    (object Module_Diagram "Main"
-		title      	"Main"
-		zoom       	100
-		max_height 	28350
-		max_width  	21600
-		origin_x   	0
-		origin_y   	0
-		items      	(list diagram_item_list))))
-    process_structure 	(object Processes
-	ProcsNDevs 	(list
-	    (object Process_Diagram ""
-		title      	""
-		zoom       	100
-		max_height 	28350
-		max_width  	21600
-		origin_x   	0
-		origin_y   	0
-		items      	(list diagram_item_list))))
-    properties 	(object Properties))
+
+(object Petal
+    version    	35)
+
+(object Design "<Top Level>"
+    is_unit    	TRUE
+    file_name  	"c:\wserv\des\client.mdl"
+    is_loaded  	TRUE
+    defaults   	(object defaults
+	rightMargin 	0.25
+	leftMargin 	0.25
+	topMargin  	0.25
+	bottomMargin 	0.5
+	pageOverlap 	0.25
+	clipIconLabels 	TRUE
+	autoResize 	FALSE
+	snapToGrid 	TRUE
+	gridX      	0
+	gridY      	0
+	defaultFont 	(object Font
+	    size       	10
+	    face       	"Arial"
+	    bold       	FALSE
+	    italics    	FALSE
+	    underline  	FALSE
+	    strike     	FALSE
+	    color      	0
+	    default_color 	TRUE)
+	showMessageNum 	3)
+    root_category 	(object Class_Category "<Top Level>"
+	exportControl 	"Public"
+	global     	TRUE
+	subsystem  	"<Top Level>"
+	logical_models 	(list unit_reference_list
+	    (object Class "Thread"
+		fields     	(list has_relationship_list
+		    (object Has_Relationship
+			supplier   	"Thread")
+		    (object Has_Relationship
+			supplier   	"Window"
+			supplier_cardinality 	(value cardinality "n")
+			client_cardinality 	(value cardinality "1"))
+		    (object Has_Relationship
+			supplier   	"Pen"
+			supplier_cardinality 	(value cardinality "n")
+			client_cardinality 	(value cardinality "1"))
+		    (object Has_Relationship
+			supplier   	"Clock"
+			supplier_cardinality 	(value cardinality "n")
+			client_cardinality 	(value cardinality "1"))
+		    (object Has_Relationship
+			supplier   	"Sprite"
+			supplier_cardinality 	(value cardinality "n")
+			client_cardinality 	(value cardinality "1"))
+		    (object Has_Relationship
+			supplier   	"Bitmap sequence"
+			supplier_cardinality 	(value cardinality "n"))
+		    (object Has_Relationship
+			supplier   	"Text cursor"
+			supplier_cardinality 	(value cardinality "0..1")
+			client_cardinality 	(value cardinality "1"))
+		    (object Has_Relationship
+			supplier   	"Font"
+			supplier_cardinality 	(value cardinality "n")
+			client_cardinality 	(value cardinality "1"))
+		    (object Has_Relationship
+			supplier   	"Palette"
+			supplier_cardinality 	(value cardinality "n")
+			client_cardinality 	(value cardinality "1"))
+		    (object Has_Relationship
+			supplier   	"Brush"
+			supplier_cardinality 	(value cardinality "n")
+			client_cardinality 	(value cardinality "1"))
+		    (object Has_Relationship
+			supplier   	"Bitmap"
+			supplier_cardinality 	(value cardinality "n")
+			client_cardinality 	(value cardinality "1"))
+		    (object Has_Relationship
+			supplier   	"GC"
+			supplier_cardinality 	(value cardinality "n")
+			client_cardinality 	(value cardinality "1"))
+		    (object Has_Relationship
+			supplier   	"Clipping region"
+			supplier_cardinality 	(value cardinality "n")
+			client_cardinality 	(value cardinality "1"))
+		    (object Has_Relationship
+			supplier   	"Session"
+			supplier_cardinality 	(value cardinality "1")
+			client_cardinality 	(value cardinality "1"))))
+	    (object Class "Connection")
+	    (object Class "Drawable")
+	    (object Class "Window"
+		superclasses 	(list inheritance_relationship_list
+		    (object Inheritance_Relationship
+			supplier   	"Drawable")))
+	    (object Class "Bitmap"
+		superclasses 	(list inheritance_relationship_list
+		    (object Inheritance_Relationship
+			supplier   	"Drawable")))
+	    (object Class "Backed up window"
+		superclasses 	(list inheritance_relationship_list
+		    (object Inheritance_Relationship
+			supplier   	"Window")))
+	    (object Class "GDI Object")
+	    (object Class "AGDI Object"
+		used_nodes 	(list uses_relationship_list
+		    (object Uses_Relationship
+			supplier   	"Window")))
+	    (object Class "Brush"
+		superclasses 	(list inheritance_relationship_list
+		    (object Inheritance_Relationship
+			supplier   	"GDI Object"))
+		used_nodes 	(list uses_relationship_list
+		    (object Uses_Relationship
+			supplier   	"Bitmap")))
+	    (object Class "Font"
+		superclasses 	(list inheritance_relationship_list
+		    (object Inheritance_Relationship
+			supplier   	"GDI Object")))
+	    (object Class "Palette"
+		superclasses 	(list inheritance_relationship_list
+		    (object Inheritance_Relationship
+			supplier   	"GDI Object")))
+	    (object Class "Pen"
+		superclasses 	(list inheritance_relationship_list
+		    (object Inheritance_Relationship
+			supplier   	"GDI Object")))
+	    (object Class "Clock"
+		superclasses 	(list inheritance_relationship_list
+		    (object Inheritance_Relationship
+			supplier   	"AGDI Object")))
+	    (object Class "Sprite"
+		superclasses 	(list inheritance_relationship_list
+		    (object Inheritance_Relationship
+			supplier   	"AGDI Object")))
+	    (object Class "Bitmap sequence"
+		superclasses 	(list inheritance_relationship_list
+		    (object Inheritance_Relationship
+			supplier   	"AGDI Object")))
+	    (object Class "Text cursor"
+		superclasses 	(list inheritance_relationship_list
+		    (object Inheritance_Relationship
+			supplier   	"AGDI Object")))
+	    (object Class "GC"
+		used_nodes 	(list uses_relationship_list
+		    (object Uses_Relationship
+			supplier   	"Drawable")
+		    (object Uses_Relationship
+			supplier   	"Brush")
+		    (object Uses_Relationship
+			supplier   	"Palette")
+		    (object Uses_Relationship
+			supplier   	"Font")
+		    (object Uses_Relationship
+			supplier   	"Pen")
+		    (object Uses_Relationship
+			supplier   	"Clipping region")))
+	    (object Class "Clipping region"
+		superclasses 	(list inheritance_relationship_list
+		    (object Inheritance_Relationship
+			supplier   	"GDI Object")))
+	    (object Class "Pointer Cursor"
+		superclasses 	(list inheritance_relationship_list
+		    (object Inheritance_Relationship
+			supplier   	"AGDI Object")))
+	    (object Class "Session"
+		fields     	(list has_relationship_list
+		    (object Has_Relationship
+			supplier   	"GDI Object"
+			supplier_cardinality 	(value cardinality "n")
+			client_cardinality 	(value cardinality "1"))
+		    (object Has_Relationship
+			supplier   	"Drawable"
+			supplier_cardinality 	(value cardinality "n")
+			client_cardinality 	(value cardinality "1"))
+		    (object Has_Relationship
+			supplier   	"Store")
+		    (object Has_Relationship
+			supplier   	"AGDI Object"
+			supplier_cardinality 	(value cardinality "n")
+			client_cardinality 	(value cardinality "1"))))
+	    (object Class "Store"))
+	logical_presentations 	(list unit_reference_list
+	    (object ClassDiagram "Main"
+		title      	"Main"
+		zoom       	80
+		max_height 	28350
+		max_width  	21600
+		origin_x   	0
+		origin_y   	0
+		items      	(list diagram_item_list
+		    (object ClassView "Class" "Thread" @1
+			location   	(1982, 181)
+			label      	(object ItemLabel
+			    location   	(1878, 97)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Thread")
+			annotation 	8)
+		    (object ClassView "Class" "Drawable" @2
+			location   	(1927, 1363)
+			label      	(object ItemLabel
+			    location   	(1823, 1279)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Drawable")
+			annotation 	8)
+		    (object ClassView "Class" "Window" @3
+			location   	(2103, 1695)
+			label      	(object ItemLabel
+			    location   	(1999, 1611)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Window")
+			annotation 	8)
+		    (object ClassView "Class" "Bitmap" @4
+			location   	(1701, 1720)
+			label      	(object ItemLabel
+			    location   	(1597, 1636)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Bitmap")
+			annotation 	8)
+		    (object InheritView ""
+			client     	@3
+			supplier   	@2)
+		    (object InheritView ""
+			client     	@4
+			supplier   	@2)
+		    (object ClassView "Class" "Backed up window" @5
+			location   	(2286, 2005)
+			label      	(object ItemLabel
+			    location   	(2182, 1921)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Backed up window")
+			annotation 	8)
+		    (object InheritView ""
+			client     	@5
+			supplier   	@3)
+		    (object ClassView "Class" "GDI Object" @6
+			location   	(958, 646)
+			label      	(object ItemLabel
+			    location   	(854, 562)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"GDI Object")
+			annotation 	8)
+		    (object ClassView "Class" "AGDI Object" @7
+			location   	(2496, 1463)
+			label      	(object ItemLabel
+			    location   	(2392, 1380)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"AGDI Object")
+			height     	250
+			annotation 	8)
+		    (object ClassView "Class" "Brush" @8
+			location   	(1666, 1102)
+			label      	(object ItemLabel
+			    location   	(1562, 1018)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Brush")
+			annotation 	8)
+		    (object ClassView "Class" "Font" @9
+			location   	(178, 1103)
+			label      	(object ItemLabel
+			    location   	(74, 1019)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Font")
+			annotation 	8)
+		    (object ClassView "Class" "Palette" @10
+			location   	(542, 1110)
+			label      	(object ItemLabel
+			    location   	(438, 1026)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Palette")
+			annotation 	8)
+		    (object ClassView "Class" "Pen" @11
+			location   	(1284, 1110)
+			label      	(object ItemLabel
+			    location   	(1180, 1026)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Pen")
+			annotation 	8)
+		    (object ClassView "Class" "Clock" @12
+			location   	(3130, 2150)
+			label      	(object ItemLabel
+			    location   	(3026, 2066)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Clock")
+			annotation 	8)
+		    (object ClassView "Class" "Sprite" @13
+			location   	(3458, 1937)
+			label      	(object ItemLabel
+			    location   	(3354, 1853)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Sprite")
+			annotation 	8)
+		    (object ClassView "Class" "Bitmap sequence" @14
+			location   	(3431, 1626)
+			label      	(object ItemLabel
+			    location   	(3327, 1542)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Bitmap sequence")
+			annotation 	8)
+		    (object InheritView ""
+			client     	@8
+			supplier   	@6)
+		    (object InheritView ""
+			client     	@10
+			supplier   	@6)
+		    (object InheritView ""
+			client     	@9
+			supplier   	@6)
+		    (object InheritView ""
+			client     	@11
+			supplier   	@6)
+		    (object ClassView "Class" "Text cursor" @15
+			location   	(3407, 1293)
+			label      	(object ItemLabel
+			    location   	(3303, 1209)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Text cursor")
+			annotation 	8)
+		    (object InheritView ""
+			client     	@12
+			supplier   	@7)
+		    (object InheritView ""
+			client     	@14
+			supplier   	@7)
+		    (object InheritView ""
+			client     	@15
+			supplier   	@7)
+		    (object InheritView ""
+			client     	@13
+			supplier   	@7)
+		    (object ClassView "Class" "GC" @16
+			location   	(964, 1635)
+			label      	(object ItemLabel
+			    location   	(860, 1551)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"GC")
+			annotation 	8)
+		    (object ClassView "Class" "Clipping region" @17
+			location   	(928, 1108)
+			label      	(object ItemLabel
+			    location   	(824, 1024)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Clipping region")
+			annotation 	8)
+		    (object InheritView ""
+			client     	@17
+			supplier   	@6)
+		    (object UsesView ""
+			client     	@7
+			supplier   	@3)
+		    (object UsesView ""
+			client     	@16
+			supplier   	@2)
+		    (object UsesView ""
+			client     	@16
+			supplier   	@8)
+		    (object UsesView ""
+			client     	@16
+			supplier   	@10)
+		    (object UsesView ""
+			client     	@16
+			supplier   	@9)
+		    (object UsesView ""
+			client     	@16
+			supplier   	@11)
+		    (object UsesView ""
+			client     	@16
+			supplier   	@17)
+		    (object ClassView "Class" "Pointer Cursor" @18
+			location   	(2700, 2245)
+			label      	(object ItemLabel
+			    location   	(2596, 2161)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Pointer Cursor")
+			annotation 	8)
+		    (object InheritView ""
+			client     	@18
+			supplier   	@7)
+		    (object ClassView "Class" "Session" @19
+			location   	(2314, 562)
+			label      	(object ItemLabel
+			    location   	(2210, 478)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Session")
+			annotation 	8)
+		    (object HasView ""
+			client     	@1
+			supplier   	@19)
+		    (object ClassView "Class" "Store" @20
+			location   	(2775, 707)
+			label      	(object ItemLabel
+			    location   	(2671, 623)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Store")
+			annotation 	8)
+		    (object UsesView ""
+			client     	@8
+			supplier   	@4)
+		    (object HasView ""
+			client     	@19
+			supplier   	@6)
+		    (object HasView ""
+			client     	@19
+			supplier   	@20)
+		    (object HasView ""
+			client     	@19
+			supplier   	@7)
+		    (object HasView ""
+			client     	@19
+			supplier   	@2)))))
+    root_subsystem 	(object SubSystem "<Top Level>"
+	physical_models 	(list unit_reference_list)
+	physical_presentations 	(list unit_reference_list
+	    (object Module_Diagram "Main"
+		title      	"Main"
+		zoom       	100
+		max_height 	28350
+		max_width  	21600
+		origin_x   	0
+		origin_y   	0
+		items      	(list diagram_item_list))))
+    process_structure 	(object Processes
+	ProcsNDevs 	(list
+	    (object Process_Diagram ""
+		title      	""
+		zoom       	100
+		max_height 	28350
+		max_width  	21600
+		origin_x   	0
+		origin_y   	0
+		items      	(list diagram_item_list))))
+    properties 	(object Properties))
--- a/windowing/windowserver/DES/CLIENT2.MDL	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/DES/CLIENT2.MDL	Fri Jul 16 11:45:55 2010 +0300
@@ -1,284 +1,284 @@
-
-(object Petal
-    version    	35)
-
-(object Design "<Top Level>"
-    is_unit    	TRUE
-    file_name  	"d:\wserv\des\client2.mdl"
-    is_loaded  	TRUE
-    defaults   	(object defaults
-	rightMargin 	0.25
-	leftMargin 	0.25
-	topMargin  	0.25
-	bottomMargin 	0.5
-	pageOverlap 	0.25
-	clipIconLabels 	TRUE
-	autoResize 	FALSE
-	snapToGrid 	TRUE
-	gridX      	0
-	gridY      	0
-	defaultFont 	(object Font
-	    size       	10
-	    face       	"Arial"
-	    bold       	FALSE
-	    italics    	FALSE
-	    underline  	FALSE
-	    strike     	FALSE
-	    color      	0
-	    default_color 	TRUE)
-	showMessageNum 	3)
-    root_category 	(object Class_Category "<Top Level>"
-	exportControl 	"Public"
-	global     	TRUE
-	subsystem  	"<Top Level>"
-	logical_models 	(list unit_reference_list
-	    (object Class_Category "W32"
-		exportControl 	"Public"
-		logical_models 	(list unit_reference_list
-		    (object Class "RWs"
-			fields     	(list has_relationship_list
-			    (object Has_Relationship
-				supplier   	"RGroupWindow"
-				supplier_cardinality 	(value cardinality "0..n")
-				client_cardinality 	(value cardinality "1"))
-			    (object Has_Relationship
-				supplier   	"RWindow"
-				supplier_cardinality 	(value cardinality "0..n")
-				client_cardinality 	(value cardinality "1"))
-			    (object Has_Relationship
-				supplier   	"RWsGc"
-				supplier_cardinality 	(value cardinality "0..n")
-				client_cardinality 	(value cardinality "1"))
-			    (object Has_Relationship
-				supplier   	"RPalette"
-				supplier_cardinality 	(value cardinality "0..n")
-				client_cardinality 	(value cardinality "1"))))
-		    (object Class "RGroupWindow"
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"RWindowBase")))
-		    (object Class "RWindow"
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"RWindowBase")
-			    (object Inheritance_Relationship
-				supplier   	"RDrawBase")))
-		    (object Class "RWsGc"
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"RGdi")))
-		    (object Class "RWindowBase")
-		    (object Class "RPalette"
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"RPaletteBase"))))
-		logical_presentations 	(list unit_reference_list
-		    (object ClassDiagram "Main"
-			title      	"Main"
-			zoom       	100
-			max_height 	28350
-			max_width  	21600
-			origin_x   	0
-			origin_y   	0
-			items      	(list diagram_item_list
-			    (object ClassView "Class" "RWs" @1
-				location   	(1403, 1017)
-				label      	(object ItemLabel
-				    location   	(1299, 933)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"RWs")
-				annotation 	8)
-			    (object ClassView "Class" "RWindow" @2
-				location   	(622, 892)
-				label      	(object ItemLabel
-				    location   	(518, 808)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"RWindow")
-				annotation 	8)
-			    (object ClassView "Class" "RWsGc" @3
-				location   	(2072, 903)
-				label      	(object ItemLabel
-				    location   	(1968, 819)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"RWsGc")
-				annotation 	8)
-			    (object ClassView "Class" "RWindowBase" @4
-				location   	(659, 395)
-				label      	(object ItemLabel
-				    location   	(555, 311)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"RWindowBase")
-				annotation 	8)
-			    (object ClassView "Class" "RGroupWindow" @5
-				location   	(1021, 795)
-				label      	(object ItemLabel
-				    location   	(917, 711)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"RGroupWindow")
-				annotation 	8)
-			    (object ClassView "Class" "RDrawBase" @6
-				location   	(269, 168)
-				label      	(object ItemLabel
-				    location   	(165, 84)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"RDrawBase")
-				annotation 	8)
-			    (object InheritView ""
-				client     	@5
-				supplier   	@4)
-			    (object HasView ""
-				client     	@1
-				supplier   	@5)
-			    (object HasView ""
-				client     	@1
-				supplier   	@2)
-			    (object HasView ""
-				client     	@1
-				supplier   	@3)
-			    (object ClassView "Class" "RGdi" @7
-				location   	(2072, 392)
-				label      	(object ItemLabel
-				    location   	(1968, 308)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"RGdi")
-				annotation 	8)
-			    (object InheritView ""
-				client     	@3
-				supplier   	@7)
-			    (object ClassView "Class" "RPalette" @8
-				location   	(2378, 1512)
-				label      	(object ItemLabel
-				    location   	(2274, 1428)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"RPalette")
-				annotation 	8)
-			    (object ClassView "Class" "RPaletteBase" @9
-				location   	(2425, 1106)
-				label      	(object ItemLabel
-				    location   	(2321, 1022)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"RPaletteBase")
-				annotation 	8)
-			    (object InheritView ""
-				client     	@8
-				supplier   	@9)
-			    (object HasView ""
-				client     	@1
-				supplier   	@8)
-			    (object InheritView ""
-				client     	@2
-				supplier   	@6)
-			    (object InheritView ""
-				client     	@2
-				supplier   	@4)))))
-	    (object Class_Category "GdiBase"
-		exportControl 	"Public"
-		logical_models 	(list unit_reference_list
-		    (object Class "RPaletteBase")
-		    (object Class "RDrawBase")
-		    (object Class "RGdi"))
-		logical_presentations 	(list unit_reference_list
-		    (object ClassDiagram "Main"
-			title      	"Main"
-			zoom       	100
-			max_height 	28350
-			max_width  	21600
-			origin_x   	0
-			origin_y   	0
-			items      	(list diagram_item_list
-			    (object ClassView "Class" "RPaletteBase" @10
-				location   	(1012, 248)
-				label      	(object ItemLabel
-				    location   	(908, 164)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"RPaletteBase")
-				annotation 	8)
-			    (object ClassView "Class" "RDrawBase" @11
-				location   	(494, 675)
-				label      	(object ItemLabel
-				    location   	(390, 591)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"RDrawBase")
-				annotation 	8)
-			    (object ClassView "Class" "RGdi" @12
-				location   	(1015, 661)
-				label      	(object ItemLabel
-				    location   	(911, 577)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"RGdi")
-				annotation 	8))))))
-	logical_presentations 	(list unit_reference_list
-	    (object ClassDiagram "Main"
-		title      	"Main"
-		zoom       	100
-		max_height 	28350
-		max_width  	21600
-		origin_x   	0
-		origin_y   	0
-		items      	(list diagram_item_list
-		    (object CategoryView "W32" @13
-			location   	(778, 431)
-			label      	(object ItemLabel
-			    location   	(634, 347)
-			    nlines     	2
-			    max_width  	288
-			    justify    	0
-			    label      	"W32")
-			width      	300
-			height     	180)
-		    (object CategoryView "GdiBase" @14
-			location   	(1494, 434)
-			label      	(object ItemLabel
-			    location   	(1350, 350)
-			    nlines     	2
-			    max_width  	288
-			    justify    	0
-			    label      	"GdiBase")
-			width      	300
-			height     	180)))))
-    root_subsystem 	(object SubSystem "<Top Level>"
-	physical_models 	(list unit_reference_list)
-	physical_presentations 	(list unit_reference_list
-	    (object Module_Diagram "Main"
-		title      	"Main"
-		zoom       	100
-		max_height 	28350
-		max_width  	21600
-		origin_x   	0
-		origin_y   	0
-		items      	(list diagram_item_list))))
-    process_structure 	(object Processes
-	ProcsNDevs 	(list
-	    (object Process_Diagram ""
-		title      	""
-		zoom       	100
-		max_height 	28350
-		max_width  	21600
-		origin_x   	0
-		origin_y   	0
-		items      	(list diagram_item_list))))
-    properties 	(object Properties))
+
+(object Petal
+    version    	35)
+
+(object Design "<Top Level>"
+    is_unit    	TRUE
+    file_name  	"d:\wserv\des\client2.mdl"
+    is_loaded  	TRUE
+    defaults   	(object defaults
+	rightMargin 	0.25
+	leftMargin 	0.25
+	topMargin  	0.25
+	bottomMargin 	0.5
+	pageOverlap 	0.25
+	clipIconLabels 	TRUE
+	autoResize 	FALSE
+	snapToGrid 	TRUE
+	gridX      	0
+	gridY      	0
+	defaultFont 	(object Font
+	    size       	10
+	    face       	"Arial"
+	    bold       	FALSE
+	    italics    	FALSE
+	    underline  	FALSE
+	    strike     	FALSE
+	    color      	0
+	    default_color 	TRUE)
+	showMessageNum 	3)
+    root_category 	(object Class_Category "<Top Level>"
+	exportControl 	"Public"
+	global     	TRUE
+	subsystem  	"<Top Level>"
+	logical_models 	(list unit_reference_list
+	    (object Class_Category "W32"
+		exportControl 	"Public"
+		logical_models 	(list unit_reference_list
+		    (object Class "RWs"
+			fields     	(list has_relationship_list
+			    (object Has_Relationship
+				supplier   	"RGroupWindow"
+				supplier_cardinality 	(value cardinality "0..n")
+				client_cardinality 	(value cardinality "1"))
+			    (object Has_Relationship
+				supplier   	"RWindow"
+				supplier_cardinality 	(value cardinality "0..n")
+				client_cardinality 	(value cardinality "1"))
+			    (object Has_Relationship
+				supplier   	"RWsGc"
+				supplier_cardinality 	(value cardinality "0..n")
+				client_cardinality 	(value cardinality "1"))
+			    (object Has_Relationship
+				supplier   	"RPalette"
+				supplier_cardinality 	(value cardinality "0..n")
+				client_cardinality 	(value cardinality "1"))))
+		    (object Class "RGroupWindow"
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"RWindowBase")))
+		    (object Class "RWindow"
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"RWindowBase")
+			    (object Inheritance_Relationship
+				supplier   	"RDrawBase")))
+		    (object Class "RWsGc"
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"RGdi")))
+		    (object Class "RWindowBase")
+		    (object Class "RPalette"
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"RPaletteBase"))))
+		logical_presentations 	(list unit_reference_list
+		    (object ClassDiagram "Main"
+			title      	"Main"
+			zoom       	100
+			max_height 	28350
+			max_width  	21600
+			origin_x   	0
+			origin_y   	0
+			items      	(list diagram_item_list
+			    (object ClassView "Class" "RWs" @1
+				location   	(1403, 1017)
+				label      	(object ItemLabel
+				    location   	(1299, 933)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"RWs")
+				annotation 	8)
+			    (object ClassView "Class" "RWindow" @2
+				location   	(622, 892)
+				label      	(object ItemLabel
+				    location   	(518, 808)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"RWindow")
+				annotation 	8)
+			    (object ClassView "Class" "RWsGc" @3
+				location   	(2072, 903)
+				label      	(object ItemLabel
+				    location   	(1968, 819)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"RWsGc")
+				annotation 	8)
+			    (object ClassView "Class" "RWindowBase" @4
+				location   	(659, 395)
+				label      	(object ItemLabel
+				    location   	(555, 311)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"RWindowBase")
+				annotation 	8)
+			    (object ClassView "Class" "RGroupWindow" @5
+				location   	(1021, 795)
+				label      	(object ItemLabel
+				    location   	(917, 711)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"RGroupWindow")
+				annotation 	8)
+			    (object ClassView "Class" "RDrawBase" @6
+				location   	(269, 168)
+				label      	(object ItemLabel
+				    location   	(165, 84)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"RDrawBase")
+				annotation 	8)
+			    (object InheritView ""
+				client     	@5
+				supplier   	@4)
+			    (object HasView ""
+				client     	@1
+				supplier   	@5)
+			    (object HasView ""
+				client     	@1
+				supplier   	@2)
+			    (object HasView ""
+				client     	@1
+				supplier   	@3)
+			    (object ClassView "Class" "RGdi" @7
+				location   	(2072, 392)
+				label      	(object ItemLabel
+				    location   	(1968, 308)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"RGdi")
+				annotation 	8)
+			    (object InheritView ""
+				client     	@3
+				supplier   	@7)
+			    (object ClassView "Class" "RPalette" @8
+				location   	(2378, 1512)
+				label      	(object ItemLabel
+				    location   	(2274, 1428)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"RPalette")
+				annotation 	8)
+			    (object ClassView "Class" "RPaletteBase" @9
+				location   	(2425, 1106)
+				label      	(object ItemLabel
+				    location   	(2321, 1022)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"RPaletteBase")
+				annotation 	8)
+			    (object InheritView ""
+				client     	@8
+				supplier   	@9)
+			    (object HasView ""
+				client     	@1
+				supplier   	@8)
+			    (object InheritView ""
+				client     	@2
+				supplier   	@6)
+			    (object InheritView ""
+				client     	@2
+				supplier   	@4)))))
+	    (object Class_Category "GdiBase"
+		exportControl 	"Public"
+		logical_models 	(list unit_reference_list
+		    (object Class "RPaletteBase")
+		    (object Class "RDrawBase")
+		    (object Class "RGdi"))
+		logical_presentations 	(list unit_reference_list
+		    (object ClassDiagram "Main"
+			title      	"Main"
+			zoom       	100
+			max_height 	28350
+			max_width  	21600
+			origin_x   	0
+			origin_y   	0
+			items      	(list diagram_item_list
+			    (object ClassView "Class" "RPaletteBase" @10
+				location   	(1012, 248)
+				label      	(object ItemLabel
+				    location   	(908, 164)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"RPaletteBase")
+				annotation 	8)
+			    (object ClassView "Class" "RDrawBase" @11
+				location   	(494, 675)
+				label      	(object ItemLabel
+				    location   	(390, 591)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"RDrawBase")
+				annotation 	8)
+			    (object ClassView "Class" "RGdi" @12
+				location   	(1015, 661)
+				label      	(object ItemLabel
+				    location   	(911, 577)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"RGdi")
+				annotation 	8))))))
+	logical_presentations 	(list unit_reference_list
+	    (object ClassDiagram "Main"
+		title      	"Main"
+		zoom       	100
+		max_height 	28350
+		max_width  	21600
+		origin_x   	0
+		origin_y   	0
+		items      	(list diagram_item_list
+		    (object CategoryView "W32" @13
+			location   	(778, 431)
+			label      	(object ItemLabel
+			    location   	(634, 347)
+			    nlines     	2
+			    max_width  	288
+			    justify    	0
+			    label      	"W32")
+			width      	300
+			height     	180)
+		    (object CategoryView "GdiBase" @14
+			location   	(1494, 434)
+			label      	(object ItemLabel
+			    location   	(1350, 350)
+			    nlines     	2
+			    max_width  	288
+			    justify    	0
+			    label      	"GdiBase")
+			width      	300
+			height     	180)))))
+    root_subsystem 	(object SubSystem "<Top Level>"
+	physical_models 	(list unit_reference_list)
+	physical_presentations 	(list unit_reference_list
+	    (object Module_Diagram "Main"
+		title      	"Main"
+		zoom       	100
+		max_height 	28350
+		max_width  	21600
+		origin_x   	0
+		origin_y   	0
+		items      	(list diagram_item_list))))
+    process_structure 	(object Processes
+	ProcsNDevs 	(list
+	    (object Process_Diagram ""
+		title      	""
+		zoom       	100
+		max_height 	28350
+		max_width  	21600
+		origin_x   	0
+		origin_y   	0
+		items      	(list diagram_item_list))))
+    properties 	(object Properties))
--- a/windowing/windowserver/DES/GDI.MDL	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/DES/GDI.MDL	Fri Jul 16 11:45:55 2010 +0300
@@ -1,208 +1,208 @@
-
-(object Petal
-    version    	35)
-
-(object Design "<Top Level>"
-    is_unit    	TRUE
-    file_name  	"d:\wserv\des\gdi.mdl"
-    is_loaded  	TRUE
-    defaults   	(object defaults
-	rightMargin 	0.25
-	leftMargin 	0.25
-	topMargin  	0.25
-	bottomMargin 	0.5
-	pageOverlap 	0.25
-	clipIconLabels 	TRUE
-	autoResize 	FALSE
-	snapToGrid 	TRUE
-	gridX      	16
-	gridY      	16
-	defaultFont 	(object Font
-	    size       	10
-	    face       	"Arial"
-	    bold       	FALSE
-	    italics    	FALSE
-	    underline  	FALSE
-	    strike     	FALSE
-	    color      	0
-	    default_color 	TRUE)
-	showMessageNum 	3)
-    root_category 	(object Class_Category "<Top Level>"
-	exportControl 	"Public"
-	global     	TRUE
-	subsystem  	"<Top Level>"
-	logical_models 	(list unit_reference_list
-	    (object Class "Bitmap Font"
-		superclasses 	(list inheritance_relationship_list
-		    (object Inheritance_Relationship
-			supplier   	"Font"))
-		statediagram 	(object State_Diagram ""
-		    title      	""
-		    zoom       	100
-		    max_height 	28350
-		    max_width  	21600
-		    origin_x   	0
-		    origin_y   	0
-		    items      	(list diagram_item_list)))
-	    (object Class "Pattern Brush"
-		superclasses 	(list inheritance_relationship_list
-		    (object Inheritance_Relationship
-			supplier   	"GDI object"))
-		statediagram 	(object State_Diagram ""
-		    title      	""
-		    zoom       	100
-		    max_height 	28350
-		    max_width  	21600
-		    origin_x   	0
-		    origin_y   	0
-		    items      	(list diagram_item_list)))
-	    (object Class "Pen"
-		superclasses 	(list inheritance_relationship_list
-		    (object Inheritance_Relationship
-			supplier   	"GDI object"))
-		statediagram 	(object State_Diagram ""
-		    title      	""
-		    zoom       	100
-		    max_height 	28350
-		    max_width  	21600
-		    origin_x   	0
-		    origin_y   	0
-		    items      	(list diagram_item_list)))
-	    (object Class "Font"
-		fields     	(list has_relationship_list
-		    (object Has_Relationship
-			supplier   	"Bitmap Font"
-			supplier_cardinality 	(value cardinality "0..1")
-			client_cardinality 	(value cardinality "n"))
-		    (object Has_Relationship
-			supplier   	"Vector font"
-			supplier_cardinality 	(value cardinality "0..1")
-			client_cardinality 	(value cardinality "n")))
-		superclasses 	(list inheritance_relationship_list
-		    (object Inheritance_Relationship
-			supplier   	"GDI object"))
-		statediagram 	(object State_Diagram ""
-		    title      	""
-		    zoom       	100
-		    max_height 	28350
-		    max_width  	21600
-		    origin_x   	0
-		    origin_y   	0
-		    items      	(list diagram_item_list)))
-	    (object Class "Vector font"
-		superclasses 	(list inheritance_relationship_list
-		    (object Inheritance_Relationship
-			supplier   	"Font"))
-		statediagram 	(object State_Diagram ""
-		    title      	""
-		    zoom       	100
-		    max_height 	28350
-		    max_width  	21600
-		    origin_x   	0
-		    origin_y   	0
-		    items      	(list diagram_item_list)))
-	    (object Class "Palette"
-		superclasses 	(list inheritance_relationship_list
-		    (object Inheritance_Relationship
-			supplier   	"GDI object")))
-	    (object Class "Drawable"))
-	logical_presentations 	(list unit_reference_list
-	    (object ClassDiagram "Main"
-		title      	"Main"
-		zoom       	100
-		max_height 	28350
-		max_width  	21600
-		origin_x   	3000
-		origin_y   	2000
-		items      	(list diagram_item_list
-		    (object ClassView "Class" "Bitmap Font" @1
-			location   	(3728, 3184)
-			label      	(object ItemLabel
-			    location   	(3624, 3100)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Bitmap Font")
-			annotation 	8)
-		    (object ClassView "Class" "Pattern Brush" @2
-			location   	(4432, 2784)
-			label      	(object ItemLabel
-			    location   	(4328, 2700)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Pattern Brush")
-			annotation 	8)
-		    (object ClassView "Class" "Pen" @3
-			location   	(5360, 2800)
-			label      	(object ItemLabel
-			    location   	(5256, 2716)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Pen")
-			annotation 	8)
-		    (object ClassView "Class" "Font" @4
-			location   	(3888, 2768)
-			label      	(object ItemLabel
-			    location   	(3784, 2684)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Font")
-			annotation 	8)
-		    (object ClassView "Class" "Vector font" @5
-			location   	(4176, 3184)
-			label      	(object ItemLabel
-			    location   	(4072, 3100)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Vector font")
-			annotation 	8)
-		    (object ClassView "Class" "Palette" @6
-			location   	(4896, 2800)
-			label      	(object ItemLabel
-			    location   	(4792, 2716)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Palette")
-			annotation 	8)
-		    (object ClassView "Class" "Drawable" @7
-			location   	(3328, 2768)
-			label      	(object ItemLabel
-			    location   	(3224, 2684)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Drawable")
-			annotation 	8)
-		    (object InheritView ""
-			client     	@1
-			supplier   	@4)
-		    (object InheritView ""
-			client     	@5
-			supplier   	@4)))))
-    root_subsystem 	(object SubSystem "<Top Level>"
-	physical_models 	(list unit_reference_list)
-	physical_presentations 	(list unit_reference_list
-	    (object Module_Diagram "Main"
-		title      	"Main"
-		zoom       	100
-		max_height 	28350
-		max_width  	21600
-		origin_x   	0
-		origin_y   	0
-		items      	(list diagram_item_list))))
-    process_structure 	(object Processes
-	ProcsNDevs 	(list
-	    (object Process_Diagram ""
-		title      	""
-		zoom       	100
-		max_height 	28350
-		max_width  	21600
-		origin_x   	0
-		origin_y   	0
-		items      	(list diagram_item_list))))
-    properties 	(object Properties))
+
+(object Petal
+    version    	35)
+
+(object Design "<Top Level>"
+    is_unit    	TRUE
+    file_name  	"d:\wserv\des\gdi.mdl"
+    is_loaded  	TRUE
+    defaults   	(object defaults
+	rightMargin 	0.25
+	leftMargin 	0.25
+	topMargin  	0.25
+	bottomMargin 	0.5
+	pageOverlap 	0.25
+	clipIconLabels 	TRUE
+	autoResize 	FALSE
+	snapToGrid 	TRUE
+	gridX      	16
+	gridY      	16
+	defaultFont 	(object Font
+	    size       	10
+	    face       	"Arial"
+	    bold       	FALSE
+	    italics    	FALSE
+	    underline  	FALSE
+	    strike     	FALSE
+	    color      	0
+	    default_color 	TRUE)
+	showMessageNum 	3)
+    root_category 	(object Class_Category "<Top Level>"
+	exportControl 	"Public"
+	global     	TRUE
+	subsystem  	"<Top Level>"
+	logical_models 	(list unit_reference_list
+	    (object Class "Bitmap Font"
+		superclasses 	(list inheritance_relationship_list
+		    (object Inheritance_Relationship
+			supplier   	"Font"))
+		statediagram 	(object State_Diagram ""
+		    title      	""
+		    zoom       	100
+		    max_height 	28350
+		    max_width  	21600
+		    origin_x   	0
+		    origin_y   	0
+		    items      	(list diagram_item_list)))
+	    (object Class "Pattern Brush"
+		superclasses 	(list inheritance_relationship_list
+		    (object Inheritance_Relationship
+			supplier   	"GDI object"))
+		statediagram 	(object State_Diagram ""
+		    title      	""
+		    zoom       	100
+		    max_height 	28350
+		    max_width  	21600
+		    origin_x   	0
+		    origin_y   	0
+		    items      	(list diagram_item_list)))
+	    (object Class "Pen"
+		superclasses 	(list inheritance_relationship_list
+		    (object Inheritance_Relationship
+			supplier   	"GDI object"))
+		statediagram 	(object State_Diagram ""
+		    title      	""
+		    zoom       	100
+		    max_height 	28350
+		    max_width  	21600
+		    origin_x   	0
+		    origin_y   	0
+		    items      	(list diagram_item_list)))
+	    (object Class "Font"
+		fields     	(list has_relationship_list
+		    (object Has_Relationship
+			supplier   	"Bitmap Font"
+			supplier_cardinality 	(value cardinality "0..1")
+			client_cardinality 	(value cardinality "n"))
+		    (object Has_Relationship
+			supplier   	"Vector font"
+			supplier_cardinality 	(value cardinality "0..1")
+			client_cardinality 	(value cardinality "n")))
+		superclasses 	(list inheritance_relationship_list
+		    (object Inheritance_Relationship
+			supplier   	"GDI object"))
+		statediagram 	(object State_Diagram ""
+		    title      	""
+		    zoom       	100
+		    max_height 	28350
+		    max_width  	21600
+		    origin_x   	0
+		    origin_y   	0
+		    items      	(list diagram_item_list)))
+	    (object Class "Vector font"
+		superclasses 	(list inheritance_relationship_list
+		    (object Inheritance_Relationship
+			supplier   	"Font"))
+		statediagram 	(object State_Diagram ""
+		    title      	""
+		    zoom       	100
+		    max_height 	28350
+		    max_width  	21600
+		    origin_x   	0
+		    origin_y   	0
+		    items      	(list diagram_item_list)))
+	    (object Class "Palette"
+		superclasses 	(list inheritance_relationship_list
+		    (object Inheritance_Relationship
+			supplier   	"GDI object")))
+	    (object Class "Drawable"))
+	logical_presentations 	(list unit_reference_list
+	    (object ClassDiagram "Main"
+		title      	"Main"
+		zoom       	100
+		max_height 	28350
+		max_width  	21600
+		origin_x   	3000
+		origin_y   	2000
+		items      	(list diagram_item_list
+		    (object ClassView "Class" "Bitmap Font" @1
+			location   	(3728, 3184)
+			label      	(object ItemLabel
+			    location   	(3624, 3100)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Bitmap Font")
+			annotation 	8)
+		    (object ClassView "Class" "Pattern Brush" @2
+			location   	(4432, 2784)
+			label      	(object ItemLabel
+			    location   	(4328, 2700)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Pattern Brush")
+			annotation 	8)
+		    (object ClassView "Class" "Pen" @3
+			location   	(5360, 2800)
+			label      	(object ItemLabel
+			    location   	(5256, 2716)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Pen")
+			annotation 	8)
+		    (object ClassView "Class" "Font" @4
+			location   	(3888, 2768)
+			label      	(object ItemLabel
+			    location   	(3784, 2684)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Font")
+			annotation 	8)
+		    (object ClassView "Class" "Vector font" @5
+			location   	(4176, 3184)
+			label      	(object ItemLabel
+			    location   	(4072, 3100)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Vector font")
+			annotation 	8)
+		    (object ClassView "Class" "Palette" @6
+			location   	(4896, 2800)
+			label      	(object ItemLabel
+			    location   	(4792, 2716)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Palette")
+			annotation 	8)
+		    (object ClassView "Class" "Drawable" @7
+			location   	(3328, 2768)
+			label      	(object ItemLabel
+			    location   	(3224, 2684)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Drawable")
+			annotation 	8)
+		    (object InheritView ""
+			client     	@1
+			supplier   	@4)
+		    (object InheritView ""
+			client     	@5
+			supplier   	@4)))))
+    root_subsystem 	(object SubSystem "<Top Level>"
+	physical_models 	(list unit_reference_list)
+	physical_presentations 	(list unit_reference_list
+	    (object Module_Diagram "Main"
+		title      	"Main"
+		zoom       	100
+		max_height 	28350
+		max_width  	21600
+		origin_x   	0
+		origin_y   	0
+		items      	(list diagram_item_list))))
+    process_structure 	(object Processes
+	ProcsNDevs 	(list
+	    (object Process_Diagram ""
+		title      	""
+		zoom       	100
+		max_height 	28350
+		max_width  	21600
+		origin_x   	0
+		origin_y   	0
+		items      	(list diagram_item_list))))
+    properties 	(object Properties))
--- a/windowing/windowserver/DES/WSERV.MDL	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/DES/WSERV.MDL	Fri Jul 16 11:45:55 2010 +0300
@@ -1,2389 +1,2389 @@
-
-(object Petal
-    version    	35)
-
-(object Design "<Top Level>"
-    is_unit    	TRUE
-    file_name  	"d:\wserv\des\wserv.mdl"
-    is_loaded  	TRUE
-    defaults   	(object defaults
-	rightMargin 	0.25
-	leftMargin 	0.25
-	topMargin  	0.25
-	bottomMargin 	0.5
-	pageOverlap 	0.25
-	clipIconLabels 	TRUE
-	autoResize 	FALSE
-	snapToGrid 	TRUE
-	gridX      	0
-	gridY      	0
-	defaultFont 	(object Font
-	    size       	10
-	    face       	"Arial"
-	    bold       	FALSE
-	    italics    	FALSE
-	    underline  	FALSE
-	    strike     	FALSE
-	    color      	0
-	    default_color 	TRUE)
-	showMessageNum 	3)
-    root_category 	(object Class_Category "<Top Level>"
-	exportControl 	"Public"
-	global     	TRUE
-	subsystem  	"<Top Level>"
-	logical_models 	(list unit_reference_list
-	    (object Class "$UNNAMED$0")
-	    (object Class "Client ")
-	    (object Class_Category "GDI"
-		exportControl 	"Public"
-		logical_models 	(list unit_reference_list
-		    (object Class "Bitmap Font"
-			statediagram 	(object State_Diagram ""
-			    title      	""
-			    zoom       	100
-			    max_height 	28350
-			    max_width  	21600
-			    origin_x   	0
-			    origin_y   	0
-			    items      	(list diagram_item_list)))
-		    (object Class "Brush"
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"GDI object"))
-			statediagram 	(object State_Diagram ""
-			    title      	""
-			    zoom       	100
-			    max_height 	28350
-			    max_width  	21600
-			    origin_x   	0
-			    origin_y   	0
-			    items      	(list diagram_item_list)))
-		    (object Class "Pen"
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"GDI object"))
-			statediagram 	(object State_Diagram ""
-			    title      	""
-			    zoom       	100
-			    max_height 	28350
-			    max_width  	21600
-			    origin_x   	0
-			    origin_y   	0
-			    items      	(list diagram_item_list)))
-		    (object Class "CBackground")
-		    (object Class "integer"
-			nonclass   	TRUE)
-		    (object Class "CPenCursor")
-		    (object Class "CTextCursor")
-		    (object Class "$UNNAMED$1")
-		    (object Class "$UNNAMED$2")
-		    (object Class " WS Object"
-			statediagram 	(object State_Diagram ""
-			    title      	""
-			    zoom       	100
-			    max_height 	28350
-			    max_width  	21600
-			    origin_x   	0
-			    origin_y   	0
-			    items      	(list diagram_item_list)))
-		    (object Class "Drawablex"
-			statediagram 	(object State_Diagram ""
-			    title      	""
-			    zoom       	100
-			    max_height 	28350
-			    max_width  	21600
-			    origin_x   	0
-			    origin_y   	0
-			    items      	(list diagram_item_list)))
-		    (object Class "Font"
-			fields     	(list has_relationship_list
-			    (object Has_Relationship
-				supplier   	"Bitmap Font"
-				supplier_cardinality 	(value cardinality "0..1")
-				client_cardinality 	(value cardinality "n"))
-			    (object Has_Relationship
-				supplier   	"Vector font"
-				supplier_cardinality 	(value cardinality "0..1")
-				client_cardinality 	(value cardinality "n")))
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"GDI object"))
-			statediagram 	(object State_Diagram ""
-			    title      	""
-			    zoom       	100
-			    max_height 	28350
-			    max_width  	21600
-			    origin_x   	0
-			    origin_y   	0
-			    items      	(list diagram_item_list)))
-		    (object Class "Vector font"
-			statediagram 	(object State_Diagram ""
-			    title      	""
-			    zoom       	100
-			    max_height 	28350
-			    max_width  	21600
-			    origin_x   	0
-			    origin_y   	0
-			    items      	(list diagram_item_list)))
-		    (object Class "$UNNAMED$3")
-		    (object Class "Palette"
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"GDI object")))
-		    (object Class "Drawable GDI Data")
-		    (object Class_Category "$UNNAMED$4"
-			exportControl 	"Public"
-			logical_models 	(list unit_reference_list)
-			logical_presentations 	(list unit_reference_list))
-		    (object Class_Category "$UNNAMED$5"
-			exportControl 	"Public"
-			logical_models 	(list unit_reference_list)
-			logical_presentations 	(list unit_reference_list))
-		    (object Class_Category "$UNNAMED$6"
-			exportControl 	"Public"
-			logical_models 	(list unit_reference_list)
-			logical_presentations 	(list unit_reference_list))
-		    (object Class_Category "$UNNAMED$7"
-			exportControl 	"Public"
-			logical_models 	(list unit_reference_list)
-			logical_presentations 	(list unit_reference_list)))
-		logical_presentations 	(list unit_reference_list
-		    (object ClassDiagram "Main"
-			title      	"Main"
-			zoom       	100
-			max_height 	28350
-			max_width  	21600
-			origin_x   	0
-			origin_y   	0
-			items      	(list diagram_item_list
-			    (object ClassView "Class" "Bitmap Font" @1
-				location   	(2259, 1427)
-				label      	(object ItemLabel
-				    location   	(2155, 1343)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Bitmap Font")
-				annotation 	8)
-			    (object ClassView "Class" "Brush" @2
-				location   	(1228, 901)
-				label      	(object ItemLabel
-				    location   	(1124, 817)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Brush")
-				annotation 	8)
-			    (object ClassView "Class" "Pen" @3
-				location   	(1709, 904)
-				label      	(object ItemLabel
-				    location   	(1605, 820)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Pen")
-				annotation 	8)
-			    (object ClassView "Class" "Font" @4
-				location   	(2200, 904)
-				label      	(object ItemLabel
-				    location   	(2096, 820)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Font")
-				annotation 	8)
-			    (object ClassView "Class" "Vector font" @5
-				location   	(2659, 1429)
-				label      	(object ItemLabel
-				    location   	(2555, 1345)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Vector font")
-				annotation 	8)
-			    (object HasView ""
-				client     	@4
-				supplier   	@1)
-			    (object HasView ""
-				client     	@4
-				supplier   	@5)
-			    (object ClassView "Class" "Palette" @6
-				location   	(822, 915)
-				label      	(object ItemLabel
-				    location   	(718, 831)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Palette")
-				annotation 	8)
-			    (object ClassView "Class" "Drawable GDI Data" @7
-				location   	(340, 909)
-				label      	(object ItemLabel
-				    location   	(236, 825)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Drawable GDI Data")
-				annotation 	8)))))
-	    (object Class_Category "Drawables"
-		visible_categories 	(list visibility_relationship_list
-		    (object Visibility_Relationship
-			supplier   	"GDI Interface")
-		    (object Visibility_Relationship
-			supplier   	"GDI"))
-		exportControl 	"Public"
-		logical_models 	(list unit_reference_list
-		    (object Class "$UNNAMED$8")
-		    (object Class "Backed up Window"
-			fields     	(list has_relationship_list
-			    (object Has_Relationship
-				supplier   	"Backup Bitmap"))
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"Window"))
-			statediagram 	(object State_Diagram ""
-			    title      	""
-			    zoom       	100
-			    max_height 	28350
-			    max_width  	21600
-			    origin_x   	0
-			    origin_y   	0
-			    items      	(list diagram_item_list)))
-		    (object Class "Window"
-			fields     	(list has_relationship_list
-			    (object Has_Relationship
-				supplier   	"Update Region"
-				supplier_cardinality 	(value cardinality "1")
-				client_cardinality 	(value cardinality "1"))
-			    (object Has_Relationship
-				supplier   	"Clipping region"
-				supplier_cardinality 	(value cardinality "1")
-				client_cardinality 	(value cardinality "1"))
-			    (object Has_Relationship
-				supplier   	"Client region"))
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"Drawable"))
-			operations 	(list Operations
-			    (object Operation "SetVisibility"
-				concurrency 	"Sequential"
-				opExportControl 	"Public"
-				uid        	0))
-			statediagram 	(object State_Diagram ""
-			    title      	""
-			    zoom       	100
-			    max_height 	28350
-			    max_width  	21600
-			    origin_x   	0
-			    origin_y   	0
-			    items      	(list diagram_item_list)))
-		    (object Class "Bitmap"
-			fields     	(list has_relationship_list
-			    (object Has_Relationship
-				supplier   	"Default region"))
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"Drawable"))
-			statediagram 	(object State_Diagram ""
-			    title      	""
-			    zoom       	100
-			    max_height 	28350
-			    max_width  	21600
-			    origin_x   	0
-			    origin_y   	0
-			    items      	(list diagram_item_list)))
-		    (object Class "Backup Bitmap"
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"Bitmap"))
-			statediagram 	(object State_Diagram ""
-			    title      	""
-			    zoom       	100
-			    max_height 	28350
-			    max_width  	21600
-			    origin_x   	0
-			    origin_y   	0
-			    items      	(list diagram_item_list)))
-		    (object Parameterized_Class "$UNNAMED$9")
-		    (object Class_Utility "$UNNAMED$10")
-		    (object Class "$UNNAMED$11")
-		    (object Class "RootWindow"
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"Window"))
-			statediagram 	(object State_Diagram ""
-			    title      	""
-			    zoom       	100
-			    max_height 	28350
-			    max_width  	21600
-			    origin_x   	0
-			    origin_y   	0
-			    items      	(list diagram_item_list)))
-		    (object Class "Update Region"
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"Region"))
-			statediagram 	(object State_Diagram ""
-			    title      	""
-			    zoom       	100
-			    max_height 	28350
-			    max_width  	21600
-			    origin_x   	0
-			    origin_y   	0
-			    items      	(list diagram_item_list)))
-		    (object Class "Root window"
-			collaborators 	(list association_list
-			    (object Association
-				supplier   	"Window"
-				supplier_cardinality 	(value cardinality "n")
-				client_cardinality 	(value cardinality "1"))
-			    (object Association
-				supplier   	"Animator"
-				supplier_cardinality 	(value cardinality "1"))))
-		    (object Class "Client region"
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"Region")))
-		    (object Class "Drawable"
-			fields     	(list has_relationship_list
-			    (object Has_Relationship
-				supplier   	"Gdi Drawable"))
-			statediagram 	(object State_Diagram ""
-			    title      	""
-			    zoom       	100
-			    max_height 	28350
-			    max_width  	21600
-			    origin_x   	0
-			    origin_y   	0
-			    items      	(list diagram_item_list)))
-		    (object Class "Gdi Drawable")
-		    (object Class "Default region")
-		    (object Mechanism @8
-			logical_models 	(list unit_reference_list
-			    (object Object "RootWindow"
-				collaborators 	(list link_list
-				    (object Link
-					supplier   	"Alert Window")
-				    (object Link
-					supplier   	"Client Windows"))
-				class      	"RootWindow"
-				persistence 	"Static"
-				multi      	FALSE)
-			    (object Object "Client Windows"
-				collaborators 	(list link_list
-				    (object Link
-					supplier   	"Temporary Status Window")
-				    (object Link
-					supplier   	"Client Windows")
-				    (object Link
-					supplier   	"Client Windows")
-				    (object Link
-					supplier   	"Client Windows")
-				    (object Link
-					supplier   	"Client Windows")
-				    (object Link
-					supplier   	"Client Windows"))
-				class      	"Window"
-				persistence 	"Transient"
-				multi      	TRUE)
-			    (object Object "Clients"
-				collaborators 	(list link_list
-				    (object Link
-					supplier   	"Client Windows")
-				    (object Link
-					supplier   	"Client Windows")
-				    (object Link
-					supplier   	"Client Windows")
-				    (object Link
-					supplier   	
-|Pseudo
-|Client
-					)
-				    (object Link
-					supplier   	"Client Windows"))
-				class      	"Session"
-				persistence 	"Transient"
-				multi      	TRUE)
-			    (object Object "Window Server"
-				collaborators 	(list link_list
-				    (object Link
-					supplier   	"Status Window")
-				    (object Link
-					supplier   	"RootWindow"
-					supplier_containment 	"By Value"
-					client_containment 	"By Value"))
-				class      	"System Client"
-				persistence 	"Static"
-				multi      	FALSE)
-			    (object Object "Foreground Client"
-				collaborators 	(list link_list
-				    (object Link
-					supplier   	"Client Windows"))
-				class      	"Session"
-				persistence 	"Transient"
-				multi      	FALSE)))
-		    (object Mechanism @9
-			logical_models 	(list unit_reference_list
-			    (object Object "Window"
-				collaborators 	(list link_list
-				    (object Link
-					supplier   	"Window"
-					messages   	(list Messages
-					    (object Message "Child"
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"FromClientToSupplier"
-						sequence   	""
-						ordinal    	0)))
-				    (object Link
-					supplier   	"Window"
-					messages   	(list Messages
-					    (object Message "Sibling"
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"FromClientToSupplier"
-						sequence   	""
-						ordinal    	1)))
-				    (object Link
-					supplier   	"Window"
-					messages   	(list Messages
-					    (object Message "Parent"
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"FromClientToSupplier"
-						sequence   	""
-						ordinal    	2)))
-				    (object Link
-					supplier   	"Window"
-					messages   	(list Messages
-					    (object Message "Sibling"
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"FromClientToSupplier"
-						sequence   	""
-						ordinal    	3)))
-				    (object Link
-					supplier   	"Window"
-					messages   	(list Messages
-					    (object Message "Parent"
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"FromClientToSupplier"
-						sequence   	""
-						ordinal    	4)))
-				    (object Link
-					supplier   	"Window")
-				    (object Link
-					supplier   	"Window")
-				    (object Link
-					supplier   	"Window")
-				    (object Link
-					supplier   	"Window")
-				    (object Link
-					supplier   	"Window")
-				    (object Link
-					supplier   	"Window")
-				    (object Link
-					supplier   	"Window")
-				    (object Link
-					supplier   	"Window")
-				    (object Link
-					supplier   	"Window"
-					messages   	(list Messages
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	5)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	6)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	7)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	8)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	9)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	10)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	11)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	12)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	13)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	14)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	15)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	16)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	17)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	18)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	19)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	20)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	21)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	22)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	23)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	24)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	25)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	26)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	27)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	28)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	29)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	30)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	31))))
-				class      	"Window"
-				persistence 	"Transient"
-				multi      	FALSE))))
-		logical_presentations 	(list unit_reference_list
-		    (object ClassDiagram "Main"
-			title      	"Main"
-			zoom       	100
-			max_height 	28350
-			max_width  	21600
-			origin_x   	0
-			origin_y   	0
-			items      	(list diagram_item_list
-			    (object ClassView "Class" "Backed up Window" @10
-				location   	(1126, 1425)
-				font       	(object Font
-				    size       	10
-				    face       	"helvetica"
-				    bold       	FALSE
-				    italics    	FALSE
-				    underline  	FALSE
-				    strike     	FALSE
-				    color      	0
-				    default_color 	TRUE)
-				label      	(object ItemLabel
-				    location   	(1024, 1343)
-				    nlines     	2
-				    max_width  	236
-				    justify    	0
-				    label      	"Backed up Window")
-				width      	343
-				height     	249
-				annotation 	8)
-			    (object ClassView "Class" "Window" @11
-				location   	(1125, 838)
-				label      	(object ItemLabel
-				    location   	(1021, 754)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Window")
-				annotation 	8)
-			    (object InheritView ""
-				client     	@10
-				supplier   	@11)
-			    (object ClassView "Class" "Bitmap" @12
-				location   	(1744, 832)
-				label      	(object ItemLabel
-				    location   	(1640, 748)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Bitmap")
-				annotation 	8)
-			    (object ClassView "Class" "Backup Bitmap" @13
-				location   	(1743, 1424)
-				label      	(object ItemLabel
-				    location   	(1636, 1337)
-				    nlines     	2
-				    max_width  	249
-				    justify    	0
-				    label      	"Backup Bitmap")
-				width      	362
-				height     	262
-				annotation 	8)
-			    (object InheritView ""
-				client     	@13
-				supplier   	@12)
-			    (object ClassView "Class" "RootWindow" @14
-				location   	(1434, 1145)
-				label      	(object ItemLabel
-				    location   	(1330, 1061)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"RootWindow")
-				annotation 	8)
-			    (object InheritView ""
-				client     	@14
-				supplier   	@11)
-			    (object ClassView "Class" "Update Region" @15
-				location   	(319, 1158)
-				label      	(object ItemLabel
-				    location   	(215, 1074)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Update Region")
-				annotation 	8)
-			    (object HasView ""
-				client     	@10
-				supplier   	@13)
-			    (object HasView ""
-				client     	@11
-				supplier   	@15)
-			    (object ClassView "Class" "Client region" @16
-				location   	(450, 842)
-				label      	(object ItemLabel
-				    location   	(346, 758)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Client region")
-				annotation 	8)
-			    (object HasView ""
-				client     	@11
-				supplier   	@16)
-			    (object ClassView "Class" "Drawable" @17
-				location   	(1390, 426)
-				label      	(object ItemLabel
-				    location   	(1286, 342)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Drawable")
-				annotation 	8)
-			    (object InheritView ""
-				client     	@11
-				supplier   	@17)
-			    (object InheritView ""
-				client     	@12
-				supplier   	@17)
-			    (object ClassView "Class" "Gdi Drawable" @18
-				location   	(2325, 846)
-				label      	(object ItemLabel
-				    location   	(2221, 762)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Gdi Drawable")
-				annotation 	8)
-			    (object HasView ""
-				client     	@17
-				supplier   	@18)
-			    (object ClassView "Class" "Default region" @19
-				location   	(2287, 1226)
-				label      	(object ItemLabel
-				    location   	(2183, 1142)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Default region")
-				annotation 	8)
-			    (object HasView ""
-				client     	@12
-				supplier   	@19)))
-		    (object ObjectDiagram "Protea top level window structure"
-			mechanism_ref 	@8
-			title      	"Protea top level window structure"
-			zoom       	100
-			max_height 	28350
-			max_width  	21600
-			origin_x   	0
-			origin_y   	0
-			items      	(list diagram_item_list
-			    (object ObjectView "RootWindow" @20
-				location   	(334, 1068)
-				label      	(object ItemLabel
-				    location   	(230, 984)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"RootWindow")
-				subobjects 	0
-				x_offset   	0
-				y_offset   	0)
-			    (object ObjectView "Client Windows" @21
-				location   	(703, 1520)
-				label      	(object ItemLabel
-				    location   	(599, 1436)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Client Windows")
-				subobjects 	0
-				x_offset   	-0.078125
-				y_offset   	0.110406)
-			    (object ObjectView "Clients" @22
-				location   	(1500, 523)
-				label      	(object ItemLabel
-				    location   	(1273, 330)
-				    nlines     	2
-				    max_width  	540
-				    justify    	0
-				    label      	"Clients")
-				width      	783
-				height     	567
-				subobjects 	1
-				x_offset   	0
-				y_offset   	0)
-			    (object ObjectView "Client Windows" @23
-				location   	(1337, 1507)
-				label      	(object ItemLabel
-				    location   	(1233, 1423)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Client Windows")
-				subobjects 	0
-				x_offset   	-0.08
-				y_offset   	0.11)
-			    (object ObjectView "Window Server" @24
-				location   	(340, 642)
-				label      	(object ItemLabel
-				    location   	(236, 558)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Window Server")
-				subobjects 	0
-				x_offset   	0
-				y_offset   	0)
-			    (object ObjectView "Client Windows" @25
-				location   	(1928, 1510)
-				label      	(object ItemLabel
-				    location   	(1824, 1426)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Client Windows")
-				subobjects 	0
-				x_offset   	-0.08
-				y_offset   	0.11)
-			    (object ObjectView "Client Windows" @26
-				location   	(2522, 1517)
-				label      	(object ItemLabel
-				    location   	(2418, 1433)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Client Windows")
-				subobjects 	0
-				x_offset   	-0.08
-				y_offset   	0.11)
-			    (object ObjectView "Client Windows" @27
-				location   	(203, 1526)
-				label      	(object ItemLabel
-				    location   	(99, 1442)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Client Windows")
-				subobjects 	0
-				x_offset   	-0.08
-				y_offset   	0.11)
-			    (object ObjectView "Foreground Client" @28
-				location   	(1438, 585)
-				label      	(object ItemLabel
-				    location   	(1335, 499)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Foreground Client")
-				subobjects 	0
-				x_offset   	-0.08
-				y_offset   	0.11)
-			    (object LinkView "" @29
-				client     	@20
-				supplier   	@27)
-			    (object LinkView "" @30
-				client     	@21
-				supplier   	@23)
-			    (object LinkView "" @31
-				client     	@23
-				supplier   	@25)
-			    (object LinkView "" @32
-				client     	@25
-				supplier   	@26)
-			    (object LinkView "" @33
-				client     	@21
-				supplier   	@27)
-			    (object LinkView "" @34
-				client     	@22
-				supplier   	@23)
-			    (object LinkView "" @35
-				client     	@22
-				supplier   	@25)
-			    (object LinkView "" @36
-				client     	@22
-				supplier   	@26)
-			    (object LinkView "" @37
-				client     	@22
-				supplier   	@27)
-			    (object LinkView "" @38
-				client     	@24
-				supplier   	@20)
-			    (object LinkView "" @39
-				client     	@28
-				supplier   	@21)))
-		    (object ObjectDiagram "Basic window tree structure"
-			mechanism_ref 	@9
-			title      	"Basic window tree structure"
-			zoom       	100
-			max_height 	28350
-			max_width  	21600
-			origin_x   	0
-			origin_y   	0
-			items      	(list diagram_item_list
-			    (object ObjectView "Window" @40
-				location   	(715, 272)
-				label      	(object ItemLabel
-				    location   	(611, 188)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Window")
-				subobjects 	0
-				x_offset   	0
-				y_offset   	0)
-			    (object ObjectView "Window" @41
-				location   	(553, 814)
-				label      	(object ItemLabel
-				    location   	(449, 730)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Window")
-				subobjects 	0
-				x_offset   	0
-				y_offset   	0)
-			    (object ObjectView "Window" @42
-				location   	(1306, 814)
-				label      	(object ItemLabel
-				    location   	(1202, 730)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Window")
-				subobjects 	0
-				x_offset   	0
-				y_offset   	0)
-			    (object ObjectView "Window" @43
-				location   	(2090, 814)
-				label      	(object ItemLabel
-				    location   	(1986, 730)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Window")
-				subobjects 	0
-				x_offset   	0
-				y_offset   	0)
-			    (object ObjectView "Window" @44
-				location   	(1306, 1345)
-				label      	(object ItemLabel
-				    location   	(1202, 1261)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Window")
-				subobjects 	0
-				x_offset   	0
-				y_offset   	0)
-			    (object ObjectView "Window" @45
-				location   	(553, 1366)
-				label      	(object ItemLabel
-				    location   	(449, 1282)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Window")
-				subobjects 	0
-				x_offset   	0
-				y_offset   	0)
-			    (object ObjectView "Window" @46
-				location   	(1306, 1823)
-				label      	(object ItemLabel
-				    location   	(1202, 1739)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Window")
-				subobjects 	0
-				x_offset   	0
-				y_offset   	0)
-			    (object ObjectView "Window" @47
-				location   	(1868, 1346)
-				label      	(object ItemLabel
-				    location   	(1764, 1262)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Window")
-				subobjects 	0
-				x_offset   	0
-				y_offset   	0)
-			    (object LinkView "" @48
-				client     	@40
-				supplier   	@41)
-			    (object MessView ""
-				location   	(667, 551)
-				label      	(object SegLabel
-				    location   	(731, 558)
-				    anchor_loc 	1
-				    nlines     	1
-				    max_width  	450
-				    justify    	0
-				    label      	"Child"
-				    pctDist    	0.407895
-				    height     	64
-				    orientation 	0)
-				object_arc 	@48
-				pctDist    	0.494941
-				height     	35
-				orientation 	0
-				dir        	1
-				origin     	(684, 494)
-				terminus   	(650, 608))
-			    (object LinkView "" @49
-				client     	@41
-				supplier   	@42)
-			    (object MessView ""
-				location   	(917, 785)
-				label      	(object SegLabel
-				    location   	(917, 741)
-				    anchor_loc 	1
-				    nlines     	1
-				    max_width  	450
-				    justify    	0
-				    label      	"Sibling"
-				    pctDist    	0.5
-				    height     	45
-				    orientation 	0)
-				object_arc 	@49
-				pctDist    	0.5
-				height     	30
-				orientation 	0
-				dir        	1
-				origin     	(857, 785)
-				terminus   	(977, 785))
-			    (object LinkView "" @50
-				client     	@41
-				supplier   	@40
-				vertices   	(list Points
-				    (572, 705)
-				    (597, 569)
-				    (665, 398)))
-			    (object MessView ""
-				location   	(578, 538)
-				label      	(object SegLabel
-				    location   	(485, 541)
-				    anchor_loc 	1
-				    nlines     	1
-				    max_width  	450
-				    justify    	0
-				    label      	"Parent"
-				    pctDist    	0.199365
-				    height     	87
-				    orientation 	0)
-				object_arc 	@50
-				pctDist    	0.5
-				height     	30
-				orientation 	0
-				dir        	1
-				origin     	(556, 593)
-				terminus   	(600, 483))
-			    (object LinkView "" @51
-				client     	@42
-				supplier   	@43)
-			    (object MessView ""
-				location   	(1676, 783)
-				label      	(object SegLabel
-				    location   	(1676, 748)
-				    anchor_loc 	1
-				    nlines     	1
-				    max_width  	450
-				    justify    	0
-				    label      	"Sibling"
-				    pctDist    	0.5
-				    height     	36
-				    orientation 	0)
-				object_arc 	@51
-				pctDist    	0.478058
-				height     	32
-				orientation 	0
-				dir        	1
-				origin     	(1616, 783)
-				terminus   	(1736, 783))
-			    (object LinkView "" @52
-				client     	@42
-				supplier   	@40)
-			    (object MessView ""
-				location   	(1076, 554)
-				label      	(object SegLabel
-				    location   	(1053, 580)
-				    anchor_loc 	1
-				    nlines     	1
-				    max_width  	450
-				    justify    	0
-				    label      	"Parent"
-				    pctDist    	0.5
-				    height     	36
-				    orientation 	0)
-				object_arc 	@52
-				pctDist    	0.368275
-				height     	37
-				orientation 	1
-				dir        	1
-				origin     	(1119, 594)
-				terminus   	(1033, 514))
-			    (object LinkView "" @53
-				client     	@43
-				supplier   	@40)
-			    (object MessView ""
-				location   	(1478, 528)
-				object_arc 	@53
-				pctDist    	0.451966
-				height     	42
-				orientation 	1
-				dir        	1
-				origin     	(1533, 549)
-				terminus   	(1423, 507))
-			    (object LinkView "" @54
-				client     	@41
-				supplier   	@45)
-			    (object MessView ""
-				location   	(583, 1095)
-				object_arc 	@54
-				pctDist    	0.5
-				height     	30
-				orientation 	0
-				dir        	1
-				origin     	(583, 1035)
-				terminus   	(583, 1155))
-			    (object LinkView "" @55
-				client     	@45
-				supplier   	@41
-				vertices   	(list Points
-				    (537, 1265)
-				    (519, 1159)
-				    (519, 1000)
-				    (532, 932)))
-			    (object MessView ""
-				location   	(485, 1074)
-				object_arc 	@55
-				pctDist    	0.577381
-				height     	35
-				orientation 	0
-				dir        	1
-				origin     	(485, 1133)
-				terminus   	(485, 1015))
-			    (object LinkView "" @56
-				client     	@42
-				supplier   	@44)
-			    (object MessView ""
-				location   	(1336, 1084)
-				object_arc 	@56
-				pctDist    	0.5
-				height     	30
-				orientation 	0
-				dir        	1
-				origin     	(1336, 1024)
-				terminus   	(1336, 1144))
-			    (object LinkView "" @57
-				client     	@44
-				supplier   	@46)
-			    (object MessView ""
-				location   	(1336, 1588)
-				object_arc 	@57
-				pctDist    	0.5
-				height     	30
-				orientation 	0
-				dir        	1
-				origin     	(1336, 1528)
-				terminus   	(1336, 1648))
-			    (object LinkView "" @58
-				client     	@44
-				supplier   	@47)
-			    (object MessView ""
-				location   	(1575, 1316)
-				object_arc 	@58
-				pctDist    	0.5
-				height     	30
-				orientation 	0
-				dir        	1
-				origin     	(1515, 1316)
-				terminus   	(1635, 1316))
-			    (object LinkView "" @59
-				client     	@47
-				supplier   	@42)
-			    (object MessView ""
-				location   	(1553, 1089)
-				object_arc 	@59
-				pctDist    	0.5
-				height     	30
-				orientation 	0
-				dir        	1
-				origin     	(1596, 1129)
-				terminus   	(1510, 1049))
-			    (object LinkView "" @60
-				client     	@44
-				supplier   	@42
-				vertices   	(list Points
-				    (1273, 1241)
-				    (1240, 1140)
-				    (1244, 1006)
-				    (1267, 938)))
-			    (object MessView ""
-				location   	(1212, 1091)
-				object_arc 	@60
-				pctDist    	0.5
-				height     	30
-				orientation 	0
-				dir        	1
-				origin     	(1210, 1150)
-				terminus   	(1214, 1032))
-			    (object LinkView "" @61
-				client     	@46
-				supplier   	@44
-				vertices   	(list Points
-				    (1286, 1721)
-				    (1269, 1640)
-				    (1265, 1537)
-				    (1282, 1464)))
-			    (object MessView ""
-				location   	(1227, 1588)
-				object_arc 	@61
-				pctDist    	0.524425
-				height     	41
-				orientation 	0
-				dir        	1
-				origin     	(1228, 1647)
-				terminus   	(1226, 1529))))))
-	    (object Class_Category "Top level"
-		visible_categories 	(list visibility_relationship_list
-		    (object Visibility_Relationship
-			supplier   	"GDI Interface")
-		    (object Visibility_Relationship
-			supplier   	"Drawables")
-		    (object Visibility_Relationship
-			supplier   	"AGDI")
-		    (object Visibility_Relationship
-			supplier   	"XGDI"))
-		exportControl 	"Public"
-		logical_models 	(list unit_reference_list
-		    (object Class "$UNNAMED$12")
-		    (object Class "Invalid window list"
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"Variable arrayx"))
-			collaborators 	(list association_list
-			    (object Association
-				supplier   	"Root window"
-				supplier_cardinality 	(value cardinality "1")
-				client_cardinality 	(value cardinality "1")))
-			statediagram 	(object State_Diagram ""
-			    title      	""
-			    zoom       	100
-			    max_height 	28350
-			    max_width  	21600
-			    origin_x   	0
-			    origin_y   	0
-			    items      	(list diagram_item_list)))
-		    (object Class_Utility "$UNNAMED$13")
-		    (object Class "Heartbeat"
-			collaborators 	(list association_list
-			    (object Association
-				supplier   	"Animatorx"
-				supplier_cardinality 	(value cardinality "n")
-				client_cardinality 	(value cardinality "1"))
-			    (object Association
-				supplier   	"GDI Controllerx")
-			    (object Association
-				supplier   	"Animator"
-				supplier_cardinality 	(value cardinality "1")
-				client_cardinality 	(value cardinality "1")))
-			concurrency 	"Active"
-			statediagram 	(object State_Diagram ""
-			    title      	""
-			    zoom       	100
-			    max_height 	28350
-			    max_width  	21600
-			    origin_x   	0
-			    origin_y   	0
-			    items      	(list diagram_item_list)))
-		    (object Class "Event queue"
-			statediagram 	(object State_Diagram ""
-			    title      	""
-			    zoom       	100
-			    max_height 	28350
-			    max_width  	21600
-			    origin_x   	0
-			    origin_y   	0
-			    items      	(list diagram_item_list)))
-		    (object Class "Session"
-			fields     	(list has_relationship_list
-			    (object Has_Relationship
-				supplier   	"Invalid window list"
-				supplier_cardinality 	(value cardinality "1")
-				client_cardinality 	(value cardinality "1"))
-			    (object Has_Relationship
-				supplier   	"Clockx"
-				supplier_cardinality 	(value cardinality "n")
-				client_cardinality 	(value cardinality "1"))
-			    (object Has_Relationship
-				supplier   	"Bitmap sequencex"
-				supplier_cardinality 	(value cardinality "n")
-				client_cardinality 	(value cardinality "1"))
-			    (object Has_Relationship
-				supplier   	"Spritex"
-				supplier_cardinality 	(value cardinality "0..1")
-				client_cardinality 	(value cardinality "1"))
-			    (object Has_Relationship
-				supplier   	"Text Cursorx"
-				supplier_cardinality 	(value cardinality "0,1")
-				client_cardinality 	(value cardinality "1"))
-			    (object Has_Relationship
-				supplier   	"Event queue"
-				supplier_cardinality 	(value cardinality "1")
-				client_cardinality 	(value cardinality "1"))
-			    (object Has_Relationship
-				supplier   	"Drawable")
-			    (object Has_Relationship
-				supplier   	"Graphics context")
-			    (object Has_Relationship
-				supplier   	"Temp graphics contextx")
-			    (object Has_Relationship
-				supplier   	"GDI Controllerx")
-			    (object Has_Relationship
-				supplier   	"Animator"
-				supplier_cardinality 	(value cardinality "1")
-				client_cardinality 	(value cardinality "1"))
-			    (object Has_Relationship
-				supplier   	"Root window"
-				supplier_cardinality 	(value cardinality "1")
-				client_cardinality 	(value cardinality "1"))
-			    (object Has_Relationship
-				supplier   	"GDI object")
-			    (object Has_Relationship
-				supplier   	"GDI controller"
-				supplier_cardinality 	(value cardinality "1")
-				client_cardinality 	(value cardinality "1"))
-			    (object Has_Relationship
-				supplier   	"Capture key list"))
-			collaborators 	(list association_list
-			    (object Association
-				label      	"Current GC"
-				supplier   	"Graphics context"
-				supplier_cardinality 	(value cardinality "1")
-				client_cardinality 	(value cardinality "0,1")))
-			statediagram 	(object State_Diagram ""
-			    title      	""
-			    zoom       	100
-			    max_height 	28350
-			    max_width  	21600
-			    origin_x   	0
-			    origin_y   	0
-			    items      	(list diagram_item_list)))
-		    (object Class "Capture key list"
-			statediagram 	(object State_Diagram ""
-			    title      	""
-			    zoom       	100
-			    max_height 	28350
-			    max_width  	21600
-			    origin_x   	0
-			    origin_y   	0
-			    items      	(list diagram_item_list)))
-		    (object Class "Pointer"
-			collaborators 	(list association_list
-			    (object Association
-				supplier   	"Session"
-				supplier_cardinality 	(value cardinality "n")
-				client_cardinality 	(value cardinality "1"))
-			    (object Association
-				supplier   	"Root window"
-				supplier_cardinality 	(value cardinality "n")
-				client_cardinality 	(value cardinality "1")))
-			used_nodes 	(list uses_relationship_list
-			    (object Uses_Relationship
-				supplier   	"Pointer cursor"))
-			concurrency 	"Active")
-		    (object Class "Keyboard"
-			collaborators 	(list association_list
-			    (object Association
-				supplier   	"Session"
-				supplier_cardinality 	(value cardinality "n")
-				client_cardinality 	(value cardinality "1")))
-			concurrency 	"Active")
-		    (object Class "Window server"
-			fields     	(list has_relationship_list
-			    (object Has_Relationship
-				supplier   	"Session"
-				supplier_cardinality 	(value cardinality "n")
-				client_cardinality 	(value cardinality "1")))
-			concurrency 	"Active")
-		    (object Class "Text Cursor"
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"Animatorx"))
-			statediagram 	(object State_Diagram ""
-			    title      	""
-			    zoom       	100
-			    max_height 	28350
-			    max_width  	21600
-			    origin_x   	0
-			    origin_y   	0
-			    items      	(list diagram_item_list)))
-		    (object Class "AGDI controller")
-		    (object Mechanism @62
-			logical_models 	(list unit_reference_list
-			    (object Object "Pointer dispatcher"
-				collaborators 	(list link_list
-				    (object Link
-					supplier   	"Clients"
-					messages   	(list Messages
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"FromClientToSupplier"
-						sequence   	""
-						ordinal    	2)))
-				    (object Link
-					supplier   	"Pointer decoder"
-					messages   	(list Messages
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"FromClientToSupplier"
-						sequence   	""
-						ordinal    	3)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	4))))
-				persistence 	"Transient"
-				multi      	FALSE)
-			    (object Object "Keyboard"
-				collaborators 	(list link_list
-				    (object Link
-					supplier   	"Foreground Client"
-					messages   	(list Messages
-					    (object Message "Key ups & downs"
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"FromClientToSupplier"
-						sequence   	""
-						ordinal    	0))))
-				persistence 	"Transient"
-				multi      	FALSE)
-			    (object Object "Clients"
-				collaborators 	(list link_list
-				    (object Link
-					supplier   	"Client commands"))
-				persistence 	"Transient"
-				multi      	TRUE)
-			    (object Object "Heartbeat"
-				collaborators 	(list link_list
-				    (object Link
-					supplier   	"Animate list"
-					messages   	(list Messages
-					    (object Message "Animate cursor"
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"FromClientToSupplier"
-						sequence   	""
-						ordinal    	1))))
-				persistence 	"Transient"
-				multi      	FALSE)
-			    (object Object "Foreground Client"
-				collaborators 	(list link_list
-				    (object Link
-					supplier   	"Heartbeat"))
-				persistence 	"Transient"
-				multi      	FALSE)
-			    (object Object "Client commands"
-				collaborators 	(list link_list
-				    (object Link
-					supplier   	"Clients"
-					messages   	(list Messages
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"FromClientToSupplier"
-						sequence   	""
-						ordinal    	5)
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"ToClientFromSupplier"
-						sequence   	""
-						ordinal    	6))))
-				persistence 	"Transient"
-				multi      	FALSE)
-			    (object Object "Pointer decoder"
-				persistence 	"Transient"
-				multi      	FALSE)
-			    (object Object "Animate list"
-				collaborators 	(list link_list
-				    (object Link
-					supplier   	"Clients"
-					messages   	(list Messages
-					    (object Message ""
-						frequency  	"Aperiodic"
-						synchronization 	"Simple"
-						dir        	"FromClientToSupplier"
-						sequence   	""
-						ordinal    	7))))
-				persistence 	"Transient"
-				multi      	FALSE))))
-		logical_presentations 	(list unit_reference_list
-		    (object ClassDiagram "Main"
-			title      	"Main"
-			zoom       	100
-			max_height 	28350
-			max_width  	21600
-			origin_x   	0
-			origin_y   	0
-			items      	(list diagram_item_list
-			    (object ClassView "Class" "Invalid window list" @63
-				location   	(913, 1391)
-				label      	(object ItemLabel
-				    location   	(811, 1308)
-				    nlines     	2
-				    max_width  	236
-				    justify    	0
-				    label      	"Invalid window list")
-				width      	343
-				height     	250
-				annotation 	8)
-			    (object ClassView "Class" "Event queue" @64
-				location   	(1962, 757)
-				label      	(object ItemLabel
-				    location   	(1858, 673)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Event queue")
-				annotation 	8)
-			    (object ClassView "Class" "Heartbeat" @65
-				location   	(244, 170)
-				label      	(object ItemLabel
-				    location   	(140, 86)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Heartbeat")
-				annotation 	10)
-			    (object ClassView "Class" "Session" @66
-				location   	(1684, 1494)
-				label      	(object ItemLabel
-				    location   	(1580, 1410)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Session")
-				annotation 	8)
-			    (object HasView ""
-				client     	@66
-				supplier   	@64)
-			    (object ClassView "Class" "Capture key list" @67
-				location   	(2440, 498)
-				label      	(object ItemLabel
-				    location   	(2336, 414)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Capture key list")
-				annotation 	8)
-			    (object ClassView "Class" "Pointer" @68
-				location   	(712, 176)
-				label      	(object ItemLabel
-				    location   	(608, 92)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Pointer")
-				annotation 	10)
-			    (object ClassView "Class" "Keyboard" @69
-				location   	(2453, 957)
-				label      	(object ItemLabel
-				    location   	(2349, 873)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Keyboard")
-				annotation 	10)
-			    (object ClassView "Class" "Window server" @70
-				location   	(1759, 292)
-				label      	(object ItemLabel
-				    location   	(1655, 208)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Window server")
-				annotation 	10)
-			    (object HasView ""
-				client     	@66
-				supplier   	@63)
-			    (object ClassView "Class" "Animator" @71
-				location   	(278, 1782)
-				label      	(object ItemLabel
-				    location   	(174, 1698)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Animator")
-				annotation 	8)
-			    (object AssociationView ""
-				client     	@65
-				supplier   	@71)
-			    (object HasView ""
-				client     	@66
-				supplier   	@71)
-			    (object ClassView "Class" "Root window" @72
-				location   	(712, 976)
-				label      	(object ItemLabel
-				    location   	(608, 892)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Root window")
-				annotation 	8)
-			    (object HasView ""
-				client     	@66
-				supplier   	@72)
-			    (object AssociationView ""
-				client     	@63
-				supplier   	@72)
-			    (object AssociationView ""
-				client     	@72
-				supplier   	@71)
-			    (object HasView ""
-				client     	@66
-				supplier   	@67)
-			    (object ClassView "Class" "Pointer cursor" @73
-				location   	(459, 700)
-				label      	(object ItemLabel
-				    location   	(355, 616)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Pointer cursor")
-				annotation 	8)
-			    (object UsesView ""
-				client     	@68
-				supplier   	@73)
-			    (object HasView ""
-				client     	@71
-				supplier   	@73)
-			    (object HasView ""
-				client     	@70
-				supplier   	@66)
-			    (object AssociationView ""
-				client     	@69
-				supplier   	@66)
-			    (object AssociationView ""
-				client     	@68
-				supplier   	@66)
-			    (object AssociationView ""
-				client     	@68
-				supplier   	@72)))
-		    (object ObjectDiagram "Event handling"
-			mechanism_ref 	@62
-			title      	"Event handling"
-			zoom       	94
-			max_height 	28350
-			max_width  	21600
-			origin_x   	0
-			origin_y   	0
-			items      	(list diagram_item_list
-			    (object ObjectView "Pointer dispatcher" @74
-				location   	(1430, 339)
-				label      	(object ItemLabel
-				    location   	(1326, 255)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Pointer dispatcher")
-				subobjects 	0
-				x_offset   	0
-				y_offset   	0)
-			    (object ObjectView "Keyboard" @75
-				location   	(306, 613)
-				label      	(object ItemLabel
-				    location   	(202, 529)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Keyboard")
-				subobjects 	0
-				x_offset   	-0.08
-				y_offset   	0.11)
-			    (object ObjectView "Clients" @76
-				location   	(964, 1683)
-				label      	(object ItemLabel
-				    location   	(737, 1490)
-				    nlines     	2
-				    max_width  	540
-				    justify    	0
-				    label      	"Clients")
-				width      	783
-				height     	567
-				subobjects 	1
-				x_offset   	0
-				y_offset   	0)
-			    (object ObjectView "Heartbeat" @77
-				location   	(2667, 621)
-				label      	(object ItemLabel
-				    location   	(2563, 537)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Heartbeat")
-				subobjects 	0
-				x_offset   	0
-				y_offset   	0)
-			    (object ObjectView "Foreground Client" @78
-				location   	(904, 1678)
-				label      	(object ItemLabel
-				    location   	(800, 1595)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Foreground Client")
-				width      	349
-				height     	250
-				subobjects 	0
-				x_offset   	-0.076628
-				y_offset   	-0.007055)
-			    (object ObjectView "Client commands" @79
-				location   	(885, 578)
-				label      	(object ItemLabel
-				    location   	(781, 494)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Client commands")
-				subobjects 	0
-				x_offset   	0
-				y_offset   	0)
-			    (object ObjectView "Pointer decoder" @80
-				location   	(1557, 850)
-				label      	(object ItemLabel
-				    location   	(1453, 766)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Pointer decoder")
-				subobjects 	0
-				x_offset   	0.033206
-				y_offset   	-0.661376)
-			    (object ObjectView "Animate list" @81
-				location   	(2165, 930)
-				label      	(object ItemLabel
-				    location   	(2061, 846)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Animate list")
-				subobjects 	0
-				x_offset   	0
-				y_offset   	0)
-			    (object LinkView "" @82
-				client     	@74
-				supplier   	@76)
-			    (object MessView ""
-				location   	(1307, 761)
-				object_arc 	@82
-				pctDist    	0.308797
-				height     	22
-				orientation 	0
-				dir        	1
-				origin     	(1326, 704)
-				terminus   	(1288, 818))
-			    (object LinkView "" @83
-				client     	@74
-				supplier   	@80)
-			    (object MessView ""
-				location   	(1522, 587)
-				object_arc 	@83
-				pctDist    	0.5
-				height     	30
-				orientation 	0
-				dir        	1
-				origin     	(1507, 529)
-				terminus   	(1537, 645))
-			    (object MessView ""
-				location   	(1465, 600)
-				object_arc 	@83
-				pctDist    	0.5
-				height     	30
-				orientation 	1
-				dir        	-1
-				origin     	(1479, 657)
-				terminus   	(1451, 543))
-			    (object LinkView "" @84
-				client     	@75
-				supplier   	@78)
-			    (object MessView "Key ups & downs"
-				location   	(623, 1120)
-				label      	(object SegLabel
-				    location   	(627, 1054)
-				    anchor_loc 	1
-				    nlines     	1
-				    max_width  	450
-				    justify    	0
-				    label      	"Key ups & downs"
-				    pctDist    	0.032819
-				    height     	37
-				    orientation 	0)
-				object_arc 	@84
-				pctDist    	0.501153
-				height     	29
-				orientation 	0
-				dir        	1
-				origin     	(594, 1068)
-				terminus   	(652, 1172))
-			    (object LinkView "" @85
-				client     	@77
-				supplier   	@81)
-			    (object MessView "Animate cursor"
-				location   	(2453, 725)
-				label      	(object SegLabel
-				    location   	(2472, 755)
-				    anchor_loc 	1
-				    nlines     	1
-				    max_width  	450
-				    justify    	0
-				    label      	"Animate cursor"
-				    pctDist    	0.5
-				    height     	36
-				    orientation 	0)
-				object_arc 	@85
-				pctDist    	0.423651
-				height     	25
-				orientation 	1
-				dir        	1
-				origin     	(2503, 693)
-				terminus   	(2403, 757))
-			    (object LinkView "" @86
-				client     	@79
-				supplier   	@76)
-			    (object MessView ""
-				location   	(951, 1070)
-				object_arc 	@86
-				pctDist    	0.5
-				height     	30
-				orientation 	0
-				dir        	1
-				origin     	(946, 1010)
-				terminus   	(956, 1130))
-			    (object MessView ""
-				location   	(892, 1073)
-				object_arc 	@86
-				pctDist    	0.5
-				height     	30
-				orientation 	1
-				dir        	-1
-				origin     	(896, 1132)
-				terminus   	(888, 1014))
-			    (object LinkView "" @87
-				client     	@81
-				supplier   	@76)
-			    (object MessView ""
-				location   	(1737, 1153)
-				object_arc 	@87
-				pctDist    	0.401609
-				height     	39
-				orientation 	1
-				dir        	1
-				origin     	(1787, 1121)
-				terminus   	(1687, 1185))))))
-	    (object Class_Category "OLIB"
-		exportControl 	"Public"
-		logical_models 	(list unit_reference_list)
-		logical_presentations 	(list unit_reference_list
-		    (object ClassDiagram "Main"
-			title      	"Main"
-			zoom       	100
-			max_height 	28350
-			max_width  	21600
-			origin_x   	0
-			origin_y   	0
-			items      	(list diagram_item_list))))
-	    (object Class_Category "AGDI"
-		visible_categories 	(list visibility_relationship_list
-		    (object Visibility_Relationship
-			supplier   	"GDI Interface")
-		    (object Visibility_Relationship
-			supplier   	"GDI")
-		    (object Visibility_Relationship
-			supplier   	"Drawables"))
-		exportControl 	"Public"
-		logical_models 	(list unit_reference_list
-		    (object Class "Animated DLL Interface"
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"Animator"))
-			statediagram 	(object State_Diagram ""
-			    title      	""
-			    zoom       	100
-			    max_height 	28350
-			    max_width  	21600
-			    origin_x   	0
-			    origin_y   	0
-			    items      	(list diagram_item_list)))
-		    (object Class "Bitmap sequence"
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"Animator")))
-		    (object Class "Sprite"
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"Animator"))
-			statediagram 	(object State_Diagram ""
-			    title      	""
-			    zoom       	100
-			    max_height 	28350
-			    max_width  	21600
-			    origin_x   	0
-			    origin_y   	0
-			    items      	(list diagram_item_list)))
-		    (object Class "Text cursor"
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"Animator")))
-		    (object Class "AGDI Controller"
-			fields     	(list has_relationship_list
-			    (object Has_Relationship
-				supplier   	"Animator"
-				supplier_cardinality 	(value cardinality "n")
-				client_cardinality 	(value cardinality "1"))))
-		    (object Class "Animator"
-			fields     	(list has_relationship_list
-			    (object Has_Relationship
-				supplier   	"Pointer cursor"))
-			collaborators 	(list association_list
-			    (object Association
-				supplier   	"Graphics context"
-				supplier_cardinality 	(value cardinality "1")
-				client_cardinality 	(value cardinality "n"))
-			    (object Association
-				supplier   	"Drawable"
-				supplier_cardinality 	(value cardinality "1")
-				client_cardinality 	(value cardinality "n"))
-			    (object Association
-				supplier   	"GDI object"
-				supplier_cardinality 	(value cardinality "n")
-				client_cardinality 	(value cardinality "n"))))
-		    (object Class "Pointer cursor"
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"Sprite"))))
-		logical_presentations 	(list unit_reference_list
-		    (object ClassDiagram "Main"
-			title      	"Main"
-			zoom       	100
-			max_height 	28350
-			max_width  	21600
-			origin_x   	0
-			origin_y   	0
-			items      	(list diagram_item_list
-			    (object ClassView "Class" "Animated DLL Interface" @88
-				location   	(444, 1156)
-				label      	(object ItemLabel
-				    location   	(340, 1072)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Animated DLL Interface")
-				annotation 	8)
-			    (object ClassView "Class" "Sprite" @89
-				location   	(1650, 1142)
-				label      	(object ItemLabel
-				    location   	(1546, 1058)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Sprite")
-				annotation 	8)
-			    (object ClassView "Class" "Text cursor" @90
-				location   	(1034, 1167)
-				label      	(object ItemLabel
-				    location   	(930, 1083)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Text cursor")
-				annotation 	8)
-			    (object ClassView "Class" "Animator" @91
-				location   	(569, 589)
-				label      	(object ItemLabel
-				    location   	(465, 505)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Animator")
-				annotation 	8)
-			    (object InheritView ""
-				client     	@89
-				supplier   	@91)
-			    (object InheritView ""
-				client     	@90
-				supplier   	@91)
-			    (object InheritView ""
-				client     	@88
-				supplier   	@91)
-			    (object ClassView "Class" "Pointer cursor" @92
-				location   	(1840, 1610)
-				label      	(object ItemLabel
-				    location   	(1736, 1526)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Pointer cursor")
-				annotation 	8)
-			    (object InheritView ""
-				client     	@92
-				supplier   	@89)))))
-	    (object Class_Category "Test code using AGDI interface"
-		visible_categories 	(list visibility_relationship_list
-		    (object Visibility_Relationship
-			supplier   	"GDI")
-		    (object Visibility_Relationship
-			supplier   	"Drawables"))
-		exportControl 	"Public"
-		logical_models 	(list unit_reference_list)
-		logical_presentations 	(list unit_reference_list))
-	    (object Class_Category "Dummy test window server "
-		visible_categories 	(list visibility_relationship_list
-		    (object Visibility_Relationship
-			supplier   	"GDI Interface")
-		    (object Visibility_Relationship
-			supplier   	"Drawables")
-		    (object Visibility_Relationship
-			supplier   	"AGDI"))
-		exportControl 	"Public"
-		logical_models 	(list unit_reference_list)
-		logical_presentations 	(list unit_reference_list))
-	    (object Class_Category "XGDI"
-		visible_categories 	(list visibility_relationship_list
-		    (object Visibility_Relationship
-			supplier   	"GDI Interface")
-		    (object Visibility_Relationship
-			supplier   	"Drawables")
-		    (object Visibility_Relationship
-			supplier   	"GDI"))
-		exportControl 	"Public"
-		logical_models 	(list unit_reference_list)
-		logical_presentations 	(list unit_reference_list)))
-	logical_presentations 	(list unit_reference_list
-	    (object ClassDiagram "Main"
-		title      	"Main"
-		zoom       	100
-		max_height 	28350
-		max_width  	21600
-		origin_x   	0
-		origin_y   	0
-		items      	(list diagram_item_list
-		    (object CategoryView "GDI" @93
-			location   	(525, 1050)
-			font       	(object Font
-			    size       	12
-			    face       	"helvetica"
-			    bold       	FALSE
-			    italics    	FALSE
-			    underline  	FALSE
-			    strike     	FALSE
-			    color      	0
-			    default_color 	TRUE)
-			label      	(object ItemLabel
-			    location   	(381, 966)
-			    nlines     	2
-			    max_width  	288
-			    justify    	0
-			    label      	"GDI")
-			width      	300
-			height     	180)
-		    (object CategoryView "Drawables" @94
-			location   	(740, 439)
-			font       	(object Font
-			    size       	12
-			    face       	"helvetica"
-			    bold       	FALSE
-			    italics    	FALSE
-			    underline  	FALSE
-			    strike     	FALSE
-			    color      	0
-			    default_color 	TRUE)
-			label      	(object ItemLabel
-			    location   	(596, 355)
-			    nlines     	2
-			    max_width  	288
-			    justify    	0
-			    label      	"Drawables")
-			width      	300
-			height     	180)
-		    (object CategoryView "Top level" @95
-			location   	(528, 158)
-			font       	(object Font
-			    size       	12
-			    face       	"helvetica"
-			    bold       	FALSE
-			    italics    	FALSE
-			    underline  	FALSE
-			    strike     	FALSE
-			    color      	0
-			    default_color 	TRUE)
-			label      	(object ItemLabel
-			    location   	(384, 74)
-			    nlines     	2
-			    max_width  	288
-			    justify    	0
-			    label      	"Top level")
-			width      	300
-			height     	180)
-		    (object CategoryView "AGDI" @96
-			location   	(1209, 437)
-			label      	(object ItemLabel
-			    location   	(1065, 353)
-			    nlines     	2
-			    max_width  	288
-			    justify    	0
-			    label      	"AGDI")
-			width      	300
-			height     	180)
-		    (object ImportView ""
-			client     	@95
-			supplier   	@94)
-		    (object ImportView ""
-			client     	@95
-			supplier   	@96)
-		    (object CategoryView "Drawables" @97
-			location   	(1911, 1251)
-			font       	(object Font
-			    size       	12
-			    face       	"helvetica"
-			    bold       	FALSE
-			    italics    	FALSE
-			    underline  	FALSE
-			    strike     	FALSE
-			    color      	0
-			    default_color 	TRUE)
-			label      	(object ItemLabel
-			    location   	(1767, 1167)
-			    nlines     	2
-			    max_width  	288
-			    justify    	0
-			    label      	"Drawables")
-			width      	300
-			height     	180)
-		    (object CategoryView "GDI" @98
-			location   	(1656, 1840)
-			font       	(object Font
-			    size       	12
-			    face       	"helvetica"
-			    bold       	FALSE
-			    italics    	FALSE
-			    underline  	FALSE
-			    strike     	FALSE
-			    color      	0
-			    default_color 	TRUE)
-			label      	(object ItemLabel
-			    location   	(1512, 1756)
-			    nlines     	2
-			    max_width  	288
-			    justify    	0
-			    label      	"GDI")
-			width      	300
-			height     	180)
-		    (object CategoryView "Test code using AGDI interface" @99
-			location   	(2401, 1249)
-			label      	(object ItemLabel
-			    location   	(2238, 1155)
-			    nlines     	2
-			    max_width  	326
-			    justify    	0
-			    label      	"Test code using AGDI interface")
-			width      	338
-			height     	200)
-		    (object CategoryView "XGDI" @100
-			location   	(234, 437)
-			label      	(object ItemLabel
-			    location   	(90, 353)
-			    nlines     	2
-			    max_width  	288
-			    justify    	0
-			    label      	"XGDI")
-			width      	300
-			height     	180)
-		    (object ImportView ""
-			client     	@95
-			supplier   	@100)
-		    (object ImportView ""
-			client     	@100
-			supplier   	@94)
-		    (object ImportView ""
-			client     	@97
-			supplier   	@98)
-		    (object ImportView ""
-			client     	@99
-			supplier   	@98)
-		    (object ImportView ""
-			client     	@99
-			supplier   	@97)
-		    (object ImportView ""
-			client     	@94
-			supplier   	@93)
-		    (object ImportView ""
-			client     	@100
-			supplier   	@93)
-		    (object ImportView ""
-			client     	@96
-			supplier   	@93)
-		    (object ImportView ""
-			client     	@96
-			supplier   	@94)))))
-    root_subsystem 	(object SubSystem "<Top Level>"
-	physical_models 	(list unit_reference_list
-	    (object module "$UNNAMED$14" "SubType" "Specification"
-		visible_modules 	(list dependency_list
-		    (object Dependency_Relationship
-			supplier   	"$UNNAMED$15"
-			supplier_is_spec 	TRUE)
-		    (object Dependency_Relationship
-			supplier   	"$UNNAMED$16"
-			supplier_is_spec 	TRUE)))
-	    (object module "$UNNAMED$15" "PackageType" "Specification"
-		visible_modules 	(list dependency_list
-		    (object Dependency_Relationship
-			supplier   	"$UNNAMED$16"
-			supplier_is_spec 	TRUE)))
-	    (object module "$UNNAMED$17" "PackageType" "Specification"
-		visible_modules 	(list dependency_list
-		    (object Dependency_Relationship
-			supplier_is_spec 	TRUE)))
-	    (object module "$UNNAMED$16" "TaskType" "Specification"
-		visible_modules 	(list dependency_list
-		    (object Dependency_Relationship
-			supplier_is_spec 	TRUE)))
-	    (object module "$UNNAMED$18" "PackageType" "Specification")
-	    (object module "$UNNAMED$19" "SubType" "Specification")
-	    (object module "$UNNAMED$20" "TaskType" "Specification")
-	    (object SubSystem "$UNNAMED$21"
-		physical_models 	(list unit_reference_list)
-		physical_presentations 	(list unit_reference_list))
-	    (object SubSystem "$UNNAMED$22"
-		physical_models 	(list unit_reference_list)
-		physical_presentations 	(list unit_reference_list)))
-	physical_presentations 	(list unit_reference_list
-	    (object Module_Diagram "Main"
-		title      	"Main"
-		zoom       	100
-		max_height 	28350
-		max_width  	21600
-		origin_x   	0
-		origin_y   	0
-		items      	(list diagram_item_list))))
-    process_structure 	(object Processes
-	ProcsNDevs 	(list
-	    (object Processor "Processor"
-		connections 	(list connection_list
-		    (object Connection_Relationship
-			supplier   	"VDU"
-			supplier_is_device 	TRUE))
-		characteristics 	""
-		scheduling 	"Preemptive"
-		processes  	(list processes))
-	    (object Device "Keyboard"
-		connections 	(list connection_list
-		    (object Connection_Relationship
-			supplier   	"Processor"
-			supplier_is_device 	FALSE))
-		characteristics 	"")
-	    (object Device "VDU"
-		characteristics 	"")
-	    (object Device "Pointing device"
-		connections 	(list connection_list
-		    (object Connection_Relationship
-			supplier   	"Processor"
-			supplier_is_device 	FALSE))
-		characteristics 	"")
-	    (object Process_Diagram ""
-		title      	""
-		zoom       	100
-		max_height 	28350
-		max_width  	21600
-		origin_x   	0
-		origin_y   	0
-		items      	(list diagram_item_list
-		    (object ProcessorView "Processor" @101
-			location   	(1334, 544)
-			label      	(object ItemLabel
-			    location   	(1156, 449)
-			    nlines     	2
-			    max_width  	246
-			    justify    	0
-			    label      	"Processor")
-			width      	360
-			height     	300
-			annotation 	0)
-		    (object DeviceView "Keyboard" @102
-			location   	(853, 409)
-			label      	(object ItemLabel
-			    location   	(675, 314)
-			    nlines     	2
-			    max_width  	246
-			    justify    	0
-			    label      	"Keyboard")
-			width      	360
-			height     	300
-			annotation 	0)
-		    (object DeviceView "VDU" @103
-			location   	(1968, 543)
-			label      	(object ItemLabel
-			    location   	(1790, 448)
-			    nlines     	2
-			    max_width  	246
-			    justify    	0
-			    label      	"VDU")
-			width      	360
-			height     	300
-			annotation 	0)
-		    (object DeviceView "Pointing device" @104
-			location   	(443, 668)
-			label      	(object ItemLabel
-			    location   	(265, 573)
-			    nlines     	2
-			    max_width  	246
-			    justify    	0
-			    label      	"Pointing device")
-			width      	360
-			height     	300
-			annotation 	0)
-		    (object ConnectionView ""
-			client     	@101
-			supplier   	@103)
-		    (object ConnectionView ""
-			client     	@104
-			supplier   	@101)
-		    (object ConnectionView ""
-			client     	@102
-			supplier   	@101)))))
-    properties 	(object Properties))
+
+(object Petal
+    version    	35)
+
+(object Design "<Top Level>"
+    is_unit    	TRUE
+    file_name  	"d:\wserv\des\wserv.mdl"
+    is_loaded  	TRUE
+    defaults   	(object defaults
+	rightMargin 	0.25
+	leftMargin 	0.25
+	topMargin  	0.25
+	bottomMargin 	0.5
+	pageOverlap 	0.25
+	clipIconLabels 	TRUE
+	autoResize 	FALSE
+	snapToGrid 	TRUE
+	gridX      	0
+	gridY      	0
+	defaultFont 	(object Font
+	    size       	10
+	    face       	"Arial"
+	    bold       	FALSE
+	    italics    	FALSE
+	    underline  	FALSE
+	    strike     	FALSE
+	    color      	0
+	    default_color 	TRUE)
+	showMessageNum 	3)
+    root_category 	(object Class_Category "<Top Level>"
+	exportControl 	"Public"
+	global     	TRUE
+	subsystem  	"<Top Level>"
+	logical_models 	(list unit_reference_list
+	    (object Class "$UNNAMED$0")
+	    (object Class "Client ")
+	    (object Class_Category "GDI"
+		exportControl 	"Public"
+		logical_models 	(list unit_reference_list
+		    (object Class "Bitmap Font"
+			statediagram 	(object State_Diagram ""
+			    title      	""
+			    zoom       	100
+			    max_height 	28350
+			    max_width  	21600
+			    origin_x   	0
+			    origin_y   	0
+			    items      	(list diagram_item_list)))
+		    (object Class "Brush"
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"GDI object"))
+			statediagram 	(object State_Diagram ""
+			    title      	""
+			    zoom       	100
+			    max_height 	28350
+			    max_width  	21600
+			    origin_x   	0
+			    origin_y   	0
+			    items      	(list diagram_item_list)))
+		    (object Class "Pen"
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"GDI object"))
+			statediagram 	(object State_Diagram ""
+			    title      	""
+			    zoom       	100
+			    max_height 	28350
+			    max_width  	21600
+			    origin_x   	0
+			    origin_y   	0
+			    items      	(list diagram_item_list)))
+		    (object Class "CBackground")
+		    (object Class "integer"
+			nonclass   	TRUE)
+		    (object Class "CPenCursor")
+		    (object Class "CTextCursor")
+		    (object Class "$UNNAMED$1")
+		    (object Class "$UNNAMED$2")
+		    (object Class " WS Object"
+			statediagram 	(object State_Diagram ""
+			    title      	""
+			    zoom       	100
+			    max_height 	28350
+			    max_width  	21600
+			    origin_x   	0
+			    origin_y   	0
+			    items      	(list diagram_item_list)))
+		    (object Class "Drawablex"
+			statediagram 	(object State_Diagram ""
+			    title      	""
+			    zoom       	100
+			    max_height 	28350
+			    max_width  	21600
+			    origin_x   	0
+			    origin_y   	0
+			    items      	(list diagram_item_list)))
+		    (object Class "Font"
+			fields     	(list has_relationship_list
+			    (object Has_Relationship
+				supplier   	"Bitmap Font"
+				supplier_cardinality 	(value cardinality "0..1")
+				client_cardinality 	(value cardinality "n"))
+			    (object Has_Relationship
+				supplier   	"Vector font"
+				supplier_cardinality 	(value cardinality "0..1")
+				client_cardinality 	(value cardinality "n")))
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"GDI object"))
+			statediagram 	(object State_Diagram ""
+			    title      	""
+			    zoom       	100
+			    max_height 	28350
+			    max_width  	21600
+			    origin_x   	0
+			    origin_y   	0
+			    items      	(list diagram_item_list)))
+		    (object Class "Vector font"
+			statediagram 	(object State_Diagram ""
+			    title      	""
+			    zoom       	100
+			    max_height 	28350
+			    max_width  	21600
+			    origin_x   	0
+			    origin_y   	0
+			    items      	(list diagram_item_list)))
+		    (object Class "$UNNAMED$3")
+		    (object Class "Palette"
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"GDI object")))
+		    (object Class "Drawable GDI Data")
+		    (object Class_Category "$UNNAMED$4"
+			exportControl 	"Public"
+			logical_models 	(list unit_reference_list)
+			logical_presentations 	(list unit_reference_list))
+		    (object Class_Category "$UNNAMED$5"
+			exportControl 	"Public"
+			logical_models 	(list unit_reference_list)
+			logical_presentations 	(list unit_reference_list))
+		    (object Class_Category "$UNNAMED$6"
+			exportControl 	"Public"
+			logical_models 	(list unit_reference_list)
+			logical_presentations 	(list unit_reference_list))
+		    (object Class_Category "$UNNAMED$7"
+			exportControl 	"Public"
+			logical_models 	(list unit_reference_list)
+			logical_presentations 	(list unit_reference_list)))
+		logical_presentations 	(list unit_reference_list
+		    (object ClassDiagram "Main"
+			title      	"Main"
+			zoom       	100
+			max_height 	28350
+			max_width  	21600
+			origin_x   	0
+			origin_y   	0
+			items      	(list diagram_item_list
+			    (object ClassView "Class" "Bitmap Font" @1
+				location   	(2259, 1427)
+				label      	(object ItemLabel
+				    location   	(2155, 1343)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Bitmap Font")
+				annotation 	8)
+			    (object ClassView "Class" "Brush" @2
+				location   	(1228, 901)
+				label      	(object ItemLabel
+				    location   	(1124, 817)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Brush")
+				annotation 	8)
+			    (object ClassView "Class" "Pen" @3
+				location   	(1709, 904)
+				label      	(object ItemLabel
+				    location   	(1605, 820)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Pen")
+				annotation 	8)
+			    (object ClassView "Class" "Font" @4
+				location   	(2200, 904)
+				label      	(object ItemLabel
+				    location   	(2096, 820)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Font")
+				annotation 	8)
+			    (object ClassView "Class" "Vector font" @5
+				location   	(2659, 1429)
+				label      	(object ItemLabel
+				    location   	(2555, 1345)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Vector font")
+				annotation 	8)
+			    (object HasView ""
+				client     	@4
+				supplier   	@1)
+			    (object HasView ""
+				client     	@4
+				supplier   	@5)
+			    (object ClassView "Class" "Palette" @6
+				location   	(822, 915)
+				label      	(object ItemLabel
+				    location   	(718, 831)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Palette")
+				annotation 	8)
+			    (object ClassView "Class" "Drawable GDI Data" @7
+				location   	(340, 909)
+				label      	(object ItemLabel
+				    location   	(236, 825)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Drawable GDI Data")
+				annotation 	8)))))
+	    (object Class_Category "Drawables"
+		visible_categories 	(list visibility_relationship_list
+		    (object Visibility_Relationship
+			supplier   	"GDI Interface")
+		    (object Visibility_Relationship
+			supplier   	"GDI"))
+		exportControl 	"Public"
+		logical_models 	(list unit_reference_list
+		    (object Class "$UNNAMED$8")
+		    (object Class "Backed up Window"
+			fields     	(list has_relationship_list
+			    (object Has_Relationship
+				supplier   	"Backup Bitmap"))
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"Window"))
+			statediagram 	(object State_Diagram ""
+			    title      	""
+			    zoom       	100
+			    max_height 	28350
+			    max_width  	21600
+			    origin_x   	0
+			    origin_y   	0
+			    items      	(list diagram_item_list)))
+		    (object Class "Window"
+			fields     	(list has_relationship_list
+			    (object Has_Relationship
+				supplier   	"Update Region"
+				supplier_cardinality 	(value cardinality "1")
+				client_cardinality 	(value cardinality "1"))
+			    (object Has_Relationship
+				supplier   	"Clipping region"
+				supplier_cardinality 	(value cardinality "1")
+				client_cardinality 	(value cardinality "1"))
+			    (object Has_Relationship
+				supplier   	"Client region"))
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"Drawable"))
+			operations 	(list Operations
+			    (object Operation "SetVisibility"
+				concurrency 	"Sequential"
+				opExportControl 	"Public"
+				uid        	0))
+			statediagram 	(object State_Diagram ""
+			    title      	""
+			    zoom       	100
+			    max_height 	28350
+			    max_width  	21600
+			    origin_x   	0
+			    origin_y   	0
+			    items      	(list diagram_item_list)))
+		    (object Class "Bitmap"
+			fields     	(list has_relationship_list
+			    (object Has_Relationship
+				supplier   	"Default region"))
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"Drawable"))
+			statediagram 	(object State_Diagram ""
+			    title      	""
+			    zoom       	100
+			    max_height 	28350
+			    max_width  	21600
+			    origin_x   	0
+			    origin_y   	0
+			    items      	(list diagram_item_list)))
+		    (object Class "Backup Bitmap"
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"Bitmap"))
+			statediagram 	(object State_Diagram ""
+			    title      	""
+			    zoom       	100
+			    max_height 	28350
+			    max_width  	21600
+			    origin_x   	0
+			    origin_y   	0
+			    items      	(list diagram_item_list)))
+		    (object Parameterized_Class "$UNNAMED$9")
+		    (object Class_Utility "$UNNAMED$10")
+		    (object Class "$UNNAMED$11")
+		    (object Class "RootWindow"
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"Window"))
+			statediagram 	(object State_Diagram ""
+			    title      	""
+			    zoom       	100
+			    max_height 	28350
+			    max_width  	21600
+			    origin_x   	0
+			    origin_y   	0
+			    items      	(list diagram_item_list)))
+		    (object Class "Update Region"
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"Region"))
+			statediagram 	(object State_Diagram ""
+			    title      	""
+			    zoom       	100
+			    max_height 	28350
+			    max_width  	21600
+			    origin_x   	0
+			    origin_y   	0
+			    items      	(list diagram_item_list)))
+		    (object Class "Root window"
+			collaborators 	(list association_list
+			    (object Association
+				supplier   	"Window"
+				supplier_cardinality 	(value cardinality "n")
+				client_cardinality 	(value cardinality "1"))
+			    (object Association
+				supplier   	"Animator"
+				supplier_cardinality 	(value cardinality "1"))))
+		    (object Class "Client region"
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"Region")))
+		    (object Class "Drawable"
+			fields     	(list has_relationship_list
+			    (object Has_Relationship
+				supplier   	"Gdi Drawable"))
+			statediagram 	(object State_Diagram ""
+			    title      	""
+			    zoom       	100
+			    max_height 	28350
+			    max_width  	21600
+			    origin_x   	0
+			    origin_y   	0
+			    items      	(list diagram_item_list)))
+		    (object Class "Gdi Drawable")
+		    (object Class "Default region")
+		    (object Mechanism @8
+			logical_models 	(list unit_reference_list
+			    (object Object "RootWindow"
+				collaborators 	(list link_list
+				    (object Link
+					supplier   	"Alert Window")
+				    (object Link
+					supplier   	"Client Windows"))
+				class      	"RootWindow"
+				persistence 	"Static"
+				multi      	FALSE)
+			    (object Object "Client Windows"
+				collaborators 	(list link_list
+				    (object Link
+					supplier   	"Temporary Status Window")
+				    (object Link
+					supplier   	"Client Windows")
+				    (object Link
+					supplier   	"Client Windows")
+				    (object Link
+					supplier   	"Client Windows")
+				    (object Link
+					supplier   	"Client Windows")
+				    (object Link
+					supplier   	"Client Windows"))
+				class      	"Window"
+				persistence 	"Transient"
+				multi      	TRUE)
+			    (object Object "Clients"
+				collaborators 	(list link_list
+				    (object Link
+					supplier   	"Client Windows")
+				    (object Link
+					supplier   	"Client Windows")
+				    (object Link
+					supplier   	"Client Windows")
+				    (object Link
+					supplier   	
+|Pseudo
+|Client
+					)
+				    (object Link
+					supplier   	"Client Windows"))
+				class      	"Session"
+				persistence 	"Transient"
+				multi      	TRUE)
+			    (object Object "Window Server"
+				collaborators 	(list link_list
+				    (object Link
+					supplier   	"Status Window")
+				    (object Link
+					supplier   	"RootWindow"
+					supplier_containment 	"By Value"
+					client_containment 	"By Value"))
+				class      	"System Client"
+				persistence 	"Static"
+				multi      	FALSE)
+			    (object Object "Foreground Client"
+				collaborators 	(list link_list
+				    (object Link
+					supplier   	"Client Windows"))
+				class      	"Session"
+				persistence 	"Transient"
+				multi      	FALSE)))
+		    (object Mechanism @9
+			logical_models 	(list unit_reference_list
+			    (object Object "Window"
+				collaborators 	(list link_list
+				    (object Link
+					supplier   	"Window"
+					messages   	(list Messages
+					    (object Message "Child"
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"FromClientToSupplier"
+						sequence   	""
+						ordinal    	0)))
+				    (object Link
+					supplier   	"Window"
+					messages   	(list Messages
+					    (object Message "Sibling"
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"FromClientToSupplier"
+						sequence   	""
+						ordinal    	1)))
+				    (object Link
+					supplier   	"Window"
+					messages   	(list Messages
+					    (object Message "Parent"
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"FromClientToSupplier"
+						sequence   	""
+						ordinal    	2)))
+				    (object Link
+					supplier   	"Window"
+					messages   	(list Messages
+					    (object Message "Sibling"
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"FromClientToSupplier"
+						sequence   	""
+						ordinal    	3)))
+				    (object Link
+					supplier   	"Window"
+					messages   	(list Messages
+					    (object Message "Parent"
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"FromClientToSupplier"
+						sequence   	""
+						ordinal    	4)))
+				    (object Link
+					supplier   	"Window")
+				    (object Link
+					supplier   	"Window")
+				    (object Link
+					supplier   	"Window")
+				    (object Link
+					supplier   	"Window")
+				    (object Link
+					supplier   	"Window")
+				    (object Link
+					supplier   	"Window")
+				    (object Link
+					supplier   	"Window")
+				    (object Link
+					supplier   	"Window")
+				    (object Link
+					supplier   	"Window"
+					messages   	(list Messages
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	5)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	6)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	7)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	8)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	9)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	10)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	11)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	12)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	13)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	14)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	15)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	16)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	17)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	18)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	19)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	20)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	21)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	22)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	23)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	24)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	25)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	26)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	27)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	28)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	29)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	30)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	31))))
+				class      	"Window"
+				persistence 	"Transient"
+				multi      	FALSE))))
+		logical_presentations 	(list unit_reference_list
+		    (object ClassDiagram "Main"
+			title      	"Main"
+			zoom       	100
+			max_height 	28350
+			max_width  	21600
+			origin_x   	0
+			origin_y   	0
+			items      	(list diagram_item_list
+			    (object ClassView "Class" "Backed up Window" @10
+				location   	(1126, 1425)
+				font       	(object Font
+				    size       	10
+				    face       	"helvetica"
+				    bold       	FALSE
+				    italics    	FALSE
+				    underline  	FALSE
+				    strike     	FALSE
+				    color      	0
+				    default_color 	TRUE)
+				label      	(object ItemLabel
+				    location   	(1024, 1343)
+				    nlines     	2
+				    max_width  	236
+				    justify    	0
+				    label      	"Backed up Window")
+				width      	343
+				height     	249
+				annotation 	8)
+			    (object ClassView "Class" "Window" @11
+				location   	(1125, 838)
+				label      	(object ItemLabel
+				    location   	(1021, 754)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Window")
+				annotation 	8)
+			    (object InheritView ""
+				client     	@10
+				supplier   	@11)
+			    (object ClassView "Class" "Bitmap" @12
+				location   	(1744, 832)
+				label      	(object ItemLabel
+				    location   	(1640, 748)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Bitmap")
+				annotation 	8)
+			    (object ClassView "Class" "Backup Bitmap" @13
+				location   	(1743, 1424)
+				label      	(object ItemLabel
+				    location   	(1636, 1337)
+				    nlines     	2
+				    max_width  	249
+				    justify    	0
+				    label      	"Backup Bitmap")
+				width      	362
+				height     	262
+				annotation 	8)
+			    (object InheritView ""
+				client     	@13
+				supplier   	@12)
+			    (object ClassView "Class" "RootWindow" @14
+				location   	(1434, 1145)
+				label      	(object ItemLabel
+				    location   	(1330, 1061)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"RootWindow")
+				annotation 	8)
+			    (object InheritView ""
+				client     	@14
+				supplier   	@11)
+			    (object ClassView "Class" "Update Region" @15
+				location   	(319, 1158)
+				label      	(object ItemLabel
+				    location   	(215, 1074)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Update Region")
+				annotation 	8)
+			    (object HasView ""
+				client     	@10
+				supplier   	@13)
+			    (object HasView ""
+				client     	@11
+				supplier   	@15)
+			    (object ClassView "Class" "Client region" @16
+				location   	(450, 842)
+				label      	(object ItemLabel
+				    location   	(346, 758)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Client region")
+				annotation 	8)
+			    (object HasView ""
+				client     	@11
+				supplier   	@16)
+			    (object ClassView "Class" "Drawable" @17
+				location   	(1390, 426)
+				label      	(object ItemLabel
+				    location   	(1286, 342)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Drawable")
+				annotation 	8)
+			    (object InheritView ""
+				client     	@11
+				supplier   	@17)
+			    (object InheritView ""
+				client     	@12
+				supplier   	@17)
+			    (object ClassView "Class" "Gdi Drawable" @18
+				location   	(2325, 846)
+				label      	(object ItemLabel
+				    location   	(2221, 762)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Gdi Drawable")
+				annotation 	8)
+			    (object HasView ""
+				client     	@17
+				supplier   	@18)
+			    (object ClassView "Class" "Default region" @19
+				location   	(2287, 1226)
+				label      	(object ItemLabel
+				    location   	(2183, 1142)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Default region")
+				annotation 	8)
+			    (object HasView ""
+				client     	@12
+				supplier   	@19)))
+		    (object ObjectDiagram "Protea top level window structure"
+			mechanism_ref 	@8
+			title      	"Protea top level window structure"
+			zoom       	100
+			max_height 	28350
+			max_width  	21600
+			origin_x   	0
+			origin_y   	0
+			items      	(list diagram_item_list
+			    (object ObjectView "RootWindow" @20
+				location   	(334, 1068)
+				label      	(object ItemLabel
+				    location   	(230, 984)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"RootWindow")
+				subobjects 	0
+				x_offset   	0
+				y_offset   	0)
+			    (object ObjectView "Client Windows" @21
+				location   	(703, 1520)
+				label      	(object ItemLabel
+				    location   	(599, 1436)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Client Windows")
+				subobjects 	0
+				x_offset   	-0.078125
+				y_offset   	0.110406)
+			    (object ObjectView "Clients" @22
+				location   	(1500, 523)
+				label      	(object ItemLabel
+				    location   	(1273, 330)
+				    nlines     	2
+				    max_width  	540
+				    justify    	0
+				    label      	"Clients")
+				width      	783
+				height     	567
+				subobjects 	1
+				x_offset   	0
+				y_offset   	0)
+			    (object ObjectView "Client Windows" @23
+				location   	(1337, 1507)
+				label      	(object ItemLabel
+				    location   	(1233, 1423)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Client Windows")
+				subobjects 	0
+				x_offset   	-0.08
+				y_offset   	0.11)
+			    (object ObjectView "Window Server" @24
+				location   	(340, 642)
+				label      	(object ItemLabel
+				    location   	(236, 558)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Window Server")
+				subobjects 	0
+				x_offset   	0
+				y_offset   	0)
+			    (object ObjectView "Client Windows" @25
+				location   	(1928, 1510)
+				label      	(object ItemLabel
+				    location   	(1824, 1426)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Client Windows")
+				subobjects 	0
+				x_offset   	-0.08
+				y_offset   	0.11)
+			    (object ObjectView "Client Windows" @26
+				location   	(2522, 1517)
+				label      	(object ItemLabel
+				    location   	(2418, 1433)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Client Windows")
+				subobjects 	0
+				x_offset   	-0.08
+				y_offset   	0.11)
+			    (object ObjectView "Client Windows" @27
+				location   	(203, 1526)
+				label      	(object ItemLabel
+				    location   	(99, 1442)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Client Windows")
+				subobjects 	0
+				x_offset   	-0.08
+				y_offset   	0.11)
+			    (object ObjectView "Foreground Client" @28
+				location   	(1438, 585)
+				label      	(object ItemLabel
+				    location   	(1335, 499)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Foreground Client")
+				subobjects 	0
+				x_offset   	-0.08
+				y_offset   	0.11)
+			    (object LinkView "" @29
+				client     	@20
+				supplier   	@27)
+			    (object LinkView "" @30
+				client     	@21
+				supplier   	@23)
+			    (object LinkView "" @31
+				client     	@23
+				supplier   	@25)
+			    (object LinkView "" @32
+				client     	@25
+				supplier   	@26)
+			    (object LinkView "" @33
+				client     	@21
+				supplier   	@27)
+			    (object LinkView "" @34
+				client     	@22
+				supplier   	@23)
+			    (object LinkView "" @35
+				client     	@22
+				supplier   	@25)
+			    (object LinkView "" @36
+				client     	@22
+				supplier   	@26)
+			    (object LinkView "" @37
+				client     	@22
+				supplier   	@27)
+			    (object LinkView "" @38
+				client     	@24
+				supplier   	@20)
+			    (object LinkView "" @39
+				client     	@28
+				supplier   	@21)))
+		    (object ObjectDiagram "Basic window tree structure"
+			mechanism_ref 	@9
+			title      	"Basic window tree structure"
+			zoom       	100
+			max_height 	28350
+			max_width  	21600
+			origin_x   	0
+			origin_y   	0
+			items      	(list diagram_item_list
+			    (object ObjectView "Window" @40
+				location   	(715, 272)
+				label      	(object ItemLabel
+				    location   	(611, 188)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Window")
+				subobjects 	0
+				x_offset   	0
+				y_offset   	0)
+			    (object ObjectView "Window" @41
+				location   	(553, 814)
+				label      	(object ItemLabel
+				    location   	(449, 730)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Window")
+				subobjects 	0
+				x_offset   	0
+				y_offset   	0)
+			    (object ObjectView "Window" @42
+				location   	(1306, 814)
+				label      	(object ItemLabel
+				    location   	(1202, 730)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Window")
+				subobjects 	0
+				x_offset   	0
+				y_offset   	0)
+			    (object ObjectView "Window" @43
+				location   	(2090, 814)
+				label      	(object ItemLabel
+				    location   	(1986, 730)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Window")
+				subobjects 	0
+				x_offset   	0
+				y_offset   	0)
+			    (object ObjectView "Window" @44
+				location   	(1306, 1345)
+				label      	(object ItemLabel
+				    location   	(1202, 1261)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Window")
+				subobjects 	0
+				x_offset   	0
+				y_offset   	0)
+			    (object ObjectView "Window" @45
+				location   	(553, 1366)
+				label      	(object ItemLabel
+				    location   	(449, 1282)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Window")
+				subobjects 	0
+				x_offset   	0
+				y_offset   	0)
+			    (object ObjectView "Window" @46
+				location   	(1306, 1823)
+				label      	(object ItemLabel
+				    location   	(1202, 1739)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Window")
+				subobjects 	0
+				x_offset   	0
+				y_offset   	0)
+			    (object ObjectView "Window" @47
+				location   	(1868, 1346)
+				label      	(object ItemLabel
+				    location   	(1764, 1262)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Window")
+				subobjects 	0
+				x_offset   	0
+				y_offset   	0)
+			    (object LinkView "" @48
+				client     	@40
+				supplier   	@41)
+			    (object MessView ""
+				location   	(667, 551)
+				label      	(object SegLabel
+				    location   	(731, 558)
+				    anchor_loc 	1
+				    nlines     	1
+				    max_width  	450
+				    justify    	0
+				    label      	"Child"
+				    pctDist    	0.407895
+				    height     	64
+				    orientation 	0)
+				object_arc 	@48
+				pctDist    	0.494941
+				height     	35
+				orientation 	0
+				dir        	1
+				origin     	(684, 494)
+				terminus   	(650, 608))
+			    (object LinkView "" @49
+				client     	@41
+				supplier   	@42)
+			    (object MessView ""
+				location   	(917, 785)
+				label      	(object SegLabel
+				    location   	(917, 741)
+				    anchor_loc 	1
+				    nlines     	1
+				    max_width  	450
+				    justify    	0
+				    label      	"Sibling"
+				    pctDist    	0.5
+				    height     	45
+				    orientation 	0)
+				object_arc 	@49
+				pctDist    	0.5
+				height     	30
+				orientation 	0
+				dir        	1
+				origin     	(857, 785)
+				terminus   	(977, 785))
+			    (object LinkView "" @50
+				client     	@41
+				supplier   	@40
+				vertices   	(list Points
+				    (572, 705)
+				    (597, 569)
+				    (665, 398)))
+			    (object MessView ""
+				location   	(578, 538)
+				label      	(object SegLabel
+				    location   	(485, 541)
+				    anchor_loc 	1
+				    nlines     	1
+				    max_width  	450
+				    justify    	0
+				    label      	"Parent"
+				    pctDist    	0.199365
+				    height     	87
+				    orientation 	0)
+				object_arc 	@50
+				pctDist    	0.5
+				height     	30
+				orientation 	0
+				dir        	1
+				origin     	(556, 593)
+				terminus   	(600, 483))
+			    (object LinkView "" @51
+				client     	@42
+				supplier   	@43)
+			    (object MessView ""
+				location   	(1676, 783)
+				label      	(object SegLabel
+				    location   	(1676, 748)
+				    anchor_loc 	1
+				    nlines     	1
+				    max_width  	450
+				    justify    	0
+				    label      	"Sibling"
+				    pctDist    	0.5
+				    height     	36
+				    orientation 	0)
+				object_arc 	@51
+				pctDist    	0.478058
+				height     	32
+				orientation 	0
+				dir        	1
+				origin     	(1616, 783)
+				terminus   	(1736, 783))
+			    (object LinkView "" @52
+				client     	@42
+				supplier   	@40)
+			    (object MessView ""
+				location   	(1076, 554)
+				label      	(object SegLabel
+				    location   	(1053, 580)
+				    anchor_loc 	1
+				    nlines     	1
+				    max_width  	450
+				    justify    	0
+				    label      	"Parent"
+				    pctDist    	0.5
+				    height     	36
+				    orientation 	0)
+				object_arc 	@52
+				pctDist    	0.368275
+				height     	37
+				orientation 	1
+				dir        	1
+				origin     	(1119, 594)
+				terminus   	(1033, 514))
+			    (object LinkView "" @53
+				client     	@43
+				supplier   	@40)
+			    (object MessView ""
+				location   	(1478, 528)
+				object_arc 	@53
+				pctDist    	0.451966
+				height     	42
+				orientation 	1
+				dir        	1
+				origin     	(1533, 549)
+				terminus   	(1423, 507))
+			    (object LinkView "" @54
+				client     	@41
+				supplier   	@45)
+			    (object MessView ""
+				location   	(583, 1095)
+				object_arc 	@54
+				pctDist    	0.5
+				height     	30
+				orientation 	0
+				dir        	1
+				origin     	(583, 1035)
+				terminus   	(583, 1155))
+			    (object LinkView "" @55
+				client     	@45
+				supplier   	@41
+				vertices   	(list Points
+				    (537, 1265)
+				    (519, 1159)
+				    (519, 1000)
+				    (532, 932)))
+			    (object MessView ""
+				location   	(485, 1074)
+				object_arc 	@55
+				pctDist    	0.577381
+				height     	35
+				orientation 	0
+				dir        	1
+				origin     	(485, 1133)
+				terminus   	(485, 1015))
+			    (object LinkView "" @56
+				client     	@42
+				supplier   	@44)
+			    (object MessView ""
+				location   	(1336, 1084)
+				object_arc 	@56
+				pctDist    	0.5
+				height     	30
+				orientation 	0
+				dir        	1
+				origin     	(1336, 1024)
+				terminus   	(1336, 1144))
+			    (object LinkView "" @57
+				client     	@44
+				supplier   	@46)
+			    (object MessView ""
+				location   	(1336, 1588)
+				object_arc 	@57
+				pctDist    	0.5
+				height     	30
+				orientation 	0
+				dir        	1
+				origin     	(1336, 1528)
+				terminus   	(1336, 1648))
+			    (object LinkView "" @58
+				client     	@44
+				supplier   	@47)
+			    (object MessView ""
+				location   	(1575, 1316)
+				object_arc 	@58
+				pctDist    	0.5
+				height     	30
+				orientation 	0
+				dir        	1
+				origin     	(1515, 1316)
+				terminus   	(1635, 1316))
+			    (object LinkView "" @59
+				client     	@47
+				supplier   	@42)
+			    (object MessView ""
+				location   	(1553, 1089)
+				object_arc 	@59
+				pctDist    	0.5
+				height     	30
+				orientation 	0
+				dir        	1
+				origin     	(1596, 1129)
+				terminus   	(1510, 1049))
+			    (object LinkView "" @60
+				client     	@44
+				supplier   	@42
+				vertices   	(list Points
+				    (1273, 1241)
+				    (1240, 1140)
+				    (1244, 1006)
+				    (1267, 938)))
+			    (object MessView ""
+				location   	(1212, 1091)
+				object_arc 	@60
+				pctDist    	0.5
+				height     	30
+				orientation 	0
+				dir        	1
+				origin     	(1210, 1150)
+				terminus   	(1214, 1032))
+			    (object LinkView "" @61
+				client     	@46
+				supplier   	@44
+				vertices   	(list Points
+				    (1286, 1721)
+				    (1269, 1640)
+				    (1265, 1537)
+				    (1282, 1464)))
+			    (object MessView ""
+				location   	(1227, 1588)
+				object_arc 	@61
+				pctDist    	0.524425
+				height     	41
+				orientation 	0
+				dir        	1
+				origin     	(1228, 1647)
+				terminus   	(1226, 1529))))))
+	    (object Class_Category "Top level"
+		visible_categories 	(list visibility_relationship_list
+		    (object Visibility_Relationship
+			supplier   	"GDI Interface")
+		    (object Visibility_Relationship
+			supplier   	"Drawables")
+		    (object Visibility_Relationship
+			supplier   	"AGDI")
+		    (object Visibility_Relationship
+			supplier   	"XGDI"))
+		exportControl 	"Public"
+		logical_models 	(list unit_reference_list
+		    (object Class "$UNNAMED$12")
+		    (object Class "Invalid window list"
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"Variable arrayx"))
+			collaborators 	(list association_list
+			    (object Association
+				supplier   	"Root window"
+				supplier_cardinality 	(value cardinality "1")
+				client_cardinality 	(value cardinality "1")))
+			statediagram 	(object State_Diagram ""
+			    title      	""
+			    zoom       	100
+			    max_height 	28350
+			    max_width  	21600
+			    origin_x   	0
+			    origin_y   	0
+			    items      	(list diagram_item_list)))
+		    (object Class_Utility "$UNNAMED$13")
+		    (object Class "Heartbeat"
+			collaborators 	(list association_list
+			    (object Association
+				supplier   	"Animatorx"
+				supplier_cardinality 	(value cardinality "n")
+				client_cardinality 	(value cardinality "1"))
+			    (object Association
+				supplier   	"GDI Controllerx")
+			    (object Association
+				supplier   	"Animator"
+				supplier_cardinality 	(value cardinality "1")
+				client_cardinality 	(value cardinality "1")))
+			concurrency 	"Active"
+			statediagram 	(object State_Diagram ""
+			    title      	""
+			    zoom       	100
+			    max_height 	28350
+			    max_width  	21600
+			    origin_x   	0
+			    origin_y   	0
+			    items      	(list diagram_item_list)))
+		    (object Class "Event queue"
+			statediagram 	(object State_Diagram ""
+			    title      	""
+			    zoom       	100
+			    max_height 	28350
+			    max_width  	21600
+			    origin_x   	0
+			    origin_y   	0
+			    items      	(list diagram_item_list)))
+		    (object Class "Session"
+			fields     	(list has_relationship_list
+			    (object Has_Relationship
+				supplier   	"Invalid window list"
+				supplier_cardinality 	(value cardinality "1")
+				client_cardinality 	(value cardinality "1"))
+			    (object Has_Relationship
+				supplier   	"Clockx"
+				supplier_cardinality 	(value cardinality "n")
+				client_cardinality 	(value cardinality "1"))
+			    (object Has_Relationship
+				supplier   	"Bitmap sequencex"
+				supplier_cardinality 	(value cardinality "n")
+				client_cardinality 	(value cardinality "1"))
+			    (object Has_Relationship
+				supplier   	"Spritex"
+				supplier_cardinality 	(value cardinality "0..1")
+				client_cardinality 	(value cardinality "1"))
+			    (object Has_Relationship
+				supplier   	"Text Cursorx"
+				supplier_cardinality 	(value cardinality "0,1")
+				client_cardinality 	(value cardinality "1"))
+			    (object Has_Relationship
+				supplier   	"Event queue"
+				supplier_cardinality 	(value cardinality "1")
+				client_cardinality 	(value cardinality "1"))
+			    (object Has_Relationship
+				supplier   	"Drawable")
+			    (object Has_Relationship
+				supplier   	"Graphics context")
+			    (object Has_Relationship
+				supplier   	"Temp graphics contextx")
+			    (object Has_Relationship
+				supplier   	"GDI Controllerx")
+			    (object Has_Relationship
+				supplier   	"Animator"
+				supplier_cardinality 	(value cardinality "1")
+				client_cardinality 	(value cardinality "1"))
+			    (object Has_Relationship
+				supplier   	"Root window"
+				supplier_cardinality 	(value cardinality "1")
+				client_cardinality 	(value cardinality "1"))
+			    (object Has_Relationship
+				supplier   	"GDI object")
+			    (object Has_Relationship
+				supplier   	"GDI controller"
+				supplier_cardinality 	(value cardinality "1")
+				client_cardinality 	(value cardinality "1"))
+			    (object Has_Relationship
+				supplier   	"Capture key list"))
+			collaborators 	(list association_list
+			    (object Association
+				label      	"Current GC"
+				supplier   	"Graphics context"
+				supplier_cardinality 	(value cardinality "1")
+				client_cardinality 	(value cardinality "0,1")))
+			statediagram 	(object State_Diagram ""
+			    title      	""
+			    zoom       	100
+			    max_height 	28350
+			    max_width  	21600
+			    origin_x   	0
+			    origin_y   	0
+			    items      	(list diagram_item_list)))
+		    (object Class "Capture key list"
+			statediagram 	(object State_Diagram ""
+			    title      	""
+			    zoom       	100
+			    max_height 	28350
+			    max_width  	21600
+			    origin_x   	0
+			    origin_y   	0
+			    items      	(list diagram_item_list)))
+		    (object Class "Pointer"
+			collaborators 	(list association_list
+			    (object Association
+				supplier   	"Session"
+				supplier_cardinality 	(value cardinality "n")
+				client_cardinality 	(value cardinality "1"))
+			    (object Association
+				supplier   	"Root window"
+				supplier_cardinality 	(value cardinality "n")
+				client_cardinality 	(value cardinality "1")))
+			used_nodes 	(list uses_relationship_list
+			    (object Uses_Relationship
+				supplier   	"Pointer cursor"))
+			concurrency 	"Active")
+		    (object Class "Keyboard"
+			collaborators 	(list association_list
+			    (object Association
+				supplier   	"Session"
+				supplier_cardinality 	(value cardinality "n")
+				client_cardinality 	(value cardinality "1")))
+			concurrency 	"Active")
+		    (object Class "Window server"
+			fields     	(list has_relationship_list
+			    (object Has_Relationship
+				supplier   	"Session"
+				supplier_cardinality 	(value cardinality "n")
+				client_cardinality 	(value cardinality "1")))
+			concurrency 	"Active")
+		    (object Class "Text Cursor"
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"Animatorx"))
+			statediagram 	(object State_Diagram ""
+			    title      	""
+			    zoom       	100
+			    max_height 	28350
+			    max_width  	21600
+			    origin_x   	0
+			    origin_y   	0
+			    items      	(list diagram_item_list)))
+		    (object Class "AGDI controller")
+		    (object Mechanism @62
+			logical_models 	(list unit_reference_list
+			    (object Object "Pointer dispatcher"
+				collaborators 	(list link_list
+				    (object Link
+					supplier   	"Clients"
+					messages   	(list Messages
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"FromClientToSupplier"
+						sequence   	""
+						ordinal    	2)))
+				    (object Link
+					supplier   	"Pointer decoder"
+					messages   	(list Messages
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"FromClientToSupplier"
+						sequence   	""
+						ordinal    	3)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	4))))
+				persistence 	"Transient"
+				multi      	FALSE)
+			    (object Object "Keyboard"
+				collaborators 	(list link_list
+				    (object Link
+					supplier   	"Foreground Client"
+					messages   	(list Messages
+					    (object Message "Key ups & downs"
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"FromClientToSupplier"
+						sequence   	""
+						ordinal    	0))))
+				persistence 	"Transient"
+				multi      	FALSE)
+			    (object Object "Clients"
+				collaborators 	(list link_list
+				    (object Link
+					supplier   	"Client commands"))
+				persistence 	"Transient"
+				multi      	TRUE)
+			    (object Object "Heartbeat"
+				collaborators 	(list link_list
+				    (object Link
+					supplier   	"Animate list"
+					messages   	(list Messages
+					    (object Message "Animate cursor"
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"FromClientToSupplier"
+						sequence   	""
+						ordinal    	1))))
+				persistence 	"Transient"
+				multi      	FALSE)
+			    (object Object "Foreground Client"
+				collaborators 	(list link_list
+				    (object Link
+					supplier   	"Heartbeat"))
+				persistence 	"Transient"
+				multi      	FALSE)
+			    (object Object "Client commands"
+				collaborators 	(list link_list
+				    (object Link
+					supplier   	"Clients"
+					messages   	(list Messages
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"FromClientToSupplier"
+						sequence   	""
+						ordinal    	5)
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"ToClientFromSupplier"
+						sequence   	""
+						ordinal    	6))))
+				persistence 	"Transient"
+				multi      	FALSE)
+			    (object Object "Pointer decoder"
+				persistence 	"Transient"
+				multi      	FALSE)
+			    (object Object "Animate list"
+				collaborators 	(list link_list
+				    (object Link
+					supplier   	"Clients"
+					messages   	(list Messages
+					    (object Message ""
+						frequency  	"Aperiodic"
+						synchronization 	"Simple"
+						dir        	"FromClientToSupplier"
+						sequence   	""
+						ordinal    	7))))
+				persistence 	"Transient"
+				multi      	FALSE))))
+		logical_presentations 	(list unit_reference_list
+		    (object ClassDiagram "Main"
+			title      	"Main"
+			zoom       	100
+			max_height 	28350
+			max_width  	21600
+			origin_x   	0
+			origin_y   	0
+			items      	(list diagram_item_list
+			    (object ClassView "Class" "Invalid window list" @63
+				location   	(913, 1391)
+				label      	(object ItemLabel
+				    location   	(811, 1308)
+				    nlines     	2
+				    max_width  	236
+				    justify    	0
+				    label      	"Invalid window list")
+				width      	343
+				height     	250
+				annotation 	8)
+			    (object ClassView "Class" "Event queue" @64
+				location   	(1962, 757)
+				label      	(object ItemLabel
+				    location   	(1858, 673)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Event queue")
+				annotation 	8)
+			    (object ClassView "Class" "Heartbeat" @65
+				location   	(244, 170)
+				label      	(object ItemLabel
+				    location   	(140, 86)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Heartbeat")
+				annotation 	10)
+			    (object ClassView "Class" "Session" @66
+				location   	(1684, 1494)
+				label      	(object ItemLabel
+				    location   	(1580, 1410)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Session")
+				annotation 	8)
+			    (object HasView ""
+				client     	@66
+				supplier   	@64)
+			    (object ClassView "Class" "Capture key list" @67
+				location   	(2440, 498)
+				label      	(object ItemLabel
+				    location   	(2336, 414)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Capture key list")
+				annotation 	8)
+			    (object ClassView "Class" "Pointer" @68
+				location   	(712, 176)
+				label      	(object ItemLabel
+				    location   	(608, 92)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Pointer")
+				annotation 	10)
+			    (object ClassView "Class" "Keyboard" @69
+				location   	(2453, 957)
+				label      	(object ItemLabel
+				    location   	(2349, 873)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Keyboard")
+				annotation 	10)
+			    (object ClassView "Class" "Window server" @70
+				location   	(1759, 292)
+				label      	(object ItemLabel
+				    location   	(1655, 208)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Window server")
+				annotation 	10)
+			    (object HasView ""
+				client     	@66
+				supplier   	@63)
+			    (object ClassView "Class" "Animator" @71
+				location   	(278, 1782)
+				label      	(object ItemLabel
+				    location   	(174, 1698)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Animator")
+				annotation 	8)
+			    (object AssociationView ""
+				client     	@65
+				supplier   	@71)
+			    (object HasView ""
+				client     	@66
+				supplier   	@71)
+			    (object ClassView "Class" "Root window" @72
+				location   	(712, 976)
+				label      	(object ItemLabel
+				    location   	(608, 892)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Root window")
+				annotation 	8)
+			    (object HasView ""
+				client     	@66
+				supplier   	@72)
+			    (object AssociationView ""
+				client     	@63
+				supplier   	@72)
+			    (object AssociationView ""
+				client     	@72
+				supplier   	@71)
+			    (object HasView ""
+				client     	@66
+				supplier   	@67)
+			    (object ClassView "Class" "Pointer cursor" @73
+				location   	(459, 700)
+				label      	(object ItemLabel
+				    location   	(355, 616)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Pointer cursor")
+				annotation 	8)
+			    (object UsesView ""
+				client     	@68
+				supplier   	@73)
+			    (object HasView ""
+				client     	@71
+				supplier   	@73)
+			    (object HasView ""
+				client     	@70
+				supplier   	@66)
+			    (object AssociationView ""
+				client     	@69
+				supplier   	@66)
+			    (object AssociationView ""
+				client     	@68
+				supplier   	@66)
+			    (object AssociationView ""
+				client     	@68
+				supplier   	@72)))
+		    (object ObjectDiagram "Event handling"
+			mechanism_ref 	@62
+			title      	"Event handling"
+			zoom       	94
+			max_height 	28350
+			max_width  	21600
+			origin_x   	0
+			origin_y   	0
+			items      	(list diagram_item_list
+			    (object ObjectView "Pointer dispatcher" @74
+				location   	(1430, 339)
+				label      	(object ItemLabel
+				    location   	(1326, 255)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Pointer dispatcher")
+				subobjects 	0
+				x_offset   	0
+				y_offset   	0)
+			    (object ObjectView "Keyboard" @75
+				location   	(306, 613)
+				label      	(object ItemLabel
+				    location   	(202, 529)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Keyboard")
+				subobjects 	0
+				x_offset   	-0.08
+				y_offset   	0.11)
+			    (object ObjectView "Clients" @76
+				location   	(964, 1683)
+				label      	(object ItemLabel
+				    location   	(737, 1490)
+				    nlines     	2
+				    max_width  	540
+				    justify    	0
+				    label      	"Clients")
+				width      	783
+				height     	567
+				subobjects 	1
+				x_offset   	0
+				y_offset   	0)
+			    (object ObjectView "Heartbeat" @77
+				location   	(2667, 621)
+				label      	(object ItemLabel
+				    location   	(2563, 537)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Heartbeat")
+				subobjects 	0
+				x_offset   	0
+				y_offset   	0)
+			    (object ObjectView "Foreground Client" @78
+				location   	(904, 1678)
+				label      	(object ItemLabel
+				    location   	(800, 1595)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Foreground Client")
+				width      	349
+				height     	250
+				subobjects 	0
+				x_offset   	-0.076628
+				y_offset   	-0.007055)
+			    (object ObjectView "Client commands" @79
+				location   	(885, 578)
+				label      	(object ItemLabel
+				    location   	(781, 494)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Client commands")
+				subobjects 	0
+				x_offset   	0
+				y_offset   	0)
+			    (object ObjectView "Pointer decoder" @80
+				location   	(1557, 850)
+				label      	(object ItemLabel
+				    location   	(1453, 766)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Pointer decoder")
+				subobjects 	0
+				x_offset   	0.033206
+				y_offset   	-0.661376)
+			    (object ObjectView "Animate list" @81
+				location   	(2165, 930)
+				label      	(object ItemLabel
+				    location   	(2061, 846)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Animate list")
+				subobjects 	0
+				x_offset   	0
+				y_offset   	0)
+			    (object LinkView "" @82
+				client     	@74
+				supplier   	@76)
+			    (object MessView ""
+				location   	(1307, 761)
+				object_arc 	@82
+				pctDist    	0.308797
+				height     	22
+				orientation 	0
+				dir        	1
+				origin     	(1326, 704)
+				terminus   	(1288, 818))
+			    (object LinkView "" @83
+				client     	@74
+				supplier   	@80)
+			    (object MessView ""
+				location   	(1522, 587)
+				object_arc 	@83
+				pctDist    	0.5
+				height     	30
+				orientation 	0
+				dir        	1
+				origin     	(1507, 529)
+				terminus   	(1537, 645))
+			    (object MessView ""
+				location   	(1465, 600)
+				object_arc 	@83
+				pctDist    	0.5
+				height     	30
+				orientation 	1
+				dir        	-1
+				origin     	(1479, 657)
+				terminus   	(1451, 543))
+			    (object LinkView "" @84
+				client     	@75
+				supplier   	@78)
+			    (object MessView "Key ups & downs"
+				location   	(623, 1120)
+				label      	(object SegLabel
+				    location   	(627, 1054)
+				    anchor_loc 	1
+				    nlines     	1
+				    max_width  	450
+				    justify    	0
+				    label      	"Key ups & downs"
+				    pctDist    	0.032819
+				    height     	37
+				    orientation 	0)
+				object_arc 	@84
+				pctDist    	0.501153
+				height     	29
+				orientation 	0
+				dir        	1
+				origin     	(594, 1068)
+				terminus   	(652, 1172))
+			    (object LinkView "" @85
+				client     	@77
+				supplier   	@81)
+			    (object MessView "Animate cursor"
+				location   	(2453, 725)
+				label      	(object SegLabel
+				    location   	(2472, 755)
+				    anchor_loc 	1
+				    nlines     	1
+				    max_width  	450
+				    justify    	0
+				    label      	"Animate cursor"
+				    pctDist    	0.5
+				    height     	36
+				    orientation 	0)
+				object_arc 	@85
+				pctDist    	0.423651
+				height     	25
+				orientation 	1
+				dir        	1
+				origin     	(2503, 693)
+				terminus   	(2403, 757))
+			    (object LinkView "" @86
+				client     	@79
+				supplier   	@76)
+			    (object MessView ""
+				location   	(951, 1070)
+				object_arc 	@86
+				pctDist    	0.5
+				height     	30
+				orientation 	0
+				dir        	1
+				origin     	(946, 1010)
+				terminus   	(956, 1130))
+			    (object MessView ""
+				location   	(892, 1073)
+				object_arc 	@86
+				pctDist    	0.5
+				height     	30
+				orientation 	1
+				dir        	-1
+				origin     	(896, 1132)
+				terminus   	(888, 1014))
+			    (object LinkView "" @87
+				client     	@81
+				supplier   	@76)
+			    (object MessView ""
+				location   	(1737, 1153)
+				object_arc 	@87
+				pctDist    	0.401609
+				height     	39
+				orientation 	1
+				dir        	1
+				origin     	(1787, 1121)
+				terminus   	(1687, 1185))))))
+	    (object Class_Category "OLIB"
+		exportControl 	"Public"
+		logical_models 	(list unit_reference_list)
+		logical_presentations 	(list unit_reference_list
+		    (object ClassDiagram "Main"
+			title      	"Main"
+			zoom       	100
+			max_height 	28350
+			max_width  	21600
+			origin_x   	0
+			origin_y   	0
+			items      	(list diagram_item_list))))
+	    (object Class_Category "AGDI"
+		visible_categories 	(list visibility_relationship_list
+		    (object Visibility_Relationship
+			supplier   	"GDI Interface")
+		    (object Visibility_Relationship
+			supplier   	"GDI")
+		    (object Visibility_Relationship
+			supplier   	"Drawables"))
+		exportControl 	"Public"
+		logical_models 	(list unit_reference_list
+		    (object Class "Animated DLL Interface"
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"Animator"))
+			statediagram 	(object State_Diagram ""
+			    title      	""
+			    zoom       	100
+			    max_height 	28350
+			    max_width  	21600
+			    origin_x   	0
+			    origin_y   	0
+			    items      	(list diagram_item_list)))
+		    (object Class "Bitmap sequence"
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"Animator")))
+		    (object Class "Sprite"
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"Animator"))
+			statediagram 	(object State_Diagram ""
+			    title      	""
+			    zoom       	100
+			    max_height 	28350
+			    max_width  	21600
+			    origin_x   	0
+			    origin_y   	0
+			    items      	(list diagram_item_list)))
+		    (object Class "Text cursor"
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"Animator")))
+		    (object Class "AGDI Controller"
+			fields     	(list has_relationship_list
+			    (object Has_Relationship
+				supplier   	"Animator"
+				supplier_cardinality 	(value cardinality "n")
+				client_cardinality 	(value cardinality "1"))))
+		    (object Class "Animator"
+			fields     	(list has_relationship_list
+			    (object Has_Relationship
+				supplier   	"Pointer cursor"))
+			collaborators 	(list association_list
+			    (object Association
+				supplier   	"Graphics context"
+				supplier_cardinality 	(value cardinality "1")
+				client_cardinality 	(value cardinality "n"))
+			    (object Association
+				supplier   	"Drawable"
+				supplier_cardinality 	(value cardinality "1")
+				client_cardinality 	(value cardinality "n"))
+			    (object Association
+				supplier   	"GDI object"
+				supplier_cardinality 	(value cardinality "n")
+				client_cardinality 	(value cardinality "n"))))
+		    (object Class "Pointer cursor"
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"Sprite"))))
+		logical_presentations 	(list unit_reference_list
+		    (object ClassDiagram "Main"
+			title      	"Main"
+			zoom       	100
+			max_height 	28350
+			max_width  	21600
+			origin_x   	0
+			origin_y   	0
+			items      	(list diagram_item_list
+			    (object ClassView "Class" "Animated DLL Interface" @88
+				location   	(444, 1156)
+				label      	(object ItemLabel
+				    location   	(340, 1072)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Animated DLL Interface")
+				annotation 	8)
+			    (object ClassView "Class" "Sprite" @89
+				location   	(1650, 1142)
+				label      	(object ItemLabel
+				    location   	(1546, 1058)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Sprite")
+				annotation 	8)
+			    (object ClassView "Class" "Text cursor" @90
+				location   	(1034, 1167)
+				label      	(object ItemLabel
+				    location   	(930, 1083)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Text cursor")
+				annotation 	8)
+			    (object ClassView "Class" "Animator" @91
+				location   	(569, 589)
+				label      	(object ItemLabel
+				    location   	(465, 505)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Animator")
+				annotation 	8)
+			    (object InheritView ""
+				client     	@89
+				supplier   	@91)
+			    (object InheritView ""
+				client     	@90
+				supplier   	@91)
+			    (object InheritView ""
+				client     	@88
+				supplier   	@91)
+			    (object ClassView "Class" "Pointer cursor" @92
+				location   	(1840, 1610)
+				label      	(object ItemLabel
+				    location   	(1736, 1526)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Pointer cursor")
+				annotation 	8)
+			    (object InheritView ""
+				client     	@92
+				supplier   	@89)))))
+	    (object Class_Category "Test code using AGDI interface"
+		visible_categories 	(list visibility_relationship_list
+		    (object Visibility_Relationship
+			supplier   	"GDI")
+		    (object Visibility_Relationship
+			supplier   	"Drawables"))
+		exportControl 	"Public"
+		logical_models 	(list unit_reference_list)
+		logical_presentations 	(list unit_reference_list))
+	    (object Class_Category "Dummy test window server "
+		visible_categories 	(list visibility_relationship_list
+		    (object Visibility_Relationship
+			supplier   	"GDI Interface")
+		    (object Visibility_Relationship
+			supplier   	"Drawables")
+		    (object Visibility_Relationship
+			supplier   	"AGDI"))
+		exportControl 	"Public"
+		logical_models 	(list unit_reference_list)
+		logical_presentations 	(list unit_reference_list))
+	    (object Class_Category "XGDI"
+		visible_categories 	(list visibility_relationship_list
+		    (object Visibility_Relationship
+			supplier   	"GDI Interface")
+		    (object Visibility_Relationship
+			supplier   	"Drawables")
+		    (object Visibility_Relationship
+			supplier   	"GDI"))
+		exportControl 	"Public"
+		logical_models 	(list unit_reference_list)
+		logical_presentations 	(list unit_reference_list)))
+	logical_presentations 	(list unit_reference_list
+	    (object ClassDiagram "Main"
+		title      	"Main"
+		zoom       	100
+		max_height 	28350
+		max_width  	21600
+		origin_x   	0
+		origin_y   	0
+		items      	(list diagram_item_list
+		    (object CategoryView "GDI" @93
+			location   	(525, 1050)
+			font       	(object Font
+			    size       	12
+			    face       	"helvetica"
+			    bold       	FALSE
+			    italics    	FALSE
+			    underline  	FALSE
+			    strike     	FALSE
+			    color      	0
+			    default_color 	TRUE)
+			label      	(object ItemLabel
+			    location   	(381, 966)
+			    nlines     	2
+			    max_width  	288
+			    justify    	0
+			    label      	"GDI")
+			width      	300
+			height     	180)
+		    (object CategoryView "Drawables" @94
+			location   	(740, 439)
+			font       	(object Font
+			    size       	12
+			    face       	"helvetica"
+			    bold       	FALSE
+			    italics    	FALSE
+			    underline  	FALSE
+			    strike     	FALSE
+			    color      	0
+			    default_color 	TRUE)
+			label      	(object ItemLabel
+			    location   	(596, 355)
+			    nlines     	2
+			    max_width  	288
+			    justify    	0
+			    label      	"Drawables")
+			width      	300
+			height     	180)
+		    (object CategoryView "Top level" @95
+			location   	(528, 158)
+			font       	(object Font
+			    size       	12
+			    face       	"helvetica"
+			    bold       	FALSE
+			    italics    	FALSE
+			    underline  	FALSE
+			    strike     	FALSE
+			    color      	0
+			    default_color 	TRUE)
+			label      	(object ItemLabel
+			    location   	(384, 74)
+			    nlines     	2
+			    max_width  	288
+			    justify    	0
+			    label      	"Top level")
+			width      	300
+			height     	180)
+		    (object CategoryView "AGDI" @96
+			location   	(1209, 437)
+			label      	(object ItemLabel
+			    location   	(1065, 353)
+			    nlines     	2
+			    max_width  	288
+			    justify    	0
+			    label      	"AGDI")
+			width      	300
+			height     	180)
+		    (object ImportView ""
+			client     	@95
+			supplier   	@94)
+		    (object ImportView ""
+			client     	@95
+			supplier   	@96)
+		    (object CategoryView "Drawables" @97
+			location   	(1911, 1251)
+			font       	(object Font
+			    size       	12
+			    face       	"helvetica"
+			    bold       	FALSE
+			    italics    	FALSE
+			    underline  	FALSE
+			    strike     	FALSE
+			    color      	0
+			    default_color 	TRUE)
+			label      	(object ItemLabel
+			    location   	(1767, 1167)
+			    nlines     	2
+			    max_width  	288
+			    justify    	0
+			    label      	"Drawables")
+			width      	300
+			height     	180)
+		    (object CategoryView "GDI" @98
+			location   	(1656, 1840)
+			font       	(object Font
+			    size       	12
+			    face       	"helvetica"
+			    bold       	FALSE
+			    italics    	FALSE
+			    underline  	FALSE
+			    strike     	FALSE
+			    color      	0
+			    default_color 	TRUE)
+			label      	(object ItemLabel
+			    location   	(1512, 1756)
+			    nlines     	2
+			    max_width  	288
+			    justify    	0
+			    label      	"GDI")
+			width      	300
+			height     	180)
+		    (object CategoryView "Test code using AGDI interface" @99
+			location   	(2401, 1249)
+			label      	(object ItemLabel
+			    location   	(2238, 1155)
+			    nlines     	2
+			    max_width  	326
+			    justify    	0
+			    label      	"Test code using AGDI interface")
+			width      	338
+			height     	200)
+		    (object CategoryView "XGDI" @100
+			location   	(234, 437)
+			label      	(object ItemLabel
+			    location   	(90, 353)
+			    nlines     	2
+			    max_width  	288
+			    justify    	0
+			    label      	"XGDI")
+			width      	300
+			height     	180)
+		    (object ImportView ""
+			client     	@95
+			supplier   	@100)
+		    (object ImportView ""
+			client     	@100
+			supplier   	@94)
+		    (object ImportView ""
+			client     	@97
+			supplier   	@98)
+		    (object ImportView ""
+			client     	@99
+			supplier   	@98)
+		    (object ImportView ""
+			client     	@99
+			supplier   	@97)
+		    (object ImportView ""
+			client     	@94
+			supplier   	@93)
+		    (object ImportView ""
+			client     	@100
+			supplier   	@93)
+		    (object ImportView ""
+			client     	@96
+			supplier   	@93)
+		    (object ImportView ""
+			client     	@96
+			supplier   	@94)))))
+    root_subsystem 	(object SubSystem "<Top Level>"
+	physical_models 	(list unit_reference_list
+	    (object module "$UNNAMED$14" "SubType" "Specification"
+		visible_modules 	(list dependency_list
+		    (object Dependency_Relationship
+			supplier   	"$UNNAMED$15"
+			supplier_is_spec 	TRUE)
+		    (object Dependency_Relationship
+			supplier   	"$UNNAMED$16"
+			supplier_is_spec 	TRUE)))
+	    (object module "$UNNAMED$15" "PackageType" "Specification"
+		visible_modules 	(list dependency_list
+		    (object Dependency_Relationship
+			supplier   	"$UNNAMED$16"
+			supplier_is_spec 	TRUE)))
+	    (object module "$UNNAMED$17" "PackageType" "Specification"
+		visible_modules 	(list dependency_list
+		    (object Dependency_Relationship
+			supplier_is_spec 	TRUE)))
+	    (object module "$UNNAMED$16" "TaskType" "Specification"
+		visible_modules 	(list dependency_list
+		    (object Dependency_Relationship
+			supplier_is_spec 	TRUE)))
+	    (object module "$UNNAMED$18" "PackageType" "Specification")
+	    (object module "$UNNAMED$19" "SubType" "Specification")
+	    (object module "$UNNAMED$20" "TaskType" "Specification")
+	    (object SubSystem "$UNNAMED$21"
+		physical_models 	(list unit_reference_list)
+		physical_presentations 	(list unit_reference_list))
+	    (object SubSystem "$UNNAMED$22"
+		physical_models 	(list unit_reference_list)
+		physical_presentations 	(list unit_reference_list)))
+	physical_presentations 	(list unit_reference_list
+	    (object Module_Diagram "Main"
+		title      	"Main"
+		zoom       	100
+		max_height 	28350
+		max_width  	21600
+		origin_x   	0
+		origin_y   	0
+		items      	(list diagram_item_list))))
+    process_structure 	(object Processes
+	ProcsNDevs 	(list
+	    (object Processor "Processor"
+		connections 	(list connection_list
+		    (object Connection_Relationship
+			supplier   	"VDU"
+			supplier_is_device 	TRUE))
+		characteristics 	""
+		scheduling 	"Preemptive"
+		processes  	(list processes))
+	    (object Device "Keyboard"
+		connections 	(list connection_list
+		    (object Connection_Relationship
+			supplier   	"Processor"
+			supplier_is_device 	FALSE))
+		characteristics 	"")
+	    (object Device "VDU"
+		characteristics 	"")
+	    (object Device "Pointing device"
+		connections 	(list connection_list
+		    (object Connection_Relationship
+			supplier   	"Processor"
+			supplier_is_device 	FALSE))
+		characteristics 	"")
+	    (object Process_Diagram ""
+		title      	""
+		zoom       	100
+		max_height 	28350
+		max_width  	21600
+		origin_x   	0
+		origin_y   	0
+		items      	(list diagram_item_list
+		    (object ProcessorView "Processor" @101
+			location   	(1334, 544)
+			label      	(object ItemLabel
+			    location   	(1156, 449)
+			    nlines     	2
+			    max_width  	246
+			    justify    	0
+			    label      	"Processor")
+			width      	360
+			height     	300
+			annotation 	0)
+		    (object DeviceView "Keyboard" @102
+			location   	(853, 409)
+			label      	(object ItemLabel
+			    location   	(675, 314)
+			    nlines     	2
+			    max_width  	246
+			    justify    	0
+			    label      	"Keyboard")
+			width      	360
+			height     	300
+			annotation 	0)
+		    (object DeviceView "VDU" @103
+			location   	(1968, 543)
+			label      	(object ItemLabel
+			    location   	(1790, 448)
+			    nlines     	2
+			    max_width  	246
+			    justify    	0
+			    label      	"VDU")
+			width      	360
+			height     	300
+			annotation 	0)
+		    (object DeviceView "Pointing device" @104
+			location   	(443, 668)
+			label      	(object ItemLabel
+			    location   	(265, 573)
+			    nlines     	2
+			    max_width  	246
+			    justify    	0
+			    label      	"Pointing device")
+			width      	360
+			height     	300
+			annotation 	0)
+		    (object ConnectionView ""
+			client     	@101
+			supplier   	@103)
+		    (object ConnectionView ""
+			client     	@104
+			supplier   	@101)
+		    (object ConnectionView ""
+			client     	@102
+			supplier   	@101)))))
+    properties 	(object Properties))
--- a/windowing/windowserver/DES/WSERV2.MDL	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/DES/WSERV2.MDL	Fri Jul 16 11:45:55 2010 +0300
@@ -1,511 +1,511 @@
-
-(object Petal
-    version    	35)
-
-(object Design "<Top Level>"
-    is_unit    	TRUE
-    file_name  	"d:\wserv\des\wserv2.mdl"
-    is_loaded  	TRUE
-    defaults   	(object defaults
-	rightMargin 	0.25
-	leftMargin 	0.25
-	topMargin  	0.25
-	bottomMargin 	0.5
-	pageOverlap 	0.25
-	clipIconLabels 	TRUE
-	autoResize 	FALSE
-	snapToGrid 	TRUE
-	gridX      	0
-	gridY      	0
-	defaultFont 	(object Font
-	    size       	10
-	    face       	"Arial"
-	    bold       	FALSE
-	    italics    	FALSE
-	    underline  	FALSE
-	    strike     	FALSE
-	    color      	0
-	    default_color 	TRUE)
-	showMessageNum 	3)
-    root_category 	(object Class_Category "<Top Level>"
-	exportControl 	"Public"
-	global     	TRUE
-	subsystem  	"<Top Level>"
-	logical_models 	(list unit_reference_list
-	    (object Class_Category "Server"
-		visible_categories 	(list visibility_relationship_list
-		    (object Visibility_Relationship
-			supplier   	"DebugLog")
-		    (object Visibility_Relationship
-			supplier   	"Gdi")
-		    (object Visibility_Relationship
-			supplier   	"KeyBoard")
-		    (object Visibility_Relationship
-			supplier   	"GdiDevice"))
-		exportControl 	"Public"
-		logical_models 	(list unit_reference_list
-		    (object Class "WsTop"
-			used_nodes 	(list uses_relationship_list
-			    (object Uses_Relationship
-				supplier   	"Gdi Device"
-				supplier_cardinality 	(value cardinality "1")
-				client_cardinality 	(value cardinality "1"))
-			    (object Uses_Relationship
-				supplier   	"ScreenGdi"
-				supplier_cardinality 	(value cardinality "1")
-				client_cardinality 	(value cardinality "1"))
-			    (object Uses_Relationship
-				supplier   	"Root Window"
-				supplier_cardinality 	(value cardinality "1")
-				client_cardinality 	(value cardinality "1"))
-			    (object Uses_Relationship
-				supplier   	"Pointer"
-				supplier_cardinality 	(value cardinality "1")
-				client_cardinality 	(value cardinality "1"))
-			    (object Uses_Relationship
-				supplier   	"WinDebugLog"
-				supplier_cardinality 	(value cardinality "1")
-				client_cardinality 	(value cardinality "1"))
-			    (object Uses_Relationship
-				supplier   	"WindowServer"
-				supplier_cardinality 	(value cardinality "1")
-				client_cardinality 	(value cardinality "1"))
-			    (object Uses_Relationship
-				supplier   	"Periodic"
-				supplier_cardinality 	(value cardinality "1")
-				client_cardinality 	(value cardinality "1"))))
-		    (object Class "ScreenGdiDevice")
-		    (object Class "ScreenGdi"
-			collaborators 	(list association_list
-			    (object Association
-				supplier   	"Gdi Device")))
-		    (object Class "Pointer"
-			collaborators 	(list association_list
-			    (object Association
-				label      	"Current window"
-				supplier   	"Window"
-				supplier_cardinality 	(value cardinality "1")
-				client_cardinality 	(value cardinality "0..1"))
-			    (object Association
-				label      	"Grab window"
-				supplier   	"Window"
-				supplier_cardinality 	(value cardinality "1")
-				client_cardinality 	(value cardinality "0..1"))))
-		    (object Class "WinDebugLog")
-		    (object Class "WindowServer"
-			used_nodes 	(list uses_relationship_list
-			    (object Uses_Relationship
-				supplier   	"Session"
-				supplier_cardinality 	(value cardinality "0..n")
-				client_cardinality 	(value cardinality "1"))))
-		    (object Class "Periodic")
-		    (object Class "Session"
-			used_nodes 	(list uses_relationship_list
-			    (object Uses_Relationship
-				supplier   	"Drawable"
-				supplier_cardinality 	(value cardinality "0..n")
-				client_cardinality 	(value cardinality "1"))
-			    (object Uses_Relationship
-				supplier   	"Gc"
-				supplier_cardinality 	(value cardinality "0..n")
-				client_cardinality 	(value cardinality "1"))
-			    (object Uses_Relationship
-				supplier   	"Text Cursor"
-				supplier_cardinality 	(value cardinality "1")
-				client_cardinality 	(value cardinality "1"))
-			    (object Uses_Relationship
-				supplier   	"Event Queue"
-				supplier_cardinality 	(value cardinality "1")
-				client_cardinality 	(value cardinality "1"))))
-		    (object Class "WindowBase"
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"Drawable")))
-		    (object Class "Gc")
-		    (object Class "Drawable")
-		    (object Class "Group Window"
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"WindowBase")))
-		    (object Class "Window"
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"WindowBase")))
-		    (object Class "Root Window"
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"Window")))
-		    (object Class "Client Window"
-			superclasses 	(list inheritance_relationship_list
-			    (object Inheritance_Relationship
-				supplier   	"Window")))
-		    (object Class "Text Cursor"
-			collaborators 	(list association_list
-			    (object Association
-				supplier   	"Window"
-				supplier_cardinality 	(value cardinality "0..1")
-				client_cardinality 	(value cardinality "0..1"))))
-		    (object Class "Event Queue"))
-		logical_presentations 	(list unit_reference_list
-		    (object ClassDiagram "Main"
-			title      	"Main"
-			zoom       	100
-			max_height 	28350
-			max_width  	21600
-			origin_x   	0
-			origin_y   	800
-			items      	(list diagram_item_list
-			    (object ClassView "Class" "WsTop" @1
-				location   	(1515, 632)
-				label      	(object ItemLabel
-				    location   	(1411, 548)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"WsTop")
-				annotation 	8)
-			    (object ClassView "Class" "Gdi Device" @2
-				location   	(2237, 514)
-				label      	(object ItemLabel
-				    location   	(2133, 430)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Gdi Device")
-				annotation 	8)
-			    (object ClassView "Class" "ScreenGdi" @3
-				location   	(2268, 876)
-				label      	(object ItemLabel
-				    location   	(2164, 792)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"ScreenGdi")
-				annotation 	8)
-			    (object ClassView "Class" "Pointer" @4
-				location   	(1828, 1132)
-				label      	(object ItemLabel
-				    location   	(1724, 1048)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Pointer")
-				annotation 	8)
-			    (object ClassView "Class" "WinDebugLog" @5
-				location   	(706, 713)
-				label      	(object ItemLabel
-				    location   	(602, 629)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"WinDebugLog")
-				annotation 	8)
-			    (object ClassView "Class" "WindowServer" @6
-				location   	(1265, 1078)
-				label      	(object ItemLabel
-				    location   	(1161, 994)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"WindowServer")
-				annotation 	8)
-			    (object ClassView "Class" "Periodic" @7
-				location   	(787, 1076)
-				label      	(object ItemLabel
-				    location   	(683, 992)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Periodic")
-				annotation 	8)
-			    (object ClassView "Class" "Session" @8
-				location   	(1147, 1474)
-				label      	(object ItemLabel
-				    location   	(1043, 1390)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Session")
-				annotation 	8)
-			    (object UsesView ""
-				client     	@6
-				supplier   	@8)
-			    (object AssociationView ""
-				client     	@3
-				supplier   	@2)
-			    (object ClassView "Class" "WindowBase" @9
-				location   	(1806, 2201)
-				label      	(object ItemLabel
-				    location   	(1702, 2117)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"WindowBase")
-				annotation 	8)
-			    (object ClassView "Class" "Gc" @10
-				location   	(353, 1663)
-				label      	(object ItemLabel
-				    location   	(249, 1579)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Gc")
-				annotation 	8)
-			    (object ClassView "Class" "Drawable" @11
-				location   	(1515, 1880)
-				label      	(object ItemLabel
-				    location   	(1411, 1796)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Drawable")
-				annotation 	8)
-			    (object InheritView ""
-				client     	@9
-				supplier   	@11)
-			    (object UsesView ""
-				client     	@8
-				supplier   	@11)
-			    (object UsesView ""
-				client     	@8
-				supplier   	@10)
-			    (object ClassView "Class" "Group Window" @12
-				location   	(1512, 2477)
-				label      	(object ItemLabel
-				    location   	(1408, 2393)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Group Window")
-				annotation 	8)
-			    (object ClassView "Class" "Window" @13
-				location   	(1981, 2499)
-				label      	(object ItemLabel
-				    location   	(1877, 2415)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Window")
-				annotation 	8)
-			    (object ClassView "Class" "Root Window" @14
-				location   	(2293, 2904)
-				label      	(object ItemLabel
-				    location   	(2189, 2820)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Root Window")
-				annotation 	8)
-			    (object ClassView "Class" "Client Window" @15
-				location   	(1775, 2922)
-				label      	(object ItemLabel
-				    location   	(1671, 2838)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Client Window")
-				annotation 	8)
-			    (object InheritView ""
-				client     	@13
-				supplier   	@9)
-			    (object InheritView ""
-				client     	@12
-				supplier   	@9)
-			    (object InheritView ""
-				client     	@15
-				supplier   	@13)
-			    (object InheritView ""
-				client     	@14
-				supplier   	@13)
-			    (object AssociationView "Current window"
-				label      	(object ItemLabel
-				    location   	(1993, 1802)
-				    anchor_loc 	1
-				    nlines     	1
-				    max_width  	450
-				    justify    	0
-				    label      	"Current window")
-				client     	@4
-				supplier   	@13
-				vertices   	(list Points
-				    (1862, 1224)
-				    (1962, 1487)
-				    (2018, 2050)
-				    (1988, 2397)))
-			    (object AssociationView "Grab window"
-				label      	(object ItemLabel
-				    location   	(2158, 1751)
-				    anchor_loc 	1
-				    nlines     	1
-				    max_width  	450
-				    justify    	0
-				    label      	"Grab window")
-				client     	@4
-				supplier   	@13
-				vertices   	(list Points
-				    (1897, 1207)
-				    (2153, 1481)
-				    (2162, 1956)
-				    (2022, 2375)))
-			    (object UsesView ""
-				client     	@1
-				supplier   	@2)
-			    (object UsesView ""
-				client     	@1
-				supplier   	@3)
-			    (object UsesView ""
-				client     	@1
-				supplier   	@14
-				vertices   	(list Points
-				    (1627, 715)
-				    (2318, 1231)
-				    (2293, 2804)))
-			    (object UsesView ""
-				client     	@1
-				supplier   	@4)
-			    (object UsesView ""
-				client     	@1
-				supplier   	@5)
-			    (object UsesView ""
-				client     	@1
-				supplier   	@6)
-			    (object UsesView ""
-				client     	@1
-				supplier   	@7)
-			    (object ClassView "Class" "Text Cursor" @16
-				location   	(906, 2822)
-				label      	(object ItemLabel
-				    location   	(802, 2738)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Text Cursor")
-				annotation 	8)
-			    (object UsesView ""
-				client     	@8
-				supplier   	@16)
-			    (object AssociationView ""
-				client     	@16
-				supplier   	@13)
-			    (object ClassView "Class" "Event Queue" @17
-				location   	(340, 2037)
-				label      	(object ItemLabel
-				    location   	(236, 1953)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Event Queue")
-				annotation 	8)
-			    (object UsesView ""
-				client     	@8
-				supplier   	@17)))))
-	    (object Class_Category "DebugLog"
-		exportControl 	"Public"
-		logical_models 	(list unit_reference_list)
-		logical_presentations 	(list unit_reference_list))
-	    (object Class_Category "KeyBoard"
-		exportControl 	"Public"
-		logical_models 	(list unit_reference_list)
-		logical_presentations 	(list unit_reference_list))
-	    (object Class_Category "Gdi"
-		exportControl 	"Public"
-		logical_models 	(list unit_reference_list
-		    (object Class "Gdi Device"))
-		logical_presentations 	(list unit_reference_list
-		    (object ClassDiagram "Main"
-			title      	"Main"
-			zoom       	100
-			max_height 	28350
-			max_width  	21600
-			origin_x   	0
-			origin_y   	0
-			items      	(list diagram_item_list
-			    (object ClassView "Class" "Gdi Device" @18
-				location   	(756, 766)
-				label      	(object ItemLabel
-				    location   	(652, 682)
-				    nlines     	2
-				    max_width  	240
-				    justify    	0
-				    label      	"Gdi Device")
-				annotation 	8))))))
-	logical_presentations 	(list unit_reference_list
-	    (object ClassDiagram "Main"
-		title      	"Main"
-		zoom       	100
-		max_height 	28350
-		max_width  	21600
-		origin_x   	0
-		origin_y   	0
-		items      	(list diagram_item_list
-		    (object CategoryView "Server" @19
-			location   	(1022, 187)
-			label      	(object ItemLabel
-			    location   	(878, 103)
-			    nlines     	2
-			    max_width  	288
-			    justify    	0
-			    label      	"Server")
-			width      	300
-			height     	180)
-		    (object CategoryView "DebugLog" @20
-			location   	(538, 593)
-			label      	(object ItemLabel
-			    location   	(394, 509)
-			    nlines     	2
-			    max_width  	288
-			    justify    	0
-			    label      	"DebugLog")
-			width      	300
-			height     	180)
-		    (object CategoryView "KeyBoard" @21
-			location   	(1688, 593)
-			label      	(object ItemLabel
-			    location   	(1544, 509)
-			    nlines     	2
-			    max_width  	288
-			    justify    	0
-			    label      	"KeyBoard")
-			width      	300
-			height     	180)
-		    (object CategoryView "Gdi" @22
-			location   	(919, 587)
-			label      	(object ItemLabel
-			    location   	(775, 503)
-			    nlines     	2
-			    max_width  	288
-			    justify    	0
-			    label      	"Gdi")
-			width      	300
-			height     	180)
-		    (object ImportView ""
-			client     	@19
-			supplier   	@20)
-		    (object ImportView ""
-			client     	@19
-			supplier   	@22)
-		    (object ImportView ""
-			client     	@19
-			supplier   	@21)))))
-    root_subsystem 	(object SubSystem "<Top Level>"
-	physical_models 	(list unit_reference_list)
-	physical_presentations 	(list unit_reference_list
-	    (object Module_Diagram "Main"
-		title      	"Main"
-		zoom       	100
-		max_height 	28350
-		max_width  	21600
-		origin_x   	0
-		origin_y   	0
-		items      	(list diagram_item_list))))
-    process_structure 	(object Processes
-	ProcsNDevs 	(list
-	    (object Process_Diagram ""
-		title      	""
-		zoom       	100
-		max_height 	28350
-		max_width  	21600
-		origin_x   	0
-		origin_y   	0
-		items      	(list diagram_item_list))))
-    properties 	(object Properties))
+
+(object Petal
+    version    	35)
+
+(object Design "<Top Level>"
+    is_unit    	TRUE
+    file_name  	"d:\wserv\des\wserv2.mdl"
+    is_loaded  	TRUE
+    defaults   	(object defaults
+	rightMargin 	0.25
+	leftMargin 	0.25
+	topMargin  	0.25
+	bottomMargin 	0.5
+	pageOverlap 	0.25
+	clipIconLabels 	TRUE
+	autoResize 	FALSE
+	snapToGrid 	TRUE
+	gridX      	0
+	gridY      	0
+	defaultFont 	(object Font
+	    size       	10
+	    face       	"Arial"
+	    bold       	FALSE
+	    italics    	FALSE
+	    underline  	FALSE
+	    strike     	FALSE
+	    color      	0
+	    default_color 	TRUE)
+	showMessageNum 	3)
+    root_category 	(object Class_Category "<Top Level>"
+	exportControl 	"Public"
+	global     	TRUE
+	subsystem  	"<Top Level>"
+	logical_models 	(list unit_reference_list
+	    (object Class_Category "Server"
+		visible_categories 	(list visibility_relationship_list
+		    (object Visibility_Relationship
+			supplier   	"DebugLog")
+		    (object Visibility_Relationship
+			supplier   	"Gdi")
+		    (object Visibility_Relationship
+			supplier   	"KeyBoard")
+		    (object Visibility_Relationship
+			supplier   	"GdiDevice"))
+		exportControl 	"Public"
+		logical_models 	(list unit_reference_list
+		    (object Class "WsTop"
+			used_nodes 	(list uses_relationship_list
+			    (object Uses_Relationship
+				supplier   	"Gdi Device"
+				supplier_cardinality 	(value cardinality "1")
+				client_cardinality 	(value cardinality "1"))
+			    (object Uses_Relationship
+				supplier   	"ScreenGdi"
+				supplier_cardinality 	(value cardinality "1")
+				client_cardinality 	(value cardinality "1"))
+			    (object Uses_Relationship
+				supplier   	"Root Window"
+				supplier_cardinality 	(value cardinality "1")
+				client_cardinality 	(value cardinality "1"))
+			    (object Uses_Relationship
+				supplier   	"Pointer"
+				supplier_cardinality 	(value cardinality "1")
+				client_cardinality 	(value cardinality "1"))
+			    (object Uses_Relationship
+				supplier   	"WinDebugLog"
+				supplier_cardinality 	(value cardinality "1")
+				client_cardinality 	(value cardinality "1"))
+			    (object Uses_Relationship
+				supplier   	"WindowServer"
+				supplier_cardinality 	(value cardinality "1")
+				client_cardinality 	(value cardinality "1"))
+			    (object Uses_Relationship
+				supplier   	"Periodic"
+				supplier_cardinality 	(value cardinality "1")
+				client_cardinality 	(value cardinality "1"))))
+		    (object Class "ScreenGdiDevice")
+		    (object Class "ScreenGdi"
+			collaborators 	(list association_list
+			    (object Association
+				supplier   	"Gdi Device")))
+		    (object Class "Pointer"
+			collaborators 	(list association_list
+			    (object Association
+				label      	"Current window"
+				supplier   	"Window"
+				supplier_cardinality 	(value cardinality "1")
+				client_cardinality 	(value cardinality "0..1"))
+			    (object Association
+				label      	"Grab window"
+				supplier   	"Window"
+				supplier_cardinality 	(value cardinality "1")
+				client_cardinality 	(value cardinality "0..1"))))
+		    (object Class "WinDebugLog")
+		    (object Class "WindowServer"
+			used_nodes 	(list uses_relationship_list
+			    (object Uses_Relationship
+				supplier   	"Session"
+				supplier_cardinality 	(value cardinality "0..n")
+				client_cardinality 	(value cardinality "1"))))
+		    (object Class "Periodic")
+		    (object Class "Session"
+			used_nodes 	(list uses_relationship_list
+			    (object Uses_Relationship
+				supplier   	"Drawable"
+				supplier_cardinality 	(value cardinality "0..n")
+				client_cardinality 	(value cardinality "1"))
+			    (object Uses_Relationship
+				supplier   	"Gc"
+				supplier_cardinality 	(value cardinality "0..n")
+				client_cardinality 	(value cardinality "1"))
+			    (object Uses_Relationship
+				supplier   	"Text Cursor"
+				supplier_cardinality 	(value cardinality "1")
+				client_cardinality 	(value cardinality "1"))
+			    (object Uses_Relationship
+				supplier   	"Event Queue"
+				supplier_cardinality 	(value cardinality "1")
+				client_cardinality 	(value cardinality "1"))))
+		    (object Class "WindowBase"
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"Drawable")))
+		    (object Class "Gc")
+		    (object Class "Drawable")
+		    (object Class "Group Window"
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"WindowBase")))
+		    (object Class "Window"
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"WindowBase")))
+		    (object Class "Root Window"
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"Window")))
+		    (object Class "Client Window"
+			superclasses 	(list inheritance_relationship_list
+			    (object Inheritance_Relationship
+				supplier   	"Window")))
+		    (object Class "Text Cursor"
+			collaborators 	(list association_list
+			    (object Association
+				supplier   	"Window"
+				supplier_cardinality 	(value cardinality "0..1")
+				client_cardinality 	(value cardinality "0..1"))))
+		    (object Class "Event Queue"))
+		logical_presentations 	(list unit_reference_list
+		    (object ClassDiagram "Main"
+			title      	"Main"
+			zoom       	100
+			max_height 	28350
+			max_width  	21600
+			origin_x   	0
+			origin_y   	800
+			items      	(list diagram_item_list
+			    (object ClassView "Class" "WsTop" @1
+				location   	(1515, 632)
+				label      	(object ItemLabel
+				    location   	(1411, 548)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"WsTop")
+				annotation 	8)
+			    (object ClassView "Class" "Gdi Device" @2
+				location   	(2237, 514)
+				label      	(object ItemLabel
+				    location   	(2133, 430)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Gdi Device")
+				annotation 	8)
+			    (object ClassView "Class" "ScreenGdi" @3
+				location   	(2268, 876)
+				label      	(object ItemLabel
+				    location   	(2164, 792)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"ScreenGdi")
+				annotation 	8)
+			    (object ClassView "Class" "Pointer" @4
+				location   	(1828, 1132)
+				label      	(object ItemLabel
+				    location   	(1724, 1048)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Pointer")
+				annotation 	8)
+			    (object ClassView "Class" "WinDebugLog" @5
+				location   	(706, 713)
+				label      	(object ItemLabel
+				    location   	(602, 629)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"WinDebugLog")
+				annotation 	8)
+			    (object ClassView "Class" "WindowServer" @6
+				location   	(1265, 1078)
+				label      	(object ItemLabel
+				    location   	(1161, 994)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"WindowServer")
+				annotation 	8)
+			    (object ClassView "Class" "Periodic" @7
+				location   	(787, 1076)
+				label      	(object ItemLabel
+				    location   	(683, 992)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Periodic")
+				annotation 	8)
+			    (object ClassView "Class" "Session" @8
+				location   	(1147, 1474)
+				label      	(object ItemLabel
+				    location   	(1043, 1390)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Session")
+				annotation 	8)
+			    (object UsesView ""
+				client     	@6
+				supplier   	@8)
+			    (object AssociationView ""
+				client     	@3
+				supplier   	@2)
+			    (object ClassView "Class" "WindowBase" @9
+				location   	(1806, 2201)
+				label      	(object ItemLabel
+				    location   	(1702, 2117)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"WindowBase")
+				annotation 	8)
+			    (object ClassView "Class" "Gc" @10
+				location   	(353, 1663)
+				label      	(object ItemLabel
+				    location   	(249, 1579)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Gc")
+				annotation 	8)
+			    (object ClassView "Class" "Drawable" @11
+				location   	(1515, 1880)
+				label      	(object ItemLabel
+				    location   	(1411, 1796)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Drawable")
+				annotation 	8)
+			    (object InheritView ""
+				client     	@9
+				supplier   	@11)
+			    (object UsesView ""
+				client     	@8
+				supplier   	@11)
+			    (object UsesView ""
+				client     	@8
+				supplier   	@10)
+			    (object ClassView "Class" "Group Window" @12
+				location   	(1512, 2477)
+				label      	(object ItemLabel
+				    location   	(1408, 2393)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Group Window")
+				annotation 	8)
+			    (object ClassView "Class" "Window" @13
+				location   	(1981, 2499)
+				label      	(object ItemLabel
+				    location   	(1877, 2415)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Window")
+				annotation 	8)
+			    (object ClassView "Class" "Root Window" @14
+				location   	(2293, 2904)
+				label      	(object ItemLabel
+				    location   	(2189, 2820)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Root Window")
+				annotation 	8)
+			    (object ClassView "Class" "Client Window" @15
+				location   	(1775, 2922)
+				label      	(object ItemLabel
+				    location   	(1671, 2838)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Client Window")
+				annotation 	8)
+			    (object InheritView ""
+				client     	@13
+				supplier   	@9)
+			    (object InheritView ""
+				client     	@12
+				supplier   	@9)
+			    (object InheritView ""
+				client     	@15
+				supplier   	@13)
+			    (object InheritView ""
+				client     	@14
+				supplier   	@13)
+			    (object AssociationView "Current window"
+				label      	(object ItemLabel
+				    location   	(1993, 1802)
+				    anchor_loc 	1
+				    nlines     	1
+				    max_width  	450
+				    justify    	0
+				    label      	"Current window")
+				client     	@4
+				supplier   	@13
+				vertices   	(list Points
+				    (1862, 1224)
+				    (1962, 1487)
+				    (2018, 2050)
+				    (1988, 2397)))
+			    (object AssociationView "Grab window"
+				label      	(object ItemLabel
+				    location   	(2158, 1751)
+				    anchor_loc 	1
+				    nlines     	1
+				    max_width  	450
+				    justify    	0
+				    label      	"Grab window")
+				client     	@4
+				supplier   	@13
+				vertices   	(list Points
+				    (1897, 1207)
+				    (2153, 1481)
+				    (2162, 1956)
+				    (2022, 2375)))
+			    (object UsesView ""
+				client     	@1
+				supplier   	@2)
+			    (object UsesView ""
+				client     	@1
+				supplier   	@3)
+			    (object UsesView ""
+				client     	@1
+				supplier   	@14
+				vertices   	(list Points
+				    (1627, 715)
+				    (2318, 1231)
+				    (2293, 2804)))
+			    (object UsesView ""
+				client     	@1
+				supplier   	@4)
+			    (object UsesView ""
+				client     	@1
+				supplier   	@5)
+			    (object UsesView ""
+				client     	@1
+				supplier   	@6)
+			    (object UsesView ""
+				client     	@1
+				supplier   	@7)
+			    (object ClassView "Class" "Text Cursor" @16
+				location   	(906, 2822)
+				label      	(object ItemLabel
+				    location   	(802, 2738)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Text Cursor")
+				annotation 	8)
+			    (object UsesView ""
+				client     	@8
+				supplier   	@16)
+			    (object AssociationView ""
+				client     	@16
+				supplier   	@13)
+			    (object ClassView "Class" "Event Queue" @17
+				location   	(340, 2037)
+				label      	(object ItemLabel
+				    location   	(236, 1953)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Event Queue")
+				annotation 	8)
+			    (object UsesView ""
+				client     	@8
+				supplier   	@17)))))
+	    (object Class_Category "DebugLog"
+		exportControl 	"Public"
+		logical_models 	(list unit_reference_list)
+		logical_presentations 	(list unit_reference_list))
+	    (object Class_Category "KeyBoard"
+		exportControl 	"Public"
+		logical_models 	(list unit_reference_list)
+		logical_presentations 	(list unit_reference_list))
+	    (object Class_Category "Gdi"
+		exportControl 	"Public"
+		logical_models 	(list unit_reference_list
+		    (object Class "Gdi Device"))
+		logical_presentations 	(list unit_reference_list
+		    (object ClassDiagram "Main"
+			title      	"Main"
+			zoom       	100
+			max_height 	28350
+			max_width  	21600
+			origin_x   	0
+			origin_y   	0
+			items      	(list diagram_item_list
+			    (object ClassView "Class" "Gdi Device" @18
+				location   	(756, 766)
+				label      	(object ItemLabel
+				    location   	(652, 682)
+				    nlines     	2
+				    max_width  	240
+				    justify    	0
+				    label      	"Gdi Device")
+				annotation 	8))))))
+	logical_presentations 	(list unit_reference_list
+	    (object ClassDiagram "Main"
+		title      	"Main"
+		zoom       	100
+		max_height 	28350
+		max_width  	21600
+		origin_x   	0
+		origin_y   	0
+		items      	(list diagram_item_list
+		    (object CategoryView "Server" @19
+			location   	(1022, 187)
+			label      	(object ItemLabel
+			    location   	(878, 103)
+			    nlines     	2
+			    max_width  	288
+			    justify    	0
+			    label      	"Server")
+			width      	300
+			height     	180)
+		    (object CategoryView "DebugLog" @20
+			location   	(538, 593)
+			label      	(object ItemLabel
+			    location   	(394, 509)
+			    nlines     	2
+			    max_width  	288
+			    justify    	0
+			    label      	"DebugLog")
+			width      	300
+			height     	180)
+		    (object CategoryView "KeyBoard" @21
+			location   	(1688, 593)
+			label      	(object ItemLabel
+			    location   	(1544, 509)
+			    nlines     	2
+			    max_width  	288
+			    justify    	0
+			    label      	"KeyBoard")
+			width      	300
+			height     	180)
+		    (object CategoryView "Gdi" @22
+			location   	(919, 587)
+			label      	(object ItemLabel
+			    location   	(775, 503)
+			    nlines     	2
+			    max_width  	288
+			    justify    	0
+			    label      	"Gdi")
+			width      	300
+			height     	180)
+		    (object ImportView ""
+			client     	@19
+			supplier   	@20)
+		    (object ImportView ""
+			client     	@19
+			supplier   	@22)
+		    (object ImportView ""
+			client     	@19
+			supplier   	@21)))))
+    root_subsystem 	(object SubSystem "<Top Level>"
+	physical_models 	(list unit_reference_list)
+	physical_presentations 	(list unit_reference_list
+	    (object Module_Diagram "Main"
+		title      	"Main"
+		zoom       	100
+		max_height 	28350
+		max_width  	21600
+		origin_x   	0
+		origin_y   	0
+		items      	(list diagram_item_list))))
+    process_structure 	(object Processes
+	ProcsNDevs 	(list
+	    (object Process_Diagram ""
+		title      	""
+		zoom       	100
+		max_height 	28350
+		max_width  	21600
+		origin_x   	0
+		origin_y   	0
+		items      	(list diagram_item_list))))
+    properties 	(object Properties))
--- a/windowing/windowserver/DES/WSV4.MDL	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/DES/WSV4.MDL	Fri Jul 16 11:45:55 2010 +0300
@@ -1,401 +1,401 @@
-
-(object Petal
-    version    	35)
-
-(object Design "<Top Level>"
-    is_unit    	TRUE
-    file_name  	"c:\wserv\des\wsv4.mdl"
-    is_loaded  	TRUE
-    defaults   	(object defaults
-	rightMargin 	0.25
-	leftMargin 	0.25
-	topMargin  	0.25
-	bottomMargin 	0.5
-	pageOverlap 	0.25
-	clipIconLabels 	TRUE
-	autoResize 	FALSE
-	snapToGrid 	TRUE
-	gridX      	0
-	gridY      	0
-	defaultFont 	(object Font
-	    size       	12
-	    face       	"helvetica"
-	    bold       	FALSE
-	    italics    	FALSE
-	    underline  	FALSE
-	    strike     	FALSE
-	    color      	0
-	    default_color 	TRUE)
-	showMessageNum 	3)
-    root_category 	(object Class_Category "<Top Level>"
-	exportControl 	"Public"
-	global     	TRUE
-	subsystem  	"<Top Level>"
-	logical_models 	(list unit_reference_list
-	    (object Class "Main"
-		documentation 	"Top level windows server, recieves commands from clients, events from the O/S and timer completions."
-		fields     	(list has_relationship_list
-		    (object Has_Relationship
-			supplier   	"Client"
-			supplier_cardinality 	(value cardinality "n")
-			client_cardinality 	(value cardinality "1"))
-		    (object Has_Relationship
-			supplier   	"WsrvClient"
-			supplier_cardinality 	(value cardinality "1")
-			client_cardinality 	(value cardinality "1"))
-		    (object Has_Relationship
-			supplier   	"System"
-			supplier_cardinality 	(value cardinality "1")
-			client_cardinality 	(value cardinality "1")))
-		cardinality 	(value Cardinality "1"))
-	    (object Class "BackedUpWindow"
-		fields     	(list has_relationship_list
-		    (object Has_Relationship
-			supplier   	"Backup Bitmap"))
-		superclasses 	(list inheritance_relationship_list
-		    (object Inheritance_Relationship
-			supplier   	"Window"))
-		collaborators 	(list association_list
-		    (object Association
-			supplier   	"Bitmap")))
-	    (object Class_Utility "$UNNAMED$0")
-	    (object Class "Owner"
-		fields     	(list has_relationship_list
-		    (object Has_Relationship
-			supplier   	"Bitmap"
-			supplier_cardinality 	(value cardinality "n")
-			client_cardinality 	(value cardinality "1"))
-		    (object Has_Relationship
-			supplier   	"Clock"
-			supplier_cardinality 	(value cardinality "0..n")
-			client_cardinality 	(value cardinality "1"))
-		    (object Has_Relationship
-			supplier   	"Font"
-			supplier_cardinality 	(value cardinality "0..n")
-			client_cardinality 	(value cardinality "1"))))
-	    (object Class "GCB"
-		collaborators 	(list association_list
-		    (object Association
-			supplier   	"Font"
-			supplier_cardinality 	(value cardinality "1")
-			client_cardinality 	(value cardinality "n"))
-		    (object Association
-			supplier   	"Backup Bitmap"
-			supplier_cardinality 	(value cardinality "0..1")
-			client_cardinality 	(value cardinality "n")))
-		used_nodes 	(list uses_relationship_list
-		    (object Uses_Relationship
-			supplier   	"Drawable")))
-	    (object Class "Bitmap"
-		superclasses 	(list inheritance_relationship_list
-		    (object Inheritance_Relationship
-			supplier   	"Drawable"))
-		collaborators 	(list association_list
-		    (object Association
-			supplier   	"System Bitmaps"
-			supplier_cardinality 	(value cardinality "n")
-			client_cardinality 	(value cardinality "1"))))
-	    (object Class "Font"
-		cardinality 	(value Cardinality "1..n"))
-	    (object Class "$UNNAMED$1")
-	    (object Class "System"
-		superclasses 	(list inheritance_relationship_list
-		    (object Inheritance_Relationship
-			supplier   	"Owner")))
-	    (object Class "System Bitmaps"
-		collaborators 	(list association_list
-		    (object Association
-			supplier   	"Main"
-			supplier_cardinality 	(value cardinality "n")
-			client_cardinality 	(value cardinality "0"))
-		    (object Association
-			supplier   	"Bitmap"))
-		cardinality 	(value Cardinality "1"))
-	    (object Class "Drawable"
-		fields     	(list has_relationship_list
-		    (object Has_Relationship
-			supplier   	"Window"))
-		used_nodes 	(list uses_relationship_list
-		    (object Uses_Relationship
-			supplier   	"GCB"
-			supplier_cardinality 	(value cardinality "1")
-			client_cardinality 	(value cardinality "n"))))
-	    (object Class "$UNNAMED$2")
-	    (object Class "Window"
-		superclasses 	(list inheritance_relationship_list
-		    (object Inheritance_Relationship
-			supplier   	
-|Normal 
-|Window
-|
-			)
-		    (object Inheritance_Relationship
-			supplier   	"Drawable")))
-	    (object Class "Normal 
-Window
-")
-	    (object Class "Clock"
-		fields     	(list has_relationship_list
-		    (object Has_Relationship
-			supplier   	"GCB"))
-		used_nodes 	(list uses_relationship_list
-		    (object Uses_Relationship
-			supplier   	"GCB")))
-	    (object Class "System Clocks")
-	    (object Class "WsrvClient"
-		superclasses 	(list inheritance_relationship_list
-		    (object Inheritance_Relationship
-			supplier   	"Client")))
-	    (object Class_Utility "$UNNAMED$3")
-	    (object Class_Utility "$UNNAMED$4")
-	    (object Parameterized_Class "$UNNAMED$5")
-	    (object Instantiated_Class_Utility "$UNNAMED$6")
-	    (object Instantiated_Class "$UNNAMED$7")
-	    (object Parameterized_Class "$UNNAMED$8")
-	    (object Class "Client"
-		fields     	(list has_relationship_list
-		    (object Has_Relationship
-			supplier   	"GCB"
-			supplier_cardinality 	(value cardinality "0..n")
-			client_cardinality 	(value cardinality "1"))
-		    (object Has_Relationship
-			supplier   	"Window"
-			supplier_cardinality 	(value cardinality "0..n")
-			client_cardinality 	(value cardinality "1")))
-		superclasses 	(list inheritance_relationship_list
-		    (object Inheritance_Relationship
-			supplier   	"Owner")))
-	    (object Metaclass "$UNNAMED$9")
-	    (object Class_Utility "$UNNAMED$10")
-	    (object Class "Backup Bitmap"
-		superclasses 	(list inheritance_relationship_list
-		    (object Inheritance_Relationship
-			supplier   	"Bitmap")))
-	    (object Class "$UNNAMED$11")
-	    (object Class "$UNNAMED$12")
-	    (object Class "$UNNAMED$13")
-	    (object Class "$UNNAMED$14")
-	    (object Class_Category "$UNNAMED$15"
-		exportControl 	"Public"
-		logical_models 	(list unit_reference_list)
-		logical_presentations 	(list unit_reference_list))
-	    (object Class_Category "$UNNAMED$16"
-		exportControl 	"Public"
-		logical_models 	(list unit_reference_list)
-		logical_presentations 	(list unit_reference_list)))
-	logical_presentations 	(list unit_reference_list
-	    (object ClassDiagram "Main"
-		title      	"Main"
-		zoom       	72
-		max_height 	28350
-		max_width  	21600
-		origin_x   	0
-		origin_y   	0
-		items      	(list diagram_item_list
-		    (object ClassView "Class" "Main" @1
-			location   	(1053, 177)
-			label      	(object ItemLabel
-			    location   	(944, 87)
-			    nlines     	2
-			    max_width  	255
-			    justify    	0
-			    label      	"Main")
-			width      	370
-			height     	270
-			annotation 	8)
-		    (object ClassView "Class" "BackedUpWindow" @2
-			location   	(468, 1946)
-			label      	(object ItemLabel
-			    location   	(361, 1859)
-			    nlines     	2
-			    max_width  	248
-			    justify    	0
-			    label      	"BackedUpWindow")
-			width      	360
-			height     	260
-			annotation 	8)
-		    (object ClassView "Class" "Owner" @3
-			location   	(1204, 559)
-			label      	(object ItemLabel
-			    location   	(1101, 476)
-			    nlines     	2
-			    max_width  	238
-			    justify    	0
-			    label      	"Owner")
-			width      	345
-			height     	250
-			annotation 	8)
-		    (object ClassView "Class" "GCB" @4
-			location   	(1594, 1447)
-			label      	(object ItemLabel
-			    location   	(1490, 1363)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"GCB")
-			annotation 	8)
-		    (object ClassView "Class" "Bitmap" @5
-			location   	(991, 1575)
-			label      	(object ItemLabel
-			    location   	(887, 1491)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Bitmap")
-			annotation 	8)
-		    (object ClassView "Class" "Font" @6
-			location   	(2195, 1345)
-			label      	(object ItemLabel
-			    location   	(2091, 1261)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Font")
-			annotation 	8)
-		    (object ClassView "Class" "System" @7
-			location   	(1802, 714)
-			label      	(object ItemLabel
-			    location   	(1698, 630)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"System")
-			annotation 	8)
-		    (object ClassView "Class" "Drawable" @8
-			location   	(880, 1170)
-			label      	(object ItemLabel
-			    location   	(776, 1086)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Drawable")
-			annotation 	8)
-		    (object ClassView "Class" "Window" @9
-			location   	(467, 1407)
-			label      	(object ItemLabel
-			    location   	(363, 1323)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Window")
-			annotation 	8)
-		    (object ClassView "Class" "Clock" @10
-			location   	(1430, 988)
-			label      	(object ItemLabel
-			    location   	(1326, 904)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Clock")
-			annotation 	8)
-		    (object HasView ""
-			client     	@3
-			supplier   	@10)
-		    (object ClassView "Class" "WsrvClient" @11
-			location   	(275, 680)
-			label      	(object ItemLabel
-			    location   	(171, 596)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"WsrvClient")
-			annotation 	8)
-		    (object HasView ""
-			client     	@1
-			supplier   	@11)
-		    (object HasView ""
-			client     	@10
-			supplier   	@4)
-		    (object ClassView "Class" "Client" @12
-			location   	(759, 557)
-			label      	(object ItemLabel
-			    location   	(655, 473)
-			    nlines     	2
-			    max_width  	240
-			    justify    	0
-			    label      	"Client")
-			annotation 	8)
-		    (object HasView ""
-			client     	@12
-			supplier   	@9)
-		    (object AssociationView ""
-			client     	@4
-			supplier   	@6)
-		    (object HasView ""
-			client     	@12
-			supplier   	@4)
-		    (object ClassView "Class" "Backup Bitmap" @13
-			location   	(991, 1968)
-			label      	(object ItemLabel
-			    location   	(881, 1877)
-			    nlines     	2
-			    max_width  	256
-			    justify    	0
-			    label      	"Backup Bitmap")
-			width      	372
-			height     	272
-			annotation 	8)
-		    (object AssociationView ""
-			client     	@4
-			supplier   	@13)
-		    (object HasView ""
-			client     	@2
-			supplier   	@13)
-		    (object InheritView ""
-			client     	@9
-			supplier   	@8)
-		    (object InheritView ""
-			client     	@5
-			supplier   	@8)
-		    (object InheritView ""
-			client     	@2
-			supplier   	@9)
-		    (object InheritView ""
-			client     	@13
-			supplier   	@5)
-		    (object InheritView ""
-			client     	@11
-			supplier   	@12)
-		    (object InheritView ""
-			client     	@7
-			supplier   	@3)
-		    (object HasView ""
-			client     	@3
-			supplier   	@5)
-		    (object InheritView ""
-			client     	@12
-			supplier   	@3)
-		    (object HasView ""
-			client     	@3
-			supplier   	@6)
-		    (object HasView ""
-			client     	@1
-			supplier   	@7)
-		    (object UsesView ""
-			client     	@4
-			supplier   	@8)
-		    (object HasView ""
-			client     	@1
-			supplier   	@12)))))
-    root_subsystem 	(object SubSystem "<Top Level>"
-	physical_models 	(list unit_reference_list)
-	physical_presentations 	(list unit_reference_list
-	    (object Module_Diagram "Main"
-		title      	"Main"
-		zoom       	100
-		max_height 	28350
-		max_width  	21600
-		origin_x   	0
-		origin_y   	0
-		items      	(list diagram_item_list))))
-    process_structure 	(object Processes
-	ProcsNDevs 	(list
-	    (object Process_Diagram ""
-		title      	""
-		zoom       	100
-		max_height 	28350
-		max_width  	21600
-		origin_x   	0
-		origin_y   	0
-		items      	(list diagram_item_list))))
-    properties 	(object Properties))
+
+(object Petal
+    version    	35)
+
+(object Design "<Top Level>"
+    is_unit    	TRUE
+    file_name  	"c:\wserv\des\wsv4.mdl"
+    is_loaded  	TRUE
+    defaults   	(object defaults
+	rightMargin 	0.25
+	leftMargin 	0.25
+	topMargin  	0.25
+	bottomMargin 	0.5
+	pageOverlap 	0.25
+	clipIconLabels 	TRUE
+	autoResize 	FALSE
+	snapToGrid 	TRUE
+	gridX      	0
+	gridY      	0
+	defaultFont 	(object Font
+	    size       	12
+	    face       	"helvetica"
+	    bold       	FALSE
+	    italics    	FALSE
+	    underline  	FALSE
+	    strike     	FALSE
+	    color      	0
+	    default_color 	TRUE)
+	showMessageNum 	3)
+    root_category 	(object Class_Category "<Top Level>"
+	exportControl 	"Public"
+	global     	TRUE
+	subsystem  	"<Top Level>"
+	logical_models 	(list unit_reference_list
+	    (object Class "Main"
+		documentation 	"Top level windows server, recieves commands from clients, events from the O/S and timer completions."
+		fields     	(list has_relationship_list
+		    (object Has_Relationship
+			supplier   	"Client"
+			supplier_cardinality 	(value cardinality "n")
+			client_cardinality 	(value cardinality "1"))
+		    (object Has_Relationship
+			supplier   	"WsrvClient"
+			supplier_cardinality 	(value cardinality "1")
+			client_cardinality 	(value cardinality "1"))
+		    (object Has_Relationship
+			supplier   	"System"
+			supplier_cardinality 	(value cardinality "1")
+			client_cardinality 	(value cardinality "1")))
+		cardinality 	(value Cardinality "1"))
+	    (object Class "BackedUpWindow"
+		fields     	(list has_relationship_list
+		    (object Has_Relationship
+			supplier   	"Backup Bitmap"))
+		superclasses 	(list inheritance_relationship_list
+		    (object Inheritance_Relationship
+			supplier   	"Window"))
+		collaborators 	(list association_list
+		    (object Association
+			supplier   	"Bitmap")))
+	    (object Class_Utility "$UNNAMED$0")
+	    (object Class "Owner"
+		fields     	(list has_relationship_list
+		    (object Has_Relationship
+			supplier   	"Bitmap"
+			supplier_cardinality 	(value cardinality "n")
+			client_cardinality 	(value cardinality "1"))
+		    (object Has_Relationship
+			supplier   	"Clock"
+			supplier_cardinality 	(value cardinality "0..n")
+			client_cardinality 	(value cardinality "1"))
+		    (object Has_Relationship
+			supplier   	"Font"
+			supplier_cardinality 	(value cardinality "0..n")
+			client_cardinality 	(value cardinality "1"))))
+	    (object Class "GCB"
+		collaborators 	(list association_list
+		    (object Association
+			supplier   	"Font"
+			supplier_cardinality 	(value cardinality "1")
+			client_cardinality 	(value cardinality "n"))
+		    (object Association
+			supplier   	"Backup Bitmap"
+			supplier_cardinality 	(value cardinality "0..1")
+			client_cardinality 	(value cardinality "n")))
+		used_nodes 	(list uses_relationship_list
+		    (object Uses_Relationship
+			supplier   	"Drawable")))
+	    (object Class "Bitmap"
+		superclasses 	(list inheritance_relationship_list
+		    (object Inheritance_Relationship
+			supplier   	"Drawable"))
+		collaborators 	(list association_list
+		    (object Association
+			supplier   	"System Bitmaps"
+			supplier_cardinality 	(value cardinality "n")
+			client_cardinality 	(value cardinality "1"))))
+	    (object Class "Font"
+		cardinality 	(value Cardinality "1..n"))
+	    (object Class "$UNNAMED$1")
+	    (object Class "System"
+		superclasses 	(list inheritance_relationship_list
+		    (object Inheritance_Relationship
+			supplier   	"Owner")))
+	    (object Class "System Bitmaps"
+		collaborators 	(list association_list
+		    (object Association
+			supplier   	"Main"
+			supplier_cardinality 	(value cardinality "n")
+			client_cardinality 	(value cardinality "0"))
+		    (object Association
+			supplier   	"Bitmap"))
+		cardinality 	(value Cardinality "1"))
+	    (object Class "Drawable"
+		fields     	(list has_relationship_list
+		    (object Has_Relationship
+			supplier   	"Window"))
+		used_nodes 	(list uses_relationship_list
+		    (object Uses_Relationship
+			supplier   	"GCB"
+			supplier_cardinality 	(value cardinality "1")
+			client_cardinality 	(value cardinality "n"))))
+	    (object Class "$UNNAMED$2")
+	    (object Class "Window"
+		superclasses 	(list inheritance_relationship_list
+		    (object Inheritance_Relationship
+			supplier   	
+|Normal 
+|Window
+|
+			)
+		    (object Inheritance_Relationship
+			supplier   	"Drawable")))
+	    (object Class "Normal 
+Window
+")
+	    (object Class "Clock"
+		fields     	(list has_relationship_list
+		    (object Has_Relationship
+			supplier   	"GCB"))
+		used_nodes 	(list uses_relationship_list
+		    (object Uses_Relationship
+			supplier   	"GCB")))
+	    (object Class "System Clocks")
+	    (object Class "WsrvClient"
+		superclasses 	(list inheritance_relationship_list
+		    (object Inheritance_Relationship
+			supplier   	"Client")))
+	    (object Class_Utility "$UNNAMED$3")
+	    (object Class_Utility "$UNNAMED$4")
+	    (object Parameterized_Class "$UNNAMED$5")
+	    (object Instantiated_Class_Utility "$UNNAMED$6")
+	    (object Instantiated_Class "$UNNAMED$7")
+	    (object Parameterized_Class "$UNNAMED$8")
+	    (object Class "Client"
+		fields     	(list has_relationship_list
+		    (object Has_Relationship
+			supplier   	"GCB"
+			supplier_cardinality 	(value cardinality "0..n")
+			client_cardinality 	(value cardinality "1"))
+		    (object Has_Relationship
+			supplier   	"Window"
+			supplier_cardinality 	(value cardinality "0..n")
+			client_cardinality 	(value cardinality "1")))
+		superclasses 	(list inheritance_relationship_list
+		    (object Inheritance_Relationship
+			supplier   	"Owner")))
+	    (object Metaclass "$UNNAMED$9")
+	    (object Class_Utility "$UNNAMED$10")
+	    (object Class "Backup Bitmap"
+		superclasses 	(list inheritance_relationship_list
+		    (object Inheritance_Relationship
+			supplier   	"Bitmap")))
+	    (object Class "$UNNAMED$11")
+	    (object Class "$UNNAMED$12")
+	    (object Class "$UNNAMED$13")
+	    (object Class "$UNNAMED$14")
+	    (object Class_Category "$UNNAMED$15"
+		exportControl 	"Public"
+		logical_models 	(list unit_reference_list)
+		logical_presentations 	(list unit_reference_list))
+	    (object Class_Category "$UNNAMED$16"
+		exportControl 	"Public"
+		logical_models 	(list unit_reference_list)
+		logical_presentations 	(list unit_reference_list)))
+	logical_presentations 	(list unit_reference_list
+	    (object ClassDiagram "Main"
+		title      	"Main"
+		zoom       	72
+		max_height 	28350
+		max_width  	21600
+		origin_x   	0
+		origin_y   	0
+		items      	(list diagram_item_list
+		    (object ClassView "Class" "Main" @1
+			location   	(1053, 177)
+			label      	(object ItemLabel
+			    location   	(944, 87)
+			    nlines     	2
+			    max_width  	255
+			    justify    	0
+			    label      	"Main")
+			width      	370
+			height     	270
+			annotation 	8)
+		    (object ClassView "Class" "BackedUpWindow" @2
+			location   	(468, 1946)
+			label      	(object ItemLabel
+			    location   	(361, 1859)
+			    nlines     	2
+			    max_width  	248
+			    justify    	0
+			    label      	"BackedUpWindow")
+			width      	360
+			height     	260
+			annotation 	8)
+		    (object ClassView "Class" "Owner" @3
+			location   	(1204, 559)
+			label      	(object ItemLabel
+			    location   	(1101, 476)
+			    nlines     	2
+			    max_width  	238
+			    justify    	0
+			    label      	"Owner")
+			width      	345
+			height     	250
+			annotation 	8)
+		    (object ClassView "Class" "GCB" @4
+			location   	(1594, 1447)
+			label      	(object ItemLabel
+			    location   	(1490, 1363)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"GCB")
+			annotation 	8)
+		    (object ClassView "Class" "Bitmap" @5
+			location   	(991, 1575)
+			label      	(object ItemLabel
+			    location   	(887, 1491)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Bitmap")
+			annotation 	8)
+		    (object ClassView "Class" "Font" @6
+			location   	(2195, 1345)
+			label      	(object ItemLabel
+			    location   	(2091, 1261)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Font")
+			annotation 	8)
+		    (object ClassView "Class" "System" @7
+			location   	(1802, 714)
+			label      	(object ItemLabel
+			    location   	(1698, 630)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"System")
+			annotation 	8)
+		    (object ClassView "Class" "Drawable" @8
+			location   	(880, 1170)
+			label      	(object ItemLabel
+			    location   	(776, 1086)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Drawable")
+			annotation 	8)
+		    (object ClassView "Class" "Window" @9
+			location   	(467, 1407)
+			label      	(object ItemLabel
+			    location   	(363, 1323)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Window")
+			annotation 	8)
+		    (object ClassView "Class" "Clock" @10
+			location   	(1430, 988)
+			label      	(object ItemLabel
+			    location   	(1326, 904)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Clock")
+			annotation 	8)
+		    (object HasView ""
+			client     	@3
+			supplier   	@10)
+		    (object ClassView "Class" "WsrvClient" @11
+			location   	(275, 680)
+			label      	(object ItemLabel
+			    location   	(171, 596)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"WsrvClient")
+			annotation 	8)
+		    (object HasView ""
+			client     	@1
+			supplier   	@11)
+		    (object HasView ""
+			client     	@10
+			supplier   	@4)
+		    (object ClassView "Class" "Client" @12
+			location   	(759, 557)
+			label      	(object ItemLabel
+			    location   	(655, 473)
+			    nlines     	2
+			    max_width  	240
+			    justify    	0
+			    label      	"Client")
+			annotation 	8)
+		    (object HasView ""
+			client     	@12
+			supplier   	@9)
+		    (object AssociationView ""
+			client     	@4
+			supplier   	@6)
+		    (object HasView ""
+			client     	@12
+			supplier   	@4)
+		    (object ClassView "Class" "Backup Bitmap" @13
+			location   	(991, 1968)
+			label      	(object ItemLabel
+			    location   	(881, 1877)
+			    nlines     	2
+			    max_width  	256
+			    justify    	0
+			    label      	"Backup Bitmap")
+			width      	372
+			height     	272
+			annotation 	8)
+		    (object AssociationView ""
+			client     	@4
+			supplier   	@13)
+		    (object HasView ""
+			client     	@2
+			supplier   	@13)
+		    (object InheritView ""
+			client     	@9
+			supplier   	@8)
+		    (object InheritView ""
+			client     	@5
+			supplier   	@8)
+		    (object InheritView ""
+			client     	@2
+			supplier   	@9)
+		    (object InheritView ""
+			client     	@13
+			supplier   	@5)
+		    (object InheritView ""
+			client     	@11
+			supplier   	@12)
+		    (object InheritView ""
+			client     	@7
+			supplier   	@3)
+		    (object HasView ""
+			client     	@3
+			supplier   	@5)
+		    (object InheritView ""
+			client     	@12
+			supplier   	@3)
+		    (object HasView ""
+			client     	@3
+			supplier   	@6)
+		    (object HasView ""
+			client     	@1
+			supplier   	@7)
+		    (object UsesView ""
+			client     	@4
+			supplier   	@8)
+		    (object HasView ""
+			client     	@1
+			supplier   	@12)))))
+    root_subsystem 	(object SubSystem "<Top Level>"
+	physical_models 	(list unit_reference_list)
+	physical_presentations 	(list unit_reference_list
+	    (object Module_Diagram "Main"
+		title      	"Main"
+		zoom       	100
+		max_height 	28350
+		max_width  	21600
+		origin_x   	0
+		origin_y   	0
+		items      	(list diagram_item_list))))
+    process_structure 	(object Processes
+	ProcsNDevs 	(list
+	    (object Process_Diagram ""
+		title      	""
+		zoom       	100
+		max_height 	28350
+		max_width  	21600
+		origin_x   	0
+		origin_y   	0
+		items      	(list diagram_item_list))))
+    properties 	(object Properties))
--- a/windowing/windowserver/SERVER/openwfc/panics.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/SERVER/openwfc/panics.h	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -162,6 +162,10 @@
 	EWsPanicInvalidRotation = 127,			//Invalid rotation used
 	EWsPanicInvalidPointerOffset = 128,      //The pointer offset value in wsini.ini is invalid.
 	EWsPanicArrayInsertFailed = 129,	//Array insert failed.           
+	EWsPanicAccessBeyondCommandBuf = 130,	//Access beyond wserv command buffer
+	EWsPanicKeyEventRouterBadResult = 131,		// Invalid result code from key event routing plug-in
+	EWsPanicKeyEventRouterBadWindowGroup = 132,	// Invalid destination window group from key event routing plug-in
+	EWsPanicKeyEventRouterLeave = 133,			// Invalid leave from Key event routing plug-in
 	};
 
 void Panic(TWservPanic aPanic);
--- a/windowing/windowserver/SERVER/w32cmd.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/SERVER/w32cmd.h	Fri Jul 16 11:45:55 2010 +0300
@@ -266,6 +266,7 @@
 	EWsClOpUnregisterAllTFXEffect,
 	EWsClOpOverrideEffectBuf,
 	EWsClOpOverrideEffectIPC,
+	EWsClOpIndicateAppOrientation,
 	EWsClOpLastEnumValue //Keep this at the end - used by test code
 	};
 	
@@ -1059,6 +1060,7 @@
 	const TWsClCmdRegisterEffect* RegisterEffect;
 	const TWsClCmdUnRegisterEffect* UnRegisterEffect; 
 	const TWsClCmdOverrideEffect* OverrideEffect;
+	const TRenderOrientation* Orientation;
 	};
 
 // Window command structures
@@ -2132,6 +2134,7 @@
 	// Under WINS character code is passed in as HIWORD of the scan code,
 	// and will need to be removed in some situations
 	#define __REMOVE_WINS_CHARCODE &0x0000FFFF
+	#define __WINS_CHARCODE(c)	((c) & 0xFFFF0000)
 #else
 	#define __REMOVE_WINS_CHARCODE
 #endif
--- a/windowing/windowserver/TClick/CLICK.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,708 +0,0 @@
-// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test Key Click Plug-In DLL
-// 
-//
-
-#include <e32std.h>
-#include "W32CLICK.H"
-#include "CLICK.H"
-#include <graphics/pointereventdata.h>
-#if defined(__WINS__)
-	#include <emulator.h>
-	#include "LOGWIN.H"
-#endif
-
-#define bufSize 64
-
-GLREF_D struct TSharedMemory GSharedMemory;
-
-class MClickMaker
-	{
-public:
-	virtual void KeyEvent(TEventCode aType,const TKeyEvent& aEvent)=0;
-	virtual void PointerEvent(const TPointerEvent& aEvent)=0;
-	virtual void OtherEvent(TInt aType,TAny* aParam)=0;
-	};
-
-struct TGpWinInfo
-	{
-	TBool iInUse;
-	TInt iServerValue;
-	TInt iNumGroups;
-	};
-
-struct TGpWinIdData
-	{
-	TInt iId;
-	TInt iClient;
-	};
-
-NONSHARABLE_CLASS(TLogClicks) : public MClickMaker
-	{
-public:
-	void StartLoggingL();
-	inline TBool IsLogging() {return iLogging;}
-	//Pure virtual functions from MClickMaker
-	void KeyEvent(TEventCode aType,const TKeyEvent& aEvent);
-	void PointerEvent(const TPointerEvent& aEvent);
-    void OtherEvent(TInt aType,TAny* aParam=NULL);
-private:
-	TBool iLogging;
-	};
-
-NONSHARABLE_CLASS(CEventClicks) : public CBase, public MClickMaker
-	{
-	enum {
-		EEventBufferSize=32,
-		EMaxGroupWinClients=6,
-		EMaxGroupWinIdData=12
-		};
-public:
-	void ConstructL();
-	TInt Add(TWsEvent* aEvent);
-	inline TInt Failed() {return iFailed;}
-	inline TInt Events() {return iEventsTested;}
-	void Reset();
-	void ExtendedPointerEvent(const TPointerEventData& aPointerEvent);
-	void ExpectNewWindowGroup(TInt aClient);
-	void NewWindowGroup(const TGroupWindowOpenData& aGpWinOpen);
-	void CheckGpWinId(TInt aId);
-	void ExpectCloseWindowGroup(TInt aId);
-	void CloseWindowGroup(TInt aId);
-	void ExpectCloseWindow(TWindowCloseData& aCloseWin);
-	void CloseWindow(TWindowCloseData& aCloseWin);
-	void PointerEventInfo(TPointerEventInfo& aPointerEventInfo);	
-	//Pure virtual functions from MClickMaker
-	void KeyEvent(TEventCode aType,const TKeyEvent& aEvent);
-	void PointerEvent(const TPointerEvent& aEvent);
-	void OtherEvent(TInt aType,TAny* aParam=NULL);
-private:
-	TBool GetEvent(TWsEvent& aEvent);
-	void Fail();
-	void AddGroupWindowId(TInt aClient,TInt aGpWinId);
-	void RemoveGroupWindowId(TInt aGpWinId);
-private:
-	CCirBuf<TWsEvent> iEventBuffer;
-	TInt iFailed;
-	TInt iEventsTested;
-	TInt iFailedAt;
-	TGpWinInfo iGroupWins[EMaxGroupWinClients];
-	TGpWinIdData iGroupWinIds[EMaxGroupWinIdData];
-	TInt iExpectedEvent;
-	TInt iExpectedEventData;
-	TInt iExpectedHandle;
-	TPointerEventInfo iExpectedPointerEventInfo;
-	TInt iLastNewGpWinId;
-	TAdvancedPointerEvent iLastPointerEvent;
-	TBool iExpectingExtendedPointer;
-	};
-
-NONSHARABLE_CLASS(CMyClickMaker) : public CClickMaker
-	{
-public:
-	~CMyClickMaker();
-	void ConstructL();
-	//Virtual function from CClickMaker
-	void KeyEvent(TEventCode aType,const TKeyEvent& aEvent);
-	void PointerEvent(const TPointerEvent& aEvent);
-	void OtherEvent(TInt aType,TAny* aParam);
-	TInt CommandReplyL(TInt aOpcode, TAny *aArgs);
-private:
-	void LogToWindowL();
-private:
-	TClickOutputModes iMode;
-	MClickMaker* iCurrentClick;
-	TLogClicks iLogClicks;
-	CEventClicks* iEventClicks;
-	};
-
-
-/*TLogClicks*/
-
-void TLogClicks::StartLoggingL()
-	{
-#if defined(__WINS__)
-	if (!IsLogging())
-		{
-		CreateLogWinThreadL();
-		iLogging=ETrue;
-		}
-#else
-	User::Leave(KErrNotSupported);
-#endif
-	}
-
-void TLogClicks::KeyEvent(TEventCode aType,const TKeyEvent& aEvent)
-	{
-	_LIT(KKeyDown,		"KEY DOWN   ");
-	_LIT(KKeyUp,		"KEY UP     ");
-	_LIT(KKeyEvent,		"KEY EVENT  ");
-	_LIT(KKeyRepeat,	"KEY REPEAT ");
-	_LIT(KKeyUnknown,	"KEY Unknown");
-	_LIT(KKeyDataFormatChar,"'%c',");
-	_LIT(KKeyDataFormatCode," Code=%u,");
-	_LIT(KKeyDataFormatScan," Scan=%d,");
-	_LIT(KKeyDataFormatModRep," Mod=0x%x, Rep=%d");
-	TBuf<bufSize> bufPlusZero;
-	switch (aType)
-		{
-	case EEventKey:
-		bufPlusZero.Copy(KKeyEvent);
-		break;
-	case EEventKeyUp:
-		bufPlusZero.Copy(KKeyUp);
-		break;
-	case EEventKeyDown:
-		bufPlusZero.Copy(KKeyDown);
-		break;
-	case EEventKeyRepeat:
-		bufPlusZero.Copy(KKeyRepeat);
-		break;
-	default:
-		bufPlusZero.Copy(KKeyUnknown);
-		break;
-		}
-	bufPlusZero.AppendFormat(KKeyDataFormatCode,aEvent.iCode);
-	if (aEvent.iCode!=0)
-		bufPlusZero.AppendFormat(KKeyDataFormatChar,aEvent.iCode);
-	bufPlusZero.AppendFormat(KKeyDataFormatScan,aEvent.iScanCode);
-	if (aEvent.iScanCode!=0)
-		bufPlusZero.AppendFormat(KKeyDataFormatChar,aEvent.iScanCode);
-	bufPlusZero.AppendFormat(KKeyDataFormatModRep,aEvent.iModifiers,aEvent.iRepeats);
-	bufPlusZero.ZeroTerminate();
-#if defined(__WINS__)
-	Emulator::Escape();
-	SendMessage(GSharedMemory.iHwnd, WM_USER+EAppendText, (bufPlusZero.Length()+1)*sizeof(TText), (TInt32)(bufPlusZero.Ptr()));
-	Emulator::Reenter();
-#endif
-	}
-
-void TLogClicks::PointerEvent(const TPointerEvent& aEvent)
-	{
-	_LIT(KButtonDown,	"POINTER DOWN ");
-	_LIT(KButtonUp,		"POINTER UP   ");
-	_LIT(KButton2Down,	"BUTTON 2 DOWN");
-	_LIT(KButton2Up,	"BUTTON 2 UP  ");
-	_LIT(KButton3Down,	"BUTTON 3 DOWN");
-	_LIT(KButton3Up,	"BUTTON 3 UP  ");
-	_LIT(KButtonDrag,	"POINTER DRAG ");
-	_LIT(KButtonMove,	"POINTER MOVE ");
-	_LIT(KButtonRepeat,	"BUTTON REPEAT");
-	_LIT(KSwitchOn,		"POINTER ON   ");
-	_LIT(KUnknown,		"PTR Unknown  ");
-	//_LIT(KPtrDataFormat," Pos=(%d,%d), ScrPos=(%d,%d), Modifiers=%x");
-	_LIT(KPtrDataFormat," Pos=(%d,%d), ScrPos=(%d,%d), Mod=%x");
-	TBuf<bufSize> bufPlusZero;
-	switch (aEvent.iType)
-		{
-	case TPointerEvent::EButton1Down:
-		bufPlusZero.Copy(KButtonDown);
-		break;
-	case TPointerEvent::EButton1Up:
-		bufPlusZero.Copy(KButtonUp);
-		break;
-	case TPointerEvent::EButton2Down:
-		bufPlusZero.Copy(KButton2Down);
-		break;
-	case TPointerEvent::EButton2Up:
-		bufPlusZero.Copy(KButton2Up);
-		break;
-	case TPointerEvent::EButton3Down:
-		bufPlusZero.Copy(KButton3Down);
-		break;
-	case TPointerEvent::EButton3Up:
-		bufPlusZero.Copy(KButton3Up);
-		break;
-	case TPointerEvent::EDrag:
-		bufPlusZero.Copy(KButtonDrag);
-		break;
-	case TPointerEvent::EMove:
-		bufPlusZero.Copy(KButtonMove);
-		break;
-	case TPointerEvent::EButtonRepeat:
-		bufPlusZero.Copy(KButtonRepeat);
-		break;
-	case TPointerEvent::ESwitchOn:
-		bufPlusZero.Copy(KSwitchOn);
-		break;
-	default:
-		bufPlusZero.Copy(KUnknown);
-		break;
-		}
-	bufPlusZero.AppendFormat(KPtrDataFormat,aEvent.iPosition.iX,aEvent.iPosition.iY
-																,aEvent.iParentPosition.iX,aEvent.iParentPosition.iY,aEvent.iModifiers);
-	bufPlusZero.ZeroTerminate();
-#if defined(__WINS__)
-	Emulator::Escape();
-	SendMessage(GSharedMemory.iHwnd, WM_USER+EAppendText, (bufPlusZero.Length()+1)*sizeof(TText), (TInt32)(bufPlusZero.Ptr()));
-	Emulator::Reenter();
-#endif
-	}
-
-void TLogClicks::OtherEvent(TInt aType,TAny* aParam)
-	{
-	_LIT(KPointer,"POINTER EVENT Ver=%d, ScrPos=(%d,%d), WinClientHandle=0x%x, WinOrigin=%d, WinGpId=%d");
-	_LIT(KScreenDeviceChanged,"SCREEN DEVICE CHANGED EVENT, Mode=%d");
-	_LIT(KGroupWindowOpen,"GROUP WINDOW OPEN EVENT WinGpId=%d, Client=%d, NumWinGps=%d");
-	_LIT(KGroupWindowClose,"GROUP WINDOW CLOSE EVENT WinGpId=%d");
-	_LIT(KWindowClose,"WINDOW CLOSE EVENT Client=%d, WinGpId=%d");
-	_LIT(KEventUnknown,	"EVENT Unknown");
-	TBuf<bufSize> bufPlusZero;
-	switch (aType)
-		{
-	case EEventPointer:
-		{
-		TPointerEventData& data=*static_cast<TPointerEventData*>(aParam);
-		bufPlusZero.Format(KPointer,data.iVersion,data.iCurrentPos.iX,data.iCurrentPos.iY,data.iClientHandle
-										,data.iWindowOrigin.iX,data.iWindowOrigin.iY,data.iWindowGroupId);
-		}
-		break;
-	case EEventScreenDeviceChanged:
-		{
-		TClickMakerData& data=*static_cast<TClickMakerData*>(aParam);
-		bufPlusZero.Format(KScreenDeviceChanged,data.screenDeviceMode);
-		}
-		break;
-	case EEventGroupWindowOpen:
-		{
-		TGroupWindowOpenData& data=*static_cast<TGroupWindowOpenData*>(aParam);
-		bufPlusZero.Format(KGroupWindowOpen,data.iIdentifier,data.iClient,data.iNumClientWindowGroups);
-		}
-		break;
-	case EEventGroupWindowClose:
-		bufPlusZero.Format(KGroupWindowClose,reinterpret_cast<TInt&>(aParam));
-		break;
-	case EEventWindowClose:
-		{
-		TWindowCloseData& data=*static_cast<TWindowCloseData*>(aParam);
-		bufPlusZero.Format(KWindowClose,data.iClientHandle,data.iWindowGroupId);
-		}
-		break;
-	default:
-		bufPlusZero.Copy(KEventUnknown);
-		break;
-		}
-	bufPlusZero.ZeroTerminate();
-#if defined(__WINS__)
-	Emulator::Escape();
-	SendMessage(GSharedMemory.iHwnd, WM_USER+EAppendText, (bufPlusZero.Length()+1)*sizeof(TText), (TInt32)(bufPlusZero.Ptr()));
-	Emulator::Reenter();
-#endif
-	}
-
-/*CEventClicks*/
-
-void CEventClicks::ConstructL()
-	{
-	iEventBuffer.SetLengthL(EEventBufferSize);
-	}
-
-TInt CEventClicks::Add(TWsEvent* aEvent)
-	{
-	return (iEventBuffer.Add(aEvent) ? KErrNone:KErrOverflow);
-	}
-
-void CEventClicks::Reset()
-	{
-	iFailed=EFalse;
-	iEventsTested=0;
-	iExpectedEvent=0;
-	iLastNewGpWinId=0;
-	}
-
-void CEventClicks::ExtendedPointerEvent(const TPointerEventData& aPointerEvent)
-	{
-	if (!iExpectingExtendedPointer)
-		{
-		Fail();
-		return;
-		}
-	iExpectingExtendedPointer=EFalse;
-	TBool match=ETrue;
-	if (0!=aPointerEvent.iVersion)
-		match=EFalse;
-	if (iLastPointerEvent.iType!=aPointerEvent.iPointerEvent.iType)
-		match=EFalse;
-	if (iLastPointerEvent.iModifiers!=aPointerEvent.iPointerEvent.iModifiers)
-		match=EFalse;
-	if (iLastPointerEvent.iPosition!=aPointerEvent.iPointerEvent.iPosition)
-		match=EFalse;
-	if (iLastPointerEvent.iParentPosition!=aPointerEvent.iCurrentPos)
-		match=EFalse;
-	if (TPointerEventData::EUnspecified!=aPointerEvent.iSource)
-		match=EFalse;
-	if (iExpectedPointerEventInfo.iClientHandle && iExpectedPointerEventInfo.iWinGpId>0)
-		{
-		if (iLastPointerEvent.iParentPosition-iExpectedPointerEventInfo.iParentOrigin
-										!=aPointerEvent.iPointerEvent.iParentPosition)
-			match=EFalse;
-		if (iExpectedPointerEventInfo.iParentOrigin+iExpectedPointerEventInfo.iWinOrigin
-															!=aPointerEvent.iWindowOrigin)
-			match=EFalse;
-		if (iExpectedPointerEventInfo.iClientHandle!=aPointerEvent.iClientHandle)
-			match=EFalse;
-		if (iExpectedPointerEventInfo.iWinGpId!=aPointerEvent.iWindowGroupId)
-			match=EFalse;
-		}
-	if (!match)
-		Fail();
-	}
-
-void CEventClicks::ExpectNewWindowGroup(TInt aClient)
-	{
-	if (iExpectedEvent>0)
-		Fail();
-	iExpectedEvent=EEventGroupWindowOpen;
-	iExpectedEventData=aClient;
-	}
-
-void CEventClicks::NewWindowGroup(const TGroupWindowOpenData& aGpWinOpen)
-	{
-	iLastNewGpWinId=aGpWinOpen.iIdentifier;
-	if (iExpectedEvent!=EEventGroupWindowOpen)
-		{
-		Fail();
-		return;
-		}
-	iExpectedEvent=0;
-	if (iExpectedEventData>=EMaxGroupWinClients)
-		return;
-	AddGroupWindowId(iExpectedEventData,iLastNewGpWinId);
-	TGpWinInfo& gpWinInfo=iGroupWins[iExpectedEventData];
-	if (gpWinInfo.iInUse)
-		{
-		if (aGpWinOpen.iClient!=gpWinInfo.iServerValue)
-			Fail();
-		else 
-			{
-			if (aGpWinOpen.iNumClientWindowGroups!=gpWinInfo.iNumGroups)
-				Fail();
-			++gpWinInfo.iNumGroups;
-			}
-		}
-	else
-		{
-		gpWinInfo.iInUse=ETrue;
-		gpWinInfo.iServerValue=aGpWinOpen.iClient;
-		gpWinInfo.iNumGroups=aGpWinOpen.iNumClientWindowGroups+1;
-		}
-	}
-
-void CEventClicks::CheckGpWinId(TInt aId)
-	{
-	if (iLastNewGpWinId!=aId)
-		Fail();
-	}
-
-void CEventClicks::ExpectCloseWindowGroup(TInt aId)
-	{
-	if (iExpectedEvent>0)
-		Fail();
-	iExpectedEvent=EEventGroupWindowClose;
-	iExpectedEventData=aId;
-	}
-
-void CEventClicks::CloseWindowGroup(TInt aId)
-	{
-	if (iExpectedEvent!=EEventGroupWindowClose || iExpectedEventData!=aId)
-		Fail();
-	if (iExpectedEvent==EEventGroupWindowClose)
-		iExpectedEvent=0;
-	RemoveGroupWindowId(aId);
-	}
-
-void CEventClicks::ExpectCloseWindow(TWindowCloseData& aCloseWin)
-	{
-	if (iExpectedEvent>0)
-		Fail();
-	iExpectedEvent=EEventWindowClose;
-	iExpectedEventData=aCloseWin.iWindowGroupId;
-	iExpectedHandle=aCloseWin.iClientHandle;
-	}
-
-void CEventClicks::CloseWindow(TWindowCloseData& aCloseWin)
-	{
-	if (iExpectedEvent!=EEventWindowClose || iExpectedEventData!=aCloseWin.iWindowGroupId || iExpectedHandle!=aCloseWin.iClientHandle)
-		Fail();
-	if (iExpectedEvent==EEventWindowClose)
-		iExpectedEvent=0;
-	}
-
-void CEventClicks::PointerEventInfo(TPointerEventInfo& aPointerEventInfo)
-	{
-	iExpectedPointerEventInfo=aPointerEventInfo;
-	}
-
-TBool CEventClicks::GetEvent(TWsEvent& aEvent)
-	{
-	++iEventsTested;
-	if (iEventBuffer.Remove(&aEvent)<1)
-		{
-		Fail();
-		return ETrue;
-		}
-	return EFalse;
-	}
-
-void CEventClicks::Fail()
-	{
-	if (!iFailed)
-		{
-		iFailed=iEventsTested;
-		}
-	}
-
-void CEventClicks::AddGroupWindowId(TInt aClient,TInt aGpWinId)
-	{
-	TInt ii=0;
-	while (ii<EMaxGroupWinIdData && iGroupWinIds[ii].iId>0)
-		++ii;
-	if (ii<EMaxGroupWinIdData)
-		{
-		iGroupWinIds[ii].iId=aGpWinId;
-		iGroupWinIds[ii].iClient=aClient;
-		}
-	}
-
-void CEventClicks::RemoveGroupWindowId(TInt aGpWinId)
-	{
-	TInt ii=0;
-	while (ii<EMaxGroupWinIdData && iGroupWinIds[ii].iId!=aGpWinId)
-		++ii;
-	if (ii<EMaxGroupWinIdData)
-		{
-		--iGroupWins[iGroupWinIds[ii].iClient].iNumGroups;
-		iGroupWinIds[ii].iId=0;
-		}
-	}
-
-#define MODIFIER_FLAGS_TO_IGNOR EModifierNumLock
-#pragma warning(disable : 4245)		//'initializing' : conversion from 'int' to 'unsigned int', signed/unsigned mismatch
-void CEventClicks::KeyEvent(TEventCode aType,const TKeyEvent& aEvent)
-	{
-	TBool pass;
-	TEventCode eType=aType;
-	switch (aType)
-		{
-	case EEventKey:
-		pass=(aEvent.iRepeats==0);
-		break;
-	case EEventKeyUp:
-	case EEventKeyDown:
-		pass=(aEvent.iCode==0) && (aEvent.iRepeats==0);
-		break;
-	case EEventKeyRepeat:
-		pass=(aEvent.iRepeats>0);
-		eType=EEventKey;
-		break;
-	default:
-		pass=EFalse;
-		}
-	if (!pass)
-		{
-		Fail();
-		return;
-		}
-	TWsEvent eEvent;
-	if (GetEvent(eEvent))
-		return;
-	if (eEvent.Type()!=eType)
-		{
-		Fail();
-		return;
-		}
-	TKeyEvent keyEvent=*eEvent.Key();
-	TUint mask=~(EModifierAutorepeatable|MODIFIER_FLAGS_TO_IGNOR);
-	if (keyEvent.iCode!=aEvent.iCode || (keyEvent.iModifiers&mask)!=(aEvent.iModifiers&mask) || keyEvent.iScanCode!=aEvent.iScanCode
-																						|| (keyEvent.iRepeats==0)!=(aEvent.iRepeats==0))
-		{
-		Fail();
-		return;
-		}
-	}
-
-void CEventClicks::PointerEvent(const TPointerEvent& aEvent)
-	{
-	// Click events are now all advanced events so in order to test the modifier bits
-	// appropriately we need to copy them as TAdvancedPointerEvent not TPointerEvent
-	if(!aEvent.IsAdvancedPointerEvent())
-		{
-		Fail();
-		return;
-		}
-	iLastPointerEvent=*aEvent.AdvancedPointerEvent();
-		
-	if (iExpectingExtendedPointer)
-		Fail();
-	else
-		iExpectingExtendedPointer=ETrue;
-	TWsEvent eEvent;
-	if (GetEvent(eEvent))
-		return;
-	TAdvancedPointerEvent pEvent=*eEvent.Pointer();
-	TUint mask=~(MODIFIER_FLAGS_TO_IGNOR);
-	if (pEvent.iType!=aEvent.iType || (pEvent.iModifiers&mask)!=(aEvent.iModifiers&mask)
-												|| pEvent.iPosition!=aEvent.iPosition || pEvent.iParentPosition!=aEvent.iParentPosition)
-		{
-		Fail();
-		return;
-		}
-	}
-
-void CEventClicks::OtherEvent(TInt aType,TAny* aParam)
-	{
-	TBool pass=ETrue;
-	if (aType!=EEventPointer)
-		++iEventsTested;
-	switch (aType)
-		{
-	case EEventPointer:
-		ExtendedPointerEvent(*static_cast<TPointerEventData*>(aParam));
-		break;
-	case EEventScreenDeviceChanged:
-		break;
-	case EEventGroupWindowOpen:
-		NewWindowGroup(*static_cast<TGroupWindowOpenData*>(aParam));
-		break;
-	case EEventGroupWindowClose:
-		CloseWindowGroup(reinterpret_cast<TInt>(aParam));
-		break;
-	case EEventWindowClose:
-		CloseWindow(*static_cast<TWindowCloseData*>(aParam));
-		break;
-	default:
-		pass=EFalse;
-		}
-	if (!pass)
-		Fail();
-	//GetEvent() is not call here because CWsGroupWindow::EnableScreenChangeEvents() could not be 
-	//been called.This mean that no EEventScreenDeviceChanged will be put in the client queue.
-	//Instead this event will be always passed to the click plugin if this is present.
-	}
-#pragma warning(default : 4245)
-
-
-/*CMyClickMaker*/
-
-CMyClickMaker::~CMyClickMaker()
-	{
-	delete iEventClicks;
-	}
-
-void CMyClickMaker::ConstructL()
-	{
-	iMode=EClickNone;
-	iEventClicks=new(ELeave) CEventClicks();
-	iEventClicks->ConstructL();
-	}
-
-void CMyClickMaker::KeyEvent(TEventCode aType,const TKeyEvent& aEvent)
-	{
-	if (iCurrentClick)
-		iCurrentClick->KeyEvent(aType,aEvent);
-	}
-
-void CMyClickMaker::PointerEvent(const TPointerEvent& aEvent)
-	{
-	if (iCurrentClick)
-		iCurrentClick->PointerEvent(aEvent);
-	}
-
-void CMyClickMaker::OtherEvent(TInt aType,TAny* aParam)
-	{
-	if (iCurrentClick)
-		iCurrentClick->OtherEvent(aType,aParam);
-	}
-
-TInt CMyClickMaker::CommandReplyL(TInt aOpcode,TAny* aArgs)
-	{
-	switch (aOpcode)
-		{
-	case EClickCommandToggleOutput:
-		switch (iMode)
-			{
-		case EClickNone:
-			LogToWindowL();
-			break;
-		case EClickCheck:
-		case EClickToWindow:
-			iMode=EClickNone;
-			iCurrentClick=NULL;
-			break;
-			}
-		break;
-	case EClickCommandSetOutput:
-		iMode=*STATIC_CAST(TClickOutputModes*,aArgs);
-		switch (iMode)
-			{
-		case EClickNone:
-			iCurrentClick=NULL;
-			break;
-		case EClickCheck:
-			iCurrentClick=iEventClicks;
-			iEventClicks->Reset();
-			break;
-		case EClickToWindow:
-			LogToWindowL();
-			break;
-			}
-		break;
-	case EClickEventAdd:
-		return iEventClicks->Add(STATIC_CAST(TWsEvent*,aArgs));
-	case EClickFailed:
-		return iEventClicks->Failed();
-	case EClickEvents:
-		return iEventClicks->Events();
-	case EClickReset:
-		iEventClicks->Reset();
-		break;
-	case EClickCreateGroupWin:
-		iEventClicks->ExpectNewWindowGroup(*static_cast<TInt*>(aArgs));
-		break;
-	case EClickCheckGpWinId:
-		iEventClicks->CheckGpWinId(*static_cast<TInt*>(aArgs));
-		break;
-	case EClickCloseGroupWin:
-		iEventClicks->ExpectCloseWindowGroup(*static_cast<TInt*>(aArgs));
-		break;
-	case EClickCloseWin:
-		iEventClicks->ExpectCloseWindow(*static_cast<TWindowCloseData*>(aArgs));
-		break;
-	case EClickPointerEvent:
-		iEventClicks->PointerEventInfo(*static_cast<TPointerEventInfo*>(aArgs));
-		break;
-	default:;
-		}
-	return KErrNone;
-	}
-
-void CMyClickMaker::LogToWindowL()
-	{
-	iMode=EClickNone;
-	iCurrentClick=NULL;
-	iLogClicks.StartLoggingL();
-	iMode=EClickToWindow;
-	iCurrentClick=&iLogClicks;
-	}
-
-
-EXPORT_C CClickMaker* CreateClickMakerL()
-	{
-	CMyClickMaker* plugIn=new(ELeave) CMyClickMaker;
-	CleanupStack::PushL(plugIn);
-	plugIn->ConstructL();
-	CleanupStack::Pop(plugIn);
-	return plugIn;
-	}
--- a/windowing/windowserver/TClick/CLICK.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Client interface to the click plugin.
-// 
-//
-
-#ifndef __CLICK_H__
-#define __CLICK_H__
-
-#define CLICK_THIRD_UID 268455780
-
-enum TClickOutputModes
-	{
-	EClickNone,
-	EClickCheck,
-	EClickToWindow,		//For WINS only
-	};
-
-enum TClickCommands
-	{
-	// Control Between Plug-in Types
-	EClickCommandToggleOutput=1,
-	EClickCommandSetOutput,
-	// Key and Pointer Testing
-	EClickEventAdd=100,
-	EClickFailed,
-	EClickEvents,
-	EClickReset,
-	// Other Event Testing
-	EClickCreateGroupWin=200,
-	EClickCheckGpWinId,
-	EClickCloseGroupWin,
-	EClickCloseWin,
-	EClickPointerEvent,
-	};
-
-class TPointerEventInfo
-	{
-public:
-	TInt iClientHandle;
-	TInt iWinGpId;
-	TPoint iWinOrigin;		//Relative to parent
-	TPoint iParentOrigin;	//Relative to screen
-	};
-
-#endif	//__CLICK_H__
--- a/windowing/windowserver/TClick/LOGWIN.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,304 +0,0 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Extracted from DEBLOGWN.CPP
-// Code to run the WIN32 windows with the output
-// 
-//
-
-#include <e32std.h>
-#include <e32base.h>
-#include <emulator.h>
-#include "LOGWIN.H"
-
-GLDEF_D struct TSharedMemory GSharedMemory;
-//GLDEF_D struct HWND__ *Hwnd;
-//LOCAL_D RSemaphore Sem;
-
-const TUint KHeapSize=0x8000;
-
-
-TInt numLines(const CArrayVarSeg<TText> &aTextArray, TBool aOutOfMemory)
-	{
-	return (TInt)(aOutOfMemory)?
-				aTextArray.Count():
-				aTextArray.Count()-1;
-	}
-
-TInt numVisibleLines(TInt aHeight, TInt aTextHeight)
-	{
-	return aHeight/aTextHeight;
-	}
-
-TInt32 __stdcall WndProc(struct HWND__ *aHwnd, TUint aMessage, TUint wParam, TInt32 lParam)
-    {
-    HDC hdc;
-    PAINTSTRUCT ps;
-	HFONT hfont;
-    RECT rect;
-	TInt i,
-		paintMin,
-		paintMax;
-	static LOGFONT logFont;
-	static TEXTMETRIC tm;
-	static TInt textHeight,
-		width,
-		height,
-		scrollMin=0,
-		scrollMax,
-		numLinesAbove=scrollMin,
-		prevNumLinesAbove;
-	static CArrayVarSeg<TText> *pmsg;
-	static TBool outOfMemory=EFalse;
-
-    switch (aMessage)
-        {
-    case WM_CREATE:
-		hdc=GetDC(aHwnd);
-
-		pmsg=new(ELeave) CArrayVarSeg<TText>(20);
-		{
-		TBuf<0x20> errorMsg;
-		errorMsg=_L("ERROR: out of memory");
-		errorMsg.ZeroTerminate();
-		TRAPD(err,pmsg->AppendL(*errorMsg.Ptr(), (errorMsg.Length()+1)*sizeof(TText)));
-		if (err!=KErrNone)
-			return(err);
-		}
-		GetTextMetrics(hdc, &tm);
-		textHeight=tm.tmHeight+tm.tmExternalLeading;
-        GetClientRect(aHwnd, &rect);
-		width=rect.right;
-		height=rect.bottom;
-		scrollMax=numLines(*pmsg, outOfMemory);
-		SetScrollPos(aHwnd, SB_VERT, numLinesAbove, TRUE);
-		SetScrollRange(aHwnd, SB_VERT, scrollMin, scrollMax, FALSE);
-		logFont.lfHeight=8;
-		wsprintf(logFont.lfFaceName, (LPCTSTR)_S("courier"));
-
-		ReleaseDC(aHwnd, hdc);
-		return 0;
-	case WM_USER+EAppendText:
-		{
-		TRAPD(err,pmsg->InsertL(pmsg->Count()-1, *(TText *)lParam, wParam));
-		if (err!=KErrNone)
-			{
-			pmsg->Delete(0, Max(0, (TInt)pmsg->Count()-1));
-			numLinesAbove=scrollMax=scrollMin;
-			SetScrollPos(aHwnd, SB_VERT, numLinesAbove, TRUE);
-			SetScrollRange(aHwnd, SB_VERT, scrollMin, scrollMax, FALSE);
-			hdc=GetDC(aHwnd);
-			PatBlt(hdc, 0, 0, width, height, WHITENESS);
-			ReleaseDC(aHwnd, hdc);
-			return(err);
-			}
-		// adjust the scroll position so that the last line added is visible
-		if (numLinesAbove<numLines(*pmsg, outOfMemory)-numVisibleLines(height, textHeight))
-			{
-			prevNumLinesAbove=numLinesAbove;
-			numLinesAbove=numLines(*pmsg, outOfMemory)-numVisibleLines(height, textHeight);
-			scrollMax=numLines(*pmsg, outOfMemory);
-			SendMessage(aHwnd, WM_USER+EScrollToPos, 0, 0L);
-			}
-		else
-			{
-			hdc=GetDC(aHwnd);
-			hfont=(HFONT)SelectObject(hdc, CreateFontIndirect(&logFont));
-			TText *text=&((*pmsg)[scrollMax]);
-			TextOut(hdc, 0, (scrollMax-numLinesAbove)*textHeight, (LPCTSTR)text, User::StringLength(text));
-			scrollMax=numLines(*pmsg, outOfMemory);
-			ReleaseDC(aHwnd, hdc);
-			}
-		return KErrNone;
-		}
-	case WM_USER+EScrollToPos:
-		SetScrollPos(aHwnd, SB_VERT, numLinesAbove, TRUE);
-		SetScrollRange(aHwnd, SB_VERT, scrollMin, scrollMax, FALSE);
-
-		hdc=GetDC(aHwnd);
-		hfont=(HFONT)SelectObject(hdc, CreateFontIndirect(&logFont));
-
-		if (numLinesAbove>prevNumLinesAbove)
-		// scrolling towards end, therefore text moves up on screen
-			{
-			TInt numLinesToDraw=numLinesAbove-prevNumLinesAbove;
-			TInt numLinesToBlt=numVisibleLines(height, textHeight)-numLinesToDraw;
-			if (numLinesToBlt>0)
-				ScrollWindow(aHwnd, 0, -numLinesToDraw*textHeight, NULL, NULL);
-			PatBlt(hdc, 0, numLinesToBlt*textHeight, width, numLinesToDraw*textHeight, WHITENESS);
-			paintMin=Max(Min(numLinesAbove+numLinesToBlt, scrollMax), scrollMin);
-			paintMax=Min(paintMin+numLinesToDraw, scrollMax);
-			for (i=paintMin; i<paintMax; i++)
-				{
-				TText *text=&((*pmsg)[i]);
-				TextOut(hdc, 0, (i-numLinesAbove)*textHeight, (LPCTSTR)text, User::StringLength(text));
-				}
-			}
-		else
-		// scrolling towards beginning, therefore text moves down on screen
-			{
-			TInt numLinesToDraw=prevNumLinesAbove-numLinesAbove;
-			TInt numLinesToBlt=numVisibleLines(height, textHeight)-numLinesToDraw;
-			if (numLinesToBlt>0)
-				ScrollWindow(aHwnd, 0, numLinesToDraw*textHeight, NULL, NULL);
-			PatBlt(hdc, 0, 0, width, numLinesToDraw*textHeight, WHITENESS);
-			paintMin=Max(Min(numLinesAbove, scrollMax), scrollMin);
-			paintMax=Min(paintMin+numLinesToDraw, scrollMax);
-			for (i=paintMin; i<paintMax; i++)
-				{
-				TText *text=&((*pmsg)[i]);
-				TextOut(hdc, 0, (i-numLinesAbove)*textHeight, (LPCTSTR)text, User::StringLength(text));
-				}
-			}
-
-		DeleteObject(hfont);
-		ReleaseDC(aHwnd, hdc);
-		return 0;
-    case WM_PAINT:
-		hdc=BeginPaint(aHwnd, &ps);
-		hfont=(HFONT)SelectObject(hdc, CreateFontIndirect(&logFont));
-
-		paintMin=Max(scrollMin, numLinesAbove);
-		paintMax=Min(numLines(*pmsg, outOfMemory), numLinesAbove+numVisibleLines(height, textHeight));
-		for (i=paintMin; i<paintMax; i++)
-				{
-				TText *text=&((*pmsg)[i]);
-				TextOut(hdc, 0, (i-numLinesAbove)*textHeight, (LPCTSTR)text, User::StringLength(text));
-				}
-
-		DeleteObject(hfont);
-		EndPaint(aHwnd, &ps);
-        return 0;
-    case WM_SIZE:
-        width=LOWORD(lParam);
-        height=HIWORD(lParam);
-		return 0;
-    case WM_VSCROLL:
-		prevNumLinesAbove=numLinesAbove;
-        switch (LOWORD(wParam))
-			{
-		case SB_TOP:
-			numLinesAbove=scrollMin;
-			break;
-		case SB_BOTTOM:
-			numLinesAbove=scrollMax;
-			break;
-		case SB_LINEUP:
-			numLinesAbove--;
-			break;
-		case SB_LINEDOWN:
-			numLinesAbove++;
-			break;
-		case SB_PAGEUP:
-			numLinesAbove-=numVisibleLines(height, textHeight);
-			break;
-		case SB_PAGEDOWN:
-			numLinesAbove+=numVisibleLines(height, textHeight);
-			break;
-		case SB_THUMBTRACK:
-			numLinesAbove=HIWORD(wParam);
-			break;
-			}
-		numLinesAbove=max(scrollMin, min(numLinesAbove, scrollMax));
-
-		if (numLinesAbove!=prevNumLinesAbove)
-			SendMessage(aHwnd, WM_USER+EScrollToPos, 0, 0L);
-		return 0;
-    case WM_KEYDOWN:
-		switch (wParam)
-			{
-		case VK_HOME:
-			SendMessage(aHwnd, WM_VSCROLL, SB_TOP, 0L);
-			break;
-		case VK_END:
-			SendMessage(aHwnd, WM_VSCROLL, SB_BOTTOM, 0L);
-			break;
-		case VK_PRIOR:
-			SendMessage(aHwnd, WM_VSCROLL, SB_PAGEUP, 0L);
-			break;
-		case VK_NEXT:
-			SendMessage(aHwnd, WM_VSCROLL, SB_PAGEDOWN, 0L);
-			break;
-		case VK_UP:
-			SendMessage(aHwnd, WM_VSCROLL, SB_LINEUP, 0L);
-			break;
-		case VK_DOWN:
-			SendMessage(aHwnd, WM_VSCROLL, SB_LINEDOWN, 0L);
-			break;
-			}
-		return 0;
-	case WM_DESTROY:
-		delete pmsg;
-		PostQuitMessage(0);
-		return 0;
-		}
-
-	return DefWindowProc(aHwnd, aMessage, wParam, lParam);
-	}
-
-TInt logWinMain(TAny *)
-    {
-    MSG msg;
-    WNDCLASS wndclass;
-    const TText *szAppName=_S("Window Server Log");
-
-    wndclass.style=CS_HREDRAW|CS_VREDRAW;
-    wndclass.lpfnWndProc=WndProc;
-    wndclass.cbClsExtra=0;
-    wndclass.cbWndExtra=0;
-    wndclass.hInstance=NULL;
-    wndclass.hIcon=LoadIcon(NULL, IDI_APPLICATION);
-    wndclass.hCursor=LoadCursor(NULL, IDC_ARROW);
-	//wndclass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
-	wndclass.hbrBackground=(HBRUSH)GetSysColorBrush(COLOR_BTNFACE);
-    wndclass.lpszMenuName=NULL;
-    wndclass.lpszClassName=(LPCTSTR)szAppName;
-
-    RegisterClass(&wndclass);
-
-	GSharedMemory.iHwnd=CreateWindow((LPCTSTR)szAppName,
-                    (LPCTSTR)szAppName,
-					WS_OVERLAPPEDWINDOW,
-					//WS_OVERLAPPEDWINDOW|WS_VSCROLL|WS_MINIMIZE,
-                    CW_USEDEFAULT,
-                    CW_USEDEFAULT,
-                    CW_USEDEFAULT,
-                    CW_USEDEFAULT,
-                    NULL,
-                    NULL,
-                    NULL,
-                    NULL);
-
-	ShowWindow(GSharedMemory.iHwnd, SW_SHOWMINNOACTIVE);
-	//ShowWindow(GSharedMemory.iHwnd, SW_MINIMIZE);
-	UpdateWindow(GSharedMemory.iHwnd);
-	GSharedMemory.iStartSemaphore.Signal(); // allows logging to start now that the window, etc. has been set up
-	Emulator::Escape();
-    while (GetMessage(&msg, NULL, 0, 0))
-        {
-        TranslateMessage(&msg);
-        DispatchMessage(&msg);
-        }
-	Emulator::Reenter();
-    return msg.wParam;
-    }
-
-GLDEF_C void CreateLogWinThreadL()
-	{
-	_LIT(KLogWin,"LogingWindow");
-	RThread wsThread;
-	GSharedMemory.iStartSemaphore.CreateLocal(0);
-	User::LeaveIfError(wsThread.Create(KLogWin,logWinMain,KDefaultStackSize,KHeapSize,KHeapSize,NULL));
-	wsThread.Resume();
-	GSharedMemory.iStartSemaphore.Wait();
-	}
--- a/windowing/windowserver/TClick/LOGWIN.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Support for logging to a WIN32 window
-// 
-//
-
-#include "../debuglog/_windows.h"
-#include <e32def.h>
-
-GLREF_C void CreateLogWinThreadL();
-
-//GLREF_D struct HWND__ *Hwnd;
-// static container for sharing data between Symbian & Windows threads
-struct TSharedMemory
-	{
-	RSemaphore iStartSemaphore;
-	struct HWND__* iHwnd;
-	};
-
-enum TWindowsUserMessage
-	{
-	EAppendText,
-	EScrollToPos
-	};
--- a/windowing/windowserver/TClick/multiptrclick.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,246 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test Multi Pointer Click Plug-In DLL
-// 
-//
-
-#include <e32std.h>
-#include "W32CLICK.H"
-#include "multiptrclick.h"
-
-class CMultiPtrClickMaker : public CClickMaker
-	{
-	enum {EEventBufferSize=32};
-public:
-	~CMultiPtrClickMaker();
-	void ConstructL();
-	//Virtual function from CClickMaker
-	void KeyEvent(TEventCode aType, const TKeyEvent& aEvent);
-	void PointerEvent(const TPointerEvent& aEvent);
-	void OtherEvent(TInt aType, TAny* aParam);
-	TInt CommandReplyL(TInt aOpcode, TAny *aArgs);
-
-private:
-	TInt AddEvent(const TWsEvent* aEvent);
-	TInt AddEvent(const TPointerEventData* aEvent);
-	TBool ComparePointerEvents(const TPointerEvent* aExpectedEvent, const TPointerEvent* aActualEvent);
-	TBool CompareOtherEvents(const TPointerEventData* aExpectedEvent, const TPointerEventData* aActualEvent);
-private:
-	CCirBuf<TWsEvent> iPtrEventBuffer;
-	CCirBuf<TPointerEventData> iOtherEventBuffer;
-	TBuf<255> iErrorDes;
-	TInt iPtrEventCount;
-	TInt iOtherEventCount;
-	TInt iError;
-	};
-
-
-void CMultiPtrClickMaker::ConstructL()
-	{
-	iPtrEventBuffer.SetLengthL(EEventBufferSize);
-	iOtherEventBuffer.SetLengthL(EEventBufferSize);
-	}
-
-CMultiPtrClickMaker::~CMultiPtrClickMaker()
-	{
-	}
-
-void CMultiPtrClickMaker::KeyEvent(TEventCode /*aType*/,const TKeyEvent& /*aEvent*/)
-	{
-	}
-
-TBool CMultiPtrClickMaker::ComparePointerEvents(const TPointerEvent* aExpectedEvent, const TPointerEvent* aActualEvent)
-	{
-	// Check pointer type
-	if (aExpectedEvent->iType != aActualEvent->iType)
-		{
-		_LIT(KEventType, "Actual Wserv Event type = %d Expected Wserv Event Type = %d ");
-		iErrorDes.Format(KEventType, aActualEvent->iType, aExpectedEvent->iType);
-		return EFalse;
-		}
-	
-	if (aExpectedEvent->iPosition != aActualEvent->iPosition)
-		{
-		_LIT(KPointerPosition, "Actual PointerPosition = (%d, %d) Expected PointerPosition = (%d, %d) ");
-		iErrorDes.Format(KPointerPosition, aActualEvent->iPosition.iX, aActualEvent->iPosition.iY, aExpectedEvent->iPosition.iX, aExpectedEvent->iPosition.iY);
-		return EFalse;
-		}
-	
-	if (aExpectedEvent->iParentPosition != aActualEvent->iParentPosition)
-		{
-		_LIT(KPointerPosition, "Actual parent Position = (%d, %d) Expected parent Position = (%d, %d) ");
-		iErrorDes.Format(KPointerPosition, aActualEvent->iParentPosition.iX, aActualEvent->iParentPosition.iY, aExpectedEvent->iParentPosition.iX, aExpectedEvent->iParentPosition.iY);
-		return EFalse;
-		}
-	
-	if (aExpectedEvent->IsAdvancedPointerEvent() != aActualEvent->IsAdvancedPointerEvent())
-		{
-		_LIT(KPointerPosition, "Actual event is TAdvancedPointerEvent = %d Expected event is TAdvancedPointerEvent = %d ");
-		iErrorDes.Format(KPointerPosition, aActualEvent->IsAdvancedPointerEvent(), aExpectedEvent->IsAdvancedPointerEvent());
-		return EFalse;
-		}
-	
-	if (aExpectedEvent->IsAdvancedPointerEvent())
-		{
-		const TAdvancedPointerEvent& expectedAdvancedEvent = *aExpectedEvent->AdvancedPointerEvent();
-		const TAdvancedPointerEvent& actualAdvancedEvent   = *aActualEvent->AdvancedPointerEvent();
-		
-		if (expectedAdvancedEvent.PointerNumber() != actualAdvancedEvent.PointerNumber())
-			{
-			_LIT(KPointerNumber, "Actual PointerNumber = %d Expected PointerNumber = %d ");
-			iErrorDes.Format(KPointerNumber, actualAdvancedEvent.PointerNumber(), expectedAdvancedEvent.PointerNumber());
-			return EFalse;
-			}
-		
-		if (expectedAdvancedEvent.Pressure() != actualAdvancedEvent.Pressure())
-			{
-			_LIT(KPointerPressure, "Actual Pressure = %d Expected Pressure = %d ");
-			iErrorDes.Format(KPointerPressure, actualAdvancedEvent.Pressure(), expectedAdvancedEvent.Pressure());
-			return EFalse;
-			}
-		
-		if (expectedAdvancedEvent.Proximity() != actualAdvancedEvent.Proximity())
-			{
-			_LIT(KPointerProximity, "Actual Proximity = %d Expected Proximity = %d ");
-			iErrorDes.Format(KPointerProximity, actualAdvancedEvent.Proximity(), expectedAdvancedEvent.Proximity());
-			return EFalse;
-			}
-		}
-
-	return ETrue;
-	}
-
-//
-void CMultiPtrClickMaker::PointerEvent(const TPointerEvent& aEvent)
-	{
-	// If it has already failed then do not test other events
-	// becasue the error value and its descriptor will be over written
-	if (iError)
-		{
-		return;
-		}
-		
-	// Get pointer event from buffer
-	TWsEvent expectedEvent;
-	iPtrEventBuffer.Remove(&expectedEvent);
-	
-	// Increment event count
-	iPtrEventCount++;
-	
-	// increment this counter in OtherEvent() becasue first pointer event iscalled and then OtherEvent() is called
-	if (!ComparePointerEvents(expectedEvent.Pointer(), &aEvent))
-		{
-		iError = iPtrEventCount;
-		}
-	}
-
-TBool CMultiPtrClickMaker::CompareOtherEvents(const TPointerEventData* aExpectedEvent, const TPointerEventData* aActualEvent)
-	{
-	if (aExpectedEvent->iCurrentPos != aActualEvent->iCurrentPos)
-		{
-		_LIT(KCurrentPosition, "Actual CurrentPosition  w.r.t screen = (%d,%d) Expected CurrentPosition  w.r.t screen = (%d,%d)");
-		iErrorDes.Copy(KCurrentPosition);
-		iErrorDes.Format(KCurrentPosition, aActualEvent->iCurrentPos.iX, aActualEvent->iCurrentPos.iX, aExpectedEvent->iCurrentPos.iX, aExpectedEvent->iCurrentPos.iY);
-		return EFalse;
-		}
-	
-	if (aExpectedEvent->iClientHandle != aActualEvent->iClientHandle)
-		{
-		_LIT(KWindowHandle, "Actual Window Handle = %d Expected Window Handle = %d ");
-		iErrorDes.Copy(KWindowHandle);
-		iErrorDes.Format(KWindowHandle, aActualEvent->iClientHandle, aExpectedEvent->iClientHandle);
-		return EFalse;
-		}
-	
-	return ComparePointerEvents(&aExpectedEvent->iPointerEvent, &aActualEvent->iPointerEvent);
-	}
-
-void CMultiPtrClickMaker::OtherEvent(TInt aType, TAny* aParam)
-	{
-	if (aType != EEventPointer)
-		{
-		return;
-		}
-			
-	if (iError)
-		{
-		return;
-		}
-
-	TPointerEventData expectedEvent;
-	iOtherEventBuffer.Remove(&expectedEvent);
-	
-	iOtherEventCount++;
-	
-	TPointerEventData* data=static_cast<TPointerEventData*>(aParam);
-	
-	if (!CompareOtherEvents(&expectedEvent, data))
-		{
-		iError = iPtrEventCount;
-		}
-	}
-
-TInt CMultiPtrClickMaker::AddEvent(const TWsEvent* aEvent)
-	{
-	return iPtrEventBuffer.Add(aEvent);
-	}
-
-TInt CMultiPtrClickMaker::AddEvent(const TPointerEventData* aEvent)
-	{
-	return iOtherEventBuffer.Add(aEvent);
-	}
-
-TInt CMultiPtrClickMaker::CommandReplyL(TInt aOpcode, TAny *aArgs)
-	{
-	TMultiPtrClickArgUnion pData;
-	pData.any=aArgs;
-	switch (aOpcode)
-		{
-	case EMultiPtrClickEventAdd:
-		return AddEvent(pData.WsEvent);
-	case EMultiPtrOtherEventAdd:
-		return AddEvent(pData.OtherEvent);
-	case EMultiPtrClickEventError:
-		return iError;
-	case EMultiPtrClickEventErrorDesc:
-		if (iError != KErrNone)
-			{
-			RChunk chunk;
-			chunk.OpenGlobal(KMultiPtrClickChunk, ETrue);
-			TUint8* desPtr = chunk.Base() + *(static_cast<TInt*>(aArgs));
-			TPtr8 ptrDes(desPtr, iErrorDes.Length(), iErrorDes.Length());
-			ptrDes.Copy(iErrorDes);
-			chunk.Close();
-			return iErrorDes.Length();
-			// returns the error description which gets displayed in logs if test failed
-			}
-		break;
-	case EMultiPtrClickEventReset:
-		iPtrEventBuffer.Reset();
-		iError = 0;
-		iPtrEventCount = 0;
-		break;
-	default:;
-		}
-	return(KErrNone);
-	}
-
-EXPORT_C CClickMaker* CreateMultiPtrClickMakerL()
-	{
-	CMultiPtrClickMaker* plugIn=new(ELeave) CMultiPtrClickMaker;
-	CleanupStack::PushL(plugIn);
-	plugIn->ConstructL();
-	CleanupStack::Pop(plugIn);
-	return plugIn;
-	}
--- a/windowing/windowserver/TClick/multiptrclick.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Client interface to the pointer click plugin.
-// 
-//
-
-#ifndef __MULTIPTRCLICK_H__
-#define __MULTIPTRCLICK_H__
-
-#ifndef __W32CLICK_H__
-#include <w32click.h>
-#endif
-
-#include <graphics/pointereventdata.h>
-
-#define MULTIPTR_CLICK_THIRD_UID 268455781
-
-_LIT(KMultiPtrClickChunk, "PointerClickChunk");
-
-enum TMultiPtrClickCommands
-	{
-	EMultiPtrClickEventAdd,
-	EMultiPtrClickEventError,
-	EMultiPtrClickEventErrorDesc,
-	EMultiPtrClickEventReset,
-	EMultiPtrOtherEventAdd,
-	};
-
-union TMultiPtrClickArgUnion
-	{
-	const TAny* any;
-	const TWsEvent* WsEvent;
-	const TPointerEventData* OtherEvent;
-	};
-
-#endif	//__MULTIPTRCLICK_H__
--- a/windowing/windowserver/bwins/WS322U.DEF	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/bwins/WS322U.DEF	Fri Jul 16 11:45:55 2010 +0300
@@ -585,5 +585,5 @@
 	?OverrideEffects@RWsSession@@QAEXHHABV?$TBuf@$0BAA@@@00V?$TBitFlagsT@K@@@Z @ 584 NONAME ; void RWsSession::OverrideEffects(int, int, class TBuf<256> const &, class TBuf<256> const &, class TBuf<256> const &, class TBitFlagsT<unsigned long>)
 	?UnregisterEffect@RWsSession@@QAEXHHI@Z @ 585 NONAME ; void RWsSession::UnregisterEffect(int, int, unsigned int)
 	?UnregisterAllEffects@RWsSession@@QAEXXZ @ 586 NONAME ; void RWsSession::UnregisterAllEffects(void)
+	?IndicateAppOrientation@RWsSession@@QAEXW4TRenderOrientation@@@Z @ 587 NONAME ; void RWsSession::IndicateAppOrientation(enum TRenderOrientation)
 
-
--- a/windowing/windowserver/bwins/ws32switchu.def	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/bwins/ws32switchu.def	Fri Jul 16 11:45:55 2010 +0300
@@ -427,8 +427,8 @@
 	call_vector_426 @ 426 NONAME ; void RBlankWindow::SetColor(void)
 	call_vector_427 @ 427 NONAME ; int RWsSession::SetClientCursorMode(enum TPointerCursorMode)
 	call_vector_428 @ 428 NONAME ; class TRect RDrawableWindow::GetDrawRect(void) const
-	call_vector_429 @ 429 NONAME 
-	call_vector_430 @ 430 NONAME 
+	call_vector_429 @ 429 NONAME
+	call_vector_430 @ 430 NONAME
 	call_vector_431 @ 431 NONAME ; void CWindowGc::Reserved_CWindowGc_3(void)
 	call_vector_432 @ 432 NONAME ; void CWindowGc::Reserved_CWindowGc_4(void)
 	call_vector_433 @ 433 NONAME ; void CWindowGc::Reserved_CWindowGc_5(void)
@@ -512,20 +512,20 @@
 	call_vector_511 @ 511 NONAME ; int RWsSession::DebugInfo(int, int) const
 	call_vector_512 @ 512 NONAME ; unsigned long RWindowTreeNode::ClientHandle(void) const
 	call_vector_513 @ 513 NONAME ; int RWindowBase::SetBackgroundSurface(class TSurfaceId const &)
-	call_vector_514 @ 514 NONAME 
+	call_vector_514 @ 514 NONAME
 	call_vector_515 @ 515 NONAME ; class TRgb RWindowBase::KeyColor(void) const
-	call_vector_516 @ 516 NONAME 
-	call_vector_517 @ 517 NONAME 
-	call_vector_518 @ 518 NONAME 
-	call_vector_519 @ 519 NONAME 
-	call_vector_520 @ 520 NONAME 
+	call_vector_516 @ 516 NONAME
+	call_vector_517 @ 517 NONAME
+	call_vector_518 @ 518 NONAME
+	call_vector_519 @ 519 NONAME
+	call_vector_520 @ 520 NONAME
 	call_vector_521 @ 521 NONAME ; int RWindowBase::GetBackgroundSurface(class TSurfaceConfiguration &) const
-	call_vector_522 @ 522 NONAME 
+	call_vector_522 @ 522 NONAME
 	call_vector_523 @ 523 NONAME ; int RWsSession::PreferredSurfaceConfigurationSize(void) const
 	call_vector_524 @ 524 NONAME ; int RWsSession::RegisterSurface(int, class TSurfaceId const &)
-	call_vector_525 @ 525 NONAME 
+	call_vector_525 @ 525 NONAME
 	call_vector_526 @ 526 NONAME ; void RWindowBase::RemoveBackgroundSurface(int)
-	call_vector_527 @ 527 NONAME 
+	call_vector_527 @ 527 NONAME
 	call_vector_528 @ 528 NONAME ; int RWindowBase::SetBackgroundSurface(class TSurfaceConfiguration const &, int)
 	call_vector_529 @ 529 NONAME ; void RWsSession::UnregisterSurface(int, class TSurfaceId const &)
 	call_vector_530 @ 530 NONAME ; void RWindow::ClearRedrawStore(void)
@@ -585,4 +585,5 @@
 	call_vector_584 @ 584 NONAME ; void RWsSession::OverrideEffects(int, int, class TBuf<256> const &, class TBuf<256> const &, class TBuf<256> const &, class TBitFlagsT<unsigned long>)
 	call_vector_585 @ 585 NONAME ; void RWsSession::UnregisterEffect(int, int, unsigned int)
 	call_vector_586 @ 586 NONAME ; void RWsSession::UnregisterAllEffects(void)
+	call_vector_587 @ 587 NONAME ; void RWsSession::IndicateAppOrientation(enum TRenderOrientation)
 
--- a/windowing/windowserver/debuglog/DECODER.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/debuglog/DECODER.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -834,7 +834,13 @@
 		_LIT(LogGetExitHighPressureThreshold,"EWsClOpGetExitHighPressureThreshold()");
 		aText.AppendFormat(LogGetExitHighPressureThreshold);		
 		}
-		break;	
+		break;
+	case EWsClOpIndicateAppOrientation:
+	    {
+        _LIT(LogIndicateAppOrientation,"EWsClOpIndicateAppOrientation(%d)");
+        aText.AppendFormat(LogIndicateAppOrientation, *pData.Orientation);       	    
+	    }
+	    break;
 	case EWsClOpLastEnumValue:
 		{		
 		_LIT(LogLastEnumValue,"EWsClOpLastEnumValue enum");
--- a/windowing/windowserver/eabi/WS322U.DEF	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/eabi/WS322U.DEF	Fri Jul 16 11:45:55 2010 +0300
@@ -659,5 +659,5 @@
 	_ZN10RWsSession16UnregisterEffectEiij @ 658 NONAME
 	_ZN10RWsSession20UnregisterAllEffectsEv @ 659 NONAME
 	_ZN11RWindowBase15OverrideEffectsEiRK4TBufILi256EES3_S3_10TBitFlagsTImE @ 660 NONAME
+	_ZN10RWsSession22IndicateAppOrientationE18TRenderOrientation @ 661 NONAME
 
-
--- a/windowing/windowserver/group/ANIM.MMP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/ANIM.MMP	Fri Jul 16 11:45:55 2010 +0300
@@ -18,7 +18,7 @@
 TARGET			tanim.exe
 TARGETTYPE		EXE
 
-SOURCEPATH		../tanim
+SOURCEPATH		../test/tanim
 SOURCE			ANIM.CPP
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- a/windowing/windowserver/group/ANIMDLL.MMP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/ANIMDLL.MMP	Fri Jul 16 11:45:55 2010 +0300
@@ -20,10 +20,10 @@
 
 CAPABILITY PowerMgmt ReadDeviceData WriteDeviceData ProtServ
 
-SOURCEPATH		../tanim
+SOURCEPATH		../test/tanim
 SOURCE			TANIMDLL.CPP
 
-USERINCLUDE 	../inc
+USERINCLUDE 	../test/inc
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 LIBRARY			euser.lib fbscli.lib gdi.lib
--- a/windowing/windowserver/group/AUTODLL_nga.MMP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/AUTODLL_nga.MMP	Fri Jul 16 11:45:55 2010 +0300
@@ -23,7 +23,7 @@
 
 CAPABILITY PowerMgmt ReadDeviceData WriteDeviceData ProtServ
 
-SOURCEPATH		../tauto
+SOURCEPATH		../test/tauto
 SOURCE			AUTODLL.CPP TAnimdraw.cpp
 
 USERINCLUDE	../inc
--- a/windowing/windowserver/group/AUTODLL_nonnga.MMP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/AUTODLL_nonnga.MMP	Fri Jul 16 11:45:55 2010 +0300
@@ -21,7 +21,7 @@
 
 CAPABILITY PowerMgmt ReadDeviceData WriteDeviceData ProtServ
 
-SOURCEPATH		../tauto
+SOURCEPATH		../test/tauto
 SOURCE			AUTODLL.CPP TAnimdraw.cpp
 
 USERINCLUDE	../inc
--- a/windowing/windowserver/group/Click.MMP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/Click.MMP	Fri Jul 16 11:45:55 2010 +0300
@@ -17,7 +17,7 @@
 CAPABILITY PowerMgmt ReadDeviceData WriteDeviceData ProtServ
 TARGETTYPE		DLL
 
-SOURCEPATH		../TClick
+SOURCEPATH		../test/TClick
 SOURCE			CLICK.CPP
 #if defined(WINS)
 SOURCE			LOGWIN.CPP
--- a/windowing/windowserver/group/INC113743.MMP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/INC113743.MMP	Fri Jul 16 11:45:55 2010 +0300
@@ -22,7 +22,7 @@
 TARGET            inc113743.exe
 TARGETTYPE        exe
 
-SOURCEPATH        ../tauto
+SOURCEPATH        ../test/tauto
 
 SOURCE            topaquechild.cpp
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- a/windowing/windowserver/group/TCAP1.MMP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/TCAP1.MMP	Fri Jul 16 11:45:55 2010 +0300
@@ -17,7 +17,7 @@
 CAPABILITY 		WriteDeviceData SwEvent
 TARGETTYPE		EXE
 
-SOURCEPATH		../tcapability
+SOURCEPATH		../test/tcapability
 SOURCE			TCapTest.CPP
 
 OS_LAYER_SYSTEMINCLUDE
--- a/windowing/windowserver/group/TCAP2.MMP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/TCAP2.MMP	Fri Jul 16 11:45:55 2010 +0300
@@ -17,7 +17,7 @@
 CAPABILITY 		PowerMgmt WriteDeviceData
 TARGETTYPE		EXE
 
-SOURCEPATH		../tcapability
+SOURCEPATH		../test/tcapability
 SOURCE			TCapTest.CPP
 
 OS_LAYER_SYSTEMINCLUDE
--- a/windowing/windowserver/group/TCAP3.MMP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/TCAP3.MMP	Fri Jul 16 11:45:55 2010 +0300
@@ -17,7 +17,7 @@
 CAPABILITY 		PowerMgmt SwEvent
 TARGETTYPE		EXE
 
-SOURCEPATH		../tcapability
+SOURCEPATH		../test/tcapability
 SOURCE			TCapTest.CPP
 
 OS_LAYER_SYSTEMINCLUDE
--- a/windowing/windowserver/group/TCAP_ALL.MMP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/TCAP_ALL.MMP	Fri Jul 16 11:45:55 2010 +0300
@@ -17,7 +17,7 @@
 CAPABILITY PowerMgmt WriteDeviceData SwEvent
 TARGETTYPE		EXE
 
-SOURCEPATH		../tcapability
+SOURCEPATH		../test/tcapability
 SOURCE			TCapTest.CPP
 
 OS_LAYER_SYSTEMINCLUDE
--- a/windowing/windowserver/group/TCAP_NONE.MMP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/TCAP_NONE.MMP	Fri Jul 16 11:45:55 2010 +0300
@@ -18,7 +18,7 @@
 TARGET			tcap_none.exe
 TARGETTYPE		EXE
 
-SOURCEPATH		../tcapability
+SOURCEPATH		../test/tcapability
 SOURCE			TCapTest.CPP
 
 OS_LAYER_SYSTEMINCLUDE
--- a/windowing/windowserver/group/TLIB.MMP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/TLIB.MMP	Fri Jul 16 11:45:55 2010 +0300
@@ -20,7 +20,7 @@
 
 CAPABILITY 		PowerMgmt WriteDeviceData SwEvent ProtServ
 
-SOURCEPATH		../tlib
+SOURCEPATH		../test/tlib
 SOURCE			TESTBASE.CPP TLDIALOG.CPP TLEVENT.CPP TLSPRITE.CPP
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- a/windowing/windowserver/group/TMAN.MMP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/TMAN.MMP	Fri Jul 16 11:45:55 2010 +0300
@@ -18,7 +18,7 @@
 TARGET			tman.exe
 TARGETTYPE		EXE
 
-SOURCEPATH		../tman
+SOURCEPATH		../test/tman
 
 SOURCE			DUMMYM.CPP HOTKEY2.CPP MULTICON.CPP SCALE.CPP
 SOURCE			TKREPEAT.CPP TMAN.CPP TMCAPKEY.CPP TMMODCHG.CPP
--- a/windowing/windowserver/group/TTIMERS.MMP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/TTIMERS.MMP	Fri Jul 16 11:45:55 2010 +0300
@@ -18,7 +18,7 @@
 TARGET			ttimers.exe
 TARGETTYPE		EXE
 
-SOURCEPATH		../ttime
+SOURCEPATH		../test/ttime
 SOURCE			TTGENRAL.CPP TTGRAPH.CPP TTIME.CPP TTMOVWIN.CPP TTTEXT.CPP
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- a/windowing/windowserver/group/TWSGRAPHIC.MMP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/TWSGRAPHIC.MMP	Fri Jul 16 11:45:55 2010 +0300
@@ -21,11 +21,11 @@
 UID		0x00000000 0x10003a3e
 VENDORID 0x70000001
 
-SOURCEPATH		../twsgraphic
+SOURCEPATH		../test/twsgraphic
 SOURCE			TWsGraphicTest.CPP
 
-USERINCLUDE		../inc ../tlib  ../tauto
-MW_LAYER_SYSTEMINCLUDE_SYMBIAN
+USERINCLUDE		../inc ../test/tlib  ../test/tauto
+OS_LAYER_SYSTEMINCLUDE
 
 
 LIBRARY			euser.lib ws32.lib gdi.lib efsrv.lib
--- a/windowing/windowserver/group/TWSGRAPHICSHARE.MMP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/TWSGRAPHICSHARE.MMP	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -19,12 +19,11 @@
 UID		 0x00000000 0x10003a3f
 VENDORID 0x70000001
 
-SOURCEPATH		../twsgraphic
+SOURCEPATH		../test/twsgraphic
 SOURCE			TWsGraphicShareTest.CPP
 
-USERINCLUDE		../inc  ../tauto
-MW_LAYER_SYSTEMINCLUDE_SYMBIAN
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+USERINCLUDE		../inc  ../test/tauto
+OS_LAYER_SYSTEMINCLUDE
 
 LIBRARY			euser.lib ws32.lib gdi.lib efsrv.lib
 LIBRARY			w32stdgraphic.lib fbscli.lib tlib.lib
--- a/windowing/windowserver/group/TWSGRAPHICSHAREGLOBAL.MMP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/TWSGRAPHICSHAREGLOBAL.MMP	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -19,12 +19,11 @@
 UID		0x00000000 0x10003a4a
 VENDORID 0x70000001
 
-SOURCEPATH		../twsgraphic
+SOURCEPATH		../test/twsgraphic
 SOURCE			TWsGraphicShareTest.CPP
 
-USERINCLUDE		../inc ../tauto
-MW_LAYER_SYSTEMINCLUDE_SYMBIAN
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+USERINCLUDE		../inc ../test/tauto
+OS_LAYER_SYSTEMINCLUDE
 
 LIBRARY			euser.lib ws32.lib gdi.lib efsrv.lib
 LIBRARY			w32stdgraphic.lib fbscli.lib tlib.lib
--- a/windowing/windowserver/group/TWSGRAPHICSHARESECURE.MMP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/TWSGRAPHICSHARESECURE.MMP	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -19,12 +19,11 @@
 UID		0x00000000 0x10003a4b
 VENDORID 0x70000001
 
-SOURCEPATH		../twsgraphic
+SOURCEPATH		../test/twsgraphic
 SOURCE			TWsGraphicShareTest.CPP
 
-USERINCLUDE		../inc ../tauto
-MW_LAYER_SYSTEMINCLUDE_SYMBIAN
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+USERINCLUDE		../inc ../test/tauto
+OS_LAYER_SYSTEMINCLUDE
 
 LIBRARY			euser.lib ws32.lib gdi.lib efsrv.lib
 LIBRARY			w32stdgraphic.lib fbscli.lib tlib.lib
--- a/windowing/windowserver/group/TWSGRAPHICUNSHAREGLOBAL.MMP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/TWSGRAPHICUNSHAREGLOBAL.MMP	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -19,12 +19,11 @@
 UID		0x00000000 0x10003a4c
 VENDORID 0x70000001
 
-SOURCEPATH		../twsgraphic
+SOURCEPATH		../test/twsgraphic
 SOURCE			TWsGraphicShareTest.CPP
 
-USERINCLUDE		../inc  ../tauto
-MW_LAYER_SYSTEMINCLUDE_SYMBIAN
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+USERINCLUDE		../inc  ../test/tauto
+OS_LAYER_SYSTEMINCLUDE
 
 LIBRARY			euser.lib ws32.lib gdi.lib efsrv.lib
 LIBRARY			w32stdgraphic.lib fbscli.lib tlib.lib
--- a/windowing/windowserver/group/TWSGRAPHICUNSHARESECURE.MMP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/TWSGRAPHICUNSHARESECURE.MMP	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -19,12 +19,11 @@
 UID             0x00000000 0x10003a4b
 VENDORID 0x70000001
 
-SOURCEPATH		../twsgraphic
+SOURCEPATH		../test/twsgraphic
 SOURCE			TWsGraphicShareTest.CPP
 
-USERINCLUDE		../inc  ../tauto
-MW_LAYER_SYSTEMINCLUDE_SYMBIAN
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+USERINCLUDE		../inc  ../test/tauto
+OS_LAYER_SYSTEMINCLUDE
 
 LIBRARY			euser.lib ws32.lib gdi.lib efsrv.lib
 LIBRARY			w32stdgraphic.lib fbscli.lib tlib.lib
--- a/windowing/windowserver/group/bufferdrawer.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/bufferdrawer.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -29,7 +29,7 @@
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
-sourcepath		../tbufferdrawer
+sourcepath		../test/tbufferdrawer
 source			proxy.cpp bufferdrawer.cpp
 resource		bufferdrawer.rss
 
--- a/windowing/windowserver/group/containdrawer.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/containdrawer.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -28,7 +28,7 @@
 userinclude 	../inc .
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
-sourcepath		../tcontaindrawer
+sourcepath		../test/tcontaindrawer
 source			proxy.cpp containdrawer.cpp simpledrawer.cpp wsgraphicdrawerngacontext.cpp wsgraphicdrawernonngacontext.cpp
 resource		containdrawer.rss
 library			euser.lib ecom.lib gdi.lib bitgdi.lib fbscli.lib wsgraphicdrawer.lib
--- a/windowing/windowserver/group/eventdd.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/eventdd.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -18,9 +18,9 @@
 target			eventdd.ldd
 targettype		ldd
 
-userinclude		../tauto
+userinclude		../test/tauto
 
-sourcepath		../tauto
+sourcepath		../test/tauto
 source			eventdd.cpp
 
 uid			0x100000af
--- a/windowing/windowserver/group/framerate.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/framerate.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -29,7 +29,7 @@
 USERINCLUDE 	../inc .
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN 
 
-SOURCEPATH		../tframerate
+SOURCEPATH		../test/tframerate
 SOURCE			proxy.cpp framerate.cpp wsgraphicdrawerngacontext.cpp wsgraphicdrawernonngacontext.cpp
 
 RESOURCE		framerate.RSS
--- a/windowing/windowserver/group/listener.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/listener.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -28,7 +28,7 @@
 userinclude 	../inc .
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
-sourcepath		../tlisten
+sourcepath		../test/tlisten
 source			proxy.cpp listener.cpp wsgraphicdrawerngacontext.cpp wsgraphicdrawernonngacontext.cpp
 resource		listener.rss
 library			euser.lib ecom.lib gdi.lib bitgdi.lib fbscli.lib wsgraphicdrawer.lib
--- a/windowing/windowserver/group/multiptrclick.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/multiptrclick.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -17,7 +17,7 @@
 CAPABILITY PowerMgmt ReadDeviceData WriteDeviceData ProtServ
 TARGETTYPE		DLL
 
-SOURCEPATH		../TClick
+SOURCEPATH		../test/TClick
 SOURCE			multiptrclick.cpp
 
 USERINCLUDE		../inc
--- a/windowing/windowserver/group/openwfc/WServ_nga.MMP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/openwfc/WServ_nga.MMP	Fri Jul 16 11:45:55 2010 +0300
@@ -74,6 +74,7 @@
 SOURCE            drawresource.cpp
 SOURCE            devicemap.cpp
 SOURCE            wsdisplaychangeao.cpp
+SOURCE            renderorientationtracker.cpp
 
 SOURCEPATH        ../../nga/SERVER/openwfc
 
--- a/windowing/windowserver/group/openwfc/bld.inf	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/openwfc/bld.inf	Fri Jul 16 11:45:55 2010 +0300
@@ -78,6 +78,7 @@
 ../../inc/Graphics/wsdisplaypolicy.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/wsdisplaypolicy.h)
 ../../inc/Graphics/openwfc/wselement.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/wselement.h)
 ../../inc/Graphics/openwfc/wsscene.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/wsscene.h)
+../../inc/Graphics/wskeyrouter.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/wskeyrouter.h)
 ../../inc/Graphics/wscontentreadyforcomposition.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/wscontentreadyforcomposition.h)
 
 //RemoteGc exports for partners
@@ -201,6 +202,7 @@
 #ifdef SYMBIAN_BUILD_GCE
 ../../group/AUTODLL_nga.MMP support
 ../../test/TAutoServer/openwfc/TAutoServer_nga.mmp
+../../test/TAutoServer/tevent_captureapp.mmp
 #endif
 
 #ifdef WINS
--- a/windowing/windowserver/group/redirector.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/redirector.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -28,7 +28,7 @@
 userinclude 	../inc .
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
-sourcepath		../tredir
+sourcepath		../test/tredir
 source			proxy.cpp redirector.cpp
 resource		redirector.rss
 library			euser.lib ecom.lib gdi.lib bitgdi.lib fbscli.lib wsgraphicdrawer.lib
--- a/windowing/windowserver/group/tclosepanicwindow.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/tclosepanicwindow.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -18,7 +18,7 @@
 
 CAPABILITY 	PowerMgmt SwEvent WriteDeviceData ProtServ
 
-SOURCEPATH  	../tauto
+SOURCEPATH  	../test/tauto
   
 SOURCE		tclosepanicwindowprocess.cpp
 
--- a/windowing/windowserver/group/tcrx.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/tcrx.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -19,9 +19,9 @@
 uid				0x100039ce 0x10281e21
 vendorid		0x70000001
 targetpath		/sys/bin
-userinclude		. ../tredir ../tlisten
+userinclude		. ../test/tredir ../test/tlisten
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-sourcepath		../tcrx
+sourcepath		../test/tcrx
 source			tcrx.cpp
 library			euser.lib ws32.lib wsredir.lib wslisten.lib gdi.lib
 
--- a/windowing/windowserver/group/tcsc.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Name		 : tcsc.mmp
-// Author	     : 
-// This is the project specification file for tcsc.
-// 
-//
-
-TARGET		  wsgcecscserver.exe
-TARGETTYPE	  exe
-UID			 0 0xE8B48691
-
-// For setting the screen mode:
-CAPABILITY		WriteDeviceData SwEvent
-
-USERINCLUDE	 ../tgce
-USERINCLUDE  ../inc
-USERINCLUDE  ../inc/Graphics
-
-MW_LAYER_SYSTEMINCLUDE_SYMBIAN
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-OS_LAYER_LIBC_SYSTEMINCLUDE
-
-SOURCEPATH	  ../tgce
-SOURCE		  surfaceutility.cpp globalsettings.cpp 
-SOURCEPATH	  ../tcsc
-SOURCE		  t_gcecscserver.cpp cwsgcecscbase.cpp cwsgcecsc.cpp
-
-
-MACRO			SYMBIAN_GRAPHICS_GCE
-
-STATICLIBRARY	tefunit.lib
-LIBRARY			euser.lib
-LIBRARY			estlib.lib 
-LIBRARY			testexecuteutils.lib
-LIBRARY			testexecutelogclient.lib
-LIBRARY			rfileloggerclient.lib
-LIBRARY			ws32.lib
-LIBRARY			surfacemanager.lib
-LIBRARY			surfaceupdateclient.lib
-LIBRARY			imageconversion.lib
-LIBRARY			efsrv.lib
-LIBRARY			fbscli.lib
-LIBRARY			gdi.lib
-LIBRARY			bitgdi.lib
-LIBRARY			hal.lib
-LIBRARY			scdv.lib
-
-SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/windowing/windowserver/group/twsthemeserverpropertydefine.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,33 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This .exe is to define an RProperty for simulating the Theme Server.
+// It needs to have the same UID3 as the theme server.
+//
+
+TARGET			twsthemeserverpropertydefine.exe
+CAPABILITY 		WriteDeviceData ReadDeviceData
+TARGETTYPE		EXE
+//The UID3 value should be the same as the actual Theme Server UID3
+UID		0x00000000 0x20022E82 
+VENDORID 0x70000001
+
+SOURCEPATH		../test/tauto
+SOURCE			themeserverpropertydefine.cpp
+
+USERINCLUDE		../inc ../test/tauto
+OS_LAYER_SYSTEMINCLUDE
+
+LIBRARY			euser.lib ws32.lib bafl.lib
+
+SMPSAFE
\ No newline at end of file
--- a/windowing/windowserver/group/wsbufferdrawer.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/wsbufferdrawer.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -32,7 +32,7 @@
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
-sourcepath      ../tbufferdrawer
+sourcepath      ../test/tbufferdrawer
 source          wsbufferdrawer.cpp
 
 library		 euser.lib ws32.lib
--- a/windowing/windowserver/group/wscons.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/wscons.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -17,7 +17,7 @@
 TARGET			wsecons.dll
 TARGETTYPE		dll
 
-SOURCEPATH		../tauto
+SOURCEPATH		../test/tauto
 SOURCE			wscons.cpp
 
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
--- a/windowing/windowserver/group/wscontaindrawer.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/wscontaindrawer.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -31,7 +31,7 @@
 userinclude		../inc
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
-sourcepath		../tcontaindrawer
+sourcepath		../test/tcontaindrawer
 source			wscontaindrawer.cpp wssimpledrawer.cpp 
 
 
Binary file windowing/windowserver/group/wservu_multiscreen.ini has changed
Binary file windowing/windowserver/group/wservu_multiscreen_changetracking.ini has changed
--- a/windowing/windowserver/group/wsframerate.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/wsframerate.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -28,7 +28,7 @@
 
 DEFFILE			wsframerate.DEF
 
-SOURCEPATH		../tframerate
+SOURCEPATH		../test/tframerate
 
 SOURCE			wsframerate.cpp
 
--- a/windowing/windowserver/group/wslisten.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/wslisten.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -31,7 +31,7 @@
 userinclude		../inc .
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
-sourcepath		../tlisten
+sourcepath		../test/tlisten
 source			wslisten.cpp
 
 library			euser.lib ws32.lib
--- a/windowing/windowserver/group/wsredir.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/group/wsredir.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -31,7 +31,7 @@
 userinclude		../inc .
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 
-sourcepath		../tredir
+sourcepath		../test/tredir
 source			wsredir.cpp
 
 library			euser.lib ws32.lib
--- a/windowing/windowserver/inc/Graphics/openwfc/WSGRAPHICDRAWERINTERFACE.H	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/inc/Graphics/openwfc/WSGRAPHICDRAWERINTERFACE.H	Fri Jul 16 11:45:55 2010 +0300
@@ -40,6 +40,7 @@
 class MEventHandler;
 class MWsElement;
 class MWsGraphicsContext;
+class MWsAnimationScheduler;
 
 /** 
 @publishedPartner
@@ -134,57 +135,6 @@
 	virtual TBool RedrawInvalid(const TArray<TGraphicDrawerId>& aInvalid) = 0;
 	};
 
-class MWsAnimationScheduler: public MWsObjectProvider
-/** A system mechanism for customising the animation timer to a particular hardware variant or to a
-	particular external compositor e.g. an out-of-scene transition engine.
-	The default animation scheduler in WSERV does not understand device-dependant parameters e.g.
-	screen refresh rates
-	@publishedPartner
-	@released
-	to be adapted when WSERV migrates to surfaces
-*/	{
-public:
-	/** Called to schedule an animation event for a screen to occur not before some point
-	A screen may be scheduled to animate several times without actually receiving an animation event from the scheduler
-	If the scheduler cannot honour the request e.g. device constraints, it ignores the request.
-	@param aScreen the screen to recieve the event
-	@param aWhen the point in time the event need not occur before
-	*/
-	virtual void ScheduleAnimation(MWsScreen& aScreen,const TTime& aWhen) = 0;
-	/** Called if a screen determines that it no longer needs to schedule any animation
-	@param aScreen the screen not needing to receive any animation events
-	*/
-	virtual void UnscheduleAnimation(MWsScreen& aScreen) = 0;
-	/** Called to schedule the redrawing of all screens containing this graphic.
-	The redrawing of affected screens can be deferred by the scheduler.
-	@param aId the ID of the graphic to be redrawn.  The graphic itself need not exist
-		(e.g. it has just been deleted, hence the need to redraw all potentially affected screens). */
-	virtual void Invalidate(const TGraphicDrawerId& aId) = 0;
-	/** Called when the Window Server receives a TRawEvent::EInactive  event, to signal power-saving */
-	virtual void OnInactive() = 0;
-	/** Called when the Window Server receives a TRawEvent::EActive event, to signal screen back on */
-	virtual void OnActive() = 0;
-
-	/** Called to schedule a redraw for a screen which is out of date
-	A screen may be scheduled to redraw several times without actually receiving aredraw event from the scheduler
-	If this request is ignored then the screen will be draw incorrectly untill a such a request is not ignored.
-	@param aScreen the screen to recieve the event
-	@param aWhen the point in time the event need not occur before
-	*/
-	virtual void ScheduleRedraw(MWsScreen& aScreen,const TTime& aWhen) = 0;
-	/** Called to force a previously scheduled redraw for a screen to happen synchronously
-	Used when we are about to loose our ability to perform the redraw correctly.
-	@param aScreen the screen to recieve the event
-	*/
-	virtual void DoRedrawNow(MWsScreen& aScreen) = 0;
-
-protected:
-	IMPORT_C void Animate(MWsScreen& aScreen);
-	IMPORT_C void Animate(MWsScreen& aScreen, TRequestStatus* aFinished);
-	IMPORT_C void Redraw(MWsScreen& aScreen);
-	IMPORT_C TBool RedrawInvalid(MWsScreen& aScreen,const TArray<TGraphicDrawerId>& aInvalid);
-	};
-
 /**
 @publishedPartner
 @prototype
@@ -245,7 +195,7 @@
 	/** Get a particular screen by ordinal
 	@return the screen, or NULL if aIndex is out of bounds */
 	virtual const MWsScreen* Screen(TInt aIndex) const = 0;
-	/** Set the animation scheduler; this can only be done once by custom code
+	/**  Not supported
 	@return success of overriding the default scheduler */
 	virtual TBool SetCustomAnimationScheduler(MWsAnimationScheduler* aScheduler) = 0;
 	/** Query whether a custom animation scheduler has been set
@@ -899,7 +849,11 @@
 		EAlphaChannelTransparencyEnabled,
 		/** True if a clipping rect should be applied when drawing a standard text cursor, false otherwise.
 		The default value is false. */
-		ECursorClipRectSet
+		ECursorClipRectSet,
+		/** Implicitly defaults to true. Will remain true as long as the application's primary screendevice 
+		is in the same orientation as the device. This information is only given for top-windows, 
+		i.e. children of group-windows, and only when wsini.ini is configured with SIZE_MODE > 0. */
+		EScreenDeviceValid
 		};
 	/**
 	 This enum encapsulates the set of non-boolean attribute changes that can be observed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/windowing/windowserver/inc/Graphics/wskeyrouter.h	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,216 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Key Event Routing Plug-in API
+
+/**
+@file
+@publishedPartner
+@prototype
+*/
+
+#ifndef WSKEYROUTER_H
+#define WSKEYROUTER_H
+
+#include <e32base.h>
+#include <w32std.h>
+
+/**
+Interface Uid
+*/
+const TUid KKeyRouterPluginUid = { 0x102872e1 };
+
+/**
+Key Capture Type
+*/
+enum TKeyCaptureType
+	{
+	ECaptureTypeKey = 0,
+	ECaptureTypeLongKey = 1,
+	ECaptureTypeKeyUpDown = 2
+	};
+
+/**
+Key Capture Request
+*/
+struct TKeyCaptureRequest
+	{
+	/** Capture type */
+	TKeyCaptureType	iType;
+
+	/** Keycode or scancode to be captured */
+	TUint			iInputCode;
+
+	/** Output keycode or scancode. When iInputCode is captured, RouteKey()
+		places iOutputCode in TKeyEventRouterOutput.iKeyEvent */
+	TUint			iOutputCode;
+
+	/** Bitmask of modifier keys of interest. Key events are captured only
+		when the modifier keys specified by iModifierMask are in the states
+		specified by iModifiers */
+	TUint			iModifierMask;
+
+	/** Bitmask of modifier key states */
+	TUint			iModifiers;
+
+	/** Opaque handle for this request */
+	TAny*			iHandle;
+
+	/** Opaque handle to window group through which request was made */
+	TAny*			iWindowGroup;
+
+	/** Identifier of the window group through which request was made */
+	TInt			iWindowGroupId;
+
+	/** UID of application that made the capture request */
+	TUid			iAppUid;
+
+	/** Capture priority for this request. If more than one window group has
+		requested capture for the same key event, the one with the highest
+		priority will capture it (unless overridden by application specific
+		rules). */
+	TInt			iPriority;
+
+	/** Reserved for future use */
+	TInt			iReserved[2];
+	};
+
+/**
+Input parameters for RouteKey()
+*/
+struct TKeyEventRouterInput
+	{
+	inline TKeyEventRouterInput(TKeyCaptureType aType, const TKeyEvent& aKeyEvent, TAny* aFocusWindowGroup, TUid aFocusAppUid);
+
+	/** Capture type */
+	TKeyCaptureType		iType;
+
+	/** Input key event */
+	TKeyEvent			iKeyEvent;
+
+	/** Opaque handle to current focussed window group */
+	TAny*				iFocusWindowGroup;
+
+	/** UID of client application with current focussed window group */
+	TUid				iFocusAppUid;
+
+	/** Reserved for future use */
+	TInt				iReserved[2];
+	};
+
+/**
+Result codes for RouteKey()
+*/
+enum TKeyEventRouterResult
+	{
+	/** Key routed, no capture */
+	ERouted = 0,
+
+	/** Key captured and routed */
+	ECaptured = 1,
+
+	/** Key consumed, do not deliver event */
+	EConsumed = 2
+	};
+
+/**
+Output parameters for RouteKey()
+*/
+struct TKeyEventRouterOutput
+	{
+	/** Result code */
+	TKeyEventRouterResult	iResult;
+
+	/** Output key event as translated by plug-in. Key code may be set by
+		RWindowGroup::CaptureLongKey() via TKeyCaptureRequest.iOutputCode **/
+	TKeyEvent				iKeyEvent;
+
+	/** Opaque handle to destination window group or NULL if captured by WServ
+		(hotkey). Plug-in must set this to either the window group from the
+		matching capture request or to TKeyEventRouterInput.iFocusWindowGroup */
+	TAny*					iWindowGroup;
+
+	/** Opaque handle from matching capture request or NULL if none */
+	TAny*					iCaptureHandle;
+
+	/** Reserved for future use */
+	TInt					iReserved[2];
+	};
+
+/**
+Key Event Router Interface
+
+This class is implemented by a plug-in DLL in order to perform customised
+routing of window server key events.
+
+The Key Event Routing plug-in is a polymorphic DLL that implements the
+CKeyEventRouter interface. Its UID1 and UID2 must be KDynamicLibraryUid and
+KKeyRouterPluginUid respectively. UID3 identifies a particular implementation
+of the plug-in. The first and only exported function should create and return
+an object of the CKeyEventRouter sub-class.
+*/
+class CKeyEventRouter : public CBase
+	{
+public:
+	/**
+	Create and return an instance of CKeyEventRouter
+
+	@return	Pointer to new router instance
+	*/
+	IMPORT_C static CKeyEventRouter* NewL();
+
+	/**
+	Add a new key capture request
+
+	@param	aRequest	Capture request details
+	*/
+	virtual void AddCaptureKeyL(const TKeyCaptureRequest& aRequest) = 0;
+	   
+	/**
+	Update an existing key capture request
+
+	@param	aRequest	Updated capture request details
+	*/
+	virtual void UpdateCaptureKeyL(const TKeyCaptureRequest& aRequest) = 0;
+
+	/**
+	Cancel a key capture request
+
+	@param	aType		Capture type
+	@param	aHandle		Opaque handle of request to be cancelled
+	*/
+	virtual void CancelCaptureKey(TKeyCaptureType aType, TAny* aHandle) = 0;
+
+	/**
+	Route the key event described by aInput and return its destination
+	in iOutput.
+
+	@param	aInput		Input data with key event to be routed
+	@param	aOutput		Output key event and routing results
+	*/
+	virtual void RouteKey(const TKeyEventRouterInput& aInput,
+						  TKeyEventRouterOutput& aOutput) = 0;
+
+	/**
+	Reserved for future use
+	*/
+private:
+	virtual void Reserved1() {};
+	virtual void Reserved2() {};
+	};
+
+inline TKeyEventRouterInput::TKeyEventRouterInput(TKeyCaptureType aType, const TKeyEvent& aKeyEvent, TAny* aFocusWindowGroup, TUid aFocusAppUid) : iType(aType), iKeyEvent(aKeyEvent), iFocusWindowGroup(aFocusWindowGroup), iFocusAppUid(aFocusAppUid)
+	{
+	}
+
+#endif // WSKEYROUTER_H
--- a/windowing/windowserver/inc/W32STD.H	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/inc/W32STD.H	Fri Jul 16 11:45:55 2010 +0300
@@ -33,6 +33,7 @@
 #include <advancedpointerevent.h>
 #include <sizemode.h>
 #include <babitflags.h>
+#include <wspublishandsubscribedata.h>
 
 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
 #include <graphics/windowserverconstants.h>
@@ -1380,6 +1381,7 @@
 		line. */
 		ECustomTextCursorAlignBottom
 		};
+	
 //
 public:
 	IMPORT_C RWsSession();
@@ -1538,6 +1540,9 @@
 	IMPORT_C void UnregisterAllEffects();
 	IMPORT_C void OverrideEffects(TInt aAction, TInt aPurpose, const TFileName& aResourceDir, const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming, TBitFlags aFlags=0);
 	
+//Application tells the window server the orientation of rendering it intends to use
+	IMPORT_C void IndicateAppOrientation(TRenderOrientation aOrientation);
+	
 // functions not exported, used by CWsGraphic
 	void GraphicMessageReady(TRequestStatus *aStat);
 	void GetGraphicMessage(TDes8& aData) const;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/windowing/windowserver/inc/wspublishandsubscribedata.h	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,47 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Standard window server header file
+// 
+//
+#ifndef WSPUBLISHANDSUBSCRIBEDATA_H
+#define WSPUBLISHANDSUBSCRIBEDATA_H
+
+#include <e32cmn.h>
+
+// Values for the render orientation P&S value that we publish
+// Used when the property is defined, attached to, and deleted
+const TUid  KRenderOrientationCategory  = {268450592};  // WServ UID3
+const TUint KRenderOrientationKey       = 0x102872E5;
+
+/** The orientation of rendering the application intends to use.
+
+@see RWsSession::IndicateAppOrientation(TOrientation aOrientation)*/
+enum TRenderOrientation
+    {
+    /** Fixed default orientation */
+    EDisplayOrientationNormal,
+    /** 90° clockwise */
+    EDisplayOrientation90CW,
+    /** 180° */
+    EDisplayOrientation180,
+    /** 270° clockwise */
+    EDisplayOrientation270CW,
+    /** The orientation is from the P&S Key */
+    EDisplayOrientationAuto,
+    /** use the orientation specified by the next top level window(s) that does not have ignore flag set. 
+    E.g. system dialog on top of foreground app. */
+    EDisplayOrientationIgnore
+    };
+
+#endif // WSPUBLISHANDSUBSCRIBEDATA_H
--- a/windowing/windowserver/nga/CLIENT/RDirect.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nga/CLIENT/RDirect.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -528,7 +528,7 @@
 	iAbort.Restart(iReason);
 	}
 
-void CDirectScreenAccess::UpdateSizeAndRotation(CFbsBitGc*/* aGc*/)
+void CDirectScreenAccess::UpdateSizeAndRotation(CFbsBitGc* aGc)
 	{
 	TPixelsAndRotation sizeAndRotation;
 	iWsScreenDevice->GetDefaultScreenSizeAndRotation(sizeAndRotation);
@@ -549,6 +549,8 @@
 			iScreenDevice->SetDrawDeviceOffset(appAreaInDsa.iTl);
 			}
 		}
+	
+	aGc->Activate(iScreenDevice);
 	}
 
 void CDirectScreenAccess::RunL()
--- a/windowing/windowserver/nga/CLIENT/RWINDOW.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nga/CLIENT/RWINDOW.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -1363,7 +1363,7 @@
 events from all detected pointers to this window.
 
 This method must be called before the window is activated by calling RWindowBase::Activate().
-Otherwise this will be ignored (release build), or panic (debug build). 
+Otherwise the client is panicked with the code EWservPanicUnableToEnableAdvPointer.
 
 If this method is not called for the window, it is assumed that the window is not
 able to receive events from multiple pointers, and thus only events from a single
@@ -2798,6 +2798,7 @@
 description above. 
 @param aPriority A priority value - if more than one window group has requested 
 capture for the same key event, the one with the highest priority will capture it.
+The value must be greater than KMinTInt.
 @return A handle identifying the capture key, or one of the system-wide error 
 codes (if <0). KErrPermissionDenied indicates that the requested key cannot be 
 captured by this window group, because it has been protected by another window group. 
@@ -2866,6 +2867,7 @@
 aModifierMask need to be set and which need to be unset. 
 @param aPriority A priority value - if more than one window group has requested 
 capture for the same key event, the one with the highest priority will capture it.
+The value must be greater than KMinTInt.
 @return A handle identifying the capture key, or one of the system-wide error 
 codes (if < 0). KErrPermissionDenied indicates that the requested key cannot be captured by this 
 window group, because it has been protected by another window group. For more information, see 
@@ -2937,6 +2939,7 @@
 not set. Modifier key states are defined in TEventModifier. 
 @param aPriority If more than one window group has requested capture for the 
 same long key event, the one with the highest priority will capture the event.
+The value must be greater than KMinTInt.
 @param aFlags Configures the long key capture behaviour. See the TLongCaptureFlags 
 enum.
 @return Identifying value for the long key capture. For use with the CancelCaptureLongKey() 
@@ -2972,6 +2975,7 @@
 not set. Modifier key states are defined in TEventModifier. 
 @param aPriority If more than one window group has requested capture for the 
 same long key event, the one with the highest priority will capture the event.
+The value must be greater than KMinTInt.
 @param aFlags Configures the long key capture behaviour. See the TLongCaptureFlags 
 enum.
 @return Identifying value for the long key capture. For use with the CancelCaptureLongKey() 
--- a/windowing/windowserver/nga/CLIENT/RWS.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nga/CLIENT/RWS.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -22,6 +22,7 @@
 #include "CLIENT.H"
 #include "graphics/windowserverconstants.h"
 #include "rtfxeffect.h"
+#include <wspublishandsubscribedata.h>
 
 const TInt KMaxWSERVMessagesSlot=-1;
 
@@ -2585,3 +2586,15 @@
 	RTFXEffect tfxEffect(iWsHandle, iBuffer);
 	tfxEffect.OverrideTFXEffect(RTFXEffect::ETFXSession, aAction, aPurpose, aResourceDir, aFilenameOutgoing, aFilenameIncoming, aFlags);
 	}
+
+EXPORT_C void RWsSession::IndicateAppOrientation(TRenderOrientation aOrientation)
+/**
+Application informs window server the orientation of rendering it intends to use
+
+@param aOrientation The orientation the application intends to use
+
+@publishedPartner
+*/
+	{
+	return(WriteInt(aOrientation,EWsClOpIndicateAppOrientation));
+	}
--- a/windowing/windowserver/nga/SERVER/CAPKEY.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nga/SERVER/CAPKEY.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1995-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -24,9 +24,6 @@
 _LIT(KWsProtectedKey, "PROTECTEDKEY");
 _LIT(KWsProtectedWindowName, "PROTECTEDKEYWINDOWNAME");
 
-TPriQue<CWsCaptureKeyUpsAndDowns> CWsCaptureKeyUpsAndDowns::iCaptureKeysUpsAndDowns(_FOFF(CWsCaptureKeyUpsAndDowns,iLink));
-TPriQue<CWsCaptureLongKey> CWsCaptureLongKey::iCaptureLongKeys(_FOFF(CWsCaptureLongKey,iLink));
-
 
 /*CWsCaptureKey*/
 
@@ -35,20 +32,38 @@
 
 CWsCaptureKey::~CWsCaptureKey()
 	{
-	TWindowServerEvent::CancelCaptureKey((TUint32)this);
+	TWindowServerEvent::CancelCaptureKey(ECaptureTypeKey, this);
 	}
 
-void CWsCaptureKey::CmdToParams(const TWsWinCmdCaptureKey &aCaptureKey, TCaptureKey &aParams)
+/**
+Convert a window server key capture command to a capture request for the
+key routing plug-in.
+
+@param	aCaptureKey		Input capture command
+@param	aRequest		Output capture request
+*/
+void CWsCaptureKey::CmdToRequest(const TWsWinCmdCaptureKey &aCaptureKey, TKeyCaptureRequest &aRequest)
 	{
-	aParams.iModifiers.iMask=aCaptureKey.modifierMask;
-	aParams.iModifiers.iValue=aCaptureKey.modifiers;
-	aParams.iKeyCodePattern.iKeyCode=(TInt16)aCaptureKey.key;
-	aParams.iKeyCodePattern.iPattern=EMatchKey;
-	aParams.iKeyCodePattern.iFiller=STATIC_CAST(TUint8,aCaptureKey.priority);
-	aParams.iApp=(TUint32)iWindowGroup;
-	aParams.iHandle=(TUint32)this;
+	aRequest.iType = ECaptureTypeKey;
+	aRequest.iModifierMask = aCaptureKey.modifierMask;
+	aRequest.iModifiers = aCaptureKey.modifiers;
+	aRequest.iInputCode = aCaptureKey.key;
+	aRequest.iOutputCode = aCaptureKey.key;
+	aRequest.iPriority = aCaptureKey.priority;
+	aRequest.iWindowGroup = iWindowGroup;
+	aRequest.iWindowGroupId = iWindowGroup ? iWindowGroup->Identifier() : 0;
+	aRequest.iAppUid = iWsOwner ? TUid::Uid(iWsOwner->SecureId().iId) : KNullUid;
+	aRequest.iHandle = this;
 	}
 
+/**
+Check for protected key in a capture command
+
+@param	aWindowGroup	Window Group of capture request
+@param	aCaptureKey		Key capture command
+
+@leave KErrPermissionDenied		Capture key is protected
+*/
 void CheckProtectedKeyL(CWsWindowGroup* aWindowGroup,const TWsWinCmdCaptureKey &aCaptureKey)
 	{
 	//The key specified in the WSINI file with the keyword: PROTECTEDKEY can only be captured 
@@ -56,7 +71,7 @@
 	TInt protectedKey;
 	if(WsIniFile->FindVar(KWsProtectedKey,protectedKey))
 		{
-		if (aCaptureKey.key == (TUint)protectedKey)
+		if (aCaptureKey.key == static_cast<TUint>(protectedKey))
 			{
 			if (aWindowGroup->GroupName()==NULL)
 				{
@@ -73,20 +88,36 @@
 		}
 	}
 
+/**
+Construct a capture object for normal key events and make a capture request
+to the key routing plug-in.
+
+@param	aCaptureKey		Key capture command from RWindowGroup::CaptureKey(),
+						RWsSession::SetHotKey() or default hot key settings.
+*/
 void CWsCaptureKey::ConstructL(const TWsWinCmdCaptureKey &aCaptureKey)
 	{
 	CheckProtectedKeyL(iWindowGroup, aCaptureKey);
 	NewObjL();
-	TCaptureKey params;
-	CmdToParams(aCaptureKey, params);
-	TWindowServerEvent::AddCaptureKeyL(params);
+
+	TKeyCaptureRequest request;
+	CmdToRequest(aCaptureKey, request);
+	TWindowServerEvent::AddCaptureKeyL(request);
 	}
 
+/**
+Make a capture request update for normal key events to the key routing plug-in.
+
+@param	aCaptureKey		Key capture command from CWsHotKey::SetL()
+
+Note: this function is used only to disable hot key capture requests or to
+reset them to their defaults.
+*/
 void CWsCaptureKey::SetL(const TWsWinCmdCaptureKey &aCaptureKey)
 	{
-	TCaptureKey params;
-	CmdToParams(aCaptureKey, params);
-	TWindowServerEvent::SetCaptureKey((TUint32)this, params);
+	TKeyCaptureRequest request;
+	CmdToRequest(aCaptureKey, request);
+	TWindowServerEvent::UpdateCaptureKeyL(request);
 	}
 
 void CWsCaptureKey::CommandL(TInt , const TAny *)
@@ -101,37 +132,39 @@
 
 CWsCaptureKeyUpsAndDowns::~CWsCaptureKeyUpsAndDowns()
 	{
-	iLink.Deque();
+	TWindowServerEvent::CancelCaptureKey(ECaptureTypeKeyUpDown, this);
 	}
 
+/**
+Construct a capture object for up/down key events and make a capture request
+to the key routing plug-in.
+
+@param	aCaptureKey		Key capture command from
+						RWindowGroup::CaptureKeyUpAndDowns().
+*/
 void CWsCaptureKeyUpsAndDowns::ConstructL(const TWsWinCmdCaptureKey &aCaptureKey)
 	{
 	CheckProtectedKeyL(iWindowGroup, aCaptureKey);
 	NewObjL();
-	iModifierMask=aCaptureKey.modifierMask;
-	iModifierValue=aCaptureKey.modifiers;
-	iScanCode=aCaptureKey.key;
-	iLink.iPriority=aCaptureKey.priority + 1;
-	iCaptureKeysUpsAndDowns.Add(*this);
-	--iLink.iPriority;
+
+	TKeyCaptureRequest request;
+	request.iType = ECaptureTypeKeyUpDown;
+	request.iInputCode = aCaptureKey.key;
+	request.iOutputCode = aCaptureKey.key;
+	request.iModifiers = aCaptureKey.modifiers;
+	request.iModifierMask = aCaptureKey.modifierMask;
+	request.iPriority = aCaptureKey.priority;
+	request.iWindowGroup = iWindowGroup;
+	request.iWindowGroupId = iWindowGroup ? iWindowGroup->Identifier() : 0;
+	request.iAppUid = iWsOwner ? TUid::Uid(iWsOwner->SecureId().iId) : KNullUid;
+	request.iHandle = this;
+	TWindowServerEvent::AddCaptureKeyL(request);
 	}
 
 void CWsCaptureKeyUpsAndDowns::CommandL(TInt , const TAny *)
 	{
 	}
 
-CWsWindowGroup *CWsCaptureKeyUpsAndDowns::CheckForCapture(TUint aScanCode, TUint aModifiers)
-	{
-	TDblQueIter<CWsCaptureKeyUpsAndDowns> iter(iCaptureKeysUpsAndDowns);
-	CWsCaptureKeyUpsAndDowns* cap;
-	while ((cap=iter++)!=NULL)
-		{
-		if (cap->iScanCode==aScanCode && (aModifiers&cap->iModifierMask)==cap->iModifierValue)
-			return(cap->iWindowGroup);
-		}
-	return NULL;
-	}
-
 
 /*CWsCaptureLongKey*/
 
@@ -141,35 +174,40 @@
 
 CWsCaptureLongKey::~CWsCaptureLongKey()
 	{
-	iLink.Deque();
+	TWindowServerEvent::CancelCaptureKey(ECaptureTypeLongKey, this);
 	}
 
+/**
+Construct a capture object for long key events and make a capture request
+to the key routing plug-in.
+
+@param	aCaptureKey		Key capture command from RWindowGroup::CaptureLongKey()
+*/
 void CWsCaptureLongKey::ConstructL(const TWsWinCmdCaptureLongKey &aCaptureKey)
 	{
 	NewObjL();
-	iData=aCaptureKey;
-	if (iData.delay.Int()<0)
+	iFlags = aCaptureKey.flags;
+	iDelay = aCaptureKey.delay;
+	if (iDelay.Int() < 0)
 		{
 		TTimeIntervalMicroSeconds32 time;
-		CKeyboardRepeat::GetRepeatTime(iData.delay,time);
+		CKeyboardRepeat::GetRepeatTime(iDelay, time);
 		}
-	iLink.iPriority=iData.priority + 1;
-	iCaptureLongKeys.Add(*this);
-	--iLink.iPriority;
+
+	TKeyCaptureRequest request;
+	request.iType = ECaptureTypeLongKey;
+	request.iInputCode = aCaptureKey.inputKey;
+	request.iOutputCode = aCaptureKey.outputKey;
+	request.iModifiers = aCaptureKey.modifiers;
+	request.iModifierMask = aCaptureKey.modifierMask;
+	request.iPriority = aCaptureKey.priority;
+	request.iWindowGroup = iWindowGroup;
+	request.iWindowGroupId = iWindowGroup ? iWindowGroup->Identifier() : 0;
+	request.iAppUid = iWsOwner ? TUid::Uid(iWsOwner->SecureId().iId) : KNullUid;
+	request.iHandle = this;
+	TWindowServerEvent::AddCaptureKeyL(request);
 	}
 
 void CWsCaptureLongKey::CommandL(TInt , const TAny *)
 	{
 	}
-
-CWsCaptureLongKey* CWsCaptureLongKey::CheckForCapture(TUint aKeyCode, TInt aModifiers)
-	{
-	TDblQueIter<CWsCaptureLongKey> iter(iCaptureLongKeys);
-	CWsCaptureLongKey* longCapture;
-	while ((longCapture=iter++)!=NULL)
-		{
-		if (aKeyCode==longCapture->iData.inputKey && (aModifiers&longCapture->iData.modifierMask)==longCapture->iData.modifiers)
-			return longCapture;
-		}
-	return NULL;
-	}
--- a/windowing/windowserver/nga/SERVER/EVENT.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nga/SERVER/EVENT.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1994-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -18,6 +18,7 @@
 #include "EVENT.H"
 
 #include "W32STD.H"
+#include <e32uid.h>
 #include <hal.h>
 #include <w32adll.h>
 #include "W32CLICK.H"
@@ -32,12 +33,16 @@
 #include "pointer.h"
 #include "debugbar.h"
 #include "advancedpointereventhelper.h"
+#include "Graphics/wsgraphicdrawerinternal.h"
 
 GLREF_D CDebugLogBase *wsDebugLog;
 
 GLREF_C void StateDump();
 GLREF_C void HeapDump();
 
+_LIT(KDefaultKeyRouterPluginName, "keyrouter.dll");
+_LIT(KWSERVIniFileVarKeyRouterPlugin, "KEYROUTERPLUGIN");
+
 #define IMPOSSIBLE 0xFFFFFFFF
 
 const TWsWinCmdCaptureKey ImpossibleKeyPress=
@@ -160,6 +165,8 @@
 TEventRequestQueue TWindowServerEvent::iScreenDeviceChangedQueue;
 TTime TWindowServerEvent::iPrevOomMessageTime;
 CCaptureKeys *TWindowServerEvent::iCaptureKeys;
+CKeyEventRouter* TWindowServerEvent::iKeyEventRouter;
+RLibrary TWindowServerEvent::iKeyEventRouterLibrary;
 CWsHotKey *TWindowServerEvent::iHotKeys;
 TInt TWindowServerEvent::iModifierState;
 CRawEventReceiver *TWindowServerEvent::iEventReceiver;
@@ -172,12 +179,12 @@
 TInt TWindowServerEvent::iEventHandlerCount=0;
 TRepeatKey CKeyboardRepeat::iCurrentRepeat;
 TRepeatKey CKeyboardRepeat::iAlternateRepeat;
+TRepeatKey CKeyboardRepeat::iLongRepeat;
 TInt CKeyboardRepeat::iRepeatRollover=1;
 CKeyboardRepeat::TRepeatType CKeyboardRepeat::iRepeating=ERepeatNone;
 CKeyboardRepeat *CKeyboardRepeat::iThis=NULL;
 TTimeIntervalMicroSeconds32 CKeyboardRepeat::iInitialTime;
 TTimeIntervalMicroSeconds32 CKeyboardRepeat::iTime;
-CWsWindowGroup *CKeyboardRepeat::iFocus=NULL;
 TBool CKeyboardRepeat::iAlternateRepeatExists=EFalse;
 CWsCaptureLongKey* CKeyboardRepeat::iLongCapture=NULL;
 
@@ -198,6 +205,8 @@
 	{
 	DeleteHotKeys();
 	delete iCaptureKeys;
+	delete iKeyEventRouter;
+	iKeyEventRouterLibrary.Close();
 	CKeyboardRepeat::Destroy();
 	delete iKeyTranslator;
 	delete iEventReceiver;
@@ -231,8 +240,57 @@
 		iKeyTranslator->ChangeKeyData(keyDataDllName);
 		}
 
+	// CCaptureKeys is no longer used but a dummy object is required for
+	// calls to CKeyTranslator::TranslateKey() until capture functionality
+	// has been removed from ektran.dll.
 	iCaptureKeys=new(ELeave) CCaptureKeys;
 	iCaptureKeys->Construct();
+
+	// Load the key event routing plug-in. The DLL name may be overridden
+	// by setting the keyword KEYROUTERPLUGIN in wsini.ini.
+	TPtrC pluginName(KDefaultKeyRouterPluginName);
+	WsIniFile->FindVar(KWSERVIniFileVarKeyRouterPlugin, pluginName);
+	const TUidType uidType(KDynamicLibraryUid, KKeyRouterPluginUid);
+	TInt err = iKeyEventRouterLibrary.Load(pluginName, uidType);
+
+	if (wsDebugLog)
+		{
+		TLogMessageText buf;
+
+		if (err == KErrNone)
+			{
+			_LIT(KLogLoadOk, "Loaded plugin '%S' UID3 0x%x");
+			const TFileName& pluginPathname = iKeyEventRouterLibrary.FileName();
+			const TUid uid3 = iKeyEventRouterLibrary.Type()[2];
+			buf.Format(KLogLoadOk, &pluginPathname, uid3.iUid);
+			}
+		else
+			{
+			_LIT(KLogLoadError, "Failed to load plugin '%S' (error %d)");
+			buf.Format(KLogLoadError, &pluginName, err);
+			}
+
+		wsDebugLog->MiscMessage(CDebugLogBase::ELogImportant, buf);
+		}
+
+	if (err != KErrNone)
+		{
+#ifdef _DEBUG
+		_LIT(KLoadError, "WServ: failed to load plugin '%S' (error %d)");
+		RDebug::Print(KLoadError, &pluginName, err);
+#endif
+		User::Leave(err);
+		}
+
+	// Create the key event router
+	typedef CKeyEventRouter* (*TCreateFunc)();
+	TCreateFunc newL = reinterpret_cast<TCreateFunc>(iKeyEventRouterLibrary.Lookup(1));
+	if (newL == NULL)
+		{
+		User::Leave(KErrNotFound);
+		}
+	iKeyEventRouter = (*newL)();
+
 	for (TInt index=0;index<TWindowServerEvent::ENumHotKeys;index++)
 		ConstructDefaultHotKeyL(index,DefaultHotKeys[index]);
 	CKeyboardRepeat::NewL();
@@ -312,6 +370,7 @@
 	captureKey.modifiers=aHotKey.modifiers;
 	captureKey.modifierMask=aHotKey.modifierMask;
 	captureKey.key=aHotKey.keycode;
+	captureKey.priority = 0;
 	hotKey->ConstructLD(captureKey);
 //
 	LinkHotKey(hotKey);
@@ -622,6 +681,21 @@
 	TWsEvent event;
 	event.SetType(EEventDisplayChanged);
 	event.SetTimeNow();
+	
+    // fill in the handle otherwise CONE will discard the notification
+    CWsObjectIx* clientObjList = aWsClient->ObjectIndex();
+    const TWsObject* ptr=clientObjList->FirstObject();
+    const TWsObject* end=ptr+clientObjList->Length();
+    while(++ptr<end)    // first one should always have a NULL object
+        {
+        const CWsObject* obj=ptr->iObject;
+        if (obj && obj->Type()==WS_HANDLE_GROUP_WINDOW)
+            {
+            event.SetHandle(ptr->iHandle);
+            break;
+            }
+        }	
+	
 	TWsDisplayChangedEvent* dispEvent = event.DisplayChanged();
 	dispEvent->iDisplayNumber = aDisplayNumber;
 	dispEvent->iConfigurationChangeId = aConfigurationChangeId;
@@ -641,23 +715,68 @@
 	aWin->EventQueue()->QueueEvent(aEvent, aPriority);
 	}
 
-void TWindowServerEvent::QueueKeyPress(const TKeyData& aKey, TInt aScanCode, CWsWindowGroup* aRepeatFocus, TBool aCheckRepeat,TInt aRepeats)
+/**
+Process a key press event.
+
+This function is called for every input key event and uses the Key Event
+Routing plug-in to check for short and long key capture and determine the
+destination window group for the queued event(s).
+Window server hotkeys are also processed.
+Note that the key repeat timer is started here but the key repeat events
+generated by the timer go directly to QueueKeyPress().
+
+@param	aKeyEvent		Input key event
+@param	aCheckRepeat	Check for key repeat and long key capture
+@param	aRepeats		Repeat count
+*/
+void TWindowServerEvent::ProcessKeyPress(const TKeyEvent& aKeyEvent, TBool aCheckRepeat, TInt aRepeats)
  	{
-	CWsWindowGroup* focusWin=CWsTop::FocusWindowGroup();
-	TWsEvent event;
-	TKeyEvent& keyEvent=*event.Key();
-	keyEvent.iCode=aKey.iKeyCode;
-	keyEvent.iScanCode=aScanCode;
-	keyEvent.iModifiers=aKey.iModifiers;
-	keyEvent.iRepeats=aRepeats;
-	if (!aRepeatFocus && CClick::IsHandler())
-		CClick::KeyEvent(EEventKey,keyEvent);
-	CWsCaptureLongKey* longCapture=NULL;
-	if (aCheckRepeat)
-		longCapture=CWsCaptureLongKey::CheckForCapture(aKey.iKeyCode, aKey.iModifiers);
-	if (aKey.iIsCaptureKey)
+	CWsWindowGroup* focusWin = CWsTop::FocusWindowGroup();
+	TUid focusAppUid = focusWin ? TUid::Uid(focusWin->Client()->SecureId().iId) : KNullUid;
+
+	// Route the key event and check for short key capture.
+	// Note that the Key Routing plugin may translate or block key events.
+	TKeyEventRouterInput input(ECaptureTypeKey, aKeyEvent, focusWin, focusAppUid);
+	TKeyEventRouterOutput output;
+
+#ifdef _DEBUG
+	// RouteKey() must not fail. Check for leaves in case the plug-in
+	// is badly behaved.
+	TRAPD(err, iKeyEventRouter->RouteKey(input, output));
+	WS_ASSERT_DEBUG(err == KErrNone, EWsPanicKeyEventRouterLeave);
+#else
+	iKeyEventRouter->RouteKey(input, output);
+#endif
+
+	WS_ASSERT_DEBUG(output.iResult == ERouted || output.iResult == ECaptured || output.iResult == EConsumed, EWsPanicKeyEventRouterBadResult);
+
+	if (output.iResult == EConsumed)
 		{
-		if (aKey.iApp==NULL)	// Captured by Wserv itself
+		focusWin = NULL;
+		}
+	else
+		{
+		focusWin = static_cast<CWsWindowGroup*>(output.iWindowGroup);
+		}
+	WS_ASSERT_DEBUG((focusWin == NULL || focusWin->Type() == WS_HANDLE_GROUP_WINDOW) && (output.iResult != ERouted || focusWin == CWsTop::FocusWindowGroup()), EWsPanicKeyEventRouterBadWindowGroup);
+
+	// Ensure that short event is not marked with EModifierLongKey
+	output.iKeyEvent.iModifiers &= ~EModifierLongKey;
+
+	// Generate key click unless the event is consumed. This is consistent
+	// with the behaviour when CKeyTranslator::TranslateKey() yields no
+	// translation for a particular scan code. (Click events for key up/down
+	// will still be generated by QueueKeyUpDown()). Note however that a long
+	// key press may still be captured even if the short event is consumed.
+	if (CClick::IsHandler() && output.iResult != EConsumed)
+		{
+		output.iKeyEvent.iRepeats = aRepeats;
+		CClick::KeyEvent(EEventKey, output.iKeyEvent);
+		}
+
+	if (output.iResult == ECaptured)
+		{
+		if (output.iWindowGroup == NULL)	// Captured by Wserv itself
 			{
 			_LIT(KWSERVDebugLogCapturedKey,"WSERV Captured Key");
 			CScreen* focusScreen=CWsTop::CurrentFocusScreen();
@@ -668,7 +787,7 @@
 			CWsHotKey *hotKey=iHotKeys;
 			while(hotKey)
 				{
-				if (hotKey->KeyHandle()==aKey.iHandle)
+				if (hotKey->KeyHandle() == reinterpret_cast<TInt>(output.iCaptureHandle))
 					{
 					switch(hotKey->HotKeyType())
 						{
@@ -753,22 +872,85 @@
 			WS_PANIC_ALWAYS(EWsPanicUnknownCaptureKey);
 			return;
 			}
-		focusWin=((CWsWindowGroup *)aKey.iApp);
+
 		_LIT(KWSERVDebugLogKeyCapturedByApp,"Key captured by app %d");
 		if (wsDebugLog)
 			wsDebugLog->MiscMessage(CDebugLogBase::ELogEverything,KWSERVDebugLogKeyCapturedByApp,focusWin->Identifier());
 		if (CWsPassword::PasswordModeActive() && focusWin!=CWsPassword::PasswordWindow()->WinGroup())
 			return;
 		}
-	if (aRepeatFocus && aRepeatFocus!=focusWin)
-		CKeyboardRepeat::CancelRepeat(NULL);		// Repeat is going to different window so cancel it and don't deliver this key
-	else if (focusWin!=NULL && focusWin->CheckForPriorityKey(aKey,aScanCode)==EFalse)
+
+	CWsCaptureLongKey* longCapture = NULL;
+	TKeyEventRouterOutput longOutput;
+	if (aCheckRepeat)
 		{
-		if (longCapture || (aCheckRepeat && !aRepeatFocus && aKey.iModifiers&EModifierAutorepeatable))
+		// Check for long key capture.
+		// Note that a long key event can only result from capture, there is
+		// no default detection or routing of long events.
+		input.iType = ECaptureTypeLongKey;
+#ifdef _DEBUG
+		TRAPD(err, iKeyEventRouter->RouteKey(input, longOutput));
+		WS_ASSERT_DEBUG(err == KErrNone, EWsPanicKeyEventRouterLeave);
+#else
+		iKeyEventRouter->RouteKey(input, longOutput);
+#endif
+
+		if (longOutput.iResult == ECaptured)
+			{
+			longCapture = static_cast<CWsCaptureLongKey*>(longOutput.iCaptureHandle);
+
+			// Mark long key events with EModifierLongKey so that applications
+			// can easily distinguish short and long events.
+			longOutput.iKeyEvent.iModifiers |= EModifierLongKey;
+
+			// Start timer to detect long key press
+			CKeyboardRepeat::StartRepeat(aKeyEvent.iScanCode, output, &longOutput);
+			}
+		else if (output.iResult != EConsumed && output.iKeyEvent.iModifiers & EModifierAutorepeatable)
 			{
-			if (CKeyboardRepeat::StartRepeat(aKey,aScanCode,focusWin,longCapture))
-				return;
+			// Start timer for key repeat
+			CKeyboardRepeat::StartRepeat(aKeyEvent.iScanCode, output, NULL);
 			}
+		}
+
+	// Queue the short event
+	if (!longCapture || longCapture->iFlags & ELongCaptureShortEventImmediately)
+		{
+		QueueKeyPress(output, EFalse, aRepeats);
+		}
+	}
+
+/**
+Queue a key press event.
+
+This function is called for each key event produced by ProcessKeyPress(),
+for every key repeat and long key event generated by the timer and also for
+delayed short key events from KeyUp().
+
+@param	aOutput			Output key event from routing plug-in
+@param	aIsRepeat		Event is due to key repeat
+@param	aRepeats		Repeat count
+*/
+void TWindowServerEvent::QueueKeyPress(const TKeyEventRouterOutput& aOutput, TBool aIsRepeat, TInt aRepeats)
+ 	{
+	if (aOutput.iResult == EConsumed)
+		{
+		// Don't deliver this key
+		return;
+		}
+
+	TWsEvent event;
+	TKeyEvent& keyEvent = *event.Key();
+	keyEvent = aOutput.iKeyEvent;
+	keyEvent.iRepeats = aRepeats;
+
+	CWsWindowGroup* focusWin = static_cast<CWsWindowGroup*>(aOutput.iWindowGroup);
+	WS_ASSERT_DEBUG(focusWin == NULL || focusWin->Type() == WS_HANDLE_GROUP_WINDOW, EWsPanicKeyEventRouterBadWindowGroup);
+
+	if (aIsRepeat && aOutput.iResult != ECaptured && focusWin != CWsTop::FocusWindowGroup())
+		CKeyboardRepeat::CancelRepeat(NULL);		// Repeat is going to different window so cancel it and don't deliver this key
+	else if (focusWin != NULL && focusWin->CheckForPriorityKey(keyEvent) == EFalse)
+		{
 		event.SetType(EEventKey);
 		event.SetHandle(focusWin->ClientHandle());
 		if (aRepeats!=0)
@@ -776,18 +958,15 @@
 			CEventQueue* queue=focusWin->EventQueue();
 			queue->Wait();
 			const TWsEvent* prev=queue->PeekLastEvent();
-			if (prev!=NULL && prev->Type()==EEventKey && prev->Key()->iRepeats>0)
+			if (prev != NULL && prev->Type() == EEventKey && prev->Key()->iRepeats > 0 && prev->Key()->iCode == keyEvent.iCode)
 				{
-				event= *prev;
-				event.Key()->iRepeats+=aRepeats;
-				queue->UpdateLastEvent(event);
+				prev->Key()->iRepeats += aRepeats;
 				queue->Signal();
 				if (CClick::IsHandler())
-					CClick::KeyEvent(EEventKeyRepeat,*event.Key());
+					CClick::KeyEvent(EEventKeyRepeat, *prev->Key());
 				return;
 				}
 			queue->Signal();
-			event.Key()->iRepeats=aRepeats;
 			if (CClick::IsHandler())
 				CClick::KeyEvent(EEventKeyRepeat,keyEvent);
 			}
@@ -795,24 +974,69 @@
 		}
 	}
 
+/**
+Queue a key up/down event.
+
+@param	aRawEvent		Raw event
+*/
 void TWindowServerEvent::QueueKeyUpDown(const TRawEvent &aRawEvent)
  	{
-	CWsWindowGroup *focusWin=CWsCaptureKeyUpsAndDowns::CheckForCapture(aRawEvent.ScanCode() __REMOVE_WINS_CHARCODE, iModifierState);
-	if (!focusWin)	// If not captured
-		focusWin=CWsTop::FocusWindowGroup();
-	TWsEvent event;
-	TEventCode type=aRawEvent.Type()==TRawEvent::EKeyUp ? EEventKeyUp : EEventKeyDown;
-	event.Key()->iCode=0;
+	TEventCode type = aRawEvent.Type() == TRawEvent::EKeyUp ? EEventKeyUp : EEventKeyDown;
+
+	// Check for key up/down capture
+	TKeyEvent keyEvent;
+	keyEvent.iScanCode = aRawEvent.ScanCode() __REMOVE_WINS_CHARCODE;
+#if defined(__WINS__)
+	keyEvent.iCode = __WINS_CHARCODE(aRawEvent.ScanCode());
+#else
+	keyEvent.iCode = 0;
+#endif
+	keyEvent.iModifiers = iModifierState;
+	keyEvent.iRepeats = 0;
+
+	CWsWindowGroup* focusWin = CWsTop::FocusWindowGroup();
+	TUid focusAppUid = focusWin ? TUid::Uid(focusWin->Client()->SecureId().iId) : KNullUid;
+
+	TKeyEventRouterInput input(ECaptureTypeKeyUpDown, keyEvent, focusWin, focusAppUid);
+	TKeyEventRouterOutput output;
+#ifdef _DEBUG
+	TRAPD(err, iKeyEventRouter->RouteKey(input, output));
+	WS_ASSERT_DEBUG(err == KErrNone, EWsPanicKeyEventRouterLeave);
+#else
+	iKeyEventRouter->RouteKey(input, output);
+#endif
+
+	if (output.iResult == EConsumed)
+		{
+		// Don't deliver this key. A key click is still generated for the
+		// input event.
+		if (CClick::IsHandler())
+			{
+			CClick::KeyEvent(type, keyEvent);
+			}
+		return;
+		}
+	WS_ASSERT_DEBUG(output.iResult == ERouted || output.iResult == ECaptured, EWsPanicKeyEventRouterBadResult);
+
+	focusWin = static_cast<CWsWindowGroup*>(output.iWindowGroup);
+	WS_ASSERT_DEBUG((focusWin == NULL || focusWin->Type() == WS_HANDLE_GROUP_WINDOW) && (output.iResult != ERouted || focusWin == CWsTop::FocusWindowGroup()), EWsPanicKeyEventRouterBadWindowGroup);
 #if defined(__WINS__)
 	if (focusWin && !focusWin->WsOwner()->RemoveKeyCode())
-		event.Key()->iScanCode=aRawEvent.ScanCode();
-	else
+		{
+		// Restore WINS character code
+		output.iKeyEvent.iScanCode |= output.iKeyEvent.iCode;
+		}
+	output.iKeyEvent.iCode = 0;
 #endif
-	event.Key()->iScanCode=aRawEvent.ScanCode() __REMOVE_WINS_CHARCODE;
-	event.Key()->iModifiers=iModifierState;
-	event.Key()->iRepeats=0;
+
+	output.iKeyEvent.iRepeats = 0;
 	if (CClick::IsHandler())
-		CClick::KeyEvent(type,*event.Key());
+		{
+		CClick::KeyEvent(type, output.iKeyEvent);
+		}
+
+	TWsEvent event;
+	*event.Key() = output.iKeyEvent;
 	if (focusWin!=NULL)
 		{
 		event.SetType(type);
@@ -921,6 +1145,11 @@
 		}
 	}
 
+/*
+Process a raw event
+
+@param	aRawEvent	Raw event
+*/
 void TWindowServerEvent::ProcessRawEvent(const TRawEvent& aRawEvent)
 //
 // Event has completed.
@@ -1020,23 +1249,35 @@
 		case TRawEvent::EKeyDown:
 			{
 			_LIT(KWSERVDebugLogKeyDownArrival,"Key down arrives %d");
-			if(CDebugBar* dbg = CWsTop::Screen()->DebugBar())
+			CScreen* screen = CWsTop::Screen();
+			WS_ASSERT_ALWAYS(screen, EWsPanicNoScreen);
+			if(CDebugBar* dbg = screen->DebugBar())
 				dbg->OnKeyEvent();
 			if (wsDebugLog)
 				wsDebugLog->MiscMessage(CDebugLogBase::ELogEverything,KWSERVDebugLogKeyDownArrival,aRawEvent.ScanCode());
 			CKeyboardRepeat::KeyDown();
 			TKeyData keyData;
+			// Note iCaptureKeys is needed as dummy arg only. Key capture is
+			// now handled in ProcessKeyPress().
 			TBool translated=iKeyTranslator->TranslateKey(aRawEvent.ScanCode(), EFalse,*iCaptureKeys,keyData);
 			ProcessModifierChanges();
 			QueueKeyUpDown(aRawEvent);
 			if (translated)
-				QueueKeyPress(keyData,aRawEvent.ScanCode() __REMOVE_WINS_CHARCODE,NULL,ETrue,0);
+				{
+				TKeyEvent keyEvent;
+				keyEvent.iScanCode = aRawEvent.ScanCode() __REMOVE_WINS_CHARCODE;
+				keyEvent.iCode = keyData.iKeyCode;
+				keyEvent.iModifiers = keyData.iModifiers;
+				ProcessKeyPress(keyEvent, ETrue, 0);
+				}
 			}
 			break;
 		case TRawEvent::EKeyUp:
 			{
 			_LIT(KWSERVDebugLogKeyUpArrival,"Key up arrives %d");
-			if(CDebugBar* dbg = CWsTop::Screen()->DebugBar())
+			CScreen* screen = CWsTop::Screen();
+			WS_ASSERT_ALWAYS(screen, EWsPanicNoScreen);
+			if(CDebugBar* dbg = screen->DebugBar())
 				dbg->OnKeyEvent();
 			if (wsDebugLog)
 				wsDebugLog->MiscMessage(CDebugLogBase::ELogEverything,KWSERVDebugLogKeyUpArrival,aRawEvent.ScanCode());
@@ -1048,7 +1289,11 @@
 			if (translated)
 				{
 				CKeyboardRepeat::CancelRepeat(NULL);
-				QueueKeyPress(keyData,aRawEvent.ScanCode() __REMOVE_WINS_CHARCODE,NULL,EFalse,0);
+				TKeyEvent keyEvent;
+				keyEvent.iScanCode = aRawEvent.ScanCode() __REMOVE_WINS_CHARCODE;
+				keyEvent.iCode = keyData.iKeyCode;
+				keyEvent.iModifiers = keyData.iModifiers;
+				ProcessKeyPress(keyEvent, EFalse, 0);
 				}
 			}
 			break;
@@ -1079,14 +1324,11 @@
  			_LIT(KWSERVDebugLogRepeatingKeyArrival,"Repeating key arrives %d");
  			if (wsDebugLog)
  				wsDebugLog->MiscMessage(CDebugLogBase::ELogEverything,KWSERVDebugLogRepeatingKeyArrival,aRawEvent.ScanCode());
- 			TKeyData keyData;
- 			keyData.iModifiers=iKeyTranslator->GetModifierState();
-			keyData.iApp=0;
-			keyData.iHandle=0;
-			keyData.iIsCaptureKey=EFalse;
-			keyData.iKeyCode=aRawEvent.ScanCode(); 
-			iCaptureKeys->ProcessCaptureKeys(keyData);
-			QueueKeyPress(keyData, aRawEvent.ScanCode() __REMOVE_WINS_CHARCODE,NULL,EFalse,aRawEvent.Repeats());
+			TKeyEvent keyEvent;
+			keyEvent.iScanCode = aRawEvent.ScanCode() __REMOVE_WINS_CHARCODE;
+			keyEvent.iCode = aRawEvent.ScanCode();
+ 			keyEvent.iModifiers = iKeyTranslator->GetModifierState();
+			ProcessKeyPress(keyEvent, EFalse, aRawEvent.Repeats());
  			}
  			break;
 		default:
@@ -1096,33 +1338,26 @@
 
 void TWindowServerEvent::ProcessKeyEvent(const TKeyEvent &aKeyEvent,TInt aRepeats)
 	{
-	TKeyData keyData;
-	keyData.iModifiers=aKeyEvent.iModifiers;
-	keyData.iApp=0;
-	keyData.iHandle=0;
-	keyData.iIsCaptureKey=EFalse;
-	keyData.iKeyCode=aKeyEvent.iCode;
 	if (CKeyboardRepeat::IsAreadyActive())
 		{
 		CKeyboardRepeat::CancelRepeat(NULL);
 		}
-	iCaptureKeys->ProcessCaptureKeys(keyData);
-	QueueKeyPress(keyData,aKeyEvent.iScanCode,NULL,aRepeats==0,aRepeats);
+	ProcessKeyPress(aKeyEvent, aRepeats == 0, aRepeats);
 	}
 
-void TWindowServerEvent::AddCaptureKeyL(const TCaptureKey &aCaptureKey)
+void TWindowServerEvent::AddCaptureKeyL(const TKeyCaptureRequest& aRequest)
 	{
-	iCaptureKeys->AddCaptureKeyL(aCaptureKey,aCaptureKey.iKeyCodePattern.iFiller);
+	iKeyEventRouter->AddCaptureKeyL(aRequest);
 	}
 
-void TWindowServerEvent::SetCaptureKey(TUint32 aHandle, const TCaptureKey &aCaptureKey)
+void TWindowServerEvent::UpdateCaptureKeyL(const TKeyCaptureRequest& aRequest)
 	{
-	iCaptureKeys->SetCaptureKey(aHandle, aCaptureKey,aCaptureKey.iKeyCodePattern.iFiller);
+	iKeyEventRouter->UpdateCaptureKeyL(aRequest);
 	}
 
-void TWindowServerEvent::CancelCaptureKey(TUint32 aHandle)
+void TWindowServerEvent::CancelCaptureKey(TKeyCaptureType aType, TAny* aHandle)
 	{
-	iCaptureKeys->CancelCaptureKey(aHandle);
+	iKeyEventRouter->CancelCaptureKey(aType, aHandle);
 	}
 
 TInt TWindowServerEvent::GetModifierState()
@@ -1463,21 +1698,27 @@
 	iTime=aTime;
 	}
 
+/**
+Process timer events.
+
+Called when the key repeat timer expires, this function generates the
+appropriate long key or repeated key event. If the timer was started for
+normal key repeat or if the long key event was captured with the automatic
+repeat option specified then the timer is restarted.
+*/
 void CKeyboardRepeat::RunL()
 	{
 	User::ResetInactivityTime();
-	//WS_ASSERT_DEBUG(iRepeating!=ERepeatNone, EWsPanicTemp);
+	WS_ASSERT_DEBUG(iRepeating != ERepeatNone, EWsPanicKeyRepeat);
 	TBool timer=ETrue;
 	if (iRepeating>=ERepeatLong)
 		{
 		// Defensive programming - iLongCapture should never be NULL if iRepeating >= ERepeatLong
+		WS_ASSERT_DEBUG(iLongCapture != NULL, EWsPanicKeyRepeat);
 		if (iLongCapture)
 			{
-			iCurrentRepeat.iKey.iApp=REINTERPRET_CAST(TUint32,iLongCapture->iWindowGroup);
-			iCurrentRepeat.iKey.iHandle=0;
-			iCurrentRepeat.iKey.iIsCaptureKey=ETrue;
-			iCurrentRepeat.iKey.iKeyCode=iLongCapture->iData.outputKey;
-			timer=iLongCapture->iData.flags&ELongCaptureRepeatEvents;
+			iCurrentRepeat = iLongRepeat;
+			timer = iLongCapture->iFlags & ELongCaptureRepeatEvents;
 			iRepeating=ERepeatLongRepeated;
 			}
 		else
@@ -1491,53 +1732,67 @@
 		After(iTime);
 	else
 		iRepeating=ERepeatNone;
-	TWindowServerEvent::QueueKeyPress(iCurrentRepeat.iKey,iCurrentRepeat.iScanCode,iFocus,EFalse,1);
+
+	TWindowServerEvent::QueueKeyPress(iCurrentRepeat.iOutput, ETrue, 1);
 	}
 
-TBool CKeyboardRepeat::StartRepeat(const TKeyData &aKey, TInt aScanCode, CWsWindowGroup *aRepeatFocus, CWsCaptureLongKey* aLongCapture)
+/**
+Start key repeat and long key press timer
+
+@param	aInputScanCode	Original scan code (before routing)
+@param	aShortEvent		Short key event (routing plug-in output)
+@param	aLongEvent		Pointer to long key event (routing plug-in output)
+						or NULL if none.
+
+Note: When aLongEvent != NULL, iCurrentRepeat reflects the short key event
+until the timer has expired. This is necessary to allow a delayed short key
+event to be delivered by KeyUp(). CancelRepeat() must therefore examine
+iCurrentRepeat or iLongRepeat according to the repeat type in iRepeat.
+*/
+void CKeyboardRepeat::StartRepeat(TInt aInputScanCode, const TKeyEventRouterOutput& aShortEvent, const TKeyEventRouterOutput* aLongEvent)
 	{
 	TTimeIntervalMicroSeconds32 time;
-	TBool ret=EFalse;
-	iCurrentRepeat.iScanCode=aScanCode;
-	iCurrentRepeat.iKey=aKey;
+	iCurrentRepeat.iInputScanCode = aInputScanCode;
+	iCurrentRepeat.iOutput = aShortEvent;
 
-	if (aLongCapture)
+	if (aLongEvent)
 		{
-		iLongCapture=aLongCapture;
-		iRepeating=ERepeatLong;
-		time=aLongCapture->iData.delay;
-		ret=!(aLongCapture->iData.flags&ELongCaptureShortEventImmediately);
-		//need window group from long capture key or even better delete it altogether.
-		iFocus=aLongCapture->WindowGroup();
+		iRepeating = ERepeatLong;
+		iLongRepeat.iInputScanCode = aInputScanCode;
+		iLongRepeat.iOutput = *aLongEvent;
+		iLongCapture = static_cast<CWsCaptureLongKey*>(aLongEvent->iCaptureHandle);
+		time = iLongCapture->iDelay;
 		}
 	else
 		{
-		iFocus=aRepeatFocus;
+		iLongCapture = NULL;
 		iRepeating=ERepeatNormal;
 		time=iInitialTime;
 		}
 	iThis->After(time);
-	return ret;
 	}
 
+/**
+Cancel key repeat processing
+*/
 void CKeyboardRepeat::doCancelRepeat()
 	{
 	iRepeating=ERepeatNone;
 	iThis->Cancel();
 	}
 
+/**
+Cancel any key repeat associated with the specified window group
+
+@param	aRepeatFocus	Destination window group or NULL for all
+*/
 void CKeyboardRepeat::CancelRepeat(CWsWindowGroup *aRepeatFocus)
 	{
-	if (aRepeatFocus==NULL || aRepeatFocus==iFocus)
+	if (iRepeating != ERepeatNone)
 		{
-		if (iRepeating)
-			doCancelRepeat();
-		iAlternateRepeatExists=EFalse;
-		}
-	else if (iRepeating >= ERepeatLong)
-		{
-		// Defensive programming - iLongCapture should never be NULL if iRepeating >= ERepeatLong
-		if (iLongCapture && iLongCapture->iWindowGroup == aRepeatFocus)
+		if (aRepeatFocus == NULL ||
+			(iRepeating == ERepeatNormal) && (aRepeatFocus == iCurrentRepeat.iOutput.iWindowGroup) ||
+			(iRepeating >= ERepeatLong) && (aRepeatFocus == iLongRepeat.iOutput.iWindowGroup))
 			{
 			doCancelRepeat();
 			iAlternateRepeatExists=EFalse;
@@ -1545,36 +1800,38 @@
 		}
 	}
 
-void CKeyboardRepeat::CancelRepeat(CWsWindowGroup *aRepeatFocus,TUint aScanCode,TBool aLongCaptureFlag,TUint aModifiers)
+/**
+Cancel any key repeat associated with the specified capture handle
+
+@param	aCaptureHandle		Handle to capture request
+@param	aLongCaptureFlag	ETrue for long key capture, EFalse for normal key
+*/
+void CKeyboardRepeat::CancelRepeat(const TAny* aCaptureHandle, TBool aLongCaptureFlag)
 	{
 	if (aLongCaptureFlag)
 		{
-		// long capture key is cancelled
-		if (iRepeating >= ERepeatLong && iCurrentRepeat.iScanCode==aScanCode)			
-				{
-				// Defensive programming - iLongCapture should never be NULL if iRepeating >= ERepeatLong
-				if (iLongCapture && aRepeatFocus == iLongCapture->iWindowGroup &&
-					(aModifiers & iLongCapture->iData.modifierMask) == iLongCapture->iData.modifiers)
-					{
-					doCancelRepeat();
-					iAlternateRepeatExists=EFalse;
-					}
-				}
+		// Cancel repeat for long capture key
+		if (iRepeating >= ERepeatLong && aCaptureHandle == iLongRepeat.iOutput.iCaptureHandle)
+			{
+			doCancelRepeat();
+			iAlternateRepeatExists=EFalse;
+			}
 		}
 	else
 		{
-		// normal capture key is cancelled
-		if (aRepeatFocus==iFocus)
+		// Cancel repeat for normal capture key
+		if (iRepeating == ERepeatNormal && aCaptureHandle == iCurrentRepeat.iOutput.iCaptureHandle)
 			{
-			if (iRepeating>=ERepeatNormal && iCurrentRepeat.iScanCode==aScanCode)
-				{
-				doCancelRepeat();
-				}
+			doCancelRepeat();
 			iAlternateRepeatExists=EFalse;
 			}
 		}
 	}
 	
+/**
+Process a key down event during key repeat.
+The current repeat data is saved for possible restoration after rollover.
+*/
 void CKeyboardRepeat::KeyDown()
 	{
 	if (iRepeating!=ERepeatNone)
@@ -1588,18 +1845,26 @@
 		}
 	}
 
+/**
+Process a key up event during key repeat.
+Send delayed short key event if necessary for long key event processing.
+Switch to alternate repeat if rollover key was released.
+
+@param	aScanCode	Scan code
+*/
 void CKeyboardRepeat::KeyUp(TInt aScanCode)
 	{
-	if (iAlternateRepeatExists && iAlternateRepeat.iScanCode==aScanCode)
+	if (iAlternateRepeatExists && iAlternateRepeat.iInputScanCode == aScanCode)
 		iAlternateRepeatExists=EFalse;
-	if (iRepeating!=ERepeatNone && iCurrentRepeat.iScanCode==aScanCode)
+	if (iRepeating != ERepeatNone && iCurrentRepeat.iInputScanCode == aScanCode)
 		{
 		if (iRepeating==ERepeatLong)
 			{
 			// Defensive programming - iLongCapture should never be NULL if iRepeating >= ERepeatLong			
-			if (iLongCapture && !(iLongCapture->iData.flags&ELongCaptureShortEventImmediately))
+			WS_ASSERT_DEBUG(iLongCapture != NULL, EWsPanicKeyRepeat);
+			if (iLongCapture && !(iLongCapture->iFlags & ELongCaptureShortEventImmediately))
 				{
-				TWindowServerEvent::QueueKeyPress(iCurrentRepeat.iKey,iCurrentRepeat.iScanCode,NULL,EFalse,0);	
+				TWindowServerEvent::QueueKeyPress(iCurrentRepeat.iOutput, EFalse, 0);
 				}
 			}			
 		if (iAlternateRepeatExists)
--- a/windowing/windowserver/nga/SERVER/EVENT.H	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nga/SERVER/EVENT.H	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1999-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -28,6 +28,7 @@
 #include "EVQUEUE.H"
 #include <w32adll.h>
 #include "Graphics/WSGRAPHICDRAWER.H"
+#include <graphics/wskeyrouter.h>
 
 class CWsClient;
 class CWsWindowBase;
@@ -78,8 +79,8 @@
 class TRepeatKey
 	{
 public:
-	TKeyData iKey;
-	TInt iScanCode;
+	TKeyEventRouterOutput iOutput;
+	TInt iInputScanCode;
 	};
 
 class CKeyboardRepeat : public CTimer
@@ -90,9 +91,9 @@
 	static void Destroy();
 	static void KeyDown();
 	static void KeyUp(TInt aScanCode);
-	static TBool StartRepeat(const TKeyData &aKey, TInt aScanCode, CWsWindowGroup *aRepeatFocus, CWsCaptureLongKey* longCapture);
+	static void StartRepeat(TInt aInputScanCode, const TKeyEventRouterOutput& aShortEvent, const TKeyEventRouterOutput* aLongEvent);
 	static void CancelRepeat(CWsWindowGroup *aRepeatFocus);
-	static void CancelRepeat(CWsWindowGroup *aRepeatFocus,TUint aScanCode,TBool aLongCaptureFlag,TUint aModifiers=0);
+	static void CancelRepeat(const TAny* aCaptureHandle, TBool aLongCaptureFlag);
 	static void SetRepeatTime(const TTimeIntervalMicroSeconds32 &aInitialTime, const TTimeIntervalMicroSeconds32 &aTime);
 	static void GetRepeatTime(TTimeIntervalMicroSeconds32 &aInitialTime, TTimeIntervalMicroSeconds32 &aTime);
 	static inline TBool IsAreadyActive();
@@ -108,13 +109,13 @@
 	static void doCancelRepeat();
 	void RunL();
 private:
-	static CWsWindowGroup *iFocus;
 	static CKeyboardRepeat *iThis; // Needed as CTimer derived parts can't be static
 	static TTimeIntervalMicroSeconds32 iInitialTime;
 	static TTimeIntervalMicroSeconds32 iTime;
+	static TRepeatType iRepeating;
 	static TRepeatKey iCurrentRepeat;
-	static TRepeatType iRepeating;
 	static TRepeatKey iAlternateRepeat;
+	static TRepeatKey iLongRepeat;
 	static TBool iAlternateRepeatExists;
 	static CWsCaptureLongKey* iLongCapture;
 	static TInt iRepeatRollover;
@@ -174,9 +175,9 @@
 	static CWsHotKey* ClearHotKeysL(TInt aHotKey);
 	static void ResetDefaultHotKeyL(TInt aHotKey);
 	static void SetHotKeyL(const TWsClCmdSetHotKey &aHotKey);
-	static void AddCaptureKeyL(const TCaptureKey &aCaptureKey);
-	static void SetCaptureKey(TUint32 aHandle, const TCaptureKey &aCaptureKey);
-	static void CancelCaptureKey(TUint32 aHandle);
+	static void AddCaptureKeyL(const TKeyCaptureRequest& aRequest);
+	static void UpdateCaptureKeyL(const TKeyCaptureRequest& aRequest);
+	static void CancelCaptureKey(TKeyCaptureType aType, TAny* aHandle);
 	static void ClientDestroyed(CWsClient *aClient);
 	static inline void AddToSwitchOnEventListL(const CWsWindowBase &aWindow, TEventControl aCircumstances);
 	static inline void RemoveFromSwitchOnEventList(const CWsWindowBase &aWindow);
@@ -207,7 +208,8 @@
 	static void SendScreenDeviceChangedEvent(const CWsWindowBase *aWindow);
 	static TBool ProcessErrorMessages(TWsErrorMessage::TErrorCategory aCategory, TInt aError);
 	static void NotifyOom();
-	static void QueueKeyPress(const TKeyData& aKey, TInt aScanCode, CWsWindowGroup* aRepeatFocus, TBool aCheckRepeat,TInt aRepeats);
+	static void ProcessKeyPress(const TKeyEvent& aKeyEvent, TBool aCheckRepeat,TInt aRepeats);
+	static void QueueKeyPress(const TKeyEventRouterOutput& aOutput, TBool aIsRepeat, TInt aRepeats);
 	static void AddEventHandler(MEventHandler *aEventHandler, TBool aAdvancedPointersEnabled);
 	static void RemoveEventHandler(const MEventHandler *aEventHandler);
 	static void PotentialEventHandlerL(TInt aNum);
@@ -250,6 +252,8 @@
 	static TEventRequestQueue iScreenDeviceChangedQueue;
 	static TTime iPrevOomMessageTime;
 	static CCaptureKeys *iCaptureKeys;
+	static CKeyEventRouter *iKeyEventRouter;
+	static RLibrary iKeyEventRouterLibrary;
 	static CWsHotKey *iHotKeys;
 	static TInt iModifierState;
 	static CRawEventReceiver *iEventReceiver;
--- a/windowing/windowserver/nga/SERVER/POINTER.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nga/SERVER/POINTER.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -81,7 +81,9 @@
 	iEmulatorRotatePointerCoords = WsIniFile->FindVar(KWSERVIniFileVarEmulatorRotPointCoords);
 #endif
 
-	iRootWindow = CWsTop::Screen()->RootWindow();
+	const CScreen* screen = CWsTop::Screen();
+	WS_ASSERT_ALWAYS(screen, EWsPanicNoScreen);
+	iRootWindow = screen->RootWindow();
 	
 	TMachineInfoV1Buf machineInfo;
 	UserHal::MachineInfo(machineInfo);
--- a/windowing/windowserver/nga/SERVER/PRIKEY.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nga/SERVER/PRIKEY.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1996-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -23,7 +23,7 @@
 	__DECLARE_NAME(_S("CPriorityKey"));
 	}
 
-void CPriorityKey::PriorityKey(TInt aHandle, const TKeyData &aKey, TInt aScanCode)
+void CPriorityKey::PriorityKey(TInt aHandle, const TKeyEvent &aKeyEvent)
 //
 // Called when a priority key is pressed
 //
@@ -31,8 +31,7 @@
 	if (!iEventMsg.IsNull())
 		{
 		iPriorityKeyHandle=aHandle;
-		iPriorityKey=aKey;
-		iScanCode=aScanCode;
+		iPriorityKey = aKeyEvent;
 		SignalEvent();
 		}
 	}
@@ -43,11 +42,8 @@
 //
 	{
 	TWsPriorityKeyEvent event;
-	TKeyEvent *key=event.Key();
-	key->iScanCode=iScanCode;
-	key->iCode=iPriorityKey.iKeyCode;
-	key->iModifiers=iPriorityKey.iModifiers;
-	key->iRepeats=0;
+	*event.Key() = iPriorityKey;
+	event.Key()->iRepeats = 0;
 	event.SetHandle(iPriorityKeyHandle);
 	CEventBase::GetData(&event,sizeof(event));
 	iPriorityKeyHandle=0;
@@ -65,7 +61,7 @@
 	return(iKeyCode==aKeycode && iModifierMask==aModifierMask && iModifiers==aModifiers);
 	}
 
-TInt TPriorityKey::KeyMatches(const TKeyData &aKey)
+TInt TPriorityKey::KeyMatches(const TKeyEvent &aKeyEvent)
 	{
-	return(iKeyCode==aKey.iKeyCode && (iModifierMask&aKey.iModifiers)==iModifiers);
+	return(iKeyCode == aKeyEvent.iCode && (iModifierMask & aKeyEvent.iModifiers) == iModifiers);
 	}
--- a/windowing/windowserver/nga/SERVER/PRIKEY.H	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nga/SERVER/PRIKEY.H	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1999-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -37,7 +37,7 @@
 public:
 	TPriorityKey(TUint aKeycode,TUint aModifierMask,TUint aModifiers,TPriorityKey *aPriorityKeys);
 	TInt Equals(TUint aKeycode,TUint aModifierMask,TUint aModifiers);
-	TInt KeyMatches(const TKeyData &aKey);
+	TInt KeyMatches(const TKeyEvent &aKeyEvent);
 public:
 	TPriorityKey *iNext;
 private:
@@ -50,12 +50,11 @@
 	{
 public:
 	CPriorityKey(CWsClient *aOwner);
-	void PriorityKey(TInt aHandle, const TKeyData &aKey, TInt aScanCode);
+	void PriorityKey(TInt aHandle, const TKeyEvent &aKeyEvent);
 	void GetData();
 private:
 	TInt iPriorityKeyHandle;
-	TKeyData iPriorityKey;
-	TInt iScanCode;
+	TKeyEvent iPriorityKey;
 	};
 
 #endif
--- a/windowing/windowserver/nga/SERVER/REDRAWQ.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nga/SERVER/REDRAWQ.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -170,7 +170,9 @@
 	TInt invalidWindows = 0;
 	for (TInt screenNo = 0; screenNo < CWsTop::NumberOfScreens(); ++screenNo)
 		{
-		CWsRootWindow* rootWindow = CWsTop::Screen(screenNo)->RootWindow();
+		const CScreen* screen = CWsTop::Screen(screenNo);
+		WS_ASSERT_ALWAYS(screen, EWsPanicNoScreen);
+		CWsRootWindow* rootWindow = screen->RootWindow();
 		for (CWsWindowGroup *groupWin = rootWindow->Child(); groupWin; groupWin = groupWin->NextSibling())
 			{
 			if (groupWin->WsOwner() == iWsOwner)
--- a/windowing/windowserver/nga/SERVER/SERVER.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nga/SERVER/SERVER.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -19,7 +19,6 @@
 #include "panics.h"
 #include "wstop.h"
 #include "EVENT.H"
-#include <Graphics/WSGRAPHICDRAWERINTERFACE.H>
 #include <bitdraw.h>
 #include <hal.h>
 #include "inifile.h"
@@ -107,6 +106,8 @@
 	void OnActive();
 	void ScheduleRedraw(MWsScreen& aScreen,const TTime& aWhen);
 	void DoRedrawNow(MWsScreen& aScreen);
+	void DoRedrawNow(MWsScreen& aScreen, MWsAnimationScheduler::MScreenUpdateObserver& aObserver);
+	void ClearScreenUpdateObserver(const MWsAnimationScheduler::MScreenUpdateObserver& aObserver);
 private:
 	static TBool OnIdleCallBack(TAny* aAny);
 	void ScheduleUpdate (TInt aScreenNumber, TBool aForce);
@@ -142,6 +143,8 @@
 	~CScreenState();
 	void SetActive ();
 	
+	void WaitForRedraws(MWsAnimationScheduler::MScreenUpdateObserver& aObserver, TInt aNumRedraws);
+	void ClearScreenUpdateObserver(const MWsAnimationScheduler::MScreenUpdateObserver& aObserver);
 	CPeriodic* iUpdateOn;
 	TTime      iExpectedTickTime;
 	TScreenUpdateDetails iScreenUpdateDetails;
@@ -151,6 +154,8 @@
 private:
 	CScreenState (CDefaultAnimationScheduler* aScheduler, TInt aScreenOrdinal);
 	void ConstructL ();
+	void ReleaseRemainingClients();
+	void ReleaseClientsWaitingFor(TUint aCurrentFrame);
 	
 	void RunL();
 	void DoCancel() 
@@ -158,6 +163,18 @@
 		TRequestStatus* tmpTRS = &iStatus;
 		User::RequestComplete(tmpTRS, KErrNone);
 		};
+	class TWaitingClient
+		{
+	public:
+		TWaitingClient(MWsAnimationScheduler::MScreenUpdateObserver& aObserver, TInt aTargetFrame)
+			: iObserver(aObserver), iTargetFrame(aTargetFrame)
+			{
+			}
+		MWsAnimationScheduler::MScreenUpdateObserver& iObserver;
+		TUint iTargetFrame;
+		};
+	TUint iFrameCount;
+	RArray<TWaitingClient> iWaitingClients;
 	};
 
 // If using the default animation scheduler on a device, these two numbers may be worth tweaking in the inifile
@@ -275,6 +292,7 @@
 void CWindowServer::CDefaultAnimationScheduler::CScreenState::ConstructL ()
 	{
 	iUpdateOn = CPeriodic::NewL(EComposeCompletePriority);
+	iWaitingClients.ReserveL(8);
 	CActiveScheduler::Add(this);
 	}
 
@@ -283,19 +301,91 @@
 	CActive::Cancel();
 	iInvalidated.Close();
 	delete iUpdateOn;
+	TInt i = iWaitingClients.Count();
+	while(i--)
+		{
+		iWaitingClients[i].iObserver.ScreenUpdateComplete(KErrAbort);
+		}
+	iWaitingClients.Close();
 	}
 
 void CWindowServer::CDefaultAnimationScheduler::CScreenState::SetActive()
 	{
 	CActive::SetActive ();
 	}
-	
+
+/**
+This function is called from CWsClient d'tor to make sure we will not hang on to any deleted objects. 
+*/
+void CWindowServer::CDefaultAnimationScheduler::CScreenState::ClearScreenUpdateObserver(const MWsAnimationScheduler::MScreenUpdateObserver& aObserver)
+	{
+	const TInt count = iWaitingClients.Count();
+	for(TInt i = count-1 ; i >= 0; i--)
+		{
+		if( &aObserver == &(iWaitingClients[i].iObserver) )
+			{
+			TWaitingClient& client = iWaitingClients[i];
+			client.iObserver.ScreenUpdateComplete(KErrCancel);
+			iWaitingClients.Remove(i);
+			}
+		}
+	}
+
+void CWindowServer::CDefaultAnimationScheduler::CScreenState::WaitForRedraws(MWsAnimationScheduler::MScreenUpdateObserver& aObserver, TInt aNumRedraws)
+	{
+	const TUint targetFrame = iFrameCount + aNumRedraws;
+	TWaitingClient request(aObserver, targetFrame);
+	TInt err = iWaitingClients.Append(request);
+	if(err != KErrNone)
+		{
+		//If OOM and already have 8 waiting clients we will not accept a 9th client
+		aObserver.ScreenUpdateComplete(KErrNoMemory);
+		}
+	}
+
+void CWindowServer::CDefaultAnimationScheduler::CScreenState::ReleaseRemainingClients()
+	{
+	const TInt count = iWaitingClients.Count();
+	for(TInt i = count-1; i >= 0; i--)
+		{
+		TWaitingClient& client = iWaitingClients[i];
+		client.iObserver.ScreenUpdateComplete(KErrNone);
+		iWaitingClients.Remove(i);
+		}
+	}
+
+void CWindowServer::CDefaultAnimationScheduler::CScreenState::ReleaseClientsWaitingFor(TUint aCurrentFrame)
+	{
+	const TInt count = iWaitingClients.Count();
+	for(TInt i = count-1; i >= 0; i--)
+		{
+		TWaitingClient& client = iWaitingClients[i];
+		if(aCurrentFrame == client.iTargetFrame)
+			{
+			client.iObserver.ScreenUpdateComplete(KErrNone);
+			iWaitingClients.Remove(i);
+			}
+		}
+	}
+
 /** 
-Invoked when the rendering pipline signals that it is ready to recieve updated.
+Invoked when the rendering pipline signals that it is ready to receive updates.
 */
 void CWindowServer::CDefaultAnimationScheduler::CScreenState::RunL() 
 	{
+	iFrameCount++;
+	
+	//Complete any clients waiting for this frame
+	ReleaseClientsWaitingFor(iFrameCount);
+	
 	iScreenUpdateDetails.iScheduler->ProcessUpdateCompletion (iScreenUpdateDetails.iScreenNumber);
+	
+	if(!IsActive())
+		{
+		//No further pending frames, release all remaining clients
+		ReleaseRemainingClients();
+		}
+	
 	}
 
 void CWindowServer::CDefaultAnimationScheduler::ProcessUpdateCompletion (TInt aScreenNumber)
@@ -310,6 +400,49 @@
 	ScheduleUpdate (aScreenNumber, ETrue);
 	}
 
+void CWindowServer::CDefaultAnimationScheduler::DoRedrawNow(MWsScreen& aScreen, MWsAnimationScheduler::MScreenUpdateObserver& aObserver)
+	{
+	TInt screenNumber = ScreenNumber (aScreen);
+	TInt redrawCount = 0;
+	
+	// redrawCount is the number of times we should wait for redraws to complete.
+	// If a redraw is not currently active then we need to wait (at most) once: for
+	// any outstanding scheduled update to complete.
+	// If a redraw is currently active then we need to wait (at most) twice: once for
+	// the current update to complete, and once for any outstanding scheduled update to complete.   
+	if (!iScreenState[screenNumber]->IsActive())
+		{
+		// No animation in progress, so force a redraw of due updates.
+		ScheduleUpdate(screenNumber, ETrue);
+
+		// If there is still nothing drawing, set redrawCount to zero to make sure we do not wait.
+		if (!iScreenState[screenNumber]->IsActive())
+			{
+			redrawCount = 0;
+			aObserver.ScreenUpdateComplete(KErrNone);
+			}
+		else
+			{
+			redrawCount = 1;
+			iScreenState[screenNumber]->WaitForRedraws(aObserver, redrawCount);
+			}
+		}
+	else
+		{
+		redrawCount = 2;
+		iScreenState[screenNumber]->WaitForRedraws(aObserver, redrawCount);
+		}
+	}
+
+void CWindowServer::CDefaultAnimationScheduler::ClearScreenUpdateObserver(const MWsAnimationScheduler::MScreenUpdateObserver& aObserver)
+	{
+	const TInt count = iScreenState.Count();
+	for(TInt screenNumber=0; screenNumber<count; screenNumber++) 
+		{
+		iScreenState[screenNumber]->ClearScreenUpdateObserver(aObserver);
+		}
+	}
+
 /**
 Switch to deactivate animation or drawing (based on setting of iInactivityBehaviour).
 See InvokeDueAnimation().
@@ -359,14 +492,14 @@
 /**
 Perform redraw and return only when completed.
 NOTE: This method uses CActiveSchedulerWait to run a "modal wait loop" while the
-		redraw complete signal is pending. When the signal is recieved, AsyncStop() is
+		redraw complete signal is pending. When the signal is received, AsyncStop() is
 		invoked on all active wait loops for the signalling screen. 
 */
 void CWindowServer::CDefaultAnimationScheduler::DoRedrawNow(MWsScreen& aScreen)
 	{	
 	TInt screenNumber = ScreenNumber (aScreen);
 	TInt redrawCount = 0;
-		
+	
 	// redrawCount is the number of times we should wait for redraws to complete.
 	// If a redraw is not currently active then we need to wait (at most) once: for
 	// any outstanding scheduled update to complete.
@@ -735,8 +868,7 @@
 	iDrawerMasterIndex.Close();
 	
 	delete iDefaultAnimationScheduler;
-	iDefaultAnimationScheduler = NULL; //might be called from clients during server destruction
-	iCustomAnimationScheduler = NULL; // not owned	
+	iDefaultAnimationScheduler = NULL; //might be called from clients during server destruction	
 	}
 	
 void CWindowServer::ConstructL()
@@ -799,40 +931,33 @@
 /**
 Custom Animation Scheduler
 */
-TBool CWindowServer::SetCustomAnimationScheduler(MWsAnimationScheduler* aScheduler)
+TBool CWindowServer::SetCustomAnimationScheduler(MWsAnimationScheduler* /*aScheduler*/)
 	{
-	if(!iCustomAnimationScheduler && aScheduler)
-		{
-		iCustomAnimationScheduler = aScheduler;
-		return ETrue;
-		}
 	return EFalse;
 	}
 
 TBool CWindowServer::HasCustomAnimationScheduler() const
 	{
-	return !!iCustomAnimationScheduler;
+	return EFalse;
 	}
 
-TBool CWindowServer::ClearCustomAnimationScheduler(MWsAnimationScheduler* aCurrentScheduler)
+TBool CWindowServer::ClearCustomAnimationScheduler(MWsAnimationScheduler* /*aCurrentScheduler*/)
 	{
-	if(iCustomAnimationScheduler && (iCustomAnimationScheduler == aCurrentScheduler))
-		{
-		iCustomAnimationScheduler = NULL;
-		return ETrue;
-		}
 	return EFalse;
 	}
 	
 MWsAnimationScheduler* CWindowServer::AnimationScheduler()
 	{
-	if(iCustomAnimationScheduler)
-		{
-		return iCustomAnimationScheduler;
-		}
 	return iDefaultAnimationScheduler;
 	}
 
+void CWindowServer::PrepareShutdown()
+	{
+	//Stop the renderloop, i.e. prevent any further calls to MWsAnimationScheduler::Animate() 
+	delete iDefaultAnimationScheduler;
+	iDefaultAnimationScheduler = NULL;
+	}
+
 TInt CWindowServer::RegisterEventHandler(CWsGraphicDrawer* aDrawer, MWsEventHandler* aHandler, TUint32 aEventMask)
 	{
 	if (!aDrawer || !aHandler || aEventMask==0)
--- a/windowing/windowserver/nga/SERVER/openwfc/CLIENT.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nga/SERVER/openwfc/CLIENT.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -1286,6 +1286,9 @@
 		case EWsClOpCreateDrawableSource:
 			CreateDrawableSourceL(*pData.CreateDrawableSource);
 			break;
+		case EWsClOpIndicateAppOrientation:
+			IndicateAppOrientation(*pData.Orientation);
+			break;
 		default:
 			PPanic(EWservPanicOpcode);
 			break;
@@ -2138,6 +2141,17 @@
 	drawableSource->ConstructL(aDrawableSourceData);
 	CleanupStack::Pop();
 	}
+	
+void CWsClient::IndicateAppOrientation(TRenderOrientation aOrientation)
+	{
+	iIndicatedAppOrientation = aOrientation;
+	CWsTop::CheckRenderOrientation();
+	}
+
+TInt CWsClient::GetIndicatedAppOrientation()
+	{
+	return iIndicatedAppOrientation;
+	}
 
 //
 // class CWsCliObj
--- a/windowing/windowserver/nga/SERVER/openwfc/CLIENT.H	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nga/SERVER/openwfc/CLIENT.H	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1999-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -146,7 +146,7 @@
 	inline void PurgePointerEvents();
 
 	// Key events
-	inline void PriorityKeyPressed(TInt aHandle, const TKeyData &aKey, TInt aScanCode);
+	inline void PriorityKeyPressed(TInt aHandle, const TKeyEvent &aKeyEvent);
 
 	// Notification of misc events
 	void AddNotificationL(TInt aKey, const RMessage2& aClientMsg);
@@ -168,6 +168,9 @@
 	TBool RetryEvent(TEventCode aEventCode);
 
     inline void WgMsgQueueOverflow();// Set flag  window group message queue is overflow and has pending messages
+    
+    //Get orientation value that app indicated
+    TInt GetIndicatedAppOrientation();
 
 private: // from MWsClient
 	TInt SendMessage(const CWsGraphicDrawer* aOnBehalfOf, const TDesC8& aData);
@@ -255,6 +258,10 @@
 	
 	// Misc
 	void SetComputeMode(RWsSession::TComputeMode aComputeMode);
+	
+	//Set orientation that application indicated
+	void IndicateAppOrientation(TRenderOrientation aOrientation);
+	
 public:
 	static TWsCmdHeaderBase iCurrentCommand;
 private:
@@ -293,6 +300,7 @@
 	RMessage2 iClientMessage;
 	RHandleBase* iResponseHandle;
 	TInt iMessageIdSeq;
+	TInt iIndicatedAppOrientation;
 
 	//Members for procerssing command buffer
 	static CWsClient* iCurrentClient;	// Client who's buffer is currently being processed
@@ -363,8 +371,8 @@
 inline void CWsClient::HandleClientRequestForPriorityKeyData()
 	{iPriorityKeyEvent->GetData();}
 
-inline void CWsClient::PriorityKeyPressed(TInt aHandle, const TKeyData &aKey, TInt aScanCode)
-	{iPriorityKeyEvent->PriorityKey(aHandle,aKey,aScanCode);}
+inline void CWsClient::PriorityKeyPressed(TInt aHandle, const TKeyEvent &aKeyEvent)
+	{iPriorityKeyEvent->PriorityKey(aHandle, aKeyEvent);}
 
 inline TInt CWsClient::ObjectHandle(const CWsObject* aThis) const
 	{return(iObjectIndex->At(aThis));}
--- a/windowing/windowserver/nga/SERVER/openwfc/GROUPWIN.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nga/SERVER/openwfc/GROUPWIN.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1995-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -515,9 +515,8 @@
 					CWsObject *destroyObj = iWsOwner->HandleToObj(*pData.UInt, WS_HANDLE_CAPTURE_KEY);
 					if (destroyObj)
 						{
-						//Cancel any repeat that is underway for this key
-						const TWsWinCmdCaptureKey& capKey(*pData.CaptureKey);
-						CKeyboardRepeat::CancelRepeat(this,capKey.key,EFalse,capKey.modifierMask);
+						// Cancel any repeat that is underway for this capture
+						CKeyboardRepeat::CancelRepeat(destroyObj, EFalse);
 						delete destroyObj;
 						}
 					else
@@ -535,9 +534,6 @@
 					CWsObject *destroyObj = iWsOwner->HandleToObj(*pData.UInt, WS_HANDLE_CAPTURE_KEY_UPDOWNS);
 					if (destroyObj)
 						{
-						//Cancel any repeat that is underway for this key
-						const TWsWinCmdCaptureKey& capKey(*pData.CaptureKey);
-						CKeyboardRepeat::CancelRepeat(this,capKey.key,EFalse,capKey.modifierMask);
 						delete destroyObj;
 						}
 					else
@@ -555,9 +551,8 @@
 					CWsObject *destroyObj = iWsOwner->HandleToObj(*pData.UInt, WS_HANDLE_CAPTURE_LONG_KEY);
 					if (destroyObj)
 						{
-						//Cancel any repeat that is underway for this key
-						const TWsWinCmdCaptureLongKey& capKey(*pData.CaptureLongKey);
-						CKeyboardRepeat::CancelRepeat(this,capKey.inputKey,ETrue,capKey.modifierMask);
+						// Cancel any repeat that is underway for this capture
+						CKeyboardRepeat::CancelRepeat(destroyObj, ETrue);
 						delete destroyObj;
 						} 
 					else
@@ -906,6 +901,12 @@
 TBool CWsWindowGroup::SetOrdinalPosition(TInt aPos,CWsWindowGroup* aClosingWindow)
 	{
 	TBool ret=ETrue;
+	
+	// Remember if the window group tree is actually changed or not, so that we know whether to 
+	// check the render orientation after the re-ordering is done ( see CWsTop::CheckRenderOrientation()
+	// call at end of this method
+	TBool changed = CheckOrdinalPositionChange(aPos);	
+	
 	if (!iQueue)
 		ret=DoSetOrdinalPosition1(aPos,aClosingWindow);
 	else
@@ -962,6 +963,11 @@
 #endif
 		}
 
+	// If the ordinal positions have changed, check to see if there is a new render orientation
+	// and publish it if so
+	if(changed)
+	    CWsTop::CheckRenderOrientation();
+	
 	return ret;
 	}
 
@@ -1348,13 +1354,13 @@
 		}
 	}
 
-TBool CWsWindowGroup::CheckForPriorityKey(const TKeyData &aKey, TInt aScanCode)
+TBool CWsWindowGroup::CheckForPriorityKey(const TKeyEvent &aKeyEvent)
 	{
 	for(TPriorityKey *pk=iPriorityKeys;pk;pk=pk->iNext)
 		{
-		if (pk->KeyMatches(aKey))
+		if (pk->KeyMatches(aKeyEvent))
 			{	
-			WsOwner()->PriorityKeyPressed(ClientHandle(),aKey, aScanCode);
+			WsOwner()->PriorityKeyPressed(ClientHandle(), aKeyEvent);
 			return(ETrue);
 			}
 		}
--- a/windowing/windowserver/nga/SERVER/openwfc/ScreenRedraw.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nga/SERVER/openwfc/ScreenRedraw.h	Fri Jul 16 11:45:55 2010 +0300
@@ -24,6 +24,7 @@
 #include "wstypes.h"
 #include "tcursor.h"
 #include <Graphics/WSGRAPHICDRAWERINTERFACE.H>
+#include "Graphics/wsgraphicdrawerinternal.h"
 
 class CScreen;
 class CWsRenderStage;
--- a/windowing/windowserver/nga/SERVER/openwfc/WINDOW.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nga/SERVER/openwfc/WINDOW.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -674,6 +674,11 @@
 		aWindowTreeObserver.FlagChanged(*this, MWsWindowTreeObserver::ENonFading, ETrue); 
 		}
 	
+	if(IsTopClientWindow() && (iFlags&EFlagScreenDeviceInvalid) )
+		{
+		aWindowTreeObserver.FlagChanged(*this, MWsWindowTreeObserver::EScreenDeviceValid, EFalse);
+		}
+	
 	if(iAnimList)
 		iAnimList->SendState(aWindowTreeObserver);
 	
--- a/windowing/windowserver/nga/SERVER/openwfc/WSTOP.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nga/SERVER/openwfc/WSTOP.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -46,6 +46,7 @@
 #include "registeredsurfacemap.h"
 #include "windowelementset.h"
 #include "wspluginmanager.h"
+#include "renderorientationtracker.h"
 
 // IDs of p&s properties that optionally contain callbacks that may be used
 // to release singletons owned by libraries at shutdown in order to make 
@@ -209,6 +210,7 @@
 TInt CWsTop::iCheckHeapResult=KErrNotReady;
 TBool CWsTop::iDoHeapCheckAndRestart=EFalse;
 #define RFbsSession_SendCommand_ShutDownMessage 1	// A FBS message that is not published yet and probably never will be.
+CWsRenderOrienationTracker* CWsTop::iRenderOrientationTracker=NULL;
 
 static void DefineSingletonKey(const TUid& aSingletonKey)
 /**
@@ -281,6 +283,8 @@
 void CWsTop::DeleteStaticsL()
 	{
 	iShuttingDown=ETrue;
+	delete iRenderOrientationTracker;	
+	
 	CClick::DeleteStatics();
 	TWsPointer::Stop();
 	CWsClient::DeleteStatics();
@@ -553,6 +557,8 @@
 		StartShell();
 		}
 	UserSvr::WsRegisterSwitchOnScreenHandling(ETrue);
+	
+	iRenderOrientationTracker = CWsRenderOrienationTracker::NewL();	
 	}
 
 
@@ -958,6 +964,18 @@
 	return EFalse;
 	}
 
+/**
+Checks to see if the render orientation has changed, and publishes any new orientaion
+via publish and subscribe
+
+@see KRenderOrientationCategory
+@see KRenderOrientationKey 
+*/
+void CWsTop::CheckRenderOrientation()
+    {
+    iRenderOrientationTracker->CheckRenderOrientation();
+    }
+
 typedef TInt (*ShellEntryPoint)(TAny *);
 
 #if defined(__WINS__)
--- a/windowing/windowserver/nga/SERVER/openwfc/cliwin.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nga/SERVER/openwfc/cliwin.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -1426,6 +1426,13 @@
 			iFlags&=~EFlagScreenDeviceInvalid;
 		else
 			iFlags|=EFlagScreenDeviceInvalid;
+		
+		MWsWindowTreeObserver* windowTreeObserver = iScreen->WindowTreeObserver();
+		if (windowTreeObserver)
+			{
+			windowTreeObserver->FlagChanged(*this, MWsWindowTreeObserver::EScreenDeviceValid, aState);
+			}
+		
 		return ETrue;
 		}
 	return EFalse;
--- a/windowing/windowserver/nga/SERVER/openwfc/screen.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nga/SERVER/openwfc/screen.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -1123,6 +1123,15 @@
 		
 		//updaterotation should not fail after this point (no cleanup)
 			
+        //update the last set config with the new rotation change so we don't incorrectly
+        //change the layer extents
+        if (iDisplayControl)
+            {
+            TDisplayConfiguration config;
+            config.SetRotation(static_cast<TDisplayConfiguration::TRotation>(newRotation));           
+            iConfigChangeNotifier->UpdateLastSetConfiguration(config);
+            }		
+		
 		TWservCrEvent crEvent(TWservCrEvent::EDeviceOrientationChanged,iScreenNumber,&gcOrientation);
 		TWindowServerEvent::NotifyDrawer(crEvent);
 		
@@ -1984,14 +1993,20 @@
 			{
 			TSize oldConfigRes;
 			oldConfig.GetResolution(oldConfigRes);
+            TDisplayConfiguration newConfig;
 			if (oldConfigRes.iWidth == 0 || oldConfigRes.iHeight == 0)
 				{
-				TDisplayConfiguration newConfig;
 				iDisplayControl->GetConfiguration(newConfig);
 				RecalculateModeTwips(&newConfig);	//needs res and twips information
 				}
 			UpdateDynamicScreenModes();
 			
+			//update the last set config in the config change notifier to 
+			//prevent SetConfiguration() from being called again!
+			newConfig.ClearAll();
+			iDisplayControl->GetConfiguration(newConfig);
+			iConfigChangeNotifier->UpdateLastSetConfiguration(newConfig); 			
+			
 			TWindowServerEvent::NotifyDrawer(TWservCrEvent(TWservCrEvent::EScreenSizeModeAboutToChange, iScreenSizeMode));
 			// This will remove all the DSA elements from the scene
 			AbortAllDirectDrawing(RDirectScreenAccess::ETerminateRotation);
@@ -2036,6 +2051,94 @@
 	return reply;
 	}
 
+/**
+ * Updates the screen device display properties. This is to ensure the screen device is 
+ * consistent with any configuration changes not made using CScreen::SetConfiguration.
+ * 
+ * @param aConfigInput a fully populated display configuration
+ **/
+TInt CScreen::UpdateConfiguration(const TDisplayConfiguration& aConfigInput)
+    {
+    TInt reply = KErrNone;
+    if(iDisplayControl)
+        {
+        TDisplayConfiguration config(aConfigInput);
+        TRect sizeModePosition;
+        if (iDisplayPolicy)
+            {   //validate config and update to a valid hardware config
+            reply = iDisplayPolicy->GetSizeModeConfiguration(iScreenSizeMode,config,sizeModePosition);
+            if (reply >= KErrNone)
+                {//set appmode in policy
+                if (iDisplayMapping)
+                    {
+                    iDisplayMapping->SetSizeModeExtent(sizeModePosition,MWsDisplayMapping::KOffsetAll);
+                    }
+                }
+            }
+        else
+            {   //exessive strategy: limit rotation agains curr app mode.
+                //really we want the system to accept the rotation change regardless of the app mode.
+            TDisplayConfiguration::TRotation newRot;
+            if (aConfigInput.GetRotation(newRot))
+                {   //This should cast between rotation enumertaions "properly"
+                if (!(iModes[0][iScreenSizeMode]->iAlternativeRotations&(1<<newRot)))
+                    {
+                    reply=KErrArgument;
+                    }
+                }
+            }
+
+        MWsScene::TSceneRotation oldRotation;
+        oldRotation = iScene->SceneRotation();
+        TSize newUiSize;
+        config.GetResolution(newUiSize);
+        if(iFlags&EHasDynamicSizeModes)
+            {
+            reply = iFallbackMap->Resize(newUiSize);
+            }
+
+        RecalculateModeTwips(&config);   //needs res and twips information
+        UpdateDynamicScreenModes();        
+        
+        TWindowServerEvent::NotifyDrawer(TWservCrEvent(TWservCrEvent::EScreenSizeModeAboutToChange, iScreenSizeMode));
+        // This will remove all the DSA elements from the scene
+        AbortAllDirectDrawing(RDirectScreenAccess::ETerminateRotation);
+        
+        //SetDigitiserAreas needs revisiting if/when we support dynamic resolutions
+        //on a screen with touch input.
+        //SetDigitiserAreas(newUiSize);
+        
+        //failure here should only be because of DSA orientation change failure, which shouldn't happen, either.
+        //Or there may be no change to do.
+        (void)UpdateOrientation(&oldRotation);
+        
+        iWindowElementSet->ResubmitAllElementExtents();
+        if(iDsaDevice && iDsaDevice->GraphicsAccelerator())
+            {
+            iDsaDevice->ChangeScreenDevice(iDsaDevice); // orientation has changed, therefore we need to re-initialise the screen device's graphics accelerator
+            }
+        
+        iRootWindow->AdjustCoordsDueToRotation();
+
+        //TODO jonas: we'd like to not have to clear at all... make the actual change to compositor etc lazily!
+        if(BlankScreenOnRotation())
+            {
+            iRootWindow->ClearDisplay();
+            }
+
+        CWsTop::ClearAllRedrawStores();
+        DiscardAllSchedules();
+        iRootWindow->InvalidateWholeScreen();
+        CWsWindowGroup::SetScreenDeviceValidStates(this);
+        TWindowServerEvent::SendScreenDeviceChangedEvents(this);
+        }
+    else
+        {
+        reply = KErrNotSupported;
+        }
+    return reply;  
+    }
+
 void CScreen::UpdateDynamicScreenModes()
 	{
 	WS_ASSERT_DEBUG(iDisplayControl,EWsPanicNoDisplayControl);
--- a/windowing/windowserver/nga/SERVER/openwfc/screen.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nga/SERVER/openwfc/screen.h	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -249,6 +249,7 @@
 	void ClearDsaSurface(const TRect& area, const TRgb& color);
 	void PositionUiElements(const TRect& aExtent,	const TRect& aViewport);
 	TInt SetConfiguration(const TDisplayConfiguration& aConfig);
+	TInt UpdateConfiguration(const TDisplayConfiguration& aConfig);
 	void UpdateDynamicScreenModes();
 	void RecalculateModeTwips(const TDisplayConfiguration* aConfig = NULL);
 	inline void IncreaseDisplaySpinner();
--- a/windowing/windowserver/nga/SERVER/openwfc/server.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nga/SERVER/openwfc/server.h	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1999-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -27,7 +27,9 @@
 #include "OBJECT.H"
 #include "CLIENT.H"
 #include "ScrDev.H"
+#include <graphics/wskeyrouter.h>
 #include <Graphics/WSGRAPHICDRAWERINTERFACE.H>
+#include "Graphics/wsgraphicdrawerinternal.h"
 #include "WSGRAPHICDRAWERARRAY.H"
 #include "panics.h"
 
@@ -150,7 +152,7 @@
 	inline CWsWindowGroup *WindowGroup();
 	inline const CWsWindowGroup *WindowGroup() const;
 private:
-	void CmdToParams(const TWsWinCmdCaptureKey &aCaptureKey, TCaptureKey &aParams);
+	void CmdToRequest(const TWsWinCmdCaptureKey &aCaptureKey, TKeyCaptureRequest &aParams);
 private:
 	CWsWindowGroup *iWindowGroup;
 	};
@@ -181,21 +183,16 @@
 	~CWsCaptureKeyUpsAndDowns();
 	void ConstructL(const TWsWinCmdCaptureKey &aCaptureKey);
 	void CommandL(TInt aOpcode, const TAny *aCmdData);
-	static CWsWindowGroup *CheckForCapture(TUint aScanCode, TUint aModifiers);
 	inline CWsWindowGroup *WindowGroup();
 	inline const CWsWindowGroup *WindowGroup() const;
 private:
-	TUint iModifierValue;
-	TUint iModifierMask;
-	TUint iScanCode;
-	static TPriQue<CWsCaptureKeyUpsAndDowns> iCaptureKeysUpsAndDowns;
-	TPriQueLink iLink;
 	CWsWindowGroup *iWindowGroup;
 	};
 
 class CWsCaptureLongKey : public CWsObject
 	{
 	friend class CKeyboardRepeat;
+	friend class TWindowServerEvent;
 public:
 	CWsCaptureLongKey(CWsWindowGroup *owner);
 	~CWsCaptureLongKey();
@@ -203,13 +200,10 @@
 	void CommandL(TInt aOpcode, const TAny *aCmdData);
 	inline CWsWindowGroup *WindowGroup();
 	inline const CWsWindowGroup *WindowGroup() const;
-	static CWsCaptureLongKey* CheckForCapture(TUint aKeyCode, TInt aModifiers);
-public:
-	static TPriQue<CWsCaptureLongKey> iCaptureLongKeys;
 private:
-	TPriQueLink iLink;
+	TTimeIntervalMicroSeconds32 iDelay;
+	TUint iFlags;
 	CWsWindowGroup *iWindowGroup;
-	TWsWinCmdCaptureLongKey iData;
 	};
 
 //--------------------------------
@@ -340,6 +334,7 @@
 	void StartL();
 	TInt SessionCount();
 	MWsAnimationScheduler* AnimationScheduler();
+	void PrepareShutdown();
 	TBool ReleaseMemory();
 	void DestroySessionsForShutdown();
 	void SetPinClientDescriptors(TBool aPin);
--- a/windowing/windowserver/nga/SERVER/openwfc/wstop.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nga/SERVER/openwfc/wstop.h	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -56,6 +56,7 @@
 #endif
 	};
 
+class CWsRenderOrienationTracker;
 class CWsTop
 	{
 	enum {EShellBootModeReboot=0,EShellBootModeNoReboot=1,EShellBootModeExit=2};
@@ -122,6 +123,7 @@
 	static TBool MultiFocusPolicy();
 	
 	static inline CWsPluginManager *PluginManager();
+	static void CheckRenderOrientation();
 	
 private:
 	static void InitLogging();
@@ -152,6 +154,7 @@
 	static TInt iCheckHeapResult;
 	static TBool iDoHeapCheckAndRestart;
 	static CWsPluginManager *iPluginManager;
+    static CWsRenderOrienationTracker* iRenderOrientationTracker;	
 	};
 	
 NONSHARABLE_CLASS(CWsActiveScheduler): public CActiveScheduler, public MWsActiveSchedulerDebug
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/windowing/windowserver/nga/SERVER/renderorientationtracker.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,570 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This material, including documentation and any related
+// computer programs, is protected by copyright controlled by
+// Nokia. All rights are reserved. Copying, including
+// reproducing, storing, adapting or translating, any
+// or all of this material requires the prior written consent of
+// Nokia. This material also contains confidential
+// information which may not be disclosed to others without the
+// prior written consent of Nokia.
+//
+// Description:
+// Render Orientation Tracking and Publication
+// 
+
+#include <hal.h>
+#include <e32std.h>
+#include "renderorientationtracker.h"
+#include "rootwin.h"
+#include "windowgroup.h"
+#include "wstop.h"
+#include "..\debuglog\DEBUGLOG.H"
+
+extern CDebugLogBase* wsDebugLog;
+
+/** Convert a TRenderOrientation value into a TDigitiserOrientation.
+Note: The algorithm used makes use of the ordering of the values of the respective enums, 
+thus this is checked for (at compile time) at the start of the function.
+@param aWservOrientation A value from the TRenderOrientation enums.
+@return The equivalent value from the TDigitiserOrientation enums.
+*/
+inline HALData::TDigitiserOrientation WservToDigitiser(TRenderOrientation aWservOrientation)
+	{
+	__ASSERT_COMPILE(EDisplayOrientationNormal+1 == EDisplayOrientation90CW);
+	__ASSERT_COMPILE(EDisplayOrientationNormal+2 == EDisplayOrientation180);
+	__ASSERT_COMPILE(EDisplayOrientationNormal+3 == EDisplayOrientation270CW);
+	__ASSERT_COMPILE(HALData::EDigitiserOrientation_000+1 == HALData::EDigitiserOrientation_090);
+	__ASSERT_COMPILE(HALData::EDigitiserOrientation_000+2 == HALData::EDigitiserOrientation_180);
+	__ASSERT_COMPILE(HALData::EDigitiserOrientation_000+3 == HALData::EDigitiserOrientation_270);
+	HALData::TDigitiserOrientation ret=static_cast<HALData::TDigitiserOrientation>
+			(HALData::EDigitiserOrientation_000 + (aWservOrientation - EDisplayOrientationNormal));
+	return ret;
+	}
+
+// Todo remove/undefine this for release
+#define TECHVIEW_TESTMODE
+
+CWsRenderOrienationTracker* CWsRenderOrienationTracker::NewL()
+    {
+    CWsRenderOrienationTracker* self = new(ELeave)CWsRenderOrienationTracker();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+CWsRenderOrienationTracker::CWsRenderOrienationTracker()
+    : CActive(CActive::EPriorityStandard),
+      iRenderOrientationTrackingType(EDisplayOrientationNormal),
+      iPublishedRenderOrientation(EDisplayOrientationNormal)
+    {
+    CActiveScheduler::Add(this);    
+    }
+
+void CWsRenderOrienationTracker::ConstructL()
+    {    
+    const TSecurityPolicy   KRenderOrientationReadSecurityPolicy(ECapability_None);
+    const TSecurityPolicy   KRenderOrientationWriteSecurityPolicy(ECapabilityWriteDeviceData);
+    
+    // Define P&S Property to publish to
+    TInt error = RProperty::Define( KRenderOrientationCategory,
+                                    KRenderOrientationKey,
+                                    RProperty::EInt,
+                                    KRenderOrientationReadSecurityPolicy,
+                                    KRenderOrientationWriteSecurityPolicy);
+
+    // Attach the publisher for real-time publishing
+    if(KErrNone == error)
+        error = iRenderOrientationPublisher.Attach( KRenderOrientationCategory,
+                                                    KRenderOrientationKey);
+
+    // Publish the initial value
+    if(KErrNone == error)    
+        error = DoPublishOrientation(EDisplayOrientationNormal);
+    
+    //Set the initial value to HAL
+    if(KErrNone == error)
+        SetHALOrientation(EDisplayOrientationNormal);
+    
+    if (wsDebugLog && KErrNone!=error)
+        {
+        _LIT(logText,"Orientation Tracker: failed to initialise with error %d");
+        wsDebugLog->MiscMessage(CDebugLogBase::ELogImportant,logText,error);
+        }    
+    User::LeaveIfError(error);
+    }
+
+CWsRenderOrienationTracker::~CWsRenderOrienationTracker()
+    {
+    Cancel();
+    iRenderOrientationPublisher.Delete(KRenderOrientationCategory, KRenderOrientationKey);
+    iRenderOrientationPublisher.Close();
+    }
+
+/**
+If the orientation of the given window group is useable updates aOrientationTrackingType with the orientation
+
+@param Input: the window group to check
+@param Output: the window group's orientation if usable ( otherwise unchanged )
+@return KErrNone if the orienation is usable, KErrNotFound if the orientation is not useable, KErrNotSupported if the orientation is unknown
+*/
+TInt CWsRenderOrienationTracker::CheckWindowGroupOrientation(const CWsWindowGroup& aWinGroup, TRenderOrientationTrackingType& aOrientationTrackingType)
+    {
+    TInt error = KErrNone;
+    TRenderOrientationTrackingType tempOrientationTrackingType = static_cast<TRenderOrientationTrackingType>(aWinGroup.WsOwner()->GetIndicatedAppOrientation());
+    switch(tempOrientationTrackingType)
+        {
+        case EDisplayOrientationNormal:
+        case EDisplayOrientation90CW:                
+        case EDisplayOrientation180:
+        case EDisplayOrientation270CW:            
+        case EDisplayOrientationAuto:
+            aOrientationTrackingType = tempOrientationTrackingType;
+            break;
+
+        case EDisplayOrientationIgnore:
+            error = KErrNotFound;
+            if (wsDebugLog)
+                {
+                _LIT(logText,"Orientation Tracker: winGroup %08x orientation is set to be ignored");
+                wsDebugLog->MiscMessage(CDebugLogBase::ELogEverything,logText,reinterpret_cast<TInt>(&aWinGroup));
+                }            
+            break;
+
+        default:
+            error = KErrNotSupported;
+            if (wsDebugLog)
+                {
+                _LIT(logText,"Orientation Tracker: winGroup %08x has undefined orientation, Error %d");                
+                TBuf<LogTBufSize> buf;
+                buf.Format(logText, &aWinGroup, error);                
+                wsDebugLog->MiscMessage(CDebugLogBase::ELogIntermediate,buf);
+                }                          
+            break;             
+        }
+    
+    return error;
+    }
+
+/**
+Checks that the given group window is appropriate for dictating the render orientation
+
+@param Input:  The group window to check
+@return ETrue is the group window is usable, else EFalse  
+*/
+TBool CWsRenderOrienationTracker::UseableGroupWindow(const CWsWindowGroup& aWinGroup) const
+    {
+#ifdef TECHVIEW_TESTMODE
+    // for some reason IsFocusable seems to return 0 and 2, not 0 and 1
+    return NULL!=aWinGroup.Child() &&
+            (aWinGroup.IsFocusable() ? ETrue : EFalse);
+#else    
+    return (NULL!=aWinGroup.Child());     
+#endif
+    }
+
+/**
+Finds the topmost usable windowgroup which has a usable orientation, and outputs that orientation
+
+@param Output: The current render orientation
+@return KErrNone if successful, KErrNotFound if the focus window group is not usable, KErrNotSupported if an invalid orientation is found
+*/
+TInt CWsRenderOrienationTracker::GetFocusWindowOrientation(TRenderOrientationTrackingType& aOrientationTrackingType)
+    {
+    TInt error = KErrNone;
+    CWsWindowGroup* focusWinGroup = CWsTop::FocusWindowGroup();    
+    if(!focusWinGroup)
+        {
+        if(wsDebugLog)
+            {
+            _LIT(logText,"Orientation Tracker: focusWinGroup not found");
+            wsDebugLog->MiscMessage(CDebugLogBase::ELogEverything,logText);
+            }
+        error = KErrNotFound;
+        }
+    else
+        {
+        error = CheckWindowGroupOrientation(*focusWinGroup, aOrientationTrackingType);
+        }
+    return error;
+    }
+
+/**
+Finds the topmost usable windowgroup which has a usable orientation, and outputs that orientation
+
+@param Output: The current render orientation
+@return KErrNone if successful, KErrNotSupported if an invalid orientation is found
+*/
+TInt CWsRenderOrienationTracker::FindOrientationFromWindowTree(TRenderOrientationTrackingType& aOrientationTrackingType)
+    {
+    TInt error = KErrNone;
+    TRenderOrientationTrackingType tempOrientationTrackingType = iRenderOrientationTrackingType;
+    CWsRootWindow* rootWin = CWsTop::CurrentFocusScreen()->RootWindow();
+    TBool finished = EFalse;
+    for(CWsWindowGroup* winGroup = rootWin->Child(); !finished && NULL != winGroup; winGroup = winGroup->NextSibling())
+        {
+        if (wsDebugLog)
+            {
+            _LIT(logText,"Orientation Tracker: winGroup %08x has priority %d, Orientation %d, Focusable %d, Child %08x");
+            TBuf<LogTBufSize> buf;
+            buf.Format(logText, winGroup, winGroup->OrdinalPriority(), winGroup->WsOwner()->GetIndicatedAppOrientation(),
+                    winGroup->IsFocusable()?ETrue:EFalse, winGroup->Child());                                
+            wsDebugLog->MiscMessage(CDebugLogBase::ELogEverything,buf);
+            }               
+        // winGroup is a higher priority ordinal, so see if it has an orientation that can be used
+        // although we're only interested in window groups with child windows otherwise nothing is visible anyway        
+        if(UseableGroupWindow(*winGroup))
+            {
+            error = CheckWindowGroupOrientation(*winGroup, tempOrientationTrackingType);
+            switch(error)
+                {
+                case KErrNone:
+                    {
+                    // List is in order, so just find the first one
+                    if (wsDebugLog)
+                        {
+                        _LIT(logText,"Orientation Tracker: Found winGroup %08x with Orientation %d");
+                        TBuf<LogTBufSize> buf;
+                        buf.Format(logText, winGroup, winGroup->WsOwner()->GetIndicatedAppOrientation());                    
+                        wsDebugLog->MiscMessage(CDebugLogBase::ELogEverything,buf);
+                        }
+                    finished = ETrue;
+                    break;
+                    }
+
+                case KErrNotFound:
+                    // so keep searching
+                    break;                    
+                    
+                case KErrNotSupported:
+                default:
+                    finished = ETrue;
+                    break;
+                    
+                }
+            
+            }
+        }
+    // Safe even in error code as won't have been changed by CheckWindowGroupOrientation
+    aOrientationTrackingType = tempOrientationTrackingType;
+    
+    return error;
+    }
+
+/**
+First checks to see if the focus window group has a usable orientation, if so that is output.
+Otherwise, finds the topmost usable windowgroup which has a usable orientation, and outputs that
+
+@param Output: The current render orientation
+@return KErrNone if successful, KErrNotSupported if an invalid orientation is found 
+ */
+TInt CWsRenderOrienationTracker::GetIndicatedOrientation(TRenderOrientationTrackingType& aOrientationTrackingType)
+    {
+    // First check the focus window group
+    TInt error = GetFocusWindowOrientation(aOrientationTrackingType);
+
+    // Don't look for another window if the focus window is usable
+    // or if an error has occured, then don't change current orientation
+    switch(error)
+        {
+        case KErrNone:
+            {
+            if(wsDebugLog)
+                {
+                _LIT(logText,"Orientation Tracker: Using focus window %08x for orientation");
+                wsDebugLog->MiscMessage(CDebugLogBase::ELogEverything,logText,reinterpret_cast<TInt>(CWsTop::FocusWindowGroup()));
+                }
+            break;
+            }
+        
+        case KErrNotFound:
+            {
+            // Can't use focus window group, so find the topmost windowgroup with a valid orientation
+            error = FindOrientationFromWindowTree(aOrientationTrackingType);
+            break;
+            }
+            
+        default:
+            // Unrecoverable error, abort and leave published orientation unchanged
+            break;
+        }
+    
+    return error;
+    }
+
+/**
+Checks to see if the render orientation has changed, and publishes any new orientaion
+via publish and subscribe
+
+@see KRenderOrientationCategory
+@see KRenderOrientationKey 
+*/
+void CWsRenderOrienationTracker::CheckRenderOrientation()
+    {
+    TRenderOrientationTrackingType newOrientationTrackingType = iRenderOrientationTrackingType;    
+    TInt error = GetIndicatedOrientation(newOrientationTrackingType);
+
+    // if the tracking type has changed...
+    if(KErrNone == error && iRenderOrientationTrackingType != newOrientationTrackingType)
+        {
+        if(EDisplayOrientationAuto == iRenderOrientationTrackingType)
+            {
+            // change from auto type, so we need to cancel request for updates from the theme server        
+            Cancel();
+            }    
+        iRenderOrientationTrackingType = newOrientationTrackingType;
+        if(EDisplayOrientationAuto == iRenderOrientationTrackingType)
+            {
+            // Change to auto type, so we need to request updates from the theme server            
+            // Attach to the Theme server to get orientation change updates
+            error = iThemeOrientationProperty.Attach( KThemeOrientationCategory, KThemeOrientationKey );
+            if (wsDebugLog)
+                {
+                if(KErrNone == error)
+                    {
+                    // Information Log
+                    _LIT(logText,"Orientation Tracker: Attached to theme orientation property");
+                    wsDebugLog->MiscMessage(CDebugLogBase::ELogEverything,logText);
+                    }
+                else
+                    {
+                    // Error Log
+                    _LIT(logText,"Orientation Tracker: Error %d attaching to theme orientation property");
+                    wsDebugLog->MiscMessage(CDebugLogBase::ELogIntermediate,logText, error);                
+                    }
+                }              
+            
+            RequestDeviceOrientationNotification();
+            }
+        // See if the  has changed, and publish if it has        
+        error = DoOrientationTracking();
+        }
+
+    if (wsDebugLog && KErrNone != error)
+        {
+        _LIT(logText,"Orientation Tracker: Error %d Checking Render Orientation");
+        wsDebugLog->MiscMessage(CDebugLogBase::ELogImportant,logText, error);
+        }  
+    }
+
+/**
+Requests notification of change of the theme server orientation
+
+@Pre iThemeOrientationProperty has had Attach called on it
+*/
+void CWsRenderOrienationTracker::RequestDeviceOrientationNotification()
+    {
+    if(!IsActive())
+        {
+        if (wsDebugLog)
+            {
+            _LIT(logText,"Orientation Tracker: Subscribing to theme orientation property");
+            wsDebugLog->MiscMessage(CDebugLogBase::ELogEverything,logText);
+            }          
+        // Request for Theme Server Orientation P&S  
+        iThemeOrientationProperty.Subscribe(iStatus);        
+        SetActive();
+        }
+    }
+
+/**
+Cancels and closes (detaches) from the theme orientation publish and subscribe
+*/
+void CWsRenderOrienationTracker::CancelDeviceOrientationNotification()
+    {
+    // Cancel Request for Theme Server Orientation P&S  
+    iThemeOrientationProperty.Cancel();
+    iThemeOrientationProperty.Close();
+    
+    if (wsDebugLog)
+        {
+        _LIT(logText,"Orientation Tracker: Cancelled/closed theme orientation property");
+        wsDebugLog->MiscMessage(CDebugLogBase::ELogEverything,logText);
+        }      
+    }
+
+/**
+Called when the theme servers orientation has changed.
+Re-requests unless cancelled
+*/
+void CWsRenderOrienationTracker::RunL()
+    {
+    TInt error = iStatus.Int();
+    if(KErrNone == error)
+        {
+        // Re-request
+        RequestDeviceOrientationNotification();
+    
+        TInt error = DoOrientationTracking();
+        if (wsDebugLog && KErrNone != error)
+            {
+            _LIT(logText,"Orientation Tracker: Error %d processing theme orientation property");
+            wsDebugLog->MiscMessage(CDebugLogBase::ELogImportant,logText, error);
+            }         
+        }
+    else if (wsDebugLog && KErrCancel != error)
+        {
+        _LIT(logText,"Orientation Tracker: Error %d from theme orientation property, not resubscribed");
+        wsDebugLog->MiscMessage(CDebugLogBase::ELogImportant,logText, error);     
+        }
+    }
+
+/**
+Cancels the request for notification for changes to theme orientation
+*/
+void CWsRenderOrienationTracker::DoCancel()
+    {
+    CancelDeviceOrientationNotification();
+    }
+
+/**
+Gets the orientation published from theme server
+
+@param Output: the theme server orientation
+@return KErrNone if successful, KErrNotSupported if the theme server returns an unknown orientation, else any of the system wide error codes 
+*/
+TInt CWsRenderOrienationTracker::GetThemeOrientation(TRenderOrientation& aThemeOrientation)
+    { 
+    TInt themeOrientation=EDisplayOrientationNormal;
+    TInt error = iThemeOrientationProperty.Get(themeOrientation);
+    if(wsDebugLog && KErrNone != error)
+        {
+        _LIT(logText,"Orientation Tracker: Error %d getting theme orientation property");
+        wsDebugLog->MiscMessage(CDebugLogBase::ELogIntermediate,logText, error);     
+        }
+    
+    if(KErrNone == error)
+        {
+        // Translate the received orientation    
+        switch(themeOrientation)
+            {           
+            case EDisplayOrientationNormal:
+            case EDisplayOrientation90CW:
+            case EDisplayOrientation180:
+            case EDisplayOrientation270CW:
+                // only update if orientation is supported
+                aThemeOrientation = static_cast<TRenderOrientation>(themeOrientation);
+                break;
+            
+            default:
+                error = KErrNotSupported;
+                if (wsDebugLog)
+                    {
+                    _LIT(logText,"Orientation Tracker: Unsupported orientation %d from theme orientation property, Error %d");
+                    TBuf<LogTBufSize> buf;
+                    buf.Format(logText, themeOrientation, error);
+                    wsDebugLog->MiscMessage(CDebugLogBase::ELogIntermediate,buf);     
+                    }                
+                break;
+            }
+        }
+    return error;  
+    }
+
+/**
+Processes the indicated orientation into an actual orientation
+
+@return KErrNone for success, KErrNotSupported if the orientation is unknown, else any of the system wide error codes
+*/
+TInt CWsRenderOrienationTracker::DoOrientationTracking()
+    {
+    TInt error = KErrNone;
+    TRenderOrientation newDeviceOrientation;
+    switch(iRenderOrientationTrackingType)
+        {
+        case EDisplayOrientationNormal:
+        case EDisplayOrientation90CW:                
+        case EDisplayOrientation180:
+        case EDisplayOrientation270CW:            
+            newDeviceOrientation = iRenderOrientationTrackingType;
+            break;
+            
+        case EDisplayOrientationAuto:
+            error = GetThemeOrientation(newDeviceOrientation);
+            break;
+                      
+        default:
+            error = KErrNotSupported;
+            if (wsDebugLog)
+                {
+                _LIT(logText,"Orientation Tracker: Unsupported orientation tracking type %d, error %d");
+                TBuf<LogTBufSize> buf;
+                buf.Format(logText, iRenderOrientationTrackingType, error);
+                wsDebugLog->MiscMessage(CDebugLogBase::ELogIntermediate,buf);     
+                }              
+            break;            
+        }    
+
+    if(KErrNone == error)
+        {
+        error = PublishOrientation(newDeviceOrientation);
+        }
+    
+    return error;
+    }
+
+/**
+Publishes the given value
+
+@param The render orientation to publish
+@return KErrNone for success, else any of the system wide erro codes
+*/
+TInt CWsRenderOrienationTracker::DoPublishOrientation(const TRenderOrientation aRenderOrientation)
+    {
+    TInt error = iRenderOrientationPublisher.Set(aRenderOrientation);
+         
+    // if it's published OK, then remember the newly published value
+    if(KErrNone == error)
+        {
+        iPublishedRenderOrientation = aRenderOrientation;
+        if(wsDebugLog)
+            {
+            _LIT(logText,"Orientation Tracker: Published render orientation %d");
+            wsDebugLog->MiscMessage(CDebugLogBase::ELogEverything, logText, aRenderOrientation);
+            }
+        }
+    else if(wsDebugLog)
+        {
+        _LIT(logText,"Orientation Tracker: Error %d setting render orientation property");
+        wsDebugLog->MiscMessage(CDebugLogBase::ELogIntermediate, logText, error);                   
+        }
+    return error;
+    }
+
+void CWsRenderOrienationTracker::SetHALOrientation(const TRenderOrientation aRenderOrientation)
+    {
+    // If the render orientation is EDisplayOrientationAuto then don't update HAL
+    // The application and HAL should always have the same state for the orientation.
+    if(EDisplayOrientationAuto != aRenderOrientation)
+        {
+        TInt error = HAL::Set(CWsTop::CurrentFocusScreen()->ScreenNumber(), HALData::EDigitiserOrientation, WservToDigitiser(iPublishedRenderOrientation));
+        //Just log the error if there is one.
+        if(wsDebugLog && error != KErrNone)
+            {
+            _LIT(logText,"Orientation Tracker: Error %d setting digitiser orientation");
+            wsDebugLog->MiscMessage(CDebugLogBase::ELogIntermediate, logText, error);           
+            } 
+        }
+    }
+
+/**
+If the current orientation differs from the previously published value then publishes the current value
+
+@param The render orientation to check and publish
+@return KErrNone for success, else any of the system wide erro codes
+*/
+TInt CWsRenderOrienationTracker::PublishOrientation(const TRenderOrientation aRenderOrientation)
+    {
+    TInt error = KErrNone;
+  
+    if(aRenderOrientation != iPublishedRenderOrientation)
+        {
+        // If the device Orientation has changed, publish it
+        error = DoPublishOrientation(aRenderOrientation);
+        if(KErrNone == error)
+            SetHALOrientation(aRenderOrientation);
+        }
+    return error;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/windowing/windowserver/nga/SERVER/renderorientationtracker.h	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,71 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This material, including documentation and any related
+// computer programs, is protected by copyright controlled by
+// Nokia. All rights are reserved. Copying, including
+// reproducing, storing, adapting or translating, any
+// or all of this material requires the prior written consent of
+// Nokia. This material also contains confidential
+// information which may not be disclosed to others without the
+// prior written consent of Nokia.
+//
+// Description:
+// Render Orientation Tracking and Publication
+// 
+
+#ifndef renderorientationtracker_h
+#define renderorientationtracker_h
+
+#include <e32std.h>
+#include <e32base.h>
+#include <e32property.h>
+#include <w32std.h>
+#include <wspublishandsubscribedata.h>
+
+// Values for the device orientation that we receive via P&S from the Theme Server
+// Todo FIX THIS Category UID!!!
+const TUid  KThemeOrientationCategory   = {0x20022E82}; // == KHbPsHardwareCoarseOrientationCategoryUid 
+const TUint KThemeOrientationKey        = 0x4F726965; // == KHbPsHardwareCoarseOrientationKey 
+
+typedef TRenderOrientation TRenderOrientationTrackingType; 
+
+class CWsWindowGroup;
+
+class CWsRenderOrienationTracker : public CActive
+    {
+public:  
+    static CWsRenderOrienationTracker* NewL();
+    ~CWsRenderOrienationTracker();
+
+    void CheckRenderOrientation();
+
+private:   
+    CWsRenderOrienationTracker();
+    void ConstructL();
+    
+    void RequestDeviceOrientationNotification();
+    void CancelDeviceOrientationNotification();
+    
+    // CActive
+    void RunL();
+    void DoCancel();
+    
+    TInt DoOrientationTracking();
+    TInt GetThemeOrientation(TRenderOrientation& aThemeOrientation);
+    TInt PublishOrientation(const TRenderOrientation aRenderOrientation);
+    TInt DoPublishOrientation(const TRenderOrientation aRenderOrientation);
+    TInt GetIndicatedOrientation(TRenderOrientationTrackingType& aOrientationTrackingType);
+    TInt CheckWindowGroupOrientation(const CWsWindowGroup& aWinGroup, TRenderOrientationTrackingType& aOrientationTrackingType);
+    TBool UseableGroupWindow(const CWsWindowGroup& aWinGroup) const;
+    TInt GetFocusWindowOrientation(TRenderOrientationTrackingType& aOrientationTrackingType);
+    TInt FindOrientationFromWindowTree(TRenderOrientationTrackingType& aOrientationTrackingType);    
+    void SetHALOrientation(const TRenderOrientation aRenderOrientation);
+    
+private:    
+    TRenderOrientationTrackingType  iRenderOrientationTrackingType;    
+    TRenderOrientation              iPublishedRenderOrientation;
+    RProperty                       iThemeOrientationProperty;
+    RProperty                       iRenderOrientationPublisher;
+    };
+
+#endif
--- a/windowing/windowserver/nga/SERVER/windowgroup.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nga/SERVER/windowgroup.h	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -82,7 +82,7 @@
 	void AddPriorityKeyL(TUint aKeycode, TUint aModifierMask, TUint aModifiers);
 	void RemovePriorityKey(TUint aKeycode, TUint aModifierMask, TUint aModifiers);
 	void RemoveAllPriorityKeys();
-	TBool CheckForPriorityKey(const TKeyData &aKey, TInt aScanCode);
+	TBool CheckForPriorityKey(const TKeyEvent &aKeyEvent);
 	inline CWsPointerCursor *GroupPointerCursor() const;
 	static CWsWindowGroup *WindowGroupFromIdentifier(TInt aIdentifier);
 	static CWsWindowGroup *WindowGroupFromIdentifierL(TInt aIdentifier);
@@ -110,7 +110,7 @@
 	void SetScreenDevice(DWsScreenDevice *aDevice);
 	static void SetEventQueueTestState(TBool aEventQueState);
 	TBool HasVisibleTranslucentChild();
-	void  ReleasePendedMessage();
+	void  ReleasePendedMessage();	
 private:
 	void SwitchToOwningWindow(CWsWindowGroup *aClosingWindow);
 	void MoveChainedWindows(TDblQueIter<CWsWindowGroup>& aIter,TBool aForward,TInt aPos,CWsWindowGroup* aClosingWindow);
--- a/windowing/windowserver/nga/SERVER/wsdisplaychangeao.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nga/SERVER/wsdisplaychangeao.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -243,6 +243,27 @@
 	Cancel();
 	}
 
+void CWsConfigChangeNotifier::UpdateLastSetConfiguration(TDisplayConfiguration& aNewConfig)
+    {
+    TSize resolution(0,0);
+    if (aNewConfig.GetResolution(resolution))
+        {
+        iLastSetConfig.SetResolution(resolution);
+        }
+    
+    TSize resolutionTwips(0,0);
+    if (aNewConfig.GetResolutionTwips(resolutionTwips))
+        {
+        iLastSetConfig.SetResolutionTwips(resolutionTwips);   
+        }
+    
+    TDisplayConfiguration1::TRotation rotation;
+    if (aNewConfig.GetRotation(rotation))
+        {
+        iLastSetConfig.SetRotation(rotation);
+        }
+    }
+
 void CWsConfigChangeNotifier::RunL()
 	{
 	if(iStatus == KErrNone)
@@ -259,6 +280,29 @@
 			iRetry->CancelRetry();
 			
 			iOwner->IncreaseConfigSpinner();
+			
+			//if the config change comes from a render stage then ensure screen device size 
+			//is also updated
+			TSize currentRes;
+			currentConfig.GetResolution(currentRes);
+			TBool disconnected = (currentRes.iHeight == 0 || currentRes.iWidth == 0) ? ETrue : EFalse;
+            
+			//if the config change is due to CScreen::SetConfiguration() being called then we
+			//don't want to update it again. Only update if the configs are different and the
+			//display is connected...
+			TDisplayConfiguration lastSetConfig(iLastSetConfig);
+			if (!((currentConfig == lastSetConfig) || (disconnected)))
+			    {
+                TDisplayConfiguration1::TRotation rotation;
+                if (lastSetConfig.GetRotation(rotation))
+                    {
+                    //use the latest rotation value to ensure we don't get any
+                    //inconsistencies with the layer extents
+                    currentConfig.SetRotation(rotation);
+                    }
+                iOwner->UpdateConfiguration(currentConfig);
+			    }		
+			
 			//put config change event on queue
 			RPointerArray<CWsClient> clientArray;
 			CleanupClosePushL(clientArray);
@@ -282,6 +326,7 @@
 				iRetry->Retry(KRetryInitialDelay);
 				}
 			}
+		iNextLevelInterface->GetConfiguration(iLastSetConfig);
 		}
 	else if(iStatus != KErrCancel && iStatus != KErrNotSupported)
 		{
--- a/windowing/windowserver/nga/SERVER/wsdisplaychangeao.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nga/SERVER/wsdisplaychangeao.h	Fri Jul 16 11:45:55 2010 +0300
@@ -1,5 +1,5 @@
 /**
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -60,6 +60,7 @@
 		static CWsConfigChangeNotifier* NewL(MWsDisplayControl* aNextLevelInterface, CScreen *aOwner);
 		void IssueNotificationRequest();
 		void CancelNotificationRequest();
+		void UpdateLastSetConfiguration(TDisplayConfiguration& aNewConfig);
 		~CWsConfigChangeNotifier();
 	protected:
 		void ConstructL();
@@ -75,6 +76,8 @@
 		CEventQueueRetry *iRetry;
 		
 		TDisplayConfiguration iLastConfig;
+		// last set screen device SetConfiguration call
+		TDisplayConfiguration iLastSetConfig;
 	};
 
 #endif
--- a/windowing/windowserver/nga/graphicdrawer/graphicdrawerenvironment.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nga/graphicdrawer/graphicdrawerenvironment.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -15,6 +15,7 @@
 
 #include "Graphics/WSGRAPHICDRAWER.H"
 #include <Graphics/WSGRAPHICDRAWERINTERFACE.H>
+#include "Graphics/wsgraphicdrawerinternal.h"
 
 // TGraphicDrawerId \\\\\\\\\\\\\\\\\\\\\\\\
 
--- a/windowing/windowserver/nonnga/CLIENT/RWS.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nonnga/CLIENT/RWS.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -22,6 +22,7 @@
 #include "CLIENT.H"
 #include "wstraces.h"
 #include "graphics/windowserverconstants.h"
+#include <wspublishandsubscribedata.h>
 
 const TInt KMaxWSERVMessagesSlot=-1;
 
@@ -2422,3 +2423,10 @@
 	{
 	ASSERT(0);
 	}
+
+EXPORT_C void RWsSession::IndicateAppOrientation(TRenderOrientation aOrientation)
+	/** Dummy implementation in order to preserve compatibility with WSERV NGA.
+	@internalComponent */
+	{
+	ASSERT(0);
+	}
--- a/windowing/windowserver/nonnga/SERVER/EVENT.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nonnga/SERVER/EVENT.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -32,6 +32,8 @@
 #include "pointer.h"
 #include "debugbar.h"
 #include "wstraces.h"
+#include "Graphics/wsgraphicdrawerinternal.h"
+
 
 GLREF_D CDebugLogBase *wsDebugLog;
 
--- a/windowing/windowserver/nonnga/SERVER/SERVER.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nonnga/SERVER/SERVER.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -19,7 +19,6 @@
 #include "panics.h"
 #include "wstop.h"
 #include "EVENT.H"
-#include <Graphics/WSGRAPHICDRAWERINTERFACE.H>
 #include <bitdraw.h>
 #include <hal.h>
 #include "inifile.h"
@@ -82,6 +81,8 @@
 	void OnActive();
 	void ScheduleRedraw(MWsScreen& aScreen,const TTime& aWhen);
 	void DoRedrawNow(MWsScreen& aScreen);
+	void DoRedrawNow(MWsScreen& aScreen, MWsAnimationScheduler::MScreenUpdateObserver& aObserver);
+	void ClearScreenUpdateObserver(const MWsAnimationScheduler::MScreenUpdateObserver& /*aObserver*/) {}
 	TInt RemoveGraphicDrawer(const TGraphicDrawerId &aId);
 	
 private:
@@ -326,6 +327,12 @@
 	OnIdleCallBack(ETrue);
 	}
 	
+void CWindowServer::CDefaultAnimationScheduler::DoRedrawNow(MWsScreen& /*aScreen*/, MWsAnimationScheduler::MScreenUpdateObserver& aObserver)
+	{
+	OnIdleCallBack(ETrue);
+	aObserver.ScreenUpdateComplete(KErrNone);
+	}	
+	
 void CWindowServer::CDefaultAnimationScheduler::ScheduleAnimation(MWsScreen& aScreen,const TTime& aWhen)
 	{
 	TSchedule schedule;
@@ -646,7 +653,6 @@
 	
 	delete iDefaultAnimationScheduler;
 	iDefaultAnimationScheduler = NULL; // might be called from clients during server destruction
-	iCustomAnimationScheduler = NULL; // not owned
 	delete iPluginManager;
 	}
 	
@@ -714,37 +720,23 @@
 /**
 Custom Animation Scheduler
 */
-TBool CWindowServer::SetCustomAnimationScheduler(MWsAnimationScheduler* aScheduler)
+TBool CWindowServer::SetCustomAnimationScheduler(MWsAnimationScheduler* /*aScheduler*/)
 	{
-	if(!iCustomAnimationScheduler && aScheduler)
-		{
-		iCustomAnimationScheduler = aScheduler;
-		return ETrue;
-		}
 	return EFalse;
 	}
 
 TBool CWindowServer::HasCustomAnimationScheduler() const
 	{
-	return !!iCustomAnimationScheduler;
+	return EFalse;
 	}
 
-TBool CWindowServer::ClearCustomAnimationScheduler(MWsAnimationScheduler* aCurrentScheduler)
+TBool CWindowServer::ClearCustomAnimationScheduler(MWsAnimationScheduler* /*aCurrentScheduler*/)
 	{
-	if(iCustomAnimationScheduler && (iCustomAnimationScheduler == aCurrentScheduler))
-		{
-		iCustomAnimationScheduler = NULL;
-		return ETrue;
-		}
 	return EFalse;
 	}
 	
 MWsAnimationScheduler* CWindowServer::AnimationScheduler()
 	{
-	if(iCustomAnimationScheduler)
-		{
-		return iCustomAnimationScheduler;
-		}
 	return iDefaultAnimationScheduler;
 	}
 
--- a/windowing/windowserver/nonnga/SERVER/ScreenRedraw.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nonnga/SERVER/ScreenRedraw.h	Fri Jul 16 11:45:55 2010 +0300
@@ -23,6 +23,7 @@
 #include <gdi.h>
 #include "wstypes.h"
 #include <Graphics/WSGRAPHICDRAWERINTERFACE.H>
+#include "Graphics/wsgraphicdrawerinternal.h"
 
 class CScreen;
 class CWsRenderStage;
--- a/windowing/windowserver/nonnga/SERVER/WSTOP.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nonnga/SERVER/WSTOP.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -18,6 +18,7 @@
 #include "wstop.h"
 
 #include <hal.h>
+#include <graphics/fbsdefs.h>
 #include "ANIM.H"
 #include "gc.h"
 #include "playbackgc.h"
--- a/windowing/windowserver/nonnga/SERVER/server.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nonnga/SERVER/server.h	Fri Jul 16 11:45:55 2010 +0300
@@ -28,6 +28,7 @@
 #include "CLIENT.H"
 #include "ScrDev.H"
 #include <Graphics/WSGRAPHICDRAWERINTERFACE.H>
+#include "Graphics/wsgraphicdrawerinternal.h"
 #include "WSGRAPHICDRAWERARRAY.H"
 #include "panics.h"
 
@@ -372,7 +373,6 @@
 private:
 	class CDefaultAnimationScheduler;
 	CDefaultAnimationScheduler* iDefaultAnimationScheduler;
-	MWsAnimationScheduler* iCustomAnimationScheduler;
 	CWsPluginManager* iPluginManager;
 	RPointerArray<MWsMemoryRelease> iMemoryReleases;
 	/** An index to all the CWsGraphicDrawer objects.
--- a/windowing/windowserver/nonnga/graphicdrawer/graphicdrawerenvironment.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/nonnga/graphicdrawer/graphicdrawerenvironment.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -15,6 +15,7 @@
 
 #include "Graphics/WSGRAPHICDRAWER.H"
 #include <Graphics/WSGRAPHICDRAWERINTERFACE.H>
+#include "Graphics/wsgraphicdrawerinternal.h"
 
 // TGraphicDrawerId \\\\\\\\\\\\\\\\\\\\\\\\
 
--- a/windowing/windowserver/tanim/ANIM.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,438 +0,0 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test code to tun ANIMDLL.DLL
-// 
-//
-
-#include <e32std.h>
-#include <w32std.h>
-#include <e32svr.h>
-#include "../tlib/testbase.h"
-#include "TANIM.H"
-#include "ANIMDLL.H"
-
-#define NONEXISTENT_DLL_NAME	_L("Z:\\NONEXISTENT.DLL")
-#define ANIM_BITMAP		_L("Z:\\WSTEST\\TANIM.MBM")
-#define ANIM_DLL_NAME	_L("ANIDLL.DLL")
-
-enum TAnimPanic
-	{
-	EAnimPanicBadLoadFailed,
-	};
-
-class CTAnimClient;
-
-class TestAnim : public RAnim
-	{
-public:
-	TestAnim(RAnimDll &aDll);
-	TInt Construct(RWindowBase &aWin,const TPoint &aPos,CFbsBitmap *aBit1,CFbsBitmap *aBit2,CFbsBitmap *aMask,TInt aInterval, CFbsFont *aFont);
-	void Set(const TPoint &aPos, TInt aInterval);
-	void TextPos(const TPoint &aPos);
-	void SetPolyRectL(const TRect &aRect);
-	void ToggleMask();
-	};
-
-class CTAnimWindow2 : public CTBlankWindow
-	{
-public:
-	CTAnimWindow2(RAnimDll &aAnimDll);
-	~CTAnimWindow2();
-	void ConstructL(CTWinBase &parent, const TPoint &aPos, const TSize &aSize);
-	void ConstructExtLD(CTWinBase &aParent, const TPoint &aPos, const TSize &aSize);
-private:
-	TestAnim iAnim;
-	CFbsBitmap iAnimBitmap1;
-	CFbsBitmap iAnimBitmap2;
-	};
-
-class CTAnimWindow1 : public CTTitledWindow
-	{
-public:
-	CTAnimWindow1(RAnimDll &aAnimDll);
-	~CTAnimWindow1();
-	void ConstructL(CTWinBase &parent);
-	void Draw();
-	void AdjustAnimRect(TInt xMove,TInt yMove,TInt modifiers);
-	void AdjustPolyRectL(TInt xMove,TInt yMove,TInt modifiers);
-	void ToggleMask();
-	TInt SubType();
-private:
-	TestAnim iAnim;
-	TPoint iAnimPos;
-	TRect iAnimPolyRect;
-	CFbsBitmap iAnimBitmap1;
-	CFbsBitmap iAnimBitmap2;
-	CFbsBitmap iMask;
-	};
-
-class CTAnimWindowGroup : public CTWindowGroup
-	{
-public:
-	CTAnimWindowGroup(CTClient *aClient);
-	void CursorKeyL(TInt xMove,TInt yMove,TInt modifiers);
-	void KeyL(const TKeyEvent &aKey, const TTime &aTime);
-	TInt iCursorMode;
-	};
-
-class CTAnimClient : public CTClient
-	{
-public:
-	CTAnimClient();
-	~CTAnimClient();
-	void ConstructL();
-	void KeyL(const TKeyEvent &aKey,const TTime &aTime);
-	void ExitL();
-	void ErrorTests();
-	CTBaseWin *CreateTestWindowL(TPoint pos,TSize size,CTWinBase *parent, TInt aType);
-private:
-	TInt iNum;
-	RAnimDll iAnimDll;
-	};
-
-const TInt Xmove=8;
-const TInt Ymove=6;
-
-void AnimPanic(TInt aPanic)
-	{
-	User::Panic(_L("ANIM"),aPanic);
-	}
-
-//
-//  Anim class
-//
-
-TestAnim::TestAnim(RAnimDll &aDll) : RAnim(aDll)
-	{
-	}
-
-TInt TestAnim::Construct(RWindowBase &aWin, const TPoint &aPos, CFbsBitmap *aBit1,CFbsBitmap *aBit2,CFbsBitmap *aMask, TInt aInterval, CFbsFont *aFont)
-	{
-	TPckgBuf<CTAParams> params;
-	params().pos=aPos;
-	params().interval=aInterval;
-	params().bit1=aBit1->Handle();
-	params().bit2=aBit2->Handle();
-	params().mask=aMask->Handle();
-	params().font=aFont->Handle();
-	return(RAnim::Construct(aWin,0,params));
-	}
-
-void TestAnim::Set(const TPoint &aPos, TInt aInterval)
-	{
-	TPckgBuf<CTAParams> params;
-	params().pos=aPos;
-	params().interval=aInterval;
-	Command(EADllOpcodeMove,params);
-	}
-
-void TestAnim::TextPos(const TPoint &aPos)
-	{
-	TPckgBuf<TPoint> params;
-	params()=aPos;
-	Command(EADllTextPos,params);
-	}
-
-void TestAnim::SetPolyRectL(const TRect &aRect)
-	{
-	TPckgC<TRect> params(aRect);
-	User::LeaveIfError(CommandReply(EADllOpcodePolyLineRect,params));
-	}
-
-void TestAnim::ToggleMask()
-	{
-	Command(EADllToggleBitmapMask);
-	}
-
-//
-// Individual window sub-classes
-//
-
-CTAnimWindow1::CTAnimWindow1(RAnimDll &aAnimDll) : CTTitledWindow(), 
-	iAnim(aAnimDll)
-	{
-	}
-
-CTAnimWindow1::~CTAnimWindow1()
-	{
-	iAnim.Close();
-	}
-
-void CTAnimWindow1::ConstructL(CTWinBase &parent)
-	{
-	CTTitledWindow::ConstructL(parent);
-	User::LeaveIfError(iAnimBitmap1.Load(ANIM_BITMAP,EMbmTanimAnim1));
-	User::LeaveIfError(iAnimBitmap2.Load(ANIM_BITMAP,EMbmTanimAnim2));
-	User::LeaveIfError(iMask.Load(ANIM_BITMAP,EMbmTanimMask));
-	iAnimPos=TPoint(10,10);
-	User::LeaveIfError(iAnim.Construct(iWin, iAnimPos,&iAnimBitmap1,&iAnimBitmap2,&iMask,1,iFont));
-	iAnimPolyRect=TRect(TPoint(10,40),TSize(50,50));
-	iAnim.SetPolyRectL(iAnimPolyRect);
-	iAnim.TextPos(TPoint(20,50));
-	}
-
-void CTAnimWindow1::Draw()
-	{
-	TInt i;
-
-	CTTitledWindow::Draw();
-	iGc->SetPenColor(TRgb::Gray16(8));
-	TInt hgt=iSize.iHeight-iTitleHeight;
-	for(i=0;i<iSize.iWidth;i+=30)
-		{
-		iGc->DrawLine(TPoint(i,iTitleHeight),TPoint(iSize.iWidth,iTitleHeight+(hgt*i)/iSize.iWidth));
-		iGc->DrawLine(TPoint(iSize.iWidth-i,iTitleHeight+hgt),TPoint(iSize.iWidth,iTitleHeight+(hgt*i)/iSize.iWidth));
-		iGc->DrawLine(TPoint(iSize.iWidth-i,iTitleHeight+hgt),TPoint(0,iTitleHeight+hgt-(hgt*i)/iSize.iWidth));
-		iGc->DrawLine(TPoint(i,iTitleHeight),TPoint(0,iTitleHeight+hgt-(hgt*i)/iSize.iWidth));
-		}
-	}
-
-void CTAnimWindow1::AdjustAnimRect(TInt xMove,TInt yMove,TInt modifiers)
-	{
-	if (modifiers&EModifierCtrl)	// 4 times the movement
-		{
-		xMove<<=2;
-		yMove<<=2;
-		}
-	iAnimPos+=TPoint(xMove,yMove);
-	iAnim.Set(iAnimPos,5);
-	}
-
-void CTAnimWindow1::AdjustPolyRectL(TInt xMove,TInt yMove,TInt modifiers)
-	{
-	if (modifiers&EModifierCtrl)	// 4 times the movement
-		{
-		xMove<<=2;
-		yMove<<=2;
-		}
-	if (modifiers&EModifierShift)	// 4 times the movement
-		iAnimPolyRect.Grow(xMove,yMove);
-	else
-		iAnimPolyRect.Move(TPoint(xMove,yMove));
-	iAnim.SetPolyRectL(iAnimPolyRect);
-	}
-
-void CTAnimWindow1::ToggleMask()
-	{
-	iAnim.ToggleMask();
-	}
-
-TInt CTAnimWindow1::SubType()
-	{
-	return(69);
-	}
-
-// CTAnimWindow2 //
-
-CTAnimWindow2::CTAnimWindow2(RAnimDll &aAnimDll) : CTBlankWindow(), 
-	iAnim(aAnimDll)
-	{
-	}
-
-CTAnimWindow2::~CTAnimWindow2()
-	{
-	iAnim.Close();
-	}
-
-void CTAnimWindow2::ConstructL(CTWinBase &parent, const TPoint &aPos, const TSize &aSize)
-	{
-	CTBlankWindow::ConstructL(parent);
-	iWin.SetColor(TRgb(128,128,128));
-	iWin.SetVisible(EFalse);
-	SetExt(aPos,aSize);
-	iWin.Activate();
-	User::LeaveIfError(iAnimBitmap1.Load(ANIM_BITMAP,EMbmTanimAnim1));
-	User::LeaveIfError(iAnimBitmap2.Load(ANIM_BITMAP,EMbmTanimAnim2));
-	User::LeaveIfError(iAnim.Construct(iWin, TPoint(10,10), &iAnimBitmap1, &iAnimBitmap2, &iAnimBitmap1, 1, iFont));
-	iWin.SetVisible(ETrue);
-	}
-
-void CTAnimWindow2::ConstructExtLD(CTWinBase &aParent, const TPoint &aPos, const TSize &aSize)
-//
-// Call ConstructL, SetExt and either of these fail destroy this and leave
-//
-	{
-	TRAPD(err,ConstructL(aParent, aPos, aSize));
-	if (err!=KErrNone)
-		{
-		delete this;
-		User::Leave(err);
-		}
-	}
-
-//
-// End of CTAnimWindow class //
-//
-
-CTAnimWindowGroup::CTAnimWindowGroup(CTClient *aClient) : CTWindowGroup(aClient)
-	{
-	}
-
-void CTAnimWindowGroup::CursorKeyL(TInt xMove,TInt yMove,TInt modifiers)
-	{
-	if (iCursorMode==0)
-		iCurWin->AdjustSizeL(xMove,yMove,modifiers);
-	else if (iCurWin->SubType()==69)
-		{
-		if (iCursorMode==1)
-			((CTAnimWindow1 *)iCurWin)->AdjustAnimRect(xMove,yMove,modifiers);
-		else
-			((CTAnimWindow1 *)iCurWin)->AdjustPolyRectL(xMove,yMove,modifiers);
-		}
-	}
-
-void CTAnimWindowGroup::KeyL(const TKeyEvent &aKey,const TTime &aTime)
-	{
-	if (aKey.iModifiers&EModifierCtrl)
-		{
-		TInt type=0;
-		switch(aKey.iCode)
-			{
-			case 1:
-				type=1;
-				break;
-			case 2:
-				type=2;
-				break;
-			}
-		if (type!=0)
-			{
-			TPoint pos;
-			TSize size;
-			pos.iX=iCurWin->Size().iWidth>>2;
-			pos.iY=iCurWin->Size().iHeight>>2;
-			size.iWidth=iCurWin->Size().iWidth>>1;
-			size.iHeight=iCurWin->Size().iHeight>>1;
-			SetCurrentWindow(((CTAnimClient *)iClient)->CreateTestWindowL(pos,size,iCurWin,type));
-			return;
-			}
-		}
-	if (aKey.iModifiers&EModifierFunc)
-		{
-		switch(aKey.iCode)
-			{
-			case 'x':
-				((CTAnimClient *)iClient)->ExitL();
-				break;
-			}
-		}
-	else switch(aKey.iCode)
-		{
-		case ' ':
-			iCursorMode=(iCursorMode+1)%3;
-			break;
-		case 8:
-			CTWin::Delete(iCurWin);
-			break;
-		case 9:
-			if (aKey.iModifiers&EModifierShift)
-				SetCurrentWindow(iCurWin->Prev());
-			else
-				SetCurrentWindow(iCurWin->Next());
-			break;
-		case 13:
-			if (iCurWin->SubType()==69)
-				((CTAnimWindow1 *)iCurWin)->ToggleMask();
-			break;
-		case EKeyLeftArrow:
-			CursorKeyL(-Xmove,0,aKey.iModifiers);
-			break;
-		case EKeyRightArrow:
-			CursorKeyL(Xmove,0,aKey.iModifiers);
-			break;
-		case EKeyUpArrow:
-			CursorKeyL(0,-Ymove,aKey.iModifiers);
-			break;
-		case EKeyDownArrow:
-			CursorKeyL(0,Ymove,aKey.iModifiers);
-			break;
-		default:
-			iCurWin->WinKeyL(aKey,aTime);
-			break;
-		}
-	}
-
-//
-
-CTAnimClient::CTAnimClient()
-	{
-	}
-
-CTBaseWin *CTAnimClient::CreateTestWindowL(TPoint pos,TSize size,CTWinBase *parent, TInt type)
-	{
-	CTBaseWin *win;
-	if (type==1)
-		{
-		win=new(ELeave) CTAnimWindow1(iAnimDll);
-		win->ConstructExtLD(*parent,pos,size);
-		win->Activate();
-		}
-	else
-		{
-		win=new(ELeave) CTAnimWindow2(iAnimDll);
-		win->ConstructExtLD(*parent,pos,size);
-		}
-	win->AssignGC(*iGc);
-	return(win);
-	}
-
-CTAnimClient::~CTAnimClient()
-	{
-	DestroyWindows();
-	iAnimDll.Close();
-	}
-
-void CTAnimClient::ErrorTests()
-	{
-	RAnimDll animDll=RAnimDll(iWs);
-	if (animDll.Load(NONEXISTENT_DLL_NAME)!=KErrNotFound)
-		AnimPanic(EAnimPanicBadLoadFailed);
-	animDll.Close();		// Close should be harmless, but unnecassary
-	RAnimDll animDll2=RAnimDll(iWs);
-	if (animDll2.Load(NONEXISTENT_DLL_NAME)!=KErrNotFound)
-		AnimPanic(EAnimPanicBadLoadFailed);
-	}
-
-void CTAnimClient::ConstructL()
-	{
-	CTClient::ConstructL();
-
-	iGroup=new(ELeave) CTAnimWindowGroup(this);
-	iGroup->ConstructL();
-	
-	ErrorTests();
-
-	iAnimDll=RAnimDll(iWs);
-	User::LeaveIfError(iAnimDll.Load(ANIM_DLL_NAME));
-
-	CreateTestWindowL(TPoint(30,20),TSize(220,140),iGroup, 1);
-	CreateTestWindowL(TPoint(260,60),TSize(60,40),iGroup, 2);
-	iGroup->SetCurrentWindow(iGroup->Child());
-	}
-
-void CTAnimClient::ExitL()
-	{
-	CActiveScheduler::Stop();
-	User::Leave(0);		// Signals RunL not to do another Request()
-	}
-
-GLDEF_C CTClient *CreateClientL()
-	{
-	return(new(ELeave) CTAnimClient());
-	}
-
-GLDEF_C TInt E32Main()
-	{
-	return(TestLibStartUp(CreateClientL));
-	}
Binary file windowing/windowserver/tanim/ANIM1.PBM has changed
Binary file windowing/windowserver/tanim/ANIM2.PBM has changed
--- a/windowing/windowserver/tanim/ANIMDLL.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Header defs for ANIMDLL
-// 
-//
-
-struct CTAParams
-	{
-	TPoint pos;
-	TInt interval;
-	TInt bit1;
-	TInt bit2;
-	TInt mask;
-	TInt font;
-	};
-
-enum AnimDllOpcodes
-	{
-	EADllOpcodeMove,
-	EADllOpcodePolyLineRect,
-	EADllToggleBitmapMask,
-	EADllTextPos,
-	};
Binary file windowing/windowserver/tanim/MASK.PBM has changed
--- a/windowing/windowserver/tanim/TANIM.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Generated by BitmapCompiler
-// 
-//
-
-enum TMbmTanim
-	{
-	EMbmTanimAnim1,
-	EMbmTanimAnim2,
-	EMbmTanimMask
-	};
--- a/windowing/windowserver/tanim/TANIMDLL.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,317 +0,0 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test Animated DLL
-// 
-//
-
-#include <e32std.h>
-#include <w32std.h>
-#include <w32adll.h>
-#include <bitstd.h>
-#include "ANIMDLL.H"
-
-#define ANIM_TEST_TEXT _L("Testing 123")
-
-class CTestAnim : public CWindowAnim
-	{
-	enum {ENumPolyPoints=9};
-public:
-	~CTestAnim();
-	virtual void ConstructL(TAny *aArgs, TBool aHasFocus);
-	virtual void Animate(TDateTime *aDateTime);
-	virtual void Redraw();
-	virtual void Command(TInt aOpcode, TAny *aArgs);
-	virtual TInt CommandReplyL(TInt aOpcode, TAny *aArgs);
-	void SetPolyList(const TRect &aRect);
-	void DrawPolyLine();
-	void DrawBitmap();
-	void DrawText();
-	void TweakPolyList(TInt aState);
-	void FocusChanged(TBool aState);
-	void InvalidateText();
-	void InvalidateBitmap();
-	//Pure virtual function from MEventHandler
-	virtual TBool OfferRawEvent(const TRawEvent &aRawEvent);
-private:
-	void AppendTime(TDes& aTimeText,const TTime& aTime) const;
-private:
-	TPoint iPos;
-	TSize iSize;
-	TInt iColor;
-	TBool iMasked;
-	TRect iPolyRect;
-	TInt iPolyState;
-	TInt iWiggleSize;
-	TPoint iTextPos;
-	TBool iHasFocus;
-	CArrayFixFlat<TPoint> *iPolyList;
-	CFbsBitmap iBitmap1;
-	CFbsBitmap iBitmap2;
-	CFbsBitmap iMask;
-	CFbsFont *iFont;
-	};
-
-class CTestAnimDll : public CAnimDll 
-	{
-public:
-	CAnim *CreateInstanceL(TInt aType);
-private:
-	};
-
-/*#if defined(__WINS__)
-#pragma data_seg(".E32_UID")
-__WINS_UID(0, KWservAnimDllUidValue, 0)
-#pragma data_seg()
-#endif*/
-
-EXPORT_C CAnimDll *CreateCAnimDllL()
-	{
-	return(new(ELeave) CTestAnimDll());
-	}
-
-// Instance code //
-
-void CTestAnim::Animate(TDateTime *)
-	{
-	if (!iWindowFunctions->IsHidden())
-		{
-		iWindowFunctions->ActivateGc();
-		if (iPolyList)
-			DrawPolyLine();
-		}
-	if (iPolyList)	
-		{
-		iPolyState=(iPolyState+1)%4;
-		TweakPolyList(iPolyState);
-		}
-	if (!iWindowFunctions->IsHidden())
-		{
-		if (iPolyList)
-			DrawPolyLine();
-		DrawText();
-		DrawBitmap();
-		}
-	iColor=(iColor+16)&0xFF;
-	}
-
-void CTestAnim::DrawPolyLine()
-	{
-	iGc->SetDrawMode(CGraphicsContext::EDrawModeXOR);
-	iGc->SetPenColor(TRgb(255,255,255));
-	iGc->DrawPolyLine(iPolyList);
-	iGc->SetDrawMode(CGraphicsContext::EDrawModePEN);
-	iGc->SetPenColor(TRgb(0,0,0));
-	}
-
-void CTestAnim::DrawBitmap()
-	{
-	iGc->SetClippingRegion(TRegionFix<1>(TRect(iPos,iSize)));
-	CFbsBitmap *bitmap=iFunctions->FlashStateOn() ? &iBitmap1 : &iBitmap2;
-	if (iMasked)
-		iGc->BitBltMasked(iPos,bitmap, TRect(iSize), &iMask,EFalse);
-	else
-		iGc->BitBlt(iPos,bitmap);
-	iGc->CancelClippingRegion();
-	}
-
-void CTestAnim::AppendTime(TDes& aTimeText,const TTime& aTime) const
-	{
-	_LIT(TimeFormat,"%:0%H%:1%T%:2%S");
-	TRAPD(err,aTime.FormatL(aTimeText,TimeFormat));
-	if (err!=KErrNone)
-		{
-		_LIT(DummyTime,"######");
-		aTimeText.Append(DummyTime);
-		}
-	}
-
-void CTestAnim::DrawText()
-	{
-	if (iHasFocus)
-		{
-		iGc->UseFont(iFont);
-		TBuf<0x20> timebuf;
-		TTime time(iFunctions->SystemTime());
-		AppendTime(timebuf,time);
-		TRect rect(iTextPos.iX,iTextPos.iY-iFont->AscentInPixels(),iTextPos.iX+iFont->TextWidthInPixels(timebuf),iTextPos.iY-iFont->AscentInPixels()+iFont->HeightInPixels());
-		iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-		iGc->DrawText(timebuf,rect,iFont->AscentInPixels());
-		time.UniversalTime();
-		AppendTime(timebuf,time);
-		rect.Move(0,iFont->HeightInPixels());
-		iGc->DrawText(timebuf,rect,iFont->AscentInPixels());
-		}
-	}
-
-void CTestAnim::Redraw()
-	{
-	DrawText();
-	DrawBitmap();
-	if (iPolyList)
-		DrawPolyLine();
-	}
-
-void CTestAnim::ConstructL(TAny *aArgs, TBool aHasFocus)
-	{
-	iHasFocus=aHasFocus;
-	iPos=((CTAParams *)aArgs)->pos;
-	iFunctions->SetInterval(((CTAParams *)aArgs)->interval);
-	if (iBitmap1.Duplicate(((CTAParams *)aArgs)->bit1)!=KErrNone || 
-		iBitmap2.Duplicate(((CTAParams *)aArgs)->bit2)!=KErrNone ||
-		iMask.Duplicate(((CTAParams *)aArgs)->mask)!=KErrNone)
-		iFunctions->Panic();
-	iSize.iWidth=Min(iBitmap1.SizeInPixels().iWidth,iBitmap2.SizeInPixels().iWidth);
-	iSize.iHeight=Min(iBitmap1.SizeInPixels().iHeight,iBitmap2.SizeInPixels().iHeight);
-	iWiggleSize=10;
-	iFont=iFunctions->DuplicateFontL(((CTAParams *)aArgs)->font);
-	}
-
-void CTestAnim::SetPolyList(const TRect &aRect)
-	{
-	iPolyRect=aRect;
-	TSize halfsize=aRect.Size();
-	halfsize.iWidth>>=1;
-	halfsize.iHeight>>=1;
-	(*iPolyList)[0]=aRect.iTl;
-	(*iPolyList)[1]=TPoint(aRect.iTl.iX+iWiggleSize,aRect.iTl.iY+halfsize.iHeight);
-	(*iPolyList)[2]=TPoint(aRect.iTl.iX,aRect.iBr.iY);
-	(*iPolyList)[3]=TPoint(aRect.iTl.iX+halfsize.iWidth,aRect.iBr.iY-iWiggleSize);
-	(*iPolyList)[4]=aRect.iBr;
-	(*iPolyList)[5]=TPoint(aRect.iBr.iX-iWiggleSize,aRect.iTl.iY+halfsize.iHeight);
-	(*iPolyList)[6]=TPoint(aRect.iBr.iX,aRect.iTl.iY);
-	(*iPolyList)[7]=TPoint(aRect.iTl.iX+halfsize.iWidth,aRect.iTl.iY+iWiggleSize);
-	(*iPolyList)[8]=aRect.iTl;
-	TweakPolyList(iPolyState);
-	}
-
-void CTestAnim::TweakPolyList(TInt aState)
-	{
-	TSize halfsize=iPolyRect.Size();
-	halfsize.iWidth>>=1;
-	halfsize.iHeight>>=1;
-	switch(aState)
-		{
-		case 0:
-			(*iPolyList)[7]=TPoint(iPolyRect.iTl.iX+halfsize.iWidth,iPolyRect.iTl.iY+iWiggleSize);
-			(*iPolyList)[1]=TPoint(iPolyRect.iTl.iX,iPolyRect.iTl.iY+halfsize.iHeight);
-			break;
-		case 1:
-			(*iPolyList)[1]=TPoint(iPolyRect.iTl.iX+iWiggleSize,iPolyRect.iTl.iY+halfsize.iHeight);
-			(*iPolyList)[3]=TPoint(iPolyRect.iTl.iX+halfsize.iWidth,iPolyRect.iBr.iY);
-			break;
-		case 2:
-			(*iPolyList)[3]=TPoint(iPolyRect.iTl.iX+halfsize.iWidth,iPolyRect.iBr.iY-iWiggleSize);
-			(*iPolyList)[5]=TPoint(iPolyRect.iBr.iX,iPolyRect.iTl.iY+halfsize.iHeight);
-			break;
-		case 3:
-			(*iPolyList)[5]=TPoint(iPolyRect.iBr.iX-iWiggleSize,iPolyRect.iTl.iY+halfsize.iHeight);
-			(*iPolyList)[7]=TPoint(iPolyRect.iTl.iX+halfsize.iWidth,iPolyRect.iTl.iY);
-			break;
-		}
-	}
-
-void CTestAnim::InvalidateText()
-	{
-	TRect invalidate;
-	invalidate.iTl.iX=iTextPos.iX;
-	invalidate.iTl.iY=iTextPos.iY-iFont->AscentInPixels();
-	invalidate.iBr.iX=iTextPos.iX+iFont->TextWidthInPixels(ANIM_TEST_TEXT);
-	invalidate.iBr.iY=iTextPos.iY+iFont->DescentInPixels();
-	iWindowFunctions->Invalidate(invalidate);
-	}
-
-void CTestAnim::InvalidateBitmap()
-	{
-	iWindowFunctions->Invalidate(TRect(iPos,iSize));
-	}
-
-void CTestAnim::Command(TInt aOpcode, TAny *aArgs)
-	{
-	switch(aOpcode)
-		{
-		case EADllOpcodeMove:
-			{
-			InvalidateBitmap();
-			iPos=((CTAParams *)aArgs)->pos;
-			iWindowFunctions->ActivateGc();
-			DrawBitmap();
-			iFunctions->SetInterval(((CTAParams *)aArgs)->interval);
-			}
-			break;
-		case EADllTextPos:
-			{
-			InvalidateText();
-			iTextPos=((CTAParams *)aArgs)->pos;
-			iWindowFunctions->ActivateGc();
-			DrawText();
-			}
-			break;
-		case EADllToggleBitmapMask:
-			iMasked=!iMasked;
-			InvalidateBitmap();
-			break;
-		}
-	}
-
-TInt CTestAnim::CommandReplyL(TInt aOpcode, TAny *aArgs)
-	{
-	switch(aOpcode)
-		{
-		case EADllOpcodePolyLineRect:
-			iWindowFunctions->ActivateGc();
-			if (!iPolyList)
-				{
-				iPolyList=new(ELeave) CArrayFixFlat<TPoint>(ENumPolyPoints);
-				TPoint zeropoint;
-				for(TInt i=0;i<ENumPolyPoints;i++)
-					iPolyList->AppendL(zeropoint);
-				}
-			else
-				DrawPolyLine();
-			SetPolyList(*((TRect *)aArgs));
-			DrawPolyLine();
-			break;
-		default:
-			iFunctions->Panic();
-		}
-	return(KErrNone);
-	}
-
-CTestAnim::~CTestAnim()
-	{
-	delete iPolyList;
-	iFunctions->CloseFont(iFont);
-	}
-
-void CTestAnim::FocusChanged(TBool aNewState)
-	{
-	iHasFocus=aNewState;
-	InvalidateText();
-	InvalidateBitmap();
-	}
-
-TBool CTestAnim::OfferRawEvent(const TRawEvent &/*aRawEvent*/)
-	{
-	return EFalse;
-	}
-
-// DLL code //
-
-CAnim *CTestAnimDll::CreateInstanceL(TInt )
-	{
-	return(new(ELeave) CTestAnim());
-	}
-
-// Dummy E32Dll needed by E32 to build //
-
Binary file windowing/windowserver/tanim/tanim.mbm has changed
--- a/windowing/windowserver/tauto/AUTO.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2543 +0,0 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Automatically test the window server
-// 
-//
-
-
-#include <e32std.h>
-#include <w32std.h>
-#include <e32svr.h>
-#include <hal.h>
-#include "../tlib/testbase.h"
-#include <stdlib.h>
-#include "AUTO.H"
-
-LOCAL_D const TUint KPanicThreadHeapSize=0x8000;
-
-GLREF_C TInt ProcPriTestOtherProcess(TAny *aScreenNumber);
-GLREF_C TInt ProcToKill(TAny *aScreenNumber);
-GLREF_C TInt ProcDirect(TAny *aScreenNumber);
-GLREF_C TInt ProcMultiDisplay(TAny *aScreenNumber);
-
-_LIT(Priority,"ProcPriTest");
-_LIT(ToKill,"ProcToKill");
-_LIT(Direct,"ProcDirect");
-_LIT(MultiDisplay,"ProcMultiDisplay");
-
-CProcess::TInitialFunction CProcess::iFunctions[]=
-	{
-	TInitialFunction(Priority,ProcPriTestOtherProcess),
-	TInitialFunction(ToKill,ProcToKill),
-	TInitialFunction(Direct,ProcDirect),
-	TInitialFunction(MultiDisplay,ProcMultiDisplay)
-	};
-
-GLDEF_D TestWindow *BaseWin;
-GLDEF_D TestWindow *TestWin;
-GLDEF_D TestClient *TheClient=NULL;
-GLDEF_D CWindowGc *TheGc;
-TInt CTestBase::iMaxGrays=0;
-TInt CTestBase::iScreenNo=0;
-TInt CTestBase::iMaxColors=0;
-TInt CTestBase::iNumberTestsPass=0;
-TInt CTestBase::iNumberTests=0;
-TRect CTestBase::iNormalPointerCursorArea;
-TPartialRedrawType CTestBase::iRedrawType=EPartialRedraw_Unknown;
-TInt CTestBase::iNumberOfGrpWndsOnPrimaryScreenWithZeroPriority = 0;
-TInt CTestDriver::iTestNum=0;
-
-GLDEF_D TInt TheTestResult=ETestPassed; // start with passed to anticipate empty test table
-
-const TInt KBorderWinWidth = 5;
-
-_LIT(Auto,"AUTO ");
-
-TInt64 TTestRects::iSeed=0;
-TRect TTestRects::iList[]={
-// 0-5
-	TRect(2,2,2,2),
-	TRect(2,2,2,2),
-	TRect(2,2,2,2),
-	TRect(2,2,2,2),
-	TRect(2,2,2,2),
-// 5-13
-	TRect(0,0,0,0),
-	TRect(2,0,2,0),
-	TRect(4,0,4,0),
-	TRect(0,2,0,2),
-	TRect(2,2,2,2),
-	TRect(4,2,4,2),
-	TRect(0,4,0,4),
-	TRect(2,4,2,4),
-	TRect(4,4,4,4),
-// 13-22
-	TRect(0,0,1,1),
-	TRect(1,0,3,1),
-	TRect(3,0,4,1),
-	TRect(0,1,1,3),
-	TRect(1,1,3,3),
-	TRect(3,1,4,3),
-	TRect(0,3,1,4),
-	TRect(1,3,3,4),
-	TRect(3,3,4,4),
-// 23-31
-	TRect(0,0,2,0),
-	TRect(2,0,4,0),
-	TRect(0,0,4,0),
-	TRect(0,2,2,2),
-	TRect(2,2,4,2),
-	TRect(0,2,4,2),
-	TRect(0,4,2,4),
-	TRect(2,4,4,4),
-	TRect(0,4,4,4),
-// 32-40
-	TRect(0,0,0,2),
-	TRect(0,2,0,4),
-	TRect(0,0,0,4),
-	TRect(2,0,2,2),
-	TRect(2,2,2,4),
-	TRect(2,0,2,4),
-	TRect(4,0,4,2),
-	TRect(4,2,4,4),
-	TRect(4,0,4,4),
-// 41-44
-	TRect(0,0,2,2),
-	TRect(2,0,4,2),
-	TRect(0,2,2,4),
-	TRect(2,2,4,4),
-// 45-48
-	TRect(0,0,3,3),
-	TRect(1,0,4,3),
-	TRect(0,1,3,4),
-	TRect(1,1,4,4),
-// 49
-	TRect(0,0,4,4),
-// 40-53
-	TRect(1,2,2,2),
-	TRect(2,2,3,2),
-	TRect(2,1,2,2),
-	TRect(2,2,3,2),
-// 54-59
-	TRect(1,2,3,2),
-	TRect(2,1,2,3),
-	TRect(1,1,2,2),
-	TRect(1,2,2,3),
-	TRect(2,2,3,3),
-	TRect(2,1,3,2),
-// 60-63
-	TRect(1,1,3,2),
-	TRect(1,1,2,3),
-	TRect(1,2,3,3),
-	TRect(2,1,3,3)};
-
-#if defined(__WINS__)
-void FindNonMatchingPixelL(TPoint aPt1,TPoint aPt2,TSize aSize)
-// This function is purely for use when debugging to find the first non-matching pixel
-// when a check of two on screen rects has failed.
-	{
-	HBufC8* buf1=HBufC8::NewMaxLC(2*aSize.iWidth);
-	HBufC8* buf2=HBufC8::NewMaxLC(2*aSize.iWidth);
-	TPtr8 ptr1=buf1->Des();
-	TPtr8 ptr2=buf2->Des();
-	TInt row=0;
-	TBool ret = true;
-	for (;row<aSize.iHeight;++row)
-		{
-		TheClient->iScreen->GetScanLine(ptr1,aPt1,aSize.iWidth,EColor64K);
-		TheClient->iScreen->GetScanLine(ptr2,aPt2,aSize.iWidth,EColor64K);
-		if (ptr1!=ptr2)
-			break;
-		++aPt1.iY;
-		++aPt2.iY;
-		}
-	TRgb color1,color2;
-	if (row<aSize.iHeight)
-		{
-		for (TInt col=0;col<aSize.iWidth;++col)
-			{
-			TheClient->iScreen->GetPixel(color1,aPt1);
-			TheClient->iScreen->GetPixel(color2,aPt2);
-			if (color1!=color2)
-				{	// Break here to find first pixel that didn't match.
-				TBuf<256> buf;
-				_LIT(KFindNonMatchingPixelFmt,"First non matching pixel (%d,%d)");
-				buf.Format(KFindNonMatchingPixelFmt,col,row);
-				TheClient->iWs.LogMessage(buf);
-				break;
-				
-				}
-			++aPt1.iX;
-			++aPt2.iX;
-			}
-		}
-	CleanupStack::PopAndDestroy(2);
-	}
-
-void FindNonMatchingPixel(TPoint aPt1,TPoint aPt2,TSize aSize)
-	{
-	TRAPD(ignore,FindNonMatchingPixelL(aPt1,aPt2,aSize));
-	}
-#endif
-
-void AutoPanic(TInt aPanic)
-	{
-	User::Panic(_L("Auto"),aPanic);
-	}
-
-void CleanUpWindow(TAny *aWindow)
-	{
-	((RWindowTreeNode  *)aWindow)->Close();
-	}
-
-void PushWindowL(RWindowTreeNode *aWindow)
-	{
-	CleanupStack::PushL(TCleanupItem(CleanUpWindow,aWindow));
-	}
-
-
-TBool OpacityAndAlphaSupportedL()
-	{
-	// If opacity is not implemented, EFalse will be returned
-	if(TransparencySupportedL()!=KErrNone)
-		return EFalse;
-
-	const TRgb KTransparencyColor(0,0,0);
-	RWindow winb(TheClient->iWs);
-	CleanupClosePushL(winb);
-	RWindow wint(TheClient->iWs);
-	CleanupClosePushL(wint);
-	User::LeaveIfError(winb.Construct(*TheClient->iGroup->GroupWin(), ENullWsHandle));
-	User::LeaveIfError(wint.Construct(*TheClient->iGroup->GroupWin(), ENullWsHandle));
-	winb.SetExtent(TPoint(0,0), TSize(50,50));
-	wint.SetExtent(TPoint(0,0), TSize(50,50));
-	winb.SetRequiredDisplayMode(EColor256);
-	wint.SetRequiredDisplayMode(EColor256);
-	wint.SetTransparencyFactor(KTransparencyColor);
-	winb.SetBackgroundColor(TRgb(0,0,255));
-	wint.SetBackgroundColor(TRgb(255,0,0));
-	winb.Activate();
-	wint.Activate();
-
-	wint.BeginRedraw();
-	TheClient->iGc->Activate(wint);
-	TheClient->iGc->SetOpaque(ETrue);
-	TheClient->iGc->SetPenStyle(CGraphicsContext::ENullPen);
-	TheClient->iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TheClient->iGc->SetBrushColor(TRgb(0,255,0));
-	TheClient->iGc->DrawRect(TRect(TPoint(0,0), TSize(50,50)));
-	TheClient->iGc->SetOpaque(EFalse);
-	TheClient->iGc->Deactivate();
-	wint.EndRedraw();
-	TheClient->Flush();
-
-	// The window should be all green, if opacity is working, or all blue if it isn't.
-	// If the window has any other colour, then something has broken.
-	TRgb color;
-	TheClient->iScreen->GetPixel(color,TPoint(25,25));
-	if (color.Red()>0 || ((color.Green()==0) == (color.Blue()==0)))
-		User::Leave(KErrGeneral);
-	TBool ret=(color.Green()>0);
-
-	CleanupStack::PopAndDestroy(2,&winb); // wint
-	return ret;
-	}
-
-TInt TransparencySupportedL()
-	{
-	// Creates a window and enables alpha transparency, if this feature
-	// is not enabled, KErrNotSupported will be returned
-	RWindow win(TheClient->iWs);
-	User::LeaveIfError(win.Construct(*TheClient->iGroup->GroupWin(), ENullWsHandle));
-	win.SetExtent(TPoint(0,0), TSize(50,50));
-	TInt ret=win.SetTransparencyAlphaChannel();
-	win.Close();
-	return ret;
-	}
-
-TInt CheckScalingSupportedOrNot()
-	{
-	TBool scalingSupported=EFalse;
-	TSizeMode originalModeData=TheClient->iScreen->GetCurrentScreenModeAttributes();
-	TSizeMode tempData=originalModeData;
-	tempData.iScreenScale=TSize(2,2);
-	TheClient->iScreen->SetCurrentScreenModeAttributes(tempData);
-	TSize scale=TheClient->iScreen->GetCurrentScreenModeScale();
-	if (scale.iWidth==2 && scale.iHeight==2)
-		{
-		scalingSupported=ETrue;
-		}
-	TheClient->iScreen->SetCurrentScreenModeAttributes(originalModeData);
-	TheClient->Flush();
-	return scalingSupported;
-	}
-
-TBool CheckNonZeroOriginsSupportedOrNot()
-	{
-	TBool nonZeroOriginsSupported=EFalse;
-	TSizeMode sizeMode1=TheClient->iScreen->GetCurrentScreenModeAttributes();
-	TSizeMode sizeMode2=sizeMode1;
-	sizeMode2.iOrigin=TPoint(30,30);
-	TheClient->iScreen->SetCurrentScreenModeAttributes(sizeMode2);
-	TPoint origin=TheClient->iScreen->GetCurrentScreenModeScaledOrigin();
-	if (origin.iX==30 && origin.iY==30)
-		{
-		nonZeroOriginsSupported=ETrue;
-		}
-	TheClient->iScreen->SetCurrentScreenModeAttributes(sizeMode1);
-	TheClient->Flush();
-	return nonZeroOriginsSupported;
-	}
-
-TPoint PhysicalToLogical(TPoint aPhysicalPtMinusOrigin,TSize aScale)
-	{
-	TPoint logicalPt(aPhysicalPtMinusOrigin);
-	if (aScale.iWidth!=1)
-		{
-		logicalPt.iX=(logicalPt.iX>= 0 ? logicalPt.iX/aScale.iWidth : (logicalPt.iX-(aScale.iWidth-1))/aScale.iWidth);
-		}
-	if (aScale.iHeight!=1)
-		{
-		logicalPt.iY=(logicalPt.iY>= 0 ? logicalPt.iY/aScale.iHeight : (logicalPt.iY-(aScale.iHeight-1))/aScale.iHeight);
-		}
-	return logicalPt;
-	}
-
-//
-// Log window, logs testing //
-//
-
-LogWindow::LogWindow() : CTWin(), iTestTitle(KNullDesC), iSubTitle(KNullDesC), iMessage(KNullDesC)
-	{}
-
-void LogWindow::ConstructL(CTWinBase &parent)
-	{
-	CTWin::ConstructL(parent);
-	iTitleHeight=iFont->HeightInPixels()+4;
-	}
-
-void LogWindow::DrawSubTitle()
-	{
-	iGc->DrawText(iSubTitle, TRect(2,iTitleHeight*2,iSize.iWidth-2,iTitleHeight*3),iFont->AscentInPixels(), CGraphicsContext::ECenter);
-	}
-
-void LogWindow::DrawMessage()
-	{
-	iGc->DrawText(iMessage, TRect(1,iTitleHeight*4,iSize.iWidth-2,iTitleHeight*5),iFont->AscentInPixels(), CGraphicsContext::ECenter);
-	}
-
-void LogWindow::Draw()
-	{
-	iGc->SetPenColor(TRgb::Gray16(8));
-	iGc->SetPenColor(TRgb::Gray16(0));
-	DrawBorder();
-	iGc->DrawLine(TPoint(0,iTitleHeight),TPoint(iSize.iWidth,iTitleHeight));
-	iGc->DrawText(iTestTitle, TPoint((iSize.iWidth-iFont->TextWidthInPixels(iTestTitle))/2,iFont->AscentInPixels()+2));
-	DrawSubTitle();
-	DrawMessage();
-	}
-
-/**
-This function is not used at the moment but I leave it in in case I need it when I improve the logging in 
-the log window.
-*/
-void LogWindow::LogTest(const TDesC &aTitle,TInt aNum)
-	{
-	_LIT(Test,"Test %d,%S");
-	iTestTitle.Format(Test,aNum,&aTitle);
-	TLogMessageText buf;
-	_LIT(AutoNewTest,"AUTO New Test: ");
-	buf.Append(AutoNewTest);
-	buf.Append(iTestTitle);
-	TheClient->LogMessage(buf);
-	iMessage.Zero();
-	iWin.Invalidate();
-	}
-
-/**
-This function is not used at the moment but I leave it in in case I need it when I improve the logging in 
-the log window.
-*/
-const TDesC& LogWindow::LogSubTest(const TDesC &aTitle,TInt aNum)
-	{
-	_LIT(SubTest,"Sub-Test[%d], %S");
-	iSubTitle.Format(SubTest,aNum,&aTitle);
-	TLogMessageText buf;
-	buf.Append(Auto);
-	buf.Append(iSubTitle);
-	TheClient->LogMessage(buf);
-	iMessage.Zero();
-	iGc->Activate(iWin);
-	iGc->UseFont((CFont *)iFont);
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	DrawSubTitle();
-	DrawMessage();
-	iGc->Deactivate();
-	TheClient->iWs.Flush();
-	return iSubTitle;
-	}
-
-const TDesC& LogWindow::LogMessage(TBool aLog,const TDesC& aText,TInt aNum)
-	{
-	if (aNum!=EDummyValue)
-		{
-		_LIT(StringInt,"%S %d");
-		iMessage.Format(StringInt,&aText,aNum);
-		}
-	else
-		{
-		_LIT(String,"%S");
-		iMessage.Format(String,&aText);
-		}
-	iGc->Activate(iWin);
-	iGc->UseFont((CFont *)iFont);
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	DrawMessage();
-	iGc->Deactivate();
-	if (aLog)
-		{
-		TLogMessageText buf;
-		buf.Append(Auto);
-		buf.Append(iMessage);
-		TheClient->LogMessage(buf);
-		}
-	TheClient->iWs.Flush();
-	return iMessage;
-	}
-
-
-//
-// Test window, simple window used to do test graphics in //
-//
-TestWindow::TestWindow() : CTWin()
-	{
-	}
-
-TestWindow::~TestWindow()
-	{
-	delete iBorderWin;
-	}
-
-void TestWindow::SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc)
-	{
-	iBorderWin=new(ELeave) CBorderWindow();
-	iBorderWin->SetUpL(pos,size,parent,aGc);
-	TRAPD(err, CTWin::ConstructL(*iBorderWin));
-	if (err==KErrNone)
-		{
-		SetExt(TPoint(2,2),TSize(size.iWidth-4,size.iHeight-4));
-		if (err==KErrNone)
-			{
-			Activate();
-			AssignGC(aGc);
-			return;
-			}
-		}
-	delete this;
-	User::Leave(err);
-	}
-
-void TestWindow::Draw()
-	{
-	iGc->Clear();
-	}
-
-void TestWindow::ClearWin()
-	{
-	TheGc->Activate(*Win());
-	TheGc->Clear();
-	TheGc->Deactivate();
-	}
-	
-void TestWindow::SetBorderExt(TPoint aPos, TSize aSize)
-	{
-	iBorderWin->SetExt(aPos, aSize);
-	}
-
-CBorderWindow* TestWindow::GetBorderWin()
-	{
-	return iBorderWin;
-	}
-//
-CBorderWindow::CBorderWindow() : CTWin()
-	{
-	}
-
-void CBorderWindow::ConstructL(CTWinBase &parent)
-	{
-	CTWin::ConstructL(parent);
-	}
-
-void CBorderWindow::Draw()
-	{
-	iGc->SetBrushColor(TRgb::Gray16(0));
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	iGc->SetPenStyle(CGraphicsContext::ENullPen);
-	iGc->DrawRect(TRect(Size()));
-	}
-
-//
-
-TestWindowGroup::TestWindowGroup(CTClient *aClient) : CTWindowGroup(aClient)
-	{
-	}
-
-void TestWindowGroup::BecomeOwning()
-	{
-	iGroupWin.DefaultOwningWindow();
-	}
-
-void TestWindowGroup::KeyL(const TKeyEvent &aKey,const TTime &aTime)
-	{
-	if (aKey.iModifiers&EModifierFunc)
-		{
-		switch(aKey.iCode)
-			{
-			case 'f':
-				TheClient->Driver()->iTest->TriggerFail();
-				break;
-			}
-		}
-	else if (iCurWin)
-		iCurWin->WinKeyL(aKey,aTime);
-	}
-
-void TestWindowGroup::KeyDownL(const TKeyEvent &aKey,const TTime &aTime)
-	{
-	if (iCurWin)
-		iCurWin->KeyDownL(aKey,aTime);
-	}
-
-void TestWindowGroup::KeyUpL(const TKeyEvent &aKey,const TTime &aTime)
-	{
-	if (iCurWin)
-		iCurWin->KeyUpL(aKey,aTime);
-	}
-
-//
-
-TestClient::TestClient()
-	{}
-
-void TestClient::ConstructL()
-	{
-	CTClient::ConstructL();
-
-	iGroup=new(ELeave) TestWindowGroup(this);
-	iGroup->ConstructL();
-
-	iScreen->GetScreenSizeModeList(&iScreenModes);
-	iScreen->SetScreenMode(iScreenModes[0]);
-	TSize screenSize=iScreen->SizeInPixels();
-
-	TInt winWidth=(screenSize.iWidth/3)-10;
-	TInt winHeight=screenSize.iHeight-10;
-	iStdLogWindow=new(ELeave) LogWindow();
-	iStdLogWindow->SetUpL(TPoint(5,5),TSize(winWidth,winHeight),iGroup,*iGc);
-	BaseWin=new(ELeave) TestWindow();
-	BaseWin->SetUpL(TPoint(screenSize.iWidth/3+5,5),TSize(winWidth,winHeight),iGroup,*iGc);
-	TestWin=new(ELeave) TestWindow();
-	TestWin->SetUpL(TPoint(screenSize.iWidth/3*2+5,5),TSize(winWidth,winHeight),iGroup,*iGc);
-
-	iDriver = CTestDriver::CreateL(iScreenNumber); // virtual constructor
-
-	TheGc=new(ELeave) CWindowGc(iScreen);
-	User::LeaveIfError(TheGc->Construct());
-
-	_LIT(KTestLog,"WSERV Auto Test Log");
-	LogMessage(KTestLog());
-	LogAvailableScreenModeL();
-	
-	//This class was designed to be created once and reused by all the tests, now it is created for each test,
-	//this needs to be changed back so tests like the following are only done once.
-	TestWsSetBufferSizeL();
-	TestWsSetMaxBufferSizeL();
-	}
-	
-inline CTestDriver* TestClient::Driver()
-	{
-	return iDriver;
-	}
-
-TBool TestClient::WaitForEvent()
-	{
-	if (iEventHandler->iStatus!=KRequestPending)
-		return ETrue;
-	else if (iRedrawEventHandler->iStatus!=KRequestPending)
-		return EFalse;
-	User::WaitForRequest(iEventHandler->iStatus,iRedrawEventHandler->iStatus);
-	TRequestStatus* status=&iEventHandler->iStatus;
-	TBool ret=ETrue;
-	if (iEventHandler->iStatus==KRequestPending)
-		{
-		status=&iRedrawEventHandler->iStatus;
-		ret=EFalse;
-		}
-	TInt reason=status->Int();
-	*status=KRequestPending;
-	User::RequestComplete(status,reason);
-	return ret;
-	}
-
-TBool TestClient::IsEventWaiting()
-	{
-	return (iEventHandler->iStatus!=KRequestPending || iRedrawEventHandler->iStatus!=KRequestPending);
-	}
-
-TestClient::~TestClient()
-	{
-	iScreenModes.Close();
-	delete iDriver;
-	delete TheGc;
-	delete iStdLogWindow;
-	delete BaseWin;
-	delete TestWin;
-	}
-
-void TestClient::LogAvailableScreenModeL()
-	{
-	_LIT(KColorModes,"Color Modes: ");
-	_LIT(KComma,", ");
-	_LIT(KColor,"Color");
-	_LIT(KGrey,"Grey");
-	CArrayFixFlat<TInt>* modeList=new(ELeave) CArrayFixFlat<TInt>(15);
-	iWs.GetColorModeList(modeList);
-	TLogMessageText buf,buf2;
-	buf.Append(KColorModes);
-	TDisplayMode mode;
-	TInt ii=0;
-	FOREVER
-		{
-		mode=STATIC_CAST(TDisplayMode,(*modeList)[ii]);
-		buf.AppendNum((*modeList)[ii]);
-		buf2.Append(TDisplayModeUtils::IsDisplayModeColor(mode)?KColor():KGrey());
-		buf2.AppendNum(TDisplayModeUtils::NumDisplayModeColors(mode));
-		if (mode==EColor16MU)
-			buf2.Append('U');
-		if (++ii==modeList->Count())
-			break;
-		buf.Append(KComma);
-		buf2.Append(KComma);
-		}
-	LogMessage(buf);
-	LogMessage(buf2);
-	delete modeList;
-	}
-
-void TestClient::TestWsSetBufferSizeL()
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	ws.SetBufferSizeL(256);		// default buffer size 640
-	ws.SetBufferSizeL(0x8000);	// 16K is max buffer size
-	ws.SetBufferSizeL(0x4000);
-	ws.Close();
-	}
-
-void TestClient::TestWsSetMaxBufferSizeL() 
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	// allow buffer to grow bigger than the default 640 bytes
-	const TInt KBigMessageSize = 800;
-	ws.SetMaxBufferSizeL(KBigMessageSize + 8);	// big message + command header length
-	
-	// send the big message to the wserv
-	TBuf8<KBigMessageSize>	bigMessage;
-
-	// LogMessage needs a pointer to a TInt with the message size at the start of the buffer
-	const TInt szLength = sizeof(TInt);
-	TInt length = KBigMessageSize - szLength;			// length in Unicode characters
-	bigMessage.Append((TUint8*) &length, szLength);
-
-	_LIT(KLetterA, "a");
-	do 
-		{
-		bigMessage.Append((TUint8*) KLetterA().Ptr(), 2);
-		}
-		while (bigMessage.Length() < KBigMessageSize);
-
-	// send to Wserv, note that the message is too long to be logged
-	ws.TestWrite(ws.WsHandle(), EWsClOpLogMessage, bigMessage.Ptr(), KBigMessageSize);
-	ws.Flush();
-
-	ws.Close();
-	}
-
-void TestClient::SetTestClientScreenMode(TInt aMode)
-	{
-	iScreen->SetAppScreenMode(aMode);
-	iScreen->SetScreenMode(aMode);
-	UpdateTestClientScreenMode();
-	}
-	
-void TestClient::UpdateTestClientScreenMode()
-	{
-	TSize screenSize=iScreen->SizeInPixels();
-
-	// Sets new positions and dimensions for the three window and their controlling border windows
-	
-	if (screenSize.iHeight > screenSize.iWidth)		// Portrait mode
-		{
-		TInt winWidth=screenSize.iWidth - (KBorderWinWidth * 2);
-		TInt winHeight=(screenSize.iHeight/3) - (KBorderWinWidth * 2);
-		
-		iStdLogWindow->SetExt(TPoint(KBorderWinWidth,KBorderWinWidth),TSize(winWidth,winHeight));
-		BaseWin->SetBorderExt(TPoint(KBorderWinWidth,screenSize.iHeight/3+KBorderWinWidth),TSize(winWidth,winHeight));
-		BaseWin->SetExt(TPoint(2,2),TSize(winWidth - (KBorderWinWidth - 1),winHeight - (KBorderWinWidth - 1)));
-		TestWin->SetBorderExt(TPoint(KBorderWinWidth,screenSize.iHeight/3*2+KBorderWinWidth),TSize(winWidth,winHeight));
-		TestWin->SetExt(TPoint(2,2),TSize(winWidth - (KBorderWinWidth - 1),winHeight - (KBorderWinWidth - 1)));
-		}
-	else											// Landscape modes
-		{
-		TInt winWidth=(screenSize.iWidth/3) - (KBorderWinWidth * 2);
-		TInt winHeight=screenSize.iHeight - (KBorderWinWidth * 2);
-		
-		iStdLogWindow->SetExt(TPoint(KBorderWinWidth,KBorderWinWidth),TSize(winWidth,winHeight));
-		BaseWin->SetBorderExt(TPoint(screenSize.iWidth/3 + KBorderWinWidth,KBorderWinWidth),TSize(winWidth,winHeight));
-		BaseWin->SetExt(TPoint(2,2),TSize(winWidth - (KBorderWinWidth - 1),winHeight - (KBorderWinWidth - 1)));
-		TestWin->SetBorderExt(TPoint(screenSize.iWidth/3*2+KBorderWinWidth,KBorderWinWidth),TSize(winWidth,winHeight));	
-		TestWin->SetExt(TPoint(2,2),TSize(winWidth - (KBorderWinWidth - 1),winHeight - (KBorderWinWidth - 1)));		
-		}	
-		
-	// Remove shading artefacts from window resizing operations		
-	TestWin->Win()->Invalidate();
-	TestWin->Win()->BeginRedraw();
-	TestWin->ClearWin();
-	TestWin->Win()->EndRedraw();
-	
-	BaseWin->Win()->Invalidate();
-	BaseWin->Win()->BeginRedraw();
-	BaseWin->ClearWin();
-	BaseWin->Win()->EndRedraw();
-	
-	TheClient->iWs.Flush();
-	}
-
-
-//
-// TestDriver, drives the test code //
-//
-CTestDriver* CTestDriver::CreateL(TInt aScreenNumber)
-	{
-	CTestDriver* self = NULL;
-	if (aScreenNumber==KDefaultScreen)
-		self = new (ELeave) CTestDriverPrimary(aScreenNumber);
-	else
-		self = new (ELeave) CTestDriverSecondary(aScreenNumber);
-
-	return self;
-	}
-
-CTestDriver::CTestDriver(TInt aScreenNumber)
-	: iScreenNumber(aScreenNumber)
-	{
-	iStartTime.HomeTime();
-	HAL::Get(HALData::EDisplayNumberOfScreens, iNumberOfScreens);
-	}
-
-CTestDriver::~CTestDriver()
-	{
-	}
-
-void CTestDriver::DestroyTest()
-	{
-	delete iTest;
-	iTest=NULL;
-	}
-
-void CTestDriver::TestComplete2()
-	{
-	++iTestNum;
-	if (iTestNum==iTestSize)
-		{
-		TBuf<64> timeBuf;
-		TTime endTime;
-		endTime.HomeTime();
-		TTimeIntervalMicroSeconds elapseTime=endTime.MicroSecondsFrom(iStartTime);
-		TInt64 elapseTime2=elapseTime.Int64()/1000;
-		TUint diffi = I64LOW(elapseTime2);
-		_LIT(TestPass,"PASSED");
-		_LIT(TestFail,"FAILED");
-		TInt noOfTests=CTestBase::iNumberTests;
-		TInt noOfTestsPass=CTestBase::iNumberTestsPass;
-		_LIT(TimeBuf,"Elapse Time  %d:%02d.%03d   %S");
-		timeBuf.Format(TimeBuf,diffi/60000,(diffi/1000)%60,diffi%1000000,&(noOfTests==noOfTestsPass?TestPass:TestFail));
-		TBuf<60> testReport;
-		_LIT(Checks,"Checks");
-		_LIT(Fails,"Fails");
-		_LIT(TestReport,"Tests:%d %S:%d");
-		TInt testNumber=(noOfTests==noOfTestsPass? noOfTestsPass : noOfTests-noOfTestsPass);
-		testReport.Format(TestReport,iTestNum,&(noOfTests==noOfTestsPass?Checks():Fails()),testNumber);
-		if (noOfTests!=noOfTestsPass)
-			{
-			_LIT(NumTests,"/%d");
-			testReport.AppendFormat(NumTests,noOfTests);
-			}
-
-		TBuf<60> logTestReport;
-		_LIT(LogReport," %S:%d/%d");
-		logTestReport.Format(LogReport,&Checks,noOfTestsPass,noOfTests);
-		TLogMessageText buf;
-		_LIT(Finished,"AUTO Testing Complete, ");
-		buf.Append(Finished);
-		buf.Append(timeBuf);
-		buf.Append(logTestReport);
-		TheClient->LogMessage(buf);
-
-		TheTestResult = noOfTests==noOfTestsPass? ETestPassed : ETestFailed;
-		DoDisplayDialog(timeBuf,testReport);
-		}
-	}
-
-//
-// Test driver for primary screen (has digitiser/pointer)
-//
-CTestDriverPrimary::CTestDriverPrimary(TInt aScreenNumber) : CTestDriver(aScreenNumber)
-	{
-	TInt i;
-	TInt numOfEntries = 1;
-	for (i=0; i<numOfEntries; ++i)
-		{
-		++iTestSize;
-		}
-
-	// omit multi display test (last entry in test table)
-	// for single screen platform
-	//
-	if (iNumberOfScreens==1)
-		--iTestSize;
-
-	}
-
-void CTestDriverPrimary::DoDisplayDialog(TDesC& timeBuf,TDesC& testReport)
-	{
-	DisplayDialog(_L("Auto tests complete"),timeBuf, testReport);
-	}
-
-//
-// Test driver for secondary screens
-//
-CTestDriverSecondary::CTestDriverSecondary(TInt aScreenNumber) : CTestDriver(aScreenNumber)
-	{
-	TInt i;
-	TInt numOfEntries = 1;
-	for (i=0; i<numOfEntries; ++i)
-		{
-		++iTestSize;
-		}
-	}
-
-void CTestDriverSecondary::DoDisplayDialog(TDesC& timeBuf,TDesC& testReport)
-	{
-	if (TheTestResult==ETestFailed)
-		DisplayDialog(iScreenNumber,_L("Auto tests complete"),timeBuf, testReport);
-	}
-
-// TTestRects //
-//
-// This class provides a list of rectangles to test graphics to the test windows
-// The list designed to test all cases total clipping, partial clipping, touching the edges,
-// unclipped etc etc...
-//
-// NOTE:- Quick test version, does not provide a proper list yet
-//
-// For the rectangle list the graphics area is divided into 9 logical areas:-
-// 0:The area above & left of the drawing area
-// 1:The area above but within the left & right limits of the drawing area
-// 2:The area above & right of the drawing area
-// 3:The area left of but within the top & bottom limits of the drawing area
-// 4:The area within the drawing area
-// 5:The area right of but within the top & bottom limits of the drawing area
-// 6:The area below & left of the drawing area
-// 7:The area below but within the left & right limits of the drawing area
-// 8:The area below & right of the drawing area
-//
-//			|		|
-//		0	|	1	|	2
-//			|		|
-//	-------------------------
-//			|		|
-//		3	|	4	|	5
-//			|		|
-//	-------------------------
-//			|		|
-//		6	|	7	|	8
-//			|		|
-//
-//
-// The full list of rectangles needed to test an official release is as follows:
-//
-//	0-8:	A rectangle wholly within each area (0 to 8) without touching the edges (if possible)
-//	9-17:	A rectangle wholly within each area and touching all bounding edges
-//	18-26:	A rectangle traversing each horizontal pair & triple of areas without touching the boundarys
-//	27-35:	A rectangle traversing each vertical pair & triple of areas without touching the boundarys
-//	36-39:	A rectangle traversing each 2x2 block of areas without touching the boundarys
-//	40-43:	A rectangle traversing each 2x2 block of areas touching each boundary
-//  44:		A rectangle that includes all areas
-//  45-48:	A rectangle fully enclosed in the central area that touches each edge
-//	49-54:	A rectangle fully enclosed in the central area that touches each pair of edges
-//	55-58:	A rectangle fully enclosed in the central area that touches each set of three edges
-//  59-67:	A Zero size rectangle in each of the 9 areas
-//	68-77:	Wide rectangles with heights from 0 to 9 in the central area
-//	78-87:	Tall rectangles with widths from 0 to 9 in the central area
-//
-
-void TTestRects::Construct(const RWindow &aWindow)
-	{
-// 59-67
-//		Special case, does not use rectangles from here
-// 68-77
-//		Special case, does not use rectangles from here
-// 78-87
-//		Special case, does not use rectangles from here
-//
-
-	iSize=aWindow.Size();
-/*
-	TInt wid=size.iWidth;
-	TInt hgt=size.iHeight;
-	TInt wid2=wid/2;
-	TInt hgt2=hgt/2;
-	TInt wid3=wid/3;
-	TInt hgt3=hgt/3;
-	TInt wid4=wid/4;
-	TInt hgt4=hgt/4;
-	TInt 2wid=wid*2;
-	TInt 2hgt=hgt*2;
-	TInt 3wid=wid*3;
-	TInt 3hgt=hgt*3;
-// 0-8
-	iList[0]=TRect(-wid,-hgt,-wid2,-hgt2);
-	iList[1]=TRect(wid3,-hgt,wid-wid3,-hgt2);
-	iList[2]=TRect(wid+wid2,-2hgt,2wid,-hgt);
-	iList[3]=TRect(-3wid,hgt3,-wid3,hgt-hgt3);
-	iList[4]=TRect(wid4,hgt3,wid-wid3,hgt-hgt4);
-	iList[5]=TRect(3wid,hgt4,wid+3wid,hgt-hgt4);
-	iList[6]=TRect(-wid3,hgt+hgt4,-wid2,hgt+hgt);
-	iList[7]=TRect(wid2,hgt+hgt4,wid-wid4,hgt+hgt3);
-	iList[8]=TRect(2wid,hgt+hgt4,3wid,hgt+hgt2);
-// 9-17
-	iList[9]=TRect(-wid,-hgt,0,0);
-	iList[10]=TRect(0,-2hgt,wid,0);
-	iList[11]=TRect(wid,-hgt2,wid+wid3,0);
-	iList[12]=TRect(-wid3,0,0,hgt);
-	iList[13]=TRect(0,0,wid,hgt);
-	iList[14]=TRect(wid,0,wid+wid4,hgt);
-	iList[15]=TRect(-wid,hgt,0,hgt+hgt4);
-	iList[16]=TRect(0,hgt,wid,hgt+hgt);
-	iList[17]=TRect(wid,hgt,wid+3wid,hgt+3hgt);
-// 18-26
-	iList[18]=TRect(-wid,-hgt,wid2,hgt3);
-	iList[19]=TRect(wid3,-2hgt,2wid,-hgt3);
-	iList[20]=TRect(-wid,-hgt2,wid3,-hgt3);
-	iList[21]=TRect(-wid3,hgt4,wid2,hgt2);
-	iList[22]=TRect(wid3,hgt3,wid+wid3,hgt-hgt3);
-	iList[23]=TRect(-wid,hgt2,wid+wid4,hgt-hgt3);
-	iList[24]=TRect(-wid,2hgt,wid3,3hgt);
-	iList[25]=TRect(wid-wid4,hgt+hgt3,wid+wid4,2hgt);
-	iList[26]=TRect(-wid4,hgt+hgt4,wid+wid4,3);
-*/
-/*
-	iList[0]=TRect(0,0,size.iWidth,size.iHeight);
-	iList[1]=TRect(-10,-10,size.iWidth/2,size.iHeight/2);
-	iList[2]=TRect(size.iWidth/2,size.iHeight/2,size.iWidth+10,size.iHeight+10);
-	iList[3]=TRect(size.iWidth/4,size.iHeight/4,size.iWidth/2,size.iHeight/2);
-	iList[4]=TRect(-10,size.iHeight/4,size.iWidth+10,size.iHeight/2);
-*/
-	}
-
-TInt TTestRects::Count1() const
-//
-// Count1() provides the simple base set of rectangles
-//
-	{
-	return(2);
-	}
-
-TInt TTestRects::Count2() const
-//
-// Count2() provides an increased set of rectangles for each graphics func to test itself more thoroughly
-//
-	{
-	return(5);
-	}
-
-TInt TTestRects::Count3() const
-//
-// Count3() provides the full set of rects for each graphics func to a quick test on
-//
-	{
-	return(88);
-	}
-
-/** Reset the seed value to 0. */
-void TTestRects::ResetSeed()
-	{
-	iSeed = 0;
-	}
-
-TInt TTestRects::Rnd(TInt aSize)
-//
-// Return a random based around aSize, maybe bigger maybe smaller, who knows?
-//
-	{
-	TInt rnd=Math::Rand(iSeed);
-	TInt result;
-	if (rnd&0x8)	// Increase from aSize
-		result=aSize*((rnd&0x7)+1);
-	else 			// Decrease from aSize
-		result=aSize/((rnd&0x7)+1);
-	return(result);
-	}
-
-TInt TTestRects::RndMax(TInt aSize)
-//
-// Return a random from 0 to aSize inclusive
-//
-	{
-	TInt64 tmpl=Math::Rand(iSeed);
-	TInt tmp = I64INT(tmpl) & 0xFFFF;
-	tmp*=aSize;
-	tmp/=0xFFFF;
-	return(tmp);
-	}
-
-TInt TTestRects::RectCoord(TInt aSection,TInt aSize)
-	{
-	TInt result=0;
-	switch(aSection)
-		{
-		case 0:
-			result=-(1+Rnd(aSize));
-			break;
-		case 1:
-			result=0;
-			break;
-		case 2:
-			result=1+RndMax(aSize-2);
-			break;
-		case 3:
-			result=aSize;
-			break;
-		case 4:
-			result=aSize+1+Rnd(aSize);
-			break;
-		default:
-			AutoPanic(EAutoPanicTestRectsSection);
-		}
-	return(result);
-	}
-
-void TTestRects::RectCoordPair(TInt &aTl, TInt &aBr, TInt aSection, TInt aSize)
-	{
-	do
-		{
-		aTl=RectCoord(aSection,aSize);
-		aBr=RectCoord(aSection,aSize);
-		} while(aTl==aBr && aSize>1);
-	if (aTl>aBr)
-		{
-		TInt tmp=aBr;
-		aBr=aTl;
-		aTl=tmp;
-		}
-	}
-
-TRect TTestRects::operator[](TInt aIndex)
-	{
-	TRect rect;
-	if (aIndex<EMaxRectFromList)
-		{
-		const TRect *pRect=&iList[aIndex];
-		if (pRect->iTl.iX==pRect->iBr.iX)
-			RectCoordPair(rect.iTl.iX,rect.iBr.iX,pRect->iTl.iX,iSize.iWidth);
-		else
-			{
-			rect.iTl.iX=RectCoord(pRect->iTl.iX,iSize.iWidth);
-			rect.iBr.iX=RectCoord(pRect->iBr.iX,iSize.iWidth);
-			}
-		if (pRect->iTl.iY==pRect->iBr.iY)
-			RectCoordPair(rect.iTl.iY,rect.iBr.iY,pRect->iTl.iY,iSize.iHeight);
-		else
-			{
-			rect.iTl.iY=RectCoord(pRect->iTl.iX,iSize.iHeight);
-			rect.iBr.iY=RectCoord(pRect->iBr.iX,iSize.iHeight);
-			}
-		}
-	else if (aIndex<EMaxRectZeroSize)
-		{
-		rect.iTl.iX=RectCoord(((aIndex-EMaxRectFromList)%3)*2,iSize.iWidth);
-		rect.iTl.iY=RectCoord(((aIndex-EMaxRectFromList)/3)*2,iSize.iHeight);
-		rect.iBr=rect.iTl;
-		}
-	else if (aIndex<EMaxRectWide)
-		{
-		rect.iTl.iX=1;
-		rect.iBr.iX=iSize.iWidth-1;
-		rect.iTl.iY=1;
-		rect.iBr.iY=rect.iTl.iY+(aIndex-EMaxRectWide);
-		}
-	else if (aIndex<EMaxRectHigh)
-		{
-		rect.iTl.iX=1;
-		rect.iBr.iX=rect.iTl.iX+(aIndex-EMaxRectHigh);
-		rect.iTl.iY=1;
-		rect.iBr.iY=iSize.iHeight-1;
-		}
-	else
-		AutoPanic(EAutoPanicTestRectsIndex);
-	return(rect);
-	}
-
-
-/*CBitmap*/
-
-CBitmap* CBitmap::NewLC(const TSize& aSizeInPixels,TDisplayMode aDispMode)
-	{
-	return NewLC(0,aSizeInPixels,aDispMode);
-	}
-
-CBitmap* CBitmap::NewL(const TSize& aSizeInPixels,TDisplayMode aDispMode)
-	{
-	CBitmap* self=NewLC(0,aSizeInPixels,aDispMode);
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-CBitmap* CBitmap::NewL(TInt aHandle)
-	{
-	CBitmap* self=NewLC(aHandle,TSize(),ENone);
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-CBitmap* CBitmap::NewL(TDesC& /*aFileName*/)
-	{
-	User::Leave(KErrNotSupported);
-	return NULL;
-	}
-
-CBitmap* CBitmap::NewLC(TInt aHandle,const TSize& aSizeInPixels,TDisplayMode aDispMode)
-	{
-	CBitmap* self=new(ELeave) CBitmap();
-	CleanupStack::PushL(self);
-	self->ConstructL(aHandle, aSizeInPixels, aDispMode);
-	return self;
-	}
-
-void CBitmap::ConstructL(TInt aHandle,const TSize& aSizeInPixels,TDisplayMode aDispMode)
-	{
-	iBitmap=new(ELeave) CFbsBitmap();
-	if (aHandle==0)
-		{
-		User::LeaveIfError(iBitmap->Create(aSizeInPixels,aDispMode));
-		}
-	else
-		{
-		User::LeaveIfError(iBitmap->Duplicate(aHandle));
-		}
-	iDevice=CFbsBitmapDevice::NewL(iBitmap);
-	User::LeaveIfError(iDevice->CreateContext(iGc));
-	}
-
-CBitmap::~CBitmap()
-	{
-	delete iGc;
-	delete iDevice;
-	delete iBitmap;
-	}
-
-
-// CTestBase //
-
-CTestBase::CTestBase(const TDesC& aTitle,CTWsGraphicsBase* aTestBase)
-	{
-	iTestBase=aTestBase;
-	iTitle.Copy(aTitle);
-	
-	iScreenNo = iTestBase->GetScreenFromIni();
-	
-	TheClient=new(ELeave) TestClient();
-	
-	if (CTestBase::iScreenNo == 1)
-		{
-		TheClient->SetScreenNumber(1);
-		iScreenNumber = 1;		
-		}
-	else
-		{
-		TheClient->SetScreenNumber(0);
-		iScreenNumber = 0;
-		}
-
-	if (iScreenNumber == 1)
-		{
-		iMinWin = new(ELeave) CMinWin(iScreenNumber);
-		iMinWin->ConstructL();
-		}
-
-	iTestNum=CTestDriver::iTestNum;
-	TheClient->ConstructL();
-	TheClient->StdLogWindow().LogTest(iTitle,iTestNum);
-	iDriver=TheClient->Driver();
-	
-	if (CTestBase::iScreenNo == 1)
-		{
-		TheClient->iWs.SetFocusScreen(1);
-		}
-	else
-		{
-		TheClient->iWs.SetFocusScreen(0);
-		}
-	
-	iTestRects.Construct(*BaseWin->Win());
-	iStdTestWindowSize=BaseWin->Size();
-	iRedrawType=EPartialRedraw_Unknown;	// Reset between tests
-	if (iMaxGrays+iMaxColors==0)
-		{
-		TheClient->iWs.GetDefModeMaxNumColors(iMaxColors,iMaxGrays);
-		iNormalPointerCursorArea=TheClient->iWs.PointerCursorArea();
-		}
-	}
-
-CTestBase::~CTestBase()
-	{
-	delete iMinWin;
-	delete TheClient;
-	}
-
-void CTestBase::CloseAllPanicWindows()
-	{
-	TInt idFocus = TheClient->iWs.GetFocusWindowGroup();
-	TWsEvent event;
-	event.SetType(EEventKey);
-	TKeyEvent *keyEvent = event.Key();
-	keyEvent->iCode = EKeyEscape;
-	keyEvent->iScanCode = EStdKeyEscape;
-	keyEvent->iModifiers = 0;
-	TInt theLimit = 50;
-	while(idFocus != NULL && (theLimit-- > 0))
-		{
-		TheClient->iWs.SendEventToAllWindowGroups(event);
-		idFocus = TheClient->iWs.GetFocusWindowGroup();
-		}
-	}
-	
-/**
-Returns the size of the standard test windows.
-@see iStdTestWindowSize
-*/	
-const TSize& CTestBase::StdTestWindowSize()
-	{
-	return iStdTestWindowSize;
-	}
-
-/** Returns the number of greys available in the richest grey mode */
-TInt CTestBase::MaxGrays() const
-	{
-	return iMaxGrays;
-	}
-
-/** Returns the number of colours available in the richest supported colour mode. */
-TInt CTestBase::MaxColors() const
-	{
-	return iMaxColors;
-	}
-
-void CTestBase::TriggerFail()
-	{
-	iFail=ETrue;
-	}
-
-void CTestBase::LogLeave(TInt aErr)
-	{
-	TLogMessageText buf;
-	_LIT(Leave,"AUTO Left with error code %d in ");
-	buf.AppendFormat(Leave,aErr);
-	buf.Append(iSubTitle);
-	TheClient->LogMessage(buf);
-	}
-
-void CTestBase::LogSubTest(const TDesC &aSubTitle)
-	{
-	Driver()->iSubTestNum++;
-	iSubTitle=aSubTitle;
-	iTestBase->Logger().Write(TheClient->StdLogWindow().LogSubTest(aSubTitle,iState));
-	}
-
-void CTestBase::LogMessage(TInt aValue)
-	{
-	_LIT(WinID,"Win Id:");
-	TheClient->StdLogWindow().LogMessage(EFalse,WinID,aValue);
-	}
-
-void CTestBase::LogSubState(TInt aSubState)
-	{
-	_LIT(SubTest,"SubState");
-	iTestBase->Logger().Write(TheClient->StdLogWindow().LogMessage(ETrue,SubTest,aSubState));
-	}
-
-TBool DoCheckRectRWin(RWindowBase &aWin1,RWindowBase &aWin2,const TRect &aRect)
-	{
-	TRect rect1(aRect);
-	TRect rect2(aRect);
-	rect1.Move(aWin1.InquireOffset(*TheClient->iGroup->WinTreeNode()));
-	rect2.Move(aWin2.InquireOffset(*TheClient->iGroup->WinTreeNode()));
-	TBool match=TheClient->iScreen->RectCompare(rect1,rect2);
-#if defined(__WINS__)
-	if (!match)
-		FindNonMatchingPixel(rect1.iTl,rect2.iTl,aRect.Size());
-#endif
-	return match;
-	}
-
-TBool DoCheckRectRWin(RWindowBase &aWin1,RWindowBase &aWin2,const TRect &aRect, TUint aFlags)
-	{
-	TRect rect1(aRect);
-	TRect rect2(aRect);
-	rect1.Move(aWin1.InquireOffset(*TheClient->iGroup->WinTreeNode()));
-	rect2.Move(aWin2.InquireOffset(*TheClient->iGroup->WinTreeNode()));
-	TBool match=TheClient->iScreen->RectCompare(rect1,rect2, aFlags);
-#if defined(__WINS__)
-	if (!match)
-		FindNonMatchingPixel(rect1.iTl,rect2.iTl,aRect.Size());
-#endif
-	return match;
-	}
-
-TBool DoCheckRect(CTBaseWin *aWin1,CTBaseWin *aWin2,const TRect &aRect)
-	{
-	return DoCheckRectRWin(*aWin1->BaseWin(), *aWin2->BaseWin(), aRect);
-	}
-
-TBool DoCheckRect(CTBaseWin *aWin1,CTBaseWin *aWin2)
-	{
-	TSize winSize=aWin1->Size();
-	TRect rect1(aWin1->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),winSize);
-	TRect rect2(aWin2->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),winSize);
-	return TheClient->iScreen->RectCompare(rect1,rect2);
-	}
-
-TBool DoCheckRect(CTBaseWin *aWin1, CTBaseWin *aWin2, const TRect &aRect, TUint aFlags)
-	{
-	return DoCheckRectRWin(*aWin1->BaseWin(), *aWin2->BaseWin(), aRect, aFlags);
-	}
-
-
-/**
-Compares the contents of 2 rectangular areas of the screen.
-
-@param aPos1 The top left corner of the first rectangle.
-@param aPos2 The top left corner of the second rectangle.
-@param aSize The size of the rectangles
-@return ETrue if the 2 areas have the same content, EFalse otherwise.
-*/
-TBool DoCheckRect(TPoint aPos1,TPoint aPos2,TSize aSize)
-	{
-	return TheClient->iScreen->RectCompare(TRect(aPos1,aSize),TRect(aPos2,aSize));
-	}
-
-void CTestBase::DrawTestBackground(TBool aInvertColors, const TSize &aSize, TInt aGrays/*=16*/)
-//
-// Draws a standard test background with a mix of colors (shades).
-// This is mainly used to test for graphic functions writing outside the intended area.
-//
-// This code assumes an TheGc is already active on the window to use.
-//
-	{
-	TheGc->SetBrushColor(TRgb::Gray256(255));
-	TInt step=5;
-	TInt col=0;
-	TInt colorInc=(aGrays>9 ? 17 : 85);
-	TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TheGc->SetPenStyle(CGraphicsContext::ENullPen);
-	for(TInt row=0;row<aSize.iHeight;row+=step)
-		{
-		TheGc->SetBrushColor(TRgb::Gray256(aInvertColors ? 255-col:col));
-		TheGc->DrawRect(TRect(0,row,aSize.iWidth,row+step));
-		col=col+colorInc;
-		if (col>255)
-			col=0;
-		}
-	}
-
-void CTestBase::AbortL()
-	{
-	CTestDriver* driver=iDriver;
-	iDriver->DestroyTest();
-	driver->TestComplete2();
-	User::Leave(ETestFailed);
-	}
-
-/*CTWsGraphicsBase*/
-
-CTWsGraphicsBase::CTWsGraphicsBase(CTestStep* aStep) : CTGraphicsBase(aStep)
-	{
-	}
-
-CTWsGraphicsBase::~CTWsGraphicsBase()
-	{
-	delete iTest;
-	}
-
-void CTWsGraphicsBase::CreateTestBaseL(CTTMSGraphicsStep* aTmsStep)
-	{
-	__ASSERT_ALWAYS(iTest==NULL,AutoPanic(EAutoPanicRecalledCreateTestBaseL));
-	iTest=new(ELeave) CTestBase(iStep->TestStepName(),this);
-	iTmsStep = aTmsStep;
-	}
-/**
-Gets the Screen Number from an .ini file supplied to the RUN_TEST_STEP. Screen number should
-be put under the section [useScreen] as screen=0 or screen=1.
-
-@return Screen number Defined in .ini file, otherwise 0.
-*/
-TInt CTWsGraphicsBase::GetScreenFromIni() const
-	{
-	_LIT(KUseScreenSection, "useScreen");
-	_LIT(KScreen, "screen");
-
-	TInt screen = 0;
-	TBool configAvailable = iStep->GetIntFromConfig(KUseScreenSection, KScreen, screen);
-	if(configAvailable)
-		{
-		return screen;
-		}
-	else
-		{
-		return 0;
-		}
-	}
-
-void CTWsGraphicsBase::TestComplete()
-	{
-	_LIT(KTestComplete,"Test complete");
-	INFO_PRINTF1(KTestComplete);
-	CTGraphicsBase::TestComplete();
-	}
-
-void CTWsGraphicsBase::LogMessage(const TText8* aFile,TInt aLine,TRefByValue<const TDesC> aFmt,...)
-	{
-	TLogMessageText buf;
-	VA_LIST list;
-	VA_START(list,aFmt);
-	buf.AppendFormatList(aFmt,list);
-	TheClient->LogMessage(buf);
-	Logger().LogExtra(aFile,aLine,ESevrInfo,buf);
-	VA_END(list);
-	}
-
-TBool CTWsGraphicsBase::CheckRetValue(TBool aPass, const TDesC *aErrorMsg, const TDesC &aErrorFunction)
-	{
-	if (!aPass && aErrorMsg)
-		{
-		LOG_MESSAGE3(_L("%S %S failed"),aErrorMsg,&aErrorFunction);
-		iTmsStep->MQCTest(EFalse,((TText8*)__FILE__),__LINE__);
-		}
-	iStep->TEST(aPass);
-	return aPass;
-	}
-
-void CTWsGraphicsBase::CompareWindowsSoftFailWinscw(const TText8* aFile, TInt aLine)
-	{
-	if (!DoCheckRect(BaseWin, TestWin, BaseWin->Size()))
-		{
-#ifdef __WINS__
-		_LIT(KMessage,"ERROR: Test Failed but is ignored on WINSCW");
-		Logger().LogExtra(aFile, aLine, ESevrErr, KMessage);
-#else // __WINS__
-		iStep->TEST(EFalse);
-		_LIT(KMessage,"ERROR: Test Failed");
-		Logger().LogExtra(aFile, aLine, ESevrErr, KMessage);
-#endif // __WINS__
-		}
-	}
-
-void CTWsGraphicsBase::CheckRect(TPoint aPos1,TPoint aPos2,TSize aSize, const TDesC *aErrorMsg)
-	{
-	CheckRetValue(DoCheckRect(aPos1,aPos2,aSize),aErrorMsg,_L("CheckRect()"));
-	}
-
-void CTWsGraphicsBase::CheckRect(TPoint aPos1,TPoint aPos2,TSize aSize, const TDesC &aErrorMsg)
-	{
-	CheckRect(aPos1,aPos2,aSize,&aErrorMsg);
-	}
-
-void CTWsGraphicsBase::CheckRectNoMatch(TPoint aPos1,TPoint aPos2,TSize aSize, const TDesC *aErrorMsg)
-	{
-	CheckRetValue(!DoCheckRect(aPos1,aPos2,aSize),aErrorMsg,_L("CheckRectNoMatch()"));
-	}
-
-void CTWsGraphicsBase::CheckRectNoMatch(TPoint aPos1,TPoint aPos2,TSize aSize, const TDesC &aErrorMsg)
-	{
-	CheckRectNoMatch(aPos1,aPos2,aSize,&aErrorMsg);
-	}
-
-void CTWsGraphicsBase::CheckRect(CTBaseWin *aWin1,CTBaseWin *aWin2, const TDesC *aErrorMsg)
-	{
-	CheckRetValue(DoCheckRect(aWin1,aWin2),aErrorMsg,_L("CheckRect()"));
-	}
-
-void CTWsGraphicsBase::CheckRect(CTBaseWin *aWin1,CTBaseWin *aWin2, const TDesC &aErrorMsg)
-	{
-	CheckRect(aWin1,aWin2,&aErrorMsg);
-	}
-
-void CTWsGraphicsBase::CheckRectNoMatch(CTBaseWin *aWin1,CTBaseWin *aWin2, const TDesC *aErrorMsg)
-	{
-	CheckRetValue(!DoCheckRect(aWin1,aWin2),aErrorMsg,_L("CheckRectNoMatch()"));
-	}
-
-void CTWsGraphicsBase::CheckRectNoMatch(CTBaseWin *aWin1,CTBaseWin *aWin2, const TDesC &aErrorMsg)
-	{
-	CheckRectNoMatch(aWin1,aWin2,&aErrorMsg);
-	}
-
-TBool CTWsGraphicsBase::CheckRect(CTBaseWin *aWin1,CTBaseWin *aWin2,const TRect &aRect, const TDesC *aErrorMsg)
-	{
-	return CheckRetValue(DoCheckRect(aWin1,aWin2,aRect),aErrorMsg,_L("CheckRect()"));
-	}
-
-TBool CTWsGraphicsBase::CheckRect(CTBaseWin *aWin1,CTBaseWin *aWin2,const TRect &aRect, const TDesC &aErrorMsg)
-	{
-	return CheckRect(aWin1,aWin2,aRect,&aErrorMsg);
-	}
-
-void CTWsGraphicsBase::CheckRectNoMatch(CTBaseWin *aWin1,CTBaseWin *aWin2,const TRect &aRect, const TDesC *aErrorMsg)
-	{
-	CheckRetValue(!DoCheckRect(aWin1,aWin2,aRect),aErrorMsg,_L("CheckRectNoMatch()"));
-	}
-
-void CTWsGraphicsBase::CheckRectNoMatch(CTBaseWin *aWin1,CTBaseWin *aWin2,const TRect &aRect, const TDesC &aErrorMsg)
-	{
-	CheckRectNoMatch(aWin1,aWin2,aRect,&aErrorMsg);
-	}
-
-void CTWsGraphicsBase::CompareWindows(const TRect &aRect, const TDesC *aErrorMsg)
-	{
-	CheckRetValue(DoCheckRect(BaseWin,TestWin,aRect),aErrorMsg,_L("CompareWindows()"));
-	}
-
-TBool CTWsGraphicsBase::CompareWindows(const TDesC *aErrorMsg)
-	{
-	return CheckRetValue(DoCheckRect(BaseWin,TestWin,TRect(BaseWin->Size())),aErrorMsg,_L("CompareWindows()"));
-	}
-
-void CTWsGraphicsBase::CompareWindows(const TRect &aRect, const TDesC &aErrorMsg)
-	{
-	CompareWindows(aRect,&aErrorMsg);
-	}
-
-TBool CTWsGraphicsBase::CompareWindows(const TDesC &aErrorMsg)
-	{
-	return CompareWindows(&aErrorMsg);
-	}
-
-/**
-Returns the size of the standard test windows.
-
-Several tests use 3 windows : one is a log window, one is a reference window 
-and one is the actual output of the test. All these windows have the same width which is roughly
-1/3 of the screen. They also have the same height which is roughly equal to the screen height.
-*/
-const TSize& CTWsGraphicsBase::StdTestWindowSize()
-	{
-	return iTest->StdTestWindowSize();
-	}
-
-/** Returns the number of greys available in the richest grey mode */
-TInt CTWsGraphicsBase::MaxGrays() const
-	{
-	return iTest->MaxGrays();
-	}
-
-/** Returns the number of colours available in the richest supported colour mode. */
-TInt CTWsGraphicsBase::MaxColors() const
-	{
-	return iTest->MaxColors();
-	}
-
-//
-// Panic testing //
-//
-
-LOCAL_C TInt PanicThreadFunc(TAny *aPtr)
-	{
-	CTrapCleanup* CleanUpStack=CTrapCleanup::New();
-	SPanicParams *ptr=(SPanicParams *)aPtr;
-	TInt ret;
-	TRAP(ret,ret=(*ptr->func)(ptr->num,ptr->ptr));
-	delete CleanUpStack;
-	if (ret==EWsExitReasonBad)
-		AutoPanic(EAutoPanicPanicFailed);
-	return(ret);
-	}
-
-TInt CTestBase::LaunchPanicThread(RThread &aThread, SPanicParams *aPtr)
-	{
-	TBuf<32> threadName;
-	threadName.Format(TRefByValue<const TDesC>(_L("AutoPanicThread%d")),iThreadNumber++);
-	return(aThread.Create(threadName,PanicThreadFunc,KDefaultStackSize,KPanicThreadHeapSize,KPanicThreadHeapSize,aPtr,EOwnerThread));
-	}
-
-TInt CTestBase::TestPanicL(SPanicParams *aPtr, TInt aExitReason, const TDesC &aCategory, TBool* aTestFinished)
-	{
-	RThread thread;
-	TRequestStatus stat;
-	TInt err=LaunchPanicThread(thread, aPtr);
-	if (err==KErrAlreadyExists)
-		{
-		// wait for kernel to clear up old threads
-		// and have several attempts at starting the thread
-		// if unsuccessful the first time
-		for (TInt i=0;i<3;i++)
-			{
-			User::After(TTimeIntervalMicroSeconds32(100000));		//0.1 secs
-			err=LaunchPanicThread(thread, aPtr);
-			if (err!=KErrAlreadyExists)
-				break;
-			}
-		}
-	User::LeaveIfError(err);
-	thread.Logon(stat);
-	User::SetJustInTime(EFalse);
-	thread.Resume();
-	User::WaitForRequest(stat);
-	User::SetJustInTime(ETrue);
-
-	TBool testFinished=EFalse;
-	TBool testPassed=ETrue;
-	if (thread.ExitType()==EExitKill)
-		{
-		User::LeaveIfError(thread.ExitReason());
-		if(thread.ExitReason()!=EWsExitReasonFinished)
-			{
-			testPassed=EFalse;
-			}
-		testFinished=ETrue;	// Finish tests
-		}
-	else
-		{
-		if ((thread.ExitCategory().Compare(aCategory)!=0)
-		|| (aExitReason!=EWservNoPanic && thread.ExitReason()!=aExitReason)
-		|| (thread.ExitType()!=EExitPanic))
-			{
-			testPassed=EFalse;
-			}			
-		}
-
-	if(aTestFinished)
-		*aTestFinished=testFinished;
-	thread.Close();
-	return(testPassed);
-	}
-
-TInt CTestBase::TestWsPanicL(TPanicFunction aFunction, TClientPanic aExitReason, TInt aInt, TAny *aPtr, TBool* aTestFinished)
-	{
-	return TestPanicL(aFunction,aExitReason,aInt,aPtr,KWSERV, aTestFinished);
-	}
-
-TInt CTestBase::TestW32PanicL(TPanicFunction aFunction, TW32Panic aExitReason, TInt aInt, TAny *aPtr, TBool* aTestFinished)
-	{
-	return TestPanicL(aFunction,aExitReason,aInt,aPtr,KW32,aTestFinished);
-	}
-	
- TInt CTestBase::TestWservPanicL(TPanicFunction aFunction, TWservPanic aExitReason, TInt aInt, TAny *aPtr)
- 	{
-	_LIT(KWSERV1,"Wserv Internal Panic");
-	return TestPanicL(aFunction,aExitReason,aInt,aPtr,KWSERV1);
-	}
-	
-TInt CTestBase::TestPanicL(TPanicFunction aFunction, TInt aExitReason, TInt aInt, TAny *aPtr, const TDesC &aCategory, TBool* aTestFinished)
-	{
-	SPanicParams params;
-	params.num=aInt;
-	params.func=aFunction;
-	params.ptr=aPtr;
-	return TestPanicL(&params, aExitReason, aCategory, aTestFinished);
-	}
-
-TBool CTestBase::IsFullRomL()
-	{
-	TBool isFullRom = EFalse;
-	_LIT(KWinName,"EikonServer");
-	TInt numWinGroups=TheClient->iWs.NumWindowGroups();
-	CArrayFixFlat<TInt>* list=new(ELeave) CArrayFixFlat<TInt>(numWinGroups);
-	TheClient->iWs.WindowGroupList(list);
-	numWinGroups=list->Count();	// Just in case it changed between originally getting it and getting the actual list
-	TBuf<64> name;
-	TInt ii;
-	for(ii=0;ii<numWinGroups;++ii)
-		{
-		TheClient->iWs.GetWindowGroupNameFromIdentifier((*list)[ii],name);
-	#ifndef DISABLE_FAIL_DIALOG
-		TInt ordinalPos=0;
-		ordinalPos+=ordinalPos;		//To stop a warning
-		ordinalPos=
-	#endif
-			TheClient->iWs.GetWindowGroupOrdinalPriority((*list)[ii]);
-		if (name==KWinName)
-			{
-			isFullRom = ETrue;
-			break;
-			}
-		}
-	delete list;
-	return isFullRom;
-	}
-
-void CTestBase::DelayIfFullRomL()
-	{
-	if (IsFullRomL())
-		User::After(400000);
-	}
-
-TPartialRedrawType CTestBase::RedrawStoreTypeL()
-	{
-/*	if (iRedrawType==EPartialRedraw_Unknown)
-		{
-		const TRgb KRed=TRgb(255,0,0);
-		const TRgb KGreen=TRgb(0,255,0);
-		const TRgb KBlue=TRgb(0,0,255);
-		CWsScreenDevice* scrDev=TheClient->iScreen;
-		TSize winSize=scrDev->SizeInPixels();
-		CBlankWindow* win=new(ELeave) CBlankWindow(KRed);	//Window will be red if WSERV just draws in background color
-		CleanupStack::PushL(win);
-		TDisplayMode mode=EColor256;
-		win->SetUpL(TPoint(),winSize,TheClient->iGroup,*TheClient->iGc,&mode);	//Window is activated
-		win->RealDraw(ETrue);
-		win->SetColor(KGreen);
-		CBlankWindow* win2=new(ELeave) CBlankWindow(KRed);
-		CleanupStack::PushL(win2);
-		win2->SetUpL(TPoint(),winSize,TheClient->iGroup,*TheClient->iGc,&mode);	//New Window completely obscures other window
-		win2->RealDraw(ETrue);
-		win->CTWin::DrawNow();	//Window will be green if drawn from stored commands
-		win2->CTWin::DrawNow();
-		win2->SetVisible(EFalse);
-		TRgb col;
-		scrDev->GetPixel(col,TPoint(5,5));	//Pixel will be red if storing off by default and green otherwise
-		if (col==KRed)
-			{
-			win->Win()->EnableRedrawStore(ETrue);
-			win->CTWin::DrawNow();	//Create stored commands
-			}
-		else
-			__ASSERT_ALWAYS(col==KGreen,AutoPanic(EAutoPanicRedrawStoring));
-		win->SetColor(KBlue);
-		TRect redrawRect(TSize(10,10));
-		win->Invalidate(redrawRect);
-		win->Win()->BeginRedraw(redrawRect);
-		win->DrawNow(redrawRect);	//Top left of Window will be blue if it draws itself
-		win->Win()->EndRedraw();
-		win2->SetVisible(ETrue);
-		win2->SetVisible(EFalse);
-		scrDev->GetPixel(col,TPoint(5,5));	//Pixel will be red if stored commands were lost
-		iRedrawType=EPartialRedraw_None;
-		if (col!=KRed)
-			{
-			__ASSERT_ALWAYS(col==KBlue,AutoPanic(EAutoPanicRedrawStoring));
-			TheClient->WaitForRedrawsToFinish();
-			win2->SetVisible(ETrue);
-			win2->SetVisible(EFalse);
-			scrDev->GetPixel(col,TPoint(15,15));	//Pixel will be blue if partial redraw triggers full redraw
-			iRedrawType=EPartialRedraw_PreserveStoredCmds;
-			if (col!=KBlue)
-				{
-				__ASSERT_ALWAYS(col==KGreen,AutoPanic(EAutoPanicRedrawStoring));
-				iRedrawType=EPartialRedraw_FullRedrawSupport;
-				}
-			}
-		CleanupStack::PopAndDestroy(2,win);
-		}
-	return iRedrawType;*/
-	return EPartialRedraw_FullRedrawSupport;
-	}
-
-void CTestBase::SetUpMember(TSpriteMember &aMember)
-	{
-	aMember.iMaskBitmap=NULL;
-	aMember.iInvertMask=EFalse;
-	aMember.iDrawMode=CGraphicsContext::EDrawModePEN;
-	aMember.iOffset=TPoint();
-	aMember.iInterval=TTimeIntervalMicroSeconds32(0);
-	}
-
-void CTestBase::SimulateKeyDownUpWithModifiers(TInt aScanCode,TUint aModifiers)
-	{
-	if (aModifiers&EModifierAlt)
-		SimulateKey(TRawEvent::EKeyDown,EStdKeyLeftFunc);
-	if (aModifiers&EModifierCtrl)
-		SimulateKey(TRawEvent::EKeyDown,EStdKeyLeftCtrl);
-	if (aModifiers&EModifierShift)
-		SimulateKey(TRawEvent::EKeyDown,EStdKeyLeftShift);
-	SimulateKeyDownUp(aScanCode);
-	if (aModifiers&EModifierShift)
-		SimulateKey(TRawEvent::EKeyUp,EStdKeyLeftShift);
-	if (aModifiers&EModifierCtrl)
-		SimulateKey(TRawEvent::EKeyUp,EStdKeyLeftCtrl);
-	if (aModifiers&EModifierAlt)
-		SimulateKey(TRawEvent::EKeyUp,EStdKeyLeftFunc);
-	}
-
-void CTestBase::SimulateKeyDownUp(TInt aScanCode)
-	{
-	__ASSERT_DEBUG(aScanCode<'a' || aScanCode>'z',AutoPanic(EAutoPanicScanCapital));
-	SimulateKey(TRawEvent::EKeyDown,aScanCode);
-	SimulateKey(TRawEvent::EKeyUp,aScanCode);
-	}
-
-void CTestBase::SimulatePointerDownUp(TInt aX, TInt aY)
-	{
-	SimulatePointer(TRawEvent::EButton1Down,aX,aY);
-	SimulatePointer(TRawEvent::EButton1Up,aX,aY);
-	}
-
-void CTestBase::SimulateKey(TRawEvent::TType aType, TInt aScanCode)
-	{
-	TRawEvent rawEvent;
-	rawEvent.Set(aType,aScanCode);
-	TheClient->iWs.SimulateRawEvent(rawEvent);
-	}
-
-/**
- * Determine if the configuration supports pointer event testing.
- * 
- * There are certain circumstances where we want to skip pointer event
- * testing because we are simulating pointer events, and don't want to
- * simulate a pointer event from an impossible co-ordinate.  We'd rather
- * just identify that there is no point in doing the test and skip over
- * to the next test case.
- * 
- * In particular, when a ROM configured with a digitiser is deployed on a
- * Naviengine, with hardware configuration DIP switches which say that there
- * is an external screen connected, then no touch pad is active.
- * The base port under these conditions returns a digitiser area (0,0,0,0)
- * 
- * @return ETrue if the configuration supports pointer event testing, otherwise
- *         return EFalse.
- */
-TBool CTestBase::ConfigurationSupportsPointerEventTesting() const
-    {
-    if (iNormalPointerCursorArea.IsEmpty())
-        {
-        return EFalse;
-        }
-    return ETrue;
-    }
-
-
-void CTestBase::SimulatePointer(TRawEvent::TType aType, TInt aX, TInt aY)
-	{
-	__ASSERT_DEBUG(ConfigurationSupportsPointerEventTesting(), AutoPanic(EAutoPanicNoDigitiser));
-
-
-#ifdef WSERV_TAUTO_LOG_POINTER_EVENTS
-	TLogMessageText buf;
-	_LIT(KLog,"SimulatePointer  Type=%d  Pos=(%d,%d)");
-	buf.Format(KLog,aType,aX,aY);
-	TheClient->LogMessage(buf);
-#endif
-	
-	TRawEvent rawEvent;
-	rawEvent.Set(aType,aX,aY);
-	TheClient->iWs.SimulateRawEvent(rawEvent);
-	}
-
-void CTestBase::SimulateEvent(TRawEvent::TType aType)
-	{
-	TRawEvent rawEvent;
-	rawEvent.Set(aType);
-	TheClient->iWs.SimulateRawEvent(rawEvent);
-	}
-
-void CTestBase::LogColors(const CBitmapDevice& aDevice,TPoint aBasePoint, TPoint aStartPoint, TPoint aEndPoint)
-	{
-	_LIT(KPixel,"Pixel(%d,%d) R=%d G=%d B=%d");
-	TLogMessageText buf;
-	TBuf8<2560> screen;
-	const TRgb* pixel;
-	if (aStartPoint.iX==aEndPoint.iX)
-		++aEndPoint.iX;
-	if (aStartPoint.iY==aEndPoint.iY)
-		++aEndPoint.iY;
-	TInt width=aEndPoint.iX-aStartPoint.iX;
-	TInt xx,yy;
-	for (yy=aStartPoint.iY;yy<aEndPoint.iY;++yy)
-		{
-		xx=aStartPoint.iX;
-		aDevice.GetScanLine(screen,aBasePoint+TPoint(xx,yy),width,ERgb);
-		pixel=REINTERPRET_CAST(const TRgb*,screen.Ptr());
-		for (;xx<aEndPoint.iX;++xx,++pixel)
-			{
-			buf.Format(KPixel,xx,yy,pixel->Red(),pixel->Green(),pixel->Blue());
-			//RDebug::Print(buf);
-			TheClient->iWs.LogMessage(buf);
-			}
-		}
-	TheClient->iWs.Flush();
-	}
-
-void CTestBase::LogColors4(const CBitmapDevice& aDevice,TPoint aStartPoint,TInt aLen)
-	{
-	_LIT(KValue,"Pixel(%d,%d)  Byte %d,  Value %d");
-	TLogMessageText buf;
-	TBuf8<2560> screen;
-	aDevice.GetScanLine(screen,aStartPoint,aLen,EGray4);
-	TInt len=(aLen+3)/4;
-	TInt ii;
-	for (ii=0;ii<len;++ii,aStartPoint.iX+=4)
-		{
-		buf.Format(KValue,aStartPoint.iX,aStartPoint.iY,ii,screen[ii]);
-		TheClient->iWs.LogMessage(buf);
-		}
-	}
-
-void CTestBase::UpdateTestResults(TInt aNoOfTest, TInt aNoOfTestPass)
-	{
-	iNumberTests+=aNoOfTest;
-	iNumberTestsPass+=aNoOfTestPass;
-	}
-
-TInt CTestBase::SaveScreen(const TDesC& aFileName)
-	{
-	return SaveScreen(aFileName,TheClient->iScreen->SizeInPixels(),TheClient->iScreen->DisplayMode());
-	}
-
-TInt CTestBase::SaveScreen(const TDesC& aFileName,const TSize& aScreenSize,TDisplayMode aColorDepth)
-	{
-	TRAPD(err,SaveScreenL(aFileName,aScreenSize,aColorDepth));
-	return err;
-	}
-
-void CTestBase::SaveScreenL(const TDesC& aFileName,const TSize& aScreenSize,TDisplayMode aColorDepth)
-	{
-	CBitmap* copyOfScreen=CBitmap::NewLC(aScreenSize,aColorDepth);
-	CFbsScreenDevice* scrDevice=CFbsScreenDevice::NewL(iScreenNumber,aColorDepth);
-	CleanupStack::PushL(scrDevice);
-	CFbsBitGc* gc;
-	User::LeaveIfError(scrDevice->CreateContext(gc));
-	CleanupStack::PushL(gc);
-	copyOfScreen->Gc().BitBlt(TPoint(),*gc);
-	User::LeaveIfError(copyOfScreen->Bitmap().Save(aFileName));
-	CleanupStack::PopAndDestroy(3,copyOfScreen);
-	}
-
-
-/*CProcess*/
-_LIT(KScreenTag,"Screen");
-
-void CProcess::GetProcArg(const TWinCommand& aParam,TBufArg& aProcArg)
-	{
-	TInt pos = aParam.Find(KScreenTag);
-	if (pos!=KErrNotFound)
-		aProcArg = aParam.Left(pos-1);
-	else
-		aProcArg = aParam;
-	}
-
-void CProcess::GetScreenArg(const TWinCommand& aParam, TInt& aScreenArg)
-	{
-	TInt pos = aParam.Find(KScreenTag);
-	if (pos!=KErrNotFound)
-		{
-		TBufArg secondArg(aParam.Right(aParam.Length()-pos));
-		if (secondArg.Length()>6)
-			{
-			TBuf<1> digit(secondArg.Mid(6,1));
-			TLex lex(digit);
-			lex.Val(aScreenArg);
-			}
-		}
-	}
-
-TInt CProcess::Start(const TWinCommand& aParam)
-	{
-	// parse command line aParam to retrieve value of
-	// screen number if it is specified
-	//
-	// command line format: <process-id> [screen<id>]
-	//
-	TBufArg procArg(_L(""));
-	TInt screenArg = KDefaultScreen;
-
-	GetProcArg(aParam, procArg);
-	GetScreenArg(aParam, screenArg);
-
-	TInt ii;
-	for(ii=0;ii<eNumProcessCalls;ii++)
-		{
-		if (procArg==iFunctions[ii].iParam)
-			{
-			TRAPD(ret,iFunctions[ii].iFunction((TAny*)screenArg));
-
-			// need to pass test result to owning process
-			// for multiple display test
-			if (ii==eProcessMultiDisplayTest)
-				ret = TheTestResult;
-
-			return ret;
-			}
-		}
-
-	return KErrNone;		//Shouldn't get here
-	}
-
-CProcess* CProcess::NewL(TInt aFunctionNo,TInt aScreenNumber)
-	{
-	CProcess* self=new(ELeave) CProcess();
-	CleanupStack::PushL(self);
-	self->ConstructL(aFunctionNo,aScreenNumber);
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-CProcess* CProcess::NewTL(TInt aFunctionNo,TInt aScreenNumber,TRequestStatus* aStatus /*=NULL*/)
-	{
-	CProcess* self=new(ELeave) CProcess();
-	CleanupStack::PushL(self);
-	self->ConstructTL(aFunctionNo,aScreenNumber,aStatus);
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-CProcess* CProcess::NewThreadL(const TDesC& aName,TThreadFunction aFunction,TThreadStartUp* aPtr
-																						,TRequestStatus* aStatus)
-	{
-	CProcess* self=new(ELeave) CProcess();
-	CleanupStack::PushL(self);
-	self->ConstructL(aName,aFunction,aPtr,aStatus);
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-CProcess* CProcess::NewThreadRendezvousL(const TDesC& aName,TThreadFunction aFunction,TThreadStartUp* aPtr ,TRequestStatus* aLogonStatus,TRequestStatus& aRendesvouzStatus)
-    {
-    CProcess* self=new(ELeave) CProcess();
-    CleanupStack::PushL(self);
-    self->ConstructRendezvousL(aName,aFunction,aPtr,aLogonStatus,aRendesvouzStatus);
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-CProcess* CProcess::NewThreadRendezvousL(const TDesC& aName,TThreadStartUp* aPtr,TRequestStatus& aRendesvouzStatus)
-    {
-    return NewThreadRendezvousL(aName,ThreadInit,aPtr,NULL,aRendesvouzStatus);
-    }
-
-CProcess* CProcess::NewThreadL(const TDesC& aName,TThreadStartUp* aPtr)
-	{
-	return NewThreadL(aName,ThreadInit,aPtr,NULL);
-	}
-
-CProcess* CProcess::NewSimpleThreadL(const TDesC& aName,TThreadStartUp* aPtr,TRequestStatus* aStatus/*=NULL*/)
-	{
-	return NewThreadL(aName,SimpleThreadInit,aPtr,aStatus);
-	}
-
-_LIT(KSpace," ");
-_LIT(KScreenFormat,"%d");
-
-void CProcess::ConstructL(TInt aFunctionNo,TInt aScreenNumber/*=KDefaultScreen*/)
-	{
-	Close();
-	// add screen number into command line param
-	// format: <proc-id> [screen<id>]
-	//
-	TBuf<100> commandLine;
-
-	commandLine = iFunctions[aFunctionNo].iParam;
-	commandLine.Append(KSpace);
-	commandLine.Append(KScreenTag);
-	commandLine.AppendFormat(KScreenFormat,aScreenNumber);
-	User::LeaveIfError(iOther.Create(RProcess().FileName(),commandLine));
-	iCreated|=eOtherCreated;
-	iOther.Resume();
-	}
-
-void CProcess::ConstructTL(TInt aFunctionNo,TInt aScreenNumber/*=KDefaultScreen*/,TRequestStatus* aStatus)
-	{
-	Close();
-	TUint flag=eThreadCreated;
-	TInt err=iThread.Create(iFunctions[aFunctionNo].iParam,iFunctions[aFunctionNo].iFunction
-													,KDefaultStackSize,KOtherProcHeapSize,KOtherProcHeapSize,(TAny*)aScreenNumber,EOwnerThread);
-	User::LeaveIfError(err);
-	iCreated|=flag;
-	if (aStatus)
-		Logon(*aStatus);
-	iThread.Resume();
-	}
-
-
-void CProcess::ConstructL(const TDesC& aName,TThreadFunction aFunction,TThreadStartUp* aPtr,TRequestStatus* aStatus)
-	{
-	Close();
-	User::LeaveIfError(iThread.Create(aName,aFunction,KDefaultStackSize,KOtherProcHeapSize,KOtherProcHeapSize,aPtr,EOwnerThread));
-	iCreated|=eThreadCreated;
-	if (aStatus)
-		Logon(*aStatus);
-	iThread.Resume();
-	}
-
-void CProcess::ConstructRendezvousL(const TDesC& aName,TThreadFunction aFunction,TThreadStartUp* aPtr,TRequestStatus* aLogonStatus,TRequestStatus& aRendezvousStatus)
-    {
-    Close();
-    User::LeaveIfError(iThread.Create(aName,aFunction,KDefaultStackSize,KOtherProcHeapSize,KOtherProcHeapSize,aPtr,EOwnerThread));
-    iCreated|=eThreadCreated;
-    if (aLogonStatus)
-        Logon(*aLogonStatus);
-
-    iThread.Rendezvous(aRendezvousStatus);     
-    iThread.Resume();
-    }
-
-void CProcess::Logon(TRequestStatus& aStatus) const
-	{
-	if (iCreated&eThreadCreated)
-		iThread.Logon(aStatus);
-	else
-		{
-		iOther.Logon(aStatus);
-		}
-	}
-
-void CProcess::Terminate(TInt aReason)
-	{
-	if (iCreated&eThreadCreated)
-		iThread.Terminate(aReason);
-	else
-		{
-		iOther.Terminate(aReason);
-		}
-	Close();
-	}
-
-void CProcess::Close()
-	{
-	if (iCreated&eOtherCreated)
-		iOther.Close();
-	if (iCreated&eThreadCreated)
-		iThread.Close();
-	iCreated=0;
-	}
-
-CProcess::~CProcess()
-	{
-	Close();
-	}
-
-TBool CProcess::StillAlive()
-	{
-	if (iCreated&eOtherCreated)
-		return iOther.ExitType()==EExitPending;
-	return iThread.ExitType()==EExitPending;
-	}
-
-void CProcess::LeaveIfDied()		//Can Leave
-	{
-	User::After(200000);		//0.2 secs
-	if (StillAlive())
-		return;
-	if (iCreated&eOtherCreated)
-		User::Leave(iOther.ExitReason());
-	User::Leave(iThread.ExitReason());
-	}
-
-const TInt KFirstInstanceId = 1;
-const TInt KOtherInstanceId = 2;
-
-TBool CProcess::ProcessDied(TInt aScreenNo/*=KDefaultScreen*/)
-	{
-	_LIT(pName,"TAutoServer*");
-	TFindProcess find(pName);
-	TFullName name;
-
-	TBool found = EFalse;
-	TInt instanceId = aScreenNo==KDefaultScreen? KFirstInstanceId : KOtherInstanceId;
-	// find the correct instance of the process
-	// required in multi display test
-	while (!found && find.Next(name)==KErrNone)
-		{
-		TPtrC scrId = name.Right(1);
-		TInt id;
-		TLex lex(scrId);
-		lex.Val(id);
-		if (id==instanceId)
-			found = ETrue;
-		}
-	if (!found)
-		return EFalse;
-
-	RProcess p;
-	p.Open(name);
-	if (p.Id()!=RProcess().Id())
-		return EFalse;
-	p.Close();
-	return (find.Next(name)!=KErrNone);
-	}
-
-TInt CProcess::ThreadInit(TAny *aPtr)
-	{
-	__UHEAP_MARK;
-	TInt err=KErrNone;
-	CTrapCleanup* CleanUpStack=CTrapCleanup::New();
-	if (CleanUpStack==NULL)
-		err=KErrNoMemory;
-	else
-		{
-		TRAP(err,InitialiseL(STATIC_CAST(TThreadStartUp*,aPtr)))
-		delete CleanUpStack;
-		}
-	__UHEAP_MARKEND;
-	return(err);
-	}
-
-void CProcess::InitialiseL(TThreadStartUp* aPtr)
-	{
-	CActiveScheduler* activeScheduler=new(ELeave) CActiveScheduler;
-	CActiveScheduler::Install(activeScheduler);
-	CleanupStack::PushL(activeScheduler);
-	aPtr->iInitFunction(aPtr->iParam);
-	CActiveScheduler::Start();
-	CleanupStack::PopAndDestroy(activeScheduler);
-	}
-
-TInt CProcess::SimpleThreadInit(TAny *aPtr)
-	{
-	__UHEAP_MARK;
-	TInt err=KErrNone;
-	CTrapCleanup* CleanUpStack=CTrapCleanup::New();
-	if (CleanUpStack==NULL)
-		err=KErrNoMemory;
-	else
-		{
-		TThreadStartUp* ptr=STATIC_CAST(TThreadStartUp*,aPtr);
-		ptr->iInitFunction(ptr->iParam);
-		delete CleanUpStack;
-		}
-	__UHEAP_MARKEND;
-	return(err);
-	}
-
-/*CMinWin*/
-
-CMinWin::CMinWin(TInt aScreenNo): iScreenNo(aScreenNo)
-	{}
-
-void CMinWin::ConstructL()
-	{
-	User::LeaveIfError(iWs.Connect());
-	iScr=new(ELeave) CWsScreenDevice(iWs);
-	User::LeaveIfError(iScr->Construct(iScreenNo));
-	iGroup=RWindowGroup(iWs);
-	User::LeaveIfError(iGroup.Construct(8970+iScreenNo,ETrue));
-	iWin=RWindow(iWs);
-	User::LeaveIfError(iWin.Construct((RWindowTreeNode)iGroup,(TUint32)this));
-	iRect=TSize(10,10);
-	iWin.SetExtent(TPoint(0,0),iRect.Size());
-	iWin.SetRequiredDisplayMode(EColor256);
-	iWin.SetBackgroundColor(KRgbGreen);
-	iWin.Activate();
-	iGc=new(ELeave) CWindowGc(iScr);
-	User::LeaveIfError(iGc->Construct());
-
-	Draw(iRect);
-	iWs.Flush();
-	}
-
-CMinWin::~CMinWin()
-	{
-	delete iGc;
-	iWin.Close();
-	iGroup.Close();
-	delete iScr;
-	iWs.Close();
-	}
-
-void CMinWin::Draw(const TRect& aRect)
-	{
-	iWin.BeginRedraw();
-	iGc->Activate(iWin);
-	iGc->SetPenStyle(CGraphicsContext::ENullPen);
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	iGc->SetBrushColor(KRgbGreen);
-	iGc->DrawRect(aRect);
-	iGc->Deactivate();
-	iWin.EndRedraw();
-	}
-
-
-/*CTimeOut*/
-
-void CTimeOut::ConstructL()
-	{
-	CTimer::ConstructL();
-	CActiveScheduler::Add(this);
-	}
-
-void CTimeOut::Start(TTimeIntervalMicroSeconds32 aInterval,TCallBack aCallBack)
-	{
-	iCallBack=aCallBack;
-	After(aInterval);
-	}
-
-void CTimeOut::RunL()
-	{
-	iCallBack.CallBack();
-	}
-
-/* 
- * Simply returns the DisplayMode as a string. Used to display mode details on test results. 
- */
-GLDEF_C TPtrC DisplayModeAsString(TDisplayMode aMode)
-	{
-	
-	TPtrC modeAsString;
-	
-	switch(aMode)
-		{
-		case ENone:
-			_LIT(KENoneMode,"ENone");
-			modeAsString.Set(KENoneMode);
-			break;
-		case EGray2: 
-			_LIT(KEGray2Mode,"EGray2");
-			modeAsString.Set(KEGray2Mode);
-			break;
-		case EGray4:
-			_LIT(KEGray4Mode,"EGray4");
-			modeAsString.Set(KEGray4Mode);
-			break;
-		case EGray16:
-			_LIT(KEGray16Mode,"EGray16");
-			modeAsString.Set(KEGray16Mode);
-			break;
-		case EGray256:
-			_LIT(KEGray256Mode,"EGray256");
-			modeAsString.Set(KEGray256Mode);
-			break;
-		case EColor16:
-			_LIT(KEColor16Mode,"EColor16");
-			modeAsString.Set(KEColor16Mode);
-			break;
-		case EColor256:
-			_LIT(KEColor256Mode,"EColor256");
-			modeAsString.Set(KEColor256Mode);
-			break;
-		case EColor64K:
-			_LIT(KEColor64KMode,"EColor64K");
-			modeAsString.Set(KEColor64KMode);
-			break;
-		case EColor16M:
-			_LIT(KEColor16MMode,"EColor16M");
-			modeAsString.Set(KEColor16MMode);
-			break;
-		case EColor4K:
-			_LIT(KEColor4KMode,"EColor4K");
-			modeAsString.Set(KEColor4KMode);
-			break;
-		case EColor16MU:
-			_LIT(KEColor16MUMode,"EColor16MU");
-			modeAsString.Set(KEColor16MUMode);
-			break;
-		case EColor16MA:
-			_LIT(KEColor16MAMode,"EColor16MA");
-			modeAsString.Set(KEColor16MAMode);
-			break;
-		case EColor16MAP:
-			_LIT(KEColor16MAPMode,"EColor16MAP");
-			modeAsString.Set(KEColor16MAPMode);
-			break;
-		default:
-			_LIT(KUnknownMode,"Unknown");
-			modeAsString.Set(KUnknownMode);
-			break;
-		}
-	
-	return modeAsString;
-	}
-
-// Check if an area of a bitmap is of a certain color
-GLDEF_C TBool LossyCheckBlankBitmap(const CFbsBitmap& aBitmap, const TRect aArea, const TRgb aCheckColor, TBool aLossyCompare)
-	{
-	const TReal errorLimit = (aLossyCompare ? 0.05 : 0.00); //Lossy(default) or exact compare?
-	
-	TBool result = ETrue;
-	/* TInt mismatchedPixels = 0; */ // -- Useful for debugging
-	TRgb bitmapPix = TRgb(0,0,0,0); //testWin Pixel
-	for (TInt x = 0; x < aArea.Size().iWidth; x++)
-		{
-		for (TInt y = 0; y < aArea.Size().iHeight; y++)
-			{
-			aBitmap.GetPixel(bitmapPix, TPoint(x,y));
-			
-			//Check if there are differeces in color between the bitmap and the test color
-			if(((TReal)abs(bitmapPix.Red() - aCheckColor.Red())/255) > errorLimit || 
-					((TReal)abs(bitmapPix.Blue() - aCheckColor.Blue())/255) > errorLimit || 
-					((TReal)abs(bitmapPix.Green() - aCheckColor.Green())/255) > errorLimit || 
-					((TReal)abs(bitmapPix.Alpha() - aCheckColor.Alpha())/255) > errorLimit)
-				{
-				/* mismatchedPixels++; */ // -- Useful for debugging
-				result = EFalse;
-				break;
-				}
-			}
-		}
-	
-	/* INFO_PRINTF2(_L("Number of different pixels: %i"), mismatchedPixels); */ // -- Useful for debugging
-	return result;
-	}
-
-// Compare a section of two bitmaps
-GLDEF_C TBool LossyCompareBitmap(const CFbsBitmap& aBitmap1, const CFbsBitmap& aBitmap2, const TRect aCompareRect, TBool aLossyCompare)
-	{
-	const TReal errorLimit = (aLossyCompare ? 0.05 : 0.00); //Lossy or Exact compare?
-	
-	TBool result = ETrue;
-
-	if (aBitmap1.DisplayMode() != aBitmap2.DisplayMode())
-		{
-		RDebug::Printf(" DisplayMode difference %d, %d", aBitmap1.DisplayMode(), aBitmap2.DisplayMode());
-		}
-	
-	TRgb bitmap1Pix = TRgb(0,0,0,0);
-	TRgb bitmap2Pix = TRgb(0,0,0,0);
-	for (TInt x = 0; x < aCompareRect.Size().iWidth; x++)
-		{
-		for (TInt y = 0; y < aCompareRect.Size().iHeight; y++)
-			{
-			aBitmap1.GetPixel(bitmap1Pix, TPoint(x,y));
-			aBitmap2.GetPixel(bitmap2Pix, TPoint(x,y));
-						
-			//Check if there are differences between the colors of the two bitmaps
-			if(((TReal)abs(bitmap1Pix.Red() - bitmap2Pix.Red())/255) > errorLimit || 
-					((TReal)abs(bitmap1Pix.Blue() - bitmap2Pix.Blue())/255) > errorLimit || 
-					((TReal)abs(bitmap1Pix.Green() - bitmap2Pix.Green())/255) > errorLimit || 
-					((TReal)abs(bitmap1Pix.Alpha() - bitmap2Pix.Alpha())/255) > errorLimit)
-				{
-				/*
-				 * There was a difference so return without checking the rest of the
-				 * bitmap.  If you are seeing Lossy compare errors, and want to diagnose
-				 * further, consider switching over to using a recording version of this
-				 * function, LossyCompareBitmapRecord()
-				 */
-				result = EFalse;
-				break;
-				}
-			}
-		}
-	
-	return result;
-	}
-
-/**
- * Compare two bitmaps, optionally a lossy comparison, recording any differences and saving bitmaps
- * 
- * @param	aBitmap1			Bitmap being checked
- * @param	aBitmap2			Reference Bitmap
- * @param	aCompareRect		Area of bitmap to compare
- * @param	aLossyCompare		ETrue means use a lossy compare strategy, else do an exact compare
- * @param	aPixelsDifferent	Returned value representing the number of pixels which are different
- * @param	aLogger				Facility for logging to be reported by this function
- * @return						ETrue if the bitmaps are the same (or similar).
- * 								Otherwise EFalse, with logging reporting the differences, and bitmaps saved in c:\logs\
- * @pre 						c:\logs directory must exist
- */
-GLDEF_C TBool LossyCompareBitmapRecord(CFbsBitmap& aBitmap1, CFbsBitmap& aBitmap2, const TRect aCompareRect, TBool aLossyCompare, TInt& aPixelsDifferent, CTestExecuteLogger& aLogger)
-	{
-	const TReal errorLimit = (aLossyCompare ? 0.05 : 0.00); //Lossy or Exact compare?
-	
-	TBool result = ETrue;
-	TInt mismatchedPixels = 0;
-	TRgb bitmap1Pix = TRgb(0,0,0,0);
-	TRgb bitmap2Pix = TRgb(0,0,0,0);
-	if (aBitmap1.DisplayMode() != aBitmap2.DisplayMode())
-		{
-		aLogger.LogExtra(((TText8*)__FILE__), __LINE__, ESevrInfo,
-				_L(" DisplayMode difference %d, %d"), aBitmap1.DisplayMode(), aBitmap2.DisplayMode());
-		}
-	for (TInt x = 0; x < aCompareRect.Size().iWidth; x++)
-		{
-		for (TInt y = 0; y < aCompareRect.Size().iHeight; y++)
-			{
-			aBitmap1.GetPixel(bitmap1Pix, TPoint(x,y));
-			aBitmap2.GetPixel(bitmap2Pix, TPoint(x,y));
-						
-			//Check if there are differences between the colors of the two bitmaps
-			if(((TReal)abs(bitmap1Pix.Red() - bitmap2Pix.Red())/255) > errorLimit || 
-					((TReal)abs(bitmap1Pix.Blue() - bitmap2Pix.Blue())/255) > errorLimit || 
-					((TReal)abs(bitmap1Pix.Green() - bitmap2Pix.Green())/255) > errorLimit || 
-					((TReal)abs(bitmap1Pix.Alpha() - bitmap2Pix.Alpha())/255) > errorLimit)
-				{
-				mismatchedPixels++;
-				
-				aLogger.LogExtra(((TText8*)__FILE__), __LINE__, ESevrInfo,
-						_L(" Pixel difference %d,%d: %d"),x,y, bitmap1Pix.Difference(bitmap2Pix));
-				result = EFalse;
-				// we loop around again to pick up all the differences
-				}
-			}
-		}
-	aPixelsDifferent = mismatchedPixels;
-	
-	/*
-	 * When the bitmaps are different, we store them locally in c:\\logs in
-	 * timestamped files.  Save() is a non-const method; this is why aBitmap1
-	 * and aBitmap2 are non-const.  Saving can fail, perhaps because we have
-	 * exceeded storage limits.
-	 */
-	if (!result) 
-		{
-		TTime now;
-		now.UniversalTime();
-		TInt timestamp = I64INT(now.Int64() & 0x7fffffffu);
-		timestamp/=1000; // a millisecond resolution is easier to track
-		TFileName mbmFileSrc;
-		mbmFileSrc.Format (_L("c:\\logs\\%d_LossyCompareBitmap1.mbm"), timestamp);
-		TFileName mbmFileDst;
-		mbmFileDst.Format (_L("c:\\logs\\%d_LossyCompareBitmap2.mbm"), timestamp); 
-		TInt saveResult1;
-		TInt saveResult2;
-		saveResult1 = aBitmap1.Save(mbmFileSrc);
-		saveResult2 = aBitmap2.Save(mbmFileDst);		
-		if (saveResult1 == KErrNone && saveResult2 == KErrNone)
-			{
-			aLogger.LogExtra(((TText8*)__FILE__), __LINE__, ESevrInfo,
-						_L(" Bitmaps are different: see %S, %S"), &mbmFileSrc, &mbmFileDst);				
-			}
-		else
-			{
-			aLogger.LogExtra(((TText8*)__FILE__), __LINE__, ESevrInfo,
-						_L(" Bitmaps are different, but could not save files into c:\\logs : %d %d"), saveResult1, saveResult2);
-			}
-		}
-
-	return result;
-	}
-
-// Check if an area of a screen is of a certain color
-GLDEF_C TBool LossyCheckBlankWindow(const CWsScreenDevice& aScreen, CFbsBitmap& aBitmap, const TRect aArea, const TRgb aCheckColor)
-	{
-	aScreen.CopyScreenToBitmap(&aBitmap, aArea);
-	return LossyCheckBlankBitmap(aBitmap, aArea, aCheckColor);
-	}
-
-// Compare a section of two windows on the screen
-GLDEF_C TBool LossyCompareWindow(const CWsScreenDevice& aScreen, CFbsBitmap& aBitmap1, CFbsBitmap& aBitmap2, const TRect aCompareRect)
-	{
-	aScreen.CopyScreenToBitmap(&aBitmap1, aCompareRect);
-	aScreen.CopyScreenToBitmap(&aBitmap2, aCompareRect);
-	return LossyCompareBitmap(aBitmap1, aBitmap2, aCompareRect);
-	}
-
--- a/windowing/windowserver/tauto/AUTODLL.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2858 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Auto test Animated DLL functions
-// 
-//
-
-#include <e32std.h>
-#include <w32std.h>
-#include <w32adll.h>
-#include <bitstd.h>
-#include "AUTODLL.H"
-#include "TAnimDraw.h"
-#include "eventdd.h"
-#include <gdi.h>
-#include <fbs.h>
-
-union TAnimArgUnion
-	{
-	const TAny* any;
-	const TBool* Bool;
-	const TInt* Int;
-	const TPoint* Point;
-	const TSize* Size;
-	const TRect* Rect;
-	const TSpriteMemberInfo* SpriteMemberInfo;
-	const TShadowDrawTest* ShadowDrawTest;
-	const TDrawTestScreen* DrawTestScreen;
-	const TSyncTests* SyncTests;
-	const TTimeChangeTest* TimeChangeTest;
-	const TAnimRawEvent* AnimRawEvent;
-	const TWindowGroupInfoParms* WindowGroupInfoParms;
-	const TSetOrdinalParms* SetOrdinalParms;
-	const TFrameData* FrameData;
-	const TRawEvent* RawEvent;
-	};
-
-class CPanicAnim : public CWindowAnim
-	{
-	enum TSyncState
-		{
-		ESyncStateNull,
-		ESyncStateStarting,
-		ESyncStateCounting,
-		ESyncLeave,
-		ESyncStateTimeChange1,
-		ESyncStateTimeChange2,
-		ESyncStateTimeChange3
-		};
-	enum {ESyncCount=8};
-public:
-	~CPanicAnim();
-	virtual void ConstructL(TAny *aArgs, TBool aHasFocus);
-	virtual void Animate(TDateTime *aDateTime);
-	virtual void Redraw();
-	virtual void Command(TInt aOpcode, TAny *aArgs);
-	virtual TInt CommandReplyL(TInt aOpcode, TAny *aArgs);
-	virtual void FocusChanged(TBool aState);
-	//Pure virtual function from MEventHandler
-	virtual TBool OfferRawEvent(const TRawEvent &aRawEvent);
-private:
-	void StartSyncTest(MAnimGeneralFunctions::TAnimSync aSync);
-	void StartTimeChangeTest();
-	void DoLeaveInActiveCallback();
-	static TInt LeaveInActiveCallback(TAny *aThis);
-private:
-	TRequestStatus *iStatusPtr;
-	TRequestStatus *iStatusPtr2;
-	TTime iTime;
-	TInt iSyncCount;
-	TSyncState iSyncState;
-	MAnimGeneralFunctions::TAnimSync iSyncMode;
-	TBool iLeaveInRedraw;
-	CIdle* iActivePanicIdle;
-	};
-
-class CPanicAnim2 : public CWindowAnim
-//
-// Simply panics in the ConstructL()
-//
-	{
-public:
-	virtual void ConstructL(TAny *aArgs, TBool aHasFocus);
-	virtual void Animate(TDateTime *aDateTime);
-	virtual void Redraw();
-	virtual void Command(TInt aOpcode, TAny *aArgs);
-	virtual TInt CommandReplyL(TInt aOpcode, TAny *aArgs);
-	virtual void FocusChanged(TBool aState);
-	//Pure virtual function from MEventHandler
-	virtual TBool OfferRawEvent(const TRawEvent &aRawEvent);
-	};
-
-class CAutoAnim3 : public CWindowAnim
-//
-// test drawing/redrawing
-//
-	{
-public:
-	virtual void ConstructL(TAny *aArgs, TBool aHasFocus);
-	virtual void Animate(TDateTime *aDateTime);
-	virtual void Redraw();
-	virtual void Command(TInt aOpcode, TAny *aArgs);
-	virtual TInt CommandReplyL(TInt aOpcode, TAny *aArgs);
-	virtual void FocusChanged(TBool aState);
-	void Draw(const TRect &aRect);
-	void DrawTestScreenL(const TDrawTestScreen* aParams);
-	//Pure virtual function from MEventHandler
-	virtual TBool OfferRawEvent(const TRawEvent &aRawEvent);
-private:
-	TRequestStatus *iStatusPtr;
-	CFbsFont *iFont;
-	TRect iRect;
-	TRect iBaseRect;
-	TInt iMode;
-	};
-
-class CAutoAnimScrBack : public CWindowAnim
-//
-// test anim drawing behind a backed up window
-//
-	{
-public:
-	virtual void ConstructL(TAny *aArgs, TBool aHasFocus);
-	virtual void Animate(TDateTime *aDateTime);
-	virtual void Redraw();
-	virtual void Command(TInt aOpcode, TAny *aArgs);
-	virtual TInt CommandReplyL(TInt aOpcode, TAny *aArgs);
-	virtual void FocusChanged(TBool aState);
-	void Draw();
-	//Pure virtual function from MEventHandler
-	virtual TBool OfferRawEvent(const TRawEvent &aRawEvent);
-private:
-	TRect iRect;
-	TInt iMode;
-	};
-
-class CTestSpriteAnim : public CSpriteAnim
-	{
-public:
-	virtual void ConstructL(TAny *aArgs);
-	virtual void Animate(TDateTime *aDateTime);
-	virtual void Command(TInt aOpcode, TAny *aArgs);
-	virtual TInt CommandReplyL(TInt aOpcode, TAny *aArgs);
-	//Pure virtual function from MEventHandler
-	virtual TBool OfferRawEvent(const TRawEvent &aRawEvent);
-private:
-	TBool CheckMember(const TSpriteMemberInfo& aMemInfo);
-	void DrawMemberL(TInt aMember);
-	void DrawMemberL();
-	};
-
-/**
-Used by CAnimTimer below
-*/
-class MAnimTimerObserver
-    {
-public:
-    virtual void DisplayNextFrameL()=0;
-    };
-
-/**
-This class is used by CTestFreeTimerAnim to determine when to swap the current frame with the next one.
-*/
-class CAnimTimer : public CTimer
-    {
-public:
-    ~CAnimTimer();
-    static CAnimTimer* NewL(MAnimTimerObserver& aObserver);
-    void RunL();
-private:
-    CAnimTimer(MAnimTimerObserver& aObserver);
-    void ConstructL();
-private:
-    MAnimTimerObserver& iAnim;
-    };
-
-class CTestFreeTimerAnim : public CFreeTimerWindowAnim, public MAnimTimerObserver
-	{
-public:
-    //from CBase 
-    ~CTestFreeTimerAnim();
-	//from CAnim
-	void Animate(TDateTime *aDateTime);
-	void Command(TInt aOpcode, TAny *aArgs);
-	TInt CommandReplyL(TInt aOpcode, TAny *aArgs);
-	//from CWindowAnim 
-    void ConstructL(TAny *aArgs, TBool aHasFocus);
-    void Redraw();
-    void FocusChanged(TBool aState);
-	//from MEventHandler
-	TBool OfferRawEvent(const TRawEvent &aRawEvent);
-private:
-    void DisplayNextFrameL();
-private:
-    CAnimTimer* iTimer;
-    TInt iFrameTime;
-    TRgb iColour;
-    TRect iRect;    
-	};
-
-class CEventTestAnimBase : public CWindowAnim
-	{
-	enum {EEventBufferSize=40};
-public:
-	virtual ~CEventTestAnimBase();
-	//Pure virtual functions from CAnim
-	virtual void Animate(TDateTime *aDateTime);
-	virtual void Command(TInt aOpcode, TAny *aArgs);
-	virtual TInt CommandReplyL(TInt aOpcode, TAny *aArgs);
-	//Pure virtual functions from CWindowAnim
-	virtual void ConstructL(TAny *aArgs, TBool aHasFocus);
-	virtual void Redraw();
-	virtual void FocusChanged(TBool aState);
-	//Pure virtual function from MEventHandler
-	virtual TBool OfferRawEvent(const TRawEvent &aRawEvent);
-protected:
-	void Fail();
-	TBool IsIgnorableEvent(const TRawEvent& aRawEvent) const;
-	TBool GetNextExpectedEvent(TAnimRawEvent& aRawEvent);
-	TBool CompareEvents(const TRawEvent& aExpectedEvent, const TRawEvent& aActualEvent) const;
-	TBool HandleRecursiveEvent(const TRawEvent& aRawEvent);
-
-	TInt Error() const;
-	TInt EventCount() const;
-	void ResetEventCount();
-	TInt TotalExpectedEvents() const;
-	TInt AddEvent(const TAnimRawEvent* event);
-private:
-	virtual TInt AddExpectedEvent(const TAnimRawEvent* event)=0;
-private:
-	CCirBuf<TAnimRawEvent> iExpectedEvents;
-	TInt iError;
-	TInt iEventCount;
-	};
-
-class CEventTestAnim : public CEventTestAnimBase
-	{
-public:
-	~CEventTestAnim();
-	//Pure virtual functions from CWindowAnim overridden in CEventTestAnimBase
-	void ConstructL(TAny* aArgs,TBool aHasFocus);
-	//Pure virtual functions from CAnim overridden in CEventTestAnimBase
-	TInt CommandReplyL(TInt aOpcode,TAny* aArgs);
-	void Command(TInt aOpcode,TAny* aArgs);
-private:
-	TInt UnloadDeviceDriver();
-	//Pure virtual function from CEventTestAnimBase
-	TInt AddExpectedEvent(const TAnimRawEvent* event);
-private:
-	TBool iDevDriverLoaded;
-	REventDD iLdd;
-	};
-
-class CEventPostingAnim : public CEventTestAnimBase
-	{
-public:
-	~CEventPostingAnim();
-	//Virtual functions from CEventTestAnimBase
-	virtual void ConstructL(TAny *aArgs, TBool aHasFocus);
-	//Virtual function from MEventHandler
-	virtual TBool OfferRawEvent(const TRawEvent &aRawEvent);
-private:
-	//Pure virtual function from CEventTestAnimBase
-	virtual TInt AddExpectedEvent(const TAnimRawEvent* event);
-	};
-
-class CRemovableAnim : public CEventTestAnimBase
-	{
-public:
-	~CRemovableAnim();
-	//Virtual functions from CEventTestAnimBase
-	virtual TInt CommandReplyL(TInt aOpcode, TAny *aArgs);
-	virtual TBool OfferRawEvent(const TRawEvent &aRawEvent);
-private:
-	//Pure virtual function from CEventTestAnimBase
-	virtual TInt AddExpectedEvent(const TAnimRawEvent* event);
-private:
-	TInt iLifetime;
-	};
-
-class CTimerTestAnim : public CWindowAnim
-	{
-public:
-	~CTimerTestAnim();
-	//Pure virtual functions from CAnim
-	virtual void Animate(TDateTime *aDateTime);
-	virtual void Command(TInt aOpcode, TAny *aArgs);
-	virtual TInt CommandReplyL(TInt aOpcode, TAny *aArgs);
-	//Pure virtual functions from CWindowAnim
-	virtual void ConstructL(TAny *aArgs, TBool aHasFocus);
-	virtual void Redraw();
-	virtual void FocusChanged(TBool aState);
-	//Pure virtual function from MEventHandler
-	virtual TBool OfferRawEvent(const TRawEvent &aRawEvent);
-private:
-	TInt iTimerCount;
-	TBool iExpectingTicks;
-	TBool iFail;
-	};
-
-class CWinFunctionTestAnim : public CWindowAnim
-	{
-	//enum {EEventBufferSize=40};
-public:
-	~CWinFunctionTestAnim();
-	//Pure virtual functions from CAnim
-	virtual void Animate(TDateTime *aDateTime);
-	virtual void Command(TInt aOpcode, TAny *aArgs);
-	virtual TInt CommandReplyL(TInt aOpcode, TAny *aArgs);
-	//Pure virtual functions from CWindowAnim
-	virtual void ConstructL(TAny *aArgs, TBool aHasFocus);
-	virtual void Redraw();
-	virtual void FocusChanged(TBool aState);
-	//Pure virtual function from MEventHandler
-	virtual TBool OfferRawEvent(const TRawEvent &aRawEvent);
-private:
-	MAnimGeneralFunctionsWindowExtension* iWinFunctions;
-	};
-
-class CNotificationTestAnim : public CWindowAnim
-	{
-public:
-	CNotificationTestAnim();
-	~CNotificationTestAnim();
-	//Pure virtual functions from CAnim
-	virtual void HandleNotification(const TWsEvent& aEvent);
-	virtual void Animate(TDateTime *aDateTime);
-	virtual void Command(TInt aOpcode, TAny *aArgs);
-	virtual TInt CommandReplyL(TInt aOpcode, TAny *aArgs);
-	//Pure virtual functions from CWindowAnim
-	virtual void ConstructL(TAny *aArgs, TBool aHasFocus);
-	virtual void Redraw();
-	virtual void FocusChanged(TBool aState);
-	//Pure virtual function from MEventHandler
-	virtual TBool OfferRawEvent(const TRawEvent &aRawEvent);
-private:
-	TFixedArray<TBool,2> iDSA;
-	TBool iHeartbeatState;
-	TBool iScreenDeviceChanged;
-	TTime iLastAnimTime;
-	};
-
-class CTransAnim : public CWindowAnim
-//
-// Test drawing/redrawing in Transparent window.
-//
-	{
-public:
-	//Implementaion for pure virtual functions from CAnim
-	void ConstructL(TAny* aArgs, TBool aHasFocus);
-	void Animate(TDateTime* aDateTime);
-	void Redraw();
-	void Command(TInt aOpcode, TAny* aArgs);
-	TInt CommandReplyL(TInt aOpcode, TAny* aArgs);
-	void FocusChanged(TBool aState);
-	TBool OfferRawEvent(const TRawEvent &aRawEvent);
-private:
-	CFbsFont* iFont;
-	TRect iRect;
-	TInt iMode;
-	TInt iDraw;
-	TRgb iColor;
-	TInt iCount;
-	};
-
-class CTestHandlerAnim : public CWindowAnim
-	{
-	public:
-		~CTestHandlerAnim();
-		void ConstructL(TAny* aArgs, TBool aHasFocus);
-		void Redraw();
-		void FocusChanged(TBool aState);
-		TInt CommandReplyL(TInt aOpcode, TAny* aArgs);
-		void Command(TInt aOpcode, TAny* aArgs);
-		void Animate(TDateTime* aDateTime);
-		TBool OfferRawEvent(const TRawEvent &aRawEvent);
-	private:
-	};
-
-class CCoverageAnim : public CWindowAnim
-/**
- This class adds functional coverage to CWsAnimGc. 
- The actual work is handled by the 'Draw' method which calls
- each method in turn.
- Mostly copied from CAutoAnimScrBack and CAutoAnim3.
- @SYMTestCaseID 
- @SYMPREQ 1841 Add Coverage tests.
- @SYMTestCaseDesc  Functional coverage.
- @SYMTestActions Run functional coverage test on CWsAnimGc.
- */
-	{
-public:
-	~CCoverageAnim();
-	virtual void ConstructL(TAny *aArgs, TBool aHasFocus);
-	virtual void Animate(TDateTime *aDateTime);
-	virtual void Redraw();
-	virtual void Command(TInt aOpcode, TAny *aArgs);
-	virtual TInt CommandReplyL(TInt aOpcode, TAny *aArgs);
-	virtual void FocusChanged(TBool aState);
-	void Draw();
-	//Pure virtual function from MEventHandler
-	virtual TBool OfferRawEvent(const TRawEvent &aRawEvent);
-private:
-	TRect iRect; /** rectangle used for all draw ops that require one */
-	CFbsFont* iFont;
-	};
-
-class CMultiPointerAnim : public CWindowAnim
-	{
-	enum {EEventBufferSize=40};
-public:
-	virtual ~CMultiPointerAnim();
-	//Pure virtual functions from CAnim
-	virtual void Animate(TDateTime *aDateTime);
-	virtual void Command(TInt aOpcode, TAny *aArgs);
-	virtual TInt CommandReplyL(TInt aOpcode, TAny *aArgs);
-	//Pure virtual functions from CWindowAnim
-	virtual void ConstructL(TAny *aArgs, TBool aHasFocus);
-	virtual void Redraw();
-	virtual void FocusChanged(TBool aState);
-	//Pure virtual function from MEventHandler
-	virtual TBool OfferRawEvent(const TRawEvent &aRawEvent);
-protected:
-	TInt AddEvent(const TAnimRawEvent* aEvent);
-	TBool CompareEvents(const TRawEvent& aExpectedEvent, const TRawEvent& aActualEvent);
-private:
-	CCirBuf<TAnimRawEvent> iExpectedEvents;
-	TBuf<255> iErrorDes;
-	TInt iEventCount;
-	TInt iError;
-	};
-
-class CTestAnimDll : public CAnimDll
-	{
-public:
-	CAnim *CreateInstanceL(TInt aType);
-private:
-	};
-
-/*#if defined(__WINS__)
-#pragma data_seg(".E32_UID")
-__WINS_UID(0, KWservAnimDllUidValue, 0)
-#pragma data_seg()
-#endif*/
-
-EXPORT_C CAnimDll *CreateCAnimDllL()
-	{
-	return(new(ELeave) CTestAnimDll());
-	}
-
-
-// Panic Tests //
-void CPanicAnim::ConstructL(TAny *, TBool )
-	{
-	iWindowFunctions->SetRect(TRect(0,0,1,1));
-	iFunctions->SetSync(MAnimGeneralFunctions::ESyncSecond);
-	if (iFunctions->Sync()!=MAnimGeneralFunctions::ESyncSecond)
-		User::Leave(KErrGeneral);
-// Check the anim time is not ahead of and not more than 2 secs behind the system time
-	TTime now;
-	now.UniversalTime();
-	TDateTime dt=now.DateTime();
-	TDateTime adt=iFunctions->SystemTime();
-	if (adt.Day()!=dt.Day())
-		User::Leave(KErrGeneral);
-
-	iFunctions->SetSync(MAnimGeneralFunctions::ESyncNone);
-	if (iFunctions->Sync()!=MAnimGeneralFunctions::ESyncNone)
-		User::Leave(KErrGeneral);
-	}
-
-CPanicAnim::~CPanicAnim()
-	{
-	delete iActivePanicIdle;
-	}
-
-void CPanicAnim::Animate(TDateTime *aDateTime)
-	{
-	switch(iSyncState)
-		{
-		case ESyncStateNull:
-			break;
-		case ESyncStateStarting:
-			iTime=iFunctions->SystemTime();
-			iSyncState=ESyncStateCounting;
-			iSyncCount=0;
-			break;
-		case ESyncStateCounting:
-			if (aDateTime)
-				{
-				TTimeIntervalSeconds interval;
-				TTime(*aDateTime).SecondsFrom(iTime, interval);
-				iSyncCount=interval.Int();
-				}
-			else
-				iSyncCount++;
-			if (iSyncCount==ESyncCount)
-				{
-				TTimeIntervalMicroSeconds minInterval(0);
-				TTimeIntervalMicroSeconds maxInterval(0);
-				iSyncState=ESyncStateNull;
-				switch(iSyncMode)
-					{
-					case MAnimGeneralFunctions::ESyncSecond:
-						minInterval=iSyncCount*1000000-100000;
-						maxInterval=iSyncCount*1000000+100000;
-						break;
-					default:;
-					}
-				TTime time(iFunctions->SystemTime());
-				TTimeIntervalMicroSeconds interval=time.MicroSecondsFrom(iTime);
-				TInt ret=KErrNone;
-				if (interval<minInterval || interval>maxInterval)
-					ret=KErrGeneral;
-				iFunctions->Client().RequestComplete(iStatusPtr,ret);
-				}
-			break;
-		case ESyncLeave:
-			User::Leave(KErrGeneral);	// Test: Not allowed to leave, will cause a panic
-			break;
-		case ESyncStateTimeChange1:
-			if (!aDateTime)
-				{
-				iFunctions->Client().RequestComplete(iStatusPtr,KErrNone);
-				iSyncState=ESyncStateTimeChange2;
-				}
-			break;
-		case ESyncStateTimeChange2:
-			if (!aDateTime)
-				{
-				iSyncState=ESyncStateTimeChange3;
-				break;
-				}
-		case ESyncStateTimeChange3:
-			iFunctions->Client().RequestComplete(iStatusPtr2,aDateTime ? KErrNone : KErrGeneral);
-			iSyncState=ESyncStateNull;
-			break;
-		}
-	}
-
-void CPanicAnim::Redraw()
-	{
-	if (iLeaveInRedraw)
-		User::Leave(KErrGeneral);	//Test: Not allowed to leave, will cause a panic
-	}
-
-void CPanicAnim::Command(TInt aOpcode, TAny *)
-	{
-	switch(aOpcode)
-		{
-		case EADllPanicCallPanic:
-			iFunctions->Panic();
-			break;
-		case EADllPanicSetInterval:
-			iFunctions->SetSync(MAnimGeneralFunctions::ESyncSecond);
-			iFunctions->SetInterval(1);
-			break;
-		case EADllPanicSetNextInterval:
-			iFunctions->SetSync(MAnimGeneralFunctions::ESyncMinute);
-			iFunctions->SetNextInterval(1);
-			break;
-		case EADllPanicDoubleActivateGC:
-			iWindowFunctions->ActivateGc();
-			iWindowFunctions->ActivateGc();
-			break;
-		case EADllPanicDrawRectWithNoGc:
-			iGc->DrawRect(TRect(0,0,10,10));
-			break;
-		case EADllPanicDrawTextWithNoFont:
-			iWindowFunctions->ActivateGc();
-			iGc->DrawText(_L("Panic"),TPoint(20,20));
-			break;
-		case EADllPanicLeaveInAnimate:
-			iFunctions->SetSync(MAnimGeneralFunctions::ESyncFlash);
-			iSyncState=ESyncLeave;
-			break;
-		case EADllPanicLeaveInRedraw:
-			iLeaveInRedraw=ETrue;
-			iWindowFunctions->Invalidate(TRect(0,0,10,10));
-			break;
-		case EADllPanicLeave:
-			//tests a leaving function in a non-leaving function and should not be moved to CommandReplyL as it leaves
-			User::Leave(KErrGeneral);	//LeaveScan: intentional test
-			break;
-		case EADllPanicSetVisWithGcActive:
-			iWindowFunctions->ActivateGc();
-			iWindowFunctions->SetVisible(EFalse);
-			iWindowFunctions->SetVisible(ETrue);
-			break;
-		case EADllPanicLeaveInActiveCallback:
-			iActivePanicIdle=CIdle::NewL(EPriorityHigh);
-			iActivePanicIdle->Start(TCallBack(CPanicAnim::LeaveInActiveCallback,this));
-			break;
-		case EADllPanicSetClippingRectWithNoGc:
-			{
-			// currently this test fails because when deactivated iWin is also NULL and is deferenced in function
-			TRect rect(20,20,20,20);	
-			iGc->SetClippingRect(rect);
-			}
-			break;
-		case EADllPanicCancelClippingRegionWithNoGc:
-			// currently this test fails because when deactivated iWin is NULL and function leaves
-			iGc->CancelClippingRegion();
-			break;
-		case EADllPanicCancelClippingRectWithNoGc:
-			// currently this test fails because when deactivated iWin is also NULL and is deferenced in function
-			iGc->CancelClippingRect();
-			break;
-		case EADllPanicSetDrawModeWithNoGc:
-			iGc->SetDrawMode(CGraphicsContext::EDrawModeAND);
-			break;
-		case EADllPanicUseFontWithNoGc:
-			{
-			// currently this test fails because does not check for NULL font
-			CFbsFont* font = NULL;
-			iGc->UseFont(font);
-			}
-			break;
-		case EADllPanicDiscardFontWithNoGc:
-			iGc->DiscardFont();
-			break;
-		case EADllPanicSetUnderlineStyleWithNoGc:
-			iGc->SetUnderlineStyle(EUnderlineOff);
-			break;
-		case EADllPanicSetStrikeThoughStyleWithNoGc:
-			iGc->SetStrikethroughStyle(EStrikethroughOff);
-			break;
-		case EADllPanicSetWordJustificationWithNoGc:
-			iGc->SetWordJustification(0,0);
-			break;
-		case EADllPanicSetCharJustificationWithNoGc:
-			iGc->SetCharJustification(0,0);
-			break;
-		case EADllPanicSetPenColorWithNoGc:
-			{
-			TRgb rgbs;
-			iGc->SetPenColor(rgbs);
-			}
-			break;
-		case EADllPanicSetPenStyleWithNoGc:
-			iGc->SetPenStyle(CGraphicsContext::ESolidPen);
-			break;
-		case EADllPanicSetPenSizeWithNoGc:
-			{
-			const TSize size;
-			iGc->SetPenSize(size);
-			}
-			break;
-		case EADllPanicSetBrushColorWithNoGc:
-			{
-			TRgb rgbs;
-			iGc->SetBrushColor(rgbs);
-			}
-			break;
-		case EADllPanicSetBrushStyleWithNoGc:
-			iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-			break;
-		case EADllPanicSetBrushOriginWithNoGc:
-			{
-			TPoint point;
-			iGc->SetBrushOrigin(point);
-			}
-			break;
-		case EADllPanicUseBrushPatterWithNoGc:
-			{
-			CFbsBitmap* bitmap = new(ELeave) CFbsBitmap();
-			CleanupStack::PushL(bitmap);
-			User::LeaveIfError(bitmap->Create(TSize(16,16),EGray4));
-			iGc->UseBrushPattern(bitmap);
-			CleanupStack::PopAndDestroy(bitmap);
-			}
-			break;
-		case EADllPanicDiscardBrushPatternWithNoGc:
-			iGc->DiscardBrushPattern();
-			break;
-		case EADllPanicSetFadedWithNoGc:
-			iGc->SetFaded(EFalse);
-			break;
-		case EADllPanicSetFadingParametersWithNoGc:
-			iGc->SetFadingParameters(1,1);
-			break;
-		case EADllPanicDrawArcWithNoGc:
-			{
-			TRect rect;
-			iGc->DrawArc(rect,
-				TPoint(rect.Center().iX, rect.iTl.iY),
-				TPoint(rect.iBr.iX, rect.Center().iY));
-			}
-			break;
-		case EADllPanicDrawPieWithNoGc:
-			{
-			TRect rect;				
-			iGc->DrawPie(rect, TPoint(rect.Center().iX, rect.iTl.iY), TPoint(rect.iBr.iX, rect.Center().iY));
-			}
-			break;
-		case EADllPanicDrawLineWithNoGc:
-			{	
-			const TPoint point1;
-			const TPoint point2;
-			iGc->DrawLine(point1, point2);
-			}
-			break;
-		case EADllPanicDrawLineToWithNoGc:
-			{
-			const TPoint point;
-			iGc->DrawLineTo(point);
-			}
-			break;
-		case EADllPanicDrawLineByWithNoGc:
-			{
-			const TPoint point;
-			iGc->DrawLineBy(point);
-			}
-			break;
-		case EADllPanicDrawEllipseWithNoGc:
-			{
-			TRect rect(20,20,20,20);
-			iGc->DrawEllipse(rect);
-			}
-			break;
-		case EADllPanicDrawRoundedRecWithNoGc:
-			{
-			TRect rect;
-			iGc->DrawRoundRect(rect, TSize(rect.Width()/8, rect.Height()/8));
-			}
-			break;
-		case EADllPanicClearWithRectWithNoGc:
-			{
-			TRect rect(20,20,20,20);
-			iGc->Clear(rect);
-			}
-			break;
-		case EADllPanicClearWithNoGc:
-			iGc->Clear();
-			break;
-		case EADllPanicBitBltWithNoGc:
-			{
-			CFbsBitmap* bitmap = new(ELeave) CFbsBitmap();
-			CleanupStack::PushL(bitmap);
-			User::LeaveIfError(bitmap->Create(TSize(16,16),EGray4));
-			iGc->BitBlt(TPoint(0, 0), bitmap);
-			CleanupStack::PopAndDestroy(bitmap);
-			}
-			break;
-		case EADllPanicBitBltWithRectWithNoGc:
-			{
-			CFbsBitmap* bitmap = new(ELeave) CFbsBitmap();
-			TRect rect;
-			CleanupStack::PushL(bitmap);
-			User::LeaveIfError(bitmap->Create(TSize(16,16),EGray4));
-			iGc->BitBlt(TPoint(0, 0), bitmap, rect);
-			CleanupStack::PopAndDestroy(bitmap);
-			}
-			break;
-		case EADllPanicBitBltMaskedWithNoGc:
-			{
-			CFbsBitmap* bitmap = new(ELeave) CFbsBitmap();
-			TRect rect;
-			CleanupStack::PushL(bitmap);
-			User::LeaveIfError(bitmap->Create(TSize(16,16),EGray4));
-			iGc->BitBltMasked(TPoint(0, 0), bitmap, rect, bitmap, EFalse);
-			CleanupStack::PopAndDestroy(bitmap);
-			}
-			break;
-		case EADllPanicDrawBitmapMaskedFbsBitmapWithNoGc:
-			{
-			CFbsBitmap* bitmap = new(ELeave) CFbsBitmap();
-			TRect rect;
-			CleanupStack::PushL(bitmap);
-			User::LeaveIfError(bitmap->Create(TSize(16,16),EGray4));
-			iGc->DrawBitmapMasked(rect, bitmap, rect, bitmap, ETrue);
-			CleanupStack::PopAndDestroy(bitmap);
-			}
-			break;
-		case EADllPanicDrawBitmapMaskedWsBitmapWithNoGc:
-			{
-			CWsBitmap* bitmap = NULL;
-			TRect rect;
-			iGc->DrawBitmapMasked(rect, bitmap, rect, bitmap, ETrue);
-			}
-			break;
-		case EADllPanicDrawBitmapPointWithNoGc:
-			{
-			CWsBitmap* bitmap = NULL;
-			TRect rect;
-			iGc->DrawBitmap(rect.iTl, bitmap);
-			}
-			break;
-		case EADllPanicDrawBitmapWithNoGc:
-			{
-			CWsBitmap* bitmap = NULL;
-			TRect rect;
-			iGc->DrawBitmap(rect, bitmap);
-			}
-			break;
-		case EADllPanicDrawBitmapRectWithNoGc:
-			{
-			CWsBitmap* bitmap = NULL;
-			TRect rect;
-			iGc->DrawBitmap(rect, bitmap, TRect(0, 0, 16, 16));
-			}
-			break;
-		case EADllPanicDrawPolyLinePointsWithNoGc:
-			{
-			TRect rect;
-			CArrayFixFlat<TPoint>* polyPoints = new(ELeave) CArrayFixFlat<TPoint>(3); //CArrayFixFlat
-			CleanupStack::PushL(polyPoints);
-			polyPoints->AppendL(rect.iTl);
-			polyPoints->AppendL(rect.Center());
-			polyPoints->AppendL(TPoint(rect.iBr.iX, rect.iTl.iY));
-			iGc->DrawPolyLine(&polyPoints->At(0), 3);
-			CleanupStack::PopAndDestroy(polyPoints);
-			}
-			break;
-		case EADllPanicDrawPolyLineArrayWithNoGc:
-			{
-			TRect rect;
-			CArrayFixFlat<TPoint>* polyPoints = new(ELeave) CArrayFixFlat<TPoint>(3); //CArrayFixFlat
-			CleanupStack::PushL(polyPoints);
-			polyPoints->AppendL(rect.iTl);
-			polyPoints->AppendL(rect.Center());
-			polyPoints->AppendL(TPoint(rect.iBr.iX, rect.iTl.iY));
-			iGc->DrawPolyLine(polyPoints);
-			CleanupStack::PopAndDestroy(polyPoints);
-			}
-			break;
-		case EADllPanicMoveToWithNoGc:
-			{
-			TPoint point;
-			iGc->MoveTo(point);
-			}
-			break;
-		case EADllPanicMoveByWithNoGc:
-			{
-			TPoint point;
-			iGc->MoveBy(point);
-			}
-			break;
-		case EADllPanicPlotWithNoGc:
-			{
-			TPoint point;
-			iGc->Plot(point);
-			}
-			break;
-		case EADllPanicSetOriginWithNoGc:
-			{
-			TPoint point;
-			iGc->SetOrigin(point);
-			}
-			break;
-		case EADllPanicCopyRectWithNoGc:
-			{
-			TPoint point;
-			TRect rect;
-			iGc->CopyRect(point, rect);
-			}
-			break;
-		case EADllPanicResetWithNoGc:
-			iGc->Reset();
-			break;
-		case EADllPanicMapColorsWithNoGc:
-			{
-			TRgb rgbs[2];
-			TRect rect;
-			iGc->MapColors(rect, rgbs, 1, ETrue);
-			}
-			break;
-		case EADllPanicDrawTextWithRectWithNoFont:
-			iWindowFunctions->ActivateGc();
-			iGc->DrawText(_L("Panic"),TRect(20,20,20,20),0);
-			break;
-		case EADllPanicDrawTextVerticalWithNoFont:
-			iWindowFunctions->ActivateGc();
-			iGc->DrawTextVertical(_L("Panic"),TPoint(20,20), EFalse);
-			break;
-		case EADllPanicDrawTextVerticalWithRectWithNoFont:
-			iWindowFunctions->ActivateGc();
-			iGc->DrawTextVertical(_L("Panic"),TRect(20,20,20,20), 0, EFalse);
-			break;
-		case EADllPanicInvalidFocusScreenTooBig:
-			(static_cast<MAnimGeneralFunctionsWindowExtension*>(iFunctions->ExtendedInterface(MAnimGeneralFunctions::EWindowExtensionInterface)))->SetFocusScreen(3000);
-			break;
-		case EADllPanicInvalidFocusScreenNegative:
-			(static_cast<MAnimGeneralFunctionsWindowExtension*>(iFunctions->ExtendedInterface(MAnimGeneralFunctions::EWindowExtensionInterface)))->SetFocusScreen(-1);
-			break;
-		default:
-			iFunctions->Panic();
-		}
-	}
-
-void CPanicAnim::DoLeaveInActiveCallback()
-	{
-	iWindowFunctions->ActivateGc();
-	User::Leave(KErrUnknown);
-	}
-
-TInt CPanicAnim::LeaveInActiveCallback(TAny *aThis)
-	{
-	CPanicAnim* panicAnim=(CPanicAnim*)aThis;
-	panicAnim->DoLeaveInActiveCallback();
-	return(KErrNone);
-	}
-
-void CPanicAnim::StartSyncTest(MAnimGeneralFunctions::TAnimSync aSync)
-	{
-	iFunctions->SetSync(aSync);
-	iSyncMode=aSync;
-	iSyncState=ESyncStateStarting;
-	}
-
-void CPanicAnim::StartTimeChangeTest()
-	{
-	iFunctions->SetSync(MAnimGeneralFunctions::ESyncSecond);
-	iSyncMode=MAnimGeneralFunctions::ESyncSecond;
-	iSyncState=ESyncStateTimeChange1;
-	}
-
-TInt CPanicAnim::CommandReplyL(TInt aOpcode,TAny* aParams)
-	{
-	TAnimArgUnion pData;
-	pData.any=aParams;
-	switch(aOpcode)
-		{
-		case EADllPanicBadFont:
-			iFunctions->DuplicateFontL(123);
-			break;
-		case EADllPanicBadBitmap:
-			iFunctions->DuplicateBitmapL(123);
-			break;
-		case EADllPanicCallPanic:
-			iFunctions->Panic();
-			break;
-		case EADllReadRemoteDescriptor:
-			{
-			TInt ret=0;
-			const RMessagePtr2& message=*iFunctions->Message();
-			TInt bufLength = message.GetDesLength(KIpcSlot);
-			TUint16* heapCell=static_cast<TUint16*>(User::AllocL(bufLength*2));
-			TPtr buf(heapCell,bufLength*2,bufLength*2);
-			const TInt theError=message.Read(KIpcSlot,buf);
-			if(theError == KErrNone)
-				{
-				for (TInt index=0;index<bufLength;index++)
-					{
-					ret+=buf[index];
-					}
-				}
-			User::Free(heapCell);
-			return(ret);
-			}
-		case EADllTestWindowSize:
-			return(*pData.Size==iWindowFunctions->WindowSize());
-		case EADllSyncTests:
-			iStatusPtr=pData.SyncTests->status;
-			StartSyncTest(pData.SyncTests->syncMode);
-			break;
-		case EADllTimeChangedTest:
-			iStatusPtr=pData.TimeChangeTest->status;
-			iStatusPtr2=pData.TimeChangeTest->status2;
-			StartTimeChangeTest();
-			break;
-		case EADllTestSetVisible:
-			if (iWindowFunctions->IsHidden())
-				goto setVisFailed;
-			iWindowFunctions->SetVisible(EFalse);
-			if (!iWindowFunctions->IsHidden())
-				goto setVisFailed;
-			iWindowFunctions->SetVisible(ETrue);
-			if (iWindowFunctions->IsHidden())
-setVisFailed:	return(EFalse);
-			return(ETrue);
-		case EADllPanicSetVisWithGcActiveReply:
-			iWindowFunctions->ActivateGc();
-			iWindowFunctions->SetVisible(EFalse);
-			iWindowFunctions->SetVisible(ETrue);
-			break;
-		case EADllPanicSetClippingRegionWithNoGc:
-			{
-			// currently this test fails because when deactivated iWin is also NULL and is deferenced in function
-			RRegion region;
-			TBool err = iGc->SetClippingRegion(region);
-			}
-			break;
-		case EADllPanicDrawPolygonPointsWithNoGc:
-			{	
-			TRect rect(20,20,20,20);
-			CArrayFixFlat<TPoint>* polyPoints = new(ELeave) CArrayFixFlat<TPoint>(3); //CArrayFixFlat
-			CleanupStack::PushL(polyPoints);
-			polyPoints->AppendL(rect.iTl);
-			polyPoints->AppendL(rect.Center());
-			polyPoints->AppendL(TPoint(rect.iBr.iX, rect.iTl.iY));
-			iGc->DrawPolygon(polyPoints, CGraphicsContext::EWinding);
-			CleanupStack::PopAndDestroy(polyPoints);
-			}
-			break;
-		case EADllPanicDrawPolygonArrayWithNoGc:
-			{	
-			TRect rect(20,20,20,20);
-			CArrayFixFlat<TPoint>* polyPoints = new(ELeave) CArrayFixFlat<TPoint>(3); //CArrayFixFlat
-			CleanupStack::PushL(polyPoints);
-			polyPoints->AppendL(rect.iTl);
-			polyPoints->AppendL(rect.Center());
-			polyPoints->AppendL(TPoint(rect.iBr.iX, rect.iTl.iY));
-			iGc->DrawPolygon(&polyPoints->At(0), 3, CGraphicsContext::EAlternate);
-			CleanupStack::PopAndDestroy(polyPoints);
-			}
-			break;
-		case EADllPanicAlphaBlendingBitmapsFbsBitmapWithNoGc:
-			{
-			TRect rect(20,20,20,20);
-			CFbsBitmap* bitmap = new(ELeave) CFbsBitmap();
-			CleanupStack::PushL(bitmap);
-			User::LeaveIfError(bitmap->Create(TSize(16,16),EGray4));
-			iGc->AlphaBlendBitmaps(TPoint(0, 0), bitmap, rect, bitmap, TPoint(0,0));
-			CleanupStack::PopAndDestroy(bitmap);
-			}
-			break;
-		case EADllPanicDevice:
-			{
-			CGraphicsDevice *device = iGc->Device();
-			}
-			break;
-		default:
-			iFunctions->Panic();
-		}
-	return(KErrNone);
-	}
-
-void CPanicAnim::FocusChanged(TBool )
-	{
-	}
-
-TBool CPanicAnim::OfferRawEvent(const TRawEvent &/*aRawEvent*/)
-	{
-	return EFalse;
-	}
-
-
-// CPanicAnim2 simply panics in the construct //
-void CPanicAnim2::ConstructL(TAny *, TBool )
-	{
-	iFunctions->Panic();
-	}
-
-void CPanicAnim2::Animate(TDateTime *)
-	{}
-
-void CPanicAnim2::Redraw()
-	{}
-
-void CPanicAnim2::Command(TInt , TAny *)
-	{}
-
-TInt CPanicAnim2::CommandReplyL(TInt , TAny *)
-	{return(0);}
-
-void CPanicAnim2::FocusChanged(TBool )
-	{}
-
-TBool CPanicAnim2::OfferRawEvent(const TRawEvent &/*aRawEvent*/)
-	{
-	return EFalse;
-	}
-
-
-// CAutoAnim3 test drawing/redrawing //
-void CAutoAnim3::ConstructL(TAny *aParam, TBool )
-	{
-	iRect=*((TRect *)aParam);
-	iWindowFunctions->SetRect(iRect);
-	iMode=0;
-	iWindowFunctions->Invalidate(iRect);
-	iFunctions->SetSync(MAnimGeneralFunctions::ESyncSecond);
-	}
-
-void CAutoAnim3::Animate(TDateTime *)
-	{
-	iWindowFunctions->ActivateGc();
-	if (iMode==1)
-		{
-		Draw(iRect);
-		if (iRect.Width()>20 && iRect.Height()>20)
-			iRect.Shrink(TSize(20,20));
-		else
-			iRect=iBaseRect;
-		Draw(iRect);
-		}
-	else if (iMode==2)
-		{
-		Draw(iRect);
-		iFunctions->Client().RequestComplete(iStatusPtr,KErrNone);
-		iFunctions->SetSync(MAnimGeneralFunctions::ESyncNone);
-		}
-	else if (iMode==3)
-		{
-		// flip between two sizes
-		if (iRect.iTl.iX == 10)
-			iRect.SetRect(40,40,80,80);
-		else
-			iRect.SetRect(10,10,110,110);
-		Draw(iRect);
-		}
-	}
-
-void CAutoAnim3::Draw(const TRect &aRect)
-	{
-	switch(iMode)
-		{
-		case 0:
-			iGc->SetDrawMode(CGraphicsContext::EDrawModeXOR);
-			iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-			iGc->SetBrushColor(TRgb::Gray256(85));
-			iGc->SetPenColor(TRgb::Gray256(170));
-			iGc->DrawEllipse(aRect);
-			iGc->SetBrushStyle(CGraphicsContext::ENullBrush);
-			break;
-		case 1:	// Shrinking box
-			iGc->SetDrawMode(CGraphicsContext::EDrawModeXOR);
-			iGc->SetPenColor(TRgb::Gray256(255));
-			iGc->DrawRect(aRect);
-			break;
-		case 2:
-		case 3:
-			iGc->SetDrawMode(CGraphicsContext::EDrawModePEN);
-			iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-			iGc->SetBrushColor(TRgb::Gray256(85));
-			iGc->SetPenColor(TRgb::Gray256(170));
-			iGc->DrawEllipse(aRect);
-			iGc->SetBrushStyle(CGraphicsContext::ENullBrush);
-			break;
-		default:
-			break;
-		}
-	}
-
-void CAutoAnim3::Redraw()
-	{
-	Draw(iRect);
-	}
-
-void CAutoAnim3::Command(TInt aOpcode,TAny* aParam)
-	{
-	TAnimArgUnion pData;
-	pData.any=aParam;
-	switch(aOpcode)
-		{
-		case EADllSetRect:
-			iWindowFunctions->ActivateGc();
-			Draw(iRect);
-			iRect=*pData.Rect;
-			iWindowFunctions->SetRect(iRect);
-			Draw(iRect);
-			{		//Do more extensive testing
-			TWindowInfo data;
-			iWindowFunctions->Parameters(data);
-			}
-			break;
-		case EADllStartAnimate:
-			iWindowFunctions->ActivateGc();
-			Draw(iRect);
-			iMode=1;
-			iBaseRect=*pData.Rect;
-			iRect=iBaseRect;
-			iWindowFunctions->SetRect(iRect);
-			iFunctions->SetSync(MAnimGeneralFunctions::ESyncFlash);
-			Draw(iRect);
-			break;
-		case EADllCancelAnimate:
-			iFunctions->SetSync(MAnimGeneralFunctions::ESyncNone);
-			iWindowFunctions->ActivateGc();
-			Draw(iRect);
-			iMode=-1;
-			break;
-		case EADllSetVisible:
-			iWindowFunctions->SetVisible(*pData.Bool);
-			break;
-		case EADllSetShadowDrawMode:
-			iMode=2;
-			break;
-		case EADllDrawTestScreen:
-			DrawTestScreenL(pData.DrawTestScreen);		//Should move to CommandReplyL as it leaves
-			break;
-		case EADllSetMode:
-			iMode = *pData.Int;
-			break;	
-		}
-	}
-
-TInt CAutoAnim3::CommandReplyL(TInt aOpcode, TAny *aParam)
-	{
-	TAnimArgUnion pData;
-	pData.any = aParam;
-	TInt ret=0;
-	switch(aOpcode)
-		{
-		case EADllShadowAnimTest:
-			iFunctions->SetSync(MAnimGeneralFunctions::ESyncFlash);
-			iStatusPtr=((TShadowDrawTest *)aParam)->status;
-			break;
-		case EADllParameterRectValueTest:
-			{
-			TWindowInfo wininf;
-			iWindowFunctions->Parameters(wininf);
-			TRect comp = *(pData.Rect);
-			ret=(comp==wininf.iScreenPos);
-			}
-			break;
-		case EADllDoSetSync:
-			iFunctions->SetSync(static_cast<MAnimGeneralFunctions::TAnimSync>(*pData.Int));
-			break;
-		case EADllSetInterval:					
-			iFunctions->SetInterval(*pData.Int);
-			break;
-		}
-	return(ret);
-	}
-
-void CAutoAnim3::FocusChanged(TBool )
-	{}
-
-//void CAutoAnim3::DrawTestScreen(TDrawTestScreen *aParams)
-//Function now at bottom of file
-
-TBool CAutoAnim3::OfferRawEvent(const TRawEvent &/*aRawEvent*/)
-	{
-	return EFalse;
-	}
-
-
-// CAutoAnimScrBack test drawing/redrawing //
-void CAutoAnimScrBack::ConstructL(TAny *aParam, TBool )
-	{
-	iRect=*((TRect *)aParam);
-	iWindowFunctions->SetRect(iRect);
-	iMode=1;
-	iFunctions->SetSync(MAnimGeneralFunctions::ESyncFlash);
-	}
-
-void CAutoAnimScrBack::Animate(TDateTime *)
-	{
-	iWindowFunctions->ActivateGc();
-	Draw();
-	iFunctions->SetSync(MAnimGeneralFunctions::ESyncNone);
-	}
-
-void CAutoAnimScrBack::Draw()
-	{
-	iGc->SetDrawMode(CGraphicsContext::EDrawModePEN);
-	if (iMode==2)
-		iGc->SetPenSize(TSize(3,3));
-	iGc->SetPenColor(TRgb::Gray4(iMode==1 ? 2 : 3));
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	iGc->SetBrushColor(TRgb::Gray4(iMode==1 ? 1 : 0));
-	iGc->DrawRect(iRect);
-	}
-
-void CAutoAnimScrBack::Redraw()
-	{
-	Draw();
-	}
-
-void CAutoAnimScrBack::Command(TInt aOpcode,TAny* aParam)
-	{
-	TAnimArgUnion pData;
-	pData.any=aParam;
-	switch(aOpcode)
-		{
-		case EADllDrawOtherRect:
-			{
-			TRect oldRect(iRect);
-			if (iMode==2)
-				oldRect.Grow(1,1);	// To allow for 3x3 pen size
-			iMode=2;
-			iRect=*pData.Rect;
-			TRect fullRect(iRect);
-			fullRect.Grow(1,1);	// To allow for 3x3 pen size
-			iWindowFunctions->Invalidate(oldRect);
-			iWindowFunctions->SetRect(fullRect);
-			iWindowFunctions->Invalidate(fullRect);
-			}
-//			iFunctions->ActivateGc();
-//			Draw();
-			break;
-		}
-	}
-
-TInt CAutoAnimScrBack::CommandReplyL(TInt aOpcode, TAny *)
-	{
-	switch(aOpcode)
-		{
-		case EADllIsHidden:
-			return iWindowFunctions->IsHidden();
-		}
-	return(0);
-	}
-
-void CAutoAnimScrBack::FocusChanged(TBool )
-	{}
-
-TBool CAutoAnimScrBack::OfferRawEvent(const TRawEvent &/*aRawEvent*/)
-	{
-	return EFalse;
-	}
-
-
-// CTestSpriteAnim test sprite access //
-void CTestSpriteAnim::ConstructL(TAny* /*aParam*/)
-	{
-	iSpriteFunctions->SizeChangedL();
-	iSpriteFunctions->Activate(ETrue);
-	}
-
-void CTestSpriteAnim::Animate(TDateTime*)
-	{
-	}
-
-void CTestSpriteAnim::Command(TInt aOpcode,TAny* aParam)
-	{
-	TAnimArgUnion pData;
-	pData.any=aParam;
-	switch (aOpcode)
-		{
-	case EADllSizeChanged:
-		iSpriteFunctions->Activate(EFalse);
-		iSpriteFunctions->SizeChangedL();		//Should move to CommandReplyL as it leaves
-	case EADllActivate:
-		iSpriteFunctions->Activate(ETrue);
-		break;
-	case EADllDeactivate:
-		iSpriteFunctions->Activate(EFalse);
-		break;
-	case EADllSetPos:
-		iSpriteFunctions->SetPosition(*pData.Point);
-		break;
-	case EADllDraw1:
-	case EADllDraw2:
-	case EADllDraw3:
-		DrawMemberL(aOpcode-EADllDraw1);		//Should move to CommandReplyL as it leaves
-		break;
-	case EADllIncDraw:
-		DrawMemberL();		//Should move to CommandReplyL as it leaves
-		break;
-	default:;
-		}
-	}
-
-TInt CTestSpriteAnim::CommandReplyL(TInt aOpcode,TAny* aParam)
-	{
-	TAnimArgUnion pData;
-	pData.any=aParam;
-	switch (aOpcode)
-		{
-	case EADllCheckMember:
-		return CheckMember(*pData.SpriteMemberInfo);
-	default:;
-		}
-	return(KErrNone);
-	}
-
-TBool CTestSpriteAnim::OfferRawEvent(const TRawEvent& /*aRawEvent*/)
-	{
-	return EFalse;
-	}
-
-TBool CTestSpriteAnim::CheckMember(const TSpriteMemberInfo& aMemInfo)
-	{
-	TSpriteMember spriteMember=*iSpriteFunctions->GetSpriteMember(aMemInfo.iMember);
-	if (spriteMember.iBitmap->Handle()!=aMemInfo.iBitmapHandle)
-		return EFalse;
-	if (aMemInfo.iMaskBitmapHandle==0)
-		{
-		if (spriteMember.iMaskBitmap!=NULL)
-			return EFalse;
-		}
-	else
-		{
-		if (spriteMember.iMaskBitmap->Handle()!=aMemInfo.iMaskBitmapHandle)
-			return EFalse;
-		}
-	if (spriteMember.iInvertMask!=aMemInfo.iInvertMask)
-		return EFalse;
-	if (spriteMember.iDrawMode!=aMemInfo.iDrawMode)
-		return EFalse;
-	if (spriteMember.iOffset!=aMemInfo.iOffset)
-		return EFalse;
-	if (spriteMember.iInterval!=aMemInfo.iInterval)
-		return EFalse;
-	return ETrue;
-	}
-
-void CTestSpriteAnim::DrawMemberL(TInt aMember)
-	{
-	CFbsBitmap *bitmap=iSpriteFunctions->GetSpriteMember(aMember)->iBitmap;
-	CFbsBitmapDevice *device=CFbsBitmapDevice::NewL(bitmap);
-	CleanupStack::PushL(device);
-	CFbsBitGc *gc;
-	User::LeaveIfError(device->CreateContext(gc));
-	CleanupStack::PushL(gc);
-	//gc->SetBrushColor(TRgb::Gray4((aMember+1)%3));
-	gc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	gc->SetPenSize(TSize());
-	TSize size=bitmap->SizeInPixels();
-	size.SetSize(size.iWidth/2,size.iHeight/2);
-	TPoint point=size.AsPoint();
-	gc->SetBrushColor(TRgb::Gray4(0));
-	//TRect rect=bitmap->SizeInPixels();
-	gc->DrawRect(TRect(TPoint(),size));
-	gc->SetBrushColor(TRgb::Gray4(1));
-	gc->DrawRect(TRect(TPoint(point.iX,0),size));
-	gc->SetBrushColor(TRgb::Gray4(2));
-	gc->DrawRect(TRect(TPoint(0,point.iY),size));
-	gc->SetBrushColor(TRgb::Gray4(3));
-	gc->DrawRect(TRect(point,size));
-	iSpriteFunctions->UpdateMember(aMember,TRect(bitmap->SizeInPixels()),ETrue);
-	CleanupStack::PopAndDestroy(2);
-	}
-
-void CTestSpriteAnim::DrawMemberL()
-	{
-	CFbsBitmap *bitmap=iSpriteFunctions->GetSpriteMember(0)->iBitmap;
-	CFbsBitmapDevice *device=CFbsBitmapDevice::NewL(bitmap);
-	CleanupStack::PushL(device);
-	CFbsBitGc *gc;
-	User::LeaveIfError(device->CreateContext(gc));
-	CleanupStack::PushL(gc);
-	gc->SetPenSize(TSize(3,3));
-	gc->SetPenColor(TRgb::Gray4(1));
-	TPoint corner=bitmap->SizeInPixels().AsPoint();
-	gc->DrawLine(TPoint(),corner);
-	gc->DrawLine(TPoint(0,corner.iY),TPoint(corner.iX,0));
-	iSpriteFunctions->UpdateMember(0,TRect(bitmap->SizeInPixels()),EFalse);
-	CleanupStack::PopAndDestroy(2);
-	}
-
-
-// CTestFreeTimerAnim test drawing off own timer //
-CTestFreeTimerAnim::~CTestFreeTimerAnim()
-    {
-    iTimer->Cancel();
-    delete iTimer;
-    }
-
-void CTestFreeTimerAnim::ConstructL(TAny* /*aParam*/, TBool )
-	{
-    User::LeaveIfNull(iFunctions);
-    User::LeaveIfNull(iWindowFunctions);
-    
-    //Configure free-timer anim (these values should be the default ones)
-    iFunctions->SetSync( MAnimGeneralFunctions::ESyncNone );
-    iFunctions->SetInterval(0);
-    
-    iFrameTime = 100000; //default frametime 0.1s
-    iTimer = CAnimTimer::NewL(*this);
-    iRect = iWindowFunctions->WindowSize();	
-	}
-
-#define MAX(a,b)    (((a)>(b))?(a):(b))
-
-void CTestFreeTimerAnim::Animate(TDateTime*)
-	{
-    TInt max = MAX(iRect.Width(), iRect.Height());
-    if(max <= 0)
-        {
-        iRect = iWindowFunctions->WindowSize();
-        }
-    else
-        {
-        iRect.Shrink(1,1);
-        }
-    
-    //change colour
-    switch(iColour.Value())
-        {
-        case 0x000000:  //black
-        case 0xffffff:  //white
-            iColour = KRgbRed;
-            break;
-        case 0x0000ff:  //red
-            iColour = KRgbGreen;
-            break;
-        case 0x00ff00:  //green
-            iColour = KRgbBlue;
-            break;
-        case 0xff0000:  //blue
-            iColour = KRgbBlack;
-            break;
-        }	
-	}
-
-void CTestFreeTimerAnim::Redraw()
-	{
-    //draw something in the animated colour
-    iGc->SetBrushColor(iColour);
-    iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-    iGc->SetPenColor(KRgbBlack);
-    iGc->DrawRect(iRect);	
-	}
-
-void CTestFreeTimerAnim::Command(TInt aOpcode, TAny* aArgs)
-	{
-    switch(aOpcode)
-        {
-        case EStartAnimation:
-            DisplayNextFrameL();
-            break;
-        case EStopAnimation:
-            iTimer->Cancel();
-            break;
-        case ESetFrameTime:
-            ASSERT(aArgs);        
-            iFrameTime = *reinterpret_cast<TInt*>(aArgs);
-            break;
-        default:
-            ASSERT(0);
-        }
-    }
-
-TInt CTestFreeTimerAnim::CommandReplyL(TInt aOpcode, TAny* aArgs)
-	{    
-    switch(aOpcode)
-        {
-        case EStartAnimation:
-            DisplayNextFrameL();
-            break;
-        case EStopAnimation:
-            iTimer->Cancel();
-            break;
-        case ESetFrameTime:
-            ASSERT(aArgs); 
-            iFrameTime = *reinterpret_cast<TInt*>(aArgs);
-            break;
-        default:
-            ASSERT(0);
-        }
-    return(KErrNone);
-    }
-
-void CTestFreeTimerAnim::FocusChanged(TBool /*aState*/)
-	{
-	}
-
-TBool CTestFreeTimerAnim::OfferRawEvent(const TRawEvent& /*aRawEvent*/)
-	{
-	return EFalse;
-	}
-
-
-void CTestFreeTimerAnim::DisplayNextFrameL()
-    {    
-    //Reschedule timer callback
-    iTimer->Cancel();
-    iTimer->After(iFrameTime);
-    
-    Animate(NULL); //wserv don't animate free-timer animations
-    
-    //Schedule wserv redraw
-    MAnimFreeTimerWindowFunctions* windowFunctions = WindowFunctions();
-    ASSERT(windowFunctions);
-    windowFunctions->ActivateGc();
-    windowFunctions->DeactivateGc();
-    windowFunctions->Update();
-    }
-
-//
-// CAnimTimer class
-//
-
-/**
- Constructs a new bitmap animation timer object,and adds the specified active object to the current active scheduler.
-
-@param aObserver a pointer to MAnimTimerObserver
-*/
-CAnimTimer::CAnimTimer(MAnimTimerObserver& aObserver)
-    :CTimer(EPriorityStandard),
-    iAnim(aObserver)
-    {
-    CActiveScheduler::Add(this);
-    }
-
-/**
- Frees resources owned by the object prior to deletion.
-*/ 
-CAnimTimer::~CAnimTimer()
-    {
-    }
-
-/**
- Creates a new bitmap animation timer object.
-
-@param aObserver A pointer to the MAnimTimerObserver
-@return A pointer to the new bitmap animation timer object.
-*/
-CAnimTimer* CAnimTimer::NewL(MAnimTimerObserver& aObserver)
-    {
-    CAnimTimer* timer=new(ELeave) CAnimTimer(aObserver);
-    CleanupStack::PushL(timer);
-    timer->ConstructL();
-    CleanupStack::Pop();
-    return timer;
-    }
-
-/**
- Completes construction of the bitmap animation timer object and
- constructs a new asynchronous timer.
-*/
-void CAnimTimer::ConstructL()
-    {
-    CTimer::ConstructL();
-    }
-
-/**
- Handles an active object's request completion event.
- Invokes the function to draw the next frame
-*/
-void CAnimTimer::RunL()
-    {
-    iAnim.DisplayNextFrameL();
-    }
-
-// CEventTestAnimBase base class for event test anims //
-CEventTestAnimBase::~CEventTestAnimBase()
-	{
-	iFunctions->GetRawEvents(EFalse);
-	}
-
-void CEventTestAnimBase::ConstructL(TAny* /*aParam*/, TBool )
-	{
-	iExpectedEvents.SetLengthL(EEventBufferSize);
-	}
-
-void CEventTestAnimBase::Animate(TDateTime*)
-	{
-	}
-
-void CEventTestAnimBase::Redraw()
-	{
-	}
-
-void CEventTestAnimBase::Command(TInt /*aOpcode*/, TAny* /*aParam*/)
-	{
-	/*switch (aOpcode)
-		{
-	default:;
-		}*/
-	}
-
-void CEventTestAnimBase::FocusChanged(TBool /*aState*/)
-	{
-	}
-
-// Base class common client server interface
-TInt CEventTestAnimBase::CommandReplyL(TInt aOpcode,TAny* aParam)
-	{
-	TAnimArgUnion pData;
-	pData.any=aParam;
-	switch (aOpcode)
-		{
-	case EADllAddExpectedEvent:
-		return AddExpectedEvent(pData.AnimRawEvent);
-	case EADllNumberOfEventsReceived:
-		return iEventCount;
-	case EADllErrorCode:
-		return iError;
-	case EADllReset:
-		iExpectedEvents.Reset();
-		iError = 0;
-		iEventCount = 0;
-		return KErrNone;
-	default:;
-		}
-	return(KErrNone);
-	}
-
-TBool CEventTestAnimBase::HandleRecursiveEvent(const TRawEvent& aRawEvent)
-	{
-	if (aRawEvent.ScanCode() == 60)
-		{
-		TRawEvent rawEvent;
-		rawEvent.Set(TRawEvent::EKeyUp, 34);
-		iFunctions->PostRawEvent(rawEvent);
-		rawEvent.Set(TRawEvent::EKeyUp, 35);
-		iFunctions->PostRawEvent(rawEvent);
-		return ETrue;
-		}
-	return EFalse;
-	}
-
-TBool CEventTestAnimBase::OfferRawEvent(const TRawEvent& aRawEvent)
-	{
-	// Do not consume the following types of events
-	if (IsIgnorableEvent(aRawEvent))
-		{
-		return EFalse;
-		}
-
-	// Increment event count if not in an error state
-	if (!Error())
-		{
-		iEventCount++;
-		}
-	
-	// For anim which generates recursive events 
-	if (aRawEvent.Type() == TRawEvent::EKeyDown && aRawEvent.ScanCode() == 60)
-		{
-		return HandleRecursiveEvent(aRawEvent);
-		}
-
-	TAnimRawEvent event;
-
-	if (!GetNextExpectedEvent(event))
-		{
-		Fail();
-		return EFalse;
-		}
-
-	// Fail if wrong event type
-	if (!CompareEvents(event.iRawEvent, aRawEvent))
-		{
-		Fail();
-		}
-
-	return event.iEat;
-	}
-
-TBool CEventTestAnimBase::GetNextExpectedEvent(TAnimRawEvent& aRawEvent)
-	{
-	// Get next expected event
-	if (iExpectedEvents.Remove(&aRawEvent)<1)
-		{
-		Fail();
-		return EFalse;
-		}
-	else
-		{
-		return ETrue;
-		}
-	}
-
-TBool CEventTestAnimBase::IsIgnorableEvent(const TRawEvent& aRawEvent) const
-	{
-	TRawEvent::TType aType=aRawEvent.Type();
-	TBool result = (aType==TRawEvent::EActive || aType==TRawEvent::EInactive || aType==TRawEvent::ERedraw
-			|| (iExpectedEvents.Count()==0 && aType==TRawEvent::EPointerMove));
-
-	return result;
-	}
-
-TBool CEventTestAnimBase::CompareEvents(const TRawEvent& aExpectedEvent, const TRawEvent& aActualEvent) const
-	{
-	TRawEvent::TType eType=aExpectedEvent.Type();
-	TRawEvent::TType aType=aActualEvent.Type();
-	if (eType!=aType)
-		{
-		return EFalse;
-		}
-	else
-		{
-		switch (aType)
-			{
-		case TRawEvent::EUpdateModifiers:
-			{
-			TInt eMod=aExpectedEvent.Modifiers(),aMod=aActualEvent.Modifiers();
-			if (eMod!=aMod)
-				{
-				return EFalse;
-				}
-			break;
-			}
-		case TRawEvent::EKeyDown:
-		case TRawEvent::EKeyUp:
-			{
-			TInt eScan=aExpectedEvent.ScanCode(),aScan=aActualEvent.ScanCode();
-			if (eScan!=aScan)
-				{
-				return EFalse;
-				}
-			break;
-			}
-		case TRawEvent::EPointerMove:
-		case TRawEvent::EPointerSwitchOn:
-		case TRawEvent::EButton1Down:
-		case TRawEvent::EButton1Up:
-		case TRawEvent::EButton2Down:
-		case TRawEvent::EButton2Up:
-		case TRawEvent::EButton3Down:
-		case TRawEvent::EButton3Up:
-			{
-			TPoint ePoint=aExpectedEvent.Pos(),aPoint=aActualEvent.Pos();
-			if (ePoint!=aPoint)
-				{
-				return EFalse;
-				}
-			break;
-			}
-		default:;
-			}
-		}
-	return ETrue;
-	}
-
-void CEventTestAnimBase::Fail()
-	{
-	if (iError==0)
-		{
-		iError=iEventCount;
-		}
-	}
-
-inline TInt CEventTestAnimBase::Error() const
-	{
-	return iError;
-	}
-
-inline TInt CEventTestAnimBase::EventCount() const
-	{
-	return iEventCount;
-	}
-
-inline void CEventTestAnimBase::ResetEventCount()
-	{
-	iEventCount = 0;
-	}
-
-inline TInt CEventTestAnimBase::TotalExpectedEvents() const
-	{
-	return iExpectedEvents.Count();
-	}
-
-inline TInt CEventTestAnimBase::AddEvent(const TAnimRawEvent* aEvent)
-	{
-	return iExpectedEvents.Add(aEvent);
-	}
-
-// CEventTestAnim test drawing off own timer //
-CEventTestAnim::~CEventTestAnim()
-	{
-	UnloadDeviceDriver();
-	}
-
-void CEventTestAnim::ConstructL(TAny* aParam, TBool aBool)
-	{
-	CEventTestAnimBase::ConstructL(aParam, aBool);
-	iFunctions->GetRawEvents(ETrue);
-	iDevDriverLoaded=EFalse;
-	}
-
-TInt CEventTestAnim::UnloadDeviceDriver()
-	{
-	TInt err=KErrNone;
-	iLdd.Close();
-	if (iDevDriverLoaded)
-		{
-		err=User::FreeLogicalDevice(REventDD::BinaryName());
-		if (err==KErrNone)
-			iDevDriverLoaded=EFalse;
-		}
-	return err;
-	}
-
-TInt CEventTestAnim::AddExpectedEvent(const TAnimRawEvent* aEvent)
-	{
-	return (AddEvent(aEvent) ? KErrNone : KErrOverflow);
-	}
-
-TInt CEventTestAnim::CommandReplyL(TInt aOpcode,TAny* aParam)
-	{
-	switch (aOpcode)
-		{
-	case EADllNoEventsAndReset:
-		{
-		TInt events=EventCount();
-		ResetEventCount();
-		return events;
-		}
-	case EADllLoadDeviceDriver:
-		{
-		TInt err=User::LoadLogicalDevice(REventDD::BinaryName());
-		if (err==KErrNone || err==KErrAlreadyExists)
-			{
-			TInt err2=iLdd.Open();
-			if (err==KErrNone)
-				{
-				if (err2==KErrNone)
-					iDevDriverLoaded=ETrue;
-				else 		//Only unload if we loaded it
-					User::FreeLogicalDevice(REventDD::BinaryName());
-				}
-			err=err2;
-			}
-		return err;
-		}
-	case EADllUnloadDeviceDriver:
-		return UnloadDeviceDriver();
-	case EADllSendEvent:
-		{
-		TAnimRawEvent event;
-		TInt events=*static_cast<TInt*>(aParam);
-		TInt err=KErrNone;
-		TInt ii;
-		for (ii=events;ii>0;--ii)
-			{
-			event.iRawEvent.Set(ii/2==0 ? TRawEvent::ECaseOpen : TRawEvent::ECaseClose);
-			//TInt err=UserSvr::AddEvent(event.iRawEvent);
-			//Need to do the above line here, but don't have enough capability
-			//so call a device driver to do it instead
-			err=iLdd.SendEvent(event.iRawEvent);
-			if (err!=KErrNone)
-				return err;
-			event.iEat=ETrue;
-			AddExpectedEvent(&event);
-			}
-		return KErrNone;
-		}
-	default:;
-		return CEventTestAnimBase::CommandReplyL(aOpcode, aParam);
-		}
-	}
-
-void CEventTestAnim::Command(TInt aOpcode,TAny* /*aParam*/)
-	{
-	switch (aOpcode)
-		{
-	case EADllAfterEvent:
-		if (TotalExpectedEvents()>0)
-			Fail();
-		break;
-	default:;
-		}
-	}
-
-// CEventPostingAnim test posting of anim events //
-CEventPostingAnim::~CEventPostingAnim()
-	{
-	}
-
-void CEventPostingAnim::ConstructL(TAny* aParam, TBool aBool)
-	{
-	CEventTestAnimBase::ConstructL(aParam, aBool);
-	iFunctions->GetRawEvents(ETrue);
-	}
-
-TInt CEventPostingAnim::AddExpectedEvent(const TAnimRawEvent* aEvent)
-	{
-	return (AddEvent(aEvent) ? KErrNone : KErrOverflow);
-	}
-
-TBool CEventPostingAnim::OfferRawEvent(const TRawEvent &aRawEvent)
-	{
-	// Call PostRawEvent or PostKeyEvent according to type of the event
-	TBool ret = CEventTestAnimBase::OfferRawEvent(aRawEvent);
-	if (ret)
-		{
-		if (aRawEvent.Type() == TRawEvent::EKeyDown && aRawEvent.ScanCode() == 45)
-			{
-			TKeyEvent event;
-			event.iCode='J';
-			event.iScanCode=0;
-			event.iModifiers=0;
-			
-			// This is to check the normal PostKeyEvent API
-			iFunctions->PostKeyEvent(event);
-			
-			// This is to check the newly added API
-			iFunctions->EventExtension()->PostKeyEvent(event, 2);
-			}
-		else
-			{
-			iFunctions->PostRawEvent(aRawEvent);	
-			}
-		}
-	return ret;
-	}
-
-// CTimerTestAnim check that timer events stop //
-CTimerTestAnim::~CTimerTestAnim()
-	{
-	}
-
-void CTimerTestAnim::ConstructL(TAny* /*aParam*/, TBool )
-	{
-	iWindowFunctions->SetRect(TRect(0,0,1,1));
-	iFunctions->SetSync(MAnimGeneralFunctions::ESyncSecond);
-	iExpectingTicks=ETrue;
-	iFail=EFalse;
-	}
-
-void CTimerTestAnim::Animate(TDateTime*)
-	{
-	++iTimerCount;
-	if (!iExpectingTicks)
-		iFail=iTimerCount;
-	}
-
-void CTimerTestAnim::Redraw()
-	{
-	}
-
-void CTimerTestAnim::Command(TInt aOpcode, TAny* /*aParam*/)
-	{
-	switch (aOpcode)
-		{
-	case EADllResetCount:
-		iTimerCount=0;
-		break;
-	case EADllNoTimer:
-		iExpectingTicks=EFalse;
-		iFunctions->SetSync(MAnimGeneralFunctions::ESyncNone);
-		break;
-	case EADllTimerStarted:
-		iExpectingTicks=ETrue;
-		iFunctions->SetSync(MAnimGeneralFunctions::ESyncSecond);
-		break;
-	default:;
-		}
-	}
-
-TInt CTimerTestAnim::CommandReplyL(TInt aOpcode, TAny* /*aParam*/)
-	{
-	switch (aOpcode)
-		{
-	case EADllCurrentCount:
-		return iTimerCount;
-	case EADllFailed:
-		return iFail;
-	default:;
-		}
-	return(KErrNone);
-	}
-
-void CTimerTestAnim::FocusChanged(TBool /*aState*/)
-	{
-	}
-
-TBool CTimerTestAnim::OfferRawEvent(const TRawEvent& /*aRawEvent*/)
-	{
-	return EFalse;
-	}
-
-
-// CWinFunctionTestAnim test drawing off own timer //
-CWinFunctionTestAnim::~CWinFunctionTestAnim()
-	{}
-
-void CWinFunctionTestAnim::ConstructL(TAny* /*aParam*/,TBool)
-	{
-	iWinFunctions=static_cast<MAnimGeneralFunctionsWindowExtension*>
-										(iFunctions->ExtendedInterface(MAnimGeneralFunctions::EWindowExtensionInterface));
-	}
-
-void CWinFunctionTestAnim::Animate(TDateTime*)
-	{}
-
-void CWinFunctionTestAnim::Redraw()
-	{}
-
-void CWinFunctionTestAnim::Command(TInt /*aOpcode*/,TAny* /*aParam*/)
-	{
-	/*switch (aOpcode)
-		{
-	default:;
-		}*/
-	}
-
-TInt CWinFunctionTestAnim::CommandReplyL(TInt aOpcode,TAny* aParam)
-	{
-	TAnimArgUnion pData;
-	pData.any=aParam;
-	switch (aOpcode)
-		{
-	case EADllScreen:
-		return iWinFunctions->Screens();
-	case EADllFocusScreen:
-		return iWinFunctions->FocusScreens();
-	case EADllWindowGroups:
-		return iWinFunctions->WindowGroups(*pData.Int);
-	case EADllWindowGroupInfo:
-		{
-		const TWindowGroupInfoParms& params=*pData.WindowGroupInfoParms;
-		TPckgBuf<MAnimGeneralFunctionsWindowExtension::TWindowGroupInfo> info;
-		TBool ret=iWinFunctions->WindowGroupInfo(info(),params.iScreen,params.iOrdinalPosition);
-		/*const TInt theError=*/(*iFunctions->Message()).Write(KIpcSlot,info);
-		return ret;
-		}
-	case EADllWindowGroupName:
-		{
-		const TWindowGroupInfoParms& params=*pData.WindowGroupInfoParms;
-		TPtrC name;
-		TBool ret=iWinFunctions->WindowGroupName(name,params.iScreen,params.iOrdinalPosition);
-		/*const TInt theError=*/(*iFunctions->Message()).Write(KIpcSlot,name);
-		return ret;
-		}
-	case EADllSetOrdinalPosition:
-		{
-		const TSetOrdinalParms& params=*pData.SetOrdinalParms;
-		return iWinFunctions->SetOrdinalPosition(params.iIdentifier,params.iOrdinalPosition,params.iOrdinalPriority);
-		}
-	case EADllSetFocusScreen:
-		{
-		const TInt& params=*pData.Int;
- 		iWinFunctions->SetFocusScreen(params);
- 		break;
-		}
-	default:;
-		}
-	return(KErrNone);
-	}
-
-void CWinFunctionTestAnim::FocusChanged(TBool /*aState*/)
-	{}
-
-TBool CWinFunctionTestAnim::OfferRawEvent(const TRawEvent& /*aRawEvent*/)
-	{
-	return EFalse;
-	}
-
-
-// CNotificationTestAnim
-CNotificationTestAnim::CNotificationTestAnim() : iHeartbeatState(EFalse) , iScreenDeviceChanged(ETrue)
-	{
-	}
-
-CNotificationTestAnim::~CNotificationTestAnim()
-	{
-//	Removed for test case GRAPHICS-WSERV-0139 for DEF12220
-//	iFunctions->RegisterForNotifications(EFalse);
-	}
-
-void CNotificationTestAnim::ConstructL(TAny* /*aParam*/, TBool )
-	{
-	iWindowFunctions->SetRect(TRect(0,0,1,1));
-	iFunctions->RegisterForNotifications(EDirectScreenAccess|EHeartbeatTimer|EScreenDeviceChange);
-	iFunctions->SetSync(MAnimGeneralFunctions::ESyncSecond);
-	iLastAnimTime.UniversalTime();
-	}
-
-void CNotificationTestAnim::HandleNotification(const TWsEvent& aEvent)
-	{
-	switch (aEvent.Type())
-		{
-	case EEventDirectScreenAccessBegin:
-		{
-		TInt screenNum = *(aEvent.Int());
-		iDSA[screenNum] = ETrue;
-		}
-		break;
-	case EEventDirectScreenAccessEnd:
-		{
-		TInt screenNum = *(aEvent.Int());
-		iDSA[screenNum] = EFalse;
-		}
-		break;
-	case EEventHeartbeatTimerStateChange:
-		{
-		iHeartbeatState=*aEvent.Int();
-		}
-		break;
-	case EEventScreenDeviceChanged:
-		{
-		iScreenDeviceChanged=!iScreenDeviceChanged;
-		}
-		break;
-	default:
-		break;
-		}
-	}
-
-void CNotificationTestAnim::Animate(TDateTime*)
-	{
-	iLastAnimTime.UniversalTime();
-	}
-
-void CNotificationTestAnim::Redraw()
-	{
-	}
-
-void CNotificationTestAnim::Command(TInt /*aOpcode*/, TAny* /*aParam*/)
-	{
-	}
-
-TInt CNotificationTestAnim::CommandReplyL(TInt aOpcode,TAny* aParam)
-	{
-	TAnimArgUnion pData;
-	pData.any=aParam;
-	switch (aOpcode)
-		{
-	case EADllQueryDSA:
-		{
-		TInt screenNum = *pData.Int;
-		return iDSA[screenNum];
-		}
-	case EADllQueryHeartbeatState:
-		{
-		return iHeartbeatState;
-		}
-	case EADllIsAnimating:
-		{
-		// Check if the anim DLL is currently animating by comparing
-		// the current time with the last anim time - if this is greater than a second
-		// then we are not animating
-		TTime timeNow;
-		timeNow.UniversalTime();
-		TTimeIntervalMicroSeconds microSecs = timeNow.MicroSecondsFrom(iLastAnimTime);
-		if(microSecs > TTimeIntervalMicroSeconds(1200000)) // 1 sec plus 0.2 secs to cope with any latency
-			{
-			return EFalse;
-			}
-		else
-			{
-			return ETrue;
-			}
-		}
-	default:;
-		}
-	return(KErrNone);
-	}
-
-void CNotificationTestAnim::FocusChanged(TBool /*aState*/)
-	{
-	}
-
-TBool CNotificationTestAnim::OfferRawEvent(const TRawEvent& /*aRawEvent*/)
-	{
-	return EFalse;
-	}
-
-// CTransAnim test drawing//
-void CTransAnim::ConstructL(TAny* aParam, TBool)
-	{
-	iRect=*static_cast<TRect*>(aParam);//Assigns the animation area
-	iWindowFunctions->SetRect(iRect);
-	iFunctions->SetSync(MAnimGeneralFunctions::ESyncFlash);
-	iFont=NULL;
-	iColor=TRgb(0,0,0);
-	}
-
-void CTransAnim::Animate(TDateTime*)
-	{
-	iWindowFunctions->ActivateGc();
-	if(iMode==1)		//Draw line mode
-		{
-		DoDraw(iDraw,*iGc,iColor,iRect);
-		}
-	else if(iMode==2)	//Draw text mode
-		{
-		DoDraw(iDraw,*iGc,iColor,iRect,iFont,iCount);
-		}
-	}
-
-void CTransAnim::Redraw()
-	{
-	DoDraw(iDraw,*iGc,iColor,iRect,iFont,iCount);
-	}
-
-void CTransAnim::Command(TInt aOpcode,TAny* aParam)
-	{
-	TAnimArgUnion pData;
-	pData.any=aParam;
-	switch(aOpcode)
-		{
-		case EADllDrawNow:	//Used to draw a single frame
-			iWindowFunctions->ActivateGc();
-			iMode=1;
-			iDraw=36;
-			iColor=TRgb(0,0,0);
-			DoDraw(iDraw,*iGc,iColor,iRect);
-			break;
-		case EADllNextFrame:	//Used to draw a continous frame
-			iMode=2;
-			iColor=pData.FrameData->color;
-			iDraw=pData.FrameData->draw;
-			iCount=pData.FrameData->text;
-			break;
-		case EADllStartAnimText:	//Used to start text animate
-			iWindowFunctions->ActivateGc();
-			iMode=2;
-			iDraw=37;
-			iFont=iFunctions->DuplicateFontL(pData.FrameData->font);
-			iColor=pData.FrameData->color;
-			iCount=pData.FrameData->text;
-			if(pData.FrameData->sync==EStateFlash)
-				iFunctions->SetSync(MAnimGeneralFunctions::ESyncFlash);
-			else if(pData.FrameData->sync==EStateSecond)
-				iFunctions->SetSync(MAnimGeneralFunctions::ESyncSecond);
-			DoDraw(iDraw,*iGc,iColor,iRect,iFont,iCount);
-			break;
-		case EADllEndAnimText:		//Used to end text animate
-			iFunctions->SetSync(MAnimGeneralFunctions::ESyncNone);
-			iWindowFunctions->ActivateGc();
-			iCount=0;
-			iMode=0;
-			iFunctions->CloseFont(iFont);
-			iFont=NULL;
-			break;
-		}
-	}
-
-TInt CTransAnim::CommandReplyL(TInt /*aOpcode*/, TAny* /*aParam*/)
-	{
-	return(0);
-	}
-
-void CTransAnim::FocusChanged(TBool /*aState*/)
-	{}
-
-TBool CTransAnim::OfferRawEvent(const TRawEvent& /*aRawEvent*/)
-	{
-	return EFalse;
-	}
-
-// an anim dll that doesn't remove itself from the event handler list
-CTestHandlerAnim::~CTestHandlerAnim()
-	{
-	}
-
-void CTestHandlerAnim::ConstructL(TAny* /*aArgs*/, TBool /*aHasFocus*/)
-	{
-	iFunctions->GetRawEvents(ETrue);
-	}
-
-void CTestHandlerAnim::Redraw()
-	{
-	}
-
-void CTestHandlerAnim::FocusChanged(TBool /*aState*/)
-	{
-	}
-
-TInt CTestHandlerAnim::CommandReplyL(TInt /*aOpcode*/, TAny* /*aArgs*/)
-	{
-	return KErrNone;
-	}
-
-void CTestHandlerAnim::Command(TInt /*aOpcode*/, TAny* /*aArgs*/)
-	{
-	}
-
-void CTestHandlerAnim::Animate(TDateTime* /*aDateTime*/)
-	{
-	}
-
-TBool CTestHandlerAnim::OfferRawEvent(const TRawEvent &/*aRawEvent*/)
-	{
-	return EFalse;
-	}
-
-// CRemovableAnim Test removal of anim during event handling //
-CRemovableAnim::~CRemovableAnim()
-	{
-	}
-
-TInt CRemovableAnim::AddExpectedEvent(const TAnimRawEvent* aEvent)
-	{
-	if (TotalExpectedEvents() + EventCount() < iLifetime)
-		{
-		return (AddEvent(aEvent) ? KErrNone : KErrOverflow);
-		}
-	else
-		{
-		return KErrNone;
-		}
-	}
-
-TInt CRemovableAnim::CommandReplyL(TInt aOpcode,TAny* aParam)
-	{
-	TAnimArgUnion pData;
-	pData.any=aParam;
-	switch (aOpcode)
-		{
-	case EADllSetEventHandlerLifetime:
-		iLifetime = *pData.Int;
-		return iLifetime;
-	case EADllEventHandlerLifetime:
-		return iLifetime;
-	case EADllAddToEventHandlers:
-		iFunctions->GetRawEvents(ETrue);
-		return KErrNone;
-	case EADllRemoveFromEventHandlers:
-		iFunctions->GetRawEvents(EFalse);
-		return KErrNone;
-	case EADllTestPassed:
-		{
-		// If any unexpected events are received, then Error() > 0
-		// If fewer than the number of expected events are received, then TotalExpectedEvents() > 0
-		TBool passed = (Error() == 0) && (TotalExpectedEvents() == 0);
-		return passed;
-		}
-	default:
-		return CEventTestAnimBase::CommandReplyL(aOpcode, aParam);
-		}
-	}
-
-
-TBool CRemovableAnim::OfferRawEvent(const TRawEvent& aRawEvent)
-	{
-	TBool eat = CEventTestAnimBase::OfferRawEvent(aRawEvent);
-
-	// Remove anim from event handlers if lifetime has been exceeded
-	if (EventCount() >= iLifetime)
-		{
-		iFunctions->GetRawEvents(EFalse);
-		}
-	return eat;
-	}
-
-// CMultiPointerAnim for Testing multipointerevents for anims //
-CMultiPointerAnim::~CMultiPointerAnim()
-	{
-	iFunctions->GetRawEvents(EFalse);
-	}
-
-// Important thing here is to call GetRawEvents() which Switches animation raw event handling on
-void CMultiPointerAnim::ConstructL(TAny */*aArgs*/, TBool /*aHasFocus*/)
-	{
-	iExpectedEvents.SetLengthL(EEventBufferSize);
-	iFunctions->GetRawEvents(ETrue);
-	}
-
-void CMultiPointerAnim::Animate(TDateTime */*aDateTime*/)
-	{
-	}
-
-void CMultiPointerAnim::Command(TInt /*aOpcode*/, TAny */*aArgs*/)
-	{
-	}
-
-TInt CMultiPointerAnim::CommandReplyL(TInt aOpcode, TAny *aArgs)
-	{
-	TAnimArgUnion pData;
-	pData.any=aArgs;
-	switch (aOpcode)
-		{
-	case EADllAddExpectedMultiPtrEvent:
-		return AddEvent(pData.AnimRawEvent);
-	case EADllMultiPtrEventError:
-		return iError;
-	case EADllMultiPtrEventErrorDesc:
-		if (iError != KErrNone)
-			{
-			// returns the error description which gets displayed in logs if test failed
-			const RMessagePtr2& message=*iFunctions->Message();
-			const TInt error=message.Write(KIpcSlot, iErrorDes);
-			if (error != KErrNone)
-				{
-				return error;
-				}
-			}
-		break;
-	case EADllMultiPtrEventReset:
-		iExpectedEvents.Reset();
-		iError = 0;
-		iEventCount = 0;
-		break;
-	default:;
-		}
-	return(KErrNone);
-	}
-
-void CMultiPointerAnim::Redraw()
-	{
-	}
-
-void CMultiPointerAnim::FocusChanged(TBool /*aState*/)
-	{
-	}
-
-TBool CMultiPointerAnim::OfferRawEvent(const TRawEvent &aRawEvent)
-	{
-	// Ignore following raw events
-	TRawEvent::TType aType=aRawEvent.Type();
-	if (aType==TRawEvent::EActive || aType==TRawEvent::EInactive || aType==TRawEvent::ERedraw
-			|| aType==TRawEvent::EPointerSwitchOn || aType==TRawEvent::EUpdateModifiers)
-		{
-		return EFalse;
-		}
-	
-	// If it has already failed then do not test other events becasue the error value 
-	// and its descriptor will be over written
-	if (iError)
-		{
-		return EFalse;;
-		}
-		
-	TAnimRawEvent expectedEvent; 
-	if (iExpectedEvents.Remove(&expectedEvent)<1)
-		{
-		return EFalse;
-		}
-	
-	// Increment event count
-	iEventCount++;
-	
-	// Call compare events function passing in both the events
-	if (!CompareEvents(expectedEvent.iRawEvent, aRawEvent))
-		{
-		iError = iEventCount;
-		}
-	
-	return expectedEvent.iEat;
-	}
-
-TInt CMultiPointerAnim::AddEvent(const TAnimRawEvent* aEvent)
-	{
-	return iExpectedEvents.Add(aEvent);
-	}
-
-TBool CMultiPointerAnim::CompareEvents(const TRawEvent& aExpectedEvent, const TRawEvent& aActualEvent)
-	{
-	// Check pointer type
-	if (aExpectedEvent.Type() != aActualEvent.Type())
-		{
-		_LIT(KEventType, "Actual Event type = %d Expected Event Type = %d ");
-		iErrorDes.Format(KEventType, aActualEvent.Type(), aExpectedEvent.Type());
-		return EFalse;
-		}
-	
-	// Here for EOutOfRange we cannot query Pos or Pos3D...
-	if (aExpectedEvent.Type() != TRawEvent::EPointer3DOutOfRange)
-		{
-		// Check 3d position
-		TPoint3D expected3DPos = aExpectedEvent.Pos3D();
-		TPoint3D actual3DPos = aActualEvent.Pos3D();
-		if (expected3DPos.iX != actual3DPos.iX)
-			{
-			_LIT(KXPosition, "Actual X coordinate = %d Expected X coordinate = %d ");
-			iErrorDes.Format(KXPosition, actual3DPos.iX, expected3DPos.iX);
-			return EFalse;
-			}
-		if (expected3DPos.iY != actual3DPos.iY)
-			{
-			_LIT(KYPosition, "Actual Y coordinate = %d Expected Y coordinate = %d ");
-			iErrorDes.Format(KYPosition, actual3DPos.iY, expected3DPos.iY);
-			return EFalse;
-			}
-		if (expected3DPos.iZ != actual3DPos.iZ)
-			{
-			_LIT(KZPosition, "Actual Z coordinate = %d Expected Z coordinate = %d ");
-			iErrorDes.Format(KZPosition, actual3DPos.iZ, expected3DPos.iZ);
-			return EFalse;
-			}
-		}
-
-	// Check pointer number
-	if (aExpectedEvent.PointerNumber() != aActualEvent.PointerNumber())
-		{
-		_LIT(KPointerNumber, "Actual Pointer number = %d Expected Pointer number = %d ");
-		iErrorDes.Copy(KPointerNumber);
-		iErrorDes.Format(KPointerNumber, aActualEvent.PointerNumber(), aExpectedEvent.PointerNumber());
-		return EFalse;
-		}
-	return ETrue;
-	}
-
-// CCoverageAnim test drawing/redrawing //
-CCoverageAnim::~CCoverageAnim()
-	{
-	if(iFont && iFunctions)
-		iFunctions->CloseFont(iFont);
-	} 
-
-/**
- Initializes members.
- */
-void CCoverageAnim::ConstructL(TAny *aParam, TBool )
-	{
-	iRect=*static_cast<TRect*>(aParam);
-	iWindowFunctions->SetRect(iRect);
-	iWindowFunctions->Invalidate(iRect);
-	
-	iFunctions->SetSync(MAnimGeneralFunctions::ESyncDay);
-	if (iFunctions->Sync() != MAnimGeneralFunctions::ESyncDay)
-		User::Leave(KErrGeneral);	 
-
-	iFunctions->SetSync(MAnimGeneralFunctions::ESyncMinute);
-	if (iFunctions->Sync() != MAnimGeneralFunctions::ESyncMinute)
-		User::Leave(KErrGeneral);	 
-
-	iFunctions->SetSync(MAnimGeneralFunctions::ESyncSecond);
-	if (iFunctions->Sync() != MAnimGeneralFunctions::ESyncSecond)
-		User::Leave(KErrGeneral);	 
-
-	iFunctions->SetSync(MAnimGeneralFunctions::ESyncFlash);
-	if (iFunctions->Sync() != MAnimGeneralFunctions::ESyncFlash)
-		User::Leave(KErrGeneral);	 
-		
-	iFunctions->SetSync(MAnimGeneralFunctions::ESyncNone);
-	if (iFunctions->Sync() != MAnimGeneralFunctions::ESyncNone)
-		User::Leave(KErrGeneral);	 
-		
-	iFunctions->SetInterval(1);
-	iFunctions->SetInterval(0);
-	iFunctions->SetNextInterval(0);
-		
-	User::LeaveIfNull(iFunctions->ExtendedInterface(MAnimGeneralFunctions::ENumberOfExtendedInterfaces));
-	User::LeaveIfNull(iFunctions->ExtendedInterface(MAnimGeneralFunctions::EWindowExtensionInterface));
-	User::LeaveIfNull(iFunctions->ExtendedInterface(MAnimGeneralFunctions::EEventExtentionInterface));
-	User::LeaveIfError(iFunctions->ExtendedInterface(MAnimGeneralFunctions::EInterfaceCount) != NULL);
-
-	#if !defined(SYMBIAN_GRAPHICS_GCE)
-		// Deprecated in NGA but needs to be tested in NONNGA
-	User::LeaveIfNull((TAny*)iFunctions->ScreenDevice());
-	#endif
-
-	iFunctions->Client();
-	}
-
-/**
- Copied from CAutoAnimScrBack.
- */
-void CCoverageAnim::Animate(TDateTime *)
-	{
-	iWindowFunctions->ActivateGc();
-	Draw();
-	}
-
-/**
- All methods of the graphic-context are executed one by one.
- */
-void CCoverageAnim::Draw()
-	{
-	iGc->SetClippingRect(iRect);
-	iGc->Clear();
-	iGc->Clear(iRect);
-
-	iGc->SetDrawMode(CGraphicsContext::EDrawModeAND);
-	iGc->SetBrushStyle(CGraphicsContext::ENullBrush);
-	iGc->SetBrushColor(TRgb::Gray256(85));
-	iGc->SetBrushOrigin(TPoint(0,0));
-	iGc->SetPenColor(TRgb::Gray256(170));
-
-	//primitive method calls
-	iGc->SetFaded(ETrue);
-	iGc->SetFadingParameters(1, 1);
-
-	iGc->SetPenStyle(CGraphicsContext::ESolidPen);
-	iGc->SetStrikethroughStyle(EStrikethroughOff);
-	iGc->SetUnderlineStyle(EUnderlineOff);
-	iGc->SetWordJustification(2, 1);
-
-	if(iFont)
-		iGc->UseFont(iFont);
-	
-	iGc->DrawArc(iRect,
-			TPoint(iRect.Center().iX, iRect.iTl.iY),
-			TPoint(iRect.iBr.iX, iRect.Center().iY));
-	iGc->DrawLine(iRect.iTl,iRect.Center());
-	iGc->DrawLineTo(TPoint(iRect.iBr.iX, iRect.iTl.iY));
-
-	iGc->DrawLineBy(TPoint(iRect.iTl.iX, iRect.iBr.iY));
-	iGc->MoveBy(iRect.iTl + TPoint(1,1));
-	iGc->MoveTo(iRect.iTl + TPoint(0,0)); 
-	iGc->SetPenSize(TSize(10,10));
-	iGc->Plot(iRect.iTl + TPoint(2,2));
-	iGc->SetPenSize(TSize(1,1));
-
-	CArrayFixFlat<TPoint>* polyPoints = new(ELeave) CArrayFixFlat<TPoint>(3); //CArrayFixFlat
-	CleanupStack::PushL(polyPoints);
-	polyPoints->AppendL(iRect.iTl);
-	polyPoints->AppendL(iRect.Center());
-	polyPoints->AppendL(TPoint(iRect.iBr.iX, iRect.iTl.iY));
-	
-	iGc->DrawPolyLine(polyPoints);
-	iGc->DrawPolyLine(&polyPoints->At(0), 3);
-	iGc->DrawPolygon(polyPoints, CGraphicsContext::EWinding);
-	iGc->DrawPolygon(&polyPoints->At(0), 3, CGraphicsContext::EAlternate);
-
-	iGc->DrawPie(iRect, TPoint(iRect.Center().iX, iRect.iTl.iY), TPoint(iRect.iBr.iX, iRect.Center().iY));
-	iGc->DrawEllipse(iRect);
-	iGc->DrawRect(iRect);
-	iGc->DrawRoundRect(iRect, TSize(iRect.Width()/8, iRect.Height()/8));
-
-	CleanupStack::PopAndDestroy(polyPoints);
-
-	iGc->CopyRect(TPoint(10, 10), iRect);
-
-	CFbsBitmap* bitmap = new(ELeave) CFbsBitmap();
-	CleanupStack::PushL(bitmap);
-	User::LeaveIfError(bitmap->Create(TSize(16,16),EGray4));
-
-	iGc->UseBrushPattern(bitmap);
-	iGc->DrawBitmap(iRect.iTl, bitmap);
-	iGc->DrawBitmap(iRect, bitmap);
-	iGc->DrawBitmap(iRect, bitmap, TRect(0, 0, 16, 16));
-	iGc->DrawBitmapMasked(iRect, bitmap, TRect(0, 0, 16, 16), bitmap, ETrue);
-
-	iGc->BitBlt(TPoint(0, 0), bitmap);
-	iGc->BitBlt(TPoint(0, 0), bitmap, iRect);
-	iGc->BitBltMasked(TPoint(0, 0), bitmap, iRect, bitmap, ETrue);
-	iGc->AlphaBlendBitmaps(TPoint(0, 0), bitmap, iRect, bitmap, TPoint(0,0));
-	
-	CleanupStack::PopAndDestroy(bitmap);
-
-	iGc->SetCharJustification(1,1);
-	iGc->SetClippingRect(iRect);
-	if(iFont)
-		{
-		_LIT(KHelloWorld,"Hello World");
-		iGc->DrawText(*&KHelloWorld, iRect.iTl);
-		iGc->DrawText(*&KHelloWorld, iRect, 0, CGraphicsContext::ELeft, 0);
-		iGc->DrawTextVertical(*&KHelloWorld, iRect.iBr, ETrue);
-		iGc->DrawTextVertical(*&KHelloWorld, iRect, 0, ETrue, CGraphicsContext::ELeft, 0);
-		}
-	
-	TRgb rgbs[2];
-	iGc->MapColors(iRect, rgbs, 1, ETrue);
-	iGc->DiscardBrushPattern();
-
-	if(iFont)
-		iGc->DiscardFont();
-	
-	iFunctions->CloseFont(0);
-	
-	TDateTime dt = iFunctions->SystemTime();
-	}
-	
-/**
- Copied from CAutoAnim3.
- */
-void CCoverageAnim::Redraw()
-	{
-	Draw();
-	}
-
-/**
- Copied from CAutoAnim3.
- */
-void CCoverageAnim::Command(TInt ,TAny*)
-	{
-	}
-
-/**
- Copied from CAutoAnim3.
- */
-TInt CCoverageAnim::CommandReplyL(TInt aOpcode , TAny* aParam)
-	{
-	TAnimArgUnion pData;
-	pData.any=aParam;
-	switch(aOpcode)
-		{
-		case EADllDrawNow:
-			iFunctions->SetSync(MAnimGeneralFunctions::ESyncFlash);
-			break;
-		case EADllSetFont:
-			if(iFont)
-				{
-				iFunctions->CloseFont(iFont);
-				iFont = NULL;
-				}
-			iFont = iFunctions->DuplicateFontL(*pData.Int);
-			break;
-		} 
-	return(KErrNone);
-	}
-
-/**
- Copied from CAutoAnim3.
- */
-void CCoverageAnim::FocusChanged(TBool )
-	{}
-
-/**
- Copied from CAutoAnim3.
- */
-TBool CCoverageAnim::OfferRawEvent(const TRawEvent &/*aRawEvent*/)
-	{
-	return EFalse;
-	}
-
-
-// DLL code //
-
-CAnim *CTestAnimDll::CreateInstanceL(TInt aType)
-	{
-	CAnim *anim=NULL;
-	switch(aType)
-		{
-		case EAnimTypeTest1:
-			anim=new(ELeave) CPanicAnim();
-			break;
-		case EAnimTypeTest2:
-			anim=new(ELeave) CPanicAnim2();
-			break;
-		case EAnimTypeTest3:
-			anim=new(ELeave) CAutoAnim3();
-			break;
-		case EAnimTypeScrBackTest:
-			anim=new(ELeave) CAutoAnimScrBack();
-			break;
-		case EAnimTypeSprite:
-			anim=new(ELeave) CTestSpriteAnim();
-			break;
-		case EAnimTypeFreeTimer:
-			anim=new(ELeave) CTestFreeTimerAnim();
-			break;
-		case EAnimTypeEventTest:
-			anim=new(ELeave) CEventTestAnim();
-			break;
-		case EAnimTypeNotificationTest:
-			anim=new(ELeave) CNotificationTestAnim();
-			break;
-		case EAnimTypeTimer:
-			anim=new(ELeave) CTimerTestAnim();
-			break;
-		case EAnimTypeWindowFunctions:
-			anim=new(ELeave) CWinFunctionTestAnim();
-			break;
-		case EAnimTypeTrans:
-			anim=new(ELeave) CTransAnim();
-			break;
-		case EAnimTypeEventHandler:
-			anim = new (ELeave) CTestHandlerAnim();
-			break;
-		case EAnimTypeRemovableAnim:
-			anim=new(ELeave) CRemovableAnim();
-			break;
-		case EAnimTypeEventPostingTest:
-			anim=new(ELeave) CEventPostingAnim();
-			break;
-		case EAnimTypeCoverage:
-			anim=new(ELeave) CCoverageAnim();
-			break;
-		case EAnimTypeMultiPointer:
-			anim=new(ELeave) CMultiPointerAnim();
-			break;
-		}
-	return(anim);
-	}
-
-// Dummy E32Dll needed by E32 to build //
-
-void CAutoAnim3::DrawTestScreenL(const TDrawTestScreen* aParams)
-//Moved here as the include messes up the debugging of the rest of the file.
-	{
-	CFbsBitmap *aBitmap=iFunctions->DuplicateBitmapL(aParams->bitmap);
-	CleanupStack::PushL(aBitmap);
-	CFbsBitmap *aMaskBitmap=iFunctions->DuplicateBitmapL(aParams->maskBitmap);
-	CleanupStack::PushL(aMaskBitmap);
-	CFbsFont *aFont=iFont=iFunctions->DuplicateFontL(aParams->font);
-	TSize size(iWindowFunctions->WindowSize());
-	iWindowFunctions->ActivateGc();
-	CBitmapContext *gc=iGc;
-	TBool aExtraDrawBitMap=ETrue;
-//
-#include "DLLDRAW.H"
-//
-	iFunctions->CloseFont(iFont);
-	iFont=NULL;
-	CleanupStack::PopAndDestroy(2);
-	}
--- a/windowing/windowserver/tauto/AUTODLL.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,352 +0,0 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Header defs for ANIMDLL
-// 
-//
-
-#ifndef __AUTODLL_H__
-#define __AUTODLL_H__
-
-
-#if !defined(__W32ADLL_H__)
-#include <w32adll.h>
-#endif
-
-#ifdef SYMBIAN_GRAPHICS_GCE
-_LIT(KAnimDLLName,"autodl_nga.dll");
-#else
-_LIT(KAnimDLLName,"autodl_nonnga.dll");
-#endif
-
-const TInt KIpcSlot=1;
-
-struct CTAParams
-	{
-	TPoint pos;
-	TInt interval;
-	TInt bit1;
-	TInt bit2;
-	};
-
-struct TAnimRawEvent
-	{
-	//inline TAnimRawEvent(TRawEvent& aRawEvent,TBool aEat) :iRawEvent(aRawEvent), iEat(aEat) {}
-	TRawEvent iRawEvent;
-	TBool iEat;
-	};
-
-enum AnimDllPanicOpcodes
-	{
-	EADllPanicCallPanic,
-	EADllPanicSetInterval,
-	EADllPanicSetNextInterval,
-	EADllPanicBadFont,
-	EADllPanicBadBitmap,
-	EADllPanicLeave,
-	EADllPanicDestroy,
-	EADllPanicOpcode,
-	EADllPanicDoubleActivateGC,
-	EADllPanicDrawRectWithNoGc,
-	EADllPanicDrawTextWithNoFont,
-	EADllPanicLeaveInAnimate,
-	EADllPanicLeaveInRedraw,
-	EADllPanicSetVisWithGcActive,
-	EADllReadRemoteDescriptor,
-	EADllSyncTests,
-	EADllTimeChangedTest,
-	EADllTestWindowSize,
-	EADllTestSetVisible,
-	EADllPanicSetVisWithGcActiveReply,
-	EADllBlankOpCode,
-	EADllPanicLeaveInActiveCallback,
-	EADllPanicSetClippingRectWithNoGc,
-	EADllPanicSetClippingRegionWithNoGc,
-	EADllPanicCancelClippingRegionWithNoGc,
-	EADllPanicCancelClippingRectWithNoGc,
-	EADllPanicSetDrawModeWithNoGc,
-	EADllPanicUseFontWithNoGc,
-	EADllPanicDiscardFontWithNoGc,
-	EADllPanicSetUnderlineStyleWithNoGc,
-	EADllPanicSetStrikeThoughStyleWithNoGc,
-	EADllPanicSetWordJustificationWithNoGc,
-	EADllPanicSetCharJustificationWithNoGc,
-	EADllPanicSetPenColorWithNoGc,
-	EADllPanicSetPenStyleWithNoGc,
-	EADllPanicSetPenSizeWithNoGc,
-	EADllPanicSetBrushColorWithNoGc,
-	EADllPanicSetBrushStyleWithNoGc,
-	EADllPanicSetBrushOriginWithNoGc,
-	EADllPanicUseBrushPatterWithNoGc,
-	EADllPanicDiscardBrushPatternWithNoGc,
-	EADllPanicSetFadedWithNoGc,
-	EADllPanicSetFadingParametersWithNoGc,
-	EADllPanicDrawArcWithNoGc,
-	EADllPanicDrawPieWithNoGc,
-	EADllPanicDrawLineWithNoGc,
-	EADllPanicDrawLineToWithNoGc,
-	EADllPanicDrawLineByWithNoGc,
-	EADllPanicDrawEllipseWithNoGc,
-	EADllPanicDrawRoundedRecWithNoGc,
-	EADllPanicClearWithRectWithNoGc,
-	EADllPanicClearWithNoGc,
-	EADllPanicBitBltWithNoGc,
-	EADllPanicBitBltWithRectWithNoGc,
-	EADllPanicBitBltMaskedWithNoGc,
-	EADllPanicDrawBitmapPointWithNoGc,
-	EADllPanicDrawBitmapWithNoGc,
-	EADllPanicDrawBitmapRectWithNoGc,
-	EADllPanicDrawBitmapMaskedFbsBitmapWithNoGc,
-	EADllPanicDrawBitmapMaskedWsBitmapWithNoGc,
-	EADllPanicDrawPolyLinePointsWithNoGc,
-	EADllPanicDrawPolyLineArrayWithNoGc,
-	EADllPanicDrawPolygonPointsWithNoGc,
-	EADllPanicDrawPolygonArrayWithNoGc,
-	EADllPanicMoveToWithNoGc,
-	EADllPanicMoveByWithNoGc,
-	EADllPanicPlotWithNoGc,
-	EADllPanicSetOriginWithNoGc,
-	EADllPanicCopyRectWithNoGc,
-	EADllPanicResetWithNoGc,
-	EADllPanicAlphaBlendingBitmapsFbsBitmapWithNoGc,
-	EADllPanicMapColorsWithNoGc,
-	EADllPanicDrawTextWithRectWithNoFont,
-	EADllPanicDrawTextVerticalWithNoFont,
-	EADllPanicDrawTextVerticalWithRectWithNoFont,
-	EADllPanicDevice,
-	EADllPanicInvalidFocusScreenTooBig,
-	EADllPanicInvalidFocusScreenNegative,
-	};
-
-enum AnimDllTestOpcodes
-	{
-	};
-
-enum AnimDllOpcodes3
-	{
-	EADllSetRect,
-	EADllStartAnimate,
-	EADllCancelAnimate,
-	EADllSetVisible,
-	EADllSetShadowDrawMode,
-	EADllShadowAnimTest,
-	EADllDrawTestScreen,
-	EADllParameterRectValueTest,
-	EADllDoSetSync,
-	EADllSetInterval,
-	EADllSetMode
-	};
-
-enum AnimDllOpcodesScrBack
-	{
-	EADllDrawOtherRect,
-	EADllIsHidden,
-	};
-
-enum AnimDllOpcodesSprite
-	{
-	EADllActivate,
-	EADllDeactivate,
-	EADllCheckMember,
-	EADllSizeChanged,
-	EADllSetPos,
-	EADllDraw1,
-	EADllDraw2,
-	EADllDraw3,
-	EADllIncDraw,
-	};
-
-enum AnimDllOpcodesFreeTimer
-	{
-    EStartAnimation,
-    EStopAnimation,
-    ESetFrameTime
-	};
-
-enum AnimDllOpcodesTimer
-	{
-	EADllNoTimer,
-	EADllTimerStarted,
-	EADllResetCount,
-	EADllCurrentCount,
-	EADllFailed,
-	};
-
-enum AnimDllWinFunctions
-	{
-	EADllScreen,
-	EADllFocusScreen,
-	EADllWindowGroups,
-	EADllWindowGroupInfo,
-	EADllWindowGroupName,
-	EADllSetOrdinalPosition,
-	EADllSetFocusScreen,
-	};
-
-enum AnimDllOpcodesNotificationTest
-	{
-	EADllQueryDSA,
-	EADllQueryHeartbeatState,
-	EADllIsAnimating,
-	};
-
-enum AnimDllTransTest
-	{
-	EADllDrawNow,
-	EADllNextFrame,
-	EADllStartAnimText,
-	EADllEndAnimText,
-	EADllSetSync,
-	EADllSetFont,
-	};
-
-enum TAnimTypes
-	{
-	EAnimTypeTest1,
-	EAnimTypeTest2,
-	EAnimTypeTest3,
-	EAnimTypeScrBackTest,
-	EAnimTypeSprite,
-	EAnimTypeFreeTimer,
-	EAnimTypeEventTest,
-	EAnimTypeEventPostingTest,
-	EAnimTypeTimer,
-	EAnimTypeWindowFunctions,
-	EAnimTypeNotificationTest,
-	EAnimTypeTrans,
-	EAnimTypeEventHandler,
-	EAnimTypeRemovableAnim,
-	/** CWsAnimGc functional coverage */
-	EAnimTypeCoverage,
-	EAnimTypeMultiPointer,
-	};
-
-enum {ERemoteBufSize=0x10};
-enum FlashState{EStateNone,EStateFlash,EStateSecond,EStateMinute};
-
-enum AnimDllOpcodesEventTestAnimBase
-	{
-	EADllAddExpectedEvent,
-	EADllNumberOfEventsReceived,
-	EADllErrorCode,
-	EADllReset,
-	EADllEventAnimBase_EndBaseEnum,
-	};
-
-enum AnimDllOpcodesEventTestAnim
-	{
-	EADllNoEventsAndReset=EADllEventAnimBase_EndBaseEnum,
-	EADllLoadDeviceDriver,
-	EADllUnloadDeviceDriver,
-	EADllSendEvent,
-	EADllAfterEvent,
-	};
-
-enum AnimDllOpcodesRemovableAnim
-	{
-	EADllSetEventHandlerLifetime=EADllEventAnimBase_EndBaseEnum,
-	EADllEventHandlerLifetime,
-	EADllAddToEventHandlers,
-	EADllRemoveFromEventHandlers,
-	EADllTestPassed,
-	};
-
-enum AnimDllOpcodeMultiPointerAnim
-	{
-	EADllAddExpectedMultiPtrEvent,
-	EADllMultiPtrEventError,
-	EADllMultiPtrEventErrorDesc,
-	EADllMultiPtrEventReset,
-	};
-
-struct TRemoteBufAddress
-	{
-	TAny *descPtr;
-	};
-struct TSyncTests
-	{
-	TRequestStatus *status;
-	MAnimGeneralFunctions::TAnimSync syncMode;
-	};
-struct TShadowDrawTest
-	{
-	TRequestStatus *status;
-	};
-struct TTimeChangeTest
-	{
-	TRequestStatus *status;
-	TRequestStatus *status2;
-	};
-struct TDrawTestScreen
-	{
-	TInt bitmap;
-	TInt maskBitmap;
-	TInt font;
-	};
-struct TSpriteMemberInfo
-	{
-	inline TSpriteMemberInfo() {}
-	inline TSpriteMemberInfo(TPoint aSpritePos,TInt aMemberNo,const TSpriteMember& aMember);
-	TPoint iSpritePos;
-	TInt iMember;
-	TInt iBitmapHandle;
-	TInt iMaskBitmapHandle;
-	TBool iInvertMask;
-	CGraphicsContext::TDrawMode iDrawMode;
-	TPoint iOffset;
-	TTimeIntervalMicroSeconds32 iInterval;
-	};
-inline TSpriteMemberInfo::TSpriteMemberInfo(TPoint aSpritePos,TInt aMemberNo,const TSpriteMember& aMember)
-	:iSpritePos(aSpritePos), iMember(aMemberNo), iBitmapHandle(aMember.iBitmap->Handle()),
-	 iMaskBitmapHandle(aMember.iMaskBitmap ? aMember.iMaskBitmap->Handle():0), iInvertMask(aMember.iInvertMask),
-	 iDrawMode(aMember.iDrawMode), iOffset(aMember.iOffset), iInterval(aMember.iInterval)
-	{}
-struct TWindowGroupInfoParms
-	{
-	TInt iScreen;
-	TInt iOrdinalPosition;
-	};
-struct TSetOrdinalParms
-	{
-	TInt iIdentifier;
-	TInt iOrdinalPosition;
-	TInt iOrdinalPriority;
-	};
-struct TFrameData
-	{
-	TInt sync;
-	TInt font;
-	TInt bitmap;
-	TRgb color;
-	TInt draw;
-	TInt text;
-	TRect rect;
-	};
-
-class RTestAnim : public RAnim
-	{
-public:
-	RTestAnim();
-	RTestAnim(RAnimDll &aDll);
- 	inline TInt Construct(const RWindowBase &aWin,TInt aType,const TDesC8 &aParams) {return(RAnim::Construct(aWin,aType,aParams));}
- 	inline TInt Construct(const RWindowBase &aDevice,const TRect &aRect) {return(RAnim::Construct(aDevice, EAnimTypeScrBackTest,TPtrC8((TUint8 *)&aRect,sizeof(aRect))));}
- 	inline TInt Construct(const RWsSprite &aSprite,TInt aType,const TDesC8 &aParams) {return(RAnim::Construct(aSprite,aType,aParams));}
- 	inline TInt CommandReply(TInt aOpcode,const TDesC8& aArgs,const TIpcArgs& aIpcArgs)  {return(RAnim::CommandReply(aOpcode,aArgs,aIpcArgs));}
- 	inline TInt CommandReply(TInt aOpcode,const TPtrC8 &aArgs) {return(RAnim::CommandReply(aOpcode,aArgs));}
- 	inline TInt CommandReply(TInt aOpcode) {return(RAnim::CommandReply(aOpcode));}
- 	inline void Command(TInt aOpcode,const TPtrC8 &aArgs) {RAnim::Command(aOpcode,aArgs);}
- 	inline void Command(TInt aOpcode) {RAnim::Command(aOpcode);}
- 	inline void ChangeRect(const TRect &aRect) {RAnim::Command(EADllDrawOtherRect,TPtrC8((TUint8 *)&aRect,sizeof(aRect)));}
-	};
-
-#endif
--- a/windowing/windowserver/tauto/AUTOTEST.TXT	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,316 +0,0 @@
-Fully Tested
-============
-class RWindow : public RWindowBase
-	{
-	IMPORT_C void Scroll(const TPoint &aOffset);
-	IMPORT_C void Scroll(const TPoint &aOffset, const TRect &aRect);
-	IMPORT_C void Scroll(const TRect &aClipRect, const TPoint &aOffset);
-	IMPORT_C void Scroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect);
-	IMPORT_C TInt OrdinalPosition() const;
-	IMPORT_C void SetOrdinalPosition(TInt aPos);
-	IMPORT_C void SetOrdinalPosition(TInt aPos,TOrdinalPriority aOrdinalPriority);
-	}
-
-class RWs : public RSessionBase
-	{
-	}
-
-class RBitmap : public RDrawBase
-	{
-	}
-
-class RWindowBase : public RDrawBase
-	{
-	}
-
-class RRootWindow : public RWindowBase
-	{
-	}
-
-class RFont : public RFontBase
-	{
-	}
-
-class RBrush : public RBrushBase
-	{
-	}
-
-class RPalette : public RPaletteBase
-	{
-	}
-
-class RGc : public RGdiBase
-	{
-	IMPORT_C void GetPixels(const TPoint &aPoint,TInt aNumOfPixels,TPtr8 &aScanLine)const;
-	IMPORT_C void DrawLine(const TPoint &aPoint1,const TPoint &aPoint2);
-	IMPORT_C void ClearDI(TRgb aColour);
-	IMPORT_C void ClearDI(TRgb aColour,const TRect &aRect);
-	IMPORT_C void ClearTrapezium(const TRect &aRect,TInt aSkew,TBool aHorizontal);
-	IMPORT_C void DrawDottedLine(const TPoint &aPoint1,const TPoint &aPoint2,TUint aDashPattern,TInt aDashedLength);
-	IMPORT_C void DrawTrapezium(const TRect &aRect,TInt aSkew,TBool aHorizontal);
-	IMPORT_C void FillTrapezium(const TRect &aRect,TInt aSkew,TBool aHorizontal);
-	IMPORT_C void GdiBltMasked(const TPoint &aDestination,const RDrawBase &aDrawPtr,const TRect &aSource,const RDrawBase &aMask,TRgb aCutoff,TBool aLowMasked);
-	IMPORT_C void DrawParallelogram(const TRect &aRect,TInt aSkew,TBool aHorizontal);
-	IMPORT_C void ClearParallelogram(const TRect &aRect,TInt aSkew,TBool aHorizontal);
-	IMPORT_C void FillParallelogram(const TRect &aRect,TInt aSkew,TBool aHorizontal);
-	IMPORT_C void PaintParallelogram(const TRect &aRect,TInt aSkew,TBool aHorizontal);
-	IMPORT_C void PaintTrapezium(const TRect &aRect,TInt aSkew,TBool aHorizontal);
-	IMPORT_C void ResetDotParam();
-	}
-
-Partially tested
-================
-class RWindow : public RWindowBase
-	{
-	}
-
-class RWs : public RSessionBase
-	{
-	}
-
-class RBitmap : public RDrawBase
-	{
-	}
-
-class RWindowBase : public RDrawBase
-	{
-	}
-
-class RRootWindow : public RWindowBase
-	{
-	}
-
-class RFont : public RFontBase
-	{
-	}
-
-class RBrush : public RBrushBase
-	{
-	}
-
-class RPalette : public RPaletteBase
-	{
-	}
-
-class RGc : public RGdiBase
-	{
-	}
-
-
-Not tested
-==========
-class RWs : public RSessionBase
-	{
-	IMPORT_C RWs();
-	IMPORT_C TInt Connect(TUint32 aHandle);
-	IMPORT_C void Disconnect();
-	IMPORT_C TVersion Version();
-	IMPORT_C TInt SetHotKey(THotKeyType aType, TUint aKeycode, TUint aModifier, TUint aModifierMask);
-	IMPORT_C TInt CaptureKey(TUint keyCode,TUint mod_mask,TUint modifiers);
-	IMPORT_C void CancelHotKey(TInt aHotKey);
-	IMPORT_C void CancelCaptureKey(TInt aCaptureKey);
-	IMPORT_C void DisplayInfo(TUint aMode, TDisplayInfo *aInfo);
-	IMPORT_C void ComputeMode(TComputeMode mode);
-	IMPORT_C void Info(TInt aClientHandle,TxInfo &aInfo);
-	IMPORT_C void ReadEvent(TPckgBuf<TWsEvent> &aEvent,TInt *stat,TUint blocks=0);
-	IMPORT_C void ReadEventUpdate(TUint blocks);
-	IMPORT_C void ReadEventCancel();
-	IMPORT_C TInt BufferSize(TInt aBufSize);
-	IMPORT_C void Flush();
-	IMPORT_C TBool SetAutoFlush(TBool aState);
-	IMPORT_C TInt HeapCount() const;
-	IMPORT_C void SetTextCursor(RWindow &aWin, const TPoint &aPos, const TTextCursor &aCursor);
-	IMPORT_C void CancelTextCursor();
-	IMPORT_C void MarkStart();
-	IMPORT_C void CheckNum(TUint aCount);
-	IMPORT_C void MarkEnd(TUint aCount);
-	IMPORT_C TInt ResourceCount();
-	inline RBuffer *Buffer() const;
-	};
-
-class RBitmap : public RDrawBase
-	{
-	IMPORT_C RBitmap();
-	IMPORT_C RBitmap(RWs &aWs);
-	IMPORT_C void Close();
-	IMPORT_C void Destroy();
-//	IMPORT_C void Construct(TSize &size,TInt colourBits);
-	IMPORT_C TInt Construct(TSize &size);
-	IMPORT_C TInt Load(const TDesC &aFileName,TReadWrite access=EReadOnly);
-	IMPORT_C void Attributes(TAttributes *attrib);
-	IMPORT_C TUint Handle() const;
-	IMPORT_C TGdiAttributes Attributes()const;
-	IMPORT_C TSize Size()const;
-	};
-
-class RWindowBase : public RDrawBase
-	{
-	IMPORT_C RWindowBase();
-	IMPORT_C RWindowBase(RWs &aWs);
-	IMPORT_C void Close();
-	IMPORT_C void Destroy();
-	IMPORT_C TAttributes Attributes(TInt handle);
-	IMPORT_C TUint32 Parent() const;
-	IMPORT_C TUint32 PrevSibling() const;
-	IMPORT_C TUint32 NextSibling() const;
-	IMPORT_C TUint32 Child() const;
-	IMPORT_C TPoint InquireOffset(const RWindowBase &aWindow) const;
-	IMPORT_C TGdiAttributes Attributes() const;
-	IMPORT_C TUint Handle() const;
-	IMPORT_C TSize Size() const;
-	IMPORT_C TPoint Position() const;
-	};
-
-class RWindow : public RWindowBase
-	{
-	IMPORT_C RWindow();
-	IMPORT_C RWindow(RWs &aWs);
-	IMPORT_C TInt Construct(const RWindowBase &parent,TUint32 handle);
-	IMPORT_C void Activate();
-	IMPORT_C TAttributes Attributes();
-	IMPORT_C void BeginRedraw();
-	IMPORT_C void BeginRedraw(const TRect &rect);
-	IMPORT_C void EndRedraw();
-	IMPORT_C void Invalidate();
-	IMPORT_C void Invalidate(const TRect &rect);
-	IMPORT_C void Validate();
-	IMPORT_C void Validate(const TRect &rect);
-	IMPORT_C void SetPosition(const TPoint &point);
-	IMPORT_C TInt SetSize(const TSize &size);
-	IMPORT_C TInt SetExtent(const TPoint &point,const TSize &size);
-	IMPORT_C TInt SetExtent(TInt tlx,TInt tly,TInt width, TInt height);
-	IMPORT_C void SetAttributes(TUint flags,const TAttributes &windata);
-	IMPORT_C void SetTextCursor(const TTextCursor cursor);
-	IMPORT_C void CancelTextCursor();
-	IMPORT_C void PointerFilter(TUint32 aFilter);
-	IMPORT_C void SetPointerGrab(TBool aState);
-	IMPORT_C void SetPointerCapture(TBool aState);
-	IMPORT_C void SetBackgroundColour(TRgb aColour);
-	IMPORT_C void SetVisible(TBool aState);
-	IMPORT_C TInt SetCurrentRegion(const TRegion &aRegion);
-	IMPORT_C void CancelCurrentRegion();
-	};
-
-class RRootWindow : public RWindowBase
-	{
-	IMPORT_C RRootWindow();
-	IMPORT_C RRootWindow(RWs &aWs);
-	IMPORT_C TInt Construct(TUint32 clientHandle);
-	};
-
-class RFont : public RFontBase
-	{
-	IMPORT_C RFont();
-	IMPORT_C RFont(RWs &aWs);
-	IMPORT_C void Close();
-	IMPORT_C void Destroy();
-	IMPORT_C TInt Construct(const TFont &aFont);
-	IMPORT_C TUint Handle()const;
-	IMPORT_C TInt Height()const;
-	IMPORT_C TInt Ascent()const;
-	IMPORT_C TInt Descent()const;
-	IMPORT_C TInt AverageWidth()const;
-	IMPORT_C TInt MaximumWidth()const;
-	IMPORT_C TBool Bold()const;
-	IMPORT_C TBool Italic()const;
-	IMPORT_C TBool Underline()const;
-	IMPORT_C TBool CrossOut()const;
-	IMPORT_C void WidthTable(TUint aStartChar,TUint aFinishChar,TPtr8 &)const;
-	IMPORT_C TInt TextWidth(const TDesC &aBuf)const;
-	IMPORT_C TInt TextCount(const TDesC &aBuf,TInt aPixelCount)const;
-	IMPORT_C TInt TextCount(const TDesC &aBuf,TInt aPixelCount,TInt &aWidth)const;
-	};
-
-class RBrush : public RBrushBase
-	{
-public:
-	IMPORT_C RBrush();
-	IMPORT_C RBrush(RWs &aWs);
-	IMPORT_C void Close();
-	IMPORT_C void Destroy();
-	IMPORT_C TInt Construct(const TDesC &aFileName,RFs &aFileSys);
-	IMPORT_C TUint Handle()const;
-	IMPORT_C TSize Size()const;
-	IMPORT_C TRgb Pixel(const TPoint &aPoint)const;
-	IMPORT_C void GetPixels(const TPoint &aPoint,TInt aPelLength,TInt aMode,TPtr8 &aBuffer)const;
-	IMPORT_C void SetThreshold(TUint aThreshold);
-private:
-	TInt32 iHandle;
-	RBuffer *iBuffer;
-	};
-
-class RPalette : public RPaletteBase
-	{
-	IMPORT_C RPalette();
-	IMPORT_C RPalette(RWs &aWs);
-	IMPORT_C void Close();
-	IMPORT_C void Destroy();
-	IMPORT_C void Clear();
-	IMPORT_C void SetEntry(TInt aPaletteIndex,TRgb aPaletteEntry);
-	IMPORT_C void SetBlock(TInt aStartIndex,TInt aNumberOfEntries,TPtr8 &aBufferOfEntries);
-	IMPORT_C TRgb GetEntry(TInt aPaletteIndex) const;
-	IMPORT_C void GetBlock(TInt aStartIndex,TInt aNumberOfEntries,TPtr8 &aBuffer) const;
-	IMPORT_C TInt Entries() const;
-	IMPORT_C TUint Handle()const;
-	};
-
-class RGc : public RGdiBase
-	{
-	IMPORT_C RGc();
-	IMPORT_C RGc(RWs &aWs);
-	IMPORT_C void Close();
-	IMPORT_C void Destroy();
-	IMPORT_C TInt Construct();
-	IMPORT_C void Activate(const RDrawBase &aDrawable);
-	IMPORT_C void Deactivate();
-	IMPORT_C void FillRect(const TRect &aRect);
-	IMPORT_C void PrintText(const TPoint &aPosition,const TDesC &aString);
-	IMPORT_C void PrintText(const TDesC &aString);
-	IMPORT_C void SetPenGrey4(TUint aGrey4);
-	IMPORT_C void SetPenGrey16(TUint aGrey16);
-	IMPORT_C void SetPenGrey256(TUint aGrey256);
-	IMPORT_C void Clear();
-	IMPORT_C void CopyRect(const TPoint &anOffset,const TRect &aRect);
-	IMPORT_C void DrawEllipse(const TRect &aRect);
-	IMPORT_C void DrawRect(const TRect &aRect);
-	IMPORT_C void ClearRect(const TRect &aRect);
-	IMPORT_C void FillEllipse(const TRect &aRect);
-	IMPORT_C void PaintEllipse(const TRect &aRect);
-	IMPORT_C void ClearEllipse(const TRect &aRect);
-	IMPORT_C void PaintRect(const TRect &aRect);
-	IMPORT_C void GdiBlt(const RDrawBase &aDevice);
-	IMPORT_C void GdiBlt(const TPoint &aDestination,const RDrawBase &aDevice);
-	IMPORT_C void GdiBlt(const TPoint &aDestination,const RDrawBase &aDevice,const TRect &aSource);
-	IMPORT_C TInt DisplayMode()const;
-	IMPORT_C TGdiDrawMode DrawMode()const;
-//	IMPORT_C TUint DisplayModesAvailable()const;
-	IMPORT_C TRgb Pixel(const TPoint &aPixel)const;
-	IMPORT_C TSize Size()const;
-	IMPORT_C RBrushBase *PatternBrush()const;
-	IMPORT_C TRgb PenColour()const;
-	IMPORT_C TRgb BrushColour()const;
-	IMPORT_C TTextBackGround TextBackGround()const;
-	IMPORT_C void Plot(const TPoint &aPoint);
-	IMPORT_C void SetBrushGrey4(TUint aGrey4);
-	IMPORT_C void SetBrushGrey16(TUint aGrey16);
-	IMPORT_C void SetBrushGrey256(TUint aGrey256);
-	IMPORT_C void SetPenColour(const TRgb &aColour);
-	IMPORT_C void SetBrushColour(const TRgb &aColour);
-	IMPORT_C TInt SetDisplayMode(TUint aDisplayMode);
-	IMPORT_C void SetDrawMode(TGdiDrawMode aDrawingMode);
-	IMPORT_C void SetLineWidth(TInt aWidth);
-	IMPORT_C void SetPatternBrushOrigin(const TPoint &aOrigin);
-	IMPORT_C void SetTextBackGround(TTextBackGround aBackGroundSetting);
-	IMPORT_C RFont Font()const;
-	IMPORT_C void UseFont(const RFontBase &aFont);
-	IMPORT_C void UsePalette(const RPaletteBase &aPalette);
-	IMPORT_C void UsePatternBrush(const RBrushBase &aBrush);
-	IMPORT_C void DiscardFont();
-	IMPORT_C void DiscardPalette();
-	IMPORT_C void DiscardPatternBrush();
-	IMPORT_C TUint Handle() const;
-	IMPORT_C TInt LoadBitmap(const TDesC &aFileName, RFs &aFileSys);
-	IMPORT_C TInt LoadBitmapDI(const TDesC &aFileName,RFs &aFileSys);
-	IMPORT_C TGdiAttributes Attributes()const;
-	IMPORT_C void RefreshPalette();
-	}
Binary file windowing/windowserver/tauto/BLUEHASH.PBM has changed
--- a/windowing/windowserver/tauto/DLLDRAW.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,144 +0,0 @@
-// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Lots of different Drawing Commands
-// 
-//
-
-	gc->SetBrushColor(TRgb::Gray4(2));
-	gc->Clear();
-	gc->SetBrushColor(TRgb::Gray4(0));
-	gc->Clear(TRect(2,2,20,5));
-	gc->DrawRect(TRect(size));
-	gc->SetBrushOrigin(TPoint(1,2));
-	gc->SetBrushStyle(CGraphicsContext::EForwardDiagonalHatchBrush);
-	gc->DrawRect(TRect(30,2,60,8));
-	gc->SetBrushOrigin(TPoint(0,0));
-	gc->UseBrushPattern(aBitmap);
-	gc->SetBrushStyle(CGraphicsContext::EPatternedBrush);
-	gc->DrawRect(TRect(60,2,90,8));
-	gc->SetBrushStyle(CGraphicsContext::ENullBrush);
-	gc->DiscardBrushPattern();
-//
-	gc->SetPenColor(TRgb::Gray4(1));
-	gc->DrawLine(TPoint(10,12),TPoint(22,20));
-	gc->SetPenSize(TSize(4,2));
-	gc->DrawLine(TPoint(22,10),TPoint(40,20));
-	gc->SetPenStyle(CGraphicsContext::EDottedPen);
-	gc->SetPenSize(TSize(1,1));
-	gc->SetPenColor(TRgb::Gray4(0));
-	gc->DrawLine(TPoint(40,11),TPoint(60,20));
-	gc->SetPenStyle(CGraphicsContext::ESolidPen);
-	gc->Plot(TPoint(60,10));
-//
-	gc->BitBlt(TPoint(size.AsPoint()-TPoint(20,20)),aBitmap);
-	gc->BitBlt(TPoint(10,30),aBitmap,TRect(0,1,8,9));
-	gc->BitBltMasked(TPoint(10,40),aBitmap,TRect(1,2,8,9),aMaskBitmap,ETrue);
-	gc->BitBltMasked(TPoint(20,40),aBitmap,TRect(0,0,9,9),aMaskBitmap,EFalse);
- 	gc->SetOrigin(TPoint(5,50));
-	gc->SetDrawMode(CGraphicsContext::EDrawModeXOR);
-	gc->SetPenColor(TRgb::Gray4(3));
- 	gc->SetClippingRect(TRect(0,0,20,15));
-	//gc->DrawArc(TRect(0,0,20,15),TPoint(10,0),TPoint(1,8));
- 	gc->CancelClippingRect();
-	gc->SetDrawMode(CGraphicsContext::EDrawModePEN);
-	gc->SetPenColor(TRgb::Gray4(0));
-	gc->MoveTo(TPoint(25,0));
-	gc->DrawLineTo(TPoint(40,5));
-	gc->DrawLineBy(TPoint(-20,10));
-//
-	CArrayFixFlat<TPoint>* polyLineArray=new(ELeave) CArrayFixFlat<TPoint>(4);
-	CleanupStack::PushL(polyLineArray);
-	polyLineArray->AppendL(TPoint(8,0));
-	polyLineArray->AppendL(TPoint(16,10));
-	polyLineArray->AppendL(TPoint(0,3));
-	polyLineArray->AppendL(TPoint(16,3));
-	polyLineArray->AppendL(TPoint(0,10));
-	polyLineArray->AppendL(TPoint(8,0));
-	gc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	gc->SetOrigin(TPoint(50,50));
-	gc->DrawPolyLine(polyLineArray);
-	gc->SetOrigin(TPoint(75,50));
-	gc->DrawPolyLine(&(polyLineArray->At(0)),polyLineArray->Count());
-	polyLineArray->Delete(5);
-	gc->SetOrigin(TPoint(0,65));
-	gc->DrawPolygon(polyLineArray,CGraphicsContext::EWinding);
-	gc->SetOrigin(TPoint(25,65));
-	gc->DrawPolygon(&(polyLineArray->At(0)),polyLineArray->Count(),CGraphicsContext::EWinding);
-	gc->SetOrigin(TPoint(50,65));
-	gc->DrawPolygon(polyLineArray,CGraphicsContext::EAlternate);
-	gc->SetOrigin(TPoint(75,65));
-	gc->DrawPolygon(&(polyLineArray->At(0)),polyLineArray->Count(),CGraphicsContext::EAlternate);
-	CleanupStack::PopAndDestroy();
-	gc->SetBrushStyle(CGraphicsContext::ENullBrush);
-	gc->SetOrigin(TPoint(0,0));
-//
-	gc->DrawPie(TRect(5,80,30,100),TPoint(10,65),TPoint(35,80));
-	gc->DrawEllipse(TRect(35,80,60,100));
-	gc->DrawRoundRect(TRect(65,80,80,100),TSize(5,3));
-	gc->DrawBitmap(TRect(10,105,40,120),aBitmap);
-	gc->DrawBitmap(TRect(45,105,105,125),aBitmap,TRect(5,5,25,20));
-//gc->DrawBitmap(TRect(110,40,205,125),aBitmap,TRect(5,5,25,20));
-	if (aExtraDrawBitMap)
-		gc->DrawBitmap(TPoint(110,70),aBitmap);
-//
-	gc->UseFont(aFont);
-	TInt height=aFont->HeightInPixels();
-	TInt ascent=aFont->AscentInPixels();
-	TInt ypos=5;
-	TInt xpos=100;
-	gc->DrawText(_L("Test1"),TPoint(xpos,ypos+ascent));
-	gc->DrawText(_L("Test2"),TRect(xpos,ypos+height,xpos+50,5+height*2),ascent);
-	gc->DrawText(_L("Test3"),TRect(xpos,ypos+height*2,xpos+80,5+height*3),ascent,CGraphicsContext::ERight,10);
-//
-	ypos+=ascent+height*3;
-	gc->SetUnderlineStyle(EUnderlineOn);
-	gc->DrawText(_L("ULine"),TPoint(xpos,ypos));
-	gc->SetUnderlineStyle(EUnderlineOff);
-//
-	gc->SetStrikethroughStyle(EStrikethroughOn);
-	gc->DrawText(_L("Strike"),TPoint(xpos+50,ypos));
-	gc->SetStrikethroughStyle(EStrikethroughOff);
-	gc->SetCharJustification(15,3);
-	gc->DrawText(_L("abc"),TPoint(xpos+100,ypos));
-//
-	gc->SetWordJustification(10,1);
-	gc->DrawText(_L("Two Words"),TPoint(xpos+5,ypos+height));
-//
-	xpos = 80;
-	ypos = 40;
-	RRegion clipRegion(2);
-//
-	clipRegion.AddRect(TRect(xpos, ypos+10, xpos+30, ypos+20));
-	clipRegion.AddRect(TRect(xpos, ypos+30, xpos+30, ypos+40));
-	gc->SetClippingRegion(clipRegion);
-//
-	gc->DrawTextVertical(_L("Vertical Text"), TPoint(xpos+10, ypos+10), EFalse);
-	gc->DrawTextVertical(_L("Vertical Text Box"), TRect(xpos+40, ypos+10, xpos+60, ypos+100), 15, EFalse);
-//
-	gc->CancelClippingRegion();
-	clipRegion.Close();
-//
-	gc->AlphaBlendBitmaps(TPoint(xpos+60, ypos+100), aBitmap, TRect(0, 0, 20,20), aMaskBitmap, TPoint(0, 0));
-//
-	gc->SetPenColor(TRgb::Gray4(3));
-	gc->SetBrushColor(TRgb::Gray4(0));
-	gc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	xpos = 0;
-	ypos = 120;
-	TRect mapColorRect(xpos, ypos, xpos+20, ypos+20);
-	gc->DrawRect(mapColorRect);
-	TRgb colours[4] = { TRgb::Gray4(3), TRgb::Gray4(0), TRgb::Gray4(0), TRgb::Gray4(3) };
-	gc->MapColors(mapColorRect, colours, 2, ETrue);
-//
-	gc->DiscardFont();
Binary file windowing/windowserver/tauto/Dither.MBM has changed
Binary file windowing/windowserver/tauto/GREYLINE.PBM has changed
Binary file windowing/windowserver/tauto/MASK0.PBM has changed
Binary file windowing/windowserver/tauto/MASK1.PBM has changed
Binary file windowing/windowserver/tauto/MASK2.PBM has changed
--- a/windowing/windowserver/tauto/TALPHAWIN.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +0,0 @@
-
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TALPHAWIN_H__
-#define __TALPHAWIN_H__
-
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-class CTDrawOpWin;
-class CTAlphaWindow;
-class CTAlphaRefWin;
-
-class CTAlphaWin : public CTWsGraphicsBase
-	{
-public:
-	CTAlphaWin(CTestStep* aStep);
-	~CTAlphaWin();
-	void ConstructL();
-	void TestCondition();
-	void TestConditionL();
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	void ConfigureDisplayModes(TDisplayMode aRequiredMode);
-	// The blending test works as follows:
-	// On the left, we have a window which draws using an opaque half-red colour
-	// On the right, we have a window which blends using a semi-transparent full-red colour
-	// The test compares left and right
-	void TestSemiTransparentDrawingL();
-	void TestTransparentDrawingL();
-
-	// The transparent window tests work as follows:
-	// On the left, we have transparent windows, on which we perform various various operations
-	// On the right, we have a reference window, in which we draw what we think the windows on the left should look like
-	// The test compares the right and the left
-	void TestInitialConfiguration();
-	void TestMove();
-	void TestRedraw();
-	void TestInvisible();
-	void TestChildrenL();
-	void TestAntiAliasedTextTransparentL();
-	void CheckRectL(const TRect& rect1, const TRect& rect2, TSize aSize, TDisplayMode aRequiredMode, TInt aTolerance, const TDesC& aErrorMsg);
-
-private:
-	TFixedArray<CTAlphaWindow*,5> iTestWin;
-	CTAlphaRefWin* iRefWin;
-	};
-
-class CTDrawOpWin : public CTWin
-	{
-public:
-	static CTDrawOpWin* NewL(CTAlphaWin* aTest, CTWinBase* aParent, TPoint aPos, TSize aSize, TRgb aDrawColour);
-	CTDrawOpWin(CTAlphaWin* aTest, TRgb aDrawColour);
-
-	//Virtual Function from CTBaseWin
-	void Draw();
-
-	void SetDrawOp(TInt aDrawOp);
-private:
-	CTAlphaWin* iTest;
-	TRgb iDrawColour;
-	TInt iDrawOp;
-	};
-
-
-class CTAlphaWindow : public CTWin
-	{
-	friend class CTAlphaRefWin;
-public:
-	inline CTAlphaWindow(CTAlphaWin* aTest) : iTest(aTest) {}
-	~CTAlphaWindow();
-	static CTAlphaWindow* NewL(CTAlphaWin* aTest, CTWinBase* aParent, TPoint aPos, TSize aSize, TInt aDrawState);
-
-	//Virtual Function from CTBaseWin
-	void Draw();
-
-	void SetDrawState(TInt aDrawState);
-	TInt DrawState();
-
-	void SetVisible(TBool aVisible);
-	void CreateChildrenL(TInt aDepth);
-	void DestroyChildren();
-private:
-	TInt iDrawState;
-	CTAlphaWin* iTest;
-	CTAlphaWindow* iChild1;
-	CTAlphaWindow* iChild2;
-	};
-
-class CTAlphaRefWin : public CTWin
-	{
-	// This class is used to draw what we think things should look like, for comparison with what they actually look like
-public:
-	inline CTAlphaRefWin(TFixedArray<CTAlphaWindow*,5>& aAlphaWin);
-	static CTAlphaRefWin* NewL(CTWinBase* aParent, TPoint aPos, TSize aSize, TFixedArray<CTAlphaWindow*,5>& aAlphaWin);
-	void Draw();
-private:
-	void DrawWindow(CTAlphaWindow* aWindow, TPoint aOffset);
-private:
-	TFixedArray<CTAlphaWindow*,5>& iAlphaWin;
-	};
-
-class CTAlphaWinStep : public CTGraphicsStep
-	{
-public:
-	CTAlphaWinStep();
-protected:
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTAlphaWinStep,"TAlphaWin");
-
-
-#endif
--- a/windowing/windowserver/tauto/TAUTO.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Generated by BitmapCompiler
-// 
-//
-
-enum TMbmTauto
-	{
-	EMbmTautoBluehash,
-	EMbmTautoGreyline,
-	EMbmTautoMask0,
-	EMbmTautoMask1,
-	EMbmTautoMask2
-	};
--- a/windowing/windowserver/tauto/TAUTODLL.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2945 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Client side of AUTODLL test code
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TAUTODLL.H"
-#include "TEVENT.H"
-
-//#define LOGGING
-
-//
-
-
-CGraphicsContext::TDrawMode CAnimWindow::iEllipseDrawMode;
-
-CTAnimDll::CTAnimDll(CTestStep* aStep) : CTWsGraphicsBase(aStep)
-	{
-	}
-
-RTestAnim::RTestAnim() : RAnim()
-	{
-	}
-
-RTestAnim::RTestAnim(RAnimDll &aDll) : RAnim(aDll)
-	{
-	}
-
-LOCAL_C TInt DoPanicTest(TInt aInt, TAny *aScreenNumber)
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-
-	// assign to the correct screen
-	CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws);
-	User::LeaveIfError(screen->Construct((TInt)aScreenNumber));
-
-	RWindowGroup group(ws);
-	User::LeaveIfError(group.Construct(333));
-	group.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
-	RAnimDll animDll=RAnimDll(ws);
-	User::LeaveIfError(animDll.Load(KAnimDLLName));
-	RTestAnim panic(animDll);
-	RWindow window(ws);
-	RBlankWindow blankwin(ws);
-	if (aInt==16 || aInt==17)	// Use a blank window for this one
-		{
-		User::LeaveIfError(blankwin.Construct(group,123));
-		blankwin.SetSize(TSize(10,10));
-		blankwin.Activate();
-		User::LeaveIfError(panic.Construct(blankwin,EAnimTypeTest1,TPtrC8()));
-		}
-	else
-		{
-		User::LeaveIfError(window.Construct(group,123));
-		window.SetSize(TSize(10,10));
-		window.Activate();
-		window.BeginRedraw();
-		window.EndRedraw();
-		if (aInt==0)
-			User::LeaveIfError(panic.Construct(window,EAnimTypeTest2,TPtrC8()));
-		User::LeaveIfError(panic.Construct(window,EAnimTypeTest1,TPtrC8()));
-		}
-	TPckgBuf<TPoint> dummyParam;
-	switch(aInt)
-		{
-		case 1:
-			panic.Command(EADllPanicCallPanic);
-			break;
-		case 2:
-			panic.Command(EADllPanicCallPanic,dummyParam);
-			break;
-		case 3:
-			panic.CommandReply(EADllPanicCallPanic);
-			break;
-		case 4:
-			panic.CommandReply(EADllPanicCallPanic,dummyParam);
-			break;
-		case 5:
-			panic.Command(EADllPanicSetInterval);
-			break;
-		case 6:
-			panic.Command(EADllPanicSetNextInterval);
-			break;
-		case 7:
-			panic.CommandReply(EADllPanicBadFont);
-			break;
-		case 8:
-			panic.CommandReply(EADllPanicBadBitmap);
-			break;
-		case 9:
-			panic.Command(EADllPanicLeave);
-			break;
-		case 10:
-			panic.Command(EADllPanicDoubleActivateGC);
-			break;
-		case 11:
-			panic.Command(EADllPanicDrawRectWithNoGc);
-			break;
-		case 12:
-			panic.Command(EADllPanicDrawTextWithNoFont);
-			break;
-		case 13:
-			panic.Command(EADllPanicLeaveInAnimate);
-			ws.Finish();
-			panic.CommandReply(EADllBlankOpCode);
-			break;
-		case 14:
-			panic.Command(EADllPanicLeaveInRedraw);
-			window.BeginRedraw();
-			window.EndRedraw();
-			ws.Finish();
-			panic.CommandReply(EADllBlankOpCode);
-			break;
-		case 15:
-			ws.TestWrite(animDll.WsHandle(),999,NULL,0);
-			break;
-		case 16:
-			panic.Command(EADllPanicSetVisWithGcActive);
-			break;
-		case 17:
-			panic.CommandReply(EADllPanicSetVisWithGcActiveReply);
-			break;
-		case 18:
-			panic.Command(EADllPanicLeaveInActiveCallback);
-			ws.Flush();
-			User::After(2000000);
-			panic.CommandReply(EADllBlankOpCode);
-			break;
-		case 19:
-			panic.Command(EADllPanicSetClippingRectWithNoGc);
-			break;
-		case 20:
-			panic.CommandReply(EADllPanicSetClippingRegionWithNoGc);
-			break;
-		case 21:
-			panic.Command(EADllPanicCancelClippingRegionWithNoGc);
-			break;
-		case 22:
-			panic.Command(EADllPanicCancelClippingRectWithNoGc);
-			break;
-		case 23:
-			panic.Command(EADllPanicSetDrawModeWithNoGc);
-			break;
-		case 24:
-			panic.Command(EADllPanicUseFontWithNoGc);
-			break;
-		case 25:
-			panic.Command(EADllPanicDiscardFontWithNoGc);
-			break;
-		case 26:
-			panic.Command(EADllPanicSetUnderlineStyleWithNoGc);
-			break;
-		case 27:
-			panic.Command(EADllPanicSetStrikeThoughStyleWithNoGc);
-			break;
-		case 28:
-			panic.Command(EADllPanicSetWordJustificationWithNoGc);
-			break;
-		case 29:
-			panic.Command(EADllPanicSetCharJustificationWithNoGc);
-			break;
-		case 30:
-			panic.Command(EADllPanicSetPenColorWithNoGc);
-			break;
-		case 31:
-			panic.Command(EADllPanicSetPenStyleWithNoGc);
-			break;
-		case 32:
-			panic.Command(EADllPanicSetPenSizeWithNoGc);
-			break;
-		case 33:
-			panic.Command(EADllPanicSetBrushColorWithNoGc);
-			break;
-		case 34:
-			panic.Command(EADllPanicSetBrushStyleWithNoGc);
-			break;
-		case 35:
-			panic.Command(EADllPanicSetBrushOriginWithNoGc);
-			break;
-		case 36:
-			panic.Command(EADllPanicUseBrushPatterWithNoGc);
-			break;
-		case 37:
-			panic.Command(EADllPanicDiscardBrushPatternWithNoGc);
-			break;
-		case 38:
-			panic.Command(EADllPanicSetFadedWithNoGc);
-			break;
-		case 39:
-			panic.Command(EADllPanicSetFadingParametersWithNoGc);
-			break;
-		case 40:
-			panic.Command(EADllPanicDrawArcWithNoGc);
-			break;
-		case 41:
-			panic.Command(EADllPanicDrawPieWithNoGc);
-			break;
-		case 42:
-			panic.Command(EADllPanicDrawLineWithNoGc);
-			break;
-		case 43:
-			panic.Command(EADllPanicDrawLineToWithNoGc);
-			break;
-		case 44:
-			panic.Command(EADllPanicDrawLineByWithNoGc);
-			break;
-		case 45:
-			panic.Command(EADllPanicDrawEllipseWithNoGc);
-			break;
-		case 46:
-			panic.Command(EADllPanicDrawRoundedRecWithNoGc);
-			break;
-		case 47:
-			panic.Command(EADllPanicClearWithRectWithNoGc);
-			break;
-		case 48:
-			panic.Command(EADllPanicClearWithNoGc);
-			break;
-		case 49:
-			panic.Command(EADllPanicBitBltWithNoGc);
-			break;
-		case 50:
-			panic.Command(EADllPanicBitBltWithRectWithNoGc);
-			break;
-		case 51:
-			panic.Command(EADllPanicBitBltMaskedWithNoGc);
-			break;
-		case 52:
-			panic.Command(EADllPanicDrawBitmapPointWithNoGc);
-			break;
-		case 53:
-			panic.Command(EADllPanicDrawBitmapWithNoGc);
-			break;
-		case 54:
-			panic.Command(EADllPanicDrawBitmapRectWithNoGc);
-			break;
-		case 55:
-			panic.Command(EADllPanicDrawBitmapMaskedFbsBitmapWithNoGc);
-			break;
-		case 56:
-			panic.Command(EADllPanicDrawBitmapMaskedWsBitmapWithNoGc);
-			break;
-		case 57:
-			panic.Command(EADllPanicDrawPolyLinePointsWithNoGc);
-			break;
-		case 58:
-			panic.Command(EADllPanicDrawPolyLineArrayWithNoGc);
-			break;
-		case 59:
-			panic.CommandReply(EADllPanicDrawPolygonPointsWithNoGc);
-			break;
-		case 60:
-			panic.CommandReply(EADllPanicDrawPolygonArrayWithNoGc);
-			break;
-		case 61:
-			panic.Command(EADllPanicMoveToWithNoGc);
-			break;
-		case 62:
-			panic.Command(EADllPanicMoveByWithNoGc);
-			break;
-		case 63:
-			panic.Command(EADllPanicPlotWithNoGc);
-			break;
-		case 64:
-			panic.Command(EADllPanicSetOriginWithNoGc);
-			break;
-		case 65:
-			panic.Command(EADllPanicCopyRectWithNoGc);
-			break;
-		case 66:
-			panic.Command(EADllPanicResetWithNoGc);
-			break;
-		case 67:
-			panic.CommandReply(EADllPanicAlphaBlendingBitmapsFbsBitmapWithNoGc);
-			break;
-		case 68:
-			panic.Command(EADllPanicMapColorsWithNoGc);
-			break;
-		case 69:
-			panic.Command(EADllPanicDrawTextWithRectWithNoFont);
-			break;
-		case 70:
-			panic.Command(EADllPanicDrawTextVerticalWithNoFont);
-			break;
-		case 71:
-			panic.Command(EADllPanicDrawTextVerticalWithRectWithNoFont);
-			break;
-		case 72:
-			panic.CommandReply(EADllPanicDevice);
-			break;
-		case 73:
-			panic.Command(EADllPanicInvalidFocusScreenTooBig);
-			break;
-		case 74:
-			panic.Command(EADllPanicInvalidFocusScreenNegative);
-			break;
-		default:
-			return(EWsExitReasonFinished);
-		}
-
-	ws.Flush();
-	return(EWsExitReasonBad);
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0125
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Panic tests
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     The test creates an animation and animation's client threads.
-					Each thread calls some
-					command of the animation which is expected to panic on certain reason.
-					The test checks that those client threads will panic returning
-					a proper panic code. Client threads are created and tested for
-					the following actions:
-					1. A Command() call to an animation which executes
-					iFunctions->Panic() method. Client thread must panic with
-					code EWservPanicAnimDll.
-					2. A Command() call with dummy parameter to an animation which
-					executes iFunctions->Panic() method. Client thread must panic
-					with code EWservPanicAnimDll.
-					3. A CommandReply() call to an animation which executes
-					iFunctions->Panic() method. Client thread must panic with code
-					EWservPanicAnimDll.
-					4. A CommandReply() call with dummy parameter to an animation
-					which executes iFunctions->Panic() method. Client thread must
-					panic with code EWservPanicAnimDll.
-					5. A command that calls MAnimGeneralFunctions::SetInterval() when
-					the synchronisation mode is not TAnimSync::ESyncNone. Client
-					thread must panic with code EWservPanicAnimDll.
-					6. A command that calls MAnimGeneralFunctions::SetNextInterval()
-					when the synchronisation mode is not TAnimSync::ESyncNone. Client
-					thread must panic with code EWservPanicAnimDll.
-					7. A command that calls MAnimGeneralFunctions::DuplicateFontL() to
-					duplicate undefined font. Client thread must panic with code
-					EWservPanicFont.
-					8. A command that calls MAnimGeneralFunctions::DuplicateBitmapL()
-					to duplicate undefined bitmap. Client thread must panic with code
-					EWservPanicBitmap.
-					9. A command that calls User::Leave(KErrGeneral). Client thread
-					must panic with code EWservPanicAnimLeave.
-					10. A command that activates window animation's graphical context
-					twice. Client thread must panic with code EWservPanicAnimDll.
-					11. A command that tries to draw a rectangle while graphical
-					context is not defined yet. Client thread must panic with code
-					EWservPanicAnimLeave.
-					12. A command that tries to draw a text whihout a font defined yet.
-					Client thread must panic with code EWservPanicNoFont.
-					13. A command that causes an animation to leave during execution
-					of CAnim::Animate() method; and a new command call 4 seconds after
-					that. Client thread must panic with code EWservPanicAnimLeave.
-					14. A command that causes an animation to leave during execution
-					of CAnim::Redraw() method. The client thread initiates it's window
-					redraw after that. Client thread must panic with code
-					EWservPanicAnimLeave.
-					15. The client thread calls RWsSession::TestWrite() on animation
-					DLL server-side handle with opcode 999. Client thread must panic with code
-					EWservPanicOpcode.
-					16. A command that activates graphical context and sets the
-					window to invisible and then to visible. Client thread must panic
-					with code EWservPanicAnimDll.
-
-
-@SYMTestExpectedResults See test actions.
-*/
-void CTAnimDll::TestPanicsL()
-	{
-	TInt index=0;
-	TBool finishTests=EFalse;
-	do
-		{
-
-
-		TClientPanic panicCode=EWservPanicAnimDll;
-		switch(index)
-			{
-			// panic the server with a KERN-4. When server fixed these this can be removed.
-			case 19:
-			case 20:
-			case 22:
-			case 24:
-				goto bypasstest;
-
-			case 0:
-			case 1:
-			case 2:
-			case 3:
-			case 4:
-			case 5:
-			case 6:
-			case 10:
-			case 16:
-			case 17:
-			case 18:
-			case 73:
-			case 74:
-				panicCode=EWservPanicAnimDll;
-				break;
-			case 7:
-				panicCode=EWservPanicFont;
-				break;
-			case 8:
-				panicCode=EWservPanicBitmap;
-				break;
-			case 12:
-			case 69:
-			case 70:
-			case 71:
-				panicCode=EWservPanicNoFont;
-				break;
-			case 15:
-				panicCode=EWservPanicOpcode;
-				break;
-			case 9:
-			case 11:
-			case 13:
-			case 14:
-			case 72:
-			default: // cases 19 - 68
-				panicCode=EWservPanicAnimLeave;
-				break;
-			}
-			
-		TEST(iTest->TestWsPanicL(&DoPanicTest,panicCode,index,(TAny*)iTest->iScreenNumber,&finishTests));
-bypasstest:
-		if (iTest->iScreenNumber == 0)
-			iTest->CloseAllPanicWindows();
-		index++;
-		} while(!finishTests);
-	}
-
-void CTAnimDll::TestSyncModes(MAnimGeneralFunctions::TAnimSync aSyncMode)
-	{
-	RTestAnim anim=RTestAnim(iAnimDll);
-	User::LeaveIfError(anim.Construct(*iTestWin->BaseWin(),EAnimTypeTest1,TPtrC8()));
-	CleanupClosePushL(anim);
-
-	TPckgBuf<TSyncTests> params;
-	TRequestStatus status(KRequestPending);
-	params().status=&status;
-	params().syncMode=aSyncMode;
-	anim.CommandReply(EADllSyncTests,params);
-	User::WaitForRequest(status);
-	TEST(status==KErrNone);
-
-	CleanupStack::PopAndDestroy(&anim);
-	}
-
-void CTAnimDll::TestTimeChange()
-	{
-	RTestAnim anim=RTestAnim(iAnimDll);
-	User::LeaveIfError(anim.Construct(*iTestWin->BaseWin(),EAnimTypeTest1,TPtrC8()));
-	CleanupClosePushL(anim);
-
-	TPckgBuf<TTimeChangeTest> params;
-	TRequestStatus status(KRequestPending);
-	TRequestStatus status2(KRequestPending);
-	params().status=&status;
-	params().status2=&status2;
-	anim.CommandReply(EADllTimeChangedTest,params);
-	User::WaitForRequest(status);
-	TTime time;
-	time.HomeTime();
-	time+=TTimeIntervalHours(1);
-	User::SetHomeTime(time);
-	User::WaitForRequest(status2);
-	time.HomeTime();
-	time-=TTimeIntervalHours(1);
-	User::SetHomeTime(time);
-	TEST(status2==KErrNone);
-
-	CleanupStack::PopAndDestroy(&anim);
-	}
-
-void CTAnimDll::ConstructL()
-	{
-	TheClient->iGroup->WinTreeNode()->SetOrdinalPosition(0);
-	iRedrawWin=new(ELeave) CAnimWindow(EFalse, CAnimWindow::ERedraw);
-	iBackedUpTestWin=new(ELeave) CAnimWindow(EFalse, CAnimWindow::EBackedUp);
-	iBlankTestWin=new(ELeave) CAnimWindow(EFalse, CAnimWindow::EBlank);
-	iBaseWin=new(ELeave) CAnimWindow(ETrue, CAnimWindow::ERedraw);
-
-//
-	TSize screenSize=TheClient->iGroup->Size();
-	TInt winWidth=(screenSize.iWidth/3)-10;
-	TInt winHeight=screenSize.iHeight-10;
-	iBaseWin->ConstructL(TPoint(screenSize.iWidth/3+5,5),TSize(winWidth,winHeight));
-	iBlankTestWin->ConstructL(TPoint(screenSize.iWidth/3*2+5,5),TSize(winWidth,winHeight));
-	((RBlankWindow *)iBlankTestWin->BaseWin())->SetColor(TRgb::Gray4(2));
-	iBackedUpTestWin->ConstructL(TPoint(screenSize.iWidth/3*2+5,5),TSize(winWidth,winHeight));
-	iRedrawWin->ConstructL(TPoint(screenSize.iWidth/3*2+5,5),TSize(winWidth,winHeight));
-//
-	iTestWin=iRedrawWin;
-//
-	iAnimDll=RAnimDll(TheClient->iWs);
-	TInt retVal = iAnimDll.Load(KAnimDLLName);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("iAnimDll.Load(KAnimDLLName) return value - Expected: %d , Actual: %d"), KErrNone, retVal);
-	}
-
-CTAnimDll::~CTAnimDll()
-	{
-	iAnimDll.Close();
-	delete iBackedUpTestWin;
-	delete iBlankTestWin;
-	delete iRedrawWin;
-	delete iBaseWin;
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0126
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Miscellaneous animation tests.
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Tests window animation's window funtions like WindowSize(),
-					IsHidden(), SetVisible().
-					Tests RAnimDll's constructor, Close(), Load() and copy-constructor.
-
-@SYMTestExpectedResults Expects window funtions and RAnimDll's methods work properly.
-*/
-void CTAnimDll::Misc()
-	{
-	RTestAnim anim=RTestAnim(iAnimDll);
-	User::LeaveIfError(anim.Construct(*iTestWin->BaseWin(),EAnimTypeTest1,TPtrC8()));
-	CleanupClosePushL(anim);
-
-	TPckgBuf<TSize> params;
-	params()=iTestWin->Size();
-	TBool retBool = anim.CommandReply(EADllTestWindowSize,params);
-	TEST(retBool);
-	if (!retBool)
-		INFO_PRINTF3(_L("anim.CommandReply(EADllTestWindowSize,params) return value - Expected: %d , Actual: %d"), ETrue, retBool);
-	TheClient->iWs.Finish();
-	retBool = anim.CommandReply(EADllTestSetVisible);
-	TEST(retBool);
-	if (!retBool)
-		INFO_PRINTF3(_L("anim.CommandReply(EADllTestSetVisible) return value - Expected: %d , Actual: %d"), ETrue, retBool);
-	CleanupStack::PopAndDestroy(&anim);
-
-	RAnimDll closeme(TheClient->iWs);
-	closeme.Close();
-	RAnimDll animdll(TheClient->iWs);
-	TInt retVal = animdll.Load(KAnimDLLName);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("animdll.Load(KAnimDLLName) return value - Expected: %d , Actual: %d"), KErrNone, retVal);
-
-	RTestAnim anim2(animdll);
-	anim2.Close();
-	animdll.Close();
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0127
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test animation's command call with reply
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Puts an array containing a sequnce of numbers into a command argument.
-					Performs command call to server, assuming that the server-side
-					should return a sum of the numbers in sequence.
-
-@SYMTestExpectedResults Checks that server returns the correct sum.
-*/
-void CTAnimDll::RemoteBuffer()
-	{
-	RTestAnim anim=RTestAnim(iAnimDll);
-	User::LeaveIfError(anim.Construct(*iTestWin->BaseWin(),EAnimTypeTest1,TPtrC8()));
-	CleanupClosePushL(anim);
-
-	TBuf<ERemoteBufSize> buf(ERemoteBufSize);
-	TInt total=0;
-	for (TInt8 index=0;index<ERemoteBufSize;index++)
-		{
-		total+=index;
-		buf[index]=index;
-		}
-	TIpcArgs ipcArgs;
-	ipcArgs.Set(KIpcSlot,&buf);
- 	TInt retVal = anim.CommandReply(EADllReadRemoteDescriptor,KNullDesC8,ipcArgs);
-	TEST(retVal==total);
-	if (retVal!=total)
-		INFO_PRINTF3(_L("anim.CommandReply(EADllReadRemoteDescriptor,KNullDesC8,ipcArgs) return value - Expected: %d , Actual: %d"), total, retVal);
-
-	CleanupStack::PopAndDestroy(&anim);
-	}
-//
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0128
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    RAnimDll extracopy test
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates another RAnimDll instance for a dll that already has a client-side interface.
-
-@SYMTestExpectedResults Expects that operation completes without errors.
-*/
-void CTAnimDll::ExtraCopyTest()
-	{
-	RAnimDll extraCopy(TheClient->iWs);
-	TInt retVal = extraCopy.Load(KAnimDLLName);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("extraCopy.Load(KAnimDLLName) return value - Expected: %d , Actual: %d"), KErrNone, retVal);
-
-	extraCopy.Close();
-	}
-//
-void CTAnimDll::SyncMode1()
-	{
-	TestSyncModes(MAnimGeneralFunctions::ESyncSecond);
-	}
-
-void CTAnimDll::CheckWindows()
-	{
-	CheckRect(iBaseWin->CtBaseWin(),iTestWin->CtBaseWin(),TRect(iBaseWin->Size()),_L("CTAnimDll::CheckWindows() failed"));
-	}
-
-void CTAnimDll::InvalidatePauseAndRedraw(const TRect &aRect,TTimeIntervalMicroSeconds32 aInterval)
-	{
-	iTestWin->Invalidate(aRect);
-	TheClient->iWs.Flush();
-	User::After(aInterval);
-	__ASSERT_DEBUG(iTestWin->iWinType==CAnimWindow::ERedraw,AutoPanic(EAutoPanicWindowType));
-	RWindow *win=(RWindow *)iTestWin->BaseWin();
-	win->BeginRedraw();
-	iTestWin->DoDraw();
-	win->EndRedraw();
-	TheClient->iWs.Flush();
-	}
-
-void CTAnimDll::RedrawAndCheckWindows(TBool aBlankIt)
-	{
-	if (iTestWin->iWinType==CAnimWindow::ERedraw)
-		{
-		RWindow *win=(RWindow *)iTestWin->BaseWin();
-		win->BeginRedraw();
-		iTestWin->DoDraw(aBlankIt);
-		win->EndRedraw();
-		}
-	RWindow *win=(RWindow *)iBaseWin->BaseWin();
-	win->BeginRedraw();
-	iBaseWin->DoDraw(aBlankIt);
-	win->EndRedraw();
-	TheClient->WaitForRedrawsToFinish();
-	CheckWindows();
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0129
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Animation drawing test
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Performs animation drawing ontop of redrawable window, backed-up window and blank window.
-					Draws the same shapes using directly window graphics on an other window (base window).
-					The following shapes are drawn:
-					1. An animation with a small ellipse drawn in XOR mode on top of redrawable
-					black-lined gray window.
-					2. The same with a bigger ellipse but previously invalidating an
-					area which intersects the old ellipse and the new ellipse.
-					3. Runs an animation that continuously moves a rectangle and shrinks another on top of
-					redrawable black-lined gray window and then cancels an animation.
-					The test checks that the window will be identical with the gray base window
-					that contains only black lines.
-					4. An animation with a small ellipse drawn in XOR mode on top of backed-up
-					black-lined gray window. The test also calls Invalidate() method and performs
-					a check again to make sure that the test-window and base window are identical.
-					5. An animation with a small ellipse drawn in XOR mode on top of the blank
-					gray window. The test also sends commands to the animation that call windows
-					SetVisible(EFalse) and SetVisible(ETrue) and checks that the
-					test-window and base window are identical.
-
-
-@SYMTestExpectedResults Each time performs pixelwise comparisons of animated windows
-					and the base window expecting the windows to be identical.
-*/
-void CTAnimDll::DrawingTestL()
-	{
-	// draws a little circle on the base window using window graphics and using window animation on the test window.
-	RTestAnim drawAnim=RTestAnim(iAnimDll);
-//
-	TRect rect;
-	TPckgBuf<TRect> rectPckg;
-	TPckgBuf<TBool> boolPckg;
-
-//
-	_LIT(KLog1,"Draw Ellipse Test1");
-	LOG_MESSAGE(KLog1);
-	rect = TRect(10,10,50,50);
-	CAnimWindow::SetEllipseDrawMode(CGraphicsContext::EDrawModeXOR);
-	iTestWin->Invalidate();
-	iTestWin->SetRect(rect);
-	iBaseWin->Invalidate();
-	iBaseWin->SetRect(rect);
-	rectPckg()=rect;
-	User::LeaveIfError(drawAnim.Construct(*iTestWin->BaseWin(),EAnimTypeTest3,rectPckg));
-	RedrawAndCheckWindows();
-//
-	_LIT(KLog2,"Draw Ellipse Test2");
-	LOG_MESSAGE(KLog2);
-	iTestWin->Invalidate(TRect(20,20,100,40));
-	iBaseWin->Invalidate(TRect(20,20,100,40));
-	iBaseWin->DoDrawEllipse();	// Should clear old Ellipse (except invalid bits)
-	rect=TRect(30,30,200,100);
-	rectPckg()=rect;
-	iBaseWin->SetRect(rect);
-	iBaseWin->DoDrawEllipse();	// Should draw new Ellipse (except invalid bits)
-	drawAnim.Command(EADllSetRect,rectPckg);
-	RedrawAndCheckWindows();
-	iBaseWin->DoDrawEllipse();	// Clear old ellipse
-//
-	_LIT(KLog3,"Window Overlap Anim Test");
-	LOG_MESSAGE(KLog3);
-
-	iBaseWin->SetRect(TRect());
-	iBaseWin->DoDraw();
-	TheClient->iWs.Finish();
-
-	// create another window on top and check that animation beneath is not visible	
-	TSize screenSize=TheClient->iGroup->Size();
-	TInt winWidth=(screenSize.iWidth/3)-10;
-	TInt winHeight=screenSize.iHeight-10;
-	TSize size=iTestWin->Size();
-	rectPckg()=TRect(size);
-	drawAnim.Command(EADllStartAnimate,rectPckg);
-
-	CAnimWindow *topWindow = new (ELeave) CAnimWindow(ETrue, CAnimWindow::ERedraw);
-	CleanupStack::PushL(topWindow);
-	topWindow->ConstructL(TPoint(screenSize.iWidth/3*2+5,5),TSize(winWidth,winHeight));
-	
-	RWindow *win=(RWindow *)iTestWin->BaseWin();
-	win->BeginRedraw();
-	topWindow->DoDraw(EFalse);
-	win->EndRedraw();
-	
-	TheClient->iWs.Flush();
-	for(TInt i=0;i<size.iWidth/2;i+=5)
-		InvalidatePauseAndRedraw(TRect(i,size.iHeight-i-i,i+i,size.iHeight-i),TTimeIntervalMicroSeconds32(400000));
-
-	TheClient->WaitForRedrawsToFinish();
-	CheckRect(iBaseWin->CtBaseWin(),iTestWin->CtBaseWin(),TRect(iBaseWin->Size()));
-	
-	win->BeginRedraw(rect);
-	drawAnim.Command(EADllCancelAnimate,rectPckg);
-	win->EndRedraw();
-
-	CleanupStack::PopAndDestroy(topWindow);
-//
-	iTestWin->BaseWin()->SetVisible(EFalse);
-	drawAnim.Close();
-//
-	_LIT(KLog4,"Draw Ellipse Test4&5");
-	LOG_MESSAGE(KLog4);
-	rect=TRect(20,20,50,50);
-	iBackedUpTestWin->SetRect(rect);
-	iBackedUpTestWin->DoDraw();
-	iBaseWin->SetRect(rect);
-	win->BeginRedraw();
-	iBaseWin->DoDraw();
-	win->EndRedraw();
-	TheClient->iWs.Finish();
-
-	rectPckg()=rect;
-	User::LeaveIfError(drawAnim.Construct(*iBackedUpTestWin->BaseWin(),EAnimTypeTest3,rectPckg));
-	TheClient->iWs.Finish();
-	TheClient->WaitForRedrawsToFinish();
-	CheckWindows();
-	iBackedUpTestWin->Invalidate();
-	TheClient->iWs.Flush();
-	TheClient->WaitForRedrawsToFinish();
-	CheckWindows();
-	iBackedUpTestWin->BaseWin()->SetVisible(EFalse);
-//
-	_LIT(KLog5,"Draw Ellipse Test6&7");
-	LOG_MESSAGE(KLog5);
-	rect=TRect(20,20,50,50);
-	TheClient->iWs.Flush();
-	RWindow *winBase=(RWindow *)iBaseWin->BaseWin();
-	winBase->BeginRedraw();
-	iBaseWin->SetRect(rect);
-	iBaseWin->DoDraw(ETrue);
-	winBase->EndRedraw();
-	rectPckg()=rect;
-	User::LeaveIfError(drawAnim.Construct(*iBlankTestWin->BaseWin(),EAnimTypeTest3,rectPckg));
-	TheClient->iWs.Flush();
-	iBlankTestWin->Invalidate();
-	TheClient->iWs.Flush();
-	TheClient->WaitForRedrawsToFinish();
-	CheckWindows();
-	boolPckg()=EFalse;
-	drawAnim.Command(EADllSetVisible,boolPckg);
-	TheClient->iWs.Flush();
-	boolPckg()=ETrue;
-	drawAnim.Command(EADllSetVisible,boolPckg);
-	TheClient->WaitForRedrawsToFinish();
-	CheckWindows();
-
-//This test does functional coverage by calling code that executes each of the 
-//server's class (CWsAnimGc) members in turn.
-
-
-	_LIT(KLog6,"Draw Primitives (Coverage) Test");
-	LOG_MESSAGE(KLog6);
-	rect = TRect(10,10,150,150);
-	iBaseWin->BaseWin()->SetVisible(ETrue);
-	iBaseWin->SetRect(TRect(0,0,0,0));
-	winBase->BeginRedraw();
-	iBaseWin->DoDraw();
-	iBaseWin->SetRect(rect);
-	iBaseWin->DoDrawCoverage();
-	winBase->EndRedraw();
-
-	iTestWin->BaseWin()->SetVisible(ETrue);
-	iTestWin->SetRect(rect);
-	win->BeginRedraw();
-	iTestWin->DoDraw();
-	win->EndRedraw();
-
-	rectPckg()=rect;
-	User::LeaveIfError(drawAnim.Construct(*iTestWin->BaseWin(),EAnimTypeCoverage,rectPckg));
-	
-	//set font
-	CFbsFont* font;
-	User::LeaveIfError(TheClient->iGc->Device()->GetNearestFontToDesignHeightInTwips((CFont*&)font, TFontSpec()));
-	TPckgBuf<TInt> fontHandle;
-	fontHandle() = font->Handle();
-	const TInt err = drawAnim.CommandReply(EADllSetFont, fontHandle);
-	TheClient->iGc->Device()->ReleaseFont(font);
-	User::LeaveIfError(err);
-	
-	//draw 
-	User::LeaveIfError(drawAnim.CommandReply(EADllDrawNow));
-
-	TheClient->iWs.Finish();
-	TheClient->WaitForRedrawsToFinish();
-	CheckWindows();
-	drawAnim.Close();
-	}
-
-void CTAnimDll::ShadowDrawingTestL()
-	{
-// Create a blank window to cast a shadow over the animation
-	TSize scrSize(TheClient->iScreen->SizeInPixels());
-	CTBlankWindow *blank=new(ELeave) CTBlankWindow();
-	CleanupStack::PushL(blank);
-	blank->SetUpL(TPoint(0,10), TSize(scrSize.iWidth,scrSize.iHeight/3), TheClient->iGroup, *TheClient->iGc);
-	blank->BaseWin()->SetShadowHeight(2);
-	iBlankTestWin->BaseWin()->SetShadowHeight(0);
-//
-	RTestAnim drawAnim=RTestAnim(iAnimDll);
-	TRect rect(10,scrSize.iHeight/3-20,50,scrSize.iHeight/3+40);
-	TPckgBuf<TRect> rectPckg;
-	rectPckg()=rect;
-	User::LeaveIfError(drawAnim.Construct(*iBlankTestWin->BaseWin(),EAnimTypeTest3,rectPckg));
-	drawAnim.Command(EADllSetShadowDrawMode);
-	CAnimWindow::SetEllipseDrawMode(CGraphicsContext::EDrawModePEN);
-//
-	iBlankTestWin->Invalidate();
-	iBlankTestWin->SetRect(rect);
-	iBaseWin->Invalidate();
-	iBaseWin->SetRect(rect);
-	RedrawAndCheckWindows(ETrue);
-//
-	for(TInt ypos=10;ypos>0;ypos-=4)
-		{
-		blank->SetPos(TPoint(0,ypos));
-		TPckgBuf<TShadowDrawTest> params;
-		TRequestStatus status(KRequestPending);
-		params().status=&status;
-		drawAnim.CommandReply(EADllShadowAnimTest,params);
-		User::WaitForRequest(status);
-		RedrawAndCheckWindows(ETrue);
-		}
-//
-	CleanupStack::PopAndDestroy(blank);	// Destroy the shadow window
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0130
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Complicated drawing test
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Performs complicated drawing both through the animation on
-					a blank window and through direct fbs drawing on the second
-					window.
-
-@SYMTestExpectedResults Expects the both windows to be are identical
-*/
-void CTAnimDll::GeneralDrawingTestL()
-	{
-	// This test has been removed as it is no longer relevant
-	// Anims are not allowed to draw immediately to the screen
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0131
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Animated window destruction test
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates a window and a child window inside it, runs an animation
-					in the child window in ESyncFlash mode, destroys windows.
-
-@SYMTestExpectedResults Expects the operations not to fail.
-*/
-void CTAnimDll::DestroyWindowTestL()
-	{
-	RWindow window(TheClient->iWs);
-	User::LeaveIfError(window.Construct(*TheClient->iGroup->GroupWin(),123));
-	CleanupClosePushL(window);
-	window.SetSize(TSize(100,100));
-	window.Activate();
-	RWindow window2(TheClient->iWs);
-	CleanupClosePushL(window2);
-	User::LeaveIfError(window2.Construct(window,124));
-	window2.Activate();
-	window2.BeginRedraw();	// Validate it
-	window2.EndRedraw();
-//
-	RTestAnim drawAnim;
-	drawAnim=RTestAnim(iAnimDll);
-	TRect rect(10,10,50,50);
-	TPckgBuf<TRect> rectPckg;
-	rectPckg()=rect;
-	User::LeaveIfError(drawAnim.Construct(window2,EAnimTypeTest3,rectPckg));
-	drawAnim.Command(EADllStartAnimate,rectPckg);
-	CleanupStack::Pop(&window2);
-	CleanupStack::PopAndDestroy(&window);
-	TheClient->iWs.Flush();
-	User::After(TTimeIntervalMicroSeconds32(2000000));
-	window2.Close();
-	drawAnim.Close();
-	}
-
-void CTAnimDll::SetUpMember(TSpriteMember &aMember,TInt aType)
-	{
-	switch (aType)
-		{
-	case 1:
-		iTest->SetUpMember(aMember);
-		aMember.iOffset=TPoint();
-		aMember.iInterval=TTimeIntervalMicroSeconds32(1);
-		break;
-	case 2:
-		aMember.iInvertMask=EFalse;
-		aMember.iDrawMode=CGraphicsContext::EDrawModeXOR;
-		aMember.iOffset=TPoint(1,2);
-		aMember.iInterval=TTimeIntervalMicroSeconds32(2);
-		break;
-	case 3:
-		aMember.iInvertMask=ETrue;
-		aMember.iDrawMode=CGraphicsContext::EDrawModeOR;
-		aMember.iOffset=TPoint(3,4);
-		aMember.iInterval=TTimeIntervalMicroSeconds32(3);
-		break;
-	default:
-		iTest->SetUpMember(aMember);
-		}
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0132
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Sprite animation test
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates a sprite with three sprite members and a sprite animation
-					passing the sprite to it. The test updates sprite members'
-					properties in various ways verifying that the properties are changing
-					on the server-side as well.
-
-@SYMTestExpectedResults Expects that operations above do not fail and that client-side
-					changes to the sprite affect server-side properly.
-*/
-#define HALF_SEC 500000
-void CTAnimDll::SpriteAnimL()
-	{
-	// create a sprite, add 3 members to it
-	RWsSprite sprite(TheClient->iWs);
-	iRedrawWin->BaseWin()->SetVisible(ETrue);
-	sprite.Construct(*iRedrawWin->CtBaseWin()->BaseWin(),TPoint(),0);
-	CleanupClosePushL(sprite);
-	CFbsBitmap* bitmap1=new(ELeave) CFbsBitmap();
-	CleanupStack::PushL(bitmap1);
-	CFbsBitmap* bitmap2=new(ELeave) CFbsBitmap();
-	CleanupStack::PushL(bitmap2);
-	CFbsBitmap* bitmap3=new(ELeave) CFbsBitmap();
-	CleanupStack::PushL(bitmap3);
-	User::LeaveIfError(bitmap1->Create(TSize(10,12),EGray4));
-	User::LeaveIfError(bitmap2->Create(TSize(15,17),EGray4));
-	User::LeaveIfError(bitmap3->Create(TSize(20,22),EGray4));
-	TSpriteMember member1;
-	TSpriteMember member2;
-	TSpriteMember member3;
-	SetUpMember(member1,1);
-	member1.iBitmap=bitmap1;
-	member1.iMaskBitmap=bitmap1;
-	SetUpMember(member2,2);
-	member2.iBitmap=bitmap2;
-	member2.iMaskBitmap=bitmap2;
-	SetUpMember(member3,3);
-	member3.iBitmap=bitmap3;
-	member3.iMaskBitmap=bitmap3;
-	sprite.AppendMember(member1);
-	sprite.AppendMember(member2);
-	sprite.AppendMember(member3);
-
-	// create a sprite animation for the sprite
-	RTestAnim spriteAnim(iAnimDll);
-	TPtrC8 des(NULL,0);
-	TPoint pos(1,2);
-	User::LeaveIfError(spriteAnim.Construct(sprite,EAnimTypeSprite,des));
-	CleanupClosePushL(spriteAnim);
-
-	// call EADllCheckMember-command to verify that sprite animation's members
-	// have the same properties as the sprite instance
-	TPckgBuf<TSpriteMemberInfo> spriteInfo;
-	spriteInfo()=TSpriteMemberInfo(TPoint(),0,member1);
-	TBool retBool = spriteAnim.CommandReply(EADllCheckMember,spriteInfo);
-	TEST(retBool);
-	if (!retBool)
-		INFO_PRINTF3(_L("spriteAnim.CommandReply(EADllCheckMember,spriteInfo) return value - Expected: %d , Actual: %d"), ETrue, retBool);
-
-	sprite.SetPosition(pos);
-	spriteInfo()=TSpriteMemberInfo(pos,1,member2);
-	retBool = spriteAnim.CommandReply(EADllCheckMember,spriteInfo);
-	TEST(retBool);
-	if (!retBool)
-		INFO_PRINTF3(_L("spriteAnim.CommandReply(EADllCheckMember,spriteInfo) return value - Expected: %d , Actual: %d"), ETrue, retBool);
-
-	pos.SetXY(3,4);
-	sprite.SetPosition(pos);
-	spriteInfo()=TSpriteMemberInfo(pos,2,member3);
-	retBool = spriteAnim.CommandReply(EADllCheckMember,spriteInfo);
-	TEST(retBool);
-	if (!retBool)
-		INFO_PRINTF3(_L("spriteAnim.CommandReply(EADllCheckMember,spriteInfo) return value - Expected: %d , Actual: %d"), ETrue, retBool);
-
-	// call commands to change sprite members' bitmaps and update members
-	spriteAnim.Command(EADllDraw1);
-	spriteAnim.Command(EADllDraw2);
-	spriteAnim.Command(EADllDraw3);
-	TheClient->iWs.Flush();
-	User::After(HALF_SEC);
-
-	// call commands to change sprite's position
-	TPckgBuf<TPoint> position;
-	position().SetXY(60,50);
-	spriteAnim.Command(EADllSetPos,position);
-	TheClient->iWs.Flush();
-	User::After(HALF_SEC);
-
-	// change 1st member's bitmap size and interval, update it and call command to check
-	// that the new properties are applied
-	User::LeaveIfError(bitmap1->Resize(TSize(30,32)));
-	member1.iMaskBitmap=NULL;
-	member1.iInterval=TTimeIntervalMicroSeconds32(25);
-	User::LeaveIfError(sprite.UpdateMember(0,member1));
-	spriteInfo()=TSpriteMemberInfo(TPoint(),0,member1);
-	retBool = spriteAnim.CommandReply(EADllCheckMember,spriteInfo);
-	TEST(retBool);
-	if (!retBool)
-		INFO_PRINTF3(_L("spriteAnim.CommandReply(EADllCheckMember,spriteInfo) return value - Expected: %d , Actual: %d"), ETrue, retBool);
-
-	User::After(HALF_SEC);
-
-	// change 1st member's bitmap size and calls command that invokes
-	// MAnimSpriteFunctions::SizeChangedL(). Check that new property is applied
-	spriteAnim.CommandReply(EADllDeactivate);
-	User::LeaveIfError(bitmap1->Resize(TSize(35,37)));
-	spriteAnim.Command(EADllSizeChanged);
-	spriteAnim.CommandReply(EADllActivate);
-	spriteInfo()=TSpriteMemberInfo(TPoint(),0,member1);
-	retBool = spriteAnim.CommandReply(EADllCheckMember,spriteInfo);
-	TEST(retBool);
-	if (!retBool)
-		INFO_PRINTF3(_L("spriteAnim.CommandReply(EADllCheckMember,spriteInfo) return value - Expected: %d , Actual: %d"), ETrue, retBool);
-
-	User::After(HALF_SEC);
-
-	// call command that changes 1st member's bitmap image
-	spriteAnim.Command(EADllIncDraw);
-	TheClient->iWs.Flush();
-	User::After(HALF_SEC);
-
-
-	CleanupStack::PopAndDestroy(5,&sprite);
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0133
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Free timer animation test
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     The test creates a free timer window animation that animates
-                    a shrinking filled rect which changes colour in a predefined way.
-
-@SYMTestExpectedResults The test verifies that the colour changes gets through to the the display.
-*/
-
-#define NOT_TIMED_OUT timeWaitingForFrame < frametime<<4
-void CTAnimDll::FreeTimerL()
-    {
-    RTestAnim freeTimerAnim(iAnimDll);
-    User::LeaveIfError(freeTimerAnim.Construct(*iRedrawWin->BaseWin(),EAnimTypeFreeTimer,KNullDesC8));
-    CleanupClosePushL(freeTimerAnim);
-    
-    const TInt frametime = 100000;  // 100 ms
-    const TInt samplingtime = frametime>>1; // 50 ms
-    
-    TPckgC<TInt> frametimeBuf(frametime);
-    freeTimerAnim.Command(ESetFrameTime, frametimeBuf);
-    freeTimerAnim.Command(EStartAnimation);
-    TheClient->iWs.Flush();
-    TheClient->iWs.Finish();
-
-    TInt x = iRedrawWin->BaseWin()->AbsPosition().iX + (iRedrawWin->BaseWin()->Size().iWidth >> 1);
-    TInt y = iRedrawWin->BaseWin()->AbsPosition().iY + (iRedrawWin->BaseWin()->Size().iHeight >> 1);
-    TPoint middle(x,y);
-    
-    TRgb color = KRgbMagenta;
-    TBool foundRedFrame = EFalse;
-    TBool foundGreenFrame = EFalse;
-    TBool foundBlueFrame = EFalse;
-    TBool foundBlackFrame = EFalse;
-    
-    //The free-timer animates the colour in this predefined way.
-    //Test that the screen gets updated.
-    TInt timeWaitingForFrame = 0;
-    while(NOT_TIMED_OUT && !(foundRedFrame && foundGreenFrame && foundBlueFrame && foundBlackFrame)) //wait max 16*frametime=1280ms
-        {
-        //wait for the colour frame
-        color = PixelColour(middle);
-
-        if(color == KRgbRed)
-            {
-            foundRedFrame = ETrue;
-            }
-        else if(color == KRgbGreen)
-            {
-            foundGreenFrame = ETrue;
-            }
-        else if(color == KRgbBlue)
-            {
-            foundBlueFrame = ETrue;
-            }
-        else if(color == KRgbBlack)
-            {
-            foundBlackFrame = ETrue;
-            }
-
-        timeWaitingForFrame += samplingtime;
-        User::After(samplingtime); 
-        }
-    
-    TEST(foundRedFrame);
-    TEST(foundGreenFrame);
-    TEST(foundBlueFrame);
-    TEST(foundBlackFrame);
-    
-    freeTimerAnim.Command(EStopAnimation);  
-    CleanupStack::PopAndDestroy(&freeTimerAnim);
-    }
-
-TRgb CTAnimDll::PixelColour(const TPoint& aPoint) const
-    {
-    TRgb pixel;
-    TheClient->iScreen->GetPixel(pixel, aPoint);
-    return pixel;
-    }
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0134
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Animation's ESyncSecond sync-mode test
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates an animation in ESyncSecond sync-mode.
-					Checks that animation's Animate() method was called either 9, 10 or 11
-					times during a 10-seconds-wait.
-					The test also checks that if RWsSession::PrepareForSwitchOff()
-					is called then the Animate() method will not be called until
-					TRawEvent::EActive event is simulated.
-
-@SYMTestExpectedResults See actions.
-*/
-static const TInt K1Second =  1000000;
-static const TInt K3Seconds = 3000000;
-static const TInt K9Seconds = 9500000;
-void CTAnimDll::DisableTimerL()
-	{
-	//Defer start of timerAnim until the systen time are close to a full second
-	TTime now;
-	now.HomeTime();
-	TInt deferTime = K1Second - now.DateTime().MicroSecond();
-	User::After(deferTime);
-	
-	//Kick off timerAnim
-	RTestAnim timerAnim(iAnimDll);
-	User::LeaveIfError(timerAnim.Construct(*iRedrawWin->BaseWin(),EAnimTypeTimer,KNullDesC8));
-	
-	User::After(K9Seconds);
-	TInt count=timerAnim.CommandReply(EADllCurrentCount);
-	
-#if defined(LOGGING)
-	TLogMessageText buf;
-	_LIT(KLog,"Anim DisableTimer  Count=%d");
-	buf.Format(KLog,count);
-	TheClient->LogMessage(buf);
-#endif
-	
-	TEST(count>=9 && count<=11);
-	if (count != 10)
-		INFO_PRINTF2(_L("count>=9 && count<=11 - Expected: 9,10 or 11 , Actual: %d"), count);
-	
-#if defined(__WINS__)
-	TheClient->iWs.SimulateXyInputType(EXYInputNone);	//Turn off pen in case it turns on the timer
-#endif
-
-	// reset timer's counter and call RWsSession::PrepareForSwitchOff(),
-	// check that 3 seconds after the counter = 0
-	timerAnim.Command(EADllResetCount);
-	timerAnim.Command(EADllNoTimer);
-	TheClient->iWs.PrepareForSwitchOff();
-	TheClient->iWs.Flush();
-	User::After(K3Seconds);
-	count=timerAnim.CommandReply(EADllCurrentCount);
-#if defined(LOGGING)
-	buf.Format(KLog,count);
-	TheClient->LogMessage(buf);
-#endif
-	TEST(count==0);
-	if (count!=0)
-		INFO_PRINTF3(_L("count==0 - Expected: %d , Actual: %d"), 0,  count);
-
-
-	// simulates TRawEvent::EActive event,
-	// check that the timer didn't ticked until the event were simulated
-	timerAnim.Command(EADllTimerStarted);
-	TRawEvent event;
-	event.Set(TRawEvent::EActive);
-	TheClient->iWs.SimulateRawEvent(event);
-#if defined(__WINS__)
-	TheClient->iWs.SimulateXyInputType(EXYInputPointer);	//Turn pen on again
-#endif
-	TInt retVal = timerAnim.CommandReply(EADllFailed);
-	TEST(retVal==0);
-	if (retVal!=0)
-		INFO_PRINTF3(_L("timerAnim.CommandReply(EADllFailed) return value - Expected: %d , Actual: %d"), 0,  retVal);
-
-	timerAnim.Close();
-	}
-
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0135
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Multiple animations test
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates multiple animations for a window.
-
-@SYMTestExpectedResults The test doesn't perform any specific validations.
-*/
-void CTAnimDll::MultipleAnimsL()
-	{
-	RTestAnim anim1(iAnimDll);
-	RTestAnim anim2(iAnimDll);
-	RTestAnim anim3(iAnimDll);
-	RTestAnim anim4(iAnimDll);
-	RTestAnim anim5(iAnimDll);
-	RTestAnim anim6(iAnimDll);
-	TPtrC8 des(NULL,0);
-	User::LeaveIfError(anim1.Construct(*iRedrawWin->BaseWin(),EAnimTypeTest3,des));
-	CleanupClosePushL(anim1);
-	User::LeaveIfError(anim2.Construct(*iRedrawWin->BaseWin(),EAnimTypeTest3,des));
-	CleanupClosePushL(anim2);
-	User::LeaveIfError(anim3.Construct(*iRedrawWin->BaseWin(),EAnimTypeTest3,des));
-	CleanupClosePushL(anim3);
-	User::LeaveIfError(anim4.Construct(*iRedrawWin->BaseWin(),EAnimTypeTest3,des));
-	CleanupClosePushL(anim4);
-	User::LeaveIfError(anim5.Construct(*iRedrawWin->BaseWin(),EAnimTypeTest3,des));
-	CleanupClosePushL(anim5);
-	User::LeaveIfError(anim6.Construct(*iRedrawWin->BaseWin(),EAnimTypeTest3,des));
-	anim6.Close();
-	User::LeaveIfError(anim6.Construct(*iRedrawWin->BaseWin(),EAnimTypeTest3,des));
-	anim6.Close();
-	User::LeaveIfError(anim6.Construct(*iRedrawWin->BaseWin(),EAnimTypeTest3,des));
-	CleanupStack::PopAndDestroy(&anim5);
-	anim6.Close();
-	User::LeaveIfError(anim5.Construct(*iRedrawWin->BaseWin(),EAnimTypeTest3,des));
-	CleanupClosePushL(anim5);
-	User::LeaveIfError(anim6.Construct(*iRedrawWin->BaseWin(),EAnimTypeTest3,des));
-	CleanupStack::Pop(&anim5);
-	CleanupStack::PopAndDestroy(&anim4);
-	anim5.Close();
-	anim6.Close();
-	User::LeaveIfError(anim4.Construct(*iRedrawWin->BaseWin(),EAnimTypeTest3,des));
-	CleanupStack::PopAndDestroy(&anim3);
-	anim4.Close();
-	User::LeaveIfError(anim3.Construct(*iRedrawWin->BaseWin(),EAnimTypeTest3,des));
-	CleanupStack::PopAndDestroy(&anim2);
-	anim3.Close();
-	User::LeaveIfError(anim2.Construct(*iRedrawWin->BaseWin(),EAnimTypeTest3,des));
-	CleanupStack::PopAndDestroy(&anim1);
-	anim2.Close();
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0136
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Click plugin DLL test
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Created two handles for a click plugin dll (RSoundPlugIn instances).
-					Plays with Load(), Unload() methods to verify that they affect
-					IsLoaded() call result.
-					Checks that CommandReply() for different opcodes
-					returns RSoundPlugIn::ESoundWrongPlugIn value.
-					Plays with SetPenClick(), SetKeyClick() to verify that they affect
-					PenClickEnabled() and KeyClickEnabled() call result.
-
-
-@SYMTestExpectedResults The test checks that RSoundPlugIn's methods work properly
-					and that both handles behave identically.
-*/
-void CTAnimDll::ClickPlugInL()
-	{
-	_LIT(KDllName,"CLICK");
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	CleanupClosePushL(ws);
-	TBool retBool;
-	TInt retVal;
-
-	// assign to the correct screen
-	CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws);
-	CleanupStack::PushL(screen);
-	User::LeaveIfError(screen->Construct(iTest->iScreenNumber));
-
-	RSoundPlugIn click1(ws);
-	RSoundPlugIn click2(TheClient->iWs);
-	User::LeaveIfError(click1.Construct());
-	CleanupClosePushL(click1);
-	User::LeaveIfError(click2.Construct());
-	CleanupClosePushL(click2);
-	TBool changeable1;
-	TBool changeable2;
-	TBool loaded=click1.IsLoaded(changeable1);
-	//test that either both are loaded or both are not loaded
-	TEST(!loaded==!click2.IsLoaded(changeable2));
-	if (!loaded!=!click2.IsLoaded(changeable2))
-		INFO_PRINTF3(_L("!loaded==!click2.IsLoaded(changeable2) - Expected: %d , Actual: %d"), !loaded,  !click2.IsLoaded(changeable2));
-
-	//test that either both are changeable or both are not changeable
-	TEST(!changeable1==!changeable2);
-	if (!changeable1!=!changeable2)
-		INFO_PRINTF3(_L("!changeable1==!changeable2) - Expected: %d , Actual: %d"), !changeable1,  !changeable2);
-
-	if (loaded && changeable1)
-		{
-		// unload the first one
-		User::LeaveIfError(click1.Unload());
-		// check that the second is not loaded and still changeable
-		retBool = !click2.IsLoaded(changeable2);
-		TEST(retBool);
-		if (!retBool)
-			INFO_PRINTF3(_L("!click2.IsLoaded(changeable2) return value - Expected: %d , Actual: %d"), ETrue,  retBool);
-
-		TEST(changeable2);
-		if (!changeable2)
-			INFO_PRINTF3(_L("changeable2 - Expected: %d , Actual: %d"), ETrue,  changeable2);
-
-
-		// load the first one and check that the second became loaded and is changeable
-		User::LeaveIfError(click1.Load(KDllName));
-		retBool = click2.IsLoaded(changeable2);
-		TEST(retBool);
-		if (!retBool)
-			INFO_PRINTF3(_L("click2.IsLoaded(changeable2) return value - Expected: %d , Actual: %d"), ETrue,  retBool);
-
-		TEST(changeable2);
-		if (!changeable2)
-			INFO_PRINTF3(_L("changeable2 - Expected: %d , Actual: %d"), ETrue,  changeable2);
-
-		// unload the second one
-		User::LeaveIfError(click2.Unload());
-		// check that the first is not loaded and still changeable
-		retBool = !click1.IsLoaded(changeable1);
-		TEST(retBool);
-		if (!retBool)
-			INFO_PRINTF3(_L("!click1.IsLoaded(changeable1) return value - Expected: %d , Actual: %d"), ETrue,  retBool);
-
-		TEST(changeable1);
-		if (!changeable1)
-			INFO_PRINTF3(_L("changeable1 - Expected: %d , Actual: %d"), ETrue,  changeable1);
-
-		// load the second one and check that the first one became loaded and is changeable
-		User::LeaveIfError(click2.Load(KDllName));
-		loaded=click1.IsLoaded(changeable1);
-		TEST(loaded);
-		if (!loaded)
-			INFO_PRINTF3(_L("loaded - Expected: %d , Actual: %d"), ETrue,  loaded);
-
-		TEST(changeable1);
-		if (!changeable1)
-			INFO_PRINTF3(_L("changeable1 - Expected: %d , Actual: %d"), ETrue,  changeable1);
-		}
-	if (loaded)
-		{
-		TPtrC8 des(NULL,0);
-		retVal = click1.CommandReply(0,des);
-		TEST(RSoundPlugIn::ESoundWrongPlugIn==retVal);
-		if (RSoundPlugIn::ESoundWrongPlugIn!=retVal)
-			INFO_PRINTF3(_L("click1.CommandReply(0,des) return value - Expected: %d , Actual: %d"), RSoundPlugIn::ESoundWrongPlugIn,  retVal);
-
-		retVal = click1.CommandReply(1,des);
-		TEST(RSoundPlugIn::ESoundWrongPlugIn==retVal);
-		if (RSoundPlugIn::ESoundWrongPlugIn!=retVal)
-			INFO_PRINTF3(_L("click1.CommandReply(1,des) return value - Expected: %d , Actual: %d"), RSoundPlugIn::ESoundWrongPlugIn,  retVal);
-
-		retVal = click1.CommandReply(2,des);
-		TEST(RSoundPlugIn::ESoundWrongPlugIn==retVal);
-		if (RSoundPlugIn::ESoundWrongPlugIn!=retVal)
-			INFO_PRINTF3(_L("click1.CommandReply(2,des) return value - Expected: %d , Actual: %d"), RSoundPlugIn::ESoundWrongPlugIn,  retVal);
-
-		retVal = click1.CommandReply(-1,des);
-		TEST(RSoundPlugIn::ESoundWrongPlugIn==retVal);
-		if (RSoundPlugIn::ESoundWrongPlugIn!=retVal)
-			INFO_PRINTF3(_L("click1.CommandReply(-1,des) return value - Expected: %d , Actual: %d"), RSoundPlugIn::ESoundWrongPlugIn,  retVal);
-
-		retBool = click1.KeyClickEnabled();
-		TEST(retBool);
-		if (!retBool)
-			INFO_PRINTF3(_L("click1.KeyClickEnabled() return value - Expected: %d , Actual: %d"), ETrue,  retBool);
-
-		retBool = click1.PenClickEnabled();
-		TEST(retBool);
-		if (!retBool)
-			INFO_PRINTF3(_L("click1.PenClickEnabled() return value - Expected: %d , Actual: %d"), ETrue,  retBool);
-
-		click1.SetPenClick(EFalse);
-		retBool = click1.KeyClickEnabled();
-		TEST(retBool);
-		if (!retBool)
-			INFO_PRINTF3(_L("click1.KeyClickEnabled() return value - Expected: %d , Actual: %d"), ETrue,  retBool);
-
-		retBool = !click1.PenClickEnabled();
-		TEST(retBool);
-		if (!retBool)
-			INFO_PRINTF3(_L("!click1.PenClickEnabled() return value - Expected: %d , Actual: %d"), ETrue,  retBool);
-
-		click1.SetKeyClick(EFalse);
-
-		retBool = !click1.KeyClickEnabled();
-		TEST(retBool);
-		if (!retBool)
-			INFO_PRINTF3(_L("!click1.KeyClickEnabled() return value - Expected: %d , Actual: %d"), ETrue,  retBool);
-
-		retBool = !click1.PenClickEnabled();
-		TEST(retBool);
-		if (!retBool)
-			INFO_PRINTF3(_L("!click1.PenClickEnabled() return value - Expected: %d , Actual: %d"), ETrue,  retBool);
-
-		click1.SetPenClick(ETrue);
-		retBool = !click1.KeyClickEnabled();
-		TEST(retBool);
-		if (!retBool)
-			INFO_PRINTF3(_L("!click1.KeyClickEnabled() return value - Expected: %d , Actual: %d"), ETrue,  retBool);
-
-		retBool = click1.PenClickEnabled();
-		TEST(retBool);
-		if (!retBool)
-			INFO_PRINTF3(_L("click1.PenClickEnabled() return value - Expected: %d , Actual: %d"), ETrue,  retBool);
-
-		click1.SetKeyClick(ETrue);
-		retBool = click1.KeyClickEnabled();
-		TEST(retBool);
-		if (!retBool)
-			INFO_PRINTF3(_L("click1.KeyClickEnabled() return value - Expected: %d , Actual: %d"), ETrue,  retBool);
-
-		retBool = click1.PenClickEnabled();
-		TEST(retBool);
-		if (!retBool)
-			INFO_PRINTF3(_L("click1.PenClickEnabled() return value - Expected: %d , Actual: %d"), ETrue,  retBool);
-
-		/*RLibrary lib;
-		TInt err=lib.Load(KDllName);
-		if (err==KErrNone)
-			{
-			TPtrC8 des(NULL,0);
-			TEST(lib.Type()[2].iUid==click1.CommandReply(0,des));
-			lib.Close();
-			}*/
-		}
-	CleanupStack::PopAndDestroy(4,&ws);
-	}
-
-void CTAnimDll::TestWindowInfo(RTestAnim& aAnim,TInt aScreen,TInt aPos,TInt aId)
-	{
-	TPckgBuf<TWindowGroupInfoParms> params;
-	params().iScreen=aScreen;
-	params().iOrdinalPosition=aPos;
-	TPckgBuf<MAnimGeneralFunctionsWindowExtension::TWindowGroupInfo> winGpInfo;
-	TIpcArgs ipcArgs;
-	ipcArgs.Set(KIpcSlot,&winGpInfo);
-	TBool retBool = aAnim.CommandReply(EADllWindowGroupInfo,params,ipcArgs);
-	TEST(retBool);
-	if (!retBool)
-		INFO_PRINTF3(_L("aAnim.CommandReply(EADllWindowGroupInfo,params,ipcArgs) return value - Expected: %d , Actual: %d"), ETrue,  retBool);
-
-	MAnimGeneralFunctionsWindowExtension::TWindowGroupInfo& info=winGpInfo();
-	TEST(info.iId==aId);
-	if (info.iId!=aId)
-		INFO_PRINTF3(_L("winGpInfo() return value - Expected: %d , Actual: %d"), aId,  info.iId);
-
-	TInt retVal = TheClient->iWs.GetWindowGroupOrdinalPriority(aId);
-	TEST(info.iOrdinalPriority==retVal);
-	if (info.iOrdinalPriority!=retVal)
-		INFO_PRINTF3(_L("TheClient->iWs.GetWindowGroupOrdinalPriority(aId) return value - Expected: %d , Actual: %d"), info.iOrdinalPriority, retVal);
-
-	TBuf<64> windowGroupNameS;
-	TBuf<64> windowGroupNameA;
-	TheClient->iWs.GetWindowGroupNameFromIdentifier(aId,windowGroupNameS);
-	retVal = windowGroupNameS.Length();
-	TEST(info.iNameLength==retVal);
-	if (info.iNameLength!=retVal)
-		INFO_PRINTF3(_L("windowGroupNameS.Length() return value - Expected: %d , Actual: %d"), info.iNameLength, retVal);
-
-	if (info.iNameLength<64)
-		{
-		ipcArgs.Set(KIpcSlot,&windowGroupNameA);
-		retBool = aAnim.CommandReply(EADllWindowGroupName,params,ipcArgs);
-		TEST(retBool);
-		if (!retBool)
-			INFO_PRINTF3(_L("aAnim.CommandReply(EADllWindowGroupName,params,ipcArgs) return value - Expected: %d , Actual: %d"), ETrue,  retBool);
-
-		if (info.iNameLength>0)
-			{
-			TEST(windowGroupNameA==windowGroupNameS);
-			}
-		else
-			{
-			TEST(windowGroupNameA.Length()==0);
-			if (windowGroupNameA.Length()!=0)
-				INFO_PRINTF3(_L("iwindowGroupNameA.Length()==0 - Expected: %d, Actual: %d"), 0, windowGroupNameA.Length());
-			}
-
-		}
-	TEST(info.iParentId>=-1);
-	if (info.iParentId<-1)
-		INFO_PRINTF3(_L("info.iParentId>=-1 - Expected: %d or greater, Actual: %d"), -1, info.iParentId);
-
-	}
-
-void CTAnimDll::TestEventHandlerRemovalL()
-	{
-	RTestAnim anim(iAnimDll);
-	User::LeaveIfError(anim.Construct(*iRedrawWin->BaseWin(),EAnimTypeEventHandler,KNullDesC8));
-	anim.Close();
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0137
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Animation's extended window functions test
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     The test creates a window animation that has a couple of
-					commands that work with extended window functions encapsulated
-					into MAnimGeneralFunctionsWindowExtension class instance.
-					The test calls those commands to compare MAnimGeneralFunctionsWindowExtension's
-					methods' results with the results retuned by WSERV client classes.
-					MAnimGeneralFunctionsWindowExtension methods tested here:
-					Screens(), FocusScreens(), WindowGroups(), WindowGroupInfo(),
-					WindowGroupName()
-
-@SYMTestExpectedResults MAnimGeneralFunctionsWindowExtension methods must give the same results as
-					the corresponding WSERV client methods would.
-*/
-void CTAnimDll::WinFunctionsL()
-	{
-	RTestAnim anim(iAnimDll);
-	User::LeaveIfError(anim.Construct(*iRedrawWin->BaseWin(),EAnimTypeWindowFunctions,KNullDesC8));
-	CleanupClosePushL(anim);
-	TInt screens=anim.CommandReply(EADllScreen);
-	TEST(screens>0);
-	if (screens<=0)
-		INFO_PRINTF3(_L("anim.CommandReply(EADllScreen) return value - Expected: %d or greater, Actual: %d"), 1, screens);
-
-	TInt focusScreen=anim.CommandReply(EADllFocusScreen);
-	TInt retVal = TheClient->iWs.GetFocusScreen();
-	TEST(focusScreen==retVal && focusScreen<=screens);
-	if (focusScreen!=retVal || focusScreen>screens)
-		INFO_PRINTF4(_L("anim.CommandReply(EADllFocusScreen) return value - Expected: %d and less than or equal to  %d, Actual: %d"), retVal, screens, focusScreen);
-
-	TInt ii;
-	TPckgBuf<TInt> screen;
-	CArrayPtrFlat<CMinWin>* wins=new(ELeave) CArrayPtrFlat<CMinWin>(screens);
-	CleanupStack::PushL(wins);
-	// create one window on each screen
-	for(ii=0;ii<screens;++ii)
-		{
-		CMinWin* win=new(ELeave) CMinWin(ii);
-		CleanupStack::PushL(win);
-		win->ConstructL();
-		wins->AppendL(win);
-		}
-	if (screens>1)
-		{
-		for (ii=screens-1;ii>=0;--ii)
-			{
-			TheClient->iWs.SetFocusScreen(ii);
-			retVal = anim.CommandReply(EADllFocusScreen);
-			TEST(retVal==ii);
-			if (retVal!=ii)
-				INFO_PRINTF3(_L("anim.CommandReply(EADllFocusScreen) return value - Expected: %d, Actual: %d"), ii, retVal);
-			}
-		for (ii=screens-1;ii>=0;--ii)
-			{
-			screen()=ii;
-			anim.CommandReply(EADllSetFocusScreen,screen);
-			retVal = anim.CommandReply(EADllFocusScreen);
-			TEST(retVal==ii);
-			if (retVal!=ii)
-				INFO_PRINTF3(_L("anim.CommandReply(EADllFocusScreen) return value - Expected: %d, Actual: %d"), ii, retVal);
-			}
-		}
-	TheClient->iWs.SetFocusScreen(focusScreen);
-	retVal = anim.CommandReply(EADllFocusScreen);
-	TEST(retVal==focusScreen);
-	if (retVal!=focusScreen)
-		INFO_PRINTF3(_L("anim.CommandReply(EADllFocusScreen) return value - Expected: %d, Actual: %d"), focusScreen, retVal);
-
-	TInt winGroupsAll=0;
-	for(ii=0;ii<screens;++ii)
-		{
-		screen()=ii;
-		winGroupsAll+=anim.CommandReply(EADllWindowGroups,screen);
-		}
-	TInt winGroupsS=TheClient->iWs.NumWindowGroups();
-	TEST(winGroupsAll==winGroupsS);
-	if (winGroupsAll!=winGroupsS)
-		INFO_PRINTF3(_L("TheClient->iWs.NumWindowGroups() return value - Expected: %d, Actual: %d"), winGroupsS, winGroupsAll);
-
-	// the remaining test will use winGroupsA and performed on current focus screen only
-	screen()=iTest->iScreenNumber;
-	TInt winGroupsA=anim.CommandReply(EADllWindowGroups,screen);
-	CArrayFixFlat<TInt>* windowList=new(ELeave) CArrayFixFlat<TInt>(3);
-	CleanupStack::PushL(windowList);
-	// wserv implementation returns window groups from current focus screen, followed by the rest
-	TheClient->iWs.WindowGroupList(windowList);
-	// only interested in window group from current focus screen
-	for (ii=0;ii<winGroupsA;++ii)
-		TestWindowInfo(anim,iTest->iScreenNumber,ii,(*windowList)[ii]);
-	TPckgBuf<MAnimGeneralFunctionsWindowExtension::TWindowGroupInfo> winGpInfo;
-	TIpcArgs ipcArgs;
-	TPckgBuf<TWindowGroupInfoParms> params;
-	params().iScreen=iTest->iScreenNumber;
-	params().iOrdinalPosition=winGroupsA;
-	ipcArgs.Set(KIpcSlot,&winGpInfo);
-	TBuf<64> windowGroupName;
-	TBool retBool = !anim.CommandReply(EADllWindowGroupInfo,params,ipcArgs);
-	TEST(retBool);
-	if (!retBool)
-		INFO_PRINTF3(_L("!anim.CommandReply(EADllWindowGroupInfo,params,ipcArgs) return value - Expected: %d, Actual: %d"), ETrue, retBool);
-
-	ipcArgs.Set(KIpcSlot,&windowGroupName);
-	retBool = !anim.CommandReply(EADllWindowGroupName,params,ipcArgs);
-	TEST(retBool);
-	if (!retBool)
-		INFO_PRINTF3(_L("!anim.CommandReply(EADllWindowGroupName,params,ipcArgs) return value - Expected: %d, Actual: %d"), ETrue, retBool);
-
-	/*params().iOrdinalPosition=-1;		//Behaviour for negative positions not defined - but as writtin this code will pass
-	ipcArgs.Set(KIpcSlot,&winGpInfo);
-	TEST(anim.CommandReply(EADllWindowGroupInfo,params,ipcArgs));
-	ipcArgs.Set(KIpcSlot,&windowGroupNameA);
-	TEST(anim.CommandReply(EADllWindowGroupName,params,ipcArgs));*/
-	RWindowGroup group(TheClient->iWs);
-	User::LeaveIfError(group.Construct(ENullWsHandle));
-	CleanupClosePushL(group);
-	_LIT(KGroupName,"Testxyz1234");
-	group.SetName(KGroupName);
-	group.SetOrdinalPosition(0,TheClient->iWs.GetWindowGroupOrdinalPriority((*windowList)[0])+1);
-	TInt groupId=group.Identifier();
-	TestWindowInfo(anim,iTest->iScreenNumber,0,groupId);
-	group.SetOrdinalPosition(0,TheClient->iWs.GetWindowGroupOrdinalPriority((*windowList)[winGroupsA-1])-1);
-	TestWindowInfo(anim,iTest->iScreenNumber,winGroupsA,groupId);
-	CleanupStack::PopAndDestroy(screens+4,&anim);
-// Restore us back to the front
-	TheClient->iGroup->GroupWin()->SetOrdinalPosition(0);
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0138
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Animation's extended window functions test 2
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     The test creates a window animation that has a command
-					for setting window's ordinal position and priority.
-					The test creates 4 window groups with the same priority and
-					checks that they have correct ordinal positions after the creation.
-					After that the test plays with updating ordinal positions and
-					priorities of the window groups using the animation's command.
-
-@SYMTestExpectedResults The test checks that the command was executed with no errors
-					and affected ordinal positions of the window groups properly.
-*/
-void CTAnimDll::WinFunctions2L()
-	{
-	RTestAnim anim(iAnimDll);
-	User::LeaveIfError(anim.Construct(*iRedrawWin->BaseWin(),EAnimTypeWindowFunctions,KNullDesC8));
-	CleanupClosePushL(anim);
-	CArrayFixFlat<TInt>* windowList=new(ELeave) CArrayFixFlat<TInt>(3);
-	TheClient->iWs.WindowGroupList(windowList);
-	TInt priority=TheClient->iWs.GetWindowGroupOrdinalPriority((*windowList)[0])+2;
-	delete windowList;
-	RWindowGroup group1(TheClient->iWs);
-	User::LeaveIfError(group1.Construct(ENullWsHandle));
-	CleanupClosePushL(group1);
-	group1.SetOrdinalPosition(0,priority);
-	RWindowGroup group2(TheClient->iWs);
-	User::LeaveIfError(group2.Construct(ENullWsHandle));
-	CleanupClosePushL(group2);
-	group2.SetOrdinalPosition(0,priority);
-	RWindowGroup group3(TheClient->iWs);
-	User::LeaveIfError(group3.Construct(ENullWsHandle));
-	CleanupClosePushL(group3);
-	group3.SetOrdinalPosition(0,priority);
-	RWindowGroup group4(TheClient->iWs);
-	User::LeaveIfError(group4.Construct(ENullWsHandle));
-	CleanupClosePushL(group4);
-	group4.SetOrdinalPosition(0,priority);
-
-	TInt retVal = group1.OrdinalPosition();
-	TEST(retVal==3);
-	if (retVal!=3)
-		INFO_PRINTF3(_L("group1.OrdinalPosition() return value - Expected: %d, Actual: %d"), 3, retVal);
-
-	retVal = group2.OrdinalPosition();
-	TEST(retVal==2);
-	if (retVal!=2)
-		INFO_PRINTF3(_L("group2.OrdinalPosition() return value - Expected: %d, Actual: %d"), 2, retVal);
-
-	retVal = group3.OrdinalPosition();
-	TEST(retVal==1);
-	if (retVal!=1)
-		INFO_PRINTF3(_L("group3.OrdinalPosition() return value - Expected: %d, Actual: %d"), 1, retVal);
-
-	retVal = group4.OrdinalPosition();
-	TEST(retVal==0);
-	if (retVal!=0)
-		INFO_PRINTF3(_L("group4.OrdinalPosition() return value - Expected: %d, Actual: %d"), 0, retVal);
-
-	TPckgBuf<TSetOrdinalParms> params;
-	params().iIdentifier=group4.Identifier();
-	params().iOrdinalPriority=priority;
-	params().iOrdinalPosition=1;
-	retVal = anim.CommandReply(EADllSetOrdinalPosition,params);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("anim.CommandReply(EADllSetOrdinalPosition,params) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
-
-	retVal = group3.OrdinalPosition();
-	TEST(retVal==0);
-	if (retVal!=0)
-		INFO_PRINTF3(_L("group3.OrdinalPosition() return value - Expected: %d, Actual: %d"), 0, retVal);
-
-	retVal = group4.OrdinalPosition();
-	TEST(retVal==1);
-	if (retVal!=1)
-		INFO_PRINTF3(_L("group4.OrdinalPosition() return value - Expected: %d, Actual: %d"), 1, retVal);
-
-	params().iOrdinalPosition=2;
-	retVal = anim.CommandReply(EADllSetOrdinalPosition,params);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("anim.CommandReply(EADllSetOrdinalPosition,params) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
-
-	retVal = group2.OrdinalPosition();
-	TEST(retVal==1);
-	if (retVal!=1)
-		INFO_PRINTF3(_L("group2.OrdinalPosition() return value - Expected: %d, Actual: %d"), 1, retVal);
-
-	retVal = group4.OrdinalPosition();
-	TEST(retVal==2);
-	if (retVal!=2)
-		INFO_PRINTF3(_L("group4.OrdinalPosition() return value - Expected: %d, Actual: %d"), 2, retVal);
-
-	params().iOrdinalPosition=3;
-	retVal = anim.CommandReply(EADllSetOrdinalPosition,params);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("anim.CommandReply(EADllSetOrdinalPosition,params) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
-
-	retVal = group1.OrdinalPosition();
-	TEST(retVal==2);
-	if (retVal!=2)
-		INFO_PRINTF3(_L("group1.OrdinalPosition() return value - Expected: %d, Actual: %d"), 2, retVal);
-
-	retVal = group2.OrdinalPosition();
-	TEST(retVal==1);
-	if (retVal!=1)
-		INFO_PRINTF3(_L("group2.OrdinalPosition() return value - Expected: %d, Actual: %d"), 1, retVal);
-
-	retVal = group3.OrdinalPosition();
-	TEST(retVal==0);
-	if (retVal!=0)
-		INFO_PRINTF3(_L("group3.OrdinalPosition() return value - Expected: %d, Actual: %d"), 0, retVal);
-
-	retVal = group4.OrdinalPosition();
-	TEST(retVal==3);
-	if (retVal!=3)
-		INFO_PRINTF3(_L("group4.OrdinalPosition() return value - Expected: %d, Actual: %d"), 3, retVal);
-
-	params().iOrdinalPriority=priority+1;
-	params().iOrdinalPosition=3;
-	retVal = anim.CommandReply(EADllSetOrdinalPosition,params);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("anim.CommandReply(EADllSetOrdinalPosition,params) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
-
-	retVal = group4.OrdinalPosition();
-	TEST(retVal==0);
-	if (retVal!=0)
-		INFO_PRINTF3(_L("group4.OrdinalPosition() return value - Expected: %d, Actual: %d"), 0, retVal);
-
-	params().iOrdinalPriority=priority;
-	params().iOrdinalPosition=-2;
-	retVal = anim.CommandReply(EADllSetOrdinalPosition,params);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("anim.CommandReply(EADllSetOrdinalPosition,params) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
-
-	retVal = group4.OrdinalPosition();
-	TEST(retVal==3);
-	if (retVal!=3)
-		INFO_PRINTF3(_L("group4.OrdinalPosition() return value - Expected: %d, Actual: %d"), 3, retVal);
-
-	params().iOrdinalPosition=0;
-	retVal = anim.CommandReply(EADllSetOrdinalPosition,params);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("anim.CommandReply(EADllSetOrdinalPosition,params) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
-
-	retVal = group1.OrdinalPosition();
-	TEST(retVal==3);
-	if (retVal!=3)
-		INFO_PRINTF3(_L("group1.OrdinalPosition() return value - Expected: %d, Actual: %d"), 3, retVal);
-
-	retVal = group2.OrdinalPosition();
-	TEST(retVal==2);
-	if (retVal!=2)
-		INFO_PRINTF3(_L("group2.OrdinalPosition() return value - Expected: %d, Actual: %d"), 2, retVal);
-
-	retVal = group3.OrdinalPosition();
-	TEST(retVal==1);
-	if (retVal!=1)
-		INFO_PRINTF3(_L("group3.OrdinalPosition() return value - Expected: %d, Actual: %d"), 1, retVal);
-
-	retVal = group4.OrdinalPosition();
-	TEST(retVal==0);
-	if (retVal!=0)
-		INFO_PRINTF3(_L("group4.OrdinalPosition() return value - Expected: %d, Actual: %d"), 0, retVal);
-
-	params().iOrdinalPriority=priority-1;
-	params().iOrdinalPosition=2;
-	retVal = anim.CommandReply(EADllSetOrdinalPosition,params);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("anim.CommandReply(EADllSetOrdinalPosition,params) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
-
-	retVal = group1.OrdinalPosition();
-	TEST(retVal==2);
-	if (retVal!=2)
-		INFO_PRINTF3(_L("group1.OrdinalPosition() return value - Expected: %d, Actual: %d"), 2, retVal);
-
-	retVal = group2.OrdinalPosition();
-	TEST(retVal==1);
-	if (retVal!=1)
-		INFO_PRINTF3(_L("group2.OrdinalPosition() return value - Expected: %d, Actual: %d"), 1, retVal);
-
-	retVal = group3.OrdinalPosition();
-	TEST(retVal==0);
-	if (retVal!=0)
-		INFO_PRINTF3(_L("group3.OrdinalPosition() return value - Expected: %d, Actual: %d"), 0, retVal);
-
-	retVal = group4.OrdinalPosition();
-	TEST(retVal==0);
-	if (retVal!=0)
-		INFO_PRINTF3(_L("group4.OrdinalPosition() return value - Expected: %d, Actual: %d"), 0, retVal);
-
-
-	params().iOrdinalPriority=priority;
-	params().iOrdinalPosition=0;
-	retVal = anim.CommandReply(EADllSetOrdinalPosition,params);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("anim.CommandReply(EADllSetOrdinalPosition,params) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
-
-	retVal = group1.OrdinalPosition();
-	TEST(retVal==3);
-	if (retVal!=3)
-		INFO_PRINTF3(_L("group1.OrdinalPosition() return value - Expected: %d, Actual: %d"), 3, retVal);
-
-	retVal = group2.OrdinalPosition();
-	TEST(retVal==2);
-	if (retVal!=2)
-		INFO_PRINTF3(_L("group2.OrdinalPosition() return value - Expected: %d, Actual: %d"), 2, retVal);
-
-	retVal = group3.OrdinalPosition();
-	TEST(retVal==1);
-	if (retVal!=1)
-		INFO_PRINTF3(_L("group3.OrdinalPosition() return value - Expected: %d, Actual: %d"), 1, retVal);
-
-	retVal = group4.OrdinalPosition();
-	TEST(retVal==0);
-	if (retVal!=0)
-		INFO_PRINTF3(_L("group4.OrdinalPosition() return value - Expected: %d, Actual: %d"), 0, retVal);
-
-	CleanupStack::PopAndDestroy(5,&anim);
-	/*TInt pos1=group1.OrdinalPosition();
-	TInt pos2=group2.OrdinalPosition();
-	TInt pos3=group3.OrdinalPosition();
-	TInt pos4=group4.OrdinalPosition();*/
-	}
-
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0139
-
-@SYMDEF             DEF081259, DEF122220
-
-@SYMTestCaseDesc    Animation's notifications test
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     The test works with two screens. An animation is created that keeps
-					track on all notifications about EDirectScreenAccess, EHeartbeatTimer,
-					EScreenDeviceChange events.
-					The test generates those events by performing operations on direct
-					screen access and simulating TRawEvent::EInactive and TRawEvent::EAactive
-					events.
-
-@SYMTestExpectedResults  The test checks that the animation didn't miss any of EDirectScreenAccess
-					or EHeartbeatTimer notifications. (The test doesn't check EScreenDeviceChange
-					notifications however).
-					The test also makes sure that the animation didn't animate
-					during inactive state.
-					For DEF12220, the test will crash when a untidied notifier from a previous RTestAnim object
-					is accessed if the fix is not present. If the fix is present, the test should not crash.
-*/
-void CTAnimDll::TestNotificationsL()
-	{
-	RTestAnim anim(iAnimDll);
-	User::LeaveIfError(anim.Construct(*iRedrawWin->BaseWin(),EAnimTypeNotificationTest,KNullDesC8));
-	CleanupClosePushL(anim);
-
-	TPckgBuf<TInt> screenNum;
-
-	// initial state - test that we have no DSA on either screen
-	screenNum() = 0;
-	TInt dsa=anim.CommandReply(EADllQueryDSA, screenNum);
-	TEST(!dsa);
-	if (dsa)
-		INFO_PRINTF3(_L("anim.CommandReply(EADllQueryDSA, screenNum) return value - Expected: %d, Actual: %d"), 0, dsa);
-
-	screenNum() = 1;
-	dsa=anim.CommandReply(EADllQueryDSA, screenNum);
-	TEST(!dsa);
-	if (dsa)
-		INFO_PRINTF3(_L("anim.CommandReply(EADllQueryDSA, screenNum) return value - Expected: %d, Actual: %d"), 0, dsa);
-
-	// create first DSA, but don't start it - test that we have no DSA on either screen
-	CScrollText* dsa1 = CScrollText::NewL(iTest->iScreenNumber,1,*TheClient->iGroup,5,EFalse);
-	CleanupStack::PushL(dsa1);
-	screenNum() = 0;
-	dsa=anim.CommandReply(EADllQueryDSA, screenNum);
-	TEST(!dsa);
-	if (dsa)
-		INFO_PRINTF3(_L("anim.CommandReply(EADllQueryDSA, screenNum) return value - Expected: %d, Actual: %d"), 0, dsa);
-
-	screenNum() = 1;
-	dsa=anim.CommandReply(EADllQueryDSA, screenNum);
-	TEST(!dsa);
-	if (dsa)
-		INFO_PRINTF3(_L("anim.CommandReply(EADllQueryDSA, screenNum) return value - Expected: %d, Actual: %d"), 0, dsa);
-
-	// start first DSA - test that we have DSA on this screen but not other screen
-	dsa1->StartL();
-	screenNum() = 0;
-	dsa=anim.CommandReply(EADllQueryDSA, screenNum);
-	TInt retVal = (screenNum() == iTest->iScreenNumber);
-	TEST(dsa == retVal);
-	if (dsa != retVal)
-		INFO_PRINTF3(_L("dsa == (screenNum() == iTest->iScreenNumber) - Expected: %d, Actual: %d"), retVal, dsa);
-
-	screenNum() = 1;
-	dsa=anim.CommandReply(EADllQueryDSA, screenNum);
-	retVal = (screenNum() == iTest->iScreenNumber);
-	TEST(dsa == retVal);
-	if (dsa != retVal)
-		INFO_PRINTF3(_L("dsa == (screenNum() == iTest->iScreenNumber) - Expected: %d, Actual: %d"), retVal, dsa);
-
-	// start second DSA
-	CScrollText* dsa2 = CScrollText::NewL(iTest->iScreenNumber,2,*TheClient->iGroup,5,EFalse);
-	CleanupStack::PushL(dsa2);
-	dsa2->StartL();
-	screenNum() = 0;
-	dsa=anim.CommandReply(EADllQueryDSA, screenNum);
-	retVal = (screenNum() == iTest->iScreenNumber);
-	TEST(dsa == retVal);
-	if (dsa != retVal)
-		INFO_PRINTF3(_L("dsa == (screenNum() == iTest->iScreenNumber) - Expected: %d, Actual: %d"), retVal, dsa);
-
-	screenNum() = 1;
-	dsa=anim.CommandReply(EADllQueryDSA, screenNum);
-	retVal = (screenNum() == iTest->iScreenNumber);
-	TEST(dsa == retVal);
-	if (dsa != retVal)
-		INFO_PRINTF3(_L("dsa == (screenNum() == iTest->iScreenNumber) - Expected: %d, Actual: %d"), retVal, dsa);
-
-	// stop second DSA
-	dsa2->Stop();
-	CleanupStack::PopAndDestroy(dsa2);
-	screenNum() = 0;
-	dsa=anim.CommandReply(EADllQueryDSA, screenNum);
-	retVal = (screenNum() == iTest->iScreenNumber);
-	TEST(dsa == retVal);
-	if (dsa != retVal)
-		INFO_PRINTF3(_L("dsa == (screenNum() == iTest->iScreenNumber) - Expected: %d, Actual: %d"), retVal, dsa);
-
-	screenNum() = 1;
-	dsa=anim.CommandReply(EADllQueryDSA, screenNum);
-	retVal = (screenNum() == iTest->iScreenNumber);
-	TEST(dsa == retVal);
-	if (dsa != retVal)
-		INFO_PRINTF3(_L("dsa == (screenNum() == iTest->iScreenNumber) - Expected: %d, Actual: %d"), retVal, dsa);
-
-	// stop first DSA
-	dsa1->Stop();
-	CleanupStack::PopAndDestroy(dsa1);
-	screenNum() = 0;
-	dsa=anim.CommandReply(EADllQueryDSA, screenNum);
-	TEST(!dsa);
-	if (dsa)
-		INFO_PRINTF3(_L("anim.CommandReply(EADllQueryDSA, screenNum) return value - Expected: %d, Actual: %d"), 0, dsa);
-
-	screenNum() = 1;
-	dsa=anim.CommandReply(EADllQueryDSA, screenNum);
-	TEST(!dsa);
-	if (dsa)
-		INFO_PRINTF3(_L("anim.CommandReply(EADllQueryDSA, screenNum) return value - Expected: %d, Actual: %d"), 0, dsa);
-
-	// TEST heartbeat timer start\stop notifications - no longer relevant - has been removed 
-
-	CleanupStack::PopAndDestroy(&anim);
-	
-	// Create second RTestAnim for DEF12220 test
-	RTestAnim anim2(iAnimDll);
-	User::LeaveIfError(anim2.Construct(*iRedrawWin->BaseWin(),EAnimTypeNotificationTest,KNullDesC8));
-	CleanupClosePushL(anim2);
-	
-	// Create third dsa
-	CScrollText* dsa3 = CScrollText::NewL(iTest->iScreenNumber,1,*TheClient->iGroup,5,EFalse);
-	CleanupStack::PushL(dsa3);
-	// If the fix for DEF12220 is not present, starting dsa3 will cause a crash.
-	dsa3->StartL();
-	dsa3->Stop();
-	CleanupStack::PopAndDestroy(dsa3);
-	CleanupStack::PopAndDestroy(&anim2);
-	}
-
-/**
- A minimal dsa call to a window with a child window, for running coverage on
- ClipWindows member funcion.
- 
-@SYMTestCaseID GRAPHICS-WSERV-0410
-
-@SYMPREQ PREQ1841
-
-@SYMTestExpectedResults Nothing visible, the CWsClientWindow::ClipWindows 
-should be partially covered.
- */
-void CTAnimDll::TestCoverageL()
-	{
-	// create first DSA, but don't start it - test that we have no DSA on either screen
-	CWindowWithChild* dsa1 = CWindowWithChild::NewL(iTest->iScreenNumber, *TheClient->iGroup, EFalse);
-	CleanupStack::PushL(dsa1);
-
-	// start first DSA - test that we have DSA on this screen but not other screen
-	dsa1->StartL();
-	dsa1->PerformCoverageCalls();
-	dsa1->Stop();
-
-	// cover another trivial case for a non-visible window
-	RWindow* cwin = dsa1->ChildWindow();
-	
-	cwin->SetTransparencyAlphaChannel();
-	dsa1->ContinueL();
-
-	//ClipWindows with visible and invisible branches
-	cwin->SetVisible(EFalse);
-
-	//cover CWsWindow::StatusDump (visible and invisible branch)
-	TheClient->iWs.LogCommand(RWsSession::ELoggingStatusDump);
-	
-	dsa1->Stop();
-	dsa1->StartL();
-	cwin->SetVisible(ETrue);
-	dsa1->Stop();
-
-	CleanupStack::PopAndDestroy(dsa1);
-	}
-
-/**
- Executes a Panic coverage test for a given test-number.
- Most of the first lines copied from DoPanicTest.
- CWsWindow is tested through CommandL (case 0-3) and other API funcs
- */
-LOCAL_C TInt DoPanicTestCoverage(TInt aTestNum, TAny *aScreenNumber)
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-
-	// assign to the correct screen
-	CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws);
-	User::LeaveIfError(screen->Construct(reinterpret_cast<TInt>(aScreenNumber)));
-
-	RWindowGroup group(ws);
-	User::LeaveIfError(group.Construct(333));
-	group.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
-	RAnimDll animDll=RAnimDll(ws);
-	User::LeaveIfError(animDll.Load(KAnimDLLName));
-	
-	RWindow window(ws);
-	User::LeaveIfError(window.Construct(group,123));
-	window.SetSize(TSize(10,10));
-	window.Activate();
-	window.BeginRedraw();
-	window.EndRedraw();
-
-	switch (aTestNum)
-	{
-	case 0: //non translucent window
-		//EWsWinOpSetTransparentRegion -> EWservPanicTransparencyObjNotCreated
-		{
-		RRegion r;
-		window.SetTransparentRegion(r);
-		break;
-		}
-	case 1:
-		//EWsWinOpSetTransparencyPolicy -> EWservPanicTransparencyObjNotCreated
-		window.SetTransparencyPolicy(ETransparencyDefault);
-		break;
-	case 2:
-		// -> EWservPanicWindowActive
-		window.Activate();
-		break;
-	case 3:
-		// -> EWservPanicCornerParams
-		window.SetCornerType(EWindowCornerSquare, ECornerTypeMask);
-		break;
-	case 4:
-		// -> EWservPanicCornerParams
-		window.SetCornerType(ECornerTypeMask, 0);
-		break;
-	default:
-		return EWsExitReasonFinished;
-	}
-	ws.Flush();
-	
-	return(EWsExitReasonBad);	// Should never get here, but it's baaddd if it does
-	}
-
-/**
-@SYMTestCaseID GRAPHICS-WSERV-0411
-
-@SYMPREQ PREQ1841
-
-@SYMTestCaseDesc Does functional coverage for code that Panics
-
-*/
-void CTAnimDll::TestPanicCoverageL()
-	{
-	TClientPanic expectedPanicCode[] = 
-		{
-		EWservPanicTransparencyObjNotCreated,	//0
-		EWservPanicTransparencyObjNotCreated,	//1
-		EWservPanicWindowActive,				//2
-		EWservPanicCornerParams,				//3
-		EWservPanicCornerParams,				//4
-		};
-	for (TInt i=0; i<sizeof(expectedPanicCode)/sizeof(TClientPanic); i++)
-		{
-		TEST(iTest->TestWsPanicL(
-				DoPanicTestCoverage,			//aFunction
-				expectedPanicCode[i],			//aExitReason
-				i,								//aInt
-				(TAny*)iTest->iScreenNumber,	//aPtr
-				NULL)); //&finishTests			//aTestFinished
-		iTest->CloseAllPanicWindows();
-		}
-	}
-
-
-/**
-@SYMTestCaseID GRAPHICS-CODEBASE-WSERV-0056-0001
-
-@SYMPREQ PGM027
-
-@SYMTestCaseDesc Tests RAnimDll::Load (by passing invalid file name)
-
-@SYMTestPriority 1 
-
-@SYMTestStatus Implemented
-
-@SYMTestActions Call RAnimDll::Load() by passing invalid file name\n
-
-@SYMTestExpectedResults Should return with appropiate error message. KErrNotFound
- */
-void CTAnimDll::TestLoadApiL()	
-	{
-	RAnimDll* animDll=new(ELeave) RAnimDll(TheClient->iWs);
-	CleanupStack::PushL(animDll);
-	TInt ret=0;
-	_LIT(KAnimFile,"Nothing.dll");
-	_LIT(KEmpty,"");
-	ret=animDll->Load(KAnimFile);
-	TEST(ret==KErrNotFound);
-	ret=animDll->Load(KEmpty);
-	TEST(ret==KErrNotFound);
-	CleanupStack::PopAndDestroy(animDll);
-	}
-
-TInt CTAnimDll::CheckError(TInt aError,TInt aExpected)
-	{
-	if (aError!=0)
-		{
-		if (aError>0)
-			{
-			_LIT(KLog,"The event at position %d did not match, total number of events=%d");
-			LOG_MESSAGE3(KLog,aError,aExpected);
-			}
-		else
-			{
-			_LIT(KLog,"Only recieved %d events, expecting %d events");
-			LOG_MESSAGE3(KLog,-aError,aExpected);
-			}
-		return EFalse;
-		}
-	return ETrue;
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0448
-
-@SYMCR				CR1164
-
-@SYMTestCaseDesc	Test events get to Anims at a higher priorty than commands
-
-@SYMTestPriority	High
-
-@SYMTestStatus		Implemented
-
-@SYMTestActions		Create a 2nd thread that sends events via kernal, send also commands from client to an Anim
-
-@SYMTestExpectedResults	Check that events intersperse commands from client
-*/
-void CTAnimDll::KeyClickPriorityL()
-	{
-	_LIT(KFailedAdd,"Device Driver Failed to Add an Event, error=%d");
-	REventAnim* anim=REventAnim::NewL(iTestWin->BaseWin(),&iAnimDll);
-	TPckgBuf<TInt> events;
-	TInt err=anim->CommandReply(EADllLoadDeviceDriver);
-	if (err!=KErrNone)
-		{
-		_LIT(KLog,"Failed to load Device Driver for sending Events");
-		TEST(EFalse);
-		LOG_MESSAGE(KLog);
-		}
-	TInt error;
-	TInt ii;
-	for (ii=1;ii<5;++ii)
-		{
-		events()=ii;
-		error=anim->CommandReply(EADllSendEvent,events);
-		if (error!=KErrNone)
-			LOG_MESSAGE2(KFailedAdd,error);
-		anim->Command(EADllAfterEvent);
-		TheClient->Flush();
-		error=anim->TestFail(ii);
-		TEST(CheckError(error,ii));
-		}
-	const TInt iterations=15;
-	const TInt eventsPerIteration=2;
-	const TInt totalEvents=iterations*eventsPerIteration;
-	events()=eventsPerIteration;
-	for (ii=iterations;ii>0;--ii)
-		{
-		error=anim->CommandReply(EADllSendEvent,events);
-		if (error!=KErrNone)
-			LOG_MESSAGE2(KFailedAdd,error);
-		anim->Command(EADllAfterEvent);
-		}
-	TheClient->Flush();
-	error=anim->TestFail(totalEvents);
-	TEST(CheckError(error,totalEvents));
-	anim->CommandReply(EADllUnloadDeviceDriver);
-	delete anim;
-	}
-
-/**
-@SYMDEF             INC117828
-
-@SYMTestCaseDesc    Tests Window Rect returned by CWsAnim::Parameters
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     This test creates a new window which overlaps the screen edge
-					and creates an animation on this window. An additional
-					CommandReplyL() option has been added to the AnimDLL to compare
-					the expected value of this rect with the actual value.
-					
-
-@SYMTestExpectedResults The result of the EADllTestParameterRect CommandReplyL call will equal ETrue
-						if the passed Rect matches, EFalse otherwise.
-*/
-void CTAnimDll::ParameterValueTestL()
-	{
-	//Window Location & Dimension
-	TPoint winOrigin(-1,15);
-	TSize winSize(250,65);
-	
-	//Create a new window to perform the test; window needs to overlap the left edge of the screen.
-	CAnimWindow* paramTestWin = new(ELeave) CAnimWindow(EFalse, CAnimWindow::ERedraw);
-	CleanupStack::PushL(paramTestWin);
-	paramTestWin->ConstructL(winOrigin, winSize);
-
-	RTestAnim anim = RTestAnim(iAnimDll);
-
-	TPckgBuf<TRect> rectPckg;
-	TRect winRect(winOrigin, winSize);
-	rectPckg() = winRect;
-
-	anim.Construct(*(paramTestWin->BaseWin()), EAnimTypeTest3, rectPckg);
-	anim.Command(EADllStartAnimate, rectPckg);
-
-	TPckgBuf<TBool> boolPckg;
-	boolPckg() = ETrue;
-	anim.Command(EADllSetVisible, boolPckg);
-
-	TEST(anim.CommandReply(EADllParameterRectValueTest, rectPckg));
-
-	boolPckg() = EFalse;
-	anim.Command(EADllSetVisible, boolPckg);
-	anim.Command(EADllCancelAnimate);	
-	anim.Close();
-	CleanupStack::PopAndDestroy(paramTestWin);
-	}
-
-/**
-@SYMDEF             DEF122176
-
-@SYMTestCaseDesc    Test the operation of SetInterval with both negative and positive intervals
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     This test uses the test anim CAutoAnim3 in mode 3 which alternates
-					between drawing a large and a small ellipse at each interval.
-					The large ellipse is drawn first.
-					Note that the anims are redrawn at the rate of 2 intervals per second, so
-					setting an interval of 2 will mean that the anim is redrawn every second.
-						Step 1: The interval is set to be -2 and the test then waits for 0.9
-								seconds (to make sure one interval has passed) then checks that 
-								only the large ellipse has been drawn.							
-						Step 2: The interval is set to be 2 (redraw every second) and the test then 
-								waits for 1.2 seconds (to make sure two intervals have passed) and 
-								checks that the small ellipse has been drawn.
-					
-@SYMTestExpectedResults 
-					After Step 1 a large ellipse will be drawn on both windows.
-					After Step 1 a small ellipse will be drawn on both windows. 
-
-*/
-void CTAnimDll::TestSetIntervalL()
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	
-	// draws a little circle on the base window using window graphics and using window animation on the test window.
-	RTestAnim drawAnim=RTestAnim(iAnimDll);
-
-	_LIT(KLog1,"SetInterval Test");
-	LOG_MESSAGE(KLog1);
-	TRect rect(10,10,110,110);
-	CAnimWindow::SetEllipseDrawMode(CGraphicsContext::EDrawModePEN);
-	iTestWin->Invalidate();
-	iTestWin->SetRect(rect);
-	iBaseWin->Invalidate();
-	iBaseWin->SetRect(rect);
-	TPckgBuf<TRect> rectPckg;
-	rectPckg()=rect;
-	User::LeaveIfError(drawAnim.Construct(*iTestWin->BaseWin(),EAnimTypeTest3,rectPckg));	
-	
-	TPckgBuf<TInt> intPckg;
-	intPckg() = 3; // mode 3 for this anim flips between drawing a large and a small ellipse
-	drawAnim.Command(EADllSetMode, intPckg);
-	
-	intPckg() = MAnimGeneralFunctions::ESyncNone;
-	drawAnim.CommandReply(EADllDoSetSync, intPckg);	
-	
-	// Set an interval of -2 then wait 0.9 seconds, after which only the large ellipse should be visible 
-	intPckg() = -2;
-	drawAnim.CommandReply(EADllSetInterval, intPckg);
-	// Draw the large ellipse on the base window to match what the anim should be drawing
-	iBaseWin->SetRect(rect);	
-	iBaseWin->DoDraw();
-	ws.Finish();	
-	// Check Step 1 completed successfully
-	RedrawAndCheckWindows();	
-	
-	// Set an interval of 2 and wait 0.9 seconds, after which the small ellipse should be visible	
-	intPckg() = 2;
-	drawAnim.CommandReply(EADllSetInterval, intPckg);
-	// Draw the small ellipse on the base window to match what the anim should be drawing
-	iBaseWin->SetRect(TRect(40,40,80,80));	
-	iBaseWin->DoDraw();	
-	ws.Finish();
-	// Check Step 2 completed successfully
-	RedrawAndCheckWindows();		
-
-	// clean up
-	drawAnim.Close();
-	ws.Close();
-	}
-
-void CTAnimDll::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(KTest0,"RemoteBuffer");
-	_LIT(KTest1,"ExtraCopyTest");
-	_LIT(KTest2,"Misc");
-	_LIT(KTest3,"SyncMode1");
-	_LIT(KTest4,"Anim Dll Panics");
-	_LIT(KTest5,"Drawing test");
-	_LIT(KTest6,"Shadow drawing test");
-	_LIT(KTest7,"General drawing test");
-	_LIT(KTest8,"Destroy window test");
-	_LIT(KTest9,"Sprite Anim test");
-	_LIT(KTest10,"Free Timer test");
-	_LIT(KTest11,"Disable Timer test");
-	_LIT(KTest12,"Multiple Anims");
-	_LIT(KTest13,"ReLoad Click PlugIn");
-	_LIT(KTest14,"Window Functions");
-	_LIT(KTest15,"Window Functions 2");
-	_LIT(KTest16,"Notifications");
-	_LIT(KTest17,"Event Handler removal");
-	_LIT(KTest18,"Anim dll - Load Api Negative Test");
-	_LIT(KTest19,"Key Click Priority Test");
-	_LIT(KTest20,"CWsAnim::Parameters() WindowRect Value Test");
-	_LIT(KTest21,"SetInterval test");
-	_LIT(KTest22,"Client Window Coverage");
-	_LIT(KTest23,"Client Window Panic Coverage");
-	((CTAnimDllStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-
-//	if (iTest->iState==0) iTest->iState=22;	//Use this line to start running tests from a particular test
-	switch(++iTest->iState)
-		{
-		case 1:
-			((CTAnimDllStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0127"));
-			iTest->LogSubTest(KTest0);
-			RemoteBuffer();
-			break;
-		case 2:
-			((CTAnimDllStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0128"));
-			iTest->LogSubTest(KTest1);
-			ExtraCopyTest();
-			break;
-		case 3:
-			((CTAnimDllStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0126"));
-			iTest->LogSubTest(KTest2);
-			Misc();
-			break;
-		case 4:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0503
-*/
-			((CTAnimDllStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0503"));
-			iTest->LogSubTest(KTest3);
-// Disabled temporarily (process isolation/ RThread::RequestComplete issue) to allow WSERV test to continue
-			break;
-		case 5:
-			((CTAnimDllStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0125"));
-			iTest->LogSubTest(KTest4);
-			TestPanicsL();
-			if (iTest->iScreenNumber == 1)
-				iTest->CloseAllPanicWindows();
-			break;
-		case 6:
-			((CTAnimDllStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0129"));
-			iTest->LogSubTest(KTest5);
-			DrawingTestL();
-			break;
-		case 7:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0504
-*/
-			((CTAnimDllStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0504"));
-			iTest->LogSubTest(KTest6);
-// Disabled temporarily (process isolation/ RThread::RequestComplete issue) to allow WSERV test to continue
-			break;
-		case 8:
-			((CTAnimDllStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0130"));
-			iTest->LogSubTest(KTest7);
-			GeneralDrawingTestL();
-			break;
-		case 9:
-			((CTAnimDllStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0131"));
-			iTest->LogSubTest(KTest8);
-			DestroyWindowTestL();
-			break;
-		case 10:
-			((CTAnimDllStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0132"));
-			iTest->LogSubTest(KTest9);
-			SpriteAnimL();
-			break;
-		case 11:
-			((CTAnimDllStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0133"));
-			iTest->LogSubTest(KTest10);
-			FreeTimerL();
-			break;
-		case 12:
-			((CTAnimDllStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0134"));
-			iTest->LogSubTest(KTest11);
-			DisableTimerL();
-			break;
-		case 13:
-			((CTAnimDllStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0135"));
-			iTest->LogSubTest(KTest12);
-			MultipleAnimsL();
-			break;
-		case 14:
-			((CTAnimDllStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0136"));
-			iTest->LogSubTest(KTest13);
-			ClickPlugInL();
-			break;
-		case 15:
-			((CTAnimDllStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0137"));
-			iTest->LogSubTest(KTest14);
-			WinFunctionsL();
-			break;
-		case 16:
-			((CTAnimDllStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0138"));
-			iTest->LogSubTest(KTest15);
-			WinFunctions2L();
-			break;
-		case 17:
-			((CTAnimDllStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0139"));
-			iTest->LogSubTest(KTest16);
-			TestNotificationsL();
-			break;
-		case 18:
-			((CTAnimDllStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0137"));
-			iTest->LogSubTest(KTest17);
-			TestEventHandlerRemovalL();
-			break;
-		case 19:
-			((CTAnimDllStep*)iStep)->SetTestStepID(_L("GRAPHICS-CODEBASE-WSERV-0056-0001"));
-			iTest->LogSubTest(KTest18);			
-			TestLoadApiL();
-			break;
-		case 20:
-			((CTAnimDllStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0448"));
-			iTest->LogSubTest(KTest19);
-			KeyClickPriorityL();
-			break;
-		case 21:
- /**
-@SYMTestCaseID		GRAPHICS-WSERV-0505
-*/
-			((CTAnimDllStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0505"));
-			iTest->LogSubTest(KTest20);
-			ParameterValueTestL();
-			break;
-		case 22:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0506
-*/
-			((CTAnimDllStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0506"));
-			iTest->LogSubTest(KTest21);
-			TestSetIntervalL();
-		case 23:
-			((CTAnimDllStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0410"));
-			iTest->LogSubTest(KTest22);			
-			TestCoverageL();
-			break;
-		case 24:
-			((CTAnimDllStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0411"));
-			iTest->LogSubTest(KTest23);
-			TestPanicCoverageL();
-		default:
-			((CTAnimDllStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTAnimDllStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-		}
-	User::Check();
-	((CTAnimDllStep*)iStep)->RecordTestResultL();
-	}
-
-//
-
-CAnimRedrawWindow::CAnimRedrawWindow(CAnimWindow *aAnimWindow, TBool aIsBase) : CTWin(),
-	iAnimWindow(aAnimWindow),
-	iIsBase(aIsBase)
-	{
-	}
-
-CAnimRedrawWindow::~CAnimRedrawWindow()
-	{
-	}
-
-void CAnimRedrawWindow::Draw()
-	{
-	CAnimWindow::Draw(Gc(),Size(),iIsBase,iAnimWindow->iRect,EFalse);
-	}
-
-//
-
-CAnimWindow::CAnimWindow(TBool aIsBase, TWinType aWinType) : iWinType(aWinType), iIsBase(aIsBase)
-	{
-	}
-
-
-CAnimWindow::~CAnimWindow()
-	{
-	delete iCtWin;
-	}
-
-void CAnimWindow::ConstructL(const TPoint &aPos, const TSize &aSize)
-	{
-	switch(iWinType)
-		{
-		case ERedraw:
-			iCtWin=new(ELeave) CAnimRedrawWindow(this, iIsBase);
-			break;
-		case EBlank:
-			iCtWin=new(ELeave) CTBlankWindow();
-			break;
-		case EBackedUp:
-			iCtWin=new(ELeave) CTBackedUpWin(EGray4);
-			break;
-		}
-	iCtWin->SetUpL(aPos, aSize, TheClient->iGroup, *TheClient->iGc);
-	if (iWinType==ERedraw)
-		{
-		static_cast<CTWin*>(iCtWin)->Win()->EnableRedrawStore(EFalse);
-		}
-	}
-
-void CAnimWindow::SetEllipseDrawMode(CGraphicsContext::TDrawMode aEllipseDrawMode)
-	{
-	iEllipseDrawMode=aEllipseDrawMode;
-	}
-
-void CAnimWindow::SetRect(const TRect &aRect)
-	{
-	iRect=aRect;
-	}
-
-void CAnimWindow::DrawEllipse(CBitmapContext *aGc, const TRect &aRect)
-	{
-	aGc->SetDrawMode(iEllipseDrawMode);
-	aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	aGc->SetBrushColor(TRgb(85,85,85));
-	aGc->SetPenColor(TRgb(170,170,170));
-	aGc->DrawEllipse(aRect);
-	}
-
-void CAnimWindow::Draw(CBitmapContext *aGc, const TSize &aSize, TBool aIsBase, const TRect &aRect, TBool aBlankIt)
-	{
-	aGc->SetBrushColor(TRgb::Gray4(2));
-	aGc->Clear();
-	if (!aBlankIt)
-		for(TInt i=0;i<aSize.iWidth;i+=10)
-			aGc->DrawLine(TPoint(i,0),TPoint(i+10,aSize.iHeight));
-	if (aIsBase)
-		DrawEllipse(aGc, aRect);
-	}
-
-void CAnimWindow::DoDraw(TBool aBlankIt)
-	{
-	__ASSERT_ALWAYS(iWinType!=EBlank,AutoPanic(EAutoPanicWindowType));
-	iCtWin->Gc()->Activate(*(RDrawableWindow *)BaseWin());
-	Draw(iCtWin->Gc(),Size(),iIsBase,iRect,aBlankIt);
-	iCtWin->Gc()->Deactivate();
-	}
-
-void CAnimWindow::DoDrawEllipse()
-	{
-	__ASSERT_ALWAYS(iWinType!=EBlank,AutoPanic(EAutoPanicWindowType));
-	iCtWin->Gc()->Activate(*(RDrawableWindow *)BaseWin());
-	DrawEllipse(iCtWin->Gc(),iRect);
-	iCtWin->Gc()->Deactivate();
-	}
-
-void CAnimWindow::DoDrawCoverage()
-	{
-	__ASSERT_ALWAYS(iWinType!=EBlank,AutoPanic(EAutoPanicWindowType));
-	CWindowGc *gc = iCtWin->Gc();
-	gc->Activate(*(RDrawableWindow *)BaseWin());
-
-	gc->SetClippingRect(iRect);
-	gc->Clear();
-	gc->Clear(iRect);
-
-	gc->SetDrawMode(CGraphicsContext::EDrawModeAND);
-	gc->SetBrushStyle(CGraphicsContext::ENullBrush);
-	gc->SetBrushColor(TRgb::Gray256(85));
-	gc->SetBrushOrigin(TPoint(0,0));
-	gc->SetPenColor(TRgb::Gray256(170));
-
-	//primitive method calls
-	gc->SetFaded(ETrue);
-	gc->SetFadingParameters(1, 1);
-
-	gc->SetPenStyle(CGraphicsContext::ESolidPen);
-	gc->SetStrikethroughStyle(EStrikethroughOff);
-	gc->SetUnderlineStyle(EUnderlineOff);
-	gc->SetWordJustification(2, 1);
-
-	CFbsFont* font;
-	gc->Device()->GetNearestFontInTwips((CFont*&)font, TFontSpec());
-
-	gc->UseFont(font);
-	
-	gc->DrawArc(iRect,
-			TPoint(iRect.Center().iX, iRect.iTl.iY),
-			TPoint(iRect.iBr.iX, iRect.Center().iY));
-	gc->DrawLine(iRect.iTl,iRect.Center());
-	gc->DrawLineTo(TPoint(iRect.iBr.iX, iRect.iTl.iY));
-
-	gc->DrawLineBy(TPoint(iRect.iTl.iX, iRect.iBr.iY));
-	gc->MoveBy(iRect.iTl + TPoint(1,1));
-	gc->MoveTo(iRect.iTl + TPoint(0,0)); 
-	gc->SetPenSize(TSize(10,10));
-	gc->Plot(iRect.iTl + TPoint(2,2));
-	gc->SetPenSize(TSize(1,1));
-
-	CArrayFixFlat<TPoint>* polyPoints = new(ELeave) CArrayFixFlat<TPoint>(3); //CArrayFixFlat
-	CleanupStack::PushL(polyPoints);
-	polyPoints->AppendL(iRect.iTl);
-	polyPoints->AppendL(iRect.Center());
-	polyPoints->AppendL(TPoint(iRect.iBr.iX, iRect.iTl.iY));
-	
-	gc->DrawPolyLine(polyPoints);
-	gc->DrawPolyLine(&polyPoints->At(0), 3);
-	gc->DrawPolygon(polyPoints, CGraphicsContext::EWinding);
-	gc->DrawPolygon(&polyPoints->At(0), 3, CGraphicsContext::EAlternate);
-
-	gc->DrawPie(iRect, TPoint(iRect.Center().iX, iRect.iTl.iY), TPoint(iRect.iBr.iX, iRect.Center().iY));
-	gc->DrawEllipse(iRect);
-	gc->DrawRect(iRect);
-	gc->DrawRoundRect(iRect, TSize(iRect.Width()/8, iRect.Height()/8));
-
-	CleanupStack::PopAndDestroy(polyPoints);
-
-	gc->CopyRect(TPoint(10, 10), iRect);
-
-	CFbsBitmap* bitmap = new(ELeave) CFbsBitmap();
-	CleanupStack::PushL(bitmap);
-	User::LeaveIfError(bitmap->Create(TSize(16,16),EGray4));
-
-	gc->UseBrushPattern(bitmap);
-	gc->DrawBitmap(iRect.iTl, bitmap);
-	gc->DrawBitmap(iRect, bitmap);
-	gc->DrawBitmap(iRect, bitmap, TRect(0, 0, 16, 16));
-	gc->DrawBitmapMasked(iRect, bitmap, TRect(0, 0, 16, 16), bitmap, ETrue);
-
-	gc->BitBlt(TPoint(0, 0), bitmap);
-	gc->BitBlt(TPoint(0, 0), bitmap, iRect);
-	gc->BitBltMasked(TPoint(0, 0), bitmap, iRect, bitmap, ETrue);
-	gc->AlphaBlendBitmaps(TPoint(0, 0), bitmap, iRect, bitmap, TPoint(0,0));
-	
-	CleanupStack::PopAndDestroy(bitmap);
-
-	_LIT(KHelloWorld,"Hello World");
-	gc->SetCharJustification(1,1);
-	gc->SetClippingRect(iRect);
-	gc->DrawText(*&KHelloWorld, iRect.iTl);
-	gc->DrawText(*&KHelloWorld, iRect, 0, CGraphicsContext::ELeft, 0);
-	gc->DrawTextVertical(*&KHelloWorld, iRect.iBr, ETrue);
-	gc->DrawTextVertical(*&KHelloWorld, iRect, 0, ETrue, CGraphicsContext::ELeft, 0);
-
-	TRgb rgbs[2];
-	gc->MapColors(iRect, rgbs, 1, ETrue);
-	gc->DiscardBrushPattern();
-
-	gc->DiscardFont();
-	gc->Device()->ReleaseFont(font);
-
-	gc->Deactivate();
-	}
-
-TSize CAnimWindow::Size()
-	{
-	return(iCtWin->Size());
-	}
-
-RWindowBase *CAnimWindow::BaseWin() const
-	{
-	return(iCtWin->BaseWin());
-	}
-
-CTBaseWin *CAnimWindow::CtBaseWin()
-	{
-	return(iCtWin);
-	}
-
-void CAnimWindow::Invalidate()
-	{
-	CTUser::Splat(TheClient,TRect(iCtWin->Position(),iCtWin->Size()),TRgb::Gray256(0));
-	}
-
-void CAnimWindow::Invalidate(const TRect &aRect)
-	{
-	TRect rect(aRect);
-	rect.Move(iCtWin->Position());
-	CTUser::Splat(TheClient,rect,TRgb::Gray256(0));
-	}
-
-void CAnimWindow::DrawTestScreen(CFbsBitmap *aBitmap, CFbsBitmap *aMaskBitmap, CFbsFont *aFont)
-	{
-	iCtWin->Gc()->Activate(*(RDrawableWindow *)BaseWin());
-	CBitmapContext *gc=iCtWin->Gc();
-	TSize size(Size());
-	TBool aExtraDrawBitMap=ETrue;
-//
-#include "DLLDRAW.H"
-//
-	iCtWin->Gc()->Deactivate();
-	}
-
-
-__WS_CONSTRUCT_STEP__(AnimDll)
--- a/windowing/windowserver/tauto/TAUTODLL.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,162 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TAUTODLL_H__
-#define __TAUTODLL_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-
-#include <w32adll.h>
-#include "AUTODLL.H"
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-#include "../nonnga/CLIENT/w32comm.h"
-#endif
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-#include "../nga/CLIENT/w32comm.h"
-#endif
-
-#include "tdirecta.h"
-
-
-class CAnimWindow;
-
-class CAnimRedrawWindow : public CTWin
-	{
-public:
-	CAnimRedrawWindow(CAnimWindow *aAnimWindow, TBool aIsBase);
-	~CAnimRedrawWindow();
-	void Draw();
-private:
-	CAnimWindow *iAnimWindow;
-	TBool iIsBase;
-	};
-
-class CAnimWindow : public CBase
-	{
-	friend class CTAnimDll;
-	friend class CAnimRedrawWindow;
-public:
-	enum TWinType
-		{
-		ERedraw,
-		EBlank,
-		EBackedUp,
-		};
-public:
-	CAnimWindow(TBool aIsBase, TWinType aWinType);
-	~CAnimWindow();
-	void ConstructL(const TPoint &aPos, const TSize &aSize);
-	void SetRect(const TRect &aRect);
-	static void Draw(CBitmapContext *aGc, const TSize &aSize, TBool aIsBase,const TRect &aRect, TBool aBlankIt);
-	static void DrawEllipse(CBitmapContext *aGc, const TRect &aRect);
-	void DoDraw(TBool aBlankIt=EFalse);
-	void DoDrawEllipse();
-	void DoDrawCoverage();
-	TSize Size();
-	RWindowBase *BaseWin() const;
-	CTBaseWin *CtBaseWin();
-	void Invalidate();
-	void Invalidate(const TRect &aRect);
-	static void SetEllipseDrawMode(CGraphicsContext::TDrawMode aEllipseDrawMode);
-	void DrawTestScreen(CFbsBitmap *aBitmap, CFbsBitmap *aMaskBitmap, CFbsFont *aFont);
-protected:
-	CTBaseWin *iCtWin;
-	TWinType iWinType;
-	TBool iIsBase;
-	TRect iRect;
-	static CGraphicsContext::TDrawMode iEllipseDrawMode;
-	};
-
-
-
-class CTAnimDll : public CTWsGraphicsBase
-	{
-public:
-	CTAnimDll(CTestStep* aStep);
-	~CTAnimDll();
-	void ConstructL();
-
-	void TestPanicsL();
-	void RemoteBuffer();
-	void Misc();
-	void ExtraCopyTest();
-	void SyncMode1();
-	void TestSyncModes(MAnimGeneralFunctions::TAnimSync aSyncMode);
-	void TestTimeChange();
-	void TestLoadApiL();
-	void KeyClickPriorityL();
-protected:	//Pure virtual from MTestCases
-	void RunTestCaseL(TInt aCurTestCase);
-private:
-	void InvalidatePauseAndRedraw(const TRect &aRect,TTimeIntervalMicroSeconds32 aInterval);	
-	void RedrawAndCheckWindows(TBool aBlankIt=EFalse);
-	void SetUpMember(TSpriteMember &aMember,TInt aType);
-	void DrawingTestL();
-	void ShadowDrawingTestL();
-	void GeneralDrawingTestL();
-	void CheckWindows();
-	void DestroyWindowTestL();
-	void SpriteAnimL();
-	void FreeTimerL();
-	void DisableTimerL();
-	void MultipleAnimsL();
-	void ClickPlugInL();
-	void WinFunctionsL();
-	void WinFunctions2L();
-	void TestNotificationsL();
-	void TestCoverageL();
-	void TestPanicCoverageL();
-	void TestWindowInfo(RTestAnim& aAnim,TInt aScreen,TInt aPos,TInt aId);
-	void TestEventHandlerRemovalL();
-	void ParameterValueTestL();
-	void TestSetIntervalL();
-	TInt CheckError(TInt aError,TInt aExpected);
-	TRgb PixelColour(const TPoint& aPoint) const;
-private:
-	RAnimDll iAnimDll;
-	TSize iWinSize;
-	CAnimWindow *iTestWin;
-	CAnimWindow *iRedrawWin;
-	CAnimWindow *iBaseWin;
-	CAnimWindow *iBackedUpTestWin;
-	CAnimWindow *iBlankTestWin;
-	};
-
-class CTAnimDllStep : public CTGraphicsStep
-	{
-public:
-	CTAnimDllStep();
-protected:
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTAnimDllStep,"TAnimDll");
-
-
-#endif
--- a/windowing/windowserver/tauto/TAlphaChannel.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1936 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// An alpha channel test case. 
-// Output different graphics primitives in each window using three graphics modes
-// for pen and brush : semi-transparent,transparent, opaque
-// Test also exercises anti-aliasing and fading for 16MA display mode
-// Moves sprite on the window. Tests a sprite functionality.
-// Creates RBackedUpWindow window and moves it over transparent window,
-// hides and shows it.
-// Moves windows on the screen, overlaps them
-// Actions:
-// Create a background window, and five foreground windows:
-// -transparent and semi-transparent 
-// -transparent with transparency factor
-// -not transparent
-// 
-//
-
-#include "TAlphaChannel.H"
-
-const TInt KWindowIndention = 2;
-const TInt KSizeKoeff = 15;
-
-
-LOCAL_D TPtrC ColumnName[]={
-	_L("Opaque"),
-	_L("Semi-transparent"),
-	_L("Transparent"),
-	_L(""),
-	_L(""),
-	_L(""),
-	};
-
-LOCAL_D TPtrC RowName[]={
-	_L("n"),
-	_L("and"),
-	_L("or"),
-	_L("xor"),
-	_L(""),
-	_L(""),
-	};
-
-
-//
-//
-CTAlphaChannel::CTAlphaChannel(CTestStep* aStep):
-	CTWsGraphicsBase(aStep), iArrWindow(8)
-	{
-	}
-
-CTAlphaChannel::~CTAlphaChannel()
-	{
-	delete iBitmap64K_1;
-	delete iBitmap16MA_1;
-	delete iBitmap64K_2;
-	delete iBitmap16MA_2;
-	delete iBitmap64K_3;
-	delete iBitmap16MA_3;
-
-	delete iBitmapMask;
-	delete iBitmapGray256Mask;
-	
-	delete iBitmapContext64K_1;
-	delete iBitmapContext16MA_1;
-	delete iBitmapContext64K_2;
-	delete iBitmapContext16MA_2;
-	delete iBitmapContext64K_3;
-	delete iBitmapContext16MA_3;
-
-	delete iBitmapDevice64K_1;
-	delete iBitmapDevice16MA_1;
-	delete iBitmapDevice64K_2;
-	delete iBitmapDevice16MA_2;
-	delete iBitmapDevice64K_3;
-	delete iBitmapDevice16MA_3;
-
-	delete iBackgroundWindow;
-	
-	
-	iArrWindow.ResetAndDestroy();
-	
-	if(iFont)
-		TheClient->iScreen->ReleaseFont(iFont);
-	if(iFont1)
-		TheClient->iScreen->ReleaseFont(iFont1);
-	
-	BaseWin->SetVisible(ETrue);
-	TestWin->SetVisible(ETrue);
-	}
-
-void CTAlphaChannel::ConstructL()
-	{
-	const TInt KIndent = 10;
-	BaseWin->SetVisible(EFalse);
-	TestWin->SetVisible(EFalse);
-
-	iText = _L("This is a text");
-	iBrushStyle = CGraphicsContext::ESolidBrush;
-	iPenTable = KRgbBlack;
-
-	TSize screenSize=TheClient->iGroup->Size();
-	TInt winWidth=(screenSize.iWidth)-KIndent;
-	TInt winHeight=screenSize.iHeight-KIndent;
-	TDisplayMode dispMode = EColor64K;
-	
-	//background opaque window
-	iBackgroundWindow = new (ELeave) CTWinAlpha();
-	iBackgroundWindow->SetUpL(TPoint(5,5),TSize(winWidth,winHeight),TheClient->iGroup,*TheClient->iGc, &dispMode);
-	RWindow *theWin = (RWindow*) (iBackgroundWindow->DrawableWin());
-	theWin->SetBackgroundColor(TRgb(255, 0, 0));
-	iBackgroundWindow->DrawNow();
-
-	iSizeForegroundWindow.iWidth = (winWidth - KWindowIndention * 4) / 5 ;
-	iSizeForegroundWindow.iHeight = winHeight;
-	
-	CalculateSizePrimitives(iSizeForegroundWindow);
-
-	//-------------create bitmaps
-	//create 64K bitmap
-	iBitmap64K_1 = new (ELeave) CFbsBitmap ;
-	iBitmap64K_1->Create(iBitmapSize,EColor64K);
-	iBitmap64K_2 = new (ELeave) CFbsBitmap ;
-	iBitmap64K_2->Create(iBitmapSize,EColor64K);
-	iBitmap64K_3 = new (ELeave) CFbsBitmap ;
-	iBitmap64K_3->Create(iBitmapSize,EColor64K);
-	iBitmapDevice64K_1 = CFbsBitmapDevice::NewL(iBitmap64K_1);
-	iBitmapDevice64K_1->CreateContext(iBitmapContext64K_1);
-	iBitmapDevice64K_2 = CFbsBitmapDevice::NewL(iBitmap64K_2);
-	iBitmapDevice64K_2->CreateContext(iBitmapContext64K_2);
-	iBitmapDevice64K_3 = CFbsBitmapDevice::NewL(iBitmap64K_3);
-	iBitmapDevice64K_3->CreateContext(iBitmapContext64K_3);
-	
-	//create 16MA bitmap
-	iBitmap16MA_1 = new (ELeave) CFbsBitmap ;
-	iBitmap16MA_1->Create(iBitmapSize, EColor16MA);
-	iBitmap16MA_2 = new (ELeave) CFbsBitmap ;
-	iBitmap16MA_2->Create(iBitmapSize, EColor16MA);
-	iBitmap16MA_3 = new (ELeave) CFbsBitmap ;
-	iBitmap16MA_3->Create(iBitmapSize, EColor16MA);
-
-	iBitmapDevice16MA_1 = CFbsBitmapDevice::NewL(iBitmap16MA_1);
-	iBitmapDevice16MA_1->CreateContext(iBitmapContext16MA_1);
-	iBitmapDevice16MA_2 = CFbsBitmapDevice::NewL(iBitmap16MA_2);
-	iBitmapDevice16MA_2->CreateContext(iBitmapContext16MA_2);
-	iBitmapDevice16MA_3 = CFbsBitmapDevice::NewL(iBitmap16MA_3);
-	iBitmapDevice16MA_3->CreateContext(iBitmapContext16MA_3);
-
-	//create mask bitmap
-	iBitmapMask = new (ELeave) CFbsBitmap ;
-	iBitmapMask->Create(iBitmapSize, EGray2);
-	
-	CFbsBitmapDevice* theBitmapDevice = CFbsBitmapDevice::NewL(iBitmapMask);
-	CGraphicsContext*  theBitmapContext = NULL;
-	theBitmapDevice->CreateContext(theBitmapContext);
-	TRect rect = TRect(iBitmapMask->SizeInPixels());
-	theBitmapContext->SetBrushColor(KRgbWhite);
-   	theBitmapContext->SetPenColor(KRgbWhite);
-   	theBitmapContext->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	theBitmapContext->DrawRect(rect);
-
-	rect.Shrink(4, 4);
-	theBitmapContext->SetBrushColor(KRgbBlack);
-	theBitmapContext->SetPenColor(KRgbBlack);
-	theBitmapContext->DrawEllipse(rect);
-	delete theBitmapContext;
-	delete theBitmapDevice;
-	
-	//create 256gray bitmap mask
-	iBitmapGray256Mask = new (ELeave) CFbsBitmap;
-	iBitmapGray256Mask->Create(iBitmapSize, EGray256);
-	theBitmapDevice = CFbsBitmapDevice::NewL(iBitmapGray256Mask);
-	theBitmapDevice->CreateContext(theBitmapContext);
-	
-	if(iBitmapSize != TSize(0, 0))
-		{
-	//fill bitmap with 256 gradation of gray
-		TInt theStep = 256 / iBitmapGray256Mask->SizeInPixels().iWidth;
-	
-		for(TInt ii = 0; ii < iBitmapGray256Mask->SizeInPixels().iWidth; ii++)
-			{
-			TInt theSingleCol = theStep * ii; 
-			TRgb theCol(theSingleCol, theSingleCol, theSingleCol);
-			theBitmapContext->SetBrushColor(theCol);
-			theBitmapContext->SetPenColor(theCol);
-			TPoint ptFrom(ii, 0);
-			TPoint ptTo(ii, iBitmapGray256Mask->SizeInPixels().iHeight);
-			theBitmapContext->DrawLine(ptFrom, ptTo);
-			}
-		}
-	delete theBitmapContext;
-	delete theBitmapDevice;
-	//--------------
-	TFontSpec fontSpec(KTestFontTypefaceName,600);
-
-	fontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightBold);
-	fontSpec.iFontStyle.SetBitmapType(EAntiAliasedGlyphBitmap);
-	
-	User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInTwips(iFont, fontSpec));
-	
-	TFontSpec fontSpec1(KTestFontTypefaceName,100);
-	User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInTwips(iFont1, fontSpec1));
-	}
-
-void CTAlphaChannel::CalculateSizePrimitives(const TSize& aSize)
-	{
-	TInt theLen = aSize.iWidth / KSizeKoeff;
-	
-	iBitmapSize = TSize(2 * theLen, 2 * theLen);
-	iRectangleSize = TSize(2 * theLen, 2 * theLen);
-	iEllipseSize = TSize(4 * theLen, 2 * theLen);
-	iTriangleSize = TSize(3 * theLen, 2 * theLen);
-	iFirstCellWidth = static_cast <TInt> (1.2 * theLen);
-	iFirstCellHeight = static_cast <TInt> (1.5 * theLen);
-	}
-
-void CTAlphaChannel::DrawOffscreenBitmapsL(const TRgb& /*aPen*/, const TRgb& aBrush,
-										CGraphicsContext* aBitmapContext64K, CGraphicsContext* aBitmapContext16MA, 
-										CFbsBitmap* aBitmap64K, CFbsBitmap* aBitmap16MA)
-	{
-
-	if(aBitmapContext64K && aBitmap64K)
-		{
-		SEpocBitmapHeader header = aBitmap64K->Header();
-		TInt source_buffer_size = header.iBitmapSize / header.iSizeInPixels.iHeight * header.iBitsPerPixel ;
-		TUint8* buffer = new(ELeave) TUint8[source_buffer_size];
-		TPtr8 source_ptr(buffer, source_buffer_size, source_buffer_size);
-		
-		TUint16* bufferCur = reinterpret_cast<TUint16*> (buffer);
-		TInt ii;
-		for(ii = 0; ii < header.iSizeInPixels.iWidth; ++ii)
-			{
-			*bufferCur = aBrush._Color64K();
-			bufferCur ++;
-			}
-	
-		for(ii = 0; ii < header.iSizeInPixels.iHeight; ++ii)
-			{
-			aBitmap64K -> SetScanLine(source_ptr, ii);
-			}
-		
-		delete [] buffer;
-		}
-		
-	if(aBitmapContext16MA && aBitmap16MA)
-		{
-		SEpocBitmapHeader header = aBitmap16MA -> Header();
-		TInt source_buffer_size = header.iBitmapSize / header.iSizeInPixels.iHeight * header.iBitsPerPixel ;
-		TUint8* buffer = new(ELeave) TUint8[source_buffer_size];
-		TPtr8 source_ptr(buffer, source_buffer_size, source_buffer_size);
-		
-		TUint32* bufferCur = reinterpret_cast<TUint32*> (buffer);
-		TInt ii;
-		for(ii = 0; ii < header.iSizeInPixels.iWidth; ++ii)
-			{
-			*bufferCur = aBrush._Color16MA();
-			bufferCur ++;
-			}
-	
-		for(ii = 0; ii < header.iSizeInPixels.iHeight; ++ii)
-			{
-			aBitmap16MA -> SetScanLine(source_ptr, ii);
-			}
-		
-		delete [] buffer;
-		}
-	
-	}
-
-enum {EOpaque, ESemiTrans, ETrans};
-
-TRgb CTAlphaChannel::GetBrush(TInt aIndex) const
-	{
-	switch(aIndex)
-		{
-			case EOpaque:
-			return TRgb(0, 0, 255, 255);
-			case ESemiTrans:
-			return TRgb(0, 0, 255, 128);
-			case ETrans:
-			return TRgb(0, 0, 255, 0);
-			default : break;
-		}
-		
-	return 	TRgb(0, 0, 255, 255);
-	}
-
-TRgb CTAlphaChannel::GetPen(TInt aIndex) const
-	{
-	switch(aIndex)
-		{
-			case EOpaque:
-			return TRgb(0, 0, 255, 255);
-			case ESemiTrans:
-			return TRgb(0, 0, 255, 128);
-			case ETrans:
-			return TRgb(0, 0, 255, 0);
-			default : break;
-		}
-		
-	return 	TRgb(0, 0, 255, 255);
-	}
-   
-CGraphicsContext::TDrawMode CTAlphaChannel::GetDrawMode(TInt /*aIndex*/) const
-	{
-	return CGraphicsContext::EDrawModePEN;
-	}
-
-enum {EAll64K, EAll16MA, EAllDifferent};// later may add EAll16M
-void CTAlphaChannel::SetDisplayModeConfiguration(TInt aConfig)
-	{
-	switch (aConfig)
-		{
-	case EAll64K:
-		if(iForegroundWindowOpaque)
-			iForegroundWindowOpaque->SetDisplayMode(EColor64K);
-		if(iForegroundWindowSemiTrans)
-			iForegroundWindowSemiTrans->SetDisplayMode(EColor64K);
-		if(iForegroundWindowTrans)
-			iForegroundWindowTrans->SetDisplayMode(EColor64K);
-		break;
-	case EAll16MA:
-		if(iForegroundWindowOpaque)
-			iForegroundWindowOpaque->SetDisplayMode(EColor16MA);
-		if(iForegroundWindowSemiTrans)
-			iForegroundWindowSemiTrans->SetDisplayMode(EColor16MA);
-		if(iForegroundWindowTrans)
-			iForegroundWindowTrans->SetDisplayMode(EColor16MA);
-		break;
-	case EAllDifferent:
-		if(iForegroundWindowOpaque)
-			iForegroundWindowOpaque->SetDisplayMode(EColor256);
-		if(iForegroundWindowSemiTrans)
-			iForegroundWindowSemiTrans->SetDisplayMode(EColor64K);
-		if(iForegroundWindowTrans)
-			iForegroundWindowTrans->SetDisplayMode(EColor16MA);
-		break;
-		}
-	}
-
-enum {ETiled, EOverlapping};
-
-void CTAlphaChannel::SetPositionConfiguration(TInt aConfig)
-	{
-	TSize screenSize=TheClient->iGroup->Size();
-	TInt winWidth=(screenSize.iWidth)-10;
-	TInt winHeight=screenSize.iHeight-10;
-	if (aConfig==ETiled)
-		{
-		if(iForegroundWindowOpaque)
-			iForegroundWindowOpaque->SetPos(TPoint(winWidth/5, 0));
-		if(iForegroundWindowSemiTrans)
-			iForegroundWindowSemiTrans->SetPos(TPoint(2*winWidth/5, 0));
-		if(iForegroundWindowTrans)
-			iForegroundWindowTrans->SetPos(TPoint(3*winWidth/5, 0));
-		}
-	else
-		{
-		if(iForegroundWindowOpaque)
-			iForegroundWindowOpaque->SetPos(TPoint(winWidth/3, -winHeight/3));
-		if(iForegroundWindowSemiTrans)
-			iForegroundWindowSemiTrans->SetPos(TPoint(2*winWidth/5, winHeight/3));
-		if(iForegroundWindowTrans)
-			iForegroundWindowTrans->SetPos(TPoint(winWidth/2, -winHeight/3));
-		}
-	if (iForegroundWindowBottom)
-		iForegroundWindowBottom->SetPos(TPoint(0, 0));
-	if (iForegroundWindowTop)
-		iForegroundWindowTop->SetPos(TPoint(4*winWidth/5, 0));
-	}
-
-enum {EVaryingTransparency, EVaryingColour};
-
-void CTAlphaChannel::SetColourConfiguration(TInt aConfig)
-	{
-	RWindow* win;
-	if (aConfig==EVaryingTransparency)
-		{
-		// red background, green foregrounds of varying transparency
-		win = (RWindow*)(iBackgroundWindow->DrawableWin());
-		win->SetBackgroundColor(TRgb(255,0,0,255));
-
-		if(iForegroundWindowOpaque)
-			iForegroundWindowOpaque->SetBackgroundColor(TRgb(0,255,0,255));
-		if(iForegroundWindowSemiTrans)
-			iForegroundWindowSemiTrans->SetBackgroundColor(TRgb(0,255,0,128));
-		if(iForegroundWindowTrans)
-			iForegroundWindowTrans->SetBackgroundColor(TRgb(0,255,0,0));
-		}
-	else
-		{
-		// white background, semi-transparent foregrounds in primary colours
-		win = (RWindow*)(iBackgroundWindow->DrawableWin());
-		win->SetBackgroundColor(TRgb(255,255,255,255));
-
-		if(iForegroundWindowOpaque)
-			iForegroundWindowOpaque->SetBackgroundColor(TRgb(255,0,0,128));
-		if(iForegroundWindowSemiTrans)
-			iForegroundWindowSemiTrans->SetBackgroundColor(TRgb(0,255,0,128));
-		if(iForegroundWindowTrans)
-			iForegroundWindowTrans->SetBackgroundColor(TRgb(0,0,255,128));
-		}
-	}
-
-void CTAlphaChannel::DoMoving()
-	{
-	TPoint pos;
-	for (TInt i = 0; i<20; i++)
-		{
-		if (iForegroundWindowBottom)
-			{
-			pos = iForegroundWindowBottom->Position();
-			pos += TPoint(1,5);
-			iForegroundWindowBottom->SetPos(pos);
-			}
-
-		if (iForegroundWindowOpaque)
-			{
-			pos = iForegroundWindowOpaque->Position();
-			pos += TPoint(1,5);
-			iForegroundWindowOpaque->SetPos(pos);
-			}
-
-		if (iForegroundWindowSemiTrans)
-			{
-			pos = iForegroundWindowSemiTrans->Position();
-			pos += TPoint(1,5);
-			iForegroundWindowSemiTrans->SetPos(pos);
-			}
-
-		if (iForegroundWindowTrans)
-			{
-			pos = iForegroundWindowTrans->Position();
-			pos += TPoint(1,5);
-			iForegroundWindowTrans->SetPos(pos);
-			}
-
-		if (iForegroundWindowTop)
-			{
-			pos = iForegroundWindowTop->Position();
-			pos += TPoint(1,5);
-			iForegroundWindowTop->SetPos(pos);
-			}
-
-		TheClient->iWs.Flush();	
-		User::After(TTimeIntervalMicroSeconds32(50000));
-		}
-
-	}
-
-void CTAlphaChannel::DoMoveBehind()
-	{
-	TPoint pos = iBackgroundWindow->Position();
-	for (TInt i = 0; i<20; i++)
-		{
-		pos += TPoint(0,5);
-		iBackgroundWindow->SetPos(pos);
-
-		TheClient->iWs.Flush();	
-		User::After(TTimeIntervalMicroSeconds32(50000));
-		}
-	iBackgroundWindow->SetPos(TPoint(5,5));
-	}
-
-void CTAlphaChannel::DoInvisibility()
-	{
-	RWindow* win;
-	if (iForegroundWindowBottom)
-		{
-		win = (RWindow*)(iForegroundWindowBottom->DrawableWin());
-		win->SetVisible(EFalse);
-		TheClient->iWs.Flush();	
-		User::After(TTimeIntervalMicroSeconds32(1000000));
-
-		win->SetVisible(ETrue);
-		TheClient->iWs.Flush();	
-		User::After(TTimeIntervalMicroSeconds32(1000000));
-		}
-	if (iForegroundWindowOpaque)
-		{
-		win = (RWindow*)(iForegroundWindowOpaque->DrawableWin());
-		win->SetVisible(EFalse);
-		TheClient->iWs.Flush();	
-		User::After(TTimeIntervalMicroSeconds32(1000000));
-
-		win->SetVisible(ETrue);
-		TheClient->iWs.Flush();	
-		User::After(TTimeIntervalMicroSeconds32(1000000));
-		}
-	if (iForegroundWindowSemiTrans)
-		{
-		win = (RWindow*)(iForegroundWindowSemiTrans->DrawableWin());
-		win->SetVisible(EFalse);
-		TheClient->iWs.Flush();	
-		User::After(TTimeIntervalMicroSeconds32(1000000));
-
-		win->SetVisible(ETrue);
-		TheClient->iWs.Flush();	
-		User::After(TTimeIntervalMicroSeconds32(1000000));
-		}
-	if (iForegroundWindowTrans)
-		{
-		win = (RWindow*)(iForegroundWindowTrans->DrawableWin());
-		win->SetVisible(EFalse);
-		TheClient->iWs.Flush();	
-		User::After(TTimeIntervalMicroSeconds32(1000000));
-
-		win->SetVisible(ETrue);
-		TheClient->iWs.Flush();	
-		User::After(TTimeIntervalMicroSeconds32(1000000));
-		}
-	if (iForegroundWindowTop)
-		{
-		win = (RWindow*)(iForegroundWindowTop->DrawableWin());
-		win->SetVisible(EFalse);
-		TheClient->iWs.Flush();	
-		User::After(TTimeIntervalMicroSeconds32(1000000));
-
-		win->SetVisible(ETrue);
-		TheClient->iWs.Flush();	
-		User::After(TTimeIntervalMicroSeconds32(1000000));
-		}
-	}
-
-/** 
-	@SYMTestCaseID	GRAPHICS-WSERV-0328
-  	
-  	@SYMTestCaseDesc			Testing a Fading.
-  	
-  	@SYMTestPriority			High
-  	
-  	@SYMTestStatus      		Implemented
-  	
-  	@SYMTestActions		
-		 Set fading parameters. Draw all graphics primitives and bitmaps with 
-		 various transparency				.
- 
-  	@SYMTestExpectedResults
- 				All windows should be drawn according their fading values. 
- */
-
-void CTAlphaChannel::TestFading()
-	{
-	iIsFading = ETrue;
-	iBlackFading = 0;
-	iWhiteFading = 128;
-	iText.Format(_L("Fading. %dX%d"), iBlackFading, iWhiteFading);
-	INFO_PRINTF1(iText);
-	DrawTestWindowsNow();
-
-	User::After(TTimeIntervalMicroSeconds32(1000000 * 1));
-	iIsFading = EFalse;
-	DrawTestWindowsNow();
-	iIsFading = ETrue;
-	iBlackFading = 128;
-	iWhiteFading = 255;
-	iText.Format(_L("Fading. %dX%d"), iBlackFading, iWhiteFading);
-	INFO_PRINTF1(iText);
-	DrawTestWindowsNow();
-
-	iIsFading = EFalse;
-	}
-	
-/** 
-	@SYMTestCaseID	GRAPHICS-WSERV-0329
-  	
-  	@SYMTestCaseDesc			Tests moving of foreground windows.
-  	
-  	@SYMTestPriority			High
-  	
-  	@SYMTestStatus      		Implemented
-  	
-  	@SYMTestActions		
-		 Set fading parameters. Set position of foreground windows as tile				.
- 
-  	@SYMTestExpectedResults
- 			Foreground window has to be redrawn properly.
- */
-
-void CTAlphaChannel::TestMoving()
-	{
-	SetPositionConfiguration(ETiled);
-	DoMoving();
-	SetPositionConfiguration(ETiled);
-	}
-
-/** 
-	@SYMTestCaseID	GRAPHICS-WSERV-0330
-  	
-  	@SYMTestCaseDesc			Tests moving of foreground windows.
-  	
-  	@SYMTestPriority			High
-  	
-  	@SYMTestStatus      		Implemented
-  	
-  	@SYMTestActions		
-		 Set fading parameters. Moves foreground windows over the screen			.
- 
-  	@SYMTestExpectedResults
- 			Foreground window has to be redrawn properly.
- */
-
-
-void CTAlphaChannel::TestMovingOverlapping()
-	{
-	TPoint pos;
-
-	for (TInt i = 0; i < 20; i++)
-		{
-		if (iForegroundWindowOpaque)
-			{
-			pos = iForegroundWindowOpaque->Position();
-			pos += TPoint(3,0);
-			iForegroundWindowOpaque->SetPos(pos);
-			}
-		if (iForegroundWindowTrans)
-			{
-			pos = iForegroundWindowTrans->Position();
-			pos -= TPoint(3,0);
-			iForegroundWindowTrans->SetPos(pos);
-			}
-		TheClient->iWs.Flush();	
-		User::After(TTimeIntervalMicroSeconds32(50000));
-		}
-	}
-
-/** 
-	@SYMTestCaseID	GRAPHICS-WSERV-0331
-  	
-  	@SYMTestCaseDesc			Testing transparency factor for windows with alpha channel.
-  	
-  	@SYMTestPriority			High
-  	
-  	@SYMTestStatus      		Implemented
-  	
-  	@SYMTestActions		
-		 Sets background colour with various level of transparency			.
- 
-  	@SYMTestExpectedResults
- 			Foreground window must be redrawn properly.
- */
-void CTAlphaChannel::TestChangingTransparencyFactor()
-	{
-	TInt i = 0;
-	while (i <= 255)
-		{
-		iForegroundWindowOpaque->SetBackgroundColor(TRgb(0,255,0,255-i));
-		iForegroundWindowTrans->SetBackgroundColor(TRgb(0,255,0,i));
-		iForegroundWindowOpaque->DrawNow();
-		iForegroundWindowTrans->DrawNow();
-		i+=15;
-		}
-	i=0;
-	while (i <= 255)
-		{
-		iForegroundWindowOpaque->SetBackgroundColor(TRgb(0,255,0,i));
-		iForegroundWindowTrans->SetBackgroundColor(TRgb(0,255,0,255-i));
-		iForegroundWindowOpaque->DrawNow();
-		iForegroundWindowTrans->DrawNow();
-		User::After(TTimeIntervalMicroSeconds32(50000));// 20 frames per second
-		i+=15;
-		}
-	}
-
-/** 
-	@SYMTestCaseID	GRAPHICS-WSERV-0332
-  	
-  	@SYMTestCaseDesc			Testing redrawing of foreground windows while their positions and 
-  				invisibility have been changed.
-  	
-  	@SYMTestPriority			High
-  	
-  	@SYMTestStatus      		Implemented
-  	
-  	@SYMTestActions		
-		 Sets position of the foreground windows as overlapping, tiled.
-		Change visability of semi transparent foreground window.		.
- 
-  	@SYMTestExpectedResults
- 		Foreground window must be redrawn properly.
- */
-
-void CTAlphaChannel::TestInvisibility()
-	{
-	RWindow* win = (RWindow*)(iForegroundWindowSemiTrans->DrawableWin());
-	SetPositionConfiguration(EOverlapping);
-	TheClient->iWs.Flush();	
-	User::After(TTimeIntervalMicroSeconds32(1000000));
-
-	win->SetVisible(EFalse);
-	TheClient->iWs.Flush();	
-	User::After(TTimeIntervalMicroSeconds32(1000000));
-
-	win->SetVisible(ETrue);
-	TheClient->iWs.Flush();	
-	User::After(TTimeIntervalMicroSeconds32(1000000));
-
-	SetPositionConfiguration(ETiled);
-
-	}
-
-/** 
-	@SYMTestCaseID	GRAPHICS-WSERV-0333
-  	
-  	@SYMTestCaseDesc			Testing redrawing of foreground windows after a 
-  				background window has been moved.
-  	
-  	@SYMTestPriority			High
-  	
-  	@SYMTestStatus      		Implemented
-  	
-  	@SYMTestActions		
-		 Sets position of the foreground windows as tiled.
-		Moves background window.
- 
-  	@SYMTestExpectedResults
- 		Foreground windows must be redrawn properly.
- */
-void CTAlphaChannel::TestMoveUnderneath()
-	{
-	SetPositionConfiguration(ETiled);
-	DoMoveBehind();
-	}
-/** 
-	@SYMTestCaseID	GRAPHICS-WSERV-0334
-  	
-  	@SYMTestCaseDesc			Testing redrawing of foreground windows after a 
-  				background window has been moved.
-  	
-  	@SYMTestPriority			High
-  	
-  	@SYMTestStatus      		Implemented
-  	
-  	@SYMTestActions		
-		 Sets different position of the foreground windows: tiled, overlapping.
-		Moves background window.
- 
-  	@SYMTestExpectedResults
- 		Foreground windows has to be redrawn properly.
- */
-
-void CTAlphaChannel::TestMoveBehindInvisible()
-	{
-	SetPositionConfiguration(ETiled);
-	RWindow* win;
-	win = (RWindow*)(iForegroundWindowOpaque->DrawableWin());
-	win->SetVisible(EFalse);
-	win = (RWindow*)(iForegroundWindowSemiTrans->DrawableWin());
-	win->SetVisible(EFalse);
-	win = (RWindow*)(iForegroundWindowTrans->DrawableWin());
-	win->SetVisible(EFalse);
-	TheClient->iWs.Flush();
-
-	DoMoveBehind();
-
-	SetPositionConfiguration(EOverlapping);
-	DoMoveBehind();
-
-	win = (RWindow*)(iForegroundWindowOpaque->DrawableWin());
-	win->SetVisible(ETrue);
-	win = (RWindow*)(iForegroundWindowSemiTrans->DrawableWin());
-	win->SetVisible(ETrue);
-	win = (RWindow*)(iForegroundWindowTrans->DrawableWin());
-	win->SetVisible(ETrue);
-	TheClient->iWs.Flush();
-	}
-/** 
-	@SYMTestCaseID	GRAPHICS-WSERV-0335
-  	
-  	@SYMTestCaseDesc			Testing redrawing of foreground windows.
-  	
-  	@SYMTestPriority			High
-  	
-  	@SYMTestStatus      		Implemented
-  	
-  	@SYMTestActions		
-		 Redraws background window
- 
-  	@SYMTestExpectedResults
- 		Foreground windows should be redrawn properly, if background window 
-  		 has been redrawn.
- */
-void CTAlphaChannel::TestRedrawBehind()
-	{
-	TheClient->iWs.Flush();	
-	iBackgroundWindow->iState += 1;
-	iBackgroundWindow->DrawNow();
-	TheClient->iWs.Flush();	
-	User::After(TTimeIntervalMicroSeconds32(1000000));
-	}
-/** 
-	@SYMTestCaseID	GRAPHICS-WSERV-0336
-  	
-  	@SYMTestCaseDesc			Testing transparency with RWsSprite class.
-  	
-  	@SYMTestPriority			High
-  	
-  	@SYMTestStatus      		Implemented
-  	
-  	@SYMTestActions		
-		 Creates RBackedUpWindow window and moves it over transparent window
-		appears and dissapears set up window as transparent
- 
-  	@SYMTestExpectedResults
- 			Must work with transparent windows. 
- */
-
-void CTAlphaChannel::TestAnimationL()
-	{
-	for(TInt ii = 0; ii < iArrWindow.Count(); ii++)
-		{
-		iArrWindow[ii]->StartAnimationL();
-		}
-	}
-/** 
-	@SYMTestCaseID	GRAPHICS-WSERV-0337
-  	
-  	@SYMTestCaseDesc			Testing transparency with RBackedUpWindow window class.
-  	
-  	@SYMTestPriority			High
-  	
-  	@SYMTestStatus      		Implemented
-  	
-  	@SYMTestActions		
-		 Creates RBackedUpWindow window and moves it over transparent window
-		appears and dissapears set up transparent window as transparent
- 
-  	@SYMTestExpectedResults
- 				Do not expect correct work of alpha channel with 
- 				RBackedUpWindow window class. 
-*/
-void CTAlphaChannel::TestBackedWindowL()
-	{
-	for(TInt ii = 0; ii < iArrWindow.Count(); ii++)
-		{
-		iArrWindow[ii]->CreateBackedWindowL();
-		}
-	}
-
-/** 
-	@SYMTestCaseID	GRAPHICS-WSERV-0338
-  	
-  	@SYMTestCaseDesc			Implication of setting SetDrawOpaque on drawing with alpha channel.
-  	
-  	@SYMTestPriority			High
-  	
-  	@SYMTestStatus      		Implemented
-  	
-  	@SYMTestActions		
-		 Change graphic context to opaque and none opaque and rewdraw all test windows
- 
-  	@SYMTestExpectedResults
- 				must not impact on output with alpha channel 
- */
-
-void CTAlphaChannel::TestEffectSetOpaque()
-	{
-	for(TInt ii = 0; ii < 3; ii++)
-		{
-		
-		for(TInt ii = 0; ii < iArrWindow.Count(); ii++)
-			{
-			iArrWindow[ii]->SetDrawOpaque(EFalse);
-			}
-	
-		DrawTestWindowsNow();
-		User::After(TTimeIntervalMicroSeconds32(1000000));
-
-		for(TInt jj = 0; jj < iArrWindow.Count(); jj++)
-			{
-			iArrWindow[jj]->SetDrawOpaque(ETrue);
-			}
-
-		DrawTestWindowsNow();
-		User::After(TTimeIntervalMicroSeconds32(1000000));
-		}
-	}
-
-/** 
-	@SYMTestCaseID	GRAPHICS-WSERV-0339
-  	
-  	@SYMTestCaseDesc			Redrawing of child windows with transparency.
-  	
-  	@SYMTestPriority			High
-  	
-  	@SYMTestStatus      		Implemented
-  	
-  	@SYMTestActions		
-		 	Creates a few child windows with various levels of transparency.
-		Moves parent window over the screen.
-  	@SYMTestExpectedResults
- 				Child and parent windows must be redrawn properly 
- */
-
-void CTAlphaChannel::TestChildWindowL()
-	{
-	SetPositionConfiguration(ETiled);
-	SetColourConfiguration(EVaryingColour);
-	DrawTestWindowsNow(ETrue);
-	TDisplayMode mode = EColor64K;
-	CTWinAlphaForeground* childWin[] = {NULL, NULL, NULL, NULL, NULL};
-	if (iForegroundWindowBottom)
-		{
-		childWin[0] = CTWinAlphaForeground::NewL(*this, TPoint(0,0),TSize(50,50),iForegroundWindowBottom,*TheClient->iGc, &mode, TRgb(0, 255, 0,128), ENonTransparentAlpha);
-		childWin[0]->DrawNow();
-		}
-	if (iForegroundWindowOpaque)
-		{
-		childWin[1] = CTWinAlphaForeground::NewL(*this, TPoint(0,0),TSize(50,50),iForegroundWindowOpaque,*TheClient->iGc, &mode, TRgb(0, 255, 0,128), ETransparencyFactor);
-		childWin[1]->DrawNow();
-		}
-	if (iForegroundWindowSemiTrans)
-		{
-		childWin[2] = CTWinAlphaForeground::NewL(*this, TPoint(0,0),TSize(50,50),iForegroundWindowSemiTrans,*TheClient->iGc, &mode, TRgb(0, 255, 0,128), ETransparencyAlpha);
-		childWin[2]->DrawNow();
-		}
-	if (iForegroundWindowTrans)
-		{
-		childWin[3] = CTWinAlphaForeground::NewL(*this, TPoint(0,0),TSize(50,50),iForegroundWindowTrans,*TheClient->iGc, &mode, TRgb(0, 255, 0,128), ENonTransparentAlpha);
-		childWin[3]->DrawNow();
-		}
-	if (iForegroundWindowTop)
-		{
-		childWin[4] = CTWinAlphaForeground::NewL(*this, TPoint(0,0),TSize(50,50),iForegroundWindowTop,*TheClient->iGc, &mode, TRgb(0, 255, 0,128), ENonTransparentAlpha);
-		childWin[4]->DrawNow();
-		}
-	TheClient->iWs.Flush();	
-
-	User::After(TTimeIntervalMicroSeconds32(1000000));
-	DoMoving();
-
-	delete childWin[0];
-	delete childWin[1];
-	delete childWin[2];
-	delete childWin[3];
-	delete childWin[4];
-	}
-/** 
-	@SYMTestCaseID	GRAPHICS-WSERV-0340
-  	
-  	@SYMTestCaseDesc			Redrawing of multiple child windows with transparency.
-  	
-  	@SYMTestPriority			High
-  	
-  	@SYMTestStatus      		Implemented
-  	
-  	@SYMTestActions		
-		 	Creates multiple child windows with various levels of transparency.
-		Moves parent windows over the screen.
-  	@SYMTestExpectedResults
- 				Child and parent windows must be redrawn properly 
- */
-
-void CTAlphaChannel::TestMultipleChildrenL()
-	{
-	SetPositionConfiguration(ETiled);
-	SetColourConfiguration(EVaryingColour);
-	TDisplayMode mode = EColor64K;
-	CTWinAlphaForeground* childWin[] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};
-	if (iForegroundWindowBottom)
-		{
-		childWin[0] = CTWinAlphaForeground::NewL(*this, TPoint(0,0),TSize(50,50),iForegroundWindowBottom,*TheClient->iGc, &mode, TRgb(255, 255, 255,128), ETransparencyFactor);
-		childWin[1] = CTWinAlphaForeground::NewL(*this, TPoint(20,20),TSize(50,50),childWin[0],*TheClient->iGc, &mode, TRgb(255, 255, 255,128), ENonTransparentAlpha);
-		childWin[0]->DrawNow();
-		childWin[1]->DrawNow();
-		}
-	if (iForegroundWindowOpaque)
-		{
-		childWin[4] = CTWinAlphaForeground::NewL(*this, TPoint(0,0),TSize(100,100),iForegroundWindowOpaque,*TheClient->iGc, &mode, TRgb(255, 255, 255,128), ETransparencyAlpha);
-		childWin[5] = CTWinAlphaForeground::NewL(*this, TPoint(20,80),TSize(50,50),iForegroundWindowOpaque,*TheClient->iGc, &mode, TRgb(255, 255, 255,128), ENonTransparentAlpha);
-		childWin[6] = CTWinAlphaForeground::NewL(*this, TPoint(20,20),TSize(60,60),childWin[4],*TheClient->iGc, &mode, TRgb(0, 255, 0,128), ENonTransparentAlpha);
-		childWin[7] = CTWinAlphaForeground::NewL(*this, TPoint(20,20),TSize(50,50),childWin[6],*TheClient->iGc, &mode, TRgb(0, 255, 0,128), ENonTransparentAlpha);
-		childWin[4]->DrawNow();
-		childWin[5]->DrawNow();
-		childWin[6]->DrawNow();
-		childWin[7]->DrawNow();
-		}
-	DrawTestWindowsNow(ETrue);
-
-	TestMoving();
-
-	delete childWin[0];
-	delete childWin[1];
-	delete childWin[2];
-	delete childWin[3];
-	delete childWin[4];
-	delete childWin[5];
-	delete childWin[6];
-	delete childWin[7];
-	}
-
-/** 
-	@SYMTestCaseID	GRAPHICS-WSERV-0341
-  	
-  	@SYMTestCaseDesc			Test transparent window which positioned under opaque.
-  	
-  	@SYMTestPriority			High
-  	
-  	@SYMTestStatus      		Implemented
-  	
-  	@SYMTestActions		
-		 	Creates an opaque window on the topt of transparent windows.
-		Moves transparent windows over the screen.
-  	@SYMTestExpectedResults
- 				Transparent windows must be redrawn properly 
- */
-
-void CTAlphaChannel::TestTransparentMovingUnderOpaqueL()
-	{
-	SetColourConfiguration(EVaryingColour);
-	TDisplayMode mode = EColor64K;
-	CTWinAlphaForeground* win = CTWinAlphaForeground::NewL(*this, TPoint(0,100),TSize(600,40),TheClient->iGroup,*TheClient->iGc, &mode, TRgb(0, 255, 0,128), ENonTransparentAlpha);
-	win->DrawNow();
-
-	TestMoving();
-
-	delete win;
-	}
-/** 
-	@SYMTestCaseID	GRAPHICS-WSERV-0342
-  	
-  	@SYMTestCaseDesc			Changing orinary position of the foreground windows.
-  	
-  	@SYMTestPriority			High
-  	
-  	@SYMTestStatus      		Implemented
-  	
-  	@SYMTestActions		
-		 	Set ordinal position of foreground windows.
-  	@SYMTestExpectedResults
- 				Foreground windows must be redrawn properly 
- */
-
-void CTAlphaChannel::TestSetOrdinalPosition()
-	{
-	SetColourConfiguration(EVaryingColour);
-	SetPositionConfiguration(EOverlapping);
-	DrawTestWindowsNow(ETrue);
-	TheClient->iWs.Flush();	
-	User::After(TTimeIntervalMicroSeconds32(1000000));
-	RWindow* win;
-	for (TInt i=0; i<3; i++)
-		{
-		if (iForegroundWindowOpaque)
-			{
-			win = (RWindow*)(iForegroundWindowOpaque->DrawableWin());
-			win->SetOrdinalPosition(0);
-			TheClient->iWs.Flush();	
-			User::After(TTimeIntervalMicroSeconds32(1000000));
-			}
-		if (iForegroundWindowSemiTrans)
-			{
-			win = (RWindow*)(iForegroundWindowSemiTrans->DrawableWin());
-			win->SetOrdinalPosition(0);
-			TheClient->iWs.Flush();	
-			User::After(TTimeIntervalMicroSeconds32(1000000));
-			}
-		if (iForegroundWindowTrans)
-			{
-			win = (RWindow*)(iForegroundWindowTrans->DrawableWin());
-			win->SetOrdinalPosition(0);
-			TheClient->iWs.Flush();	
-			User::After(TTimeIntervalMicroSeconds32(1000000));
-			}
-		}
-	}
-
-void CTAlphaChannel::RunTestCaseL(TInt aCurTestCase)
-	{
-	User::After(TTimeIntervalMicroSeconds32(1000000 * 2));
-	
-	((CTAlphaChannelStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch (aCurTestCase)
-		{
-		case 1:
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			CreateForegroundWindowsL(iSizeForegroundWindow, EColor16MU);
-			break;
-		case 2:
-			{
-			CreateForegroundWindowsL(iSizeForegroundWindow, EColor64K);
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0339"));
-			TestChildWindowL();
-			((CTAlphaChannelStep*)iStep)->RecordTestResultL();
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0340"));
-			TestMultipleChildrenL();
-			((CTAlphaChannelStep*)iStep)->RecordTestResultL();
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0342"));
-			TestSetOrdinalPosition();
-			}
-			break;
-		case 3: 
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0336"));
-			TestAnimationL();
-		case 4: 
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0337"));
-			TestBackedWindowL();
-			break;
-		case 5: 
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0338"));
-			TestEffectSetOpaque();
-			break;
-		case 6:
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			iIsFading = EFalse;
-			DrawTestWindowsNow();
-			INFO_PRINTF1(_L("Anti-aliasing"));
-			iIsFading = EFalse;
-			iDrawText = ETrue;
-			DrawTestWindowsNow();
-			break;
-		case 7:	
-			SetColourConfiguration(EVaryingColour);
-			SetPositionConfiguration(EOverlapping);
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0335"));
-			TestRedrawBehind();		
-			((CTAlphaChannelStep*)iStep)->RecordTestResultL();
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0329"));
-			TestMoving();
-			((CTAlphaChannelStep*)iStep)->RecordTestResultL();
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0330"));
-			TestMovingOverlapping();		
-			((CTAlphaChannelStep*)iStep)->RecordTestResultL();
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0341"));
-			TestMoveBehindInvisible();
-			((CTAlphaChannelStep*)iStep)->RecordTestResultL();
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0334"));
-			TestTransparentMovingUnderOpaqueL();
-			((CTAlphaChannelStep*)iStep)->RecordTestResultL();
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0331"));
-			TestInvisibility();
-			((CTAlphaChannelStep*)iStep)->RecordTestResultL();
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0332"));
-			TestChangingTransparencyFactor();
-			break;
-		case 8:
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0328"));
-			TestFading();
-			break;
-		case 9:
-			{
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			iDrawText = EFalse;
-			SetDisplayModeConfiguration(EAll16MA);
-			}
-			break;
-		case 10:
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			iIsFading = EFalse;
-			DrawTestWindowsNow();
-			INFO_PRINTF1(_L("Anti-aliasing"));
-			iIsFading = EFalse;
-			iDrawText = ETrue;
-			DrawTestWindowsNow();
-			break;
-		case 11:
-			SetColourConfiguration(EVaryingColour);
-			SetPositionConfiguration(EOverlapping);
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0333"));
-			TestMoveUnderneath();
-			((CTAlphaChannelStep*)iStep)->RecordTestResultL();
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0335"));
-			TestRedrawBehind();
-			((CTAlphaChannelStep*)iStep)->RecordTestResultL();
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0329"));
-			TestMoving();
-			((CTAlphaChannelStep*)iStep)->RecordTestResultL();
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0332"));
-			TestInvisibility();
-			((CTAlphaChannelStep*)iStep)->RecordTestResultL();
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0331"));
-			TestChangingTransparencyFactor();
-			break;
-		case 12:
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0328"));
-			TestFading();
-			break;
-		case 13:
-			SetDisplayModeConfiguration(EAllDifferent);
-			SetColourConfiguration(EVaryingColour);
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0333"));
-			TestMoveUnderneath();
-			((CTAlphaChannelStep*)iStep)->RecordTestResultL();
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0335"));
-			TestRedrawBehind();
-			((CTAlphaChannelStep*)iStep)->RecordTestResultL();
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0332"));
-			TestInvisibility();
-			((CTAlphaChannelStep*)iStep)->RecordTestResultL();
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0329"));
-			TestMoving();
-			break;
-		case 14:
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0336"));
-			TestAnimationL();
-			break;
-		case 15:
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0337"));
-			TestBackedWindowL();
-			break;
-		case 16:
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0338"));
-			TestEffectSetOpaque();
-			break;
-		case 17:
-			((CTAlphaChannelStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTAlphaChannelStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-			break;
-		}
-	((CTAlphaChannelStep*)iStep)->RecordTestResultL();
-	}
-	
-/** Calculate foreground windows margin and create them*/
-void CTAlphaChannel::CreateForegroundWindowsL(const TSize& aSize, TDisplayMode aMode)
-	{
-	TPoint pt = TPoint(5, 5);
-	
-	//creating foreground windows
-	//bottom window
-	TDisplayMode dispMode = aMode;
-	iForegroundWindowBottom = CTWinAlphaForeground::NewL(*this, pt,aSize,TheClient->iGroup,*TheClient->iGc, &dispMode, TRgb(0, 255, 0,128), ETransparencyFactor);
-	iArrWindow.AppendL( iForegroundWindowBottom);
-
-	//dispMode = EColor16MA;
-	pt.iX += aSize.iWidth + KWindowIndention;
-	//opaque window
-	iForegroundWindowOpaque = CTWinAlphaForeground::NewL(*this, pt,aSize,TheClient->iGroup,*TheClient->iGc, &dispMode, TRgb(0, 255, 0, 255), ETransparencyAlpha);
-	iArrWindow.AppendL( iForegroundWindowOpaque);
-
-	pt.iX += aSize.iWidth + KWindowIndention;
-	//semi-transparent window
-	iForegroundWindowSemiTrans = CTWinAlphaForeground::NewL(*this, pt,aSize,TheClient->iGroup,*TheClient->iGc, &dispMode, TRgb(0, 255, 0, 128), ETransparencyAlpha);
-	iArrWindow.AppendL( iForegroundWindowSemiTrans);
-
-	//transparent window
-	pt.iX += aSize.iWidth + KWindowIndention;
-	iForegroundWindowTrans = CTWinAlphaForeground::NewL(*this, pt,aSize,TheClient->iGroup,*TheClient->iGc, &dispMode, TRgb(0, 255, 0, 0), ETransparencyAlpha);
-	iArrWindow.AppendL( iForegroundWindowTrans);
-
-	// top window
-	pt.iX += aSize.iWidth + KWindowIndention;
-	iForegroundWindowTop = CTWinAlphaForeground::NewL(*this, pt,aSize,TheClient->iGroup,*TheClient->iGc, &dispMode, TRgb(0, 255, 0,128), ENonTransparentAlpha);
-	iArrWindow.AppendL( iForegroundWindowTop);
-	}
-
-void CTAlphaChannel::DestroyForegroundWindows()
-	{
-	iArrWindow.ResetAndDestroy();
-	iForegroundWindowBottom = NULL;
-	iForegroundWindowOpaque = NULL;
-	iForegroundWindowSemiTrans = NULL;
-	iForegroundWindowTrans = NULL;
-	iForegroundWindowTop = NULL;
-	}
-
-/** Draw all foreground windows */
-void CTAlphaChannel::DrawTestWindowsNow(TBool aDrawBackgroundWin)
-	{
-	if(iBackgroundWindow && aDrawBackgroundWin)
-		{
-		iBackgroundWindow->DrawNow();
-		}
-
-	for(TInt ii = 0; ii < iArrWindow.Count(); ii++)
-		{
-		iArrWindow[ii]->DrawNow();
-		}
-	}
-	
-//-------------
-
-CTWinAlphaForeground* CTWinAlphaForeground::NewL(CTAlphaChannel& aTest, TPoint aPos, TSize aSize, CTWinBase *aParent, CWindowGc &aGc, TDisplayMode *aMode, TRgb aCol, TInt aTransparencyType)
-	{
-	CTWinAlphaForeground* theWin = new(ELeave) CTWinAlphaForeground(aTest);
-	
-	theWin->ConstructL(*aParent);
-	if (aMode)
-		theWin->SetDisplayMode(*aMode);
-	theWin->SetExtL(aPos, aSize);
-	theWin->AssignGC(aGc);
-	theWin->PrepareForDrawingL();	
-
-	// for hardware testing	only we create an additional bitmap
-#ifndef __WINS__
-	theWin->CreateBackgroundBitmapL(*aMode);
-#endif
-		
-	RWindow* win = (RWindow*) (theWin->DrawableWin());
-	win->SetShadowHeight(0);
-	win->SetShadowDisabled(ETrue);
-	switch (aTransparencyType)
-		{
-	case ETransparencyFactor:
-		{
-		win->SetTransparencyFactor(aCol);
-		theWin->SetBackgroundColor(aCol);
-		}
-		break;
-	case ETransparencyAlpha:
-		win->SetTransparencyAlphaChannel();
-		// fall through into next case
-	case ENonTransparentAlpha:
-	default:
-		theWin->SetBackgroundColor(aCol);
-		break;
-		}
-	
-	theWin->Activate();
-
-	return theWin;
-	}
-
-CTWinAlphaForeground::~CTWinAlphaForeground()
-	{
-	if(iPolygon)
-		{
-		iPolygon->Reset();
-		delete iPolygon;
-		}
-	delete iBitmapBackground;
-	delete iBitmapDeviceBackground;
-	delete iBitmapContextBackground;
-	}
-	
-CTWinAlphaForeground::CTWinAlphaForeground(CTAlphaChannel& aTest)
-	: iTest(aTest)
-	{	
-	}
-
-
-void CTWinAlphaForeground::SetDisplayMode(TDisplayMode aDisplayMode)
-	{
-	BaseWin()->SetRequiredDisplayMode(aDisplayMode);
-	switch (aDisplayMode)
-		{
-	case EColor256:
-		iTitle1 = _L("256");
-		break;
-	case EColor64K:
-		iTitle1 = _L("64K");
-		break;
-	case EColor16MU:
-		iTitle1 = _L("16MU");
-		break;
-	case EColor16MA:
-		iTitle1 = _L("16MA");
-		break;
-	case EColor16MAP:
-		iTitle1 = _L("16MAP");
-		break;
-	default:
-		iTitle1 = _L("");
-		break;
-		}
-	}
-
-void CTWinAlphaForeground::SetBackgroundColor(TRgb aRgb)
-	{
-	switch (aRgb.Alpha())
-		{
-		case 0:
-		iTitle2 = _L(" trans ");		
-		break;
-		case 255:
-		iTitle2 = _L(" opaque ");		
-		break;
-		case 128:
-		default:
-		iTitle2 = _L(" s-trans ");		
-		break;
-		}
-	if (aRgb.Red())
-		iTitle2 += _L("R");
-	if (aRgb.Green())
-		iTitle2 += _L("G");
-	if (aRgb.Blue())
-		iTitle2 += _L("B");
-
-	iBackgroundColor = aRgb;
-	((RWindow*) DrawableWin())->SetBackgroundColor(aRgb);
-	}
-
-void CTWinAlphaForeground::Draw()
-	{
-	CBitmapContext* theGc = TheClient->iGc;
-	((CWindowGc*)theGc)->SetOpaque(iDrawOpaque);
-	
-	if(iBitmapContextBackground)
-		{
-		//CGraphicsContext
-		theGc = iBitmapContextBackground;
-		CleanBackgroundBitmap();
-		}
-	if(iTest.iFont1)
-		theGc->UseFont(iTest.iFont1);
-	
-	
-	theGc->SetFaded(EFalse);
-	DrawTable(*theGc);
-
-	TInt numRows = sizeof(iRows) / sizeof(iRows[0]) ;
-
-	theGc->SetBrushStyle(iTest.iBrushStyle);
-	if(iTest.iFont && iTest.iDrawText)
-		{
-		theGc->DiscardFont();
-		theGc->UseFont(iTest.iFont);
-		}
-	
-	theGc->SetFaded(iTest.iIsFading);
-	
-	// the factor and offset are calculated as follows: 
-	// iFadeMapFactor = iWhiteFading - iBlackFading;
-	// iFadeMapOffset = iBlackFading;
-
-	theGc->SetFadingParameters(iTest.iBlackFading, iTest.iWhiteFading); //black and white
-		
-	for(TInt ii = 0; ii < numRows - 1; ii++)
-		{
-		theGc -> SetBrushStyle(iTest.iBrushStyle);
-
-		TRect theRect = TRect(iCol, iRows[ii], Size().iWidth, iRows[ii + 1]);
-				
-   		TRgb theBrush = iTest.GetBrush(ii);
-   		TRgb thePen = iTest.GetPen(ii);
-
-   		CGraphicsContext::TDrawMode theDrawMode = iTest.GetDrawMode(ii);
-    		
-   		theGc->SetBrushColor(theBrush);
-		theGc->SetPenColor(thePen);
-   		theGc->SetDrawMode(theDrawMode);
-		
-		CGraphicsContext* theBitmapContext64K;
-		CGraphicsContext* theBitmapContext16MA;
-		CFbsBitmap* theBitmap64K;
-		CFbsBitmap* theBitmap16MA;
-
-		switch(ii)
-			{
-			case 0:
-				{
-				theBitmapContext64K = iTest.iBitmapContext64K_1;
-				theBitmapContext16MA = iTest.iBitmapContext16MA_1;
-				theBitmap64K = iTest.iBitmap64K_1;
-				theBitmap16MA = iTest.iBitmap16MA_1;
-				break;
-				}
-			case 1:
-				{
-				theBitmapContext64K = iTest.iBitmapContext64K_2;
-				theBitmapContext16MA = iTest.iBitmapContext16MA_2;
-				theBitmap64K = iTest.iBitmap64K_2;
-				theBitmap16MA = iTest.iBitmap16MA_2;
-				break;
-				}
-			default:
-				{
-				theBitmapContext64K = iTest.iBitmapContext64K_3;
-				theBitmapContext16MA = iTest.iBitmapContext16MA_3;
-				theBitmap64K = iTest.iBitmap64K_3;
-				theBitmap16MA = iTest.iBitmap16MA_3;
-				break;
-				}
-			}
-			if(iTest.iDrawText)
-				{
-				DrawTextInCell(*theGc, theRect);
-				}
-			else
-				{
-				TRAP_IGNORE(iTest.DrawOffscreenBitmapsL(thePen, theBrush, theBitmapContext64K, 
-					theBitmapContext16MA, theBitmap64K, theBitmap16MA));
-				DrawPrimitivesInCell(*theGc, theRect, theBitmap64K, theBitmap16MA);
-				}
-		TheClient->iWs.Flush();	
-		}
-
-	theGc->DiscardFont();
-
-	if(iBitmapContextBackground)
-		{
-		theGc = TheClient->iGc;
-		theGc->BitBlt(TPoint(0, 0), iBitmapBackground);
-		}
-	}
-
-void CTWinAlphaForeground::SetPoligonLocation(const TPoint &ptOffset)
-	{
-	TRect rect = TRect(iTest.iTriangleSize);
-	(*iPolygon)[0] = rect.iTl + ptOffset;
-	(*iPolygon)[1] = TPoint(rect.iTl.iX, rect.iBr.iY) + ptOffset;
-	(*iPolygon)[2] = rect.iBr + ptOffset;
-	}
-	
-/** Define boundary of the table*/
-void CTWinAlphaForeground::CalculateTableMargin()
-	{
-	TInt numRows = sizeof(iRows) / sizeof(iRows[0]) ;
-	iRows[0] = iTest.iFirstCellHeight;
-	TInt theRowHeight = (Size().iHeight - iTest.iFirstCellHeight) / 3;
-	for(TInt ii = 1; ii < numRows; ii++)
-		{
-		iRows[ii] = iRows[ii-1] + theRowHeight;
-		}
-	}
-	
-/** Draw a table which comprises 3 rows: for transparent, semi-transparent 
-	and opaque output
-
-*/	
-void CTWinAlphaForeground::DrawTable(CBitmapContext& aGc) const
-	{
-	TInt numRows = sizeof(iRows) / sizeof(iRows[0]) ;
-	
-	aGc.SetPenColor(iTest.iPenTable);
-	
-	for (TInt ii = 0; ii < numRows - 1; ii++)
-		{
-		TBuf<4> iBuf;
-		TPoint pt1 = TPoint(0, iRows[ii]);
-		TPoint pt2 = TPoint(Size().iWidth, iRows[ii]);
-
-		aGc.DrawLine(pt1, pt2);
-		
-		if(iCol)
-			{
-			TPoint pt3 = TPoint(0, iRows[ii]) + TPoint(2,(iRows[1] - iRows[0]) / 2); 
-			switch(ii)
-				{
-					case 0: iBuf = _L("o"); break;
-					case 1: iBuf = _L("s"); break;
-					case 2: iBuf = _L("t"); break;
-					default : iBuf = _L(""); break;
-				}
-			aGc.DrawText(iBuf, pt3); 
-			}
-		}
-	if(iCol)
-		{
-		TPoint pt3 = TPoint(iCol, iRows[0]) + TPoint(1,-2); 
-		TBuf<32> text = iTitle1;
-		text += iTitle2;
-		aGc.DrawText(text, pt3); 
-	
-		TPoint pt1 = TPoint(iCol, 0);
-		TPoint pt2 = TPoint(iCol, Size().iHeight);
-		aGc.DrawLine(pt1, pt2);
-		}
-		
-	}
-
-/** Draw truetype font to check anti-aliasing*/
-void CTWinAlphaForeground::DrawTextInCell(CBitmapContext& aGc, const TRect& aRect)
-	{
-    TPoint pt(aRect.iTl.iX, aRect.iBr.iY);
-    pt += TPoint(2, -10);
-    
-    aGc.DrawText(_L("ABCD"), pt);
-	}
-
-/** Draw graphics primitive in a cell:
-	rectangle, ellipse, triangle, a few lines, bitmaps
-
- */	
-void CTWinAlphaForeground::DrawPrimitivesInCell(CBitmapContext& aGc, const TRect& aRect, 
-								CFbsBitmap* aBitmap64K, CFbsBitmap* aBitmap16MA)
-	{
-	TRect theCellRect = aRect;
-	theCellRect.Shrink(1, 1);
-	
-	//rectangle
-	TRect rect = TRect(iTest.iRectangleSize);
-	rect.Move(theCellRect.iTl);
-    aGc.DrawRect(rect);
-    
-    //ellipse
-    rect = TRect(iTest.iEllipseSize);
-	rect.Move(theCellRect.iTl + TPoint(iTest.iRectangleSize.iWidth + 5, 0));
-    aGc.DrawEllipse(rect);
-
-	//triangle
-	TPoint pt = TPoint(rect.iBr.iX, rect.iTl.iY) + TPoint(5, 0);
-	SetPoligonLocation(pt);
-   	aGc.DrawPolygon(iPolygon);
-    
-    //DrawLine
-    pt = pt + TPoint (((*iPolygon)[2]).iX - ((*iPolygon)[0]).iX, 0) + TPoint(5, 2);
-    rect = TRect(iTest.iTriangleSize);
-    rect.Move(pt);
-    aGc.DrawLine(rect.iTl, TPoint(rect.iTl.iX, rect.iBr.iY));
-    aGc.DrawLine(TPoint(rect.iTl.iX, rect.iBr.iY), rect.iBr);
-    aGc.DrawLine(rect.iBr, TPoint(rect.iBr.iX, rect.iTl.iY));
-    aGc.DrawLine(TPoint(rect.iBr.iX, rect.iTl.iY), rect.iTl);
-    aGc.DrawLine(rect.iTl, rect.iBr);
-    aGc.DrawLine(TPoint(rect.iBr.iX, rect.iTl.iY), TPoint(rect.iTl.iX, rect.iBr.iY));
-
-    //64K bitmap
-    aGc.SetBrushStyle(CGraphicsContext::ENullBrush);
-    pt = TPoint(theCellRect.iTl.iX, rect.iBr.iY) + TPoint(0, 5);
-    if(aBitmap64K)
-    	{
-    	aGc.BitBlt(pt, aBitmap64K);
-    	pt = pt + TPoint( aBitmap64K->SizeInPixels().iWidth, 0) + TPoint(2, 0);
-
-    	aGc.BitBltMasked(pt, 
-    		aBitmap64K, TRect(aBitmap64K->SizeInPixels()),
-	    	iTest.iBitmapGray256Mask, EFalse);
-    	pt = pt + TPoint( aBitmap64K->SizeInPixels().iWidth, 0) + TPoint(2, 0);
-
-    	aGc.BitBltMasked(pt, 
-	    	aBitmap64K, TRect(aBitmap64K->SizeInPixels()),
-    		iTest.iBitmapMask, EFalse);
-
-    	pt = pt + TPoint( aBitmap64K->SizeInPixels().iWidth, 0) + TPoint(2, 0);
-	   	}
-    
-    if(aBitmap16MA)
-    	{
-    	aGc.BitBlt(pt, aBitmap16MA);
-
-    	pt = pt + TPoint( aBitmap16MA->SizeInPixels().iWidth, 0) + TPoint(2, 0);
-
-    	aGc.BitBltMasked(pt, 
-	    	aBitmap16MA, TRect(aBitmap16MA->SizeInPixels()),
-    		iTest.iBitmapGray256Mask, EFalse);
-
-    	pt = pt + TPoint( aBitmap16MA->SizeInPixels().iWidth, 0) + TPoint(2,0);
-
-    	pt = pt + TPoint( 0, aBitmap16MA->SizeInPixels().iHeight);
-    	}
-    
-	pt.iX = aRect.iTl.iX + 2;
-	pt.iY = pt.iY + 18;
-	
-    if(aBitmap64K)
-    	{
-		TSize size = aBitmap64K->SizeInPixels();
-		TRect srcRect(TPoint(0,0),size);
-		size += TSize(5,5);
-		TRect destRect(pt - TPoint(0, 8), size);
-    	aGc.DrawBitmap(destRect, aBitmap64K, srcRect);
-    	pt = pt + TPoint( size.iWidth, 0) + TPoint(2, 0);
-
-#ifdef __WINS__
-    	destRect.Move(TPoint(aBitmap64K->SizeInPixels().iWidth + 8, 0));
-    	((CWindowGc&) aGc).DrawBitmapMasked(destRect, 
-    		aBitmap64K, srcRect,
-	    	iTest.iBitmapGray256Mask, EFalse);
-    	pt = pt + TPoint( aBitmap64K->SizeInPixels().iWidth, 0) + TPoint(2, 0);
-#endif
-	   	}
-    
-    aGc.DrawText(iTest.iText, pt);
-    
-#ifdef __WINS__
-    ((CWindowGc&) aGc).DrawTextVertical(iTest.iText, pt, ETrue);
-#endif
-	}
-	
-/** calculate table's size and size of graphics primitieves */
-void CTWinAlphaForeground::PrepareForDrawingL()
-	{
-	iCol = iTest.iFirstCellWidth;
-
-	CalculateTableMargin();
-
-	//create triangle
-	iPolygon = new (ELeave) CArrayFixFlat<TPoint> (3);
-	TRect rect = TRect(iTest.iTriangleSize);
-	iPolygon->AppendL(rect.iTl);
-	iPolygon->AppendL(TPoint(rect.iTl.iX, rect.iBr.iY));
-	iPolygon->AppendL(rect.iBr);
-	}
-
-/** Bitmap is intended to use on target only*/	
-void CTWinAlphaForeground::CreateBackgroundBitmapL(const TDisplayMode& aDispMode)
-	{
-	ASSERT(!iBitmapBackground);
-	
-	TSize size = Size(); 
-		
-	iBitmapBackground = new (ELeave) CFbsBitmap ;
-	iBitmapBackground->Create(size,aDispMode);
-	
-	iBitmapDeviceBackground = CFbsBitmapDevice::NewL(iBitmapBackground);
-	CGraphicsContext *&theGc = (CGraphicsContext*&)iBitmapContextBackground;
-	iBitmapDeviceBackground->CreateContext(theGc);
-	}
-	
-void CTWinAlphaForeground::CleanBackgroundBitmap()
-	{
-	ASSERT(iBitmapBackground);
-	
-	TRect rect = TRect(iBitmapBackground->SizeInPixels());
-	iBitmapContextBackground->SetBrushColor(iBackgroundColor);
-   	iBitmapContextBackground->SetPenColor(iBackgroundColor);
-   	iBitmapContextBackground->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	iBitmapContextBackground->DrawRect(rect);
-	}
-
-void CTWinAlphaForeground::StartAnimationL()
-	{
-	__UHEAP_MARK;
-	RWsSprite theSprite;
-	
-	RDrawableWindow *theWin = DrawableWin();
-
-	theSprite=RWsSprite(TheClient->iWs);
-	TPoint theSpritePos = TPoint(10, 10); 
-	TInt theFlags = 0;
-	theSprite.Construct(*theWin, theSpritePos, theFlags);
-	TDisplayMode dispMode = EColor256;
-	//create a ball bitmap for animation
-	CFbsBitmap* theBitmapBall= new (ELeave) CFbsBitmap;
-	theBitmapBall->Create(TSize(32, 32), dispMode);
-	CFbsBitmapDevice* theBitmapDeviceBall = CFbsBitmapDevice::NewL(theBitmapBall);
-	CGraphicsContext* theBitmapContextBall = NULL;
-	theBitmapDeviceBall->CreateContext(theBitmapContextBall);
-	//draw a background
-	theBitmapContextBall->SetBrushColor(TRgb(128, 0, 255));
-   	theBitmapContextBall->SetPenColor(TRgb(128, 0, 255));
-   	theBitmapContextBall->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	theBitmapContextBall->DrawRect(theBitmapBall->SizeInPixels());
-	
-	//create a ball's mask
-	CFbsBitmap* theBitmapMask= new (ELeave) CFbsBitmap;
-	theBitmapMask->Create(TSize(32, 32), dispMode);
-	CFbsBitmapDevice* theBitmapDeviceMask = CFbsBitmapDevice::NewL(theBitmapMask);
-	CGraphicsContext* theBitmapContextMask = NULL;
-	theBitmapDeviceMask->CreateContext(theBitmapContextMask);
-	//draw a mask
-	theBitmapContextMask->SetBrushColor(TRgb(0, 0, 0));
-   	theBitmapContextMask->SetPenColor(TRgb(0, 0, 0));
-   	theBitmapContextMask->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	theBitmapContextMask->DrawRect(theBitmapMask->SizeInPixels());
-
-	theBitmapContextMask->SetBrushColor(TRgb(255, 255, 255));
-   	theBitmapContextMask->SetPenColor(TRgb(255, 255, 255));
-   	TRect rect = TRect(theBitmapMask->SizeInPixels());
-	theBitmapContextMask->SetPenSize(TSize(6,6));
-	theBitmapContextMask->DrawLine(rect.iTl, rect.iBr);
-	theBitmapContextMask->DrawLine(TPoint(0, rect.iBr.iY), TPoint(rect.iBr.iX, 0));
-
-	//create a second ball's mask
-	CFbsBitmap* theBitmapMask1= new (ELeave) CFbsBitmap;
-	theBitmapMask1->Create(TSize(32, 32), dispMode);
-	CFbsBitmapDevice* theBitmapDeviceMask1 = CFbsBitmapDevice::NewL(theBitmapMask1);
-	CGraphicsContext* theBitmapContextMask1 = NULL;
-	theBitmapDeviceMask1->CreateContext(theBitmapContextMask1);
-	//draw a mask
-	theBitmapContextMask1->SetBrushColor(TRgb(0, 0, 0));
-   	theBitmapContextMask1->SetPenColor(TRgb(0, 0, 0));
-   	theBitmapContextMask1->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	theBitmapContextMask1->DrawRect(theBitmapMask1->SizeInPixels());
-
-	theBitmapContextMask1->SetBrushColor(TRgb(255, 255, 255));
-   	theBitmapContextMask1->SetPenColor(TRgb(255, 255, 255));
-   	rect = TRect(theBitmapMask1->SizeInPixels());
-	theBitmapContextMask1->SetPenSize(TSize(6,6));
-	theBitmapContextMask1->DrawLine(TPoint(rect.iBr.iX/2, 0), TPoint(rect.iBr.iX/2, rect.iBr.iY));
-	theBitmapContextMask1->DrawLine(TPoint(0, rect.iBr.iY/2), TPoint(rect.iBr.iX, rect.iBr.iY/2));
-
-
-	TSpriteMember theSpriteList;
-	theSpriteList.iBitmap = theBitmapBall;
-	theSpriteList.iMaskBitmap = theBitmapMask;
-	theSpriteList.iInvertMask = EFalse;
-	theSpriteList.iDrawMode = CGraphicsContext::EDrawModePEN;
-	theSpriteList.iOffset = TPoint(0, 0);
-	theSpriteList.iInterval = TTimeIntervalMicroSeconds32(100000);
-	theSprite.AppendMember(theSpriteList);
-
-	TSpriteMember theSpriteList1;
-	theSpriteList1.iBitmap = theBitmapBall;
-	theSpriteList1.iMaskBitmap = theBitmapMask1;
-	theSpriteList1.iInvertMask = EFalse;
-	theSpriteList1.iDrawMode = CGraphicsContext::EDrawModePEN;
-	theSpriteList1.iOffset = TPoint(0, 0);
-	theSpriteList1.iInterval = TTimeIntervalMicroSeconds32(100000);
-	
-	theSprite.AppendMember(theSpriteList1);
-	
-	theSprite.Activate();
-	
-	for(TInt ii = 0; ii < 20; ii++)
-		{
-		theSpritePos += TPoint(3, 8);
-		theSprite.SetPosition(theSpritePos);
-		TheClient->iWs.Flush();	
-		User::After(TTimeIntervalMicroSeconds32(50000));		
-		}
-
-	for(TInt jj = 0; jj < 20; jj++)
-		{
-		theSpritePos -= TPoint(0, 8);
-		theSprite.SetPosition(theSpritePos);
-		TheClient->iWs.Flush();	
-		User::After(TTimeIntervalMicroSeconds32(50000));
-		}
-	
-	theSprite.Close();
-	
-	delete theBitmapContextBall;
-	delete theBitmapDeviceBall;
-	
-	delete theBitmapBall;
-	
-	delete theBitmapMask;
-	delete theBitmapContextMask;
-	delete theBitmapDeviceMask;
-	
-	delete theBitmapMask1;
-	delete theBitmapContextMask1;
-	delete theBitmapDeviceMask1;
-
-	__UHEAP_MARKEND;
-	}
-
-void CTWinAlphaForeground::CreateBackedWindowL()
-	{
-	RBackedUpWindow theBackedWindow(TheClient->iWs); 
-	CleanupClosePushL(theBackedWindow);
-	
-	TDisplayMode theDisplayMode = EColor16MA;
-	
-	RWindow* theWin = (RWindow*) DrawableWin();
-
-	theBackedWindow.Construct(*theWin,theDisplayMode, ENullWsHandle);
-	
-	TPoint pos =TPoint(10, 10);
-	TSize size = theWin->Size();
-	size.SetSize(size.iWidth / 5, size.iHeight/10);
-	
-	theBackedWindow.SetExtentErr(pos, size);
-	theBackedWindow.SetOrdinalPosition(0);
-
-	
-	//draw to backed window	
-	TRgb color = TRgb(255, 0, 128);
-	TInt bitmapHandle = theBackedWindow.BitmapHandle();
-	CFbsBitmap bitmapWin;
-	bitmapWin.Duplicate(bitmapHandle);
-	//Leave poss here - theBackedWindow could leak
-	CFbsBitmapDevice* theBitmapDevice = CFbsBitmapDevice::NewL(&bitmapWin);
-	CGraphicsContext* theBitmapContext = NULL;
-	theBitmapDevice->CreateContext(theBitmapContext);
-	theBitmapContext->SetBrushColor(color);
-   	theBitmapContext->SetPenColor(color);
-   	theBitmapContext->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	theBitmapContext->DrawRect(TRect(bitmapWin.SizeInPixels()));
-
-	color = TRgb(0, 0, 0);
-   	theBitmapContext->SetPenColor(color);
-	for(TInt kk = 0; kk < bitmapWin.SizeInPixels().iWidth; kk += 8)
-		{
-		theBitmapContext->DrawLine(TPoint(kk, 0), TPoint(kk, bitmapWin.SizeInPixels().iHeight));
-		}
-	
-	
-	theBackedWindow.Activate();
-	TheClient->iWs.Flush();
-	User::After(TTimeIntervalMicroSeconds32(500000));
-	
-	//hide the window
-	theBackedWindow.SetVisible(EFalse);
-	TheClient->iWs.Flush();
-	User::After(TTimeIntervalMicroSeconds32(500000));
-	theBackedWindow.SetVisible(ETrue);
-	TheClient->iWs.Flush();
-	
-	for(TInt ii = 0; ii < 7; ii++)
-		{
-		User::After(TTimeIntervalMicroSeconds32(100000));
-		pos.iX += 5;
-		pos.iY += 15;
-		 
-		theBackedWindow.SetExtentErr(pos, size);
-		TheClient->iWs.Flush();
-		}
-
-	User::After(TTimeIntervalMicroSeconds32(500000));
-	
-	//transparent color. don't expect it to work
-	pos.iX -= 5;
-	pos.iY -= 15;
-
-	theBackedWindow.SetExtentErr(pos, size);
-	color = TRgb(255, 255, 128, 128);
-	theBitmapContext->SetBrushColor(color);
-   	theBitmapContext->SetPenColor(color);
-	theBitmapContext->DrawRect(TRect(bitmapWin.SizeInPixels()));
-	TheClient->iWs.Flush();
-	User::After(TTimeIntervalMicroSeconds32(500000));
-
-	//semi-transparent color
-	pos.iX -= 5;
-	pos.iY -= 15;
-	theBackedWindow.SetExtentErr(pos, size);
-	color = TRgb(255, 255, 128, 255);
-	theBitmapContext->SetBrushColor(color);
-   	theBitmapContext->SetPenColor(color);
-	TheClient->iWs.Flush();
-	User::After(TTimeIntervalMicroSeconds32(500000));
-
-	
-	CleanupStack::PopAndDestroy();	 //bitmapWin
-	delete theBitmapContext;
-	delete theBitmapDevice;
-	
-	}
-
-	
-//-------------------
-void CTWinAlpha::Draw()
-	{
-	CBitmapContext* theGc = TheClient->iGc;
-	TSize size = Size();
-	
-	for(TInt ii = 0; ii < size.iHeight; ii += (20+iState))
-		{
-		theGc->DrawLine(TPoint(0, ii), TPoint(size.iWidth, ii));
-		}
-	}
-	
-__WS_CONSTRUCT_STEP__(AlphaChannel)
--- a/windowing/windowserver/tauto/TAlphaChannel.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,218 +0,0 @@
-
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// TBITMAP.H
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TALPHACHANNEL_H__
-#define __TALPHACHANNEL_H__
-
-#include "AUTO.H"
-#include "../tlib/testbase.h"
-#include "TGraphicsHarness.h"
-
-class CTAlphaChannel;
-
-/**
-	Introduces a base class for transparent windows (both background and foreground)
-*/
-class CTWinAlpha : public CTWin
-	{
-public:
-	void Draw(); //we have to overridden it to avoid panic in a based class
-public:
-	TInt iState;
-	};
-
-enum {ETransparencyFactor, ETransparencyAlpha, ENonTransparentAlpha};
-
-/**
-	Introduces a foreground transparent windows.
-	In order to set any instance of class as transparent it has to be created with 
-	ETransparencyAlpha parameter
-*/
-class CTWinAlphaForeground : public CTWin
-	{
-public:
-	static CTWinAlphaForeground* NewL(CTAlphaChannel& aTest, TPoint aPos, TSize aSize, 
-		CTWinBase* aParent, CWindowGc& aGc, TDisplayMode* aMode, TRgb aCol, TInt aTransparencyType = ENonTransparentAlpha);
-	~CTWinAlphaForeground();
-		
-private:
-	CTWinAlphaForeground(CTAlphaChannel& aTest);
-	
-public:
-	void Draw();
-	void SetBackgroundColor(TRgb aColor);
-	void SetDisplayMode(TDisplayMode aDisplayMode);
-	void StartAnimationL();
-	void CreateBackedWindowL();
-	inline void SetDrawOpaque(TBool aDrawOpaque = ETrue)
-		{
-		iDrawOpaque = aDrawOpaque;
-		}
-		
-protected:
-	void DrawTable(CBitmapContext& aGc) const;
-	void DrawPrimitivesInCell(CBitmapContext& aGc, const TRect& aRect, 
-								CFbsBitmap* aBitmap64K, CFbsBitmap* aBitmap16MA);
-	void DrawTextInCell(CBitmapContext& aGc, const TRect& aRect);
-	void PrepareForDrawingL();
-	void CalculateTableMargin();
-	void SetPoligonLocation(const TPoint &ptOffset);
-	void CreateBackgroundBitmapL(const TDisplayMode& aDispMode);
-	void CleanBackgroundBitmap();
-	
-protected:
-	TInt iRows[4];
-	TInt iCol; // width of the first column
-	CFbsBitmap* iBitmapBackground;
-	CFbsBitmapDevice* iBitmapDeviceBackground;
-	CBitmapContext*  iBitmapContextBackground;
-	TRgb iBackgroundColor;
-	CArrayFix<TPoint>* iPolygon;
-	TBuf<16> iTitle1;
-	TBuf<16> iTitle2;
-	TBool iDrawOpaque; // this value will set to CWindowGc before drawing, should have any effect on drawing with alpha channel
-	
-private:
-	CTAlphaChannel& iTest;
-	};
-
-/** Test base class, which exersices drawing graphics operations with alpha channel */
-class CTAlphaChannel : public CTWsGraphicsBase
-	{
-friend class CTWinAlphaForeground;	
-public:
-	CTAlphaChannel(CTestStep* aStep);
-	~CTAlphaChannel();
-	void ConstructL();
-	void DrawTestWindowsNow(TBool aDrawBackgroundWin = EFalse);
-	
-	void SetWindow64K();
-	void SetOpaqueWindow16MA();
-	void SetTransparentWindow16MA();
-	TInt SetWindow16MAWithMask();
-	TInt SetWindow64KWithMask();
-	CGraphicsContext::TDrawMode GetDrawMode(TInt aIndex) const;
-	TRgb GetBrush(TInt aIndex) const;
-	TRgb GetPen(TInt aIndex) const;
-
-	// test functions
-	void SetDisplayModeConfiguration(TInt aConfig);
-	void SetPositionConfiguration(TInt aConfig);
-	void SetColourConfiguration(TInt aConfig);
-	void DoMoving();
-	void DoMoveBehind();
-	void DoInvisibility();
-	void TestMoving();
-	void TestMovingOverlapping();
-	void TestFading();
-	void TestChangingTransparencyFactor();
-	void TestInvisibility();
-	void TestMoveUnderneath();
-	void TestMoveBehindInvisible();
-	void TestRedrawBehind();
-	void TestAnimationL();
-	void TestBackedWindowL();
-	void TestEffectSetOpaque();
-	void TestChildWindowL();
-	void TestMultipleChildrenL();
-	void TestTransparentMovingUnderOpaqueL();
-	void TestSetOrdinalPosition();
-	
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-	void CreateForegroundWindowsL(const TSize& aSize, TDisplayMode aMode);
-	void DestroyForegroundWindows();
-	void DrawOffscreenBitmapsL(const TRgb& aPen, const TRgb& aBrush, 
-										CGraphicsContext* aBitmapContext64K, CGraphicsContext* aBitmapContext16MA, 
-										CFbsBitmap* aBitmap64K, CFbsBitmap* aBitmap16MA);
-	void CalculateSizePrimitives(const TSize& aSize);
-protected:
-	TRgb iPenTable;
-	CGraphicsContext::TBrushStyle	iBrushStyle;
-	CGraphicsContext::TPenStyle iPenStyle;
-	TSize iSizeForegroundWindow;
-private:
-	CTWinAlpha*	iBackgroundWindow;
-	CTWinAlphaForeground*	iForegroundWindowBottom;
-	CTWinAlphaForeground*	iForegroundWindowOpaque;
-	CTWinAlphaForeground*	iForegroundWindowSemiTrans;
-	CTWinAlphaForeground*	iForegroundWindowTrans;
-	CTWinAlphaForeground*	iForegroundWindowTop;
-	
-	CArrayPtrFlat<CTWinAlphaForeground> iArrWindow;	
-	
-	
-	CFbsBitmap* iBitmap64K_1;
-	CFbsBitmap* iBitmap16MA_1;
-	CFbsBitmap* iBitmap64K_2;
-	CFbsBitmap* iBitmap16MA_2;
-	CFbsBitmap* iBitmap64K_3;
-	CFbsBitmap* iBitmap16MA_3;
-	CFbsBitmap* iBitmapMask;
-	CFbsBitmap* iBitmapGray256Mask;
-	
-	CFbsBitmapDevice* iBitmapDevice64K_1;
-	CFbsBitmapDevice* iBitmapDevice16MA_1;
-	CFbsBitmapDevice* iBitmapDevice64K_2;
-	CFbsBitmapDevice* iBitmapDevice16MA_2;
-	CFbsBitmapDevice* iBitmapDevice64K_3;
-	CFbsBitmapDevice* iBitmapDevice16MA_3;
-
-	CGraphicsContext* iBitmapContext64K_1;
-	CGraphicsContext* iBitmapContext16MA_1;
-	CGraphicsContext* iBitmapContext64K_2;
-	CGraphicsContext* iBitmapContext16MA_2;
-	CGraphicsContext* iBitmapContext64K_3;
-	CGraphicsContext* iBitmapContext16MA_3;
-
-	TBuf<256> iText;
-	CFont* iFont; // for true type font, needs to exercise anti-aliasing 
-	CFont* iFont1; // title font
-
-	TSize iBitmapSize;
-	TSize iRectangleSize;
-	TSize iEllipseSize ;
-	TSize iTriangleSize ;
-	TInt iFirstCellWidth ;
-	TInt iFirstCellHeight;
-	TBool iDrawText; // if true output text, graphics primitives otherwise
-	TBool iIsFading;
-	TUint8 iBlackFading;
-	TUint8 iWhiteFading;
-	};
-	
-class CTAlphaChannelStep : public CTGraphicsStep
-	{
-public:
-	CTAlphaChannelStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTAlphaChannelStep,"TAlphaChannel");
-
-
-#endif
--- a/windowing/windowserver/tauto/TAnimDraw.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include <e32std.h>
-#include <e32base.h>
-#include "W32STD.H"
-
-GLREF_C void DoDraw(TInt aDraw,CBitmapContext& aGc,TRgb aColor,TRect aRect,CFbsFont *aFont=NULL,TInt aTextVal=0);
--- a/windowing/windowserver/tauto/TAnimdraw.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include "TAnimDraw.h"
-
-GLREF_C void DoDraw(TInt aDraw,CBitmapContext& aGc,TRgb aColor,TRect aRect,CFbsFont *aFont,TInt aTextVal)
-	{
-	switch (aDraw)
-		{
-		case 36:
-			{
-			aGc.Clear();
-			aGc.SetPenSize(TSize(15,15));
-			aGc.SetPenColor(aColor);
-			aGc.DrawLine(TPoint(aRect.iTl),TPoint(aRect.iBr));
-			break;
-			}
-		case 37:
-			{
-			TBuf<3> buf;
-			buf.Format(_L("%d"), aTextVal);
-			aGc.Clear();
-			aGc.SetDrawMode(CGraphicsContext::EDrawModePEN);
-			aGc.SetPenStyle(CGraphicsContext::ESolidPen);
-			aGc.SetPenSize(TSize(1,1));
-			aGc.SetPenColor(aColor);
-			aGc.UseFont(aFont);
-			TInt drawHeight=aFont->AscentInPixels();
-			aRect.iTl.iY=aRect.iBr.iY/3;
-			aGc.DrawText(buf,aRect,drawHeight,CGraphicsContext::ECenter);
-			break;
-			}
-	default:;
-		}
-	}
--- a/windowing/windowserver/tauto/TBACKUPW.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,953 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test backed up windows
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TBACKUPW.H"
-
-CTBackedUpWindow::CTBackedUpWindow(CTestStep* aStep):
-	CTWsGraphicsBase(aStep)
-	{
-	}
-
-
-void CTBackedUpWindow::CheckWindow(CFbsBitmap *aBitmap)
-	{
-	TPoint oldPos=iBackedUpWindow.Position();
-	iBackedUpWindow.SetPosition(TPoint(0,0));
-
-	iCheckWindow.SetVisible(ETrue);
-	iCheckWindow.SetPosition(iCheckPos);
-
-	iCheckWindow.BeginRedraw();
-	TheGc->Activate(iCheckWindow);
-	TheGc->BitBlt(TPoint(0,0), aBitmap);
-	TheGc->Deactivate();
-	iCheckWindow.EndRedraw();
-
-	TheClient->iWs.Flush();
-	TheClient->WaitForRedrawsToFinish();
-	TBool retVal = TheClient->iScreen->RectCompare(TRect(iSize),TRect(iCheckPos,iSize));
-	TEST(retVal);
-	if (!retVal)
-		INFO_PRINTF3(_L("TheClient->iScreen->RectCompare(TRect(iSize),TRect(iCheckPos,iSize)) return value - Expected: %d , Actual: %d"), ETrue, retVal);		
-
-	iCheckWindow.SetVisible(EFalse);
-	iBackedUpWindow.SetPosition(oldPos);
-	}
-
-void CTBackedUpWindow::CheckWindow()
-	{
-	CheckWindow(&iBitmap);
-	}
-
-void CTBackedUpWindow::Draw(TInt aDrawFunc, TAny *aParam)
-	{
-	TheGc->Activate(iBackedUpWindow);
-	Draw(aDrawFunc, aParam, TheGc, iBitGc);
-	TheGc->Deactivate();
-	}
-
-void CTBackedUpWindow::DrawWithTwoGcsL()
-	{
-	RBlankWindow blank(TheClient->iWs);
-	User::LeaveIfError(blank.Construct(*(TheClient->iGroup->GroupWin()),ENullWsHandle));
-	blank.Activate();
-	CWindowGc *gc2;
-	User::LeaveIfError(TheClient->iScreen->CreateContext(gc2));
-	CleanupStack::PushL(gc2);
-
-	CFbsFont *font1;
-	TFontSpec fspec(KTestFontTypefaceName,200);
-	User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInTwips((CFont *&)font1,fspec));
-	CFbsFont *font2;
-	TFontSpec fspec2(KTestFontTypefaceName,400);
-	User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInTwips((CFont *&)font2,fspec2));
-
-	gc2->Activate(iBackedUpWindow);
-	gc2->UseFont(font2);
-	TheGc->Activate(iBackedUpWindow);
-	TheGc->UseFont(font1);
-	_LIT(KText,"Testing123");
-	TheGc->DrawText(KText,TPoint(20,20));
-	gc2->DrawText(KText,TPoint(20,40));
-	iBitGc->UseFont(font1);
-	iBitGc->DrawText(KText,TPoint(20,20));
-	iBitGc->UseFont(font2);
-	iBitGc->DrawText(KText,TPoint(20,40));
-	iBitGc->DiscardFont();
-	TheGc->Deactivate();
-	TheClient->iScreen->ReleaseFont(font2);
-	TheClient->iScreen->ReleaseFont(font1);
-	CleanupStack::PopAndDestroy();
-	blank.Close();
-	}
-
-void CTBackedUpWindow::Draw(TInt aDrawFunc, TAny *aParam, CBitmapContext *gc1, CBitmapContext *gc2)			//DDD
-	{
-	CBitmapContext *gc;
-	for(TInt mode=0;mode<2;mode++)
-		{
-		if (mode==0)
-			gc=gc1;
-		else
-			gc=gc2;
-		gc->Reset();
-		switch(aDrawFunc)
-			{
-			case 0:
-				gc->SetBrushColor(*((TRgb *)aParam));
-				gc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-				gc->SetPenStyle(CGraphicsContext::ENullPen);
-				gc->DrawRect(TRect(iSize));
-				break;
-			case 1:
-				{
-				TSize half(iSize.iWidth/2,iSize.iHeight/2);
-				gc->DrawEllipse(TRect(half));
-				gc->DrawEllipse(TRect(TPoint(0,half.iHeight),half));
-				TRect rect1(half);
-				gc->SetOrigin(TPoint(half.iWidth,0));
-				gc->SetClippingRect(rect1);
-				gc->DrawEllipse(rect1);
-				gc->SetOrigin(TPoint(half.iWidth,half.iHeight));
-				gc->SetClippingRect(rect1);
-				gc->DrawEllipse(rect1);
-				gc->SetOrigin(TPoint(0,0));
-				gc->CancelClippingRect();
-				}
-				break;
-			case 2:
-				{
-				TInt param= *((TInt *)aParam);
-				if (param&0x1)
-					gc->DrawLine(TPoint(param+(param*27)%iSize.iWidth,0),
-								 TPoint(iSize.iWidth-((param<<1)+(param*19)%iSize.iWidth),iSize.iHeight));
-				else
-					gc->DrawLine(TPoint(0, (param<<1)+(param*7)%iSize.iHeight),
-								 TPoint(iSize.iWidth,param+(param*13)%iSize.iHeight));
-				}
-				break;
-			case 3:
-				{
-				TPoint pos;
-				for(;pos.iX<iSize.iWidth;pos.iX+=10)
-					gc->DrawLine(pos,pos+TSize(0,iSize.iHeight));
-				for(pos.iX=0;pos.iY<iSize.iHeight;pos.iY+=10)
-					gc->DrawLine(pos,pos+TSize(iSize.iWidth,0));
-				}
-				break;
-			}
-		}
-	}
-
-CTBackedUpWindow::~CTBackedUpWindow()
-	{
-	iBackedUpWindow.Close();
-	iCheckWindow.Close();
-	iOomFrontWindow.Close();
-	delete iBitGc;
-	delete iBitmapDevice;
-	delete iTestBitmap;
-	delete iMaskBitmap;
-	}
-
-void CopyToGray4L(CFbsBitmap*& aDestBitmap,const CFbsBitmap& aSrcBitmap)
-	{
-	aDestBitmap=new(ELeave) CFbsBitmap();
-	CleanupStack::PushL(aDestBitmap);
-	User::LeaveIfError(aDestBitmap->Create(aSrcBitmap.SizeInPixels(),EGray4));
-	CFbsBitmapDevice* device=CFbsBitmapDevice::NewL(aDestBitmap);
-	CleanupStack::PushL(device);
-	CFbsBitGc* gc;
-	User::LeaveIfError(device->CreateContext(gc));
-	gc->BitBlt(TPoint(),&aSrcBitmap);
-	delete gc;
-	CleanupStack::PopAndDestroy(device);
-	CleanupStack::Pop(aDestBitmap);
-	}
-
-void CTBackedUpWindow::ConstructL()
-	{
-	iBackedUpWindow=RBackedUpWindow(TheClient->iWs);
-	iBackedUpWindow.Construct(*(TheClient->iGroup->GroupWin()),EGray4,ENullWsHandle);
-	TSize size=TheClient->iScreen->SizeInTwips();
-	iSize=TheClient->iScreen->SizeInPixels();
-	iSize.iWidth>>=1;
-	iSize.iHeight>>=1;
-	size.iWidth>>=1;
-	size.iHeight>>=1;
-	size.iWidth-=1;			//Modification to get the mapping factor the same as the screen
-	size.iHeight-=1;		//Ditto
-	iWinPos.SetXY(iSize.iWidth>>1,iSize.iHeight>>1);
-	User::LeaveIfError(iBackedUpWindow.SetExtentErr(iWinPos,iSize));
-	iBackedUpWindow.Activate();
-
-	iCheckPos.SetXY(iSize.iWidth,0);
-	iCheckWindow=RWindow(TheClient->iWs);
-	iCheckWindow.Construct(*(TheClient->iGroup->GroupWin()),ENullWsHandle);
-	iCheckWindow.SetSize(iSize);
-	iCheckWindow.SetVisible(EFalse);
-	iCheckWindow.Activate();
-
-	TInt col,grey;
-	TDisplayMode defMode=TheClient->iWs.GetDefModeMaxNumColors(col,grey);
-	User::LeaveIfError(iBitmap.Create(iSize,defMode));
-	iBitmap.SetSizeInTwips(size);
-	iBitmapDevice=CFbsBitmapDevice::NewL(&iBitmap);
-	User::LeaveIfError(iBitmapDevice->CreateContext(iBitGc));
-
-	TRgb rgb(TRgb::Gray4(2));
-	Draw(0,&rgb);
-
-	iTestBitmap=new(ELeave) CFbsBitmap();
-  	User::LeaveIfError(iTestBitmap->Load(TEST_BITMAP_NAME,0));
-	iTestBitmap->SetSizeInTwips(TSize(1500,750));
-	iMaskBitmap=new(ELeave) CFbsBitmap();
-  	User::LeaveIfError(iMaskBitmap->Load(TEST_BITMAP_NAME,0));
-  	TDisplayMode defMode2=iMaskBitmap->DisplayMode();
-  	if (defMode>EGray4)
-		{
-		CFbsBitmap* bitmap=iTestBitmap;
-		CopyToGray4L(iTestBitmap,*bitmap);
-		delete bitmap;
-		bitmap=iMaskBitmap;
-		CopyToGray4L(iMaskBitmap,*bitmap);
-		delete bitmap;
-		}
-	defMode2=iMaskBitmap->DisplayMode();
-	defMode2=iMaskBitmap->DisplayMode();	
-	}
-
-void CTBackedUpWindow::InvisVis()
-	{
-	iBackedUpWindow.SetVisible(EFalse);
-	TheClient->iWs.Flush();
-	iBackedUpWindow.SetVisible(ETrue);
-	TheClient->iWs.Flush();
-	}
-
-void CTBackedUpWindow::WindowOnTop()
-	{
-	RBlankWindow blank(TheClient->iWs);
-	blank.Construct(*(TheClient->iGroup->GroupWin()),ENullWsHandle);
-	blank.Activate();
-	blank.Close();
-	TheClient->iWs.Flush();
-
-	TPoint pos;
-	TInt sizeMode=0;
-	TInt draw=13;
-
-	for(pos.iX=-iSize.iWidth;pos.iX<iSize.iWidth;pos.iX+=50)
-		for(pos.iY=-iSize.iHeight;pos.iY<iSize.iHeight;pos.iY+=50)
-			{
-			blank=RBlankWindow(TheClient->iWs);
-			blank.Construct(*(TheClient->iGroup->GroupWin()),ENullWsHandle);
-			blank.SetColor(TRgb::Gray256(220));
-			blank.SetShadowHeight(2);
-			blank.SetExtent(pos+iWinPos,TSize((sizeMode&0x1)?iSize.iWidth>>1:iSize.iWidth<<1,(sizeMode&0x2)?iSize.iHeight>>1:iSize.iHeight<<1));
-			sizeMode=(sizeMode+1)%4;
-			blank.Activate();
-			Draw(2,&draw);
-			TheClient->iWs.Flush();
-			draw++;
-			blank.Close();
-			}
-	}
-
-void CTBackedUpWindow::Resize()
-	{
-	RBlankWindow blank(TheClient->iWs);
-	blank.Construct(*(TheClient->iGroup->GroupWin()),ENullWsHandle);
-	blank.SetColor(TRgb::Gray256(128));
-	blank.Activate();
-	TInt xtop=(iSize.iWidth)-(iSize.iWidth>>2);
-	TInt ytop=(iSize.iHeight)-(iSize.iHeight>>2);
-	for(TInt winMode=0;winMode<3;winMode++)
-		{
-		switch(winMode)
-			{
-			case 0:
-				blank.SetExtent(TPoint(0,ytop),TSize(iSize.iWidth,iSize.iHeight>>1));
-				break;
-			case 1:
-				blank.SetExtent(TPoint(xtop,0),TSize(iSize.iWidth>>1,iSize.iHeight));
-				break;
-			case 2:
-				blank.SetExtent(TPoint(xtop,ytop),TSize(iSize.iWidth>>1,iSize.iHeight>>1));
-				break;
-			}
-		blank.SetShadowHeight(winMode);
-		TPoint oldPos=iBackedUpWindow.Position();
-		TPoint pos=oldPos;
-		for(TUint i=0;i<sizeof(moveList)/sizeof(moveList[0]);i++)
-			{
-			pos+=moveList[i];
-			iBackedUpWindow.SetPosition(pos);
-			TheClient->iWs.Flush();
-			}
-		iBackedUpWindow.SetPosition(oldPos);
-		}
-	blank.Close();
-	}
-
-void CTBackedUpWindow::ChildWindows()
-	{
-	TPoint pos;
-	TInt sizeMode=0;
-	TInt draw=13;
-	RBlankWindow blank(TheClient->iWs);
-	for(pos.iX=-(iSize.iWidth>>1);pos.iX<iSize.iWidth;pos.iX+=33)
-		for(pos.iY=-(iSize.iHeight>>1);pos.iY<iSize.iHeight;pos.iY+=33)
-			{
-			blank.Construct(iBackedUpWindow,ENullWsHandle);
-			blank.SetColor(TRgb::Gray256(220));
-			blank.SetShadowHeight(2);
-			blank.SetExtent(pos,TSize((sizeMode&0x1)?iSize.iWidth>>2:iSize.iWidth,(sizeMode&0x2)?iSize.iHeight>>2:iSize.iHeight));
-			sizeMode=(sizeMode+1)%4;
-			blank.Activate();
-			Draw(2,&draw);
-			TheClient->iWs.Flush();
-			draw++;
-			blank.Close();
-			}
-	}
-
-void CTBackedUpWindow::DupBitmapTestL()
-	{
-	INFO_PRINTF1(_L("AUTO  Dup Bitmap Test "));
-	CFbsBitmap *dup=new(ELeave) CFbsBitmap();
-	dup->Duplicate(iBackedUpWindow.BitmapHandle());
-	CheckWindow(dup);
-	TRgb rgb(TRgb::Gray4(1));
-	Draw(0,&rgb);
-	CheckWindow(dup);
-	INFO_PRINTF1(_L(" Done Window Drawing Test"));
-
-	CFbsBitmapDevice *dupDevice=NULL;
-	TRAPD(err,dupDevice=CFbsBitmapDevice::NewL(dup));
-	CFbsBitGc *gc;
-	if (err==KErrNone && dupDevice->CreateContext(gc)==KErrNone)
-		{
-		Draw(3,NULL,gc,iBitGc);		// Draw directly to backup bitmap (and test bitmap)
-		iBackedUpWindow.UpdateScreen();
-		INFO_PRINTF1(_L(" First Bitmap Drawing"));
-		CheckWindow();
-		TRgb rgb(TRgb::Gray256(128));
-		TInt col,grey;
-		if (TheClient->iWs.GetDefModeMaxNumColors(col,grey)>EGray4)
-			rgb=TRgb::Gray4(2);
-		Draw(0,&rgb,gc,iBitGc);
-		Draw(1,NULL,gc,iBitGc);
-		iBackedUpWindow.UpdateScreen(TRegionFix<1>(TRect(iSize)));
-		INFO_PRINTF1(_L(" Second Bitmap Drawing"));
-		CheckWindow();
-		delete gc;
-		}
-	delete dupDevice;
-	delete dup;
-	}
-
-void CTBackedUpWindow::UpdateBitmapTestL()
-	{
-	INFO_PRINTF1(_L("AUTO  UpdateBitmap "));
-	CheckWindow();
-	CFbsBitmap *dup=new(ELeave) CFbsBitmap();
-	dup->Duplicate(iBackedUpWindow.BitmapHandle());
-	Draw(3,NULL);
-	iBackedUpWindow.UpdateBackupBitmap();
-	INFO_PRINTF1(_L(" First Drawing"));
-	CheckWindow(dup);
-	TRgb rgb;
-	if (iSupState==0)
-		rgb=TRgb::Gray256(128);
-	else
-		rgb=TRgb::Gray4(2);
-	Draw(0,&rgb);
-	Draw(1,NULL);
-	iBackedUpWindow.UpdateBackupBitmap();
-	INFO_PRINTF1(_L(" Second Drawing"));
-	CheckWindow(dup);
-	delete dup;
-	}
-
-void CTBackedUpWindow::OOML()
-	{
-	iOomFrontWindow=RBlankWindow(TheClient->iWs);
-	TSize size(iBackedUpWindow.Size());
-	size.iWidth>>=1;
-	size.iHeight>>=1;
-	TPoint pos(size.iWidth*3/2,size.iHeight*3/2);
-	iOomFrontWindow.Construct(*(TheClient->iGroup->GroupWin()),ENullWsHandle);
-	iOomFrontWindow.SetColor(TRgb(TRgb::Gray4(1)));
-	iOomFrontWindow.SetExtent(pos,size);
-	iOomFrontWindow.Activate();
-	TheClient->iWs.Flush();
-
-	TPoint buwPos=iBackedUpWindow.Position();
-	TSize buwSize=iBackedUpWindow.Size();
-	for(TInt count=0;count<100;count++)
-		{
-		iOomFrontWindow.SetVisible(ETrue);
-		TheClient->iWs.HeapSetFail(RHeap::EDeterministic,count);
-		iBackedUpWindow.SetPosition(buwPos+TPoint(10,5));
-		iBackedUpWindow.SetPosition(buwPos);
-		iOomFrontWindow.SetSize(size+TSize(10,5));
-		iOomFrontWindow.SetSize(size);
-		iBackedUpWindow.SetSizeErr(buwSize+TSize(13,7));
-		iBackedUpWindow.SetSizeErr(buwSize);
-		iOomFrontWindow.SetVisible(EFalse);
-		TheClient->iWs.HeapSetFail(RHeap::ENone,0);
-		User::LeaveIfError(iBackedUpWindow.SetSizeErr(buwSize));
-		TheClient->WaitForRedrawsToFinish();
-		CheckWindow();
-		}
-
-	iOomFrontWindow.Close();
-	}
-
-void CTBackedUpWindow::doGraphicFunctionsL(CBitmapContext *gc,TBool aExtraDrawBitMap)
-	{
-	TSize size=iBackedUpWindow.Size();
-	CFbsFont *aFont;
-	_LIT(KFontName,"Swiss");
-	TFontSpec fspec(KFontName,190);
-	User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInTwips((CFont *&)aFont,fspec));
-	CFbsBitmap* aBitmap=iTestBitmap;
-	CFbsBitmap* aMaskBitmap=iMaskBitmap;
-
-	#include "DLLDRAW.H"	// Draws to a Gc called 'gc'
-	
-	TheClient->iScreen->ReleaseFont(aFont);
-	}
-
-void CTBackedUpWindow::AllGraphicFunctionsL(RBlankWindow &aBlank,TBool aExtraDrawBitMap/*=ETrue*/)
-	{
-	aExtraDrawBitMap=EFalse;		//Check out when bitblit scaling has changed again
-	aBlank.SetVisible(ETrue);
-	TheGc->Activate(iBackedUpWindow);
-	TRAPD(err,doGraphicFunctionsL(TheGc,aExtraDrawBitMap));
-	TheGc->Deactivate();
-	User::LeaveIfError(err);
-	iBitGc->Reset();
-	iBitGc->SetUserDisplayMode(EGray4);
-	doGraphicFunctionsL(iBitGc,aExtraDrawBitMap);
-	aBlank.SetVisible(EFalse);
-	CheckWindow();
-	}
-
-void CTBackedUpWindow::AllGraphicFunctionsTestsL()
-	{
-	RBlankWindow blank(TheClient->iWs);
-	TInt xtop=(iSize.iWidth)-(iSize.iWidth>>1);
-	TInt ytop=(iSize.iHeight)-(iSize.iHeight>>1);
-	blank.Construct(*(TheClient->iGroup->GroupWin()),ENullWsHandle);
-	blank.SetColor(TRgb::Gray256(128));
-	blank.Activate();
-	blank.SetExtent(TPoint(0,ytop),TSize(iSize.iWidth,iSize.iHeight>>2));
-	AllGraphicFunctionsL(blank);
-	blank.SetExtent(TPoint(0,ytop+10),TSize(iSize.iWidth,iSize.iHeight>>2));
-	AllGraphicFunctionsL(blank);
-	blank.SetExtent(TPoint(xtop,ytop),TSize(iSize.iWidth>>1,iSize.iHeight));
-	AllGraphicFunctionsL(blank,EFalse);
-	blank.SetExtent(TPoint(xtop+(iSize.iWidth>>1),ytop),TSize(iSize.iWidth>>1,iSize.iHeight));
-	AllGraphicFunctionsL(blank,EFalse);
-	blank.SetExtent(TPoint(xtop+10,iSize.iHeight),TSize(iSize.iWidth,iSize.iHeight));
-	AllGraphicFunctionsL(blank,EFalse);
-	blank.SetExtent(TPoint(xtop,ytop),iSize);
-	AllGraphicFunctionsL(blank,EFalse);
-	blank.SetExtent(TPoint(0,0),TSize(0,0));
-	AllGraphicFunctionsL(blank);
-	blank.Close();
-	}
-
-void CTBackedUpWindow::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	switch(iSupState)
-		{
-		case 0:
-			for (TInt iSubTest=0;iSubTest<KLastSubtest;iSubTest++)
-				{
-				DoSubTestL(iSubTest);
-				}
-			iBackedUpWindow.MaintainBackup();		//Putting this line here is a work around
-			break;
-		case 1:
-			for (TInt iSubTest=0;iSubTest<KLastSubtest;iSubTest++)
-				{
-				DoSubTestL(iSubTest);
-				}
-			break;
-		default:
-			TestComplete();
-			break;
-		}
-	iSupState++;
-	}
-
-void CTBackedUpWindow::DoSubTestL(TInt iState)
-	{
-	_LIT(KTest0,"Simple draw");
-	_LIT(KTest1,"Resizing");
-	_LIT(KTest2,"Invisible/Visible");
-	_LIT(KTest3,"Windows on top");
-	_LIT(KTest4,"Child Windows");
-	_LIT(KTest5,"OOM");
-	_LIT(KTest6,"Update Bitmap");
-	_LIT(KTest7,"Bitmap duplicate");
-	_LIT(KTest8,"Two Graphic Contexts");
-	_LIT(KTest9,"All Graphic Functions");
-	_LIT(KTest10,"Reactivate");
-	_LIT(KTest11,"DoDrawCommand");
-
-	TRgb rgb1(255,255,255);
-	TRgb rgb2(255,255,255);
-	TRgb rgb3(255,255,255);
-	TRgb rgb4(255,255,255);
-	TRgb rgb5(255,255,255);
-	TRgb rgb6(255,255,255);
-	TRgb rgb7(255,255,255);
-	TRgb color(TRgb::Gray4(2));
-
-	iTest->iState=iState;
-((CTBackedUpWindowStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(iState)
-		{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0202-0001
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test drawing in a backed up window
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Draw in a backed up window and a normal window and check
-					the two drawings are the same
-
-@SYMTestExpectedResults The two drawings are exactly the same
-*/
-		case 0:
-			((CTBackedUpWindowStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0202-0001"));
-			iTest->LogSubTest(KTest0);
-			Draw(1,NULL);
-			CheckWindow();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0202-0002
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test drawing in a backed up window
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Draw in a backed up window and a normal window and check
-					the two drawings are the same
-
-@SYMTestExpectedResults The two drawings are exactly the same
-*/
-		case 1:
-			((CTBackedUpWindowStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0202-0002"));
-			iTest->LogSubTest(KTest1);
-			Draw(0,&rgb1);
-			Draw(3,NULL);
-			Resize();
-			CheckWindow();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0203
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test making a backed up window invisible
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Draw in a backed up window and a normal window, make
-					the backed up window invisible then visible and
-					then check the two drawings are the same
-
-@SYMTestExpectedResults The two drawings are exactly the same
-*/
-		case 2:
-			((CTBackedUpWindowStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0203"));
-			iTest->LogSubTest(KTest2);
-			Draw(0,&rgb2);
-			Draw(1,NULL);
-			InvisVis();
-			CheckWindow();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0204
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test drawing in a backed up window and then placing a
-					window on top of it
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Draw in a backed up window and a normal window, then
-					place a window on top of the backed up window and then
-					check the two drawings are the same
-
-@SYMTestExpectedResults The two drawings are exactly the same
-*/
-		case 3:
-			((CTBackedUpWindowStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0204"));
-			iTest->LogSubTest(KTest3);
-			//TRgb rgb(220,220,220);
-			Draw(0,&rgb3);
-			Draw(1,NULL);
-			WindowOnTop();
-			CheckWindow();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0205
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test drawing in a backed up window and then drawing in
-					a child window
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Draw in a backed up window and a normal window, then
-					create and draw in a child window and then
-					check the two original drawings are the same
-
-@SYMTestExpectedResults The two drawings are exactly the same
-*/
-		case 4:
-			((CTBackedUpWindowStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0205"));
-			iTest->LogSubTest(KTest4);
-			Draw(0,&rgb4);
-			Draw(3,NULL);
-			ChildWindows();
-			CheckWindow();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0206
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Out of memeory test for backed up windows
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Out of memeory test for backed up windows
-
-@SYMTestExpectedResults Backed up window responds correctly when out
-						of memory
-*/
-		case 5:
-			((CTBackedUpWindowStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0206"));
-			iTest->LogSubTest(KTest5);
-			if (!iTest->IsFullRomL())
-				{
-				Draw(0,&rgb5);
-				Draw(3,NULL);
-				OOML();
-				CheckWindow();
-				}
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0207
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test updating a bitmap in a backed up window
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Update a bitmap in a backed up window and a normal window
-					and check the two bitmaps are the same
-
-@SYMTestExpectedResults The two bitmaps are exactly the same
-*/
-		case 6:
-			((CTBackedUpWindowStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0207"));
-			iTest->LogSubTest(KTest6);
-			Draw(0,&rgb6);
-			Draw(1,NULL);
-			UpdateBitmapTestL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0208
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test updating a duplicate bitmap in a backed up window
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Update a duplicated bitmap in a backed up window and a normal window
-					and check the two bitmaps are the same
-
-@SYMTestExpectedResults The two bitmaps are exactly the same
-*/
-		case 7:
-			((CTBackedUpWindowStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0208"));
-			if (iSupState==0)		//Will fail unless the window is fully backup.
-				break;
-			iTest->LogSubTest(KTest7);
-			Draw(0,&rgb7);
-			Draw(1,NULL);
-			DupBitmapTestL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0209
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test drawing with two graphic contexts in a backed up window
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Draw using two graphic contexts in a backed up window and a normal
-					window and check the two drawings are the same
-
-@SYMTestExpectedResults The two drawings are exactly the same
-*/
-		case 8:
-			((CTBackedUpWindowStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0209"));
-			iTest->LogSubTest(KTest8);
-			Draw(0,&color);
-			Draw(1,NULL);
-			DrawWithTwoGcsL();
-			CheckWindow();
-			break;
-			
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0210
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test drawing using all the graphic functions in a backed up window
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Draw using all the graphic functions in a backed up window and a normal
-					window and check the two drawings are the same
-
-@SYMTestExpectedResults The two drawings are exactly the same
-*/
-		case 9:
-			((CTBackedUpWindowStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0210"));
-			iTest->LogSubTest(KTest9);
-			if(TheClient->iScreen->SizeInPixels() == TSize(640,240))
-				AllGraphicFunctionsTestsL();
-			break;
-
-		//A Coverage test, nothing spectacular just making the code
-		//go into CWsGc::Reactivate
-		case 10:
-			{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0502
-*/
-			((CTBackedUpWindowStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0502"));
-			iTest->LogSubTest(KTest10);
-			TheGc->Deactivate();
-			RBackedUpWindow extentWindow;
-			extentWindow=RBackedUpWindow(TheClient->iWs);
-			extentWindow.Construct(*(TheClient->iGroup->GroupWin()),EGray4,ENullWsHandle);
-			TheGc->Activate(extentWindow);
-			TheClient->Flush();
-			User::LeaveIfError(extentWindow.SetExtentErr(TPoint(2,2), TSize(4,4)));
-			extentWindow.Activate();
-			extentWindow.Close();
-			TheGc->Deactivate();
-			break;
-			}
-
-		//Coverage for various messages for CWsGc::DoDrawCommand
-		case 11:
-			{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0507
-*/
-			((CTBackedUpWindowStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0507"));
-			iTest->LogSubTest(KTest11);
-			TheGc->Activate(iBackedUpWindow);
-			TheGc->Reset();
-			iBitGc->Reset();
-			iBitGc->SetUserDisplayMode(EGray4);
-			
-			// EWsGcOpDrawWsGraphic
-			TheGc->DrawWsGraphic(TWsGraphicId(0), TRect(0,0,10,10)); 
-			
-			//create a large junk buffer so that messages with Ptr suffix will be sent
-			RBuf8 junkBuf8;
-			RBuf  junkBuf;
-			junkBuf8.CreateMax(650); // a large enough buffer to sent as Ptr (this value used to crash the code before)
-			junkBuf.CreateMax(650); // a large enough buffer to sent as Ptr
-			for (int i=0; i<junkBuf.MaxLength()-1;i++)
-				{
-				junkBuf8[i] = 'A';
-				junkBuf[i] = 'A';
-				}
-			junkBuf8[junkBuf8.MaxLength()-1] = '\0';
-			junkBuf[junkBuf.MaxLength()-1] = '\0';
-			
-			// EWsGcOpDrawWsGraphicPtr
-			TheGc->DrawWsGraphic(TWsGraphicId(0), TRect(0,0,10,10), junkBuf8);
-			
-			// Set font for drawing on screen
-			CFbsFont *font1;
-			TFontSpec fspec(KTestFontTypefaceName,200);
-			User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInTwips((CFont *&)font1,fspec));
-			TheGc->UseFont(font1);
-			iBitGc->UseFont(font1);
-						
-			// EWsGcOpDrawTextPtr
-			TheGc->DrawText(junkBuf, TPoint(0,0));
-			iBitGc->DrawText(junkBuf, TPoint(0,0));
-			
-			// EWsGcOpDrawBoxText - unreachable 299-too lo, 300-too hi
-
-			// EWsGcOpDrawBoxTextPtr
-			TheGc->DrawText(junkBuf, TRect(0,0,10,10), 0, CGraphicsContext::ELeft, 0); 
-			iBitGc->DrawText(junkBuf, TRect(0,0,10,10), 0, CGraphicsContext::ELeft, 0); 
-			
-			// EWsGcOpDrawTextVerticalPtr
-			TheGc->DrawTextVertical(junkBuf, TPoint(0,0), ETrue);
-			iBitGc->DrawTextVertical(junkBuf, TPoint(0,0), ETrue);
-			
-			// EWsGcOpDrawBoxTextVerticalPtr
-			TheGc->DrawTextVertical(junkBuf, TRect(0,0,10,10), 0, ETrue, CGraphicsContext::ELeft, 0);
-			iBitGc->DrawTextVertical(junkBuf, TRect(0,0,10,10), 0, ETrue, CGraphicsContext::ELeft, 0);
-			
-			// EWsGcOpMoveBy
-			TheGc->MoveBy(TPoint(2,2));
-			iBitGc->MoveBy(TPoint(2,2));
-			
-			// a bitmap for bitblt ops
-			CWsBitmap bmp(TheClient->iWs);
-			bmp.Create(TSize(16,16), iBackedUpWindow.DisplayMode());
-			
-			// EWsGcOpGdiWsBlt2
-			TheGc->BitBlt(TPoint(0,0), &bmp);
-			iBitGc->BitBlt(TPoint(0,0), &bmp);
-			
-			// EWsGcOpGdiWsBlt3
-			TheGc->BitBlt(TPoint(0,0), &bmp, TRect(0,0,10,10));
-			iBitGc->BitBlt(TPoint(0,0), &bmp, TRect(0,0,10,10));
-			
-			// EWsGcOpGdiWsBltMasked
-			TheGc->BitBltMasked(TPoint(0,0), &bmp, TRect(0,0,10,10), &bmp, EFalse);
-			iBitGc->BitBltMasked(TPoint(0,0), &bmp, TRect(0,0,10,10), &bmp, EFalse);
-			
-			// EWsGcOpGdiWsAlphaBlendBitmaps
-			TheGc->AlphaBlendBitmaps(TPoint(0,0), &bmp, TRect(0,0,10,10), &bmp, TPoint(1,1));
-			iBitGc->AlphaBlendBitmaps(TPoint(0,0), &bmp, TRect(0,0,10,10), &bmp, TPoint(1,1));
-			
-			// EWsGcOpWsDrawBitmapMasked
-			TheGc->DrawBitmapMasked(TRect(0,0,10,10), &bmp, TRect(0,0,8,8), &bmp, ETrue);
-			iBitGc->DrawBitmapMasked(TRect(0,0,10,10), &bmp, TRect(0,0,8,8), &bmp, ETrue);
-			
-			// EWsGcOpDrawBitmap 
-			TheGc->DrawBitmap(TPoint(0,0), &bmp);
-			iBitGc->DrawBitmap(TPoint(0,0), &bmp);
-			
-			// EWsGcOpDrawBitmapMasked 
-			TheGc->DrawBitmapMasked(TRect(0,0,10,10), static_cast<const CFbsBitmap*>(&bmp), 
-					                TRect(0,0,8,8), static_cast<const CFbsBitmap*>(&bmp), 
-					                EFalse);
-			iBitGc->DrawBitmapMasked(TRect(0,0,10,10), static_cast<const CFbsBitmap*>(&bmp), 
-	                				TRect(0,0,8,8), static_cast<const CFbsBitmap*>(&bmp), 
-	                				EFalse);
-			
-			// EWsGcOpDrawPolyLineContinued
-			TheGc->DrawPolyLine(reinterpret_cast<const TPoint*>(junkBuf8.Ptr()),
-    				            TInt(junkBuf8.Size()/sizeof(TPoint)));
-			iBitGc->DrawPolyLine(reinterpret_cast<const TPoint*>(junkBuf8.Ptr()),
-		            			TInt(junkBuf8.Size()/sizeof(TPoint)));
-			
-			// EWsGcOpCopyRect
-			TheGc->CopyRect(TPoint(0,0), TRect(0,0,10,10));
-			iBitGc->CopyRect(TPoint(0,0), TRect(0,0,10,10));
-			
-			//cleanup
-			TheClient->Flush();
-			TheGc->DiscardFont();
-			iBitGc->DiscardFont();
-			TheClient->iScreen->ReleaseFont(font1);
-			junkBuf.Close();
-			junkBuf8.Close();
-			TheGc->Deactivate();
-		
-			CheckWindow();
-			
-			//the following have no client equivalent methods
-			// EWsGcOpMapColorsLocal
-			// EWsGcOpDrawPolyLineLocalBufLen
-			// EWsGcOpDrawPolyLineLocal
-			// EWsGcOpDrawPolygonLocalBufLen
-			// EWsGcOpDrawPolygonLocal
-			// EWsGcOpDrawBitmapLocal
-			// EWsGcOpDrawBitmap2Local
-			// EWsGcOpDrawBitmap3Local
-			// EWsGcOpDrawBitmapMaskedLocal
-			// EWsGcOpDrawTextPtr1
-			// EWsGcOpDrawBoxTextPtr1
-			// EWsGcOpDrawTextVerticalPtr1
-			// EWsGcOpDrawBoxTextVerticalPtr1
-			// EWsGcOpDrawTextLocal
-			// EWsGcOpDrawBoxTextLocal
-			// EWsGcOpGdiBlt2Local
-			// EWsGcOpGdiBlt3Local
-			// EWsGcOpGdiBltMaskedLocal
-			((CTBackedUpWindowStep*)iStep)->CloseTMSGraphicsStep();
-			break;
-			}
-
-		default:
-			((CTBackedUpWindowStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTBackedUpWindowStep*)iStep)->CloseTMSGraphicsStep();
-			break;
-		}
-       ((CTBackedUpWindowStep*)iStep)->RecordTestResultL();
-	}
-
-__WS_CONSTRUCT_STEP__(BackedUpWindow)
--- a/windowing/windowserver/tauto/TBACKUPW.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TBACKUPW_H__
-#define __TBACKUPW_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include <bitstd.h>
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-const TInt KLastSubtest = 13;
-
-class CTBackedUpWindow : public CTWsGraphicsBase
-	{
-public:
-	CTBackedUpWindow(CTestStep* aStep);
-	~CTBackedUpWindow();
-	void DoTestL();
-	void DoSubTestL(TInt iState);
-	void CheckWindow();
-	void CheckWindow(CFbsBitmap *aBitmap);
-	void Draw(TInt aDrawFunc, TAny *aParam);
-	void Draw(TInt aDrawFunc, TAny *aParam, CBitmapContext *aGc1, CBitmapContext *aGc2);
-	void DrawWithTwoGcsL();
-	void ConstructL();
-	void InvisVis();
-	void WindowOnTop();
-	void Resize();
-	void ChildWindows();
-	void DupBitmapTestL();
-	void UpdateBitmapTestL();
-	void OOML();
-	void TestPanicsL();
-	void doGraphicFunctionsL(CBitmapContext *gc,TBool aExtraDrawBitMap);
-	void AllGraphicFunctionsL(RBlankWindow &aBlank,TBool aExtraDrawBitMap=ETrue);
-	void AllGraphicFunctionsTestsL();
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	TInt iSupState;
-	TSize iSize;
-	TPoint iCheckPos;
-	TPoint iWinPos;
-	RWindow iCheckWindow;
-	RBackedUpWindow iBackedUpWindow;
-	RBlankWindow iOomFrontWindow;
-	CFbsBitmap iBitmap;
-	CFbsBitGc *iBitGc;
-	CFbsDevice *iBitmapDevice;
-	CFbsBitmap* iTestBitmap;
-	CFbsBitmap* iMaskBitmap;
-	};
-
-LOCAL_D const TPoint moveList[]={TPoint(1,0),TPoint(10,20),TPoint(-50,0),TPoint(30,-1),TPoint(-1000,20)};
-
-
-
-class CTBackedUpWindowStep : public CTGraphicsStep
-	{
-public:
-	CTBackedUpWindowStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTBackedUpWindowStep,"TBackedUpWindow");
-
-
-#endif
--- a/windowing/windowserver/tauto/TBITMAP.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,226 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test the window server bitmap class
-// Test the window server bitmap class
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TBITMAP.H"
-
-//
-
-CTBitmap::CTBitmap(CTestStep* aStep):
-	CTWsGraphicsBase(aStep)
-	{
-	}
-
-CTBitmap::~CTBitmap()
-	{
-	delete iBitmap1;
-	delete iBitmap2;
-	}
-
-void CTBitmap::ConstructL()
-	{
-	}
-
-void CTBitmap::BasicTestsL()
-	{
-	iBitmap1=new(ELeave) CWsBitmap(TheClient->iWs);
-	iBitmap2=new(ELeave) CWsBitmap(TheClient->iWs);
-	User::LeaveIfError(iBitmap1->Create(TSize(20,10),EGray4));
-// Re-create should close previous Create
-	User::LeaveIfError(iBitmap1->Create(TSize(20,10),EGray4));
-	User::LeaveIfError(iBitmap2->Duplicate(iBitmap1->Handle()));
-	TEST(iBitmap1->SizeInPixels()==iBitmap2->SizeInPixels());
-		
-	TInt err=iBitmap2->Load(_L("NOTEXIST.XXX"),0);
-	TEST(err==KErrNotFound || err==KErrPathNotFound);
-	if (err!=KErrNotFound && err!=KErrPathNotFound)
-		INFO_PRINTF4(_L("Bitmap2->Load(_L(NOTEXIST.XXX),0) return value - Expected: %d or %d , Actual: %d"), KErrNotFound, KErrPathNotFound, err);		
-	
-	TInt retVal = iBitmap2->Handle();
-	TEST(retVal==0);
-	if (retVal!=0)
-		INFO_PRINTF3(_L("iBitmap2->Handle() return value - Expected: %d , Actual: %d"), 0, retVal);		
-
-	RFs fs;
-	User::LeaveIfError(fs.Connect());
-	fs.SetNotifyUser(EFalse);
-	TInt ret=fs.MkDir(SAVE_BITMAP_NAME);
-	if (ret!=KErrNone && ret!=KErrAlreadyExists && ret!=KErrPathNotFound)
-		User::Leave(ret);
-	fs.Close();
-//
-	retVal = iBitmap1->Save(SAVE_BITMAP_NAME);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("iBitmap1->Save(SAVE_BITMAP_NAME) return value - Expected: %d , Actual: %d"), KErrNone, retVal);		
-	
-	retVal = iBitmap2->Load(SAVE_BITMAP_NAME,0);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("iBitmap2->Load(SAVE_BITMAP_NAME,0) return value - Expected: %d , Actual: %d"), KErrNone, retVal);		
-	
-	TEST(iBitmap1->SizeInPixels()==iBitmap2->SizeInPixels());
-	}
-	
-	
-void CTBitmap::TestFixForPDEF098889L()
-	{
-	TRequestStatus status;
-	TThreadParams params;
-	params.iScreenNr = TheClient->iWs.GetFocusScreen();
-
-	RThread thread1;
-	params.iFunction = Function1PDEF098889L;
-	TEST(thread1.Create(_L("PDEF098889_1"), ThreadFunction, 0x1000, NULL, &params)==KErrNone);
-	thread1.Logon(status);
-	thread1.Resume();
-	User::WaitForRequest(status);
-	TEST(status==KErrNone);
-	TEST(thread1.ExitType()==EExitKill);
-	thread1.Close();
-
-	RThread thread2;
-	params.iFunction = Function2PDEF098889L;
-	TEST(thread2.Create(_L("PDEF098889_2"), ThreadFunction, 0x1000, NULL, &params)==KErrNone);
-	thread2.Logon(status);
-	thread2.Resume();
-	User::WaitForRequest(status);
-	TEST(status==KErrNone);
-	TEST(thread2.ExitType()==EExitKill);
-	thread2.Close();
-	}
-
-TInt CTBitmap::ThreadFunction(TAny* aParams)
-	{
-	CTrapCleanup *trap = CTrapCleanup::New();
-	__ASSERT_ALWAYS(trap, User::Invariant());
-	RWsSession session;
-	TInt err = session.Connect();
-	if (err == KErrNone)
-		{
-		CWsScreenDevice *device = new CWsScreenDevice(session);
-		if (device)
-			{
-			err = device->Construct(static_cast<TThreadParams*>(aParams)->iScreenNr);
-			if (err == KErrNone)
-				{
-				TRAP(err, static_cast<TThreadParams*>(aParams)->iFunction(session, *device));	
-				}
-			delete device;
-			}
-		else
-			err = KErrNoMemory;
-		session.Close();
-		}
-	delete trap;
-	return err;
-	}
-
-void CTBitmap::Function1PDEF098889L(RWsSession& aSession, CWsScreenDevice& aDevice)
-	{
-	CWindowGc *gc;
-	User::LeaveIfError(aDevice.CreateContext(gc));
-	CleanupStack::PushL(gc);
-	RWindowGroup group(aSession);
-	User::LeaveIfError(group.Construct(1, EFalse));
-	CWsBitmap *bitmap = new(ELeave) CWsBitmap(aSession);
-	CleanupStack::PushL(bitmap);
-	User::LeaveIfError(bitmap->Create(TSize(32, 32), EGray256));
-	RWindow window(aSession);
-	User::LeaveIfError(window.Construct(group, 2));
-	window.SetExtent(TPoint(0,0), TSize(32, 32));
-	User::LeaveIfError(window.SetRequiredDisplayMode(EColor64K));
-	window.Activate();
-	window.BeginRedraw();
-	gc->Activate(window);
-	gc->BitBlt(TPoint(0, 0), bitmap);
-	gc->Deactivate();
-	window.EndRedraw();
-	CleanupStack::PopAndDestroy(bitmap);
-	aSession.Flush();
-	CleanupStack::PopAndDestroy(gc);
-	}
-
-void CTBitmap::Function2PDEF098889L(RWsSession& aSession, CWsScreenDevice& /*aDevice*/) 
-	{
-	RWindowGroup group(aSession);
-	User::LeaveIfError(group.Construct(1, EFalse));
-	CWsBitmap *bitmap = new(ELeave) CWsBitmap(aSession);
-	CleanupStack::PushL(bitmap);
-	User::LeaveIfError(bitmap->Create(TSize(32, 32), EGray256));
-	RWindow window(aSession);
-	User::LeaveIfError(window.Construct(group, 2));
-	window.SetExtent(TPoint(0,0), TSize(32, 32));
-	User::LeaveIfError(window.SetRequiredDisplayMode(EColor64K));
-	User::LeaveIfError(window.SetTransparencyWsBitmap(*bitmap));
-	window.Activate();
-	CleanupStack::PopAndDestroy(bitmap);
-	aSession.Flush();
-	}
-
-void CTBitmap::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	((CTBitmapStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(++iTest->iState)
-		{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0201
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test basic bitmap functionality
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Test that bitmaps can be loaded, copied and saved
-					correctly
-
-@SYMTestExpectedResults The bitmaps are manipulated withotu error
-*/	 
-		case 1:
-			((CTBitmapStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0201"));
-			iTest->LogSubTest(_L("Bitmap1"));
-			BasicTestsL();
-			break;
-		case 2:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0532
-*/
-			((CTBitmapStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0532"));
-			if (TransparencySupportedL()==KErrNotSupported)
-				return;
-			iTest->LogSubTest(_L("Test fix for PDEF098889"));
-			TestFixForPDEF098889L();
-			break; 
-		default:
-			((CTBitmapStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTBitmapStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-			break;
-		}
-	((CTBitmapStep*)iStep)->RecordTestResultL();
-	}
-	
-__WS_CONSTRUCT_STEP__(Bitmap)
--- a/windowing/windowserver/tauto/TBITMAP.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TBITMAP_H__
-#define __TBITMAP_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-#define SAVE_BITMAP_NAME _L("C:\\WSTEST\\SAVE.PBM")
-
-class CTBitmap : public CTWsGraphicsBase
-	{
-public:
-	CTBitmap(CTestStep* aStep);
-	~CTBitmap();
-	void ConstructL();
-	void BasicTestsL();
-	void TestFixForPDEF098889L();
-private:
-	struct TThreadParams
-		{
-		TInt iScreenNr;
-		void (*iFunction)(RWsSession& aSession, CWsScreenDevice& aDevice);
-		};
-	static TInt ThreadFunction(TAny* aParams);
-	static void Function1PDEF098889L(RWsSession& aSession, CWsScreenDevice& aDevice);
-	static void Function2PDEF098889L(RWsSession& aSession, CWsScreenDevice& aDevice); 
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	CWsBitmap *iBitmap1;
-	CWsBitmap *iBitmap2;
-	};
-
-class CTBitmapStep : public CTGraphicsStep
-	{
-public:
-	CTBitmapStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTBitmapStep,"TBitmap");
-
-
-#endif
--- a/windowing/windowserver/tauto/TBLANK.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,271 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test blank windows
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-
-#include "TBLANK.H"
-
-
-CBaseWindow::CBaseWindow() : CTWin()
-	{}
-
-void CBaseWindow::ConstructL(CTWinBase &parent)
-	{
-	CTWin::ConstructL(parent);
-	}
-
-void CBaseWindow::Draw()
-	{
-	iGc->SetBrushColor(iRgb);
-	iGc->Clear();
-	}
-
-void CBaseWindow::SetColor(const TRgb &aRgb)
-	{
-	iRgb=aRgb;
-	iGc->Activate(iWin);
-	Draw();
-	iGc->Deactivate();
-	}
-
-//
-
-TInt DestructCallbackBlank(TAny *aParam)
-	{
-	((CTBlank *)aParam)->doDestruct();
-	return(0);
-	}
-
-
-CTBlank::CTBlank(CTestStep* aStep):
-	CTWsGraphicsBase(aStep)
-	{
-	INFO_PRINTF1(_L("Testing TBlank functions"));
-	}
-
-void CTBlank::doDestruct()
-	{
-	BaseWin->SetVisible(ETrue);
-	TestWin->SetVisible(ETrue);
-	delete iBaseWin;
-	delete iTestWin;
-	iBaseWin = NULL;
-	iTestWin = NULL;
-//	CActiveScheduler::Stop();
-	}
-
-CTBlank::~CTBlank()
-	{
-	TCallBack callBack(DestructCallbackBlank,this);
-	TheClient->SetRedrawCancelFunction(callBack);
-//	CActiveScheduler::Start();
-	}
-
-void CTBlank::ConstructL()
-	{
-	BaseWin->SetVisible(EFalse);
-	TestWin->SetVisible(EFalse);
-	}
-
-void CTBlank::SetColor(const TRgb &aRgb)
-	{
-	iTestWin->SetColor(aRgb);
-	iBaseWin->SetColor(aRgb);
-	}
-
-void CTBlank::InvalidateTestWin(const TRect &aRect)
-	{
-	TRect rect(aRect);
-	rect.Move(iTestWin->BaseWin()->InquireOffset(*(TheClient->iGroup->WinTreeNode())));
-	CTUser::Splat(TheClient, rect,TRgb(0,0,0));
-	}
-
-void CTBlank::CheckBlankWindows()
-	{
-	User::Heap().Check();
-	CheckRect(iBaseWin,iTestWin,TRect(BaseWin->Size()),_L("CheckBlankWindows - CheckRect(iBaseWin,iTestWin,TRect(BaseWin->Size()) failed"));
-	}
-
-void CTBlank::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	TSize screenSize;
-	TInt winWidth;
-	TInt winHeight;
-	((CTBlankStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-
-	switch(++iTest->iState)
-		{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0022
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Create a base and test blank windows and invalidate an
-					area of the test window
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Two windows are created and an area of a window is 
-					invalidated
-
-@SYMTestExpectedResults Windows create and invalidate without error
-*/
-	case 1:
-		((CTBlankStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0022"));
-		iTest->LogSubTest(_L("Blank 1"));
-		screenSize=TheClient->iGroup->Size();
-		winWidth=(screenSize.iWidth/3)-10;
-		winHeight=screenSize.iHeight-10;
-		iBaseWin=new(ELeave) CBaseWindow();
-		iBaseWin->SetUpL(TPoint(screenSize.iWidth/3+5,5),TSize(winWidth,winHeight),TheClient->iGroup,*TheClient->iGc);
-		iBaseWin->SetColor(TRgb(255,255,255));
-		iTestWin=new(ELeave) CTBlankWindow();	
-		iTestWin->SetUpL(TPoint(screenSize.iWidth/3*2+5,5),TSize(winWidth,winHeight),TheClient->iGroup,*TheClient->iGc);				
-		SetColor(TRgb::Gray4(2));
-		InvalidateTestWin(TRect(10,10,50,50));
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0023
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Check that a base blank window is the same as a
-					test window which has had an area invalidated
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Check the test window is the same as the base window 
-
-@SYMTestExpectedResults The windows are identical
-*/
-	case 2:
-		((CTBlankStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0023"));
-		iTest->LogSubTest(_L("Check Blank 1"));
-		CheckBlankWindows();
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0024
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Set a color and invalidate two areas of a test blank
-					window
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Invalidate two areas of a test blank window 
-
-@SYMTestExpectedResults The window areas are invalidated without error
-*/
-	case 3:
-		((CTBlankStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0024"));
-		iTest->LogSubTest(_L("Blank 2"));
-		SetColor(TRgb(0,0,0));
-		InvalidateTestWin(TRect(1,1,150,20));
-		InvalidateTestWin(TRect(10,-10,20,90));
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0025
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Check a base blank window is identical to a test 
-					blank window which has had two areas invalidated
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Check the test window is the same as the base window 
-
-@SYMTestExpectedResults The windows are identical
-*/
-	case 4:
-		((CTBlankStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0025"));
-		iTest->LogSubTest(_L("Check Blank 2"));
-		CheckBlankWindows();
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0026
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Set a color and invalidate three areas of a test blank
-					window
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Invalidate three areas of a test blank window 
-
-@SYMTestExpectedResults The window areas are invalidated without error
-*/
-	case 5:
-		((CTBlankStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0026"));
-		iTest->LogSubTest(_L("Blank 3"));
-		SetColor(TRgb(255,255,255));
-		InvalidateTestWin(TRect(-1000,100,1000,120));
-		InvalidateTestWin(TRect(1,1,150,20));
-		InvalidateTestWin(TRect(10,30,20,60));
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0027
-
-@@SYMDEF            DEF081259
-
-@SYMTestCaseDesc    Check a base blank window is identical to a test 
-					blank window which has had three areas invalidated
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Check the test window is the same as the base window 
-
-@SYMTestExpectedResults The windows are identical
-*/
-	case 6:
-		((CTBlankStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0027"));
-		iTest->LogSubTest(_L("Check Blank 3"));
-		CheckBlankWindows();
-		delete iBaseWin;
-		delete iTestWin;
-		iBaseWin = NULL;
-		iTestWin = NULL;
-		break;	
-	case 7:
-		((CTBlankStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-		((CTBlankStep*)iStep)->CloseTMSGraphicsStep();
-		TestComplete();
-		break;
-		}
-	((CTBlankStep*)iStep)->RecordTestResultL();
-	}
-
-__WS_CONSTRUCT_STEP__(Blank)
--- a/windowing/windowserver/tauto/TBLANK.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TBLANK_H__
-#define __TBLANK_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-class CBaseWindow : public CTWin
-	{
-public:
-	CBaseWindow();
-	void ConstructL(CTWinBase &parent);
-	virtual void Draw();
-	void SetColor(const TRgb &aRgb);
-private:
-	TRgb iRgb;
-	};
-
-class CTBlank : public CTWsGraphicsBase
-	{
-public:
-	CTBlank(CTestStep* aStep);
-	~CTBlank();
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-public:
-	void doDestruct();
-	void ConstructL();
-	void InvalidateTestWin(const TRect &aRect);
-	void CheckBlankWindows();
-	void SetColor(const TRgb &aRgb);
-private:
-	TBool iDoCheck;
-	TSize iWinSize;
-	CBaseWindow *iBaseWin;
-	CTBlankWindow *iTestWin;
-	};
-
-class CTBlankStep : public CTGraphicsStep
-	{
-public:
-	CTBlankStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTBlankStep,"TBlank");
-
-
-#endif
--- a/windowing/windowserver/tauto/TBUFFERSECURITY.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,457 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// DEF075471 buffer security test
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TBUFFERSECURITY.H"
-#include "graphics/windowserverconstants.h"
-
-//Set this #define in buffersecurity.h to add extra logging to this test case (useful when debugging a test fail)
-//#define _TBUFS_LOGGING
-
-//Set this #define in buffersecurity.h to initiate a long running soak test, this should be done periodically
-//#define _TBUFS_TEST_SOAK_TEST
-
-
-
-LOCAL_C TInt TestWsThreadFunc(TAny* aPtr)
-	{
-	TTestThreadData* data = (TTestThreadData*)aPtr;
-	RWsSession ws;
-
-	TInt err=ws.Connect();
-	if (err!=KErrNone)
-		return(err);
-	ws.TestWrite(ws.WsHandle(), data->iOpCode, data->iData, data->iDataLength);
-	ws.Flush();
-	ws.Close();
-
-	return(KErrNone);
-	}
-
-LOCAL_C TInt TestAnimDllThreadFunc(TInt aInt, TAny* /*aPtr*/)
-	{
-	TBool useTestWrite = (TBool)aInt;
-
-	RWsSession ws;
-	TInt err=ws.Connect();
-	if (err != KErrNone)
-		return (err);
-	if (useTestWrite)
-		{
-		TUint32 data[2];
-		data[0] = 200;
-		data[1] = 4;
-		ws.TestWrite(ws.WsHandle(), EWsClOpCreateAnimDll, REINTERPRET_CAST(TUint8*,data), 8);
-		ws.Flush();
-		}
-	else
-		{
-		RAnimDll animDll(ws);
-		const TPtrC	filename(REINTERPRET_CAST(TUint16*,4),200);
-		animDll.Load(filename);
-		animDll.Close();
-		}
-	ws.Close();
-
-	return(KErrNone);
-	}
-
-TInt RTestIpcSession::Connect()
-	{
-	TVersion v(KWservMajorVersionNumber,KWservMinorVersionNumber,KWservBuildVersionNumber);
-	TInt err = CreateSession(KWSERVServerName,v);
-	if (err == KErrNone)
-		{
-		err=iWsHandle=SendReceive(EWservMessInit,TIpcArgs());
-		}
-	return err;
-	}
-
-TInt RTestIpcSession::SendBadBuffer()
-	{
-	TIpcArgs ipcArgs;
-	TUint32 iData[2];
-	iData[0] = 200;
-	iData[1] = 4;
-	ipcArgs.Set(KBufferMessageSlot,&iData);
-	return SendReceive(EWservMessCommandBuffer,ipcArgs);
-	}
-
-LOCAL_C TInt TestIpcThreadFunc(TInt /*aInt*/, TAny* /*aPtr*/)
-	{
-	RTestIpcSession server;
-
-	TInt handle=server.Connect();
-	if (handle >= KErrNone)
-		server.SendBadBuffer();
-
-	return(KErrNone);
-	}
-
-
-CTBufferSecurity::CTBufferSecurity(CTestStep* aStep):
-	CTWsGraphicsBase(aStep)
-	{
-	}
-
-CTBufferSecurity::~CTBufferSecurity()
-	{
-	}
-
-void CTBufferSecurity::ConstructL()
-	{
-	RProperty securityTesting;
-	TInt err=securityTesting.Attach(KUidWServSecurityTesting,EWServSecTestBufferSecurity);
-	User::LeaveIfError(err);
-	err=securityTesting.Define(KUidWServSecurityTesting,EWServSecTestBufferSecurity,RProperty::EInt,KAllowAllPolicy,KWriteDeviceDataMgmtPolicy);
-	if (err!=KErrAlreadyExists)
-    	User::LeaveIfError(err);
-	TInt value = ETrue;
-	err = securityTesting.Set(value);
-	User::LeaveIfError(err);
-	}
-
-void CTBufferSecurity::TestWsBufferL(TInt aOpCode, TUint aDataFill, TBool aEightBit)
-	{
-	// create a new thread in which to test each of the TWsClientOpCode values
-	// so if the thread is panicked the test will not fail.
-	RThread testThread;
-	TTestThreadData data;
-	TRequestStatus status;
-	TUint8 storeData[KTestDataMax];
-	TTestDataStore store;
-	store.any=storeData;
-
-	//collect initial values
-	for (TInt count = 0; count < KTestDataMax; count++)
-		storeData[count] = 0;
-	switch (aOpCode)
-		{
-		case EWsClOpHeapSetFail:
-			store.heapSetFail->type = RAllocator::ENone;
-			break;
-		case EWsClOpSetPointerCursorArea:
-			store.cursorArea->area = TheClient->iWs.PointerCursorArea();
-			break;
-		case EWsClOpRawEvent:
-			//skip switch off (would need a timer to turn it back on again)
-			if (aDataFill == TRawEvent::ESwitchOff)
-				aDataFill = TRawEvent::ENone;
-			break;
-#if defined(__WINS__)
-		case EWsClOpSimulateXyInput:
-			*store.xyInputType = EXYInputMouse;
-			break;
-#endif
-		}
-
-	data.iOpCode = aOpCode;
-	if (aEightBit)
-		{
-		for (TInt count = 0; count < KTestDataMax; count++)
-			data.iData[count] = (TUint8)aDataFill;
-		}
-	else
-		{
-		for (TInt count = 0; count < KTestDataMax32; count++)
-			data.iData32[count] = aDataFill;
-		}
-	data.iDataLength = KTestDataMax;
-	_LIT(KThreadNameFormat,"BufSecTestWsThread-%d-%d");
-	HBufC* threadName = HBufC::NewLC(KThreadNameFormat().Size() + 32);
-	TPtr threadNamePtr(threadName->Des());
-	threadNamePtr.Format(KThreadNameFormat(), aOpCode, aDataFill);
-	TInt err = testThread.Create(threadNamePtr, TestWsThreadFunc,KDefaultStackSize,KPanicThreadHeapSize,KPanicThreadHeapSize,(TAny*)&data,EOwnerThread);
-
-	if (err != KErrNone)
-		{
-		User::After(100000);
-		err = testThread.Create(threadNamePtr,TestWsThreadFunc,KDefaultStackSize,KPanicThreadHeapSize,KPanicThreadHeapSize,(TAny*)&data,EOwnerThread);
-		}
-	CleanupStack::PopAndDestroy(threadName);
-	testThread.Logon(status);
-	User::SetJustInTime(EFalse);
-	testThread.Resume();
-	User::WaitForRequest(status);
-	User::SetJustInTime(ETrue);
-#ifdef _TBUFS_LOGGING
-	TLogMessageText logMessageText;
-	TBufSStartLogText("TestWsBufferL");
-	logMessageText.Format(_L(" OpCode(%d), ExitReason: %d"),aOpCode,testThread.ExitReason());
-	TBufSLogFormat(logMessageText);
-#endif
-
-	testThread.Close();
-	//reset some values to sensible ones
-	switch (aOpCode)
-		{
-		case EWsClOpHeapSetFail:
-		case EWsClOpSetPointerCursorArea:
-#if defined(__WINS__)
-		case EWsClOpSimulateXyInput:
-#endif
-			RThread resetThread;
-			TheClient->iWs.TestWrite(TheClient->iWs.WsHandle(), data.iOpCode, storeData, data.iDataLength);
-			TheClient->iWs.Flush();
-			break;
-		}
-	}
-
-void CTBufferSecurity::TestBadStringAnimDllL()
-	{
-	TEST(iTest->TestPanicL(&TestAnimDllThreadFunc,3,EFalse,NULL,KLitKernExec));
-	}
-
-void CTBufferSecurity::TestBadStringL()
-	{
-	TEST(iTest->TestWsPanicL(&TestAnimDllThreadFunc,EWservPanicBufferPtr,ETrue,NULL));
-	}
-
-void CTBufferSecurity::TestBadIpcL()
-	{
-	TEST(iTest->TestWsPanicL(&TestIpcThreadFunc,EWservPanicDescriptor,1));
-	}
-
-void CTBufferSecurity::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	TInt ii;
-	((CTBufferSecurityStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(++iTest->iState)
-		{
-		case 1:
-			((CTBufferSecurityStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0022"));
-			_LIT(KBuffSecTestBadIpcL,"TestBadIpcL");
-			iTest->LogSubTest(KBuffSecTestBadIpcL);
-			TestBadIpcL();
-			break;
-		case 2:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0549
-*/
-			((CTBufferSecurityStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0549"));
-			_LIT(KBuffSecTestBadStringLRAnimDll,"TestBadStringL use RAnimDll");
-			iTest->LogSubTest(KBuffSecTestBadStringLRAnimDll);
-			TestBadStringAnimDllL();
-			break;
-		case 3:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0550
-*/
-			((CTBufferSecurityStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0550"));
-			_LIT(KBuffSecTestBadStringLTestWrite,"TestBadStringL use TestWrite");
-			iTest->LogSubTest(KBuffSecTestBadStringLTestWrite);
-			TestBadStringL();
-			break;
-#ifdef _TBUFS_TEST_SOAK_TEST
-		case 4:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0551
-*/
-			((CTBufferSecurityStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0551"));
-			_LIT(KBuffSecTestWsBufferLSoak8bit,"TestWsBufferL Soak 8bit");
-			iTest->LogSubTest(KBuffSecTestWsBufferLSoak8bit);
-			for(ii = EWsClOpDisconnect; ii < EWsClOpLastEnumValue; ii++)
-				{
-				TUint8 soak8=0;//gets set as KMaxTUint8 on first iteration
-				do
-					{
-					--soak8;
-					TestWsBufferL(ii,soak8);
-					}
-				while (soak8>0);
-				}
-			break;
-		case 5:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0552
-*/
-			((CTBufferSecurityStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0552"));
-			_LIT(KBuffSecTestWsBufferLSoak32bit,"TestWsBufferL Soak 32bit");
-			iTest->LogSubTest(KBuffSecTestWsBufferLSoak32bit);
-			for(ii = EWsClOpDisconnect; ii < EWsClOpLastEnumValue; ii++)
-				{
-				TUint32 soak32=0;//gets set as KMaxTUint8 on first iteration
-				do
-					{
-					--soak32;
-					TestWsBufferL(ii,soak32,EFalse);
-					}
-				while (soak32>0);
-				}
-			break;
-#else
-		case 4:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0553
-*/
-			((CTBufferSecurityStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0553"));
-			_LIT(KBuffSecTestWsBufferL0,"TestWsBufferL 0");
-			iTest->LogSubTest(KBuffSecTestWsBufferL0);
-			for(ii = EWsClOpDisconnect; ii < EWsClOpLastEnumValue; ii++)
-				{
-				TestWsBufferL(ii,0);
-				}
-			break;
-		case 5:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0554
-*/
-			((CTBufferSecurityStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0554"));
-			_LIT(KBuffSecTestWsBufferL5,"TestWsBufferL 5");
-			iTest->LogSubTest(KBuffSecTestWsBufferL5);
-			for(ii = EWsClOpDisconnect; ii < EWsClOpLastEnumValue; ii++)
-				{
-				TestWsBufferL(ii,5);
-				}
-			break;
-		case 6:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0555
-*/
-			((CTBufferSecurityStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0555"));
-			_LIT(KBuffSecTestWsBufferL32,"TestWsBufferL 32");
-			iTest->LogSubTest(KBuffSecTestWsBufferL32);
-			for(ii = EWsClOpDisconnect; ii < EWsClOpLastEnumValue; ii++)
-				{
-				TestWsBufferL(ii,32);
-				}
-			break;
-		case 7:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0556
-*/
-			((CTBufferSecurityStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0556"));
-			_LIT(KBuffSecTestWsBufferL64,"TestWsBufferL 64");
-			iTest->LogSubTest(KBuffSecTestWsBufferL64);
-			for(ii = EWsClOpDisconnect; ii < EWsClOpLastEnumValue; ii++)
-				{
-				TestWsBufferL(ii,64);
-				}
-			break;
-		case 8:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0557
-*/
-			((CTBufferSecurityStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0557"));
-			_LIT(KBuffSecTestWsBufferL128,"TestWsBufferL 128");
-			iTest->LogSubTest(KBuffSecTestWsBufferL128);
-			for(ii = EWsClOpDisconnect; ii < EWsClOpLastEnumValue; ii++)
-				{
-				TestWsBufferL(ii,128);
-				}
-			break;
-		case 9:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0558
-*/
-			((CTBufferSecurityStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0558"));
-			_LIT(KBuffSecTestWsBufferL255,"TestWsBufferL 255");
-			iTest->LogSubTest(KBuffSecTestWsBufferL255);
-			for(ii = EWsClOpDisconnect; ii < EWsClOpLastEnumValue; ii++)
-				{
-				TestWsBufferL(ii,255);
-				}
-			break;
-		case 10:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0559
-*/
-			((CTBufferSecurityStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0559"));
-			_LIT(KBuffSecTestWsBufferL325,"TestWsBufferL 32-5");
-			iTest->LogSubTest(KBuffSecTestWsBufferL325);
-			for(ii = EWsClOpDisconnect; ii < EWsClOpLastEnumValue; ii++)
-				{
-				TestWsBufferL(ii,5,EFalse);
-				}
-			break;
-		case 11:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0560
-*/
-			((CTBufferSecurityStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0560"));
-			_LIT(KBuffSecTestWsBufferL32128,"TestWsBufferL 32-128");
-			iTest->LogSubTest(KBuffSecTestWsBufferL32128);
-			for(ii = EWsClOpDisconnect; ii < EWsClOpLastEnumValue; ii++)
-				{
-				TestWsBufferL(ii,128,EFalse);
-				}
-			break;
-		case 12:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0561
-*/
-			((CTBufferSecurityStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0561"));
-			_LIT(KBuffSecTestWsBufferL32512,"TestWsBufferL 32-512");
-			iTest->LogSubTest(KBuffSecTestWsBufferL32512);
-			for(ii = EWsClOpDisconnect; ii < EWsClOpLastEnumValue; ii++)
-				{
-				TestWsBufferL(ii,512,EFalse);
-				}
-			break;
-		case 13:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0562
-*/
-			((CTBufferSecurityStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0562"));
-			_LIT(KBuffSecTestWsBufferL320x01234567,"TestWsBufferL 32-0x01234567");
-			iTest->LogSubTest(KBuffSecTestWsBufferL320x01234567);
-			for(ii = EWsClOpDisconnect; ii < EWsClOpLastEnumValue; ii++)
-				{
-				TestWsBufferL(ii,0x01234567,EFalse);
-				}
-			break;
-		case 14:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0563
-*/
-			((CTBufferSecurityStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0563"));
-			_LIT(KBuffSecTestWsBufferL320x89abcdef,"TestWsBufferL 32-0x89abcdef");
-			iTest->LogSubTest(KBuffSecTestWsBufferL320x89abcdef);
-			for(ii = EWsClOpDisconnect; ii < EWsClOpLastEnumValue; ii++)
-				{
-				TestWsBufferL(ii,0x89abcdef,EFalse);
-				}
-			break;
-		case 15:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0564
-*/
-			((CTBufferSecurityStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0564"));
-			_LIT(KBuffSecTestWsBufferL320xCCCCCCCC,"TestWsBufferL 32-0xCCCCCCCC");
-			iTest->LogSubTest(KBuffSecTestWsBufferL320xCCCCCCCC);
-			for(ii = EWsClOpDisconnect; ii < EWsClOpLastEnumValue; ii++)
-				{
-				TestWsBufferL(ii,0xCCCCCCCC,EFalse);
-				}
-			break;
-#endif
-		default:
-			((CTBufferSecurityStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTBufferSecurityStep*)iStep)->CloseTMSGraphicsStep();
-			TInt err = RProperty::Set(KUidWServSecurityTesting,EWServSecTestBufferSecurity,EFalse);
-			User::LeaveIfError(err);
-			TestComplete();
-		}
-	((CTBufferSecurityStep*)iStep)->RecordTestResultL();
-	}
-
-__WS_CONSTRUCT_STEP__(BufferSecurity)
--- a/windowing/windowserver/tauto/TBUFFERSECURITY.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// DEF075471 buffer security test
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TBUFFERSECURITY_H__
-#define __TBUFFERSECURITY_H__
-
-#include "AUTO.H"
-#include "../tlib/testbase.h"
-#include <w32std.h>
-#include "../SERVER/w32cmd.h"
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-#include "../nonnga/CLIENT/w32comm.h"
-#endif
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-#include "../nga/CLIENT/w32comm.h"
-#endif
-
-#include <e32property.h>
-#include "TGraphicsHarness.h"
-
-//Set this #define to add extra logging to this test case (useful when debugging a test fail)
-//#define _TBUFS_LOGGING
-
-//Set this #define to initiate a long running soak test, this should be done periodically
-//#define _TBUFS_TEST_SOAK_TEST
-
-#ifdef _TBUFS_LOGGING
-#define TBufSStartLogText StartLogText
-#define TBufSLogText LogText
-#define TBufSLogFormat LogFormat
-#else
-#define TBufSStartLogText
-#define TBufSLogText
-#define TBufSLogFormat
-#endif
-
-LOCAL_D const TUint KPanicThreadHeapSize=0x4000;
-
-_LIT(KLitKernExec, "KERN-EXEC");
-_LIT(KTestName, "DEF086238 Buffer Security Test");
-static _LIT_SECURITY_POLICY_PASS(KAllowAllPolicy);
-static _LIT_SECURITY_POLICY_C1(KWriteDeviceDataMgmtPolicy,ECapabilityWriteDeviceData);
-const TInt KTestDataMax = 256;
-const TInt KTestDataMax32 = KTestDataMax/4;
-
-struct TTestThreadData
-	{
-	TInt iOpCode;
-	union
-		{
-		TUint8 iData[KTestDataMax];
-		TUint32 iData32[KTestDataMax32];
-		};
-	TInt iDataLength;
-	};
-
-enum KBufSecTestType
-	{
-	EBufSecUnInitialised,
-	EBufSecRandom,
-	EBufSecZero
-	};
-
-union TTestDataStore
-	{
-	TAny *any;
-	TWsClCmdSetPointerCursorArea* cursorArea;
-	TWsClCmdHeapSetFail *heapSetFail;
-	TXYInputType *xyInputType;
-	};
-
-class CTBufferSecurity : public CTWsGraphicsBase
-	{
-public:
-	CTBufferSecurity(CTestStep* aStep);
-	~CTBufferSecurity();
-	void TestWsBufferL(TInt aOpCode, TUint aDataFill, TBool aEightBit=ETrue);
-	void TestBadStringAnimDllL();
-	void TestBadStringL();
-	void TestBadIpcL();
-	void ConstructL();
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	void TestBufferSecurityL();
-	};
-
-class RTestIpcSession : public RSessionBase
-	{
-public:
-	inline RTestIpcSession() {};
-	TInt Connect();
-	TInt SendBadBuffer();
-private:
-	TInt iWsHandle;
-	};
-
-class CTBufferSecurityStep : public CTGraphicsStep
-	{
-public:
-	CTBufferSecurityStep();
-protected:
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTBufferSecurityStep,"TBufferSecurity");
-
-#endif
--- a/windowing/windowserver/tauto/TCAPABILITY.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,263 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Capability test
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TCAPABILITY.H"
-
-_LIT(KTestResultsFile, "C:\\DATA\\TestResult.Dat");
-_LIT(KSpace, " ");
-_LIT(KTest0Name, "All capabilities");
-_LIT(KTest0Exe, "TCAP_ALL.exe");
-_LIT(KTest0Cap, "CAPABILITY_ALL");
-_LIT(KTest1Name, "No capabilities");
-_LIT(KTest1Exe, "TCAP_NONE.exe");
-_LIT(KTest1Cap, "CAPABILITY_NONE");
-_LIT(KTest2Name, "WriteDeviceData and SwEvent capabilities");
-_LIT(KTest2Exe, "TCAP_ONE.exe");
-_LIT(KTest2Cap, "WRITEDATA+SWEVENT");
-_LIT(KTest3Name, "WriteDeviceData and PowerMgnt capabilities");
-_LIT(KTest3Exe, "TCAP_TWO.exe");
-_LIT(KTest3Cap, "WRITEDATA+POWERMGMT");
-_LIT(KTest4Name, "PowerMgnt and SwEvent capabilities");
-_LIT(KTest4Exe, "TCAP_THREE.exe");
-_LIT(KTest4Cap, "POWERMGMT+SWEVENT");
-
-
-//CCapabilityTest 
-CTCapability::CTCapability(CTestStep* aStep):
-	CTWsGraphicsBase(aStep)
-	{
-	}
-
-CTCapability::~CTCapability()
-	{
-	}
-
-void CTCapability::ConstructL()
-	{
-	//Empty function ConstructL is pure virtual function and this 
-	//definition required to satisfy the compiler
-	}
-
-//Reads the shared files which contains the total tests	run and tests passed.
-void CTCapability::GetCapabilityTestResultsL(TInt& aNoOfTests, TInt& aNoOfTestsPass)
-	{	
-	TBuf<256> noOfTest;
-	TBuf<256> noOfTestPass;
-	RFs fileSession;
-	RFile file;
-	TFileText textFile;
-	User::LeaveIfError(fileSession.Connect());
-	CleanupClosePushL(fileSession);
-	User::LeaveIfError(file.Open(fileSession,KTestResultsFile,EFileRead));
-	CleanupClosePushL(file);
-	textFile.Set(file);
-	if(textFile.Read(noOfTest)==KErrNone)
-		{
-		TLex lexVar(noOfTest);
-		lexVar.Val(aNoOfTests);
-		if(textFile.Read(noOfTestPass)==KErrNone)
-			{
-			lexVar=noOfTestPass;
-			lexVar.Val(aNoOfTestsPass);
-			}
-		else
-			{
-			aNoOfTestsPass=0;
-			}
-		}
-	CleanupStack::PopAndDestroy(&file);
-	CleanupStack::PopAndDestroy(&fileSession);
-	}
-	
- void CTCapability::LaunchNewProcess(const TDesC& aExecutable,const TDesC& aCapability)
-	{
-	TBuf<128> args;
- 	args.Append(aCapability);
- 	args.Append(KSpace);
- 	args.AppendNum(TheClient->iGroup->GroupWin()->Identifier());
-	RProcess pr;
-//	TInt noOfTest,noOfTestPass;
-	if (pr.Create(aExecutable,args)==KErrNone)
-		{
-		TRequestStatus status=NULL;
-		pr.Logon(status);
-		pr.Resume();
-		User::WaitForRequest(status);
-		//Close all the panic windows to avoid "Hangs the H4" 
-		//PDEF100501: TEF Migrated Test TCapability Hangs the H4 
-	   	if (iTest->iScreenNumber == 0)
-			iTest->CloseAllPanicWindows();
-		pr.Close();
-//		GetCapabilityTestResultsL(noOfTest,noOfTestPass);
-//		UpdateTestResults(noOfTest,noOfTestPass);
-		}
-	}
-	
-void CTCapability::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	((CTCapabilityStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(++iTest->iState)
-		{
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0305
-  
-  @SYMDEF             DEF081259
- 
-  @SYMTestCaseDesc Capability test with a process with all capability
-    
-  @SYMTestPriority High
- 
-  @SYMTestStatus Implemented
- 
-  @SYMTestActions The security threat API's are called with all 
- 				 capability to test whether the API's are accessible or not.
-  
-  @SYMTestExpectedResults If the required capability is defined to test code then API should 
- 							 accessible, otherwise it should panic the test.
- 
-*/
-		case 1:
-			((CTCapabilityStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0305"));
-			iTest->LogSubTest(KTest0Name);
- 			LaunchNewProcess(KTest0Exe, KTest0Cap);
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0306
-  
-  @SYMDEF             DEF081259
- 
-  @SYMTestCaseDesc Capability test with a process with no capability
-    
-  @SYMTestPriority High
- 
-  @SYMTestStatus Implemented
- 
-  @SYMTestActions The security threat API's are called with no 
- 				 capability to test whether the API's are accessible or not.
-  
-  @SYMTestExpectedResults If the required capability is defined to test code then API should 
- 							 accessible, otherwise it should panic the test.
- 
-*/
-		case 2:
-			((CTCapabilityStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0306"));
-			//create process with no capability 
-			RDebug::Print(KPlatsecBegin);
-			iTest->LogSubTest(KTest1Name);
- 			LaunchNewProcess(KTest1Exe,KTest1Cap);
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0307
-  
-  @SYMDEF             DEF081259
- 
-  @SYMTestCaseDesc Capability test with a process with WriteDevicedata and SwEvent capability
-    
-  @SYMTestPriority High
- 
-  @SYMTestStatus Implemented
- 
-  @SYMTestActions The security threat API's are called with WriteDevicedata and SwEvent 
- 				 capability to test whether the API's are accessible or not.
-  
-  @SYMTestExpectedResults If the required capability is defined to test code then API should 
- 							 accessible, otherwise it should panic the test.
- 
-*/
-		case 3:
-			((CTCapabilityStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0307"));
-			//create process with WriteDevicedata and SwEvent capability 
-			iTest->LogSubTest(KTest2Name);
- 			LaunchNewProcess(KTest2Exe,KTest2Cap);
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0308
-  
-  @SYMDEF             DEF081259
- 
-  @SYMTestCaseDesc Capability test with a process with WriteDevicedata and PowerMgmt capability
-    
-  @SYMTestPriority High
- 
-  @SYMTestStatus Implemented
- 
-  @SYMTestActions The security threat API's are called with WriteDevicedata and PowerMgmt 
- 				 capability to test whether the API's are accessible or not.
-  
-  @SYMTestExpectedResults If the required capability is defined to test code then API should 
- 							 accessible, otherwise it should panic the test.
- 
-*/
-		case 4:
-			((CTCapabilityStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0308"));
-			//create process with WriteDevicedata and PowerMgmt capability 
-			iTest->LogSubTest(KTest3Name);
- 			LaunchNewProcess(KTest3Exe,KTest3Cap);
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0309
-  
-  @SYMDEF             DEF081259
- 
-  @SYMTestCaseDesc Capability test with a process with PowerMgmt and SwEvent capability
-    
-  @SYMTestPriority High
- 
-  @SYMTestStatus Implemented
- 
-  @SYMTestActions The security threat API's are called with PowerMgmt and SwEvent 
- 				 capability to test whether the API's are accessible or not.
-  
-  @SYMTestExpectedResults If the required capability is defined to test code then API should 
- 							 accessible, otherwise it should panic the test.
- 
-*/
-		case 5:
-			((CTCapabilityStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0309"));
-			//create process with PowerMgmt and SwEvent capability 
-			iTest->LogSubTest(KTest4Name);
- 			LaunchNewProcess(KTest4Exe, KTest4Cap);
-			break;
-		default :
-			((CTCapabilityStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTCapabilityStep*)iStep)->CloseTMSGraphicsStep();
-			RDebug::Print(KPlatsecEnd);
-			RFs fileSession;
-			User::LeaveIfError(fileSession.Connect());
-			CleanupClosePushL(fileSession);
-			CFileMan *fileMan=CFileMan::NewL(fileSession);
-			fileMan->Delete(KTestResultsFile);
-			delete fileMan;
-			CleanupStack::PopAndDestroy(&fileSession);
-			TestComplete();		
-			break;
-		}
-	((CTCapabilityStep*)iStep)->RecordTestResultL();
-	}
-	
-__WS_CONSTRUCT_STEP__(Capability)
--- a/windowing/windowserver/tauto/TCAPABILITY.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TCAPABILITY_H__
-#define __TCAPABILITY_H__
-
-#include "AUTO.H"
-#include "../tlib/testbase.h"
-#include "TGraphicsHarness.h"
-
-class CTCapability : public CTWsGraphicsBase
-	{
-public:
-	CTCapability(CTestStep* aStep);
-	~CTCapability();
-	void ConstructL();
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	void GetCapabilityTestResultsL(TInt& aNoOfTest, TInt&aNoOfTestPass);
-	void LaunchNewProcess(const TDesC& aExecutableName,const TDesC& acapability);
-	};
-
-class CTCapabilityStep : public CTGraphicsStep
-	{
-public:
-	CTCapabilityStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTCapabilityStep,"TCapability");
-
-
-#endif
--- a/windowing/windowserver/tauto/TCapKey.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,877 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test capture key
-// Coverted from TMan test code (TMCAPKEY.CPP) October 2000
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-
-#include "TCapKey.H"
-
-#define LOGGING on
-
-//
-// CAbortHandler
-
-CAbortHandler::CAbortHandler(RWsSession *aWs, CCKAbortConnection *aConnection) : CTEventBase(aWs, 10), iConnection(aConnection)
-	{
-	}
-
-CAbortHandler::~CAbortHandler()
-	{
-	Cancel();
-	}
-
-void CAbortHandler::Request()
-	{
-	iWs->PriorityKeyReady(&iStatus);
-	SetActive();
-	}
-
-void CAbortHandler::DoCancel()
-	{
-	iWs->PriorityKeyReadyCancel();
-	}
-
-void CAbortHandler::doRunL()
-	{
-	TWsPriorityKeyEvent abortEvent;
-	iWs->GetPriorityKey(abortEvent);
-	iConnection->ReceivedAbortEvent(abortEvent.Handle(),abortEvent.Key());
-	}
-
-//
-// CCKConnection
-
-CCKConnectionBase::CCKConnectionBase(CTCaptureKey *aTest) : iTest(aTest)
-	{
-	}
-
-void CCKConnectionBase::ConstructL()
-	{
-	CTClient::SetScreenNumber(iTest->ScreenNumber());
-	CTClient::ConstructL();
-	iGroup=new(ELeave) CCKWindowGroup(this, iTest);
-	iGroup->ConstructL();
-	}
-
-CCKConnection::CCKConnection(CTCaptureKey *aTest, TInt aConnIndex) : CCKConnectionBase(aTest), iConnIndex(aConnIndex)
-	{
-	}
-
-CCKConnection::~CCKConnection()
-	{
-	for(TInt index=0;index<numCapKeys;index++)
-		if (capKeys[index].connIndex==iConnIndex)
-			iGroup->GroupWin()->CancelCaptureKey(capKeyHandle[index]);
-	for(TInt index1=0;index1<numCapKeysWithPriority;index1++)
-		if (capKeysWithPriority[index1].connIndex==iConnIndex)
-			iGroup->GroupWin()->CancelCaptureKey(capKeyWithPriorityHandle[index1]);
-	for(TInt index2=0;index2<numUpDownKeys;index2++)
-		if (capUpAndDownKeys[index2].connIndex==iConnIndex)
-			iGroup->GroupWin()->CancelCaptureKeyUpAndDowns(capUpDownKeyHandle[index2]);
-	for(TInt index3=0;index3<numUpDownKeysWithPriority;index3++)
-		if (capUpAndDownKeysWithPriority[index3].connIndex==iConnIndex)
-			iGroup->GroupWin()->CancelCaptureKeyUpAndDowns(capUpDownKeyWithPriorityHandle[index3]);
-	CTWin::Delete(iWin);
-	}
-
-void CCKConnection::SubStateChanged()
-	{
-	iWin->Invalidate();
-	iWs.Flush();
-	}
-
-void CCKConnection::ConstructL()
-	{
-	CCKConnectionBase::ConstructL();
-	for(TInt index=0;index<numCapKeys;index++)
-		if (capKeys[index].connIndex==iConnIndex)
-			capKeyHandle[index]=User::LeaveIfError(iGroup->GroupWin()->CaptureKey(capKeys[index].keyCode,capKeys[index].modifier_mask,capKeys[index].modifiers));
-	for(TInt index1=0;index1<numCapKeysWithPriority;index1++)
-		if (capKeysWithPriority[index1].connIndex==iConnIndex)
-			capKeyWithPriorityHandle[index1]=User::LeaveIfError(iGroup->GroupWin()->CaptureKey(capKeysWithPriority[index1].keyCode,capKeysWithPriority[index1].modifier_mask,capKeysWithPriority[index1].modifiers,capKeysWithPriority[index1].priority));
-	for(TInt index2=0;index2<numUpDownKeys;index2++)
-		if (capUpAndDownKeys[index2].connIndex==iConnIndex)
-			capUpDownKeyHandle[index2]=User::LeaveIfError(iGroup->GroupWin()->CaptureKeyUpAndDowns(capUpAndDownKeys[index2].keyCode,
-								capUpAndDownKeys[index2].modifier_mask,capUpAndDownKeys[index2].modifiers));
-	for(TInt index3=0;index3<numUpDownKeysWithPriority;index3++)
-		if (capUpAndDownKeysWithPriority[index3].connIndex==iConnIndex)
-			capUpDownKeyWithPriorityHandle[index3]=User::LeaveIfError(iGroup->GroupWin()->CaptureKeyUpAndDowns(capUpAndDownKeysWithPriority[index3].keyCode,
-								capUpAndDownKeysWithPriority[index3].modifier_mask,capUpAndDownKeysWithPriority[index3].modifiers,capUpAndDownKeysWithPriority[index3].priority));
-	TSize screenSize=iGroup->Size();
-	TInt winWidth=screenSize.iWidth/2;
-	TInt winHeight=screenSize.iHeight-10;
-	iGroup->GroupWin()->AutoForeground(EFalse);		// Don't allow clicking to cause foreground, might mess up test
-	CCKWindow *win=new(ELeave) CCKWindow(iTest, iConnIndex);
-	win->SetUpL(TPoint(5,5),TSize(winWidth,winHeight),iGroup,*iGc);
-	iWin=win;
-	}
-
-void CCKConnection::KeyTestL(TInt aBool)
-	{
-	if (!aBool)
-		{
-		CTDialog *dialog= new(ELeave) CTDialog();
-		TInt ret=0;
-		if (dialog)
-			{
-			dialog->ConstructLD(*iGroup,*iGc);
-			dialog->SetTitle(_L("Invalid key press"));
-			dialog->SetLine1(_L("Try again?"));
-			dialog->SetNumButtons(2);
-			dialog->SetButtonText(0,_L("Fail"));
-			dialog->SetButtonText(1,_L("Retry"));
-			ret=dialog->Display();
-			}
-		User::Leave(ret==1 ? ECapKeyRetry : ECapKeyFail);
-		}
-	}
-
-void CCKConnection::CheckKeyL(const SCapKeyTestParams &aKeyTest, const TKeyEvent &aKey)
-	{
-	KeyTestL(aKeyTest.keyCode==aKey.iCode);
-	KeyTestL(aKeyTest.modifiers==(aKey.iModifiers&aKeyTest.modifier_mask));
-	}
-
-void CCKConnection::CheckUpDownL(const SCapKeyTestParams &aKeyTest, const TKeyEvent &aKey)
-	{
-	if(iTest->Mode()==EModeKeyUpsAndDownsWithPriority)
-		KeyTestL(aKeyTest.connIndex==iTest->SubState()-15);
-	KeyTestL(aKeyTest.connIndex==iConnIndex);
-	KeyTestL(aKeyTest.keyCode==(TUint)aKey.iScanCode);
-	KeyTestL(aKeyTest.modifiers==(aKey.iModifiers&aKeyTest.modifier_mask));
-	}
-
-void CCKConnection::KeyL(const TKeyEvent &aKey,const TTime &)
-	{
-#if defined(LOGGING)
-	_LIT(KLog,"CCKConnection::KeyL  State=%d  SubState=%d  Mode=%d  KeyCode=%d  ScanCode=%d  Mod=0x%x");
-	iTest->LOG_MESSAGE7(KLog,iTest->State(),iTest->SubState(),iTest->Mode(),aKey.iCode,aKey.iScanCode,aKey.iModifiers);
-#endif
-	if (iTest->Mode()==EModeNormalCapture || iTest->Mode()==EModeNormalCaptureWithPriority)
-		{
-		//if (aKey.iCode==EKeyEscape)
-		//	iTest->Abort();
-		if(iTest->Mode()==EModeNormalCaptureWithPriority)
-			{
-			SCapKeyTestParams tmpCapKeyTest=capKeyTests[iTest->SubState()];
-			KeyTestL(tmpCapKeyTest.connIndex==iTest->SubState()-8);
-			}
-		TRAPD(ret,CheckKeyL(capKeyTests[iTest->SubState()],aKey));
-		if (ret==ECapKeyOkay)
-			iTest->IncSubState();
-		else
-			{
-			iTest->TEST(ret==ECapKeyRetry);
-			if (ret!=ECapKeyRetry)
-				iTest->INFO_PRINTF3(_L("CheckKeyL(capKeyTests[iTest->SubState()],aKey) return value - Expected: %d, Actual: %d"), ECapKeyRetry, ret);		
-			}
-			
-		}
-	}
-
-void CCKConnection::CheckUpDownL(const TKeyEvent &aKey)
-	{
-	CheckUpDownL(capKeyTests[iTest->SubState()],aKey);
-	}
-
-CCKAbortConnection::CCKAbortConnection(CTCaptureKey *aTest) : CCKConnectionBase(aTest)
-	{
-	}
-
-CCKAbortConnection::~CCKAbortConnection()
-	{
-	iGroup->GroupWin()->RemovePriorityKey(3,EModifierCtrl,EModifierCtrl);
-	delete iAbortHandler;
-	}
-
-void CCKAbortConnection::ConstructL()
-	{
-	CCKConnectionBase::ConstructL();
-	User::LeaveIfError(iGroup->GroupWin()->AddPriorityKey(abortKeyTests[0].keyCode,abortKeyTests[0].modifier_mask,abortKeyTests[0].modifiers));
-	User::LeaveIfError(iGroup->GroupWin()->AddPriorityKey(abortKeyTests[1].keyCode,abortKeyTests[1].modifier_mask,abortKeyTests[1].modifiers));
-	User::LeaveIfError(iGroup->GroupWin()->AddPriorityKey(abortKeyTests[2].keyCode,abortKeyTests[2].modifier_mask,abortKeyTests[2].modifiers));
-	iAbortHandler=new(ELeave) CAbortHandler(&iWs, this);
-	iAbortHandler->Construct();
-	iWs.Flush();
-	}
-
-void CCKAbortConnection::ReceivedAbortEvent(TInt aHandle,TKeyEvent* aKey)
-	{
-#if defined(LOGGING)
-	_LIT(KLog,"CCKAbortConnection::ReceivedAbortEvent  State=%d  SubState=%d  Mode=%d  KeyCode=%d  ScanCode=%d  Mod=0x%x");
-	iTest->LOG_MESSAGE7(KLog,iTest->State(),iTest->SubState(),iTest->Mode(),aKey->iCode,aKey->iScanCode,aKey->iModifiers);
-#endif
-	TInt group=reinterpret_cast<TInt>(iGroup);
-	iTest->TEST(aHandle==group);
-	if (aHandle!=group)
-		{
-		_LIT(KLog,"Event Handle is not for the right group, expected=%d actual=%d");
-		iTest->LOG_MESSAGE3(KLog,group,aHandle);
-		}
-
-	iTest->TEST(aKey->iCode==abortKeyTests[iAbortKeyIndex].keyCode);
-	if (aKey->iCode!=abortKeyTests[iAbortKeyIndex].keyCode)
-		{
-		_LIT(KLog,"The event KeyCode is not right, expected=%d actual=%d");
-		iTest->LOG_MESSAGE3(KLog,abortKeyTests[iAbortKeyIndex].keyCode,aKey->iCode);
-		}
-
-	iTest->TEST((aKey->iModifiers&abortKeyTests[iAbortKeyIndex].modifier_mask)==abortKeyTests[iAbortKeyIndex].modifiers);
-	if ((aKey->iModifiers&abortKeyTests[iAbortKeyIndex].modifier_mask)!=abortKeyTests[iAbortKeyIndex].modifiers)
-		{
-		_LIT(KLog,"The event modifiers are not right, expected=0x%x actual=0x%x (0x%x) mask=0x%x");
-		iTest->LOG_MESSAGE5(KLog,abortKeyTests[iAbortKeyIndex].modifiers,aKey->iModifiers&abortKeyTests[iAbortKeyIndex].modifier_mask
-									,aKey->iModifiers,abortKeyTests[iAbortKeyIndex].modifier_mask);
-		}
-	iAbortKeyIndex++;
-	iTest->IncSubState();
-	}
-
-void CCKAbortConnection::Foreground()
-	{
-	iGroup->GroupWin()->SetOrdinalPosition(0);
-	iWs.Flush();
-	}
-
-//
-// CCKWindowGroup class //
-//
-
-CCKWindowGroup::CCKWindowGroup(CTClient *aClient, CTCaptureKey *aTest) : CTWindowGroup(aClient), iTest(aTest)
-	{}
-
-void CCKWindowGroup::KeyL(const TKeyEvent &aKey,const TTime &time)
-	{
-#if defined(LOGGING)
-	_LIT(KLog,"CCKWindowGroup::KeyL  State=%d  SubState=%d  Mode=%d  KeyCode=%d  ScanCode=%d  Mod=0x%x");
-	iTest->LOG_MESSAGE7(KLog,iTest->State(),iTest->SubState(),iTest->Mode(),aKey.iCode,aKey.iScanCode,aKey.iModifiers);
-#endif
-	if (iTest->Mode()==EModeWaitingForFirstNormalCapWithPriority)
-		iTest->SetMode(EModeNormalCaptureWithPriority);
-	if (iCurWin)
-		iCurWin->WinKeyL(aKey,time);
-	else
-		((CCKConnection *)iClient)->KeyL(aKey,time);
-	}
-
-void CCKWindowGroup::KeyDownL(const TKeyEvent &aKey,const TTime &)
-	{
-#if defined(LOGGING)
-	_LIT(KLog,"CCKWindowGroup::KeyDownL  State=%d  SubState=%d  Mode=%d  KeyCode=%d  ScanCode=%d  Mod=0x%x");
-	iTest->LOG_MESSAGE7(KLog,iTest->State(),iTest->SubState(),iTest->Mode(),aKey.iCode,aKey.iScanCode,aKey.iModifiers);
-#endif
-	if (aKey.iScanCode!=EStdKeyLeftShift && aKey.iScanCode!=EStdKeyRightShift)
-		{
-		if (iTest->Mode()==EModeWaitingForFirstDown)
-			iTest->SetMode(EModeKeyUpsAndDowns);
-		if (iTest->Mode()==EModeWaitingForFirstDownWithPriority)
-			iTest->SetMode(EModeKeyUpsAndDownsWithPriority);
-		if (iTest->Mode()==EModeKeyUpsAndDowns || iTest->Mode()==EModeKeyUpsAndDownsWithPriority)
-			((CCKConnection *)iClient)->CheckUpDownL(aKey);
-		}
-	}
-
-void CCKWindowGroup::KeyUpL(const TKeyEvent &aKey,const TTime &)
-	{
-#if defined(LOGGING)
-	_LIT(KLog,"CCKWindowGroup::KeyUpL  State=%d  SubState=%d  Mode=%d  KeyCode=%d  ScanCode=%d  Mod=0x%x");
-	iTest->LOG_MESSAGE7(KLog,iTest->State(),iTest->SubState(),iTest->Mode(),aKey.iCode,aKey.iScanCode,aKey.iModifiers);
-#endif
-	if (aKey.iScanCode!=EStdKeyLeftShift && aKey.iScanCode!=EStdKeyRightShift)
-		{
-		if (iTest->Mode()==EModeKeyUpsAndDowns || iTest->Mode()==EModeKeyUpsAndDownsWithPriority)
-			{
-			((CCKConnection *)iClient)->CheckUpDownL(aKey);
-			iTest->IncSubState();
-			}
-		}
-	}
-
-//
-// CCKWindow, class //
-//
-
-CCKWindow::CCKWindow(CTCaptureKey *aTest, TInt aConnIndex) : CTWin(), iConnIndex(aConnIndex), iTest(aTest)
-	{
-	iBack=TRgb::Gray256(230);
-	}
-
-void CCKWindow::SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc)
-	{
-	ConstructExtLD(*parent,pos,size);
-	iWin.SetBackgroundColor(iBack);
-	Activate();
-	AssignGC(aGc);
-	}
-
-void CCKWindow::Draw()
-	{
-	iGc->Clear();
-	if (iConnIndex==0)
-		{
-		TInt test=iTest->SubState();
-		if (test<numTests)
-			iGc->DrawText(TPtrC(capKeyTests[test].txt), TPoint(10,20));
-		}
-	}
-
-//
-
-CTCaptureKey::CTCaptureKey(CTestStep* aStep) : CTWsGraphicsBase(aStep)
-	{
-	}
-	
-CTCaptureKey::~CTCaptureKey()
-	{
-	((CTCaptureKeyStep*)iStep)->CloseTMSGraphicsStep();
-	delete iConn1;
-	delete iConn2;
-	delete iConn3;
-	delete iAbortConn;
-	}
-
-void CTCaptureKey::ConstructL()
-	{
-	iAbortConn=new(ELeave) CCKAbortConnection(this);
-	iAbortConn->ConstructL();
-	iConn3=new(ELeave) CCKConnection(this,2);
-	iConn3->ConstructL();
-	iConn2=new(ELeave) CCKConnection(this,1);
-	iConn2->ConstructL();
-	iConn1=new(ELeave) CCKConnection(this,0);
-	iConn1->ConstructL();
-	iMode=EModeNormalCapture;
-	SetSelfDrive(ETrue);
-	TUint mods=TheClient->iWs.GetModifierState();
-	_LIT(KLog,"Initial Modifiers state 0x%x (ideally should be zero)");
-	LOG_MESSAGE2(KLog,mods);
-	}
-
-TInt CTCaptureKey::SubState() const
-	{
-	return(iSubState);
-	}
-
-void CTCaptureKey::IncSubState()
-	{
-	iSubState++;
-#if defined(LOGGING)
-	_LIT(KLog,"IncSubState  State=%d  SubState=%d  Mode=%d");
-	LOG_MESSAGE4(KLog,iState,iSubState,iMode);
-#endif
-	iConn1->SubStateChanged();
-	iConn2->SubStateChanged();
-	iConn3->SubStateChanged();
-	switch(iMode)
-		{
-		case EModeNormalCapture:
-			if (iSubState==numCapKeyTests)
-				{
-				CaseComplete();
-				return;
-				}
-			break;
-		case EModeNormalCaptureWithPriority:
-			if (iSubState==numCapKeyTests+numCapKeyWithPriorityTests)
-				{
-				CaseComplete();
-				return;
-				}
-			break;
-		case EModeKeyUpsAndDowns:
-			if (iSubState==(numCapKeyTests+numCapKeyWithPriorityTests+numUpDownKeyTests))
-				{
-				CaseComplete();
-				return;
-				}
-			break;
-		case EModeKeyUpsAndDownsWithPriority:
-			if (iSubState==(numCapKeyTests+numCapKeyWithPriorityTests+numUpDownKeyTests+numUpDownKeyWithPriorityTests))
-				{
-				SetSelfDrive(EFalse);
-				return;
-				}
-			break;
-		case EModeAbortKeys:
-			if (iSubState==(numCapKeyTests+numCapKeyWithPriorityTests+numUpDownKeyTests+numUpDownKeyWithPriorityTests+numAbortKeyTests))
-				++iState;
-			TheClient->WaitForRedrawsToFinish();
-			return;
-		default:
-			break;
-		}
-	TheClient->WaitForRedrawsToFinish();
-	SendEvents();
-	}
-
-void CTCaptureKey::CapKeyPurgingL()
-	{
-	TInt base=Client()->iWs.ResourceCount();
-	RWindowGroup groupWin(Client()->iWs);
-	User::LeaveIfError(groupWin.Construct(ENullWsHandle));
-	TInt capHandle=User::LeaveIfError(groupWin.CaptureKey('a',EModifierFunc,EModifierFunc));
-	User::LeaveIfError(groupWin.CaptureKey('b',EModifierFunc,EModifierFunc));
-	TInt retVal = Client()->iWs.ResourceCount();
-	TEST(retVal==(base+3));
-	if (retVal!=(base+3))
-		INFO_PRINTF3(_L("Client()->iWs.ResourceCount() return value - Expected: %d, Actual: %d"), retVal, (base+3));		
-
-	groupWin.CancelCaptureKey(capHandle);
-	retVal = Client()->iWs.ResourceCount();
-	TEST(retVal==(base+2));
-	if (retVal!=(base+2))
-		INFO_PRINTF3(_L("Client()->iWs.ResourceCount() return value - Expected: %d, Actual: %d"), retVal, (base+2));		
-
-	groupWin.Close();
-	// Check it also freed the extra capture key
-	retVal = Client()->iWs.ResourceCount();
-	TEST(retVal==base);
-	if (retVal!=base)
-		INFO_PRINTF3(_L("Client()->iWs.ResourceCount() return value - Expected: %d, Actual: %d"), retVal, base);		
-
-	}
-
-void CTCaptureKey::BadParams()
-	{
-	TInt retVal;
-	TInt resCount=Client()->iWs.ResourceCount();
-	for(TInt index=0;index<numErrorKeys;index++)
-	{
-		retVal = Client()->iGroup->GroupWin()->CaptureKey(errorKeys[index].keyCode,errorKeys[index].modifier_mask,errorKeys[index].modifiers);
-		TEST(retVal==KErrArgument);
-		if (retVal!=KErrArgument)
-			INFO_PRINTF3(_L("Client()->iGroup->GroupWin()->CaptureKey() return value - Expected: %d, Actual: %d"), KErrArgument, retVal);	
-	}
-	retVal = Client()->iWs.ResourceCount();
-	TEST(retVal==resCount);
-	if (retVal!=resCount)
-		INFO_PRINTF3(_L("Client()->iWs.ResourceCount() return value - Expected: %d, Actual: %d"), resCount, retVal);	
-	}
-
-void CTCaptureKey::SetMode(TTestMode aMode)
-	{
-#if defined(LOGGING)
-	_LIT(KLog,"SetMode  State=%d  SubState=%d  OldMode=%d  NewMode=%d");
-	LOG_MESSAGE5(KLog,State(),SubState(),iMode,aMode);
-#endif
-	iMode=aMode;
-	}
-
-TTestMode CTCaptureKey::Mode()
-	{
-	return(iMode);
-	}
-
-void CTCaptureKey::SetUpPriorityKeyTest()
-	{
-	iMode=EModeAbortKeys;
-	iAbortConn->Foreground();
-	}
-
-void CTCaptureKey::CaptureWithPriorityTest() //normal key capture but with priority
-	{
-	iMode=EModeWaitingForFirstNormalCapWithPriority;
-	}
-
-void CTCaptureKey::CaptureUpsAndDownsTest()
-	{
-	iMode=EModeWaitingForFirstDown;
-	}
-
-void CTCaptureKey::CaptureUpsAndDownsWithPriorityTest()
-	{
-	iMode=EModeWaitingForFirstDownWithPriority;
-	}
-
-void CTCaptureKey::SendEvents()
-	{
-#if defined(LOGGING)
-	_LIT(KLog,"SendEvents  State=%d  SubState=%d");
-	LOG_MESSAGE3(KLog,iState,iSubState);
-#endif
-	switch (iSubState)
-		{
-	case 0:
-		iTest->SimulateKeyDownUp('Q');
-		break;
-	case 1:
-		iTest->SimulateKeyDownUpWithModifiers('W',EModifierAlt);
-		break;
-	case 2:
-		iTest->SimulateKeyDownUp('A');
-		break;
-	case 3:
-		iTest->SimulateKeyDownUpWithModifiers('S',EModifierAlt|EModifierCtrl);
-		break;
-	case 4:
-		iTest->SimulateKeyDownUpWithModifiers('N',EModifierAlt);
-		break;
-	case 5:
-		iTest->SimulateKeyDownUpWithModifiers('B',EModifierAlt|EModifierCtrl);
-		break;
-	case 6:
-		iTest->SimulateKeyDownUpWithModifiers('D',EModifierAlt);
-		break;
-	case 7:
-		iTest->SimulateKeyDownUpWithModifiers('C',EModifierAlt|EModifierCtrl);
-		break;
-	case 8:
-		iTest->SimulateKeyDownUp('H');//state EModeNormalCaptureWithPriority
-		break;
-	case 9:
-		iTest->SimulateKeyDownUp('J');
-		break;
-	case 10:
-		iTest->SimulateKeyDownUp('K');
-		break;
-	case 11:
-		iTest->SimulateKeyDownUp(EStdKeySpace);
-		break;
-	case 12:
-		iTest->SimulateKeyDownUp(EStdKeyEnter);
-		break;
-	case 13:
-		iTest->SimulateKeyDownUpWithModifiers(EStdKeySpace,EModifierShift);
-		break;
-	case 14:
-		iTest->SimulateKeyDownUpWithModifiers(EStdKeyEnter,EModifierShift);
-		break;
-	case 15:
-		iTest->SimulateKeyDownUp('H');//state EModeKeyUpsAndDownsWithPriority
-		break;
-	case 16:
-		iTest->SimulateKeyDownUp('J');
-		break;
-	case 17:
-		iTest->SimulateKeyDownUp('K');
-		break;
-	case 18:
-		iTest->SimulateKeyDownUpWithModifiers('C',EModifierCtrl);
-		break;
-	case 19:
-		iTest->SimulateKeyDownUpWithModifiers('D',EModifierCtrl);
-		break;
-	case 20:
-		iTest->SimulateKeyDownUp('Z');
-		break;
-	default:
-		TEST(EFalse);
-		}
-	TheClient->iWs.Flush();
-	}
-
-void CTCaptureKey::CapKeyPowerOffL()
-	{
-	const TUint protKey=0xF844;		//This value needs to be defined in the WSINI.INI file as a key only capturable by a certain application
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	CleanupClosePushL(ws);
-	
-	// assign to the correct screen
-	CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws);
-	CleanupStack::PushL(screen);
-	User::LeaveIfError(screen->Construct(iTest->iScreenNumber));
-	
-	RWindowGroup group(ws);
-	group.Construct(ENullWsHandle);
-	CleanupClosePushL(group);
-	group.EnableReceiptOfFocus(EFalse);
-	group.SetOrdinalPosition(0,5);
-	RBlankWindow blank(ws);
-	blank.Construct(group,ENullWsHandle);
-	CleanupClosePushL(blank);
-	blank.EnableBackup();
-	blank.Activate();
-	_LIT(kGroupName1,"Hello");
-	group.SetName(kGroupName1);
-	TInt capHandle = group.CaptureKey(EKeyDevice2,EModifierFunc,EModifierFunc);
-	TEST(capHandle==KErrPermissionDenied);
-	if (capHandle!=KErrPermissionDenied)
-		{
-		_LIT(KLog1,"Capture Key suceeded when it should of failed, Error/Handle=%d (expected: %d)");
-		LOG_MESSAGE3(KLog1,capHandle,KErrPermissionDenied);
-		_LIT(KLog2,"This is indicative of a bad WSINI file");
-		LOG_MESSAGE(KLog2);
-		}
-
-	capHandle=group.CaptureKeyUpAndDowns(protKey,0,0);
-	TEST(capHandle==KErrPermissionDenied);
-	if (capHandle!=KErrPermissionDenied)
-		{
-		_LIT(KLog,"Capture Key Up & Down suceeded when it should of failed, Error/Handle=%d (expected: %d)");
-		LOG_MESSAGE3(KLog,capHandle,KErrPermissionDenied);
-		}
-	
-	_LIT(kGroupName2,"SysApp");
-	group.SetName(kGroupName2);
-	capHandle = group.CaptureKey(EKeyDevice2,EModifierFunc,EModifierFunc);
-	TEST(capHandle > 0);
-	if (capHandle<=0)
-		{
-		_LIT(KLog,"Capture Key failed when it should of succeeded, Error=%d");
-		LOG_MESSAGE2(KLog,capHandle);
-		}
-
-	group.CancelCaptureKey(capHandle);
-	capHandle=group.CaptureKeyUpAndDowns(protKey,0,0);
-	TEST(capHandle > 0);
-	if (capHandle<=0)
-		{
-		_LIT(KLog,"Capture Key Up & Down failed when it should of succeeded, Error=%d");
-		LOG_MESSAGE2(KLog,capHandle);
-		}
-
-	group.CancelCaptureKeyUpAndDowns(capHandle);
-	CleanupStack::PopAndDestroy(4,&ws);
-	}
-
-
-void CTCaptureKey::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(Test0,"Normal capture with priority");
-	_LIT(TestNormalCaptureWithPriority,"Normal capture with priority");
-	_LIT(TestUpDown,"Capture ups and downs");
-	_LIT(TestUpDownWithPriority,"Capture ups and downs with priority");
-	_LIT(TestAbort,"Abort key");
-	_LIT(TestAbort2,"Abort key extended");
-	_LIT(TestErrors,"Errors");
-	_LIT(TestCaptureKey,"Capture Key");
-	_LIT(TestCapturePowerOffKey,"Capture PowerOff Key");
-
-	iTest->iState=iState;
-	((CTCaptureKeyStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(iState)
-		{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0140
-
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Normal key capture test
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     The test uses 3 wserv clients with their own window groups. The 
-					clients are registered for different keys to capture. The test 
-					simulates key presses.
-
-@SYMTestExpectedResults Checks that the key presses are captured correctly .
-*/
-		case 0:	// Dummy one to let capture key tests run
-			((CTCaptureKeyStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0140"));
-			iTest->LogSubTest(Test0);
-			iState++;
-			SendEvents();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0141
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Normal key capture test with priorities
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     The test uses 3 wserv clients with their own window groups. The 
-					clients are registered for different keys to capture and with
-					different priorities. The test simulates key presses.
-
-@SYMTestExpectedResults Checks that the key presses are captured correctly .
-*/
-		case 1:
-			((CTCaptureKeyStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0141"));
-			iTest->LogSubTest(TestNormalCaptureWithPriority);
-			CaptureWithPriorityTest();
-			iState++;
-			SendEvents();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0142
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Up-down key capture test
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     The test uses 3 wserv clients with their own window groups. The 
-					clients are registered for different keys to capture their
-					up and down events. The test simulates key presses and releases.
-
-@SYMTestExpectedResults Checks that the key presses and releases are captured correctly .
-*/
-		case 2:
-			((CTCaptureKeyStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0142"));
-			iTest->LogSubTest(TestUpDown);
-			CaptureUpsAndDownsTest();
-			iState++;
-			SendEvents();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0143
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Up-down key capture test with priorities
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     The test uses 3 wserv clients with their own window groups. The 
-					clients are registered with different priorities for different keys to capture their
-					up and down events. The test simulates key presses and releases.
-
-@SYMTestExpectedResults Checks that the key presses and releases are captured correctly .
-*/
-		case 3:
-			((CTCaptureKeyStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0143"));
-			iTest->LogSubTest(TestUpDownWithPriority);
-			CaptureUpsAndDownsWithPriorityTest();
-			iState++;
-			SendEvents();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0144
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Priority key events test
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     The test simulates key events and make sure that the events are 
-					recieved by the registered wserv client.
-
-@SYMTestExpectedResults Makes sure that key code is the same as a key simulated, event modifiers comply
-					with registered priority key's modifirs and mask, and that event handle 
-					is a window group of the session.
-					
-*/
-		case 4:
-			((CTCaptureKeyStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0144"));
-			if (iSubState==numCapKeyTests+numUpDownKeyWithPriorityTests+numUpDownKeyTests+numUpDownKeyWithPriorityTests)
-				{
-				iTest->LogSubTest(TestAbort);
-				SetUpPriorityKeyTest();
-				}
-			else
-				iTest->LogSubTest(TestAbort2);
-			//iState++;
-			SendEvents();
-			TheClient->WaitUntilEventPending();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0145
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Invalid capture keys test
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Memorizes amount of objects that the server has allocated for that client.
-					Tries to register 3 different capture keys with invalid
-					modifiers and modifirs mask pair.
-
-@SYMTestExpectedResults Makes sure that the number of server-side objects for the 
-					session didn't change.
-*/
-		case 5:
-			((CTCaptureKeyStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0145"));
-			iTest->LogSubTest(TestErrors);
-			BadParams();
-			((CTCaptureKeyStep*)iStep)->RecordTestResultL();
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0146
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Capture keys clean up test
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Memorizes amount of objects that the server has allocated for that client.
-					Creates a window group and requests two keys to be captured.
-					Cancels one key capture request and closes the window group.
-
-@SYMTestExpectedResults Checks that creation of the group or registering a capture key
-					increased this amount by 1 each time.
-					Makes sure that the number of server-side objects for the 
-					session in the end of the test is the same as in the beginning.
-*/
-			((CTCaptureKeyStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0146"));
-			iTest->LogSubTest(TestCaptureKey);
-			CapKeyPurgingL();
-			iState++;
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0147
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Capture power off key test
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     The test creates a new session, new window group and a new window
-					in the group. After that the test gives "Hello" name to the group
-					and tries to register for key capture of FN+EKeyDevice2 and 0xF844
-					buttons. Makes sure that registration fails due to KErrPermissionDenied
-					error.
-					Then the test changes the name of the window group to "SysApp"
-					and tries the registration again. Makes sure that operation 
-					completed successfully.
-
-@SYMTestExpectedResults See actions
-*/
-		case 6:
-			((CTCaptureKeyStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0147"));
-			iTest->LogSubTest(TestCapturePowerOffKey);
-			CapKeyPowerOffL();
-			iState++;
-			break;
-		default:
-			((CTCaptureKeyStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			TestComplete();
-		}
-	((CTCaptureKeyStep*)iStep)->RecordTestResultL();
-
-	}
-
-
-__WS_CONSTRUCT_STEP__(CaptureKey)
--- a/windowing/windowserver/tauto/TCapKey.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,313 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TCAPKEY_H__
-#define __TCAPKEY_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-enum TTestMode
-	{
-	EModeNormalCapture,
-	EModeNormalCaptureWithPriority,
-	EModeWaitingForFirstNormalCapWithPriority,
-	EModeWaitingForFirstDown,
-	EModeWaitingForFirstDownWithPriority,
-	EModeKeyUpsAndDowns,
-	EModeKeyUpsAndDownsWithPriority,
-	EModeAbortKeys,
-	};
-enum TCapKeyRetValues
-	{
-	ECapKeyOkay,
-	ECapKeyRetry,
-	ECapKeyFail,
-	};
-
-struct SCapKeyParams
-	{
-	TInt connIndex;		// Connection that should capture this key
-	TUint keyCode;
-	TUint modifier_mask;
-	TUint modifiers;
-	TInt priority;
-	};
-
-struct SCapKeyTestParams
-	{
-	TText *txt;			// Text message telling user what to do
-	TInt connIndex;		// Connection that receive the key press
-	TUint keyCode;		// Expected key code
-	TUint modifier_mask;// Modifiers mask for expected modifiers
-	TUint modifiers;	// Expected modifiers
-	};
-
-struct SAbortKeyTests
-	{
-	TUint keyCode;		// Expected key code
-	TUint modifier_mask;// Modifiers mask for expected modifiers
-	TUint modifiers;	// Expected modifiers
-	};
-
-LOCAL_D SCapKeyParams capKeys[]={
-	{1,19,EModifierFunc|EModifierCtrl,EModifierFunc|EModifierCtrl,0},
-	{2,'b',EModifierFunc|EModifierCtrl,EModifierFunc,0},
-	{2,'n',EModifierFunc|EModifierCtrl,EModifierFunc,0},
-	{0,3,EModifierFunc|EModifierCtrl,EModifierFunc|EModifierCtrl,0},
-	{2,'q',0,0,0},
-	{2,'w',0,0,0},
-	};
-
-LOCAL_D SCapKeyParams capKeysWithPriority[]={
-	{2,'h',0,0,7},
-	{1,'h',EModifierFunc|EModifierCtrl|EModifierShift,0,7},
-	{0,'h',EModifierFunc|EModifierCtrl|EModifierShift,0,7},
-	{2,'j',EModifierFunc|EModifierCtrl|EModifierShift,0,6},
-	{1,'j',EModifierFunc|EModifierCtrl|EModifierShift,0,6},
-	{0,'j',EModifierFunc|EModifierCtrl|EModifierShift,0,5},
-	{2,'k',EModifierFunc|EModifierCtrl|EModifierShift,0,4},
-	{1,'k',EModifierFunc|EModifierCtrl|EModifierShift,0,3},
-	{0,'k',EModifierFunc|EModifierCtrl|EModifierShift,0,2},
-	};
-	
-LOCAL_D SCapKeyParams capUpAndDownKeys[]={
-	{2,EStdKeySpace,EModifierFunc|EModifierCtrl|EModifierShift,0,0},
-	{2,EStdKeyEnter,EModifierFunc|EModifierCtrl|EModifierShift,EModifierShift,0},
-	};
-
-LOCAL_D SCapKeyParams capUpAndDownKeysWithPriority[]={
-	{2,'H',EModifierFunc|EModifierCtrl|EModifierShift,0,7},
-	{1,'H',EModifierFunc|EModifierCtrl|EModifierShift,0,7},
-	{0,'H',EModifierFunc|EModifierCtrl|EModifierShift,0,7},
-	{2,'J',EModifierFunc|EModifierCtrl|EModifierShift,0,6},
-	{1,'J',EModifierFunc|EModifierCtrl|EModifierShift,0,6},
-	{0,'J',EModifierFunc|EModifierCtrl|EModifierShift,0,5},
-	{2,'K',EModifierFunc|EModifierCtrl|EModifierShift,0,4},
-	{1,'K',EModifierFunc|EModifierCtrl|EModifierShift,0,3},
-	{0,'K',EModifierFunc|EModifierCtrl|EModifierShift,0,2},
-	};
-	
-LOCAL_D SCapKeyTestParams capKeyTests[]={
-	{(TText *)_S("Press q"),2,'q',EModifierFunc|EModifierCtrl|EModifierShift,0},
-	{(TText *)_S("Press <Alt>w"),2,'w',EModifierFunc|EModifierCtrl|EModifierShift,EModifierFunc},
-	{(TText *)_S("Press a"),0,'a',0},
-	{(TText *)_S("Press <Ctrl><Alt>s"),1,19,EModifierFunc|EModifierCtrl|EModifierShift,EModifierFunc|EModifierCtrl},
-	{(TText *)_S("Press <Alt>n"),2,'n',EModifierFunc|EModifierCtrl|EModifierShift,EModifierFunc},
-	{(TText *)_S("Press <Ctrl><Alt>b"),0,2,EModifierFunc|EModifierCtrl|EModifierShift,EModifierFunc|EModifierCtrl},
-	{(TText *)_S("Press <Alt>d"),0,'d',EModifierFunc|EModifierCtrl|EModifierShift,EModifierFunc},
-	{(TText *)_S("Press <Ctrl><Alt>c"),0,3,EModifierFunc|EModifierCtrl|EModifierShift,EModifierFunc|EModifierCtrl},
-//
-// Capture normal keys with priority
-//
-	{(TText *)_S("Press h"),0,'h',EModifierFunc|EModifierCtrl|EModifierShift,0},
-	{(TText *)_S("Press j"),1,'j',EModifierFunc|EModifierCtrl|EModifierShift,0},
-	{(TText *)_S("Press k"),2,'k',EModifierFunc|EModifierCtrl|EModifierShift,0},
-//
-// Capture ups and downs
-//
-	{(TText *)_S("Press <Space>"),2,EStdKeySpace,EModifierFunc|EModifierCtrl|EModifierShift,0},
-	{(TText *)_S("Press <Enter>"),0,EStdKeyEnter,EModifierShift,0},
-	{(TText *)_S("Press <Shift><Space>"),0,EStdKeySpace,EModifierFunc|EModifierCtrl|EModifierShift,EModifierShift},
-	{(TText *)_S("Press <Shift><Enter>"),2,EStdKeyEnter,EModifierShift,EModifierShift},
-
-//
-// Capture ups and downs
-//
-	{(TText *)_S("Press H"),0,'H',EModifierFunc|EModifierCtrl|EModifierShift,0},
-	{(TText *)_S("Press J"),1,'J',EModifierFunc|EModifierCtrl|EModifierShift,0},
-	{(TText *)_S("Press K"),2,'K',EModifierFunc|EModifierCtrl|EModifierShift,0},
-//
-// Priority keys
-//
-	{(TText *)_S("Press <Ctrl>c"),0,0,0,0},
-	{(TText *)_S("Press <Ctrl>d"),0,0,0,0},
-	{(TText *)_S("Press z"),0,0,0,0},
-	};
-
-LOCAL_D SAbortKeyTests abortKeyTests[]={
-	{3,EModifierCtrl,EModifierCtrl},
-	{4,EModifierCtrl,EModifierCtrl},
-	{'z',EModifierFunc|EModifierCtrl|EModifierShift,0}
-	};
-
-struct SErrorCapKey
-	{
-	TInt keyCode;
-	TUint modifier_mask;
-	TUint modifiers;
-	};
-
-LOCAL_D SErrorCapKey errorKeys[]={
-	{'a',EModifierFunc|EModifierShift,EModifierFunc|EModifierCtrl},
-	{'1',0,EModifierFunc},
-	{3,EModifierCtrl,EModifierCtrl|EModifierShift},
-	};
-
-const TInt numCapKeys=sizeof(capKeys)/sizeof(capKeys[0]);
-const TInt numCapKeysWithPriority=sizeof(capKeysWithPriority)/sizeof(capKeysWithPriority[0]);
-const TInt numTests=sizeof(capKeyTests)/sizeof(capKeyTests[0]);
-const TInt numErrorKeys=sizeof(errorKeys)/sizeof(errorKeys[0]);
-const TInt numAbortKeyTests=sizeof(abortKeyTests)/sizeof(abortKeyTests[0]);
-const TInt numUpDownKeys=sizeof(capUpAndDownKeys)/sizeof(capUpAndDownKeys[0]);
-const TInt numUpDownKeysWithPriority=sizeof(capUpAndDownKeysWithPriority)/sizeof(capUpAndDownKeysWithPriority[0]);
-const TInt numUpDownKeyTests=4;
-const TInt numUpDownKeyWithPriorityTests=3;
-const TInt numCapKeyWithPriorityTests=3;
-const TInt numCapKeyTests=numTests-numAbortKeyTests-numUpDownKeyTests-numUpDownKeyWithPriorityTests-numCapKeyWithPriorityTests;
-
-LOCAL_D TInt capKeyHandle[numCapKeys];
-LOCAL_D TInt capKeyWithPriorityHandle[numCapKeysWithPriority];
-LOCAL_D TInt capUpDownKeyHandle[numUpDownKeys];
-LOCAL_D TInt capUpDownKeyWithPriorityHandle[numUpDownKeysWithPriority];
-
-class CCKWindow;
-class CTCaptureKey;
-class CCKAbortConnection;
-
-class CCKConnectionBase : public CTClient
-	{
-public:
-	CCKConnectionBase(CTCaptureKey *aTest);
-	void ConstructL();
-protected:
-	CTCaptureKey *iTest;
-	};
-
-class CCKConnection : public CCKConnectionBase
-	{
-public:
-	CCKConnection(CTCaptureKey *aTest, TInt aConnIndex);
-	~CCKConnection();
-	void ConstructL();
-	void CheckKeyL(const SCapKeyTestParams &aKeyTest, const TKeyEvent &aKey);
-	void SubStateChanged();
-	void KeyTestL(TInt aBool);
-	void KeyL(const TKeyEvent &aKey,const TTime &aTime);
-	void CheckUpDownL(const SCapKeyTestParams &aKeyTest, const TKeyEvent &aKey);
-	void CheckUpDownL(const TKeyEvent &aKey);
-	inline TInt Index() {return iConnIndex;}
-protected:
-	TInt iConnIndex;
-	CCKWindow *iWin;
-	};
-
-class CAbortHandler : public CTEventBase
-	{
-public:
-	CAbortHandler(RWsSession *aWs, CCKAbortConnection *aConnection);
-	~CAbortHandler();
-	void Request();
-protected:
-	void DoCancel();
-	void doRunL();
-protected:
-	CCKAbortConnection *iConnection;
-	};
-
-class CCKAbortConnection : public CCKConnectionBase
-	{
-public:
-	CCKAbortConnection(CTCaptureKey *aTest);
-	~CCKAbortConnection();
-	void ConstructL();
-	void ReceivedAbortEvent(TInt aHandle, TKeyEvent *aKey);
-	void Foreground();
-protected:
-	CAbortHandler *iAbortHandler;
-	TInt iAbortKeyIndex;
-	};
-
-class CCKWindow : public CTWin
-	{
-public:
-	CCKWindow(CTCaptureKey *aTest, TInt aConnIndex);
-	void SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
-	void Draw();
-protected:
-	TInt iConnIndex;
-	CTCaptureKey *iTest;
-	TRgb iBack;
-	};
-
-class CCKWindowGroup : public CTWindowGroup
-	{
-public:
-	CCKWindowGroup(CTClient *aClient, CTCaptureKey *aTest);
-	void KeyL(const TKeyEvent &aKey,const TTime &aTime);
-	void KeyDownL(const TKeyEvent &aKey,const TTime &);
-	void KeyUpL(const TKeyEvent &aKey,const TTime &);
-	void CheckUpDown(const SCapKeyTestParams &aKeyTest, const TKeyEvent &aKey);
-private:
-	CTCaptureKey *iTest;
-	};
-
-class CTCaptureKey : public CTWsGraphicsBase
-	{
-public:
-	CTCaptureKey(CTestStep* aStep);
-	~CTCaptureKey();
-	void ConstructL();
-	void EndCaptureKeyTest();
-	inline TInt State() {return iState;}
-	TInt SubState() const;
-	void IncSubState();
-	void BadParams();
-	void CapKeyPurgingL();
-	void SetUpPriorityKeyTest();
-	void CaptureWithPriorityTest();
-	void CaptureUpsAndDownsTest();
-	void CaptureUpsAndDownsWithPriorityTest();
-	TTestMode Mode();
-	void SetMode(TTestMode aMode);
-	inline TestClient* Client() {return TheClient;}
-	void SendEvents();
-	void CapKeyPowerOffL();
-	inline TInt ScreenNumber() {return iTest->ScreenNumber();}
-protected:
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	CCKConnection *iConn1;
-	CCKConnection *iConn2;
-	CCKConnection *iConn3;
-	CCKAbortConnection *iAbortConn;
-	TSize iWinSize;
-	TInt iState;
-	TInt iSubState;
-	TTestMode iMode;
-	};
-
-class CTCaptureKeyStep : public CTGraphicsStep
-	{
-public:
-	CTCaptureKeyStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTCaptureKeyStep,"TCaptureKey");
-
-
-#endif
--- a/windowing/windowserver/tauto/TDERIVED.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,435 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test classes derived from Wserv client side classes
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TDERIVED.H"
-
-CTDerived::CTDerived(CTestStep* aStep) : CTWsGraphicsBase(aStep)
-	{
-	}
-
-CTDerived::~CTDerived()
-	{
-	}
-
-//
-// CDerivedWindowGc //
-//
-
-CDerivedWindowGc::CDerivedWindowGc(CWsScreenDevice *aDevice) : CWindowGc(aDevice)
-	{
-	}
-
-CDerivedWindowGc::~CDerivedWindowGc()
-	{
-	}
-
-void CDerivedWindowGc::DrawLine(const TPoint &aPoint1,const TPoint &aPoint2)
-	{
-	CWindowGc::DrawLine(aPoint1+TPoint(10,10), aPoint2-TPoint(10,10));
-	}
-
-//
-// RDerivedSession //
-//
-
-TInt RDerivedSession::ResourceCount()
-	{
-	return(RWsSession::ResourceCount()+1);
-	}
-
-void RDerivedSession::EnableAutoFlush()
-	{
-	SetAutoFlush(ETrue);
-	}
-
-//
-// Derived windows //
-//
-
-RDerivedBlankWindow::RDerivedBlankWindow()
-	{}
-RDerivedBlankWindow::RDerivedBlankWindow(RWsSession &aWs) : RBlankWindow(aWs)
-	{
-	}
-
-void RDerivedBlankWindow::SetColor(TRgb aColor)
-	{
-	RBlankWindow::SetColor(~aColor);
-	}
-
-void RDerivedBlankWindow::SetColorGray()
-	{
-	RBlankWindow::SetColor(TRgb::Gray16(8));
-	}
-
-RDerivedWindow::RDerivedWindow()
-	{}
-RDerivedWindow::RDerivedWindow(RWsSession &aWs) : RWindow(aWs)
-	{
-	}
-
-void RDerivedWindow::SetBackgroundColor(TRgb aColor)
-	{
-	RWindow::SetBackgroundColor(~aColor);
-	}
-
-void RDerivedWindow::SetBackgroundColorGray()
-	{
-	RWindow::SetBackgroundColor(TRgb::Gray16(8));
-	}
-
-RDerivedBackedUpWindow::RDerivedBackedUpWindow()
-	{}
-RDerivedBackedUpWindow::RDerivedBackedUpWindow(RWsSession &aWs) : RBackedUpWindow(aWs)
-	{
-	}
-
-TInt RDerivedBackedUpWindow::BitmapHandle()
-	{
-	MaintainBackup();
-	return(RBackedUpWindow::BitmapHandle()+1);
-	};
-
-RDerivedWindowGroup::RDerivedWindowGroup()
-	{}
-
-RDerivedWindowGroup::RDerivedWindowGroup(RWsSession &aWs) : RWindowGroup(aWs)
-	{
-	}
-
-TName RDerivedWindowGroup::Name() const
-	{
-	return(_L("Fred"));
-	}
-
-//
-// CDerivedScreenDevice //
-//
-
-CDerivedScreenDevice::CDerivedScreenDevice()
-	{}
-
-CDerivedScreenDevice::CDerivedScreenDevice(RWsSession &aWs) : CWsScreenDevice(aWs)
-	{}
-
-TSize CDerivedScreenDevice::SizeInPixels() const
-	{
-	TSize size=CWsScreenDevice::SizeInPixels();
-	return(TSize(size.iWidth*2,size.iHeight*2));
-	}
-
-//
-// Derived Sprite/Pointer cursor //
-//
-
-RDerivedSprite::RDerivedSprite()
-	{
-	}
-
-RDerivedSprite::RDerivedSprite(RWsSession &aWs) : RWsSprite(aWs)
-	{
-	}
-
-RDerivedPointerCursor::RDerivedPointerCursor()
-	{
-	}
-
-RDerivedPointerCursor::RDerivedPointerCursor(RWsSession &aWs) : RWsPointerCursor(aWs)
-	{
-	}
-
-//
-
-void CTDerived::ConstructL()
-	{
-	TheGc->Activate(*BaseWin->Win());
-	TheGc->Clear();
-	TheGc->SetBrushColor(TRgb::Gray16(12));
-	TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TheGc->SetPenStyle(CGraphicsContext::ENullPen);
-	TheGc->DrawRect(TRect(BaseWin->Win()->Size()));
-	TheGc->Deactivate();
-	TheGc->Activate(*TestWin->Win());
-	TheGc->Clear();
-	TheGc->SetBrushColor(TRgb::Gray16(4));
-	TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TheGc->SetPenStyle(CGraphicsContext::ENullPen);
-	TheGc->DrawRect(TRect(TestWin->Win()->Size()));
-	TheGc->Deactivate();
-	}
-
-void CTDerived::DerivedWindowGcL()
-	{
-	CDerivedWindowGc *dgc=new(ELeave) CDerivedWindowGc(TheClient->iScreen);
-	dgc->Construct();
-	dgc->Activate(*TestWin->Win());
-	dgc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TestWin->Win()->BeginRedraw();
-	dgc->DrawRect(TRect(TestWin->Win()->Size()));
-	dgc->DrawLine(TPoint(0,0),TestWin->Win()->Size().AsPoint());
-	TestWin->Win()->EndRedraw();
-	dgc->Deactivate();
-	delete dgc;
-	dgc = NULL;
-	CWindowGc *wgc=new(ELeave) CWindowGc(TheClient->iScreen);
-	wgc->Construct();
-	wgc->Activate(*BaseWin->Win());
-	wgc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	BaseWin->Win()->BeginRedraw();
-	wgc->DrawRect(TRect(TestWin->Win()->Size()));
-	wgc->DrawLine(TPoint(10,10),TestWin->Win()->Size().AsPoint()-TPoint(10,10));
-	BaseWin->Win()->EndRedraw();
-	wgc->Deactivate();
-	delete wgc;
-	wgc = NULL;
-	CompareWindows(_L("CTDerived::DerivedWindowGcL()"));
-	}
-
-void CTDerived::DerivedSession()
-	{
-	TInt err;
-	err = iDSession.Connect();
-	if (err!=KErrNone)
-		return;
-	
-	// use the correct screen
-	CWsScreenDevice* screen = NULL;
-	TRAP(err, screen = new (ELeave) CWsScreenDevice(iDSession));
-	if (err!=KErrNone)
-		{
-		iDSession.Close();
-		return;
-		}
-	
-	if ((err=screen->Construct(iTest->iScreenNumber))!=KErrNone)
-		{
-		delete screen;
-		iDSession.Close();
-		return;
-		}
-
-	delete screen;
-	
-	TInt retVal = iDSession.ResourceCount();	
-	TEST(retVal==1);
-	if (retVal!=1)
-		INFO_PRINTF3(_L("iDSession.ResourceCount() return value - Expected: %d, Actual: %d"), 1, retVal);		
-	
-	iDSession.SetAutoFlush(EFalse);
-	iDSession.EnableAutoFlush();
-	
-	TBool retBool = iDSession.SetAutoFlush(EFalse);	
-	TEST(retBool);
-	if (!retBool)
-		INFO_PRINTF3(_L("iDSession.SetAutoFlush(EFalse) return value - Expected: %d, Actual: %d"), ETrue, retBool);		
-	
-	iDSession.Close();
-	}
-
-void CTDerived::DerivedWindows()
-	{
-//
-// Window group
-//
-	iDGroup=RDerivedWindowGroup(TheClient->iWs);
-	iDGroup.Construct(222);
-	iDGroup.Name();
-//
-// Redraw up window
-//
-	iDRedraw=RDerivedWindow(TheClient->iWs);
-	iDRedraw.Construct(iDGroup,12);
-	iDRedraw.SetBackgroundColor(TRgb(1,2,3));
-	iDRedraw.SetBackgroundColorGray();
-	iDRedraw.Close();
-//
-// Blank up window
-//
-	iDBlank=RDerivedBlankWindow(TheClient->iWs);
-	iDBlank.Construct(iDGroup,123);
-	iDBlank.SetColor(TRgb(1,20,50));
-	iDBlank.SetColorGray();
-	iDBlank.Close();
-//
-// Backed up window
-//
-	iDBackedUp=RDerivedBackedUpWindow(TheClient->iWs);
-	iDBackedUp.Construct(iDGroup,EGray4,1234);
-	iDBackedUp.BitmapHandle();
-	iDBackedUp.Close();
-//
-	iDGroup.Close();
-	}
-
-void CTDerived::DerivedScreenDeviceL()
-	{
-	CWsScreenDevice *wsd=new(ELeave) CWsScreenDevice(TheClient->iWs);
-	User::LeaveIfError(wsd->Construct(iTest->iScreenNumber));
-	TSize size1(wsd->SizeInPixels());
-	delete wsd;
-	CDerivedScreenDevice *dsd=new(ELeave) CDerivedScreenDevice(TheClient->iWs);
-	User::LeaveIfError(dsd->Construct(iTest->iScreenNumber));
-	TSize size2(dsd->SizeInPixels());
-	delete dsd;
-	TEST(size2.iWidth==size1.iWidth*2 && size2.iHeight==size1.iHeight*2);
-	}
-
-void CTDerived::DerivedSprite()
-	{
-	iDSprite=RDerivedSprite(TheClient->iWs);
-	TSpriteMember spm;
-	spm.iBitmap=NULL;
-	spm.iMaskBitmap=NULL;
-	spm.iInvertMask=EFalse;
-	spm.iOffset=TPoint(0,0);				// Offset from sprites central position
-	spm.iInterval=TTimeIntervalMicroSeconds32(1000000);
-	iDSprite.Construct(*TestWin->Win(), TPoint(10,10), 0);
-	iDSprite.Close();
-//
-	iDPCursor=RDerivedPointerCursor(TheClient->iWs);
-	iDPCursor.Construct(0);
-	iDPCursor.Close();
-	};
-
-void CTDerived::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	((CTDerivedStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(++iTest->iState)
-		{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0075
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test derived window graphics context
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Draw using a derived window gc and a normal
-					window gc and check the dawing is the same
-
-@SYMTestExpectedResults Drawing is the same with a derived window gc
-*/
-		case 1:
-			((CTDerivedStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0075"));
-			iTest->LogSubTest(_L("Derived Gc"));
-			DerivedWindowGcL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0076
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test derived window server session
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Test that a derived window server session functions
-					the same as a normal window server session
-
-@SYMTestExpectedResults The derived window server session functions correctly
-*/
-		case 2:
-			((CTDerivedStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0076"));
-			iTest->LogSubTest(_L("Derived Session"));
-			DerivedSession();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0077
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test derived windows and window groups function correctly
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Test that a derived windows and window groups function
-					the same as the classes they are derived from
-
-@SYMTestExpectedResults The derived windows and window group functions correctly
-*/
-		case 3:
-			((CTDerivedStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0077"));
-			iTest->LogSubTest(_L("Derived Blank Window"));
-			DerivedWindows();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0078
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test derived screen devices function correctly
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Test that a derived screen device function
-					the same as the class it is derived from
-
-@SYMTestExpectedResults The derived screen device functions correctly
-*/
-		case 4:
-			((CTDerivedStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0078"));
-			iTest->LogSubTest(_L("Derived Screed Device"));
-			DerivedScreenDeviceL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0079
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test derived sprites and pointer cursors function
-					correctly
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Test that a derived sprite and pointer cursor
-					function correctly
-
-@SYMTestExpectedResults The derived sprite and pointer cursor function 
-					correctly
-*/
-		case 5:
-			((CTDerivedStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0079"));
-			iTest->LogSubTest(_L("Derived Sprites"));
-			DerivedSprite();
-			break;
-		case 6:
-			((CTDerivedStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTDerivedStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();	
-			break;
-		}
-	((CTDerivedStep*)iStep)->RecordTestResultL();
-	}
-	
-__WS_CONSTRUCT_STEP__(Derived)
--- a/windowing/windowserver/tauto/TDERIVED.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TDERIVED_H__
-#define __TDERIVED_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-class CDerivedWindowGc : public CWindowGc
-	{
-public:
-	CDerivedWindowGc(CWsScreenDevice *aDevice);
-	~CDerivedWindowGc();
-	void DrawLine(const TPoint &aPoint1,const TPoint &aPoint2);
-	};
-
-class RDerivedSession : public RWsSession
-	{
-public:
-	TInt ResourceCount();
-	void EnableAutoFlush();
-	};
-
-class RDerivedBlankWindow : public RBlankWindow
-	{
-public:
-	RDerivedBlankWindow();
-	RDerivedBlankWindow(RWsSession &aWs);
-	void SetColor(TRgb aColor);
-	void SetColorGray();
-	};
-
-class RDerivedWindow : public RWindow
-	{
-public:
-	RDerivedWindow();
-	RDerivedWindow(RWsSession &aWs);
-	void SetBackgroundColor(TRgb aColor);
-	void SetBackgroundColorGray();
-	};
-
-class RDerivedBackedUpWindow : public RBackedUpWindow
-	{
-public:
-	RDerivedBackedUpWindow();
-	RDerivedBackedUpWindow(RWsSession &aWs);
-	TInt BitmapHandle();
-	};
-
-class RDerivedWindowGroup : public RWindowGroup
-	{
-public:
-	RDerivedWindowGroup();
-	RDerivedWindowGroup(RWsSession &aWs);
-	TName Name() const;
-	};
-
-class CDerivedScreenDevice : public CWsScreenDevice
-	{
-public:
-	CDerivedScreenDevice(RWsSession &aWs);
-	CDerivedScreenDevice();
-	TSize SizeInPixels() const;
-	};
-
-class RDerivedSprite : public RWsSprite
-	{
-public:
-	RDerivedSprite();
-	RDerivedSprite(RWsSession &aWs);
-	};
-
-class RDerivedPointerCursor : public RWsPointerCursor
-	{
-public:
-	RDerivedPointerCursor();
-	RDerivedPointerCursor(RWsSession &aWs);
-	};
-
-class CTDerived : public CTWsGraphicsBase
-	{
-public:
-	CTDerived(CTestStep* aStep);
-	void ConstructL();
-	void DerivedWindowGcL();
-	void DerivedSession();
-	void DerivedWindows();
-	void DerivedScreenDeviceL();
-	void DerivedSprite();
-	~CTDerived();
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	TSize iWinSize;
-	RDerivedSession iDSession;
-	RDerivedWindow iDRedraw;
-	RDerivedBlankWindow iDBlank;
-	RDerivedBackedUpWindow iDBackedUp;
-	RDerivedWindowGroup iDGroup;
-	RDerivedSprite iDSprite;
-	RDerivedPointerCursor iDPCursor;
-	};
-
-class CTDerivedStep : public CTGraphicsStep
-	{
-public:
-	CTDerivedStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTDerivedStep,"TDerived");
-
-
-#endif
--- a/windowing/windowserver/tauto/TDirectA.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3950 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test Direct Screen Access
-// 
-//
-
-#include "tdirecta.h"
-
-static TRect WinExt;
-static TInt WinCol=0;
-static TTimeIntervalMicroSeconds32 MoveInterval;
-static TTimeIntervalMicroSeconds32 ModeInterval;
-static TTimeIntervalMicroSeconds32 FlipInterval;
-static TBool ImmediateModeSwitch;
-#if defined(LOGGING)
-	LOCAL_D TLogMessageText LogMessageText;
-#endif
-
-_LIT(SemControl,"Control");
-_LIT(SemNextOp,"TrigerWindow");
-_LIT(FontName,"DejaVu Serif Condensed");
-_LIT(QueueControl,"Queue");
-
-LOCAL_D TSize FullScreenModeSize;
-LOCAL_D TInt Copy2ndHalfOfScreen;
-
-const TBool KRegionTrackingOnly = ETrue;
-const TBool KDrawingDsa = EFalse;
-
-const TInt KPanicTestOrdinalPriority=65536;
-const TInt KMainTestOrdinalPriority=65535;
-const TInt KMainTestBaseWindow=KMainTestOrdinalPriority/3;
-const TInt KAboveMainTestBaseWindow = KMainTestBaseWindow +1;
-
-const TInt KMaxIdlingTime = 25; //used for RegionTrackingOnly DSAs, it represents the maximum number of times the Idling function can be called
-//Ids of two RegionTrackingOnly DSAs
-const TInt KRegionTrackingOnlyDsaWaitingForAbortSignal = 25;
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-const TInt KRegionTrackingOnlyDsaNoAbortSignal = 26;
-#endif
-
-const TInt KRegionTrackingOnlyDsaExistLast = 0;
-const TInt KDrawingDsaExistLast = 1;
-const TInt KShortDelay = 5000;
-#define SHORT_DELAY	TTimeIntervalMicroSeconds32(KShortDelay)
-
-_LIT(KSem_DefectFix_KAA_5J3BLW_Name, "DefectFix_KAA_5J3BLW");
-
-GLDEF_C TInt ProcDirect(TAny *aScreenNumber)
-	{
-	CTrapCleanup* cleanupStack = NULL;
-	User::LeaveIfNull(cleanupStack = CTrapCleanup::New());
-
-#if defined(LOGGING)
-	_LIT(KWindow,"Window Toggle Vis=");
-	_LIT(KParams,"%d, Pos=(%d,%d,%d,%d), Col=%d");
-#endif
-	RSemaphore controlSem;
-	RSemaphore windowSem;
-	User::LeaveIfError(controlSem.OpenGlobal(SemControl));
-	User::LeaveIfError(windowSem.OpenGlobal(SemNextOp));
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-
-	// assign to the correct screen
-	CWsScreenDevice* screen = NULL;
-	TInt err;
-	TRAP(err, screen = new (ELeave) CWsScreenDevice(ws));
-	if (err!=KErrNone)
-		return err;
-
-	if ((err=screen->Construct((TInt)aScreenNumber))!=KErrNone)
-		{
-		delete screen;
-		return err;
-		}
-
-	RWindowGroup group(ws);
-	User::LeaveIfError(group.Construct(898));
-	group.EnableReceiptOfFocus(EFalse);
-	group.SetOrdinalPosition(0,KAboveMainTestBaseWindow );
-	RBlankWindow window(ws);
-	User::LeaveIfError(window.Construct(group,899));
-	TBool vis=EFalse;
-	window.SetVisible(vis);
-	window.Activate();
-	ws.Flush();
-	controlSem.Signal();
-	windowSem.Wait();
-	RMsgQueueBase queue;
-	TInt open = queue.OpenGlobal(QueueControl);
-	TInt data;
-	while (queue.Receive(&data,sizeof(TInt)) != KErrNone)
-		{
-		vis=!vis;
-		if (vis)
-			{
-			window.SetColor(TRgb::Gray4(WinCol));
-			window.SetExtent(WinExt.iTl,WinExt.Size());
-		#if defined(LOGGING)
-			LogMessageText.Copy(KWindow);
-			LogMessageText.AppendFormat(KParams,vis,WinExt.iTl.iX,WinExt.iTl.iY,WinExt.iBr.iX,WinExt.iBr.iY,WinCol);
-			ws.LogMessage(LogMessageText);
-		#endif
-			}
-		window.SetVisible(vis);
-		ws.Flush();
-		windowSem.Wait();
-		}
-	queue.Close();
-
-	window.Close();
-	group.Close();
-
-	delete screen;
-	ws.Close();
-	controlSem.Close();
-	windowSem.Close();
-
-	delete cleanupStack;
-	return(KErrNone);
-	}
-
-
-/*CDirectScreenAccessOld*/
-
-CDirectScreenAccessOld* CDirectScreenAccessOld::NewL(RWsSession& aWs,MAbortDirectScreenAccess& aAborter)
-	{
-	CDirectScreenAccessOld* self=new(ELeave) CDirectScreenAccessOld(aWs,aAborter);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-CDirectScreenAccessOld::~CDirectScreenAccessOld()
-	{
-	__ASSERT_ALWAYS(!iAborting,AutoPanic(EAutoPanicDirect));
-	Cancel();
-	iDirectAccess.Close();
-	}
-
-void CDirectScreenAccessOld::ConstructL()
-	{
-	User::LeaveIfError(iDirectAccess.Construct());
-	CActiveScheduler::Add(this);
-	}
-
-TInt CDirectScreenAccessOld::Request(RRegion*& aRegion, RWindowBase& aWindow)
-	{
-	TInt ret=iDirectAccess.Request(aRegion,iStatus,aWindow);
-	if (ret==KErrNone)
-		SetActive();
-	return ret;
-	}
-
-void CDirectScreenAccessOld::DoCancel()
-	{
-	iDirectAccess.Cancel();
-	}
-
-void CDirectScreenAccessOld::RunL()
-	{
-	iAborting=ETrue;
-	iAborter.AbortNow(REINTERPRET_CAST(RDirectScreenAccess::TTerminationReasons&,iStatus));
-	iAborting=EFalse;
-	iDirectAccess.Completed();
-	}
-
-
-/*CColorAnimation*/
-
-CColorAnimation* CColorAnimation::NewL(TInt aScreenNumber,TInt aId,MAnimCallBacks& aCallBack,CTWinBase& aParent,TRect aExtent,TBool aStart,TBool aRegionTrackingOnly)
-	{
-	CColorAnimation* self=new(ELeave) CColorAnimation(aScreenNumber,aId,aCallBack);
-	CleanupStack::PushL(self);
-	self->ConstructL(aParent,aExtent,aRegionTrackingOnly);
-	if (aStart)
-		self->StartL();
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-CColorAnimation::~CColorAnimation()
-	{
-	delete iTimer;
-	delete iDrawer;
-	delete iWindow;
-	delete iWindow2;
-	TheClient->Flush();
-	}
-
-void CColorAnimation::ConstructL(CTWinBase& aParent,TRect aExtent,TBool aRegionTrackingOnly,TInt aTypeWindow/*=0*/,TInt aSingleWinForMultipleDSA/*=0*/)
-	{	
-	iRegionTrackingOnly = aRegionTrackingOnly;
-	// Make sure that the top right corner is not 0,0
-	if (aTypeWindow && aExtent.iTl==TPoint(0,0))
-		{
-		aExtent.iTl=TPoint(10,10);
-		}
-	RWindowBase* win=NULL;
-	iSingleWinForMultipleDSA=aSingleWinForMultipleDSA;
-	if (aSingleWinForMultipleDSA)
-		{
-		win=iCallBack.iCallBackWin->BaseWin();
-		iWinSize=TheClient->iScreen->SizeInPixels();
-		}
-	else
-		{
-		iWindow=new(ELeave) CTBlankWindow();
-		iWinSize=aExtent.Size();
-		iWindow->ConstructExtLD(aParent,aExtent.iTl,iWinSize);
-		ChangeModeL(iCallBack.DisplayMode(iId));
-		win=iWindow->BaseWin();
-		win->SetShadowDisabled(ETrue);
-		win->Activate();
-		}
-	if (!aTypeWindow)
-		{
-		if(iRegionTrackingOnly)
-			{
-			iDrawer=CDirectScreenAccess::NewL(TheClient->iWs,*TheClient->iScreen,*win,*this,iRegionTrackingOnly);
-			}
-		else
-			{
-			//needed for the non NGA case: only the old API is allowed to be used
-			iDrawer=CDirectScreenAccess::NewL(TheClient->iWs,*TheClient->iScreen,*win,*this);
-			}
-		}
-	else
-		{
-		TRect childRect(0,0,100,100);
-		switch(aTypeWindow)
-			{
-			case 1:
-				{
-				// Create a Blank Window smaller than it's parent and its top left corner within the parent area and withn the screen area
-	 			childRect.Shrink(10,10);
-				break;
-				}
-			case 2:
-				{
-				// Create a Blank Window with its top left corner being left side of its parent
-				childRect.Move(-10,0);
-				break;
-				}
-			}
-		iWindow2=new(ELeave) CTBlankWindow();
-		iWindow2->ConstructExtLD(*iWindow,childRect.iTl,childRect.Size());
-		// Finish constructing the window
-	 	RWindowBase& win=*iWindow2->BaseWin();
-	 	win.SetShadowDisabled(ETrue);
-	 	win.Activate();
-		// Create the Direct Screen Access object
-	 	if(iRegionTrackingOnly)
-	 		{
-	 		iDrawer=CDirectScreenAccess::NewL(TheClient->iWs,*TheClient->iScreen,win,*this,iRegionTrackingOnly);
-	 		}
-	 	else
-	 		{
-	 		//needed for the non NGA case: only the old API is allowed to be used
-	 		iDrawer=CDirectScreenAccess::NewL(TheClient->iWs,*TheClient->iScreen,win,*this);
-	 		}
-		}
-	TheClient->Flush();
-	if (iId == 4)
-	    {
-        // This clause is needed to prevent sub-test 9 from taking an 
-        // exceedingly large amount of time. The CColorAnimation with iId 4 is 
-        // the one which controls when the test stops. This raise in 
-        // priority compared to the other CColorAnimations, allows it's 
-        // callbacks to get through when otherwise they would take much longer
-        // due to the volume of callbacks generated by the other
-        // CColorAnimations
-        iTimer=CPeriodic::NewL(1);
-	    }
-	else
-	    {
-        iTimer=CPeriodic::NewL(0);
-	    }
-	}
-
-TPoint CColorAnimation::AbsoluteWindowPosition(TInt aWindowId/*=0*/)
-	{
-	if (iSingleWinForMultipleDSA)
-		{
-		return iCallBack.iCallBackWin->BaseWin()->AbsPosition();
-		}
-	if (!aWindowId)
-		{
-		// Return the absolute position of iWindow, if Color Animation is not for Position Relative to Screen test.
-		return iWindow->BaseWin()->AbsPosition();
-		}
-	else
-		{
-		// Return the absolute position of iWindow2, if it is for Position Relative to Screen test.
-		return iWindow2->BaseWin()->AbsPosition();
-		}
-	}
-
-TInt CColorAnimation::DrawColorL(TAny* aAnimation)
-	{
-	STATIC_CAST(CColorAnimation*,aAnimation)->DrawColorL();
-	return(KErrNone);
-	}
-
-TInt CColorAnimation::IdlingL(TAny* aAnimation)
-	{
-	(static_cast<CColorAnimation*>(aAnimation))->IdlingL();
-	return(KErrNone);
-	}
-
-void CColorAnimation::StartL(TBool aChildWindow/*=EFalse*/)
-	{
-	iDrawer->StartL();
-	TRect bounding=iDrawer->DrawingRegion()->BoundingRect();
-	TRect window;
-	if (aChildWindow)
-		{
-		window.SetRect(AbsoluteWindowPosition(1),iWinSize);
-		}
-	else
-		{
-		window.SetRect(AbsoluteWindowPosition(),iWinSize);
-		}
-	// Check that the window contains the bounding area (a bounding rect of (0,0,0,0) shouldn't fail the test)
-	if (!(window.Contains(bounding.iTl) && window.Contains(bounding.iBr-TPoint(1,1))) && bounding.Size()!=TSize(0,0))
-		{
-		iCallBack.Fail();
-	//	iDrawer->Cancel();
-	//	iDrawer->StartL();
-	//	bounding=iDrawer->DrawingRegion()->BoundingRect();
-		}
-	if(!iRegionTrackingOnly)                                                                                                                                                          
-		{
-		iTimer->Start(0,iCallBack.TimerInterval(iId),TCallBack(CColorAnimation::DrawColorL,this));
-		iDrawer->Gc()->SetPenStyle(CGraphicsContext::ENullPen);
-		iDrawer->Gc()->SetBrushStyle(CGraphicsContext::ESolidBrush);
-		}                                                                                                                                                                                
-	else                                                                                                                                                                              
-		{
-		iTimer->Start(0,iCallBack.TimerInterval(iId),TCallBack(CColorAnimation::IdlingL,this));
-		}
-	}
-
-void CColorAnimation::StartOrPanic()
-	{
-	TRAPD(err,StartL());
-	if (err!=KErrNone)
-		{
-		iCallBack.LogLeave(err);
-		iCallBack.Fail();
-		}
-	}
-
-void CColorAnimation::Stop()
-	{
-	iTimer->Cancel();
-	iDrawer->Cancel();
-	}
-
-void CColorAnimation::BringWindowToFront()
-	{
-	iWindow->WinTreeNode()->SetOrdinalPosition(0);
-	}
-
-void CColorAnimation::ChangeModeL(TDisplayMode aMode)
-	{
-	User::LeaveIfError(iWindow->BaseWin()->SetRequiredDisplayMode(aMode));
-	TheClient->Flush();
-	}
-
-void CColorAnimation::FinishTest()
-	{
-	iCallBack.Finished(iId);
-	}
-
-inline CDirectScreenAccess* CColorAnimation::GetDrawer()
-	{
-	return iDrawer;
-	}
-
-void CColorAnimation::DrawColorL()
-	{
-	TBool aFinished;
-	iDrawer->Gc()->SetBrushColor(iCallBack.BrushColorL(iId,iColor,aFinished));
-	if (iSingleWinForMultipleDSA==1)
-		{
-		iDrawer->Gc()->DrawRect(iWinSize-TSize(iWinSize.iWidth/2,iWinSize.iHeight/2));
-		}
-	else if (iSingleWinForMultipleDSA==2)
-		{
-		iDrawer->Gc()->DrawRect(TRect(TPoint(iWinSize.iWidth/2,iWinSize.iHeight/2),TSize(iWinSize.iWidth/2,iWinSize.iHeight/2)));
-		}
-	else
-		{
-		iDrawer->Gc()->DrawRect(iWinSize);
-		}
-	iDrawer->ScreenDevice()->Update();
-	if (aFinished)
-		{
-		if (iId==1)
-			{
-			iWindow->SetSize(TSize(48,52));
-			TheClient->Flush();
-			}
-		if (aFinished==1)
-			Stop();
-		iCallBack.Finished(iId);
-		}
-	}
-
-void CColorAnimation::IdlingL()
-	{
-	iIdling++;
-	if(iIdling == KMaxIdlingTime)
-		{
-		Stop();
-		iIdling = 0;
-		if (iId == KRegionTrackingOnlyDsaWaitingForAbortSignal)
-			{
-			_LIT(KErrorAbortNotReceived,"DSA didn't get an abort signal even though the window was opened in front");
-			CallBack().Log((TText8*)__FILE__,__LINE__, ESevrErr,KErrorAbortNotReceived);
-			CallBack().Fail();
-			}
-		iCallBack.Finished(iId);
-		}
-	}
-
-void CColorAnimation::AbortNow(RDirectScreenAccess::TTerminationReasons /*aReason*/)
-	{
-	TInt slow=iCallBack.SlowStopping(iId,iCount);
-	switch (slow)
-		{
-	case eAbortAll:
-		iCallBack.Finished(iId);
-	case eAbort:
-		Stop();
-		return;
-	case eStopDelayed:
-		User::After(750000);		//0.75 secs
-		break;
-	default:;
-		}
-	++iCount;
-	iTimer->Cancel();
-	}
-
-void CColorAnimation::Restart(RDirectScreenAccess::TTerminationReasons /*aReason*/)
-	{
-	TRAPD(err,StartL());
-	if (err!=KErrNone)
-		iCallBack.FailedReStart(iId,err);
-	}
-
-
-/*CScrollingTextDrawer*/
-
-CScrollingTextDrawer* CScrollingTextDrawer::NewL(TInt aScreenNumber,CFbsScreenDevice*& aDevice,CFbsBitGc& aGc)
-	{
-	CScrollingTextDrawer* self=new(ELeave) CScrollingTextDrawer(aDevice,aGc);
-	CleanupStack::PushL(self);
-	self->ConstructL(aScreenNumber);
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-CScrollingTextDrawer::~CScrollingTextDrawer()
-	{
-	if(iFontDevice)
-		{
-		iFontDevice->ReleaseFont(iFont);
-		delete iFontDevice;
-		}
-	}
-
-void CScrollingTextDrawer::ConstructL(TInt aScreenNumber)
-	{
-	iFontDevice=CFbsScreenDevice::NewL(aScreenNumber,iDevice->DisplayMode());
-	_LIT(text,"ABCDEFGHIJKLMNOPQRSTUVWXYZ");
-	iText=text;
-	CreateFontL();
-	//iFirstChar=0;
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-#if defined(LOGGING)
-	iWs.Connect();
-	// point to correct screen
-	CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(iWs);
-	CleanupStack::PushL(screen);
-	User::LeaveIfError(screen->Construct(aScreenNumber));
-	CleanupStack::Pop(screen);
-
-	_LIT(KConstTextDrawer,"Constructed Text Drawer");
-	LogMessageText.Copy(KConstTextDrawer);
-	iWs.LogMessage(LogMessageText);
-	iWs.Flush();
-
-	delete screen;
-	iWs.Close();
-#endif
-	}
-
-void CScrollingTextDrawer::CreateFontL()
-	{
-	TInt screenHeight=iDevice->SizeInPixels().iHeight;
-	TFontSpec fontSpec(FontName,screenHeight);
-	User::LeaveIfError(iFontDevice->GetNearestFontToDesignHeightInPixels(iFont,fontSpec));
-	iGc->UseFont(iFont);
-	TInt fontHeight=iFont->HeightInPixels();
-	iDrawRect.iTl.iY=(screenHeight-fontHeight)/2;
-	iDrawRect.iBr.iY=iDrawRect.iTl.iY+fontHeight;
-	iDrawHeight=iFont->AscentInPixels();
-	iCharWidth=iFont->CharWidthInPixels(iText[iFirstChar]);
-	iDrawRect.iBr.iX=Max(iDevice->SizeInPixels().iWidth,iDevice->SizeInPixels().iHeight);
-	iDrawRect.iTl.iX=iDrawRect.iBr.iX-iCharWidth;
-	}
-
-void CScrollingTextDrawer::SetBottomOfTest(TInt aBottom)
-	{
-	if (iDrawRect.iBr.iY>aBottom)
-		{
-		iDrawRect.iTl.iY-=iDrawRect.iBr.iY-aBottom;
-		iDrawRect.iBr.iY=aBottom;
-		}
-	}
-
-void CScrollingTextDrawer::Scroll()
-	{
-	iCharWidth=iFont->CharWidthInPixels(iText[iFirstChar]);
-	iDrawRect.iTl.iX-=iJump;
-	iGc->DrawText(iText.Mid(iFirstChar),iDrawRect,iDrawHeight);
-	iDevice->Update();
-	if (iDrawRect.iTl.iX<-iCharWidth)
-		{
-		if (++iFirstChar==iText.Length())
-			{
-			iFirstChar=0;
-			iDrawRect.iTl.iX=iDevice->SizeInPixels().iWidth;
-			}
-		else
-			iDrawRect.iTl.iX+=iCharWidth;
-		iCharWidth=iFont->CharWidthInPixels(iText[iFirstChar]);
-		}
-	}
-
-
-/*CScrollText*/
-
-TInt CScrollText::DrawText(TAny* aAnimation)
-	{
-	STATIC_CAST(CScrollText*,aAnimation)->ScrollText();
-	return(KErrNone);
-	}
-
-CScrollText* CScrollText::NewL(TInt aScreenNumber,TInt aId,CTWindowGroup& aParent,TInt aScrollJump,TBool aStart/*=EFalse*/)
-	{
-	CScrollText* self=new(ELeave) CScrollText(aId,aScrollJump,aScreenNumber);
-	CleanupStack::PushL(self);
-	self->ConstructL(aParent);
-	if (aStart)
-		self->StartL();
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-CScrollText::~CScrollText()
-	{
-	delete iTimer;
-	delete iTextDraw;
-	iTextDraw=NULL;
-	delete iDrawer;
-	delete iWindow;
-	TheClient->Flush();
-	}
-
-void CScrollText::ConstructL(CTWindowGroup& aParent)
-	{
-	iWindow=new(ELeave) CTBlankWindow();
-	iWindow->ConstructL(aParent);
-	RWindowBase& win=*iWindow->BaseWin();
-	win.Activate();
-	iDrawer=CDirectScreenAccess::NewL(TheClient->iWs,*TheClient->iScreen,win,*this);
-	TheClient->Flush();
-	iTimer=CPeriodic::NewL(0);
-	}
-
-void CScrollText::StartL()
-	{
-	DoContinueL();
-	iDrawer->Gc()->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	if (!iTextDraw)
-		{
-		iTextDraw=CScrollingTextDrawer::NewL(iScreenNumber,iDrawer->ScreenDevice(),*iDrawer->Gc());
-		iTextDraw->SetScrollJump(iScrollJump);
-		}
-	}
-
-void CScrollText::ContinueL()
-	{
-	DoContinueL();
-	}
-
-void CScrollText::DoContinueL()
-	{
-	iTimer->Start(0,10000,TCallBack(CScrollText::DrawText,this));
-	
-		//0.01secs
-	iDrawer->StartL();
-	TRect bounding=iDrawer->DrawingRegion()->BoundingRect();
-#if defined(LOGGING)
-	_LIT(KBoundRect,"Continue Scroll Text  Rect=(%d,%d,%d,%d)");
-	LogMessageText.Zero();
-	LogMessageText.AppendFormat(KBoundRect,bounding.iTl.iX,bounding.iTl.iY,bounding.iBr.iX,bounding.iBr.iY);
-	TheClient->iWs.LogMessage(LogMessageText);
-	TheClient->Flush();
-#endif
-	TRect window=TRect(iWindow->BaseWin()->AbsPosition(),iWindow->Size());
-	if (!window.Contains(bounding.iTl) || !window.Contains(bounding.iBr-TPoint(1,1)))
-		AutoPanic(EAutoPanicTestFailed);
-	}
-
-void CScrollText::Stop()
-	{
-	iTimer->Cancel();
-	iDrawer->Cancel();
-	}
-
-void CScrollText::ScrollText()
-	{
-	iTextDraw->Scroll();
-	}
-
-void CScrollText::AbortNow(RDirectScreenAccess::TTerminationReasons aReason)
-	{
-	iTimer->Cancel();
-	if (!iCounting)
-		return;
-	if (iAbortCountDown>0)
-		--iAbortCountDown;
-	else
-		{
-		if (aReason==RDirectScreenAccess::ETerminateRegion)
-			{
-			User::After(1500000);		//1.5secs
-			iAbortCountDown=7;
-			}
-		}
-	}
-
-void CScrollText::Restart(RDirectScreenAccess::TTerminationReasons /*aReason*/)
-//This function is pure virtual and so cannot have an 'L' at the end of it's name
-	{
-	ContinueL();
-	}
-
-/*CWindowWithChild*/
-
-CWindowWithChild* CWindowWithChild::NewL(TInt aScreenNumber, CTWindowGroup& aParent,TBool aStart/*=EFalse*/)
-	{
-	CWindowWithChild* self=new(ELeave) CWindowWithChild(aScreenNumber);
-	CleanupStack::PushL(self);
-	self->ConstructL(aParent);
-	if (aStart)
-		self->StartL();
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-CWindowWithChild::~CWindowWithChild()
-	{
-	delete iDrawer;
-	delete iChildWindow;
-	delete iWindow;
-	TheClient->Flush();
-	}
-
-void CWindowWithChild::ConstructL(CTWindowGroup& aParent)
-	{
-	iWindow=new(ELeave) CTBlankWindow();
-	iWindow->ConstructL(aParent);
-
-	iChildWindow = new(ELeave) CTWin();
-	iChildWindow->ConstructWin(*iWindow);
-	
-	iChildWindow->SetExt(TPoint(0,0), TSize(4,4));
-	RWindowBase& cwin=*iChildWindow->BaseWin();
-	cwin.Activate();
-
-	RWindowBase& win=*iWindow->BaseWin();
-	win.Activate();
-
-	iDrawer=CDirectScreenAccess::NewL(TheClient->iWs,*TheClient->iScreen,win,*this);
-	
-	TheClient->Flush();
-	}
-
-void CWindowWithChild::StartL()
-	{
-	DoContinueL();
-	}
-
-void CWindowWithChild::ContinueL()
-	{
-	DoContinueL();
-	}
-
-void CWindowWithChild::DoContinueL()
-	{
-	iDrawer->StartL();
-	iRunning = ETrue;
-	}
-
-void CWindowWithChild::Stop()
-	{
-	iDrawer->Cancel();
-	}
-
-void CWindowWithChild::AbortNow(RDirectScreenAccess::TTerminationReasons /*aReason*/)
-	{
-	iRunning = EFalse;
-	}
-
-void CWindowWithChild::Restart(RDirectScreenAccess::TTerminationReasons /*aReason*/)
-//This function is pure virtual and so cannot have an 'L' at the end of it's name
-	{
-	ContinueL();
-	}
-
-void CWindowWithChild::PerformCoverageCalls()
-	{
-	//add coverage to commands with no/partial coverage
-	RWindow& cwin=*iChildWindow->Win();	
-	TInt priority = 0;
-	
-	cwin.SetPointerCapturePriority(priority);
-	__ASSERT_ALWAYS(cwin.GetPointerCapturePriority()==priority, User::Invariant());
-	cwin.ClaimPointerGrab(EFalse);
-	cwin.EnableBackup(0);
-	__ASSERT_ALWAYS(cwin.PrevSibling()==0, User::Invariant());	
-	cwin.Invalidate(TRect(0, 0, 10, 10));
-	cwin.FadeBehind(ETrue);
-	TheClient->Flush();
-	// cover (empty) False condition in CWsWindow::SetFadeBehind
-	cwin.FadeBehind(ETrue);
-	TheClient->Flush();
-	}
-
-/*CWsBase*/
-
-void CWsBase::ConstructL(TInt aScreenNumber, TInt aHandle)
-	{
-	User::LeaveIfError(iWs.Connect());
-	iScrDev=new(ELeave) CWsScreenDevice(iWs);
-	User::LeaveIfError(iScrDev->Construct(aScreenNumber));
-	iGroup=RWindowGroup(iWs);
-	User::LeaveIfError(iGroup.Construct(aHandle,EFalse));
-	iGroup.SetOrdinalPosition(0,KMainTestBaseWindow);
-	}
-
-void CWsBase::CreateBlankWindowL(RBlankWindow& iWin,TInt aHandle)
-	{
-	iWin=RBlankWindow(iWs);
-	User::LeaveIfError(iWin.Construct(iGroup,aHandle));
-	}
-
-CWsBase::~CWsBase()
-	{
-	iGroup.Close();
-	delete iScrDev;
-	iWs.Close();
-	}
-
-
-/*CAnimating*/
-
-TInt CAnimating::StartLC(TAny* aScreenNumber)
-	{
-	CAnimating* self=new(ELeave) CAnimating();
-	CleanupStack::PushL(self);
-	self->ConstructL((TInt)aScreenNumber);
-	return KErrNone;
-	}
-
-void CAnimating::ConstructL(TInt aScreenNumber)
-	{
-	CWsBase::ConstructL(aScreenNumber,798);
-#if defined(LOGGING)
-	_LIT(KAnimate1,"Constructed CWsBase");
-	LogMessageText.Copy(KAnimate1);
-	iWs.LogMessage(LogMessageText);
-	iWs.Flush();
-#endif
-	iGroup.EnableReceiptOfFocus(EFalse);
-	CreateBlankWindowL(iWindow,799);
-	User::LeaveIfError(iWindow.SetRequiredDisplayMode(EGray16));
-	iWindow.Activate();
-#if defined(LOGGING)
-	_LIT(KAnimate2,"Set up Windows");
-	LogMessageText.Copy(KAnimate2);
-	iWs.LogMessage(LogMessageText);
-#endif
-	iWs.Flush();
-	TDisplayMode displayMode=CWsBase::iScrDev->DisplayMode();
-	if (displayMode<EGray16)
-		displayMode=EGray16;
-	iScrDev=CFbsScreenDevice::NewL(aScreenNumber,displayMode);
-	User::LeaveIfError(iScrDev->CreateContext(iGc));
-#if defined(LOGGING)
-	_LIT(KAnimate3,"Created Screen Device");
-	LogMessageText.Copy(KAnimate3);
-	iWs.LogMessage(LogMessageText);
-	iWs.Flush();
-#endif
-	iDirect=CDirectScreenAccessOld::NewL(iWs,*this);
-	iTimer=CPeriodic::NewL(0);
-	User::LeaveIfError(iControlSem.OpenGlobal(SemControl,EOwnerThread));		//Must be thread relative, since it won't get cleaned up when the thread is killed otherwise
-	User::LeaveIfError(iControlQueue.OpenGlobal(QueueControl,EOwnerThread));	//Must be thread relative, since it won't get cleaned up when the thread is killed otherwise
-	iSemCreated=ETrue;
-#if defined(LOGGING)
-	_LIT(KAnimate5,"Created Direct, Timer and Semaphore");
-	LogMessageText.Copy(KAnimate5);
-	iWs.LogMessage(LogMessageText);
-	iWs.Flush();
-#endif
-	iScrSize=iScrDev->SizeInPixels();
-	iGc->SetPenStyle(CGraphicsContext::ENullPen);
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	StartAnimatingL();
-#if defined(LOGGING)
-	_LIT(KAnimate6,"Started Animation");
-	LogMessageText.Copy(KAnimate6);
-	iWs.LogMessage(LogMessageText);
-	iWs.Flush();
-#endif
-	}
-
-CAnimating::~CAnimating()
-	//This function should never actually get run in practice
-	{
-	if (iSemCreated)
-		{
-		iControlSem.Close();
-		iControlQueue.Close();
-		}
-	if (iDrawingRegion)
-		iDrawingRegion->Destroy();
-	delete iTimer;
-	delete iDirect;
-	delete iGc;
-	delete iScrDev;
-	iWindow.Close();
-	}
-
-void CAnimating::AbortNow(RDirectScreenAccess::TTerminationReasons /*aReason*/)
-	{
-	iTimer->Cancel();
-	iControlSem.Signal();
-	TInt data = 2;
-	iControlQueue.Send(&data,sizeof(TInt));
-	User::After(10000000);		//10 secs
-	}
-
-TInt NextColor(TAny* aAnimation)
-	{
-	STATIC_CAST(CAnimating*,aAnimation)->DrawFrame();
-	return(KErrNone);
-	}
-
-void CAnimating::DrawFrame()
-	{
-	iColor=(iColor+3)%16;
-	iGc->SetBrushColor(TRgb::Gray16(iColor));
-	iGc->DrawRect(iScrSize);
-	iScrDev->Update();
-	if (iColor==2)
-		{
-		iControlSem.Signal();
-		TInt data = 1;
-		iControlQueue.Send(&data,sizeof(TInt));
-		}
-	}
-
-void CAnimating::StartAnimatingL()
-	{
-	iTimer->Start(0,150000,TCallBack(NextColor,this));		//0.15 secs
-
-	User::LeaveIfError(iDirect->Request(iDrawingRegion,iWindow));
-	iGc->SetClippingRegion(iDrawingRegion);
-	}
-
-
-/*CMoveWindow*/
-
-TInt CMoveWindow::StartLC(TAny* aScreenNumber)
-	{
-	CMoveWindow* self=new(ELeave) CMoveWindow();
-	CleanupStack::PushL(self);
-	self->ConstructL((TInt)aScreenNumber);
-	return KErrNone;
-	}
-
-TInt CMoveWindow::FlipChange(TAny* aMoveWin)
-	{
-	Cast(aMoveWin)->FlipChange();
-	return(KErrNone);
-	}
-
-TInt CMoveWindow::StateChange(TAny* aMoveWin)
-	{
-	Cast(aMoveWin)->StateChange();
-	return(KErrNone);
-	}
-
-CMoveWindow::~CMoveWindow()
-	{
-	delete iStateTimer;
-	delete iTimer;
-	iWindow.Close();
-	iBackUpWin.Close();
-	delete iGc;
-	}
-
-TInt MoveWin(TAny* aMoveWin)
-	{
-	STATIC_CAST(CMoveWindow*,aMoveWin)->MoveWindow();
-	return(KErrNone);
-	}
-
-void CMoveWindow::ConstructL(TInt aScreenNumber)
-	{
-	CWsBase::ConstructL(aScreenNumber,898);
-	iBounceArea=TRect(iScrDev->SizeInPixels());
-	iSize.iHeight=iBounceArea.iBr.iY/5;
-	iSize.iWidth=iBounceArea.iBr.iX/5;
-	iBounceArea.iTl.iX=iBounceArea.iBr.iX/6;
-	iBounceArea.iBr.iX=5*iBounceArea.iBr.iX/6;
-	iBounceArea.iTl.iY=iBounceArea.iBr.iY/4;
-	iBounceArea.iBr.iY=3*iBounceArea.iBr.iY/4;
-	iDelta=TSize(3,3);
-	iTl=iBounceArea.iTl;
-	CreateBlankWindowL(iWindow,899);
-	iWindow.SetExtent(iTl,iSize);
-	iWindow.SetShadowDisabled(ETrue);
-	iWindow.SetColor(TRgb::Gray4(2));
-	iWindow.Activate();
-	iBackUpWin=RBackedUpWindow(iWs);
-	User::LeaveIfError(iBackUpWin.Construct(iGroup,EGray4,698));
-	User::LeaveIfError(iBackUpWin.SetSizeErr(TSize(2,2)));
-	iGc=new(ELeave) CWindowGc(iScrDev);
-	User::LeaveIfError(iGc->Construct());
-	iDisplayMode=EGray4;
-	if (MoveInterval>TTimeIntervalMicroSeconds32(0))
-		CreateTimerL();
-	if (ModeInterval>TTimeIntervalMicroSeconds32(0))
-		{
-		iStateTimer=CPeriodic::NewL(0);
-		iStateTimer->Start(ModeInterval,ModeInterval,TCallBack(CMoveWindow::StateChange,this));
-		}
-	if (FlipInterval>TTimeIntervalMicroSeconds32(0))
-		{
-		iDevice=new(ELeave) CWsScreenDevice(iWs);
-		User::LeaveIfError(iDevice->Construct(aScreenNumber));
-		iNumOfModes=iDevice->NumScreenModes();
-		if (iNumOfModes>1)
-			{
-			iFlipTimer=CPeriodic::NewL(0);
-			iFlipTimer->Start(FlipInterval,FlipInterval,TCallBack(CMoveWindow::FlipChange,this));
-			}
-		}
-	iStateCountDown=0;
-	}
-
-void CMoveWindow::CreateTimerL()
-	{
-	iTimer=CPeriodic::NewL(0);
-	iTimer->Start(0,MoveInterval,TCallBack(MoveWin,this));
-
-	}
-
-void CMoveWindow::MoveWindow()
-	{
-	if (--iStateCountDown>=0)
-		{
-		if (iStateCountDown==2)
-			ToggleDisplayMode();
-		return;
-		}
-	TPoint iBr=iTl+iSize;
-	TSize iDeltaSize;
-	if ((iDelta.iHeight<0 && iTl.iY<=iBounceArea.iTl.iY) || (iDelta.iHeight>0 && iBr.iY>=iBounceArea.iBr.iY))
-		{
-		iDelta.iHeight=-iDelta.iHeight;
-		iDeltaSize.iWidth=2;
-		}
-	if ((iDelta.iWidth<0 && iTl.iX<=iBounceArea.iTl.iX) || (iDelta.iWidth>0 && iBr.iX>=iBounceArea.iBr.iX))
-		{
-		iDelta.iWidth=-iDelta.iWidth;
-		if (iDeltaSize.iWidth==0)
-			iDeltaSize.iHeight=2;
-		else
-			iDeltaSize.iWidth=0;
-		}
-	iTl+=iDelta;
-	iSize+=iDeltaSize;
-	iWindow.SetExtent(iTl,iSize);
-	iWs.Flush();
-	}
-
-void CMoveWindow::StateChange()
-	{
-	if (ImmediateModeSwitch>1)
-		{
-		if (MoveInterval>TTimeIntervalMicroSeconds32(0) && iTimer==NULL)
-			{
-			TRAPD(err,CreateTimerL());
-			if (err==KErrNone)
-				ImmediateModeSwitch=ETrue;
-			}
-		}
-	if (ImmediateModeSwitch || MoveInterval==TTimeIntervalMicroSeconds32(0))
-		ToggleDisplayMode();
-	else
-		{
-		if (iStateCountDown<-8)
-			iStateCountDown=6;
-		}
-	}
-
-void CMoveWindow::ToggleDisplayMode()
-	{
-	if(iDisplayMode==EColor16MU)
-		{
-		return;		//Test probably doesn't work with mode EColor16MU
-		}
-	iDisplayMode=(iDisplayMode==EColor16M ? EGray4:EColor16M);
-#if defined(LOGGING)
-	TInt newMode=
-#endif
-				iWindow.SetRequiredDisplayMode(iDisplayMode);
-	iGc->Activate(iBackUpWin);
-	iBackUpWin.SetPosition(iDisplayMode==EColor16M ? TPoint(1,0):TPoint(0,1));
-#if defined(LOGGING)
-	TDisplayMode curentMode=iScrDev->DisplayMode();
-	_LIT(KToggleMode,"Toggle Display Mode  Mode=%d Window=%d Actual=%d");
-	LogMessageText.Zero();
-	LogMessageText.AppendFormat(KToggleMode,(TInt&)iDisplayMode,newMode,(TInt&)curentMode);
-	iWs.LogMessage(LogMessageText);
-	//iWs.LogCommand(RWsSession::ELoggingStatusDump);
-#endif
-	iWs.Flush();
-	iGc->Deactivate();
-	}
-
-void CMoveWindow::FlipChange()
-	{
-	if (++iCurrentMode==2) //flip between modes 0 and 1
-		iCurrentMode=0;
-	iDevice->SetScreenMode(iCurrentMode);
-	iWs.Flush();
-	}
-
-//
-// CBugFixColorAnimation
-//
-// This class is used for reproducing a defect found on 6.1: KAA-5J3BLW "Unnecessary Wserv's DSA abort".
-// The problem was that a direct screen access client was getting an unnecessary abort notification
-// when a new window (or window group) was created but not visible.
-// This class will simulate the direct screen access client and it will check whether the first DSA abort
-// is not caused by just creating a window.
-
-CBugFixColorAnimation* CBugFixColorAnimation::NewL(TInt aScreenNumber,TInt aId,MAnimCallBacks& aCallBack,CTWindowGroup& aParent,TRect aExtent,TBool aStart)
-	{
-	CBugFixColorAnimation* self=new(ELeave) CBugFixColorAnimation(aScreenNumber, aId,aCallBack);
-	CleanupStack::PushL(self);
-	self->ConstructL(aParent,aExtent);
-	if (aStart)
-		{
-		self->StartL();
-		self->Started();
-		}
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-CBugFixColorAnimation::CBugFixColorAnimation(TInt aScreenNumber,TInt aId,MAnimCallBacks& aCallBack)
-	: CColorAnimation(aScreenNumber, aId, aCallBack)
-	{
-		iThreadParam.iScreenNumber = aScreenNumber;
-	}
-
-CBugFixColorAnimation::~CBugFixColorAnimation()
-	{
-	iSem.Close();
-	if(iThread)
-		{
-		TRequestStatus status;
-		iThread->Logon(status);
-		if (iThread->StillAlive())
-			{
- 			iThread->Terminate(KErrNone);
-			User::WaitForRequest(status);
-			}
-		delete iThread;
-		}
-	iTestFailed->Cancel();
-	delete iTestFailed;
-	}
-
-
-LOCAL_D TInt TestFailed(TAny* aAnimation)
-	{
-	CBugFixColorAnimation* anim=reinterpret_cast<CBugFixColorAnimation*>(aAnimation);
-	TRAP_IGNORE(
-		anim->Stop();
-		anim->CallBack().Fail();
-		anim->FinishTest();
-		);
-	return KErrNone;
-	}
-
-LOCAL_D TInt CreateNewWindowGroup(TAny* aParam)
-	{
-	TDirectThreadParam* param = (TDirectThreadParam*)aParam;
-	TRect rect = param->iRect;
-	TBool isInFront = param->iIsInFront;
-	RWsSession ws;
-	TInt error=ws.Connect();
-
-	CWsScreenDevice* screen = NULL;
-	TRAP(error, screen = new (ELeave) CWsScreenDevice(ws));
-	if (error!=KErrNone)
-		{
-		ws.Close();
-		RThread::Rendezvous(error);
-		return error;
-		}
-
-	if ((error=screen->Construct(param->iScreenNumber))!=KErrNone)
-		{
-		delete screen;
-		ws.Close();
-		RThread::Rendezvous(error);
-		return error;
-		}
-	RSemaphore sem;
-	error = sem.OpenGlobal(KSem_DefectFix_KAA_5J3BLW_Name, EOwnerThread);
-	if (error!=KErrNone)
-	    {
-	    ws.Close();
-	    RThread::Rendezvous(error);
-	    return error;
-	    }
-	
-	RThread::Rendezvous(KErrNone);
-
-	// wait for the dsa to start before creating the new window group
-	sem.Wait();
-	sem.Close();
-
-	
-	RWindowGroup group(ws);
-	group.Construct(431,EFalse);
-	if(isInFront)
-		{
-		group.SetOrdinalPosition(0,KAboveMainTestBaseWindow);
-		}
-	else
-		{
-		group.SetOrdinalPosition(2);
-		}
-	RWindow window(ws);
-	error=window.Construct(group, 432);
-	if (error==KErrNone)
-		{
-		window.SetExtentErr(rect.iTl, rect.Size());
-		window.SetOrdinalPosition(0,0);
-		ws.Flush();
-		window.Activate();
-		ws.Flush();
-		if(!isInFront)
-			{
-			group.SetOrdinalPosition(-1);
-			}
-		ws.Flush();
-		//Wait for wserv to render new window on top of the existing DSA region.
-		ws.Finish(); 
-		//Now the window has been rendered (and DSA should have been aborted).
-		window.Close();
-		}
-
-	group.Close();
-	delete screen;
-	ws.Close();
-	return error;
-	}
-
-void CBugFixColorAnimation::ConstructL(CTWindowGroup& aParent,TRect aExtent)
-	{
-	CColorAnimation::ConstructL(aParent, aExtent,KDrawingDsa);
-	_LIT(ThreadName,"Create new Window");
-	iAnimRect=aExtent;
-	TInt error=iSem.CreateGlobal(KSem_DefectFix_KAA_5J3BLW_Name, 0);
-	if (error==KErrNone)
-	    {
-	    iThreadParam.iRect = iAnimRect;
-	    iThreadParam.iIsInFront = EFalse;
-	    TThreadStartUp function=TThreadStartUp(CreateNewWindowGroup, &iThreadParam);
-	    TRequestStatus status;
-	    iThread=CProcess::NewThreadRendezvousL(ThreadName,&function, status);
-	    User::WaitForRequest(status);
-	    if (status != KErrNone)
-	        {
-	        RDebug::Printf("the request status is returned to be non KErrNone: %d", status.Int());
-	        TestFailed(this);
-	        }
-		iTestFailed = CIdle::NewL(0);
-	    }
-	else
-	    {
-	    TestFailed(this);
-	    }
-	}
-
-void CBugFixColorAnimation::AbortNow(RDirectScreenAccess::TTerminationReasons /*aReason*/)
-	{
-	Stop();
-	if (!iTestFailed->IsActive())
-		{
-		iTestFailed->Start(TCallBack(TestFailed,this));
-		}
-	}
-
-void CBugFixColorAnimation::Restart(RDirectScreenAccess::TTerminationReasons aReason)
-	{
-	AbortNow(aReason);
-	}
-
-TInt CPanicDirect::DoTestOnNewSchedulerL(TInt aInt, TAny* aPtr)
-	{	
-	CActiveScheduler* activeScheduler=new(ELeave) CActiveScheduler;
-	CActiveScheduler::Install(activeScheduler);
-	CleanupStack::PushL(activeScheduler);
-	DoTestNowL(aInt,aPtr);
-	CleanupStack::PopAndDestroy(activeScheduler);
-	return(EWsExitReasonBad);	//calls to this method currently all ignore the return code anyway.
-	}
-
-TInt CPanicDirect::DoTestOnNewScheduler(TInt aInt, TAny* aPtr)
-	{
-	TInt rv=EWsExitReasonBad;	
-	TRAP_IGNORE(rv=DoTestOnNewSchedulerL(aInt,aPtr));
-	return(rv);	//calls to this method currently all ignore the return code anyway.
- 	}
-
-void CPanicDirect::DoTestNowL(TInt aInt, TAny* aPtr)
-	{
-	CPanicDirect* self=new(ELeave) CPanicDirect();
-	CleanupStack::PushL(self);
-	self->ConstructL((TInt)aPtr, aInt);
-	self->TestL();
-	CleanupStack::PopAndDestroy(self);
-	}
-
-void CPanicDirect::ConstructL(TInt aScreenNumber, TInt aInt)
-	{
-	iScreenNumber = aScreenNumber;
-
-	User::LeaveIfError(iTimer.CreateLocal());
-	User::LeaveIfError(iWs.Connect());
-	iWsScrDev=new(ELeave) CWsScreenDevice(iWs);
-	User::LeaveIfError(iWsScrDev->Construct(iScreenNumber));
-
-#if defined(LOGGING)
-	_LIT(KPanicThead1,"PanicThread: Into ConstructL");
-	LogMessageText.Copy(KPanicThead1);
-	iWs.LogMessage(LogMessageText);
-	iWs.Flush();
-#endif
-	iGroup=RWindowGroup(iWs);
-	User::LeaveIfError(iGroup.Construct(2200+aInt,EFalse));
-	iGroup.SetOrdinalPosition(0,KPanicTestOrdinalPriority);
-	iBlankWin=RBlankWindow(iWs);
-	User::LeaveIfError(iBlankWin.Construct(iGroup,2300+aInt));
-	iBlankWin.Activate();
-	iDirect=RDirectScreenAccess(iWs);
-	User::LeaveIfError(iDirect.Construct());
-	iDisplayMode=iWsScrDev->DisplayMode();
-#if defined(LOGGING)
-	_LIT(KPanicThead2,"PanicThread: Creating Screen Device, Mode=%d");
-	LogMessageText.Format(KPanicThead2,iDisplayMode);
-	iWs.LogMessage(LogMessageText);
-	iWs.Flush();
-#endif
-	iScreenDevice=CFbsScreenDevice::NewL(aScreenNumber,iDisplayMode);
-#if defined(LOGGING)
-	_LIT(KPanicThead3,"PanicThread: Created Device");
-	LogMessageText.Copy(KPanicThead3);
-	iWs.LogMessage(LogMessageText);
-	iWs.Flush();
-#endif
-	User::LeaveIfError(iScreenDevice->CreateContext(iGc));
-#if defined(LOGGING)
-	_LIT(KPanicThead4,"PanicThread: Created Context");
-	LogMessageText.Copy(KPanicThead4);
-	iWs.LogMessage(LogMessageText);
-	iWs.Flush();
-#endif
-	iTextDraw=CScrollingTextDrawer::NewL(iScreenNumber,iScreenDevice,*iGc);
-#if defined(LOGGING)
-	_LIT(KPanicThead5,"PanicThread: Created ScrollDrawer");
-	LogMessageText.Copy(KPanicThead5);
-	iWs.LogMessage(LogMessageText);
-	iWs.Flush();
-#endif
-	iTextDraw->SetScrollJump(4);
-#if defined(LOGGING)
-	_LIT(KCreatedDrawer,"PanicThread: CreatedDrawer");
-	LogMessageText.Copy(KCreatedDrawer);
-	iWs.LogMessage(LogMessageText);
-	iWs.Flush();
-#endif
-	iTestNo=aInt;
-	}
-
-CPanicDirect::~CPanicDirect()
-	{
-	iDirect.Close();
-	delete iGc;
-	delete iScreenDevice;
-	delete iTextDraw;
-	iBlankWin.Close();
-	iGroup.Close();
-	delete iWsScrDev;
-	iWs.Close();
-	if (iRegion)
-		iRegion->Close();
-	iTimer.Close();
-	}
-
-void CPanicDirect::TestL()
-	{
-	if (iTestNo==2)
-		{
-		iDirect.Completed();
-		return;
-		}
-	TInt err=iDirect.Request(iRegion,iDirectStatus,iBlankWin);
-	if (err!=KErrNone || !iRegion)
-		return;
-	TRect screen(iScreenDevice->SizeInPixels());
-	TRect bounding=iRegion->BoundingRect();
-	if (!screen.Contains(bounding.iTl) || !screen.Contains(bounding.iBr-TPoint(1,1)))
-		goto Cancel;
-	iGc->SetClippingRegion(iRegion);
-	iDrawingAllowed=ETrue;
-	iTimer.After(iTimerStatus,50000);		//0.05secs
-	FOREVER
-		{
-		User::WaitForRequest(iDirectStatus,iTimerStatus);
-		if (iDirectStatus!=KRequestPending)
-			iDrawingAllowed=EFalse;
-		else if (iTimerStatus!=KRequestPending)
-			{
-			if (iDrawingAllowed)
-				DoDrawingL();
-			iTimer.After(iTimerStatus,50000);		//0.05secs
-			}
-		else
-			{
-	Cancel:
-			iDirect.Cancel();
-			return;
-			}
-		}
-	}
-
-void CPanicDirect::DoDrawingL()
-	{
-	++iCount;
-	iTextDraw->Scroll();
-	if (iTestNo==1 && iCount==8)
-		{
-		iDirect.Request(iRegion,iDirectStatus,iBlankWin);
-		return;
-		}
-	if (iTestNo==3 && iCount==12)
-		{
-		iDirect.Completed();
-		iDirect.Completed();
-		return;
-		}
-	if (iTestNo==4 && iCount==16)
-		{
-		iBlankWin.SetSize(TSize(20,25));
-		delete iRegion;
-		User::LeaveIfError(iDirect.Request(iRegion,iDirectStatus,iBlankWin));
-		return;
-		}
-	if (iTestNo==5 && iCount==19)
-		{
-		iWs.Close();
-		return;
-		}
-	}
-
-
-/*CTDirect*/
-
-CTDirect::CTDirect(CTestStep* aStep):
-	CTWsGraphicsBase(aStep)
-	{
-	iState = 0;
-	iNextFrameFinished = ETrue;
-	iPackagingFinished = EFalse;
-	iTimerRunning = EFalse;
-	}
-
-CTDirect::~CTDirect()
-	{
-	DeleteMoveWindow();
-	DeleteScroll();
-			
-	delete iAnim;
-	TheClient->WaitForRedrawsToFinish();
-	delete iCallBackWin;
-	// put focus back to current screen as this test changed the focus screen to primary screen
-	TheClient->iWs.SetFocusScreen(iTest->iScreenNumber);
-	}
-
-void CTDirect::ConstructL()
-	{
-	_LIT(KCTDirectConstructL,"AUTO  Construct Direct Test");
-	LOG_MESSAGE(KCTDirectConstructL);
-	FullScreenModeSize=TheClient->iScreen->SizeInPixels();
-	iIsScalingSupported=CheckScalingSupportedOrNot();
-	iNumOfCallBack=0;
-	iCallBackWin=new(ELeave) CTBlankWindow;
-	iCallBackWin->ConstructL(*TheClient->iGroup);
-	User::LeaveIfError(iCallBackWin->BaseWin()->SetRequiredDisplayMode(EColor256));
-	iCallBackWin->SetExt(TPoint(),TheClient->iScreen->SizeInPixels());
-	iCallBackWin->SetVisible(EFalse);
-	iCallBackWin->Activate();
-	// the following line makes sure that a console object hidden outside of
-	// screens range doesn't affect test results being on top of tested objects
-	TheClient->iGroup->GroupWin()->SetOrdinalPosition(0, KMainTestBaseWindow);
-	}
-
-void CTDirect::ConstrucBlankWindowL()
-	{
-	delete iWin;
-	iWin=new(ELeave) CTBlankWindow;
-	iWin->ConstructL(*TheClient->iGroup);
-	iWin->BaseWin()->SetShadowDisabled(ETrue);
-	iWin->BaseWin()->Activate();
-	TheClient->Flush();
-	}
-
-void CTDirect::InitialiseAnimationL()
-	{
-	ConstrucBlankWindowL();
-	TInt colors,greys;
-	TDisplayMode dispMode=TheClient->iWs.GetDefModeMaxNumColors(colors,greys);
-	iScrDev=CFbsScreenDevice::NewL(iTest->iScreenNumber,dispMode);
-	User::LeaveIfError(iScrDev->CreateContext(iGc));
-	INFO_PRINTF1(_L(" Constructed Screen Device"));
-	iScrSize=iScrDev->SizeInPixels();
-	TFontSpec fontSpec(FontName,iScrSize.iHeight);
-	fontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightBold);
-	User::LeaveIfError(iScrDev->GetNearestFontToDesignHeightInPixels(iFont,fontSpec));
-	iGc->UseFont(iFont);
-	iFlags|=eFontSet;
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TInt fontHeight=iFont->HeightInPixels();
-	iDrawRect.iTl.iY=(iScrSize.iHeight-fontHeight)/2;
-	iDrawRect.SetHeight(fontHeight);
-	iDrawHeight=iFont->AscentInPixels();
-	TSize winSize(25,20);
-	iWin2=new(ELeave) CTBlankWindow;
-	iWin2->ConstructL(*TheClient->iGroup);
-	iWin2->SetExt(TPoint((iScrSize.iWidth-winSize.iWidth)/2,(iScrSize.iHeight-winSize.iHeight)/2),winSize);
-	iWin2->SetColor(TRgb::Gray4(2));
-	iWin2->BaseWin()->Activate();
-	INFO_PRINTF1(_L(" Setup Window"));
-	iScrDev->Update();
-	TheClient->iWs.Finish();
-	
-	User::LeaveIfError(iControlSem.CreateGlobal(SemControl,0,KOwnerType));
-	User::LeaveIfError(iControlQueue.CreateGlobal(QueueControl,1,sizeof(TInt),KOwnerType));
-
-	iFlags|=eDirectControlSem;
-	User::LeaveIfError(iWinSem.CreateGlobal(SemNextOp,0,KOwnerType));
-	iFlags|=eDirectWindowSem;
-	iProcess=CProcess::NewTL(CProcess::eProcessDirectTest,iTest->iScreenNumber,&iThreadStatus);
-	INFO_PRINTF1(_L(" Constructed Semaphores & Thread"));
-	iControlSem.Wait();	
-	
-	iTimer=CPeriodic::NewL(iTest->EAutoTestPriority);
-	iRestart=CIdle::NewL(iTest->EAutoTestPriority+5);
-	iDirect=CDirectScreenAccessOld::NewL(TheClient->iWs,*this);
-	}
-
-void CTDirect::DestroyAnimation()
-	{
-	ResetScreenSizeMode();
-	if(iProcess && iProcess->StillAlive())
-		{
-		if (iFlags&eDirectControlSem)
-			{
-			iControlSem.Signal();
-			TInt data = 3;
-			iControlQueue.Send(&data,sizeof(TInt));
-			}
-		if (iFlags&eDirectWindowSem)
-			iWinSem.Signal();
-		}
-	
-	delete iTimer;
-	iTimer=NULL;
-	delete iRestart;
-	iRestart=NULL;
-	delete iDirect;
-	iDirect=NULL;
-	delete iChangeScreenModeTimer;
-	iChangeScreenModeTimer=NULL;
-	delete iScreenModeTimer;
-	iScreenModeTimer=NULL;
-	
-	if (iFlags&eFontSet)
-		{
-		iGc->DiscardFont();
-		iScrDev->ReleaseFont(iFont);
-		}
-	delete iGc;
-	if (iDrawingRegion)
-		iDrawingRegion->Destroy();
-	delete iScrDev;
-	delete iWin;
-	delete iWin2;
-	if (iProcess)
-		{
-		User::WaitForRequest(iThreadStatus);
-		delete iProcess;
-		iProcess = NULL;
-		}
-	if (iFlags&eDirectControlSem)
-		{
-		iControlSem.Close();
-		iControlQueue.Close();
-		}
-	if (iFlags&eDirectWindowSem)
-		iWinSem.Close();
-	}
-
-void CTDirect::ResetScreenSizeMode()
-	{
-	if (iModeBackup!=ESizeEnforcementNone)
-		{
-		TheClient->iScreen->SetScreenModeEnforcement(ESizeEnforcementNone);
-		iModeBackup=ESizeEnforcementNone;
-		}
-	TheClient->iScreen->SetCurrentRotations(0,CFbsBitGc::EGraphicsOrientationNormal);
-	TheClient->iScreen->SetScreenMode(0);
-	TPixelsAndRotation pixelsAndRotation;
-	TheClient->iScreen->GetDefaultScreenSizeAndRotation(pixelsAndRotation);
-	TheClient->iScreen->SetScreenSizeAndRotation(pixelsAndRotation);
-	User::After(350000);		//0.35secs
-	}
-
-void CTDirect::ScanTypeFacesL()
-	{
-	CFbsScreenDevice* scrdev=CFbsScreenDevice::NewL(iTest->iScreenNumber,EGray4);
-	TTypefaceSupport typeFace;
-	TInt numFaces=scrdev->NumTypefaces();
-	TInt ii;
-	for (ii=0;ii<numFaces;++ii)
-		{
-		scrdev->TypefaceSupport(typeFace,ii);
-		}
-	delete scrdev;
-	}
-
-TInt RestartAnimation(TAny* aTest)
-	{
-	STATIC_CAST(CTDirect*,aTest)->Restart();
-	return(KErrNone);
-	}
-
-TInt NextFrame(TAny* aTest)
-	{
-	STATIC_CAST(CTDirect*,aTest)->DrawFrame();
-	return(KErrNone);
-	}
-
-void CTDirect::AbortNow(RDirectScreenAccess::TTerminationReasons aReason)
-	{
-	TEST(aReason==RDirectScreenAccess::ETerminateRegion);
-	
-	if (iDelay)
-		User::After(2000000);		//2 secs
-	if (iCancelNext)
-		{
-		iFrameNo=eDirectNumFrames;
-		iTimer->Cancel();	
-		iDirect->Cancel();
-		TheClient->Flush();
-		iNextFrameFinished = ETrue;
-		iState++;
-		return;
-		}
-	iRestart->Start(TCallBack(RestartAnimation,this));
-	}
-
-TBool CTDirect::Restart()
-	{
-	StartDirect();
-	return ETrue;
-	}
-
-#pragma warning( disable : 4244 )	//conversion from 'int' to 'unsigned short', possible loss of data
-TBool CTDirect::DrawFrame()
-	{
-	if (iFrameNo==eDirectNumFrames)
-		{
-		iState++;
-		iTimer->Cancel();
-		if (iFrameNo==eDirectNumFrames)
-			iDirect->Cancel();
-		iNextFrameFinished = ETrue;
-		return EFalse;
-		}
-	_LIT(Text,"A0");
-	TBuf<2> iString(Text);		//_LIT(Text,"ABCabc123");
-	iString[0]+=iFrameNo;
-	iString[1]+=iFrameNo;
-	TInt textWidth=iFont->TextWidthInPixels(iString);
-	TInt maxTextWidth=Max(textWidth,iLastTextWidth);
-	iLastTextWidth=textWidth;
-	if (iLastMaxTextWidth!=maxTextWidth)
-		{
-		iLastMaxTextWidth=maxTextWidth;
-		iDrawRect.iTl.iX=(iScrSize.iWidth-iLastMaxTextWidth)/2;
-		iDrawRect.SetWidth(iLastMaxTextWidth);
-		}
-	TInt colorOffset=iFrameNo%2;
-	iGc->SetPenColor(TRgb::Gray4(colorOffset));
-	iGc->DrawText(iString,iDrawRect,iDrawHeight,CGraphicsContext::ECenter);
-	iGc->SetPenColor(TRgb::Gray4(1+colorOffset));
-	iGc->DrawLine(TPoint(),iScrSize.AsPoint());
-	iGc->DrawLine(TPoint(iScrSize.iWidth,0),TPoint(0,iScrSize.iHeight));
-	iGc->DrawLine(TPoint(iScrSize.iWidth/2,0),TPoint(iScrSize.iWidth/2,iScrSize.iHeight));
-	iGc->DrawLine(TPoint(0,iScrSize.iHeight/2),TPoint(iScrSize.iWidth,iScrSize.iHeight/2));
-	iScrDev->Update();
-	++iFrameNo;
-	if (iFrameNo==iFrameToSignalAfter)
-		SignalWindow();
-	return ETrue;
-	}
-#pragma warning( default : 4244 )
-
-void CTDirect::SignalWindow()
-	{
-	switch(iState)
-		{
-	case 0:
-		switch(iFrameNo)
-			{
-		case 0:
-			iFrameToSignalAfter=0;
-			}
-		return;
-	case 1:
-	case 3:
-		switch(iFrameNo)
-			{
-		case 0:
-			iFrameToSignalAfter=3;
-			iDelay=(iState==3);
-			return;
-		case 3:
-			WinExt.SetSize(TSize(iScrSize.iWidth/2-5,iScrSize.iHeight/2+30));
-			iFrameToSignalAfter=5;
-			break;
-		case 5:
-			iFrameToSignalAfter=7;
-			break;
-		case 7:
-			WinExt.SetSize(TSize(iScrSize.iWidth/2+30,iScrSize.iHeight/2-5));
-			WinCol=1;
-			iFrameToSignalAfter=8;
-			break;
-		case 8:
-			iFrameToSignalAfter=0;
-			iDelay=EFalse;
-			break;
-			}
-		break;
-	case 2:
-		switch(iFrameNo)
-			{
-		case 0:
-			iFrameToSignalAfter=2;
-			return;
-		case 2:
-			WinExt.SetRect(TPoint(iScrSize.iWidth/2-15,iScrSize.iHeight/2-20),TSize(iScrSize.iWidth/3,iScrSize.iHeight/3));
-			WinCol=2;
-			iFrameToSignalAfter=5;
-			break;
-		case 5:
-			iFrameToSignalAfter=6;
-			break;
-		case 6:
-			WinExt.SetRect(TPoint(iScrSize.iWidth/2-50,iScrSize.iHeight/3),TSize(iScrSize.iWidth/4,iScrSize.iHeight/3));
-			WinCol=3;
-			iFrameToSignalAfter=8;
-			break;
-		case 8:
-			iFrameToSignalAfter=0;
-			break;
-			}
-		break;
-	case 4:
-		switch(iFrameNo)
-			{
-		case 0:
-			iFrameToSignalAfter=3;
-			return;
-		case 3:
-			iFrameToSignalAfter=6;
-			iWin2->SetVisible(EFalse);
-			TheClient->Flush();
-			return;
-		case 6:
-			iFrameToSignalAfter=0;
-			iWin2->SetVisible(ETrue);
-			TheClient->Flush();
-			return;
-			}
-		break;
-	case 5:
-		switch(iFrameNo)
-			{
-		case 0:
-			iFrameToSignalAfter=6;
-			return;
-		case 6:
-			iFrameToSignalAfter=0;
-			WinExt.SetRect(10,10,20,20);
-			iCancelNext=ETrue;
-			break;
-			}
-		break;
-	case 6:
-		switch(iFrameNo)
-			{
-		case 0:
-			iFrameToSignalAfter=7;
-			iCancelNext=EFalse;
-			return;
-		case 7:
-			iFrameToSignalAfter=0;
-			delete iWin;
-			TheClient->Flush();
-			iWin=NULL;
-			iWindowDead=ETrue;
-			return;
-			}
-		break;
-		}
-#if defined(LOGGING)
-	_LIT(KSignal,"Signaling Move Window");
-	LogMessageText.Copy(KSignal);
-	TheClient->iWs.LogMessage(LogMessageText);
-	TheClient->Flush();
-#endif
-	iWinSem.Signal();
-	}
-
-void CTDirect::StartDirect()
-	{
-	if (iWin==NULL)
-		{
-		TEST(iWindowDead);
-		if (!iWindowDead)
-			INFO_PRINTF3(_L("iWindowDead - Expected: %d, Actual: %d"), ETrue, iWindowDead);		
-	
-		iFrameNo=eDirectNumFrames;
-		return;
-		}
-	TEST(!iWindowDead);
-	if (iWindowDead)
-		INFO_PRINTF3(_L("iWindowDead - Expected: %d, Actual: %d"), EFalse, iWindowDead);		
-
-	if (iDrawingRegion)
-		iDrawingRegion->Destroy();
-	TInt retVal = iDirect->Request(iDrawingRegion,*iWin->BaseWin());
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("iDirect->Request(iDrawingRegion,*iWin->BaseWin()) return value - Expected: %d, Actual: %d"), KErrNone, retVal);		
-
-	iGc->SetClippingRegion(iDrawingRegion);
-	}
-
-void CTDirect::LogLeave(TInt aErr)
-	{
-	iTest->LogLeave(aErr);
-	}
-
-void CTDirect::Fail()
-	{
-	TEST(EFalse);
-	}
-
-void CTDirect::Finished(TInt aId)
-	{
-	//aId refers to the animation, it is not the test number
-	_LIT(KCTDirectFinished,"Destroying animation number %d");
-	LOG_MESSAGE2(KCTDirectFinished,aId);
-	switch (aId)
-		{
-	case 10:
-	case 11:
-		ResetScreenSizeMode();
-	case 9:
-		iPackagingFinished = ETrue;
-	case 8:
-		DeleteMoveWindow();
-		//iPackagingFinished = ETrue;
-		if (iScroll)
-			{
-			DeleteScroll();
-		#if defined(LOGGING)
-			_LIT(KDeleteScroll,"Deleting Scroll Text  Id=%d  TimerActive=%d");
-			LogMessageText.Zero();
-			LogMessageText.AppendFormat(KDeleteScroll,aId,iAnim->IsTimerActive());
-			TheClient->iWs.LogMessage(LogMessageText);
-			TheClient->Flush();
-		#endif
-			}
-		if (aId==8  && iAnim->IsTimerActive())
-			return;
-	case 1:
-	case 12:
-	case 25:	//case DSA using Region tracking Only (abort signal expceted)
-	case 26:	//case DSA using Region tracking Only (abort signal not expceted)
-		{
-		iPackagingFinished = ETrue;
-		delete iAnim;
-		iAnim=NULL;
-CHECKHANDLES:
-		TInt numProcessHandles;
-		TInt numThreadHandles;
-		RThread().HandleCount(numProcessHandles,numThreadHandles);
-		TEST(Abs(numThreadHandles-iNumThreadHandles)<2);
-		if (Abs(numThreadHandles-iNumThreadHandles)>=2)
-			INFO_PRINTF3(_L("Abs(numThreadHandles-iNumThreadHandles)<2 - Expected: %d or less, Actual: %d"), 2, Abs(numThreadHandles-iNumThreadHandles));		
-		}
-		break;
-	case 16:
-	case 15:	
-		{		
-		// Stop the animation and delete it, but make sure that you don't increment iState and call Rquest()
-		// until this is the second call i.e. one of aId = 15 or aId = 16 has already been finished.
-		TInt index = aId-15;
-		iAnims[index]->Stop();
-		delete iAnims[index];
-		iAnims[index]=NULL;
-		// This test creates two animations iAnims[0] and iAnims[1].
-		// Use (index ^ 1 ) = Toggle the Index, to get the index of other animation.
-		// If iAnims [ index ^ 1] is NULL then this is the second Call and test is finished.
-		if (iAnims[index ^ 1] != NULL)
-			{
-			return;
-			}
-		iPackagingFinished = ETrue;
-		goto CHECKHANDLES;
-		}
-	case 13:
-		{
-		iPackagingFinished = ETrue;
-		delete iBlankTopClientWin1;
-	//	delete iBlankTopClientWin2;
-		TInt jj;
-		for (jj=0;jj<4;++jj)
-			iAnims[jj]->Stop();
-		for (jj=0;jj<4;++jj)
-			delete iAnims[jj];
-		break;
-		}
-	case 14:
-		{
-		iPackagingFinished = ETrue;
-		iAnims[0]->Stop();
-		delete iAnims[0];
-		if (iNumOfModes==iCurrentMode)
-			{
-			ResetScreenSizeMode();
-			iCallBackWin->SetVisible(EFalse);
-			break;
-			}
-		break;
-		}
-	case 18:
-	case 17:
-		{
-		// Stop the animation and delete it, but make sure that you don't increment iState and call Rquest()
-		// until this is the second call i.e. one of aId = 17 or aId = 18 has already been finished.
-		TInt ii = 0;
-		TBool finished = ETrue;
-		if (aId == 17)
-			{
-			iAnims[0]->Stop();
-			delete iAnims[0];
-			iAnims[0] = NULL;
-			for (ii=1;ii<=iNumAnimation;++ii)
-				{
-				 if (iAnims[ii])
-				 	{
-				 	finished = EFalse;
-				 	break;
-				 	}
-				}
-			}
-		else // aId == 18
-			{
-			for (ii=1;ii<=iNumAnimation;++ii)
-				{
-				iAnims[ii]->Stop();
-				delete iAnims[ii];
-				iAnims[ii] = NULL;
-				}
-			if (iAnims[0])
-			 	{
-			 	finished = EFalse;
-			 	}	
-			}
-		if (!finished)
-			{
-			return;
-			}
-		iPackagingFinished = ETrue;
-		break;
-		}
-	case 19:
-		{
-		iPackagingFinished = ETrue;
-		iAnims[0]->Stop();
-		delete iAnims[0];
-		break;
-		}
-	case 21:
-	case 20:
-		{	
-		// Stop the animation and delete it, but make sure that you don't increment iState and call Rquest()
-		// until this is the second call i.e. one of aId = 20 or aId = 21 has already been finished.
-		TInt index = aId-20;
-		iAnims[index]->Stop();
-		delete iAnims[index];
-		iAnims[index]=NULL;
-		// This test creates two animations iAnims[0] and iAnims[1].
-		// Use (index ^ 1 ) = Toggle the Index, to get the index of other animation.
-		// If iAnims [ index ^ 1] is NULL then this is the second Call and test is finished.
-		if (iAnims[index ^ 1] != NULL)
-			{
-			return;
-			}
-		DeleteMoveWindow();
-		iPackagingFinished = ETrue;
-		goto CHECKHANDLES;
-		}		//unreachable line, no need for break
-	case 24:
-		iPackagingFinished = ETrue;
-		iAnim->Stop();
-		delete iAnim;
-		iAnim=NULL;
-		//don't want to increase state, so decrement, since it is incremented below
-		//as part of processing normal completions.  This is to reenter the test
-		//to call Fail() if required
-		iState--;
-		break;
-	
-	case 27:
-	case 28:
-	case 29:
-	case 30:
-	case 31:
-	case 32:
-		iAnims[aId-27]->Stop();
-		delete iAnims[aId-27];
-		iAnims[aId-27] = NULL;
-		if(aId != 32)
-			{
-			return;
-			}
-		DeleteMoveWindow();
-		iPackagingFinished = ETrue;
-		break;
-	default:
-		iPackagingFinished = ETrue;
-		TInt ii;
-		for (ii=0;ii<6;++ii)
-			iAnims[ii]->Stop();
-		for (ii=0;ii<6;++ii)
-			delete iAnims[ii];
-		DeleteMoveWindow();
-		break;
-		}
-#if defined(LOGGING)
-	_LIT(KRequest,"Signal Start NextTest  Id=%d, State=%d(+1)");
-	LogMessageText.Zero();
-	LogMessageText.AppendFormat(KRequest,aId,iState);
-	TheClient->iWs.LogMessage(LogMessageText);
-	TheClient->Flush();
-#endif
-	iState++;
-	}
-
-void CTDirect::DeleteMoveWindow()
-	{
-	if (iMoveWin)
-		{
-		TRequestStatus status;
-		iMoveWin->Logon(status);
-		if (iMoveWin->StillAlive())
-			{
-			iMoveWin->Terminate(KErrNone);
-			User::WaitForRequest(status);
-			}
-		delete iMoveWin;
-		iMoveWin=NULL;
-		}
-	}
-
-void CTDirect::DeleteScroll()
-	{
-	if (iScroll)
-		{
-		TheClient->iScreen->SetScreenMode(0);
-		iScroll->Stop();
-		delete iScroll;
-		iScroll=NULL;
-		}
-	}
-
-TDisplayMode CTDirect::DisplayMode(TInt aId)
-	{
-	switch (aId)
-		{
-	case 1:
-	case 13:
-	case 15:
-	case 16:
-		return EColor16;
-	case 2:
-		return EGray16;
-	case 3:
-		return EColor16;
-	case 4:
-	case 14:
-	case 17:
-	case 18:
-	case 19:
-	case 24:
-		return EColor256;
-	case 5:
-		return EGray256;
-	case 6:
-		return EColor4K;
-	case 7:
-		return EColor64K;
-	case 8:
-	case 9:
-	case 10:
-	case 11:
-	case 12:
-		{
-		TInt colors,grays;
-		/*TDisplayMode mode=*/TheClient->iWs.GetDefModeMaxNumColors(colors,grays);
-		if (colors==0)
-			return EGray4;
-		return (aId==8? EGray16:EColor16);
-		}
-	default:;
-		return TheClient->iScreen->DisplayMode();
-		}
-	}
-
-void CTDirect::Log(const TText8* aFile, TInt aLine, TInt aSeverity,const TDesC& aString)
-	{
-	Logger().LogExtra(((TText8*)aFile), aLine, aSeverity, aString) ;
-	}
-
-TRgb CTDirect::BrushColorL(TInt aId,TInt& aColor,TBool& aFinished)
-	{
-	aFinished=EFalse;
-	switch (aId)
-		{
-	case 1:
-	case 13:
-	case 14:
-	case 15:
-	case 16:
-	case 17:
-	case 18:
-	case 19:
-	case 20:
-	case 21:
-	case 27:
-		aFinished=(aColor==20);
-		return TRgb::Color16(27 + aColor++);
-	case 28:
-		aFinished=(aColor==17);
-		return TRgb::Color16(28 + aColor++);
-	case 29:
-		aFinished=(aColor==15);
-		return TRgb::Color16(29 + aColor++);
-	case 8:
-		if (aColor==15)
-			{
-			++iCycles;
-			aFinished=(iCycles==5);
-			}
-		else if (!iScroll)
-			aFinished=ETrue;
-		else if (!iScroll->IsRunning())
-			iScroll->ContinueL();
-		{
-	#if defined(LOGGING)
-		if (aFinished || iScroll==NULL)
-			{
-			_LIT(KColor,"Col=%d Cycles=%d Fin=%d  iScroll=%d");
-			LogMessageText.Zero();
-			LogMessageText.AppendFormat(KColor,aColor,iCycles,aFinished,(TInt&)iScroll);
-			TheClient->iWs.LogMessage(LogMessageText);
-			TheClient->Flush();
-			}
-	#endif
-		}
-	case 2:
-		if (aColor==16)
-			aColor=0;
-		return TRgb::Gray16(aColor++);
-	case 9:
-	case 10:
-		aFinished=iCycles>3;
-	case 11:
-	case 3:
-		if (aColor==16)
-			{
-			++iCycles;
-			aColor=0;
-			}
-		return TRgb::Color16(aColor++);
-	case 4:
-		aFinished=(aColor==256);
-		return TRgb::Color256(aColor++);
-	case 5:
-		if (aColor==256)
-			aColor=0;
-		return TRgb::Gray256(aColor++);
-	case 6:
-		aColor+=127;
-		if (aColor>4095)
-			aColor-=4096;
-		return TRgb::Color4K(aColor);
-	case 7:
-		aColor+=211;
-		if (aColor>65535)
-			aColor-=65536;
-		return TRgb::Color64K(aColor++);
-	case 12:
-		aFinished=2*(aColor>5);
-		return TRgb::Color16(aColor++);
-	case 24:
-		iCycles++;
-		if (iCycles==5)
-			{
-			aFinished=ETrue;
-			CheckForTemporaryDeadlock();
-			}
-		return TRgb::Color16(aColor++);
-	case 30:
-		aFinished=(aColor==256);
-		return TRgb::Color16(aColor++);
-	case 31:
-		aFinished=(aColor==100);
-		return TRgb::Color16(aColor++);
-	case 32:
-		aFinished=(aColor==300);
-		return TRgb::Color16(aColor++);
-	default:;
-		aFinished=ETrue;
-		return TRgb::Gray2(1);		//White
-		}
-	}
-
-TInt CTDirect::TimerInterval(TInt aId)
-	{
-	switch (aId)
-		{
-	case 1:
-	case 15:
-	case 16:
-	case 17:
-	case 18:
-	case 20:
-	case 21:
-		return 143200;
-	case 27:	
-		return 200000;
-	case 28:
-		return 180000;
-	case 29:
-		return 170000;
-	case 30:
-		return 200000;
-	case 31:
-		return 205000;
-	case 32:
-		return 300000;
-	case 2:		
-	case 25:
-	case 26:
-		return 234567;
-	case 3:
-		return 200000;
-	case 4:
-		return 11718;
-	case 5:
-		return 13719;
-	case 6:
-		return 14719;
-	case 7:
-		return 15719;
-	case 8:
-		return 275000;
-	case 9:
-		return 210000;
-	case 10:
-		return 110000;
-	case 11:
-		return 123456;
-	case 12:
-		return 10627;
-	case 19:
-		return 1000000;
-	default:;
-		return 1;
-		}
-	}
-
-void CTDirect::FailedReStart(TInt /*aId*/,TInt /*aReason*/)
-	{
-	Fail();
-	}
-
-TInt CTDirect::SlowStopping(TInt aId,TInt aCount)
-	{
-	if (aId==8)
-		return (aCount>1 ? CColorAnimation::eAbortAll : CColorAnimation::eStopNow);
-	if (aId==9 || aId==10)
-		return CColorAnimation::eStopNow;
-	TInt ret=(2*aId-3==aCount%12);
-	if (ret && aId==5)
-		{
-		++iCount;
-		if (iCount==5)
-			return CColorAnimation::eAbort;
-		}
-	return ret;
-	}
-
-void CTDirect::ModeSwitch()
-	{
-	TRAPD(err,iAnim->ChangeModeL(EGray4));
-	iWin2->SetSize(TSize(20,25));
-	TheClient->Flush();
-	if (err!=KErrNone)
-		Fail();
-	}
-
-TestState CTDirect::AnimateWindowL()
-	{
-//	if (!iTimer->IsActive())
-	{
-		
-	
-	iFrameNo=0;
-	SignalWindow();
-	
-	
-		iTimer->Start(0,200000,TCallBack(NextFrame,this));		//0.2 secs
-
-	StartDirect();
-	TEST(iDrawingRegion->BoundingRect()==iScrSize);
-	}
-//	else
-//	{
-//		int i=0;
-//	}
-	return EWait;
-	}
-
-TestState CTDirect::AnimationDiesL()
-	{
-	INFO_PRINTF1(_L("AUTO  Animation Dies "));
-	_LIT(ThreadName,"AnimationDie");
-	iFirstFunction=TThreadStartUp(CAnimating::StartLC,(TAny*)iTest->iScreenNumber);
-	CProcess* thread=CProcess::NewThreadL(ThreadName,&iFirstFunction);
-	CleanupStack::PushL(thread);
-	thread->LeaveIfDied();
-	INFO_PRINTF1(_L(" Constructed Thread"));
-	iControlSem.Wait();
-	RWindowGroup group(TheClient->iWs);
-	group.Construct(431,EFalse);
-	RBlankWindow win(TheClient->iWs);
-	win.Construct(group,432);
-	win.SetExtent(TPoint(12,34),TSize(56,78));
-	win.Activate();
-	INFO_PRINTF1(_L(" Constructed Windows"));
-	iControlSem.Wait();
-	User::After(1000000);		//1 sec
-	TRequestStatus threadDied;
-	thread->Logon(threadDied);
-	thread->Terminate(KErrGeneral);
-	INFO_PRINTF1(_L(" Waiting for Thread"));
-	User::WaitForRequest(threadDied);
-	CleanupStack::PopAndDestroy(thread);
-	win.Close();
-	group.Close();
-	INFO_PRINTF1(_L(" Finished"));
-	return ENext;
-	}
-
-TestState CTDirect::PackagingClassL()
-	{
-	ConstrucBlankWindowL();
-	TInt numProcessHandles;
-	RThread().HandleCount(numProcessHandles,iNumThreadHandles);
-	iAnim=CColorAnimation::NewL(iTest->iScreenNumber,1,*this,*TheClient->iGroup,TRect(10,10,630,230),ETrue);
-	return EWait;
-	}
-
-TestState CTDirect::MultipleL()
-	{
-	TSize scrSize=TheClient->iScreen->SizeInPixels();
-	
-	iFlags|=eMultiAnim;
-	iAnims[0]=CColorAnimation::NewL(iTest->iScreenNumber,2,*this,*TheClient->iGroup,
-									TRect(0,10,scrSize.iWidth/3+20,scrSize.iHeight/2-5),EFalse);
-	iAnims[1]=CColorAnimation::NewL(iTest->iScreenNumber,3,*this,*TheClient->iGroup,
-									TRect(10,scrSize.iHeight/2-20,scrSize.iWidth/3-5,scrSize.iHeight),EFalse);
-	iAnims[3]=CColorAnimation::NewL(iTest->iScreenNumber,5,*this,*TheClient->iGroup,
-									TRect(scrSize.iWidth/3-20,scrSize.iHeight/2+5,2*scrSize.iWidth/3+20,scrSize.iHeight-10),EFalse);
-	iAnims[2]=CColorAnimation::NewL(iTest->iScreenNumber,4,*this,*TheClient->iGroup,
-									TRect(scrSize.iWidth/3+5,0,2*scrSize.iWidth/3-5,scrSize.iHeight/2+20),EFalse);
-	iAnims[4]=CColorAnimation::NewL(iTest->iScreenNumber,6,*this,*TheClient->iGroup,
-									TRect(2*scrSize.iWidth/3-20,15,scrSize.iWidth,scrSize.iHeight/2+50),EFalse);
-	iAnims[5]=CColorAnimation::NewL(iTest->iScreenNumber,7,*this,*TheClient->iGroup,
-									TRect(2*scrSize.iWidth/3+5,-20,scrSize.iWidth-15,scrSize.iHeight+10),ETrue);
-	TInt ii;
-	for (ii=0;ii<5;++ii)
-		iAnims[ii]->StartL();
-	_LIT(ThreadName,"MoveWin");
-	
-	MoveInterval=100000;		//0.1 secs
-	ModeInterval=1200000;		//1.2 sec
-	ImmediateModeSwitch=EFalse;
-	iFirstFunction=TThreadStartUp(CMoveWindow::StartLC,(TAny*)iTest->iScreenNumber);
-	iMoveWin=CProcess::NewThreadL(ThreadName,&iFirstFunction);
-	return EWait;
-	}
-
-TestState CTDirect::MixDsaAndRegionTrackingOnlyL(TBool aWhoExitsLast)
-	{
-	TSize scrSize=TheClient->iScreen->SizeInPixels();
-	
-	iFlags|=eMultiAnim;
-	TUint firstRegionTrackinOnlyDsa = (aWhoExitsLast == KRegionTrackingOnlyDsaExistLast ? 0 : 3);
-	TUint firstDrawingDsa = (aWhoExitsLast == KDrawingDsaExistLast ? 0 : 3);
-	
-	//DSAs who use region tracking only
-	iAnims[firstRegionTrackinOnlyDsa]=CColorAnimation::NewL(iTest->iScreenNumber,firstRegionTrackinOnlyDsa+27,*this,*TheClient->iGroup,
-											TRect(10,scrSize.iHeight/2-20,scrSize.iWidth/3-5,scrSize.iHeight),EFalse,KRegionTrackingOnly);
-	iAnims[firstRegionTrackinOnlyDsa+1]=CColorAnimation::NewL(iTest->iScreenNumber,firstRegionTrackinOnlyDsa+28,*this,*TheClient->iGroup,
-											TRect(2*scrSize.iWidth/3-20,15,scrSize.iWidth,scrSize.iHeight/2+50),EFalse,KRegionTrackingOnly);
-	iAnims[firstRegionTrackinOnlyDsa+2]=CColorAnimation::NewL(iTest->iScreenNumber,firstRegionTrackinOnlyDsa+29,*this,*TheClient->iGroup,
-											TRect(2*scrSize.iWidth/3+5,-20,scrSize.iWidth-15,scrSize.iHeight+10),EFalse,KRegionTrackingOnly);
-	
-	//DSAs who actually draw
-	iAnims[firstDrawingDsa]=CColorAnimation::NewL(iTest->iScreenNumber,firstDrawingDsa+27,*this,*TheClient->iGroup,
-											TRect(0,10,scrSize.iWidth/3+20,scrSize.iHeight/2-5),EFalse,KDrawingDsa);
-	iAnims[firstDrawingDsa+1]=CColorAnimation::NewL(iTest->iScreenNumber,firstDrawingDsa+28,*this,*TheClient->iGroup,
-											TRect(scrSize.iWidth/3+5,0,2*scrSize.iWidth/3-5,scrSize.iHeight/2+20),EFalse,KDrawingDsa);
-	iAnims[firstDrawingDsa+2]=CColorAnimation::NewL(iTest->iScreenNumber,firstDrawingDsa+29,*this,*TheClient->iGroup,
-											TRect(scrSize.iWidth/3-20,scrSize.iHeight/2+5,2*scrSize.iWidth/3+20,scrSize.iHeight-10),EFalse,KDrawingDsa);
-	
-	TInt ii;
-	for (ii=0;ii<6;++ii)
-		{
-		if(iAnims[ii])
-			iAnims[ii]->StartL();
-		}
-		
-	_LIT(ThreadName,"MoveWin");
-	
-	MoveInterval=100000;		//0.1 secs
-	ModeInterval=1200000;		//1.2 secs
-	ImmediateModeSwitch=EFalse;
-	iFirstFunction=TThreadStartUp(CMoveWindow::StartLC,(TAny*)iTest->iScreenNumber);
-	iMoveWin=CProcess::NewThreadL(ThreadName,&iFirstFunction);
-	return EWait;
-	}
-
-TestState CTDirect::TryDifferentSupportedModesL()
-	{
-	
-	RWsSession session;
-	User::LeaveIfError(session.Connect());
-	CWsScreenDevice* device = new(ELeave) CWsScreenDevice(session);
-	CleanupStack::PushL(device);
-	User::LeaveIfError(device->Construct(iTest->iScreenNumber));
-	TUint numOfModes=device->NumScreenModes();
-	_LIT(KTryingCurrentMode,"Trying Mode = %d");
-	for(TUint currentMode =0; currentMode < numOfModes; currentMode++)
-		{
-		LOG_MESSAGE2(KTryingCurrentMode,currentMode);
-		device->SetScreenMode(currentMode);
-		TRAPD(err,iAnims[0]=CColorAnimation::NewL(iTest->iScreenNumber,4,*this,*TheClient->iGroup,
-										TRect(0,0,50,50),ETrue));
-		if(err!=KErrNone)
-			{
-			TEST(EFalse);
-			}
-		else
-			{
-			User::After(2000000);
-			iAnims[0]->Stop();
-			delete iAnims[0];
-			}
-		}
-	CleanupStack::PopAndDestroy(device);
-	session.Close();
-	iState++;
-	return EWait;
-	}
-
-
-TestState CTDirect::FailCodesL()
-	{
- 	__UHEAP_MARK;
-	TRequestStatus status;
-	RRegion region(TRect(0,0,10,10),1);
-	RRegion* pRegion=&region;
-	RDirectScreenAccess direct(TheClient->iWs);
-	User::LeaveIfError(direct.Construct());
-	RBlankWindow window(TheClient->iWs);
-	User::LeaveIfError(window.Construct(*TheClient->iGroup->WinTreeNode(),1234));
-	TInt err=direct.Request(pRegion,status,window);
-	TEST(err==KErrNone);
-	if (err!=KErrNone)
-		INFO_PRINTF3(_L("direct.Request(pRegion,status,window) return value - Expected: %d, Actual: %d"), KErrNone, err);		
-	TEST(pRegion!=NULL);
-	if (pRegion==NULL)
-		INFO_PRINTF3(_L("pRegion!=NULL - Expected: %d, Actual: %d"), 0, 0);		
-	pRegion->Destroy();
-	direct.Cancel();
-	User::WaitForRequest(status);
-	window.Activate();
-	window.SetOrdinalPosition(-2);
-	pRegion=&region;
-	err=direct.Request(pRegion,status,window);
-	TEST(err==KErrNone);
-	if (err!=KErrNone)
-		INFO_PRINTF3(_L("direct.Request(pRegion,status,window) return value - Expected: %d, Actual: %d"), KErrNone, err);		
-	TEST(pRegion!=NULL);
-	if (pRegion==NULL)
-		INFO_PRINTF3(_L("pRegion!=NULL - Expected: %d, Actual: %d"), 0, 0);		
-	pRegion->Destroy();
-	direct.Cancel();
-	User::WaitForRequest(status);
-#if defined(__WINS__)
-	// Loop over the allocations done.
-	// There is one allocating of the rectangle list and
-	// one of the region holding the list
-	for (TInt rate = 1; rate <= 2; rate++)
-		{
-		window.SetOrdinalPosition(0);
-		pRegion=&region;
-		TheClient->Flush();
-		__UHEAP_FAILNEXT(rate);
-		err=direct.Request(pRegion,status,window);
-		TEST(err==KErrNoMemory);
-		if (err!=KErrNoMemory)
-			INFO_PRINTF3(_L("direct.Request(pRegion,status,window) return value - Expected: %d, Actual: %d"), KErrNoMemory, err);		
-
-		TEST(pRegion==NULL);
-		if (pRegion!=NULL)
-			INFO_PRINTF3(_L("pRegion!=NULL - Expected: %d, Actual: %d"), 0, 0);		
-		}
-#endif
-	window.Close();
-	direct.Close();
-	region.Close();
-	__UHEAP_MARKEND;
-	return ENext;
-	}
-
-void CTDirect::ScrolingTextL(TInt aId,TRect aWinRect,TBool aStartThread,TInt aScreenMode/*=0*/)
-	{
-	INFO_PRINTF1(_L("AUTO  Construct ScrolingText "));
-	INFO_PRINTF1(_L(" Constructed Window"));
-	iCycles=0;
-	TInt numProcessHandles;
-	RThread().HandleCount(numProcessHandles,iNumThreadHandles);
-	iAnim=CColorAnimation::NewL(iTest->iScreenNumber,aId,*this,*TheClient->iGroup,aWinRect,EFalse);
-	iScroll=CScrollText::NewL(iTest->iScreenNumber,1,*TheClient->iGroup,5,EFalse);
-	INFO_PRINTF1(_L(" Constructed Text Scroller & Animation"));
-	iAnim->BringWindowToFront();
-	if (aStartThread)
-		{
-		_LIT(ThreadName,"MoveWin");
-		INFO_PRINTF1(_L(" About to constructed Thread"));
-		iFirstFunction=TThreadStartUp(CMoveWindow::StartLC,(TAny*)iTest->iScreenNumber);
-		__ASSERT_DEBUG(!iMoveWin,AutoPanic(EAutoPanicDirect));
-		iMoveWin=CProcess::NewThreadL(ThreadName,&iFirstFunction);
-		INFO_PRINTF1(_L(" Constructed Thread"));
-		}
-	if (aScreenMode>0)
-		{
-		TInt numScreenModes = TheClient->iScreen->NumScreenModes();
-		if (aScreenMode < numScreenModes)
-			TheClient->iScreen->SetScreenMode(aScreenMode);
-		else
-			LOG_MESSAGE(_L("WARNING: Failed to change screen mode"));
-			// We have to run the test anyway to avoid things going wrong later
-		}
-	iAnim->StartOrPanic();
-	iScroll->StartL();
-	INFO_PRINTF1(_L(" Constructed/Started"));
-#if defined(LOGGING)
-	_LIT(KStarted,"Finished StartUp ScrollText");
-	LogMessageText.Copy(KStarted);
-	TheClient->iWs.LogMessage(LogMessageText);
-	TheClient->Flush();
-#endif
-	}
-
-TestState CTDirect::ScrolingText1L()
-	{
-	MoveInterval=0;
-	ModeInterval=1200000;		//1.2 sec
-	ScrolingTextL(8,TRect(20,20,40,40),ETrue);
-	return EWait;
-	}
-
-TestState CTDirect::RClassL()
-	{
-#if defined(LOGGING)
-	_LIT(KRClass,"Starting Panic test on RClass");
-	LogMessageText.Zero();
-	LogMessageText.AppendFormat(KRClass);
-	TheClient->iWs.LogMessage(LogMessageText);
-	TheClient->Flush();
-#endif
-	TEST(iTest->TestWsPanicL(CPanicDirect::DoTestOnNewScheduler,EWservPanicDirectMisuse,1,(TAny*)iTest->iScreenNumber));
-#if defined(LOGGING)
-	_LIT(KPanic1,"Done First Panic");
-	LogMessageText.Zero();
-	LogMessageText.AppendFormat(KPanic1);
-	TheClient->iWs.LogMessage(LogMessageText);
-	TheClient->Flush();
-#endif
-#if defined(__WINS__)
-#if defined(LOGGING)
-	_LIT(KPanic2,"Doing 2 debug panics");
-	LogMessageText.Zero();
-	LogMessageText.AppendFormat(KPanic2);
-	TheClient->iWs.LogMessage(LogMessageText);
-	TheClient->Flush();
-#endif
-	TEST(iTest->TestW32PanicL(CPanicDirect::DoTestOnNewScheduler,EW32PanicDirectMisuse,2,(TAny*)iTest->iScreenNumber));
-	TEST(iTest->TestW32PanicL(CPanicDirect::DoTestOnNewScheduler,EW32PanicDirectMisuse,3,(TAny*)iTest->iScreenNumber));
-#endif
-#if defined(LOGGING)
-	_LIT(KPanicTest,"Trying Panic %d");
-	LogMessageText.Zero();
-	LogMessageText.AppendFormat(KPanicTest,4);
-	TheClient->iWs.LogMessage(LogMessageText);
-	TheClient->Flush();
-#endif
-	TEST(iTest->TestWsPanicL(CPanicDirect::DoTestOnNewScheduler,EWservPanicDirectMisuse,4,(TAny*)iTest->iScreenNumber));
-	TEST(iTest->TestW32PanicL(CPanicDirect::DoTestOnNewScheduler,EW32PanicDirectMisuse,5,(TAny*)iTest->iScreenNumber));
-	return ENext;
-	}
-
-TestState CTDirect::ScrolingText2L()
-	{
-	MoveInterval=81234;		//0.08 sec
-	ModeInterval=140123;		//0.14 sec
-	ImmediateModeSwitch=2;
-	ScrolingTextL(9,TRect(15,25,45,35),ETrue);
-	iScroll->SetCountDown(5);
-	return EWait;
-	}
-
-TestState CTDirect::ScrolingText3L()
-	{
-	iModeBackup=TheClient->iScreen->ScreenModeEnforcement();
-	if (iModeBackup!=ESizeEnforcementNone)
-		TheClient->iScreen->SetScreenModeEnforcement(ESizeEnforcementNone);
-	MoveInterval=0;
-	ModeInterval=0;
-	FlipInterval=1200000;		//1.2 secs
-	ScrolingTextL(10,TRect(25,30,35,45),ETrue,1);
-	iScroll->SetBottomOfTest(80);		//So it can be seen in both screen modes
-	return EWait;
-	}
-
-TestState CTDirect::ScrolingText4L()
-	{
-	iModeBackup=TheClient->iScreen->ScreenModeEnforcement();
-	if (iModeBackup!=ESizeEnforcementNone)
-		TheClient->iScreen->SetScreenModeEnforcement(ESizeEnforcementNone);
-	MoveInterval=876543;		//0.88 secs
-	ModeInterval=2178900;		//2.18 secs
-	FlipInterval=5000000;		//5 secs
-	ScrolingTextL(11,TRect(30,40,55,65),ETrue);
-	iScroll->SetBottomOfTest(80);		//So it can be seen in both screen modes
-	return EWait;
-	}
-
-void CTDirect::CreateAnimForScreenModeL(TInt aAnimIndex,CTWinBase& aParent,TRect aRect,TInt aId)
-	{
-	iAnims[aAnimIndex]=CColorAnimation::NewL(iTest->iScreenNumber,aId,*this,aParent,aRect,EFalse);
-	iAnims[aAnimIndex]->StartL();
-	iAnims[aAnimIndex]->BringWindowToFront();
-	}
-
-void CTDirect::BlankTopClientWindowL(CTBlankWindow& aBlankWindow,TRect aRect)
-	{
-	aBlankWindow.ConstructExtLD(*TheClient->iGroup,aRect.iTl,aRect.Size());
-	User::LeaveIfError(aBlankWindow.BaseWin()->SetRequiredDisplayMode(EColor256));
-	aBlankWindow.BaseWin()->SetShadowDisabled(ETrue);
-	aBlankWindow.Activate();
-	}
-
-static TInt ChangeScreenModeL(TAny* aTest)
-	{
-	STATIC_CAST(CTDirect*,aTest)->ChangeToNextScreenModeL();
-	return KErrNone;
-	}
-
-void CTDirect::ChangeToNextScreenModeL()
-	{
-#if defined(LOGGING)
-	_LIT(KChangeMode,"AUTO Screen Mode Pos Test2 CallBack");
-	LogMessageText.Copy(KChangeMode);
-	TheClient->LogMessage(LogMessageText);
-	TheClient->iWs.LogCommand(RWsSession::ELoggingStatusDump);
-#endif
-	iNumOfModes=TheClient->iScreen->NumScreenModes();
-	if (iCurrentMode<iNumOfModes)
-		{
-		TPixelsAndRotation pixelsAndRotation;
-		SetScreenMode(iCurrentMode,pixelsAndRotation);
-		TInt oldCurrentMode=iCurrentMode;
-		CArrayFixFlat<TInt>* rotations=new(ELeave) CArrayFixFlat<TInt>(1);
-		CleanupStack::PushL(rotations);
-		User::LeaveIfError(TheClient->iScreen->GetRotationsList(iCurrentMode,rotations));
-		TInt count=rotations->Count();
-		TInt jj=0;
-		if (count>1)
-			{
-			for (jj=0;jj<count;)
-				{
-				if ((*rotations)[jj++]==pixelsAndRotation.iRotation)
-					{
-					break;
-					}
-				}
-			if (jj==count)
-				{
-				jj=0;
-				}
-			}
-		if (jj==0)
-			{
-			iCurrentMode++;
-			}
-		TInt currentRotation=(*rotations)[jj];
-		TheClient->iScreen->SetCurrentRotations(oldCurrentMode,REINTERPRET_CAST(CFbsBitGc::TGraphicsOrientation&,currentRotation));
-		CleanupStack::PopAndDestroy(rotations);
-		TheClient->iScreen->GetScreenModeSizeAndRotation(oldCurrentMode,pixelsAndRotation);
-		TInt screenWidth=pixelsAndRotation.iPixelSize.iWidth;
-		TInt screenHeight=pixelsAndRotation.iPixelSize.iHeight;
-		TPoint screenModeOrigin=TheClient->iScreen->GetScreenModeScaledOrigin(oldCurrentMode);
-		TPoint point1(screenModeOrigin.iX,screenModeOrigin.iY+(screenModeOrigin.iY+screenHeight)/2);
-		TPoint point2(screenModeOrigin.iX+(screenModeOrigin.iX+screenWidth)/2,screenHeight+screenModeOrigin.iY);
-		TRect rect0(point1,point2);
-		TRect rect1(TPoint(0,0),rect0.Size());
-		CreateAnimForScreenModeL(0,*TheClient->iGroup,rect1,14);
-		TPoint pos=iAnims[0]->AbsoluteWindowPosition();
-		TEST(pos==TPoint(0,0));
-		}
-	}
-
-TInt ChangeScreenScaleCallBack(TAny* aTest)
-	{
-	static_cast<CTDirect*>(aTest)->ChangeScreenScale();
-	return KErrNone;
-	}
-
-void CTDirect::ChangeScreenScale()
-	{
-	if (!iNumOfCallBack)
-		{
-		iCurrentMode=TheClient->iScreen->CurrentScreenMode();
-		iModeData=TheClient->iScreen->GetCurrentScreenModeAttributes();
-		iModeData.iScreenScale.SetSize(1,1);
-		}
-	TSizeMode testMode=iModeData;
-	if (!iNumOfCallBack)
-		{
-		testMode.iScreenScale.SetSize(2,2);
-		}
-	else if (iNumOfCallBack==1)
-		{
-		testMode.iScreenScale.SetSize(3,2);
-		}
-	else if (iNumOfCallBack==2)
-		{
-		testMode.iScreenScale.SetSize(2,3);
-		}
-	TheClient->iScreen->SetCurrentScreenModeAttributes(testMode);
-	TheClient->iScreen->SetAppScreenMode(iCurrentMode);
-	TheClient->iScreen->SetScreenMode(iCurrentMode);
-	if (iNumOfCallBack==2)
-		{
-		iScreenModeTimer->Cancel();
-		delete iScreenModeTimer;
-		iScreenModeTimer=NULL;
-		}
-	iNumOfCallBack++;
-	}
-
-/*
- * Creates a DSA for screen mode 0. After DSA has displayd 2 or 3 frames screen mode
- * scale is changed with a timer. The DSA aborts and restarts once again
- * and completes itself in different screen mode.
- */
-TestState CTDirect::ScreenModeTestForScalingL()
-	{
-	CreateAnimForScreenModeL(0,*TheClient->iGroup,TRect(TSize(10,10)),19);
-	iScreenModeTimer=CPeriodic::NewL(0);
-	MoveInterval=2000000;
-	iScreenModeTimer->Start(1000,MoveInterval,TCallBack(ChangeScreenScaleCallBack,this));
-	return EWait;
-	}
-
-/*
- * Creates a DSA for screen mode 0, tests API AbsoluteWindowPosition()
- * Then sets screen mode to last(test) screen mode, here it does the same thing as
- * done for screenmode 0, but with diffrerent scale (2,2) (2,3) (3,2) (3,3) and
- * with different origin (20,30) (30,20) (20,20).
- * Lastly copy back the test screen mode values.
- */
-TestState CTDirect::ScreenModeScalingTestL()
-	{
-#if defined(LOGGING)
-INFO_PRINTF1("AUTO  ScreenModeScalingTest ");
-#else
-//	DisabledStartLogText();
-#endif
-INFO_PRINTF1(_L(" Switch to mode 0"));
-	iModeData.iScreenScale.iWidth=1;
-	iModeData.iScreenScale.iHeight=1;
-	TheClient->iScreen->SetCurrentScreenModeAttributes(iModeData);
-	TheClient->iScreen->SetAppScreenMode(0);
-	TheClient->iScreen->SetScreenMode(0);
-	iCurrentMode=0;
-INFO_PRINTF1(_L(" Get Parameters"));
-	iCurrentScreenModeOrigin=TheClient->iScreen->GetDefaultScreenModeOrigin();
-	iCurrentScreenModeScale=TheClient->iScreen->GetCurrentScreenModeScale();
-	Copy2ndHalfOfScreen=(iCurrentScreenModeOrigin.iX>FullScreenModeSize.iWidth/2? 1 : 0);
-	TRect testWinRect(PhysicalToLogical(TPoint(),iCurrentScreenModeScale),
-					  PhysicalToLogical(TPoint((Copy2ndHalfOfScreen ? FullScreenModeSize.iWidth :
-	                                                                  FullScreenModeSize.iWidth/2),
-										       FullScreenModeSize.iHeight)-
-										iCurrentScreenModeOrigin,iCurrentScreenModeScale)
-					 );
-	testWinRect.Shrink(10,10);
-INFO_PRINTF1(_L(" Create Animation"));
-	CreateAnimForScreenModeL(0,*TheClient->iGroup,testWinRect,17);
-	TPoint pos0=iAnims[0]->AbsoluteWindowPosition();
-	TEST(pos0==TPoint(10,10));
-
-	TInt numOfModes=TheClient->iScreen->NumScreenModes();
-	iCurrentMode=numOfModes-1;
-INFO_PRINTF1(_L(" Switch to Last Mode"));
-	TheClient->iScreen->SetAppScreenMode(iCurrentMode);
-	TheClient->iScreen->SetScreenMode(iCurrentMode);
-	TSizeMode storeModeData=TheClient->iScreen->GetCurrentScreenModeAttributes();
-	TSizeMode testMode=storeModeData;
-	iNumAnimation=0;
-	for (TInt xScale=2;xScale<4;xScale++)
-		{
-INFO_PRINTF1(_L(" New X-Scale"));
-		for (TInt yScale=2;yScale<4;yScale++)
-			{
-INFO_PRINTF1(_L(" New Y-Scale"));
-			testMode.iScreenScale=TSize(xScale,yScale);
-			TestDifferentOriginAndScaleL(testMode,TPoint(20,20));
-			TestDifferentOriginAndScaleL(testMode,TPoint(20,30));
-			TestDifferentOriginAndScaleL(testMode,TPoint(30,20));
-			}
-		}
-	TheClient->iScreen->SetScreenMode(iCurrentMode);
-	TheClient->iScreen->SetCurrentScreenModeAttributes(storeModeData);
-INFO_PRINTF1(_L(" Set To Mode 0"));
-	TheClient->iScreen->SetAppScreenMode(0);
-	TheClient->iScreen->SetScreenMode(0);
-	return EWait;
-	}
-
-void CTDirect::TestDifferentOriginAndScaleL(TSizeMode &aMode,TPoint aOrigin)
-	{
-	aMode.iOrigin=aOrigin;
-	TheClient->iScreen->SetCurrentScreenModeAttributes(aMode);
-	TheClient->iScreen->SetAppScreenMode(iCurrentMode);
-	TheClient->iScreen->SetScreenMode(iCurrentMode);
-	iCurrentScreenModeOrigin=TheClient->iScreen->GetScreenModeOrigin(iCurrentMode);
-	iCurrentScreenModeScale=TheClient->iScreen->GetScreenModeScale(iCurrentMode);
-	Copy2ndHalfOfScreen=(iCurrentScreenModeOrigin.iX>FullScreenModeSize.iWidth/2? 1 : 0);
-	TRect testWinRect(PhysicalToLogical(TPoint(),iCurrentScreenModeScale),
-					  PhysicalToLogical(TPoint((Copy2ndHalfOfScreen ? FullScreenModeSize.iWidth
-																	: FullScreenModeSize.iWidth/2),
-											   FullScreenModeSize.iHeight)
-										-iCurrentScreenModeOrigin,iCurrentScreenModeScale)
-					 );
-	testWinRect.Shrink(10,10);
-	++iNumAnimation;
-	CreateAnimForScreenModeL(iNumAnimation,*TheClient->iGroup,testWinRect,18);
-	TPoint pos0=iAnims[iNumAnimation]->AbsoluteWindowPosition();
-	TEST(pos0==TPoint(10,10));
-	}
-
-//REQUIREMENT: CR PHAR-5SJGAM, PREQ673
-//Tests that DSA works correctly in screen modes with non-zero screen mode origin.
-TestState CTDirect::DSAWithScreenModeOffset1L()
-	{
-	TPoint screenModeTwoOrigin=TheClient->iScreen->GetScreenModeScaledOrigin(2);
-	TPixelsAndRotation pixelsAndRotation;
-	TheClient->iScreen->GetScreenModeSizeAndRotation(2,pixelsAndRotation);
-	if(pixelsAndRotation.iRotation != CFbsBitGc::EGraphicsOrientationNormal)
-		{
-		TheClient->iScreen->SetCurrentRotations(2, CFbsBitGc::EGraphicsOrientationNormal);
-		}
-	TheClient->iScreen->GetScreenModeSizeAndRotation(2,pixelsAndRotation);
-	//check that the current rotation is normal
-	__ASSERT_DEBUG(pixelsAndRotation.iRotation==CFbsBitGc::EGraphicsOrientationNormal,AutoPanic(EAutoPanicDirect));
-	TInt screenWidthMode2=pixelsAndRotation.iPixelSize.iWidth;
-	TInt screenHeightMode2=pixelsAndRotation.iPixelSize.iHeight;
-	TPoint point1(screenModeTwoOrigin.iX,screenModeTwoOrigin.iY+(screenModeTwoOrigin.iY+screenHeightMode2)/2);
-	TPoint point2(screenModeTwoOrigin.iX+(screenModeTwoOrigin.iX+screenWidthMode2)/2,screenHeightMode2+screenModeTwoOrigin.iY);
-	TPoint point3(screenModeTwoOrigin.iX+screenWidthMode2,screenModeTwoOrigin.iY+screenHeightMode2);
-
-	SetScreenMode(0,pixelsAndRotation);
-	TRect rect0(point1,point2);
-	CreateAnimForScreenModeL(0,*TheClient->iGroup,rect0,13);
-	TPoint pos0=iAnims[0]->AbsoluteWindowPosition();
-	TEST(pos0==point1);
-
-	SetScreenMode(2,pixelsAndRotation);
-	TRect rect1(TPoint(0,0),rect0.Size());
-	CreateAnimForScreenModeL(1,*TheClient->iGroup,rect1,13);
-	TPoint pos1=iAnims[1]->AbsoluteWindowPosition();
-	TEST(pos1==rect1.iTl);
-
-	SetScreenMode(0,pixelsAndRotation);
-	iBlankTopClientWin1=new(ELeave) CTBlankWindow();
-//	TInt ordpos = iBlankTopClientWin1->BaseWin()->OrdinalPosition();
-	TRect rect2(TPoint(point2.iX,point1.iY),point3);
-	BlankTopClientWindowL(*iBlankTopClientWin1,rect2);
-	TInt x=rect2.Size().iWidth/4;
-	TPoint animWinPt(x,0);
-	rect2.Shrink(x,0);
-	CreateAnimForScreenModeL(2,*iBlankTopClientWin1,TRect(animWinPt,rect2.Size()),13);
-	TPoint pos2=iAnims[2]->AbsoluteWindowPosition();
-	TEST(pos2==rect2.iTl);
-
-	SetScreenMode(2,pixelsAndRotation);
-	iBlankTopClientWin2=new(ELeave) CTBlankWindow();
-//	ordpos = iBlankTopClientWin2->BaseWin()->OrdinalPosition();
-	TPoint tl(rect1.iBr.iX,0);
-	TRect rect3(tl,TPoint(screenWidthMode2,rect1.iBr.iY));
-	BlankTopClientWindowL(*iBlankTopClientWin2,rect3);
-	x=rect3.Size().iWidth/4;
-	animWinPt=TPoint(x,0);
-	rect3.Shrink(x,0);
-	CreateAnimForScreenModeL(3,*iBlankTopClientWin2,TRect(animWinPt,rect3.Size()),13);
-	TPoint pos3=iAnims[3]->AbsoluteWindowPosition();
-	TEST(pos3==(animWinPt+tl));
-
-	SetScreenMode(0,pixelsAndRotation);
-	return EWait;
-	}
-
-//REQUIREMENT: CR PHAR-5SJGAM, PREQ673
-//Tests that DSA works correctly in screen modes with non-zero screen mode origin and different rotations
-TestState CTDirect::DSAWithScreenModeOffset2L()
-	{
-	iCurrentMode=0;
-	TTimeIntervalMicroSeconds32 timeBetweenScreenModeChange=3200000;
-	iCallBackWin->WinTreeNode()->SetOrdinalPosition(0);
-	iCallBackWin->SetVisible(ETrue);		//Used to forsce screen into Color256 so that it will rotate
-	iChangeScreenModeTimer=CPeriodic::NewL(0);
-	iChangeScreenModeTimer->Start(0,timeBetweenScreenModeChange,TCallBack(ChangeScreenModeL,this));
-	return EWait;
-	}
-
-void CTDirect::SetScreenMode(TInt aMode,TPixelsAndRotation& aPixelsAndRotation)
-	{
-	TheClient->iScreen->SetScreenMode(aMode);
-	TheClient->iScreen->SetScreenModeEnforcement(ESizeEnforcementNone);
-	TheClient->iScreen->GetDefaultScreenSizeAndRotation(aPixelsAndRotation);
-	TheClient->iScreen->SetScreenSizeAndRotation(aPixelsAndRotation);
-	TheClient->Flush();
-	}
-
-TestState CTDirect::DefectFix_KAA_5J3BLW_L()
-	{
-	TInt numProcessHandles;
-	RThread().HandleCount(numProcessHandles,iNumThreadHandles);
-	const TSize screenSize(TheClient->iScreen->SizeInPixels());
-	const TRect dsaRect(0,0,screenSize.iWidth>>2,screenSize.iHeight>>2);
-	iAnim=CBugFixColorAnimation::NewL(iTest->iScreenNumber, 1, *this, *TheClient->iGroup, dsaRect,ETrue);
-	return EWait;
-	}
-
-TestState CTDirect::RegionTrackingOnlyNotificationsL(TUint aId)
-	{
-	TInt numProcessHandles;
-	RThread().HandleCount(numProcessHandles,iNumThreadHandles);
-	const TSize screenSize(TheClient->iScreen->SizeInPixels());
-	const TRect dsaRect(0,0,screenSize.iWidth>>2,screenSize.iHeight>>2);
-	TBool isWindowOpenedInFrontOfDsa = (aId == KRegionTrackingOnlyDsaWaitingForAbortSignal);
-	iAnim=CRegionTrackingOnly::NewL(iTest->iScreenNumber, aId, *this, *TheClient->iGroup, dsaRect,ETrue,isWindowOpenedInFrontOfDsa);
-	return EWait;
-	}
-
-// Tests the new function of getting the window's absolute position
-TestState CTDirect::WindowPoistionRelativeToScreenL()
-	{
-	//.. delete screen mode timer
-	delete iChangeScreenModeTimer;
-	iChangeScreenModeTimer=NULL;
-
-	TInt numProcessHandles;
-	RThread().HandleCount(numProcessHandles,iNumThreadHandles);
-	TSize screenSize(TheClient->iScreen->SizeInPixels());
-	TRect rect(0,0,screenSize.iWidth>>1,screenSize.iHeight);
-	rect.Shrink(10,10);
-	// First animation is for showing that child window is within the visible part of the parent window and within the visible screen area
-	iAnims[0]=new(ELeave) CColorAnimation(iTest->iScreenNumber,15,*this);
-	iAnims[0]->ConstructL(*TheClient->iGroup,rect,KDrawingDsa,1);
-	iAnims[0]->StartL(ETrue);
-	// First animation is for showing that child window is to the side of visible part of parent window
-	rect.Move(screenSize.iWidth>>1,0);
-	iAnims[1]=new(ELeave) CColorAnimation(iTest->iScreenNumber,16,*this);
-	iAnims[1]->ConstructL(*TheClient->iGroup,rect,KDrawingDsa,2);
-	iAnims[1]->StartL(ETrue);
-	return EWait;
-	}
-
-TestState CTDirect::MultipleDSAsOnSameWindowL()
-	{
-	TInt numProcessHandles;
-	RThread().HandleCount(numProcessHandles,iNumThreadHandles);
-	iCallBackWin->SetVisible(ETrue);
-	iCallBackWin->WinTreeNode()->SetOrdinalPosition(0);
-	iAnims[0]=new(ELeave) CColorAnimation(iTest->iScreenNumber,20,*this);
-	iAnims[0]->ConstructL(*TheClient->iGroup,TRect(),KDrawingDsa,0,1);
-	iAnims[0]->StartL();
-	iAnims[1]=new(ELeave) CColorAnimation(iTest->iScreenNumber,21,*this);
-	iAnims[1]->ConstructL(*TheClient->iGroup,TRect(),KDrawingDsa,0,2);
-	iAnims[1]->StartL();
-	_LIT(ThreadName,"MoveWin");
-	MoveInterval=100000;
-	ModeInterval=0;
-	FlipInterval=0;
-	ImmediateModeSwitch=EFalse;
-	iFirstFunction=TThreadStartUp(CMoveWindow::StartLC,(TAny*)iTest->iScreenNumber);
-	iMoveWin=CProcess::NewThreadL(ThreadName,&iFirstFunction);
-	return EWait;
-	}
-
-TestState CTDirect::KillAnimationL()
-	{
-	TInt numProcessHandles;
-	RThread().HandleCount(numProcessHandles,iNumThreadHandles);
-	iAnim=CColorAnimation::NewL(iTest->iScreenNumber,12,*this,*TheClient->iGroup,TRect(15,15,625,225),ETrue);
-	return EWait;
-	}
-
-TestState CTDirect::TemporaryDeadlockL()
-	{
-
-	if (iTestJustCompleted)
-		{
-			if (iTestJustFailed)
-			{
-			Fail();
-			}
-		iState++;
-		return ENext;
-		}
-
-	//make sure this code isn't called a second time
-	__ASSERT_ALWAYS(iAnim==NULL,AutoPanic(EAutoPanicDirect));
-
-	TSize screenSize(TheClient->iScreen->SizeInPixels());
-	TRect rect(0,0,screenSize.iWidth>>1,screenSize.iHeight);
-	rect.Shrink(10,10);
-	iAnim=new(ELeave) CColorAnimation(iTest->iScreenNumber,24,*this);
-	iAnim->ConstructL(*TheClient->iGroup,rect,KDrawingDsa,1);
-	iAnim->StartL(ETrue);
-	return EWait;
-	}
-
-void CTDirect::CheckForTemporaryDeadlock()
-	{
-
-	TBool result=ETrue;
-	TInt error;
-
-
-	//Create a window for placing on top
-	TTime beforeTime;
-	beforeTime.HomeTime();
-
-	RWindow window(TheClient->iWs);
-
-	error=window.Construct(*TheClient->iGroup->GroupWin(), reinterpret_cast<TInt>(&window));
-	if (error==KErrNone)
-		{
-		window.SetOrdinalPosition(0);
-		window.SetExtent(TPoint(30,30),TSize(10,10));
-		window.SetBackgroundColor(TRgb(255,0,255));
-
-		//make sure the basewin is towards the back
-		iCallBackWin->BaseWin()->SetOrdinalPosition(5);
-
-		window.SetRequiredDisplayMode(EColor256);
-		window.Activate();
-		TheClient->iWs.Flush();
-		//need code similar to below, but the status of the active object we
-		//really want is too private
-		//if (!iAnim->IsReadyToAbort())
-		//	{
-		//	result=EFalse;
-		//	}
-		window.Close();
-		}
-	else
-		{
-		result = EFalse;
-		}
-
-	TTime afterTime;
-	afterTime.HomeTime();
-	TTimeIntervalMicroSeconds difference = afterTime.MicroSecondsFrom(beforeTime);
-
-	//make time difference 350ms, since the two timers to be checked are 400ms and 500ms
-	if (difference>TTimeIntervalMicroSeconds(1000*350))
-		{
-		result=EFalse;
-		}
-
-	iTestJustCompleted = ETrue;
-	if (result==EFalse)
-		{
-		iTestJustFailed=ETrue;
-		}
-	}
-
-void CTDirect::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(Animation1,"Animating");
-	_LIT(Animation2,"Animating Dies");
-	_LIT(Animation3,"Packaging Class");
-	_LIT(Animation4,"Many Animations");
-	_LIT(Animation5,"Fail Codes");
-	_LIT(Animation6,"Cancel The Other");
-	_LIT(Animation7,"'R' Class API");
-	_LIT(Animation8,"Switch Clear Type");
-	_LIT(Animation9,"SizeMode Change");
-	_LIT(Animation10,"Soak Testing");
-	_LIT(Animation11,"Kill Animation");
-	_LIT(Animation12,"Defect-Fix: KAA-5J3BLW");
-	_LIT(Animation13,"Screen Mode Positioning DSA Test 1");
-	_LIT(Animation14,"Screen Mode Positioning DSA Test 2");
-	_LIT(Animation15,"Position Relative to Screen");
-	_LIT(Animation16,"Screen mode Scaling DSA Test 1");
-	_LIT(Animation17,"Screen mode Scaling DSA Test 2");
-	_LIT(Animation18,"Multiple DSAs on same window");
-	_LIT(Animation19,"DSA and windows temporary deadlock");
-	_LIT(Animation25,"RegionTrackingOnly DSA, window opened in front");
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-	_LIT(Animation26,"RegionTrackingOnly DSA, window opened behind");
-	_LIT(Animation27,"Mixed DSAs, RegionTrackingOnly DSA last to exit");
-	_LIT(Animation28,"Mixed DSAs, drawing DSA last to exit");
-	_LIT(Animation29,"Trying all the screen supported modes");
-#endif
-	TestState ret=ENext;
-
-	if (iTimerRunning && !iPackagingFinished)
-		{
-		// Prevent test harness from repeatedly running the test case too quickly.
-		User::After(SHORT_DELAY);
-		}
-
-	//if (iState==0) iState=18;
-	iTest->iState=iState;
-	((CTDirectStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(iState)
-		{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0158
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Create seven seperate animations and run them to completion
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Create animations and start them running. Run until the animations finish.
-
-@SYMTestExpectedResults The animation run to completion without error
-*/
-	case 0:
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0158"));
-		if (iNextFrameFinished)
-			InitialiseAnimationL();
-	case 1:
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0158"));
-	case 2:
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0158"));
-	case 3:
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0158"));
-	case 4:
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0158"));
-	case 5:
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0158"));
-	case 6:
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0158"));
-		if (iNextFrameFinished)
-			{
-			iTest->LogSubTest(Animation1);
-			ret=AnimateWindowL();
-			iNextFrameFinished=EFalse;
-			}
-		else
-			{
-			// Prevent test harness from repeatedly running the test case too quickly.
-			User::After(SHORT_DELAY);
-			}
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0159
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Check animation dies correctly when run in a thread
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Create animation and run in from a thread that dies. Once the thread
-					has died check the animation has been dealt with correctly.
-
-@SYMTestExpectedResults The animation dies correctly
-*/
-	case 7:
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0159"));
-		iTest->LogSubTest(Animation2);
-		ret=AnimationDiesL();
-		++iState;
-		DestroyAnimation();
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0160
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Check animation runs correctly in blank window
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Create an animation and run it in a blank window
-
-@SYMTestExpectedResults The animation runs to completion without error
-*/
-	case 8:
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0160"));
-		if (!iTimerRunning)
-			{
-			iTest->LogSubTest(Animation3);
-			ret=PackagingClassL();
-			iTimerRunning = ETrue;
-			}
-		if (iPackagingFinished)
-			{
-			iPackagingFinished = EFalse;
-			iTimerRunning = EFalse;
-			}
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0161
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Check many animations can be run in the same window
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Create multiple animations in a window and run them all
-					until completion
-
-@SYMTestExpectedResults The animations run without error
-*/
-	case 9:
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0161"));
-		if (!iTimerRunning)
-			{
-			iTest->LogSubTest(Animation4);
-			ret=MultipleL();
-			iTimerRunning = ETrue;
-			}
-		if (iPackagingFinished)
-			{
-			iPackagingFinished = EFalse;
-			iTimerRunning = EFalse;
-			}
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0162
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Direct screen access out of memory test
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Direct screen access out of memory test
-
-@SYMTestExpectedResults The out of memory error is handled correctly
-*/
-	case 10:
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0162"));
-		iTest->LogSubTest(Animation5);
-		ret=FailCodesL();
-		iState++;
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0163
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Two animations, one scrolling text
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Create two animations, one which scrolls text across the screen and
-					run them to completion
-
-@SYMTestExpectedResults The animations run without error
-*/
-	case 11:		
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0163"));
-		if (!iTimerRunning)
-			{
-			iTest->LogSubTest(Animation6);
-			ret=ScrolingText1L();
-			iTimerRunning = ETrue;
-			}
-		if (iPackagingFinished)
-			{
-			iPackagingFinished = EFalse;
-			iTimerRunning = EFalse;
-			}
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0164
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test direct screen access panic messages
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Call the direct screen access panic's and check they are handled
-					correctly
-
-@SYMTestExpectedResults The panic's are handled correctly
-*/
-	case 12:
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0164"));
-		iTest->LogSubTest(Animation7);
-		ret=RClassL();
-		iTest->CloseAllPanicWindows();
-		iState++;
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0165
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Two animations, one scrolling text
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Create two animations, one which scrolls text across the screen and
-					run them to completion
-
-@SYMTestExpectedResults The animations run without error
-*/
-	case 13:
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0165"));
-		if (!iTimerRunning)
-			{
-			iTest->LogSubTest(Animation8);
-			ret=ScrolingText2L();
-			iTimerRunning = ETrue;
-			}
-		if (iPackagingFinished)
-			{
-			iPackagingFinished = EFalse;
-			iTimerRunning = EFalse;
-			}
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0166
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Two animations, one scrolling text. Change the screen mode an run.
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Create two animations, one which scrolls text across the screen and
-					run them to completion while changing the screen mode
-
-@SYMTestExpectedResults The animations run without error
-*/
-	
-	case 14:
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0166"));
-		if (!iTimerRunning)
-			{
-			iTest->LogSubTest(Animation9);
-			ret=ScrolingText3L();
-			if (ret == ENext)
-				iPackagingFinished = ETrue;
-			else
-				iTimerRunning = ETrue;
-			}
-		if (iPackagingFinished)
-			{
-			iPackagingFinished = EFalse;
-			iTimerRunning = EFalse;
-			FlipInterval = 0; // Stops the tests (erroneously) flipping for the rest of the run
-			}
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0167
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Start an animation then kill it
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Start an animation running then kill it. Check the animation dies correctly
-
-@SYMTestExpectedResults The animations dies correctly
-*/
-	case 15:
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0167"));
-		if (!iTimerRunning)
-			{
-			iTest->LogSubTest(Animation11);
-			ret=KillAnimationL();
-			iTimerRunning = ETrue;
-			}
-		if (iPackagingFinished)
-			{
-			iPackagingFinished = EFalse;
-			iTimerRunning = EFalse;
-			}
-		break;
-	case 16:
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0167"));
-		iTest->LogSubTest(Animation10);		//This test is designed to be left running for at least several hours
-		//ret=ScrolingText4L();
-		iState++;
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0168
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    CBugFixColorAnimation
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     This class is used for reproducing a defect found on 6.1: KAA-5J3BLW "Unnecessary Wserv's DSA abort".
-					The problem was that a direct screen access client was getting an unnecessary abort notification
-					when a new window (or window group) was created but not visible.
-					This class will simulate the direct screen access client and it will check whether the first DSA abort
-					is not caused by just creating a window.
-
-@SYMTestExpectedResults Abort is not caused when creatung a window
-*/	
-	case 17:
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0168"));
-		if (!iTimerRunning)
-			{
-			iTest->LogSubTest(Animation12);
-			ret=DefectFix_KAA_5J3BLW_L();
-			iTimerRunning = ETrue;
-			}
-		if (iPackagingFinished)
-			{
-			iPackagingFinished = EFalse;
-			iTimerRunning = EFalse;
-			}
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0169
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Direct screen access in screen modes with non-zero screen mode origin
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Tests that DSA works correctly in screen modes with non-zero screen mode origin
-
-@SYMTestExpectedResults The DSA works correctly
-*/
-	case 18:
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0169"));
-		if (!CheckNonZeroOriginsSupportedOrNot())
-			{
-			INFO_PRINTF1(_L("Non Zero Origins not supported\n"));
-			iState++;
-			}
-		else
-			{
-			if (!iTimerRunning)
-				{
-				iTest->LogSubTest(Animation13);
-				ret=DSAWithScreenModeOffset1L();
-				iTimerRunning = ETrue;
-				}
-			if (iPackagingFinished)
-				{
-				iPackagingFinished = EFalse;
-				iTimerRunning = EFalse;
-				}
-			}
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0170
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Direct screen access in screen modes with non-zero screen mode origin
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Tests that DSA works correctly in screen modes with non-zero screen mode origin and different rotations
-
-@SYMTestExpectedResults The DSA works correctly
-*/
-	case 19:
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0170"));
-		if (!CheckNonZeroOriginsSupportedOrNot())
-			{
-			INFO_PRINTF1(_L("Non Zero Origins not supported\n"));
-			iState++;
-			}
-		else
-			{
-			if (!iTimerRunning)
-				{
-				iTest->LogSubTest(Animation14);
-				ret=DSAWithScreenModeOffset2L();
-				iTimerRunning = ETrue;
-				}
-			if (iPackagingFinished)
-				{
-				iPackagingFinished = EFalse;
-				iTimerRunning = EFalse;
-				}
-			}
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0171
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Window absolute position
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Tests the new function of getting the window's absolute position
-
-@SYMTestExpectedResults Function works correctly
-*/
-	case 20:
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0171"));
-		if (!iTimerRunning)
-			{
-			iTest->LogSubTest(Animation15);
-			ret=WindowPoistionRelativeToScreenL();
-			iTimerRunning = ETrue;
-			}
-		if (iPackagingFinished)
-			{
-			iPackagingFinished = EFalse;
-			iTimerRunning = EFalse;
-			}
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0172
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test direct screen access restart
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates a DSA for screen mode 0. After DSA has displayed 2 or 3 frames screen mode
- 					scale is changed with a timer. The DSA aborts and restarts once again
- 					and completes itself in different screen mode.
-
-@SYMTestExpectedResults DSA restarts and completes correctly
-*/
-	case 21:
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0172"));
-		if (iIsScalingSupported)
-			{
-			if (!iTimerRunning)
-				{
-				iTest->LogSubTest(Animation16);
-				ret=ScreenModeTestForScalingL();
-				iTimerRunning = ETrue;
-				}
-			if (iPackagingFinished)
-				{
-				iPackagingFinished = EFalse;
-				iTimerRunning = EFalse;
-				}
-			break;
-			}
-		iState++;
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0173
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test direct screen access scaling
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates a DSA for screen mode 0, tests API AbsoluteWindowPosition()
- 					Then sets screen mode to last(test) screen mode, here it does the same thing as
- 					done for screenmode 0, but with diffrerent scale (2,2) (2,3) (3,2) (3,3) and
- 					with different origin (20,30) (30,20) (20,20).
- 					Lastly copy back the test screen mode values.
-
-@SYMTestExpectedResults DSA scales correctly
-*/
-	case 22:
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0173"));
-		if (iIsScalingSupported)
-			{
-			if (!iTimerRunning)
-				{
-				iTest->LogSubTest(Animation17);
-				ret=ScreenModeScalingTestL();
-				iTimerRunning = ETrue;
-				}
-			if (iPackagingFinished)
-				{
-				iPackagingFinished = EFalse;
-				iTimerRunning = EFalse;
-				}
-			break;
-			}
-		iState++;
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0174
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test multiple direct screen access elements on the same window 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Create a number of direct screen access elements on the same window and
-					check that they work correctly
-
-@SYMTestExpectedResults DSAs work correctly
-*/
-	case 23:
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0174"));
-		if (iIsScalingSupported)
-			{
-			if (!iTimerRunning)
-				{
-				iTest->LogSubTest(Animation18);
-				ret=MultipleDSAsOnSameWindowL();
-				iTimerRunning = ETrue;
-				}
-			if (iPackagingFinished)
-				{
-				iPackagingFinished = EFalse;
-				iTimerRunning = EFalse;
-				}	
-			break;
-			}
-		iState++;
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0175
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Create a temporary deadlock on a DSA and resolve it 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Resolve a temporary deadlock on a DSA
-
-@SYMTestExpectedResults DSA resolves the deadlock
-*/
-	case 24:
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0175"));
-		if (!iTimerRunning)
-			{
-			iTest->LogSubTest(Animation19);
-			ret=TemporaryDeadlockL();//for INC072887 - removing a 0.5s delay in wserv.
-			iTimerRunning = ETrue;
-			}
-		if (iPackagingFinished)
-			{
-			iPackagingFinished = EFalse;
-			iTimerRunning = EFalse;
-			iState++;
-			}
-		break;
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-	case 25:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0533
-*/
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0533"));
-		if (!iTimerRunning)
-			{
-			FlipInterval=0;
-			iTest->LogSubTest(Animation25);
-			//Opens a window in front of a region tracking only DSA
-			ret=RegionTrackingOnlyNotificationsL(KRegionTrackingOnlyDsaWaitingForAbortSignal);
-			iTimerRunning = ETrue;
-			}
-		if (iPackagingFinished)
-			{
-			iPackagingFinished = EFalse;
-			iTimerRunning = EFalse;
-			}
-		break;
-	case 26:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0534
-*/
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0534"));
-		if (!iTimerRunning)
-			{
-			iTest->LogSubTest(Animation26);
-			//Opens a window behind a region tracking only DSA
-			ret=RegionTrackingOnlyNotificationsL(KRegionTrackingOnlyDsaNoAbortSignal);
-			iTimerRunning = ETrue;
-			}
-		if (iPackagingFinished)
-			{
-			iPackagingFinished = EFalse;
-			iTimerRunning = EFalse;
-			}
-		break;
-	case 27:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0535
-*/
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0535"));
-		if (!iTimerRunning)
-			{
-			iTest->LogSubTest(Animation27);
-			ret=MixDsaAndRegionTrackingOnlyL(KRegionTrackingOnlyDsaExistLast);
-			iTimerRunning = ETrue;
-			}
-		if (iPackagingFinished)
-			{
-			iPackagingFinished = EFalse;
-			iTimerRunning = EFalse;
-			}
-		break;
-	case 28:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0536
-*/
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0536"));
-		if (!iTimerRunning)
-			{
-			iTest->LogSubTest(Animation28);
-			ret=MixDsaAndRegionTrackingOnlyL(KDrawingDsaExistLast);
-			iTimerRunning = ETrue;
-			}
-		if (iPackagingFinished)
-			{
-			iPackagingFinished = EFalse;
-			iTimerRunning = EFalse;
-			}
-		break;
-	case 29:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0537
-*/
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0537"));
-		if (!iTimerRunning)
-			{
-			iTest->LogSubTest(Animation29);
-			ret=TryDifferentSupportedModesL();
-			iTimerRunning = ETrue;
-			}
-		if (iPackagingFinished)
-			{
-			iPackagingFinished = EFalse;
-			iTimerRunning = EFalse;
-			}
-		break;
-#else
-//NON NGA negative test for RegionTrackingOnly DSA
-	case 25:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0575
-*/
-		((CTDirectStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0575"));
-		if (!iTimerRunning)
-			{
-			FlipInterval=0;
-			iTest->LogSubTest(Animation25);
-			CColorAnimation* temp = NULL;
-			//Attempt to create a RegionTrackingOnly DSA in non NGA code
-			TRAPD(err,temp = CColorAnimation::NewL(iTest->iScreenNumber,1,*this,*TheClient->iGroup,TRect(10,10,630,230),ETrue,KRegionTrackingOnly));
-			if(err!=KErrNotSupported)
-				{
-				_LIT(KCTDirectNonNgaError,"Attempt to creat a RegionTrackingOnly DSA did not return KErrNotSupported on non-NGA");
-				LOG_MESSAGE(KCTDirectNonNgaError);
-				if(temp)
-					{
-					delete temp;
-					}
-				Fail();
-				}
-			else
-				{
-				_LIT(KCTDirectNonNgaSuccess,"RegionTrackingOnly DSA not supported on non-NGA as expected");
-				LOG_MESSAGE(KCTDirectNonNgaSuccess);
-				}
-			iState++;
-			}
-		break;
-#endif
-	default:
-		((CTDirectStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-		((CTDirectStep*)iStep)->CloseTMSGraphicsStep();
-		TestComplete();
-		break;
-		}
-	((CTDirectStep*)iStep)->RecordTestResultL();
-	}
-
-CRegionTrackingOnly* CRegionTrackingOnly::NewL(TInt aScreenNumber,TInt aId,MAnimCallBacks& aCallBack,CTWindowGroup& aParent,TRect aExtent,TBool aStart,TBool aOpenWindowInFrontDsa)
-	{
-	CRegionTrackingOnly* self=new(ELeave) CRegionTrackingOnly(aScreenNumber, aId,aCallBack);
-	CleanupStack::PushL(self);
-	self->ConstructL(aParent,aExtent,aOpenWindowInFrontDsa);
-	if (aStart)
-		{
-		self->StartL();
-		self->Started();
-		}
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-CRegionTrackingOnly::CRegionTrackingOnly(TInt aScreenNumber,TInt aId,MAnimCallBacks& aCallBack)
-	: CColorAnimation(aScreenNumber, aId, aCallBack)
-	{
-	iThreadParam.iScreenNumber = aScreenNumber;
-	}
-
-void CRegionTrackingOnly::ConstructL(CTWindowGroup& aParent,TRect aExtent,TBool aOpenWindowInFrontDsa)
-	{
-	iExpectedToAbort = aOpenWindowInFrontDsa; 
-	CColorAnimation::ConstructL(aParent, aExtent, KRegionTrackingOnly);
-	_LIT(ThreadName,"Create new Window");
-	
-    TInt error=iSem.CreateGlobal(KSem_DefectFix_KAA_5J3BLW_Name, 0);
-    if (error==KErrNone)
-        {
-        iAnimRect=aExtent;
-        iThreadParam.iRect = iAnimRect;
-        iThreadParam.iIsInFront = aOpenWindowInFrontDsa;
-        TThreadStartUp function=TThreadStartUp(CreateNewWindowGroup, &iThreadParam);
-        TRequestStatus status;
-        iThread=CProcess::NewThreadRendezvousL(ThreadName,&function,status);
-        User::WaitForRequest(status);
-        if (status != KErrNone)
-            {
-            RDebug::Printf("the request status is returned to be non KErrNone: %d", status.Int());
-            TestFailed(this);
-            }
-        }
-    else
-        {
-        TestFailed(this);
-        }
-	}
-
-TBool CColorAnimation::TestGcAndScreenDeviceValues()
-	{
-	TBool succeeded = ETrue;
-	_LIT(KErrorLogGraphicContext,"GraphicsContext not NULL when using the region tracking feature only");
-	_LIT(KErrorLogScreenDevice,"ScreenDevice not NULL when using the region tracking feature only");
-	if(iRegionTrackingOnly && iDrawer->Gc() != NULL)
-		{
-		CallBack().Log((TText8*)__FILE__,__LINE__, ESevrErr,KErrorLogGraphicContext);
-		succeeded = EFalse;
-		}
-	if(iRegionTrackingOnly && iDrawer->ScreenDevice() != NULL)
-		{
-		CallBack().Log((TText8*)__FILE__,__LINE__, ESevrErr,KErrorLogScreenDevice);
-		succeeded = EFalse;
-		}
-	return succeeded;
-	}
-
-void CRegionTrackingOnly::AbortNow(RDirectScreenAccess::TTerminationReasons /*aReason*/)
-	{
-	Stop();
-	}
-
-void CRegionTrackingOnly::Restart(RDirectScreenAccess::TTerminationReasons/* aReason*/)
-	{
-	if(!TestGcAndScreenDeviceValues())
-		{
-		CallBack().Fail();
-		}
-	if (iExpectedToAbort)
-		{
-		_LIT(KExpected,"DSA got an abort signal as expected");
-		CallBack().Log((TText8*)__FILE__,__LINE__,ESevrInfo,KExpected);
-		}
-	else
-		{
-		_LIT(KError,"DSA got an abort signal even though the window was opened behind it");
-		CallBack().Log((TText8*)__FILE__,__LINE__,ESevrErr,KError);
-		CallBack().Fail();
-		}
-	FinishTest();
-	}
-
-CRegionTrackingOnly::~CRegionTrackingOnly()
-	{
-	iSem.Close();
-	if(iThread)
-		{
-		TRequestStatus status;
-		iThread->Logon(status);
-		if (iThread->StillAlive())
-			{
- 			iThread->Terminate(KErrNone);
-			User::WaitForRequest(status);
-			}
-		delete iThread;
-		}
-	}
-
-__WS_CONSTRUCT_STEP__(Direct)
--- a/windowing/windowserver/tauto/TEVENT.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,423 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-
-#ifndef __TEVENT_H__
-#define __TEVENT_H__
-
-#include <e32std.h>
-#include <e32cmn.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "AUTODLL.H"
-#include "../TClick/CLICK.H"
-#include "TGraphicsHarness.h"
-#ifndef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA 
-#include <graphics/surfacemanager.h>
-#include <graphics/surfaceupdateclient.h>
-#endif //TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA 
-
-const TInt EMaxEventQueueSize=32;
-const TInt EMinQueueSize = 2;
-
-
-class CTEventTest;
-class CTQueueClient;
-
-class TWsQTEvent : public TWsEvent
-	{
-	friend class CTEventTest;
-public:
-	inline TTime& Time() {return iTime;}
-	};
-
-class CTQueueTestEvent : public CTEvent
-	{
-	enum {EEventBufferSize=40};
-public:
-	CTQueueTestEvent(RWsSession *aWs, CTEventTest *aTest);
-	void ConstructL();
-	void AddExpectedEvent(TWsEvent &aEvent);
-	inline void ResetCount(TInt aSet) {iEventCount=0;iEventSet=aSet;iLastEventError=EFalse;}
-	TInt EventsLeft();
-	inline void SetCheckTimeStamp(TBool aCheck) {iCheckTimeStamp = aCheck;}
-protected:
-	void doRunL();
-private:
-	void TestL(TInt aTest);
-private:
-	CCirBuf<TWsEvent> iEventBuffer;
-	CTEventTest *iTest;
-	TInt iEventCount;
-	TInt iEventSet;
-	TBool iCheckTimeStamp;
-	TPartialRedrawType iRedrawType;
-	TBool iLastEventError;
-	};
-
-const TInt EWinPositionX=6;
-const TInt EWinPositionY=9;
-const TInt EWinWidth=100;
-const TInt EWinHeight=50;
-// (6,9)
-// +----------------------+
-// |   (31,21)            |
-// |   +--------------+   |
-// |   |              |   |
-// |   |              |   |
-// |   +--------------+   |
-// |            (81,46)   |
-// +----------------------+ (106,59)
-
-class CTQueueClient : public CTClient
-	{
-private:
-	enum {EMaxKeysDown=50};
-public:
-	CTQueueClient(CTEventTest *aTest);
-	~CTQueueClient();
-	void ConstructL(TBool aCreateChild);
-	void ConstructEventHandlerL();
-	void AddExpectedEvent(TWsEvent &aEvent);
-	TInt WindowGroupIdentifier();
-	CTWinBase* GetHandle(TPoint& aPos);
-	void SetChildCapture(TInt aCaptureFlags);
-	inline void ResetCount(TInt aSet) {EventQueue()->ResetCount(aSet);}
-	inline void EnableFocusChangeEvents() {iGroup->GroupWin()->EnableFocusChangeEvents();}
-	inline void DisableFocusChangeEvents() {iGroup->GroupWin()->DisableFocusChangeEvents();}
-	inline void EnableGroupListChangeEvents() {iGroup->GroupWin()->EnableGroupListChangeEvents();}
-	inline void DisableGroupListChangeEvents() {iGroup->GroupWin()->DisableGroupListChangeEvents();}
-	inline CTQueueTestEvent* EventQueue() {return STATIC_CAST(CTQueueTestEvent*,iEventHandler);}
-	inline TPoint ChildTopLeft() {return TPoint(EWinWidth/4,EWinHeight/4);}
-	inline TSize ChildSize() {return TSize(EWinWidth/2,EWinHeight/2);}
-	void CreateEventTestGroupOnSecondScreenL();
-	void CloseEventTestGroupOnSecondScreen();
-private:
-	inline TPoint ParentTopLeft() {return TPoint(EWinPositionX,EWinPositionY);}
-	inline TPoint ChildAbsTopLeft() {return ParentTopLeft()+ChildTopLeft();}
-private:
-	TInt iKeysDown[EMaxKeysDown];
-	TInt iNumKeysDown;
-	CTEventTest *iTest;
-public:
-	CTBackedUpWin *iChildWin;
-	CTBackedUpWin *iWin;
-	TBool iChildCapturing;
-	TBool iCapturing;
-	CWsScreenDevice* iSndScreen;
-	RWindowGroup* iWinGp1;
-	RWindowGroup* iWinGp2;
-	};
-
-class REventAnimBase : public RTestAnim
-	{
-public:
-	enum EAnimationType
-		{
-		EEventAnim,
-		EEventPostingAnim
-		};
-	REventAnimBase(RAnimDll* aDll) :RTestAnim(*aDll) {}
-	virtual void Destroy();
-	void Reset();
-	TInt ErrorCode();
-	TInt NumberOfEventsReceived();
-	TInt AddExpectedEvent(TBool aEat, const TRawEvent& aEvent);
-	TInt AddExpectedEvent(const TAnimRawEvent& aEvent);	
-	static RAnimDll* LoadL();
-	};
-
-/**
- Client side handle to server-side anim class used for Anim Event tests
- @internalComponent
- @test
- */
-class REventAnim : public REventAnimBase
-	{
-public:
-	static REventAnim* NewL(RWindowBase* aWin, RAnimDll* aDll, REventAnimBase::EAnimationType aType=EEventAnim);
-	inline REventAnim(RAnimDll* aDll) : REventAnimBase(aDll) {}
-	inline TInt AddEvent(const TAnimRawEvent& aEvent) {return REventAnimBase::AddExpectedEvent(aEvent);};
-	inline TInt GetError() {return REventAnimBase::ErrorCode();};
-	inline TInt GetNumEvents() {return REventAnimBase::NumberOfEventsReceived();};
-	TInt TestFail(TInt aNoEvents);
-	};
-
-/**
- Client side handle to server-side anim class used for Event Handler Removal tests
- 
- RRemovableAnim is an anim which removes itself from the event handler list 
- after receiving n events, where n is the 'lifetime' of the anim measured in events received.
- 
- @internalComponent
- @test
- */
-class RRemovableAnim : public REventAnimBase
-	{
-public:
-	static RRemovableAnim* NewLC(RWindowBase* aWin, RAnimDll* aDll);
-	inline RRemovableAnim(RAnimDll* aDll) : REventAnimBase(aDll) {}
-	inline TInt AddExpectedEvent(const TRawEvent& aEvent) {return REventAnimBase::AddExpectedEvent(EFalse, aEvent);};
-	TInt SetEventHandlerLifetime(TInt aEventCount);
-	TInt EventHandlerLifetime();
-	TInt AddToEventHandlers();
-	TInt RemoveFromEventHandlers();
-	TBool TestPassed();
-	};
-
-class CTEventTest : public CTWsGraphicsBase
-	{
-	enum {
-		EKeyboardInitialRepeat1=1234567,
-		EKeyboardRepeat1=555666,
-		EKeyboardInitialRepeat2=2121212,
-		EKeyboardRepeat2=20000,
-		EDoubleClickTime1=900000,
-		EDoubleClickGap1=10,
-		EDoubleClickTime2=4000000,
-		EDoubleClickGap2=5,
-		ENumVisWins=2,
-		EPointerCursorUpdateGap=50000,		//0.05secs Same as WsPointer::EPointerUpdateGapInMicroSeconds
-		EKeyboardInitialRepeat3=2147483447, // Max value
-		EKeyboardRepeat3=8000, // for repeat 3
-		EKeyboardInitialRepeat4=-2, // Min value
-		EKeyboardRepeat4=6000, // for repeat 4
-		EKeyboardRepeat5=7000, // for repeat 4z
-		EKeyboardRepeat6=-30000, // for repeat 4
-		EKeyboardRepeat7=2147483447, // for repeat 4
-		};
-public:
-	CTEventTest(CTestStep* aStep);
-	~CTEventTest();
-	//TestState DoTestL();
-	void ConstructL();
-	void General();
-	void General2();
-	void Failed();
-	//void QueuePurgingL();
-	//void SendEventL();
-	//void InvisibleWindowL();
-	//void JavaAdditionsL();
-	void WindowCapBugL();
-	//void XyInputTypeL();
-	//void MovingPointerCursorL();
-	//void RotatedModeL();
-	//void AnimEvent();
-	void CheckTimeInterval(const TTimeIntervalMicroSeconds32 &aTime,TInt EKeyboardRepeat1);
-	void KeyRepeatRate(TInt aInitialRepeat, TInt aRepeat);
-	void KeyRepeatRateNegTest(TInt aInitialRepeat, TInt aRepeat);
-	void DoubleClickSettings(TInt aInterval, TInt aDistance);
-	void NextSetOfEventsL();
-	inline void ResetCount(TInt aSet) {iQueueClient->ResetCount(aSet);}
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	enum
-		{
-		EDoRot0  =0x01,
-		EDoRot90 =0x02,
-		EDoRot180=0x04,
-		EDoScale=0x80,
-		};
-	enum TClients
-		{
-		ETheClient,
-		EQueueClient,
-		};
-	enum TCaptureKeyApis
-		{
-		ECaptureKey1,
-		ECaptureKey2,
-		ECaptureKeyUpAndDowns1,
-		ECaptureKeyUpAndDowns2,
-		ECaptureLongKey1,
-		ECaptureLongKey2,
-		// Add additional enum values before this line
-		EMaxCaptureKeyApis 
-		};
-	enum TCancelCaptureKeyApis
-		{
-		ECancelCaptureKey,		
-		ECancelCaptureKeyUpAndDowns,		
-		ECancelCaptureLongKey,
-		// Add additional enum values before this line
-		EMaxCancelCaptureKeyApis
-		};
-private:
-	void RunTestsL(TBool aNeedChildWindows=EFalse);
-	void RunTestsRestoreAreaL(TBool aNeedChildWindows);
-	void QueuePurge_NextSetOfEventsL();
-	void InitializeQueueSizeTestL(TBool aEventReadyCancel);
-	void SendEventTest_NextSetOfEvents();
-	void InvisibleWindow_NextSetOfEvents();
-	void JavaAdditions_NextSetOfEvents();
-	void XyInputType_NextSetOfEvents();
-	void MovingPointerCursor_NextSetOfEventsL();
-	void WinCap_NextSetOfEvents();
-	void RotatedMode_NextSetOfEventsL();
-	void ScreenScaling_NextSetOfEventsL();
-	void AnimEvent_NextSetOfEventsL();
-	void FocusChanged_NextSetOfEventsL();
-	void StopEvents_NextSetOfEventsL();
-	void VirtualKeyboard_NextSetOfEventsL();
-	void KeyClicks_NextSetOfEvents();
-	void CaptureLong_NextSetOfEventsL();
-	void Password_NextSetOfEvents();
-	void GroupListChanged_NextSetOfEventsL();
-	void VisibilityChanged_NextSetOfEventsL();
-#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS	
-#ifndef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA  	
-	void SurfaceVisibilityChanged1_NextSetOfEventsL();
-	void SurfaceVisibilityChanged2_NextSetOfEventsL();
-	void SurfaceVisibilityChanged3_NextSetOfEventsL();
-#endif //TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-#endif //SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
-	void CheckTimeStamp_NextSetOfEventsL();
-	void RepeatableKeysL();
-	void PointerCapture_NextSetOfEventsL();
-	void PointerBufferPurge_NextSetOfEventsL();
-	void MismatchedCapture_NextSetOfEventsL();	
-	void EventHandlerRemoval_NextSetOfEventsL();
-	void EventHandlerRemoval_CreateAnimsL(TInt aAnimCount);
-	void EventHandlerRemoval_PrepareAnims(const TInt* aLifeTimes, TInt aAnimCount);
-	void EventHandlerRemoval_CreateExpectedEvents(TInt aEventCount, TInt aLiveAnimCount);
-	void EventHandlerRemoval_AddExpectedEvent(TRawEvent aEvent, TInt aLiveAnimCount);
-	void EventHandlerRemoval_CheckExpectedEventsReceivedByAnims();
-	void EventHandlerRemoval_CheckRecursionOfProcessRawEvent();
-	void EventHandlerRemoval_ManuallyRemoveAllAnims();
-	void EventHandlerRemoval_ResetAllAnims();
-	void EventHandlerRemoval_RemoveAndResetAllAnims();
-	void EventHandlerRemoval_DestroyAllAnims();
-	void EventHandlerRemoval_AddEventHandlerMultipleTimes();
-	void CheckPointerCursorInDifferentScreenMode(TSizeMode aMode,TPoint aOrigin);
-	void SimulateAndCheck(TPoint aOrigin,TSize aScale,TInt aXOffset,TInt aYOffset,TPointerEvent::TType aEventType,TRect aPointerCursorArea);
-	void AddExpectedKey(TInt aEventCode, TInt aScanCode, TInt aCode=0, TInt aRepeats=0, TUint aModifiers=0);
-	void AddExpectedKeyDownUp(TInt aScanCode, TInt aCode=0, TInt aRepeats=0, TUint aModifiers=0);
-	void AddExpectedEvent(TInt aEventCode, CTWinBase* aWin);
-	void AddExpectedEvent(TInt aEventCode);
-	void AddExpectedEvent(TInt aEventCode,RWindowGroup* aWindow);
-	void AddExpectedErrorMessage(TWsErrorMessage::TErrorCategory aCategory, TInt aError);
-	void CalculatePointerEvent(TWsEvent& aEvent,TPointerEvent::TType aType, TPoint aPos);
-	void CalculatePointerCaptureEvent(TWsEvent& aEvent,TPointerEvent::TType aType, TPoint aPos, TInt aHandle=0);
-	void AddExpectedPointer(TPointerEvent::TType aType, TPoint aPos);
-	void AddExpectedPointerCapture(TPointerEvent::TType aType, TPoint aPos, TInt aHandle=0);
-	void AddExpectedPointerClick(TPointerEvent::TType aType, TPoint aPos);
-	void AddExpectedPointerDownUp(TPoint aPos);
-	inline void AddExpectedPointerScr(TPointerEvent::TType aType, TPoint aPos);
-	inline void AddExpectedPointerDownUpScr(TPoint aPos);
-	void AddExpectedModifiersChanged(TInt aChangedModifiers, TInt aModifiers);
-	void AddExpectedEnterExit(TInt aEventCode, TPoint aPos);
-	void AddExpectedKeyAnim(TRawEvent::TType aEventCode, TInt aScanCode,TBool aEat);
-	void AddExpectedPointerAnim(TRawEvent::TType aEventCode, TPoint aPoint, TBool aEat=ETrue);
-	void AddExpectedVisibilityChange(TUint aFlags);
-	void AddExpectedVisibilityChange(TUint aFlags, CTBlankWindow* aWindow);
-	inline void SimulatePointerWin(TRawEvent::TType aType, TInt aX, TInt aY);
-	inline void SimulatePointerDownUpWin(TInt aX, TInt aY);
-	inline void SimulatePointer(TRawEvent::TType aType, TInt aX, TInt aY);
-	void doSendEvent(TWsEvent &aEvent);
-	void SendKey(TInt aEventCode, TInt aScanCode, TInt aCode=0, TInt iRepeats=0);
-	void SendEvent(TInt aEventCode);
-	void CreateEventTestGroup();
-	void CloseEventTestGroup();
-	void CreateAndCloseEventTestGroup();
-	void TriggerOomMessage(TTimeIntervalMinutes aPeriod);
-	TBool SetClickType(TClickOutputModes aType);
-	CTBlankWindow* NewBlueForgroundWindowL();
-	CTBlankWindow* NewBlueForgroundWindow();
-	TInt KeyRepeatTime() const;
-	void EventQueuePtrCrashTest();
-	TInt ClickCommandReply(TInt aCommand,TInt aData);
-	TInt CreateGroupWindow(RWindowGroup& aWinGp,TClients aClient,TInt& aWinGpId);
-	void CloseGroupWindow(RWindowGroup& aWinGp,TInt aWinGpId);
-	void CloseWindow(RWindowBase& aWin,TInt aHandle,TInt aWinGpId);
-	void EventQueueExpansionTestL();
-	void RawEventRepeatTest_NextSetOfEventsL();
-	void SimulateRepeatEvent(TInt aScanCode, TInt aRepeats=0);
-#if !defined(TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA)
-	void SimulateButton1DownWithSimulatedMove(TInt aX, TInt aY);
-#endif
-	void TestCaptureAndCancelCapturePair(TCaptureKeyApis aCaptureApi, TCancelCaptureKeyApis aCancelCaptureApi);
-	static TInt GenerateAnEvent(TAny* aEventTest);
-private:
-	CTBlankWindow* iBlankWin;
-	RBlankWindow iBackingWindow;
-	TSize iPhysicalScreenSize;
-	TSize iWinSize;
-	RWindowGroup iEventTestGroup;
-	CTWindowGroup *iEventTestGroup2;
-	CTWindowGroup *iEventTestGroup3;
-	CTWindowGroup *iEventTestGroup4;
-	TInt iEventSet;
-	CTQueueClient *iQueueClient;
-	TBool iFailed;
-	REventAnim* iAnim;
-	TUint iScreenModeTests; //currently contains supported rotation and if screen scaling is possible
-	TInt iNumScrModes;
-	RSoundPlugIn iClick;
-	TBool iAddToClick;
-	TInt iCaptureKey;
-	TBool iTurnBackOnCapsLock;
-	TInt iCurrentMode;
-	TSizeMode iSizeMode;
-	TBool iTheClientFlush;
-	TBool iQuequeClientFlush;
-	CTBlankWindow* iVisWins1;
-	CTBlankWindow* iVisWins2;
-	CTBlankWindow* iVisWins3;
-	CTransWindow* iTransWin;
-	RAnimDll* iAnimDll;
-	RPointerArray<RRemovableAnim>* iRemovableAnims;
-	TBool iIs3DPointer;
-	TBool iPtrPluginLoaded;
-	TInt iYOffset;
-#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS	
-#ifndef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA 	
-	TSurfaceId iSurfaceId;
-	RSurfaceManager iSurfaceManager;
-	CPeriodic* iTimeOutCallback;
-#endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-#endif // SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
-	};
-
-class CTQueueWindowGroup : public CTWindowGroup
-	{
-public:
-	CTQueueWindowGroup(CTClient *aClient);
-	void ConstructL();
-private:
-	TInt iNumOnEvents;
-	};
-
-class CTEventTestStep : public CTGraphicsStep
-	{
-public:
-	CTEventTestStep();
-protected:
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTEventTestStep,"TEventTest");
-
-
-#endif
--- a/windowing/windowserver/tauto/TEvent.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7027 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test window server events
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __INIPARSER_H__
-#define __INIPARSER_H__
-#endif // __INIPARSER_H__
-
-#include "PARSEINIDATA.H"
-#include "TEVENT.H"
-#include "W32CLICK.H"
-#include <w32debug.h>
-#include <hal.h>
-
-#define FAIL_LOGGING on
-//#define DETAILED
-#define LOGGING 1	//Uncomment this when there is a fail so that you get more logging
-
-_LIT(KKeyClickPluginDll, "click.dll");
-
-CTQueueClient::CTQueueClient(CTEventTest *aTest) : iTest(aTest)
-	{
-	}
-
-CTQueueClient::~CTQueueClient()
-	{
-	CloseEventTestGroupOnSecondScreen();
-	iGroup->GroupWin()->EnableReceiptOfFocus(EFalse);
-	delete iChildWin;
-	delete iWin;
-
-	}
-
-void CTQueueClient::ConstructL(TBool aCreateChild)
-	{
-	CTClient::ConstructL();
-	iGroup=new(ELeave) CTQueueWindowGroup(this);
-	iGroup->ConstructL();
-	iWin=new(ELeave) CTBackedUpWin(EGray4);
-	iWin->ConstructExtLD(*iGroup,TPoint(EWinPositionX,EWinPositionY),TSize(EWinWidth,EWinHeight));
-	iWin->Activate();
-	if (aCreateChild)
-		{
-		iChildWin=new(ELeave) CTBackedUpWin(EGray4);
-		iChildWin->ConstructExtLD(*iWin,ChildTopLeft(),ChildSize());
-		iChildWin->Activate();
-		}
-	iWs.Flush();
-	}
-
-void CTQueueClient::ConstructEventHandlerL()
-	{
-	iEventHandler=new(ELeave) CTQueueTestEvent(&iWs, iTest);
-	((CTQueueTestEvent *)iEventHandler)->ConstructL();
-	}
-
-TInt CTQueueClient::WindowGroupIdentifier()
-	{
-	return(iGroup->GroupWin()->Identifier());
-	}
-
-CTWinBase* CTQueueClient::GetHandle(TPoint& aPos)
-	{
-	if (iCapturing)
-		return iChildWin;
-	if (iChildWin && TRect(ChildTopLeft(),ChildSize()).Contains(aPos))
-	//if (iChildWin && TRect(TPoint(),ChildSize()).Contains(aPos))
-		{
-		aPos-=ChildTopLeft();
-		if (iChildCapturing)
-			iCapturing=ETrue;
-		return iChildWin;
-		}
-	return iWin;
-	}
-
-void CTQueueClient::AddExpectedEvent(TWsEvent &aEvent)
-	{
-#if defined(DETAILED)
-	_LIT(KLog,"   Adding Event Type=%d");
-	TLogMessageText buf;
-	buf.Format(KLog,aEvent.Type());
-	LogMessage(buf);
-#endif
-	((CTQueueTestEvent *)iEventHandler)->AddExpectedEvent(aEvent);
-	}
-
-void CTQueueClient::SetChildCapture(TInt aCaptureFlags)
-	{
-	if (!iChildWin)
-		return;
-	iChildWin->BaseWin()->SetPointerCapture(aCaptureFlags);
-	if (aCaptureFlags|RWindowBase::TCaptureFlagEnabled)
-		iChildCapturing=ETrue;
-	}
-//
-
-CTQueueTestEvent::CTQueueTestEvent(RWsSession *aWs, CTEventTest *aTest) : CTEvent(aWs)
-	{
-	iTest = aTest;
-	iCheckTimeStamp = EFalse;
-	iLastEventError = EFalse;
-	}
-
-void CTQueueTestEvent::ConstructL()
-	{
-	CTEventBase::Construct();
-	iEventBuffer.SetLengthL(EEventBufferSize);
-	iRedrawType=iTest->TestBase()->RedrawStoreTypeL();
-	}
-
-void CTQueueTestEvent::TestL(TInt aTest)
-	{
-	if (!aTest)
-		{
-		iTest->Failed();
-		User::Leave(ETestFailed);
-		}
-	}
-
-//#define FAIL_LOGGING yes
-void CTQueueTestEvent::doRunL()
-	{
-	TWsEvent wsEvent;
-	iWs->GetEvent(wsEvent);
-	TWsEvent expectedEvent;
-
-#if defined(FAIL_LOGGING)
-	TInt eType,wsHan,eHan,wsKeyCode,eKeyCode,wsKeyRepeat,eKeyRepeat,wsKeyScan,eKeyScan;
-	TLogMessageText buf;
-	_LIT(KStartString,"AUTO  EventTestFail ");
-#endif
-	TInt wsType=wsEvent.Type();
-	if (wsEvent.Type()==EEventNull)
-		TestL(wsEvent.Handle()==0);
-	else
-		{
-		TInt count=iEventBuffer.Count();
-		if (count==0 && wsType==EEventFocusGained)
-			goto End;
-		if (iLastEventError
-			&& (iRedrawType==EPartialRedraw_FullRedrawSupport || iRedrawType==EPartialRedraw_PreserveStoredCmds)
-			&& wsEvent.Type()==EEventErrorMessage /*&& expectedEvent.Type()!=EEventErrorMessage*/)		//Should really check if the next expected event is an error but there is no way to do this without removing it from the buffer
-			{
-		#if defined(DETAILED)
-			_LIT(KLog,"Skip Duplicate Error Message");
-			iTest->LOG_MESSAGE(KLog);
-		#endif
-			return;		//Ignore repeated error events
-			}
-		do	{
-			TestL(iEventBuffer.Remove(&expectedEvent));	//Loop needed for REL Build with DEB WSERV and W32
-		#if defined(DETAILED)
-			_LIT(KLog,"Skip event while waiting for error message");
-			if (expectedEvent.Type()==EEventErrorMessage && wsEvent.Type()!=expectedEvent.Type())
-				iTest->LOG_MESSAGE(KLog);
-		#endif
-			} while (expectedEvent.Type()==EEventErrorMessage && wsEvent.Type()!=expectedEvent.Type());
-		++iEventCount;		//iEventSet
-	#if defined(FAIL_LOGGING)
-		wsType=wsEvent.Type(),eType=expectedEvent.Type(),wsHan=wsEvent.Handle(),eHan=expectedEvent.Handle();
-		if (wsType!=eType)
-			{
-			_LIT(KEventDiff,"Count=%d  Events Differ Exp=%d  Act=%d");
-			buf.Copy(KStartString);
-			buf.AppendFormat(KEventDiff,iEventCount,eType,wsType);
-			iTest->LOG_MESSAGE(buf);
-			}
-		else
-			{
-		#if defined(DETAILED)
-			_LIT(KLog," Count=%d  Event Type=%d");
-			iTest->LOG_MESSAGE3(KLog,iEventCount,wsType);
-		#endif
-			}
-		if (wsHan!=eHan)
-			{
-			_LIT(KHandlesDiff,"Count=%d  Handles Differ");
-			buf.Copy(KStartString);
-			buf.AppendFormat(KHandlesDiff,iEventCount);
-			iTest->LOG_MESSAGE(buf);
-			}
-	#endif
-		TestL(wsEvent.Type()==expectedEvent.Type() && wsEvent.Handle()==expectedEvent.Handle());
-		}		
-	iLastEventError=(wsEvent.Type()==EEventErrorMessage);
-	switch(wsEvent.Type())
-		{
-		case EEventKey:
-		#if defined(FAIL_LOGGING)
-			wsKeyCode=wsEvent.Key()->iCode,eKeyCode=expectedEvent.Key()->iCode;
-			if (wsKeyCode!=eKeyCode)
-				{
-				_LIT(KKeysDiff,"Count=%d  Key Code Exp=%d (%c)  Act=%d (%c)");
-				buf.Copy(KStartString);
-				buf.AppendFormat(KKeysDiff,iEventCount,iEventCount,eKeyCode,eKeyCode,wsKeyCode,wsKeyCode);
-				iTest->LOG_MESSAGE(buf);
-				}
-			wsKeyRepeat=wsEvent.Key()->iRepeats,eKeyRepeat=expectedEvent.Key()->iRepeats;
-			if ((wsKeyRepeat>0)!=(eKeyRepeat>0) || wsKeyRepeat<eKeyRepeat)
-				{
-				_LIT(KKeysRepDiff,"Count=%d  Key Repeat Exp=%d  Act=%d");
-				buf.Copy(KStartString);
-				buf.AppendFormat(KKeysRepDiff,iEventCount,eKeyRepeat,wsKeyRepeat);
-				iTest->LOG_MESSAGE(buf);
-				}
-		#endif
-			TestL(wsEvent.Key()->iCode==expectedEvent.Key()->iCode && wsEvent.Key()->iRepeats>=expectedEvent.Key()->iRepeats
-								&& (wsEvent.Key()->iRepeats>0)==(expectedEvent.Key()->iRepeats>0));		//Fall Through
-		case EEventKeyDown:
-		case EEventKeyUp:
-		#if defined(FAIL_LOGGING)
-			wsKeyScan=wsEvent.Key()->iScanCode,eKeyScan=expectedEvent.Key()->iScanCode;
-			if (wsKeyScan!=eKeyScan)
-				{
-				_LIT(KScanDiff,"Count=%d  Scan Code Exp=%d (%c)  Act=%d (%c)");
-				buf.Copy(KStartString);
-				buf.AppendFormat(KScanDiff,iEventCount,eKeyScan,eKeyScan,wsKeyScan,wsKeyScan);
-				iTest->LOG_MESSAGE(buf);
-				}
-		#endif
-			TestL(wsEvent.Key()->iScanCode==expectedEvent.Key()->iScanCode);
-			break;
-		case EEventModifiersChanged:
-			{
-			TBool changeModifiersOK=(wsEvent.ModifiersChanged()->iChangedModifiers
-																==expectedEvent.ModifiersChanged()->iChangedModifiers);
-			TBool modifiersOK=((wsEvent.ModifiersChanged()->iModifiers&wsEvent.ModifiersChanged()->iChangedModifiers)==
-						(expectedEvent.ModifiersChanged()->iModifiers&wsEvent.ModifiersChanged()->iChangedModifiers));
-		#if defined(FAIL_LOGGING)
-			if (!changeModifiersOK || !modifiersOK)
-				{
-				_LIT(KModDiff,"Count=%d  Modifiers");
-				buf.Copy(KStartString);
-				buf.AppendFormat(KModDiff,iEventCount);
-				iTest->LOG_MESSAGE(buf);
-				}
-		#endif
-			TestL(changeModifiersOK);
-			TestL(modifiersOK);
-			}
-			break;
-		case EEventPointer:
-		case EEventDragDrop:
-			{
-		#if defined(FAIL_LOGGING)
-			TInt expectedType=expectedEvent.Pointer()->iType, actualType=wsEvent.Pointer()->iType;
-			TPoint expectedPos=expectedEvent.Pointer()->iPosition, actualPos=wsEvent.Pointer()->iPosition;
-			if (actualType!=expectedType)
-				{
-				_LIT(KPointerDiff,"Count=%d  Pointer Type Exp=%d  Act=%d");
-				buf.Copy(KStartString);
-				buf.AppendFormat(KPointerDiff,iEventCount,expectedType,actualType);
-				iTest->LOG_MESSAGE(buf);
-				}
-			if (actualPos!=expectedPos)
-				{
-				_LIT(KPointerPosDiff,"Count=%d  Pointer Pos E=(%d,%d)  A=(%d,%d)");
-				buf.Copy(KStartString);
-				buf.AppendFormat(KPointerPosDiff,iEventCount,expectedPos.iX,expectedPos.iY
-																,actualPos.iX,actualPos.iY);
-				iTest->LOG_MESSAGE(buf);
-				}
-		#endif
-			TestL(wsEvent.Pointer()->iType==expectedEvent.Pointer()->iType);
-			TestL(wsEvent.Pointer()->iPosition==expectedEvent.Pointer()->iPosition);
-			TInt count=iEventBuffer.Count();count++;			//Dummy line to help in debugging.
-			}
-			break;
-		case EEventWindowVisibilityChanged:
-			{
-		#if defined(FAIL_LOGGING)
-			TUint expectedFlags=expectedEvent.VisibilityChanged()->iFlags;
-			TUint actualFlags=wsEvent.VisibilityChanged()->iFlags;
-			if (actualFlags!=expectedFlags)
-				{
-				_LIT(KVisibilityDiff,"Count=%d  Visibility Flags Exp=%d  Act=%d");
-				buf.Copy(KStartString);
-				buf.AppendFormat(KVisibilityDiff,iEventCount,expectedFlags,actualFlags);
-				iTest->LOG_MESSAGE(buf);
-				}
-		#endif
-			TestL(wsEvent.VisibilityChanged()->iFlags==expectedEvent.VisibilityChanged()->iFlags);
-			TInt count=iEventBuffer.Count();count++;			//Dummy line to help in debugging.
-			}
-			break;
-		case EEventMessageReady:
-			{
-			const SEventMessageReady message = *(SEventMessageReady*)wsEvent.EventData();
-			TestL(message.iMessageUid== TUid::Uid(123));
-			}
-			break;
-		default:;
-		}
-	if(iCheckTimeStamp)
-		{
-		const TInt KOffset=100000; //0.1secs
-		TInt64 offset = expectedEvent.Time().Int64() - wsEvent.Time().Int64();
-		#if defined(FAIL_LOGGING)
-			if(Abs(offset)<KOffset)
-				{
-				_LIT(KTimeStampDiff,"Count=%d  Offset=%d, ExpectedTime=%d, WServEventTime=%d");
-				buf.Copy(KStartString);
-				buf.AppendFormat(KTimeStampDiff,iEventCount,offset,expectedEvent.Time().Int64(),wsEvent.Time().Int64());
-				iTest->LOG_MESSAGE(buf);
-				}
-		#endif
-		TestL(Abs(offset)<KOffset);
-		}
-	End:
-	if (iEventBuffer.Count()==0)
-	    {
-		TRAPD(err, iTest->NextSetOfEventsL());		//Not allowed to leave
-		if(err != KErrNone)
-		    {
-            buf.Copy(KStartString);
-            buf.AppendFormat(_L("Subtest does not follow rules set by TEvent test framework, leave code: %d"), err);
-            iTest->TEST(EFalse);
-            iTest->LOG_MESSAGE(buf);
-            User::Leave(err);
-		    }
-	    }
-	
-	}
-
-void CTQueueTestEvent::AddExpectedEvent(TWsEvent &aEvent)
-	{
-	if(iCheckTimeStamp)
-		{
-		static_cast<TWsQTEvent&>(aEvent).Time().UniversalTime();
-		}
-	iEventBuffer.Add(&aEvent);
-	}
-
-TInt CTQueueTestEvent::EventsLeft()
-	{
-	return iEventBuffer.Count();
-	}
-//
-
-CTQueueWindowGroup::CTQueueWindowGroup(CTClient *aClient) : CTWindowGroup(aClient)
-	{}
-
-void CTQueueWindowGroup::ConstructL()
-	{
-	CTWindowGroup::ConstructL();
-	User::LeaveIfError(iGroupWin.EnableOnEvents(EEventControlAlways));
-	User::LeaveIfError(iGroupWin.EnableGroupChangeEvents());
-	}
-
-//
-
-/**
- Closes and deletes anim DLL.
- @param aAnimDll Pointer to the anim Dll to be closed and deleted
- */
-LOCAL_C void DestroyAnimDll(TAny* aAnimDll)
-	{
-	(static_cast<RAnimDll*>(aAnimDll))->Destroy();
-	}
-
-/**
- Destroys an REventAnimBase derived anim
- @param aAnim REventAnimBase derived client-side handle to anim
- */
-LOCAL_C void DestroyAnim(TAny* aAnim)
-	{
-	(static_cast<REventAnimBase*>(aAnim))->Destroy();
-	}
-
-/**
- Loads the DLL containing the test anims and pushes it onto the cleanup stack.
- This function leaves if the operation was unsuccessful.
- @return A pointer to the DLL containing test anims
- */
-RAnimDll* REventAnimBase::LoadL()
-	{
-	RAnimDll* animDll=new(ELeave) RAnimDll(TheClient->iWs);
-	CleanupStack::PushL(TCleanupItem(DestroyAnimDll,animDll));
-	User::LeaveIfError(animDll->Load(KAnimDLLName));
-	CleanupStack::Pop(animDll);
-	return animDll;
-	}
-
-/**
- Closes the client-side handle to the anim, destroys the DLL and deletes itself.
- */
-void REventAnimBase::Destroy()
-	{
-	Close();
-	delete this;
-	}
-
-/**
- Resets server-side state of anim
- */
-void REventAnimBase::Reset()
-	{
-	CommandReply(EADllReset);
-	}
-
-/**
- @return Under non-error conditions, returns 0.
- Under error conditions, returns the number of events received
- since the first unexpected event was sent.
- */
-TInt REventAnimBase::ErrorCode()
-	{
-	return CommandReply(EADllErrorCode);
-	}
-
-/**
- @return The number of events received by the anim since it was last reset.
- */
-TInt REventAnimBase::NumberOfEventsReceived()
-	{
-	return CommandReply(EADllNumberOfEventsReceived);
-	}
-
-/**
- Adds an expected event to the list of events expected by the anim.
- @param aEat Indicates if event is expected to be eaten (ETrue 'indicates expected to be eaten')
- @param aEvent The expected event
- @return KErrNone if succcessful, othewise error code.
- */
-TInt REventAnimBase::AddExpectedEvent(TBool aEat, const TRawEvent& aEvent)
-	{
-	TAnimRawEvent event;
-	event.iRawEvent=aEvent;
-	event.iEat=aEat;
-	return AddExpectedEvent(event);
-	}
-
-/**
- Adds an expected event to the list of events expected by the anim.
- @param aEvent The expected event
- @return KErrNone if succcessful, othewise error code.
- */
-TInt REventAnimBase::AddExpectedEvent(const TAnimRawEvent& aEvent)
-	{
-	TPckgBuf<TAnimRawEvent> param;
-	param()=aEvent;
-	return CommandReply(EADllAddExpectedEvent,param);
-	}
-
-//
-
-/**
- Loads the DLL containing the event test anim and creates an anim for event tests
- @param aWin the base window to which the anim is associated (this anim is a Window anim)
- @return A pointer to the new REventAnim
- */
-REventAnim* REventAnim::NewL(RWindowBase* aWin, RAnimDll* aDll, REventAnimBase::EAnimationType aType/*=EEventAnim*/)
-	{
-	REventAnim* self=new(ELeave) REventAnim(aDll);
-	CleanupStack::PushL(TCleanupItem(DestroyAnim,self));
-	User::LeaveIfError(self->Construct(*aWin,(aType == EEventAnim ? EAnimTypeEventTest : EAnimTypeEventPostingTest), TPtrC8()));
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-/**
- Checks if the anim has received the correct events, and resets the sever-side state of the anim
- @return positive value if events did not match expected showing the first event that didn't match.
-         negative value if there were the wrong number of events showing the number of events there were
-         0 if correct number of events and they all match
- */
-TInt REventAnim::TestFail(TInt aNoEvents)
-	{
-	TInt events=CommandReply(EADllErrorCode);
-	if (events>0)
-		return events;
-	events=CommandReply(EADllNoEventsAndReset);
-	if (events==aNoEvents)
-		return 0;
-	return -events;
-	}
-
-//
-/**
- Loads the DLL containing the event test anim and creates an anim for event handler removal tests
- @param aWin the base window to which the anim is associated (this anim is a Window anim)
- @return A pointer to the new REventAnim
- */
-RRemovableAnim* RRemovableAnim::NewLC(RWindowBase* aWin, RAnimDll* aDll)
-	{
-	RRemovableAnim* self=new(ELeave) RRemovableAnim(aDll);
-	CleanupStack::PushL(TCleanupItem(DestroyAnim,self));
-	User::LeaveIfError(self->Construct(*aWin,EAnimTypeRemovableAnim,TPtrC8()));
-	return self;
-	}
-
-/**
- Sets the lifetime of the anim. This anim will remove itself from the
- event handler list after receiving this number of events.
- @return The lifetime of the anim
- */
-TInt RRemovableAnim::SetEventHandlerLifetime(TInt aEventCount)
-	{
-	TPckgBuf<TInt> param;
-	param()=aEventCount;
-	return CommandReply(EADllSetEventHandlerLifetime, param);
-	}
-
-/**
- Retrieves the lifetime of the anim. This anim will remove itself from the
- event handler list after receiving this number of events.
- @return The lifetime of the anim
- */
-TInt RRemovableAnim::EventHandlerLifetime()
-	{
-	return CommandReply(EADllEventHandlerLifetime);
-	}
-/**
- Adds the anim to the list of event handlers.
- This anim should receive any subsequent events.
- @return KErrNone on successful addition.
- */
-TInt RRemovableAnim::AddToEventHandlers()
-	{
-	return CommandReply(EADllAddToEventHandlers);
-	}
-
-/**
- Removes the anim from the list of event handlers.
- This anim should not receive any subsequent events.
- @return KErrNone on successful removal.
- */
-TInt RRemovableAnim::RemoveFromEventHandlers()
-	{
-	return CommandReply(EADllRemoveFromEventHandlers);
-	}
-
-/**
- Tests if the anim has received the correct number of events, and that
- the events received are all the correct events.
- @param aNoEvents The total expected number of events since it was last reset/constructed.
- @return ETrue if the anim has received the expected events.
- */
-TBool RRemovableAnim::TestPassed()
-	{
-	return CommandReply(EADllTestPassed);
-	}
-
-//
-
-CTEventTest::CTEventTest(CTestStep* aStep) : CTWsGraphicsBase(aStep)
-	{
-	INFO_PRINTF1(_L("Testing Event functions"));
-	}
-
-CTEventTest::~CTEventTest()
-	{
-	delete iBlankWin;
-	iBackingWindow.Close();
-	delete iVisWins1;
-	delete iVisWins2;
-	delete iVisWins3;
-	delete iTransWin;
-	delete iQueueClient;
-	if (iAnim)
-		iAnim->Destroy();
-	delete iEventTestGroup2;		//Just in case it doesn't get deleted normally
-	delete iEventTestGroup3;		//Just in case it doesn't get deleted normally
-	delete iEventTestGroup4;        //Just in case it doesn't get deleted normally
-	if (iPtrPluginLoaded)
-	    {
-	    iClick.Unload();
-	    }
-	iClick.Close();
-	if (iTurnBackOnCapsLock)
-		{
-		TheClient->iWs.SetModifierState(EModifierCapsLock,ETurnOnModifier);
-		}
-	if (iRemovableAnims)
-		{
-		EventHandlerRemoval_DestroyAllAnims();
-		iRemovableAnims->Close();
-		delete iRemovableAnims;
-		}
-	if (iAnimDll)
-		{
-		iAnimDll->Destroy();
-		}
-#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS	
-#ifndef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA  	
-	if (!iSurfaceId.IsNull())
-	    {
-	    iSurfaceManager.CloseSurface(iSurfaceId);
-	    }
-	iSurfaceManager.Close();
-	if(iTimeOutCallback)
-	    {
-	    iTimeOutCallback->Cancel();
-	    delete iTimeOutCallback;
-	    }
-#endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-#endif // SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
-	}
-
-void CTEventTest::ConstructL()
-	{
-    _LIT(KWsIniFile, "z:\\system\\data\\wsini.ini");
-    CIniData* iniData = CIniData::NewL(KWsIniFile, ' ');
-    _LIT( KWsiniYShifting, "YSHIFTING");
-    iniData->FindVar(KWsiniYShifting, iYOffset);
-    delete iniData;
-	TheClient->iScreen->SetAppScreenMode(0);
-	TheClient->iScreen->SetScreenMode(0);						// in mode 0 TheClient->iScreen->SizeInPixels() 
-	iPhysicalScreenSize = TheClient->iScreen->SizeInPixels();	// is equal to physical screen size
-	BaseWin->Invalidate();
-	BaseWin->Win()->BeginRedraw();
-	TheGc->Activate(*BaseWin->Win());
-	TheGc->SetBrushColor(TRgb::Gray16(12));
-	TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TheGc->SetPenStyle(CGraphicsContext::ENullPen);
-	TheGc->DrawRect(TRect(BaseWin->Win()->Size()));
-	TheGc->Deactivate();
-	BaseWin->Win()->EndRedraw();
-	TheGc->Activate(*TestWin->Win());
-	TheGc->SetBrushColor(TRgb::Gray16(4));
-	TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TheGc->SetPenStyle(CGraphicsContext::ENullPen);
-	TheGc->DrawRect(TRect(TestWin->Win()->Size()));
-	TheGc->Deactivate();
-	iBackingWindow=RBlankWindow(TheClient->iWs);
-	iBackingWindow.Construct(*TheClient->iGroup->WinTreeNode(),ENullWsHandle);
-	iBackingWindow.SetColor(TRgb(0,0xDD,0xDD));
-	iBackingWindow.SetOrdinalPosition(-1,-25);
-	iBackingWindow.Activate();
-	iBlankWin=new(ELeave) CTBlankWindow();
-	iBlankWin->ConstructL(*TheClient->iGroup);
-	User::LeaveIfError(iBlankWin->BaseWin()->SetRequiredDisplayMode(EColor256));
-	iBlankWin->SetExt(TPoint(),iPhysicalScreenSize);
-	iBlankWin->SetVisible(EFalse);
-	iBlankWin->Activate();
-	CArrayFixFlat<TInt> *rotations=new(ELeave) CArrayFixFlat<TInt>(1);
-	iNumScrModes=TheClient->iScreen->NumScreenModes();
-	TInt modes=Min(2,iNumScrModes);
-	TInt mode;
-	TInt rot;
-	CleanupStack::PushL(rotations);
-	for (mode=0;mode<modes;++mode)
-		{
-		User::LeaveIfError(TheClient->iScreen->GetRotationsList(mode,rotations));
-		for (rot=rotations->Count()-1;rot>=0;--rot)
-			{
-			iScreenModeTests|=(1<<(*rotations)[rot]);
-			}
-		}
-	if (CheckScalingSupportedOrNot())
-		iScreenModeTests|=EDoScale;
-
-	iClick=RSoundPlugIn(TheClient->iWs);
-	User::LeaveIfError(iClick.Construct(TUid::Uid(CLICK_THIRD_UID)));
-    TBool ptrPluginLoadable = EFalse;
-    iClick.IsLoaded(ptrPluginLoadable);
-    if (ptrPluginLoadable)
-        {
-        User::LeaveIfError(iClick.Load(KKeyClickPluginDll));
-        iPtrPluginLoaded = ETrue;
-        }
-	CleanupStack::PopAndDestroy();
-	if (TheClient->iWs.GetModifierState()&EModifierCapsLock)
-		{
-		iTurnBackOnCapsLock=ETrue;
-		TheClient->iWs.SetModifierState(EModifierCapsLock,ETurnOffModifier);
-		}
-	iAnimDll = REventAnimBase::LoadL();
-	TInt mods=TheClient->iWs.GetModifierState();
-	if (mods&EModifierCapsLock)
-		iTest->SimulateKeyDownUp(EStdKeyCapsLock);
-	if (mods&EModifierNumLock)
-		iTest->SimulateKeyDownUp(EStdKeyNumLock);
-	//Make sure all the keys we test are in the up state
-	iTest->SimulateKeyDownUp(EStdKeyLeftShift);
-	iTest->SimulateKeyDownUp(EStdKeyRightShift);
-	iTest->SimulateKeyDownUp(EStdKeyLeftFunc);
-	iTest->SimulateKeyDownUp(EStdKeyLeftCtrl);
-	iTest->SimulateKeyDownUp(EStdKeyRightCtrl);
-	mods=TheClient->iWs.GetModifierState();
-	_LIT(KLog,"Initial Modifiers state 0x%x (ideally should be zero)");
-	LOG_MESSAGE2(KLog,mods);
-	iTest->DelayIfFullRomL();
-
-#if !defined(TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA)
-	// 2d or 3d pointer?
-	if(HAL::Get(HALData::EPointer3D,iIs3DPointer)!=KErrNone)
-		{
-		iIs3DPointer=EFalse;
-		}
-#endif		
-	}
-
-void CTEventTest::Failed()
-	{
-#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS	
-#ifndef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA  	
-   if(iTimeOutCallback)
-        {
-        iTimeOutCallback->Cancel();
-        iTimeOutCallback->Deque();
-        delete iTimeOutCallback;
-        iTimeOutCallback = NULL;
-        }
-    TEST(EFalse);
-#endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-#endif // SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
-	CActiveScheduler::Stop();
-	iFailed=ETrue;
-	}
-
-void CTEventTest::CheckTimeInterval(const TTimeIntervalMicroSeconds32 &aTime,TInt aCheckTime)
-	{
-	TEST(aTime.Int()==aCheckTime);
-	if (aTime.Int()!=aCheckTime)
-		INFO_PRINTF3(_L("aTime.Int()==aCheckTime - Expected: %d, Actual: %d"), aCheckTime, aTime.Int());
-	}
-
-void CTEventTest::KeyRepeatRate(TInt aInitialRepeat, TInt aRepeat)
-	{
-	TheClient->iWs.SetKeyboardRepeatRate(TTimeIntervalMicroSeconds32(aInitialRepeat), TTimeIntervalMicroSeconds32(aRepeat));
-	TTimeIntervalMicroSeconds32 initialTime;
-	TTimeIntervalMicroSeconds32 time;
-	TheClient->iWs.GetKeyboardRepeatRate(initialTime,time);
-	CheckTimeInterval(initialTime,aInitialRepeat);
-	CheckTimeInterval(time,aRepeat);
-	}
-
-void CTEventTest::DoubleClickSettings(TInt aInterval, TInt aDistance)
-	{
-	TheClient->iWs.SetDoubleClick(TTimeIntervalMicroSeconds32(aInterval), aDistance);
-	TTimeIntervalMicroSeconds32 interval;
-	TInt distance;
-	TheClient->iWs.GetDoubleClickSettings(interval, distance);
-	CheckTimeInterval(interval,aInterval);
-	TEST(aDistance==distance);
-	if (aDistance!=distance)
-		INFO_PRINTF3(_L("aDistance==distance - Expected: %d, Actual: %d"), distance, aDistance);
-	}
-
-TInt EventCancelFunc(TAny* aClient)
-	{
-	TWsQTEvent event;
-	event.SetType(EEventModifiersChanged);
-	((TModifiersChangedEvent *)event.EventData())->iChangedModifiers=0;
-	((TModifiersChangedEvent *)event.EventData())->iModifiers=0;
-	TheClient->iWs.SendEventToWindowGroup(TheClient->iGroup->GroupWin()->Identifier(),event);
-//
-	TRequestStatus status;
-	((CTClient *)aClient)->iWs.EventReady(&status);
-	((CTClient *)aClient)->iWs.EventReadyCancel();
-	User::WaitForRequest(status);
-	return(KErrNone);
-	}
-
-void CTEventTest::General()
-	{
-	TWsQTEvent event;
-	event.SetType(EEventModifiersChanged);
-	((TModifiersChangedEvent *)event.EventData())->iChangedModifiers=0;
-	((TModifiersChangedEvent *)event.EventData())->iModifiers=0;
-	TheClient->iWs.SendEventToWindowGroup(TheClient->iGroup->GroupWin()->Identifier(),event);
-	TCallBack callBack(EventCancelFunc,TheClient);
-	TheClient->SetCancelFunction(callBack);
-//
-	TTimeIntervalMicroSeconds32 oldInitialTime;
-	TTimeIntervalMicroSeconds32 oldTime;
-	TheClient->iWs.GetKeyboardRepeatRate(oldInitialTime,oldTime);
-//
-	KeyRepeatRate(EKeyboardInitialRepeat1, EKeyboardRepeat1);
-	KeyRepeatRate(EKeyboardInitialRepeat2, EKeyboardRepeat2);
-	KeyRepeatRate(EKeyboardInitialRepeat3+200, EKeyboardRepeat3); // Max initial repeat with normal keyboard repeat value
-	KeyRepeatRate(EKeyboardInitialRepeat3, EKeyboardRepeat7+200); // Max key and initial repeat
-	KeyRepeatRateNegTest(EKeyboardInitialRepeat4, EKeyboardRepeat4); // -ve initial repeat
-	KeyRepeatRateNegTest(EKeyboardInitialRepeat2, EKeyboardRepeat6); // -ve keyboard repeat
-	#if defined __WINS__ || defined __WINSCW__
-	KeyRepeatRateNegTest(EKeyboardInitialRepeat3+400, EKeyboardRepeat5); // More than max initial repeat
-	#endif//defined __WINS__ || defined __WINSCW__
-	DoubleClickSettings(EDoubleClickTime1,EDoubleClickGap1);
-	DoubleClickSettings(EDoubleClickTime2,EDoubleClickGap2);
-	TheClient->iWs.SetKeyboardRepeatRate(oldInitialTime,oldTime);
-//
-	}
-
-#define UNIQUE_PRIORITY 123
-void CTEventTest::General2()
-	{
-	RWindowGroup& group=*TheClient->iGroup->GroupWin();
-	TInt priority=group.OrdinalPriority();
-	TInt position=group.OrdinalPosition();
-	TInt priorityGain=TheClient->iWs.GetWindowGroupOrdinalPriority(group.Identifier())-priority;
-	group.SetOrdinalPosition(0,UNIQUE_PRIORITY);
-	TWsQTEvent event;
-	event.SetType(EEventModifiersChanged);
-	((TModifiersChangedEvent *)event.EventData())->iChangedModifiers=0;
-	((TModifiersChangedEvent *)event.EventData())->iModifiers=0;
-	TheClient->iWs.SendEventToAllWindowGroups(UNIQUE_PRIORITY+priorityGain,event);
-	TCallBack callBack(EventCancelFunc,TheClient);
-	TheClient->SetCancelFunction(callBack);
-	group.SetOrdinalPosition(position,priority);
-	}
-
-void CTEventTest::AddExpectedKey(TInt aEventCode, TInt aScanCode, TInt aCode/*=0*/, TInt aRepeats/*=0*/, TUint aModifiers/*=0*/)
-	{
-	TPckgBuf<TWsEvent> evtPkg;
-	TWsEvent& event=evtPkg();
-	if (aEventCode==EEventKey && aCode==0)
-		aCode=aScanCode;
-	event.SetType(aEventCode);
-	event.SetHandle((TInt)iQueueClient->iGroup);
-	event.Key()->iCode=aCode;
-	event.Key()->iScanCode=aScanCode;
-	event.Key()->iModifiers=aModifiers;
-	event.Key()->iRepeats=aRepeats;
-	iQueueClient->AddExpectedEvent(event);
-	if (iAddToClick)
-		iClick.CommandReply(EClickEventAdd,evtPkg);
-	}
-
-void CTEventTest::AddExpectedKeyDownUp(TInt aScanCode, TInt aCode/*=0*/, TInt aRepeats/*=0*/, TUint aModifiers/*=0*/)
-	{
-	__ASSERT_DEBUG(aScanCode<'a' || aScanCode>'z',AutoPanic(EAutoPanicScanCapital));
-	AddExpectedKey(EEventKeyDown,aScanCode,0,aRepeats,aModifiers);
-	AddExpectedKey(EEventKey,aScanCode,aCode,aRepeats,aModifiers);
-	AddExpectedKey(EEventKeyUp,aScanCode,0,aRepeats,aModifiers);
-	}
-
-void CTEventTest::AddExpectedEvent(TInt aEventCode, CTWinBase* aWin)
-	{
-	TWsQTEvent event;
-	event.iType=aEventCode;
-	event.iHandle=REINTERPRET_CAST(TInt,aWin);
-	iQueueClient->AddExpectedEvent(event);
-	}
-
-void CTEventTest::AddExpectedEvent(TInt aEventCode, RWindowGroup* aWindow)
-	{
-	TWsQTEvent event;
-	event.iType=aEventCode;
-	event.iHandle=(TUint32)aWindow;
-	iQueueClient->AddExpectedEvent(event);
-	}
-
-void CTEventTest::AddExpectedEvent(TInt aEventCode)
-	{
-	AddExpectedEvent(aEventCode,iQueueClient->iGroup);
-	}
-
-void CTEventTest::AddExpectedErrorMessage(TWsErrorMessage::TErrorCategory aCategory, TInt aError)
-	{
-	TWsQTEvent event;
-	event.iType=EEventErrorMessage;
-	event.iHandle=(TInt)iQueueClient->iGroup;
-	event.ErrorMessage()->iErrorCategory=aCategory;
-	event.ErrorMessage()->iError=aError;
-	iQueueClient->AddExpectedEvent(event);
-	}
-
-void CTEventTest::CalculatePointerEvent(TWsEvent& aEvent,TPointerEvent::TType aType, TPoint aPos)
-	{
-#if !defined(TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA)
-	TAdvancedPointerEvent& ptrEvent=*aEvent.Pointer();
-	aEvent.SetType(EEventPointer);
-	ptrEvent.iParentPosition=aPos;
-	// SetHandle must be done after iParentPosition is set, but before iPosition is set.
-	aEvent.SetHandle(reinterpret_cast<TInt>(iQueueClient->GetHandle(aPos)));	
-	const TPoint3D point3D(aPos.iX, aPos.iY, 0);
-	const TInt pointerEventModifiers=0;
-	const TUint8 pointerNumber=0;
-	aEvent.InitAdvancedPointerEvent(aType,pointerEventModifiers,point3D,pointerNumber);
-#else	
-	TPointerEvent& ptrEvent=*aEvent.Pointer();
-	aEvent.SetType(EEventPointer);
-	ptrEvent.iParentPosition=aPos;		//Must be done before next line
-	aEvent.SetHandle(REINTERPRET_CAST(TInt,iQueueClient->GetHandle(aPos)));
-	ptrEvent.iType=aType;
-	ptrEvent.iModifiers=0;
-	ptrEvent.iPosition=aPos;
-#endif
-	}
-
-void CTEventTest::CalculatePointerCaptureEvent(TWsEvent& aEvent, TPointerEvent::TType aType, TPoint aPos, TInt aHandle)
-	{
-	TPointerEvent& ptrEvent=*aEvent.Pointer();
-	aEvent.SetType(EEventPointer);
-	ptrEvent.iParentPosition=aPos;		//Must be done before next line
-	if(iVisWins1 && iVisWins2)
-		{
-		if (TRect(iQueueClient->ChildTopLeft(),iQueueClient->ChildSize()).Contains(aPos) &&
-			!TRect(iQueueClient->ChildTopLeft()+TPoint(15,15),iQueueClient->ChildSize()).Contains(aPos))
-			{
-			aPos-=iQueueClient->ChildTopLeft();	//Pointer is on the first window
-			aEvent.SetHandle((TInt)iVisWins1);
-			}
-		else if (TRect(iQueueClient->ChildTopLeft()+TPoint(15,15),iQueueClient->ChildSize()).Contains(aPos))
-			{
-			aPos-=(iQueueClient->ChildTopLeft()+TPoint(15,15));	//Pointer is on the second window
-			aEvent.SetHandle((TInt)iVisWins2);
-			}
-		else if (TRect(TPoint(EWinPositionX,EWinPositionY),TSize(EWinWidth,EWinHeight)).Contains(aPos))
-			{
-			aPos-=TPoint(EWinPositionX,EWinPositionY);	//Pointer is on the parent window
-			aEvent.SetHandle((TInt)iQueueClient->iWin);
-			}
-		else
-			{
-			aEvent.SetHandle((TInt)0);		//Pointer is not in the same window group
-			}
-		}
-	ptrEvent.iType=aType;
-	ptrEvent.iModifiers=0;
-	if(aHandle!=0 && aHandle!=aEvent.Handle())
-		{
-		aEvent.SetHandle(aHandle);
-		ptrEvent.iPosition=ptrEvent.iParentPosition-(iQueueClient->ChildTopLeft()+TPoint(15,15));
-		}
-	else
-		{
-		ptrEvent.iPosition=aPos;
-		}
-	}
-
-void CTEventTest::AddExpectedPointerCapture(TPointerEvent::TType aType, TPoint aPos, TInt aHandle)
-	{
-	TPckgBuf<TWsQTEvent> evtPkg;
-	CalculatePointerCaptureEvent(evtPkg(),aType,aPos,aHandle);
-	iQueueClient->AddExpectedEvent(evtPkg());
-	}
-
-void CTEventTest::AddExpectedPointer(TPointerEvent::TType aType, TPoint aPos)
-	{
-	TPckgBuf<TWsQTEvent> evtPkg;
-	CalculatePointerEvent(evtPkg(),aType,aPos);
-	iQueueClient->AddExpectedEvent(evtPkg());
-	if (iAddToClick)
-		{
-		evtPkg().Pointer()->iParentPosition+=TPoint(EWinPositionX,EWinPositionY);
-		iClick.CommandReply(EClickEventAdd,evtPkg);
-		}
-	}
-
-void CTEventTest::AddExpectedPointerClick(TPointerEvent::TType aType, TPoint aPos)
-	{
-	TPckgBuf<TWsQTEvent> evtPkg;
-	CalculatePointerEvent(evtPkg(),aType,aPos);
-	evtPkg().Pointer()->iParentPosition+=TPoint(EWinPositionX,EWinPositionY);
-	iClick.CommandReply(EClickEventAdd,evtPkg);
-	}
-
-void CTEventTest::AddExpectedPointerDownUp(TPoint aPos)
-	{
-	AddExpectedPointer(TPointerEvent::EButton1Down,aPos);
-	AddExpectedPointer(TPointerEvent::EButton1Up,aPos);
-	}
-
-void CTEventTest::AddExpectedPointerScr(TPointerEvent::TType aType, TPoint aPos)
-	{
-	AddExpectedPointer(aType,TPoint(aPos.iX-EWinPositionX,aPos.iY-EWinPositionY));
-	}
-
-void CTEventTest::AddExpectedPointerDownUpScr(TPoint aPos)
-	{
-	AddExpectedPointerDownUp(TPoint(aPos.iX-EWinPositionX,aPos.iY-EWinPositionY));
-	}
-
-void CTEventTest::AddExpectedModifiersChanged(TInt aChangedModifiers, TInt aModifiers)
-	{
-	TWsQTEvent event;
-	event.iType=EEventModifiersChanged;
-	event.iHandle=(TInt)iQueueClient->iGroup;
-	event.ModifiersChanged()->iChangedModifiers=aChangedModifiers;
-	event.ModifiersChanged()->iModifiers=aModifiers;
-	iQueueClient->AddExpectedEvent(event);
-	}
-
-void CTEventTest::AddExpectedEnterExit(TInt aEventCode, TPoint aPos)
-	{
-	AddExpectedEvent(aEventCode,iQueueClient->GetHandle(aPos));
-	}
-
-void CTEventTest::AddExpectedKeyAnim(TRawEvent::TType aEventCode, TInt aScanCode, TBool aEat)
-	{
-	TAnimRawEvent event;
-	event.iRawEvent.Set(aEventCode,aScanCode);
-	event.iEat=aEat;
-	TInt retVal = iAnim->AddEvent(event);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("iAnim->AddEvent(event) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
-
-	if (!aEat)
-		AddExpectedKey((aEventCode==TRawEvent::EKeyDown ? EEventKeyDown:EEventKeyUp),aScanCode);
-	}
-
-void CTEventTest::AddExpectedPointerAnim(TRawEvent::TType aEventCode, TPoint aPoint, TBool aEat/*=ETrue*/)
-	{
-	TAnimRawEvent event;
-	event.iRawEvent.Set(aEventCode,aPoint.iX,aPoint.iY);
-	event.iEat=aEat;
-
-	TInt retVal = iAnim->AddEvent(event);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("iAnim->AddEvent(event) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
-
-	if (!aEat)
-		AddExpectedPointer((aEventCode==TRawEvent::EButton1Down ? TPointerEvent::EButton1Down:TPointerEvent::EButton1Up)
-																			,aPoint-TPoint(EWinPositionX,EWinPositionY));
-	}
-
-void CTEventTest::AddExpectedVisibilityChange(TUint aFlags)
-	{
-	TWsQTEvent event;
-	event.iType=EEventWindowVisibilityChanged;
-	event.iHandle=(TInt)iVisWins1;
-	event.VisibilityChanged()->iFlags=aFlags;
-	iQueueClient->AddExpectedEvent(event);
-	}
-
-void CTEventTest::AddExpectedVisibilityChange(TUint aFlags, CTBlankWindow* aWindow)
-    {
-    TWsQTEvent event;
-    event.iType=EEventWindowVisibilityChanged;
-    event.iHandle=(TInt)aWindow;
-    event.VisibilityChanged()->iFlags=aFlags;
-    iQueueClient->AddExpectedEvent(event);
-    }
-
-void CTEventTest::SimulatePointerWin(TRawEvent::TType aType, TInt aX, TInt aY)
-	{
-	SimulatePointer(aType,EWinPositionX+aX,EWinPositionY+aY+iYOffset);
-	}
-
-void CTEventTest::SimulatePointerDownUpWin(TInt aX, TInt aY)
-	{
-	iTest->SimulatePointerDownUp(EWinPositionX+aX,EWinPositionY+aY+iYOffset);
-	}
-
-void CTEventTest::SimulatePointer(TRawEvent::TType aType, TInt aX, TInt aY)
-    {
-    iTest->SimulatePointer(aType,aX,aY+iYOffset);
-    }
-
-#if !defined(TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA)
-void CTEventTest::SimulateButton1DownWithSimulatedMove(TInt aX, TInt aY)
-	{
-	if(iIs3DPointer)
-		{
-		// With advanced pointer events we can have an XYInputType of Pointer coupled with 3DPointer
-		// which now makes MovesAvailable return ETrue rahter than EFalse, which in turn stops the simulated
-		// Emove from being generated.
-		// So...
-		// If MovesAvailable() returns ETrue, then this move will be used, and the WServ simulated move wont be generated
-		// If MovesAvailable() returns EFalse, then this move will be filtered out, and the WServ simulated move will be generated		
-		SimulatePointer(TRawEvent::EPointerMove,aX,aY);
-		}
-	// then the original button down event
-	SimulatePointer(TRawEvent::EButton1Down,aX,aY);	
-	}
-#endif
-
-void CTEventTest::NextSetOfEventsL()
-	{
-	iQueueClient->ResetCount(iEventSet);
-	switch (iTest->iState)
-		{
-	case 1:
-		QueuePurge_NextSetOfEventsL();
-		break;
-	case 2:
-		SendEventTest_NextSetOfEvents();
-		break;
-	case 4:
-		InvisibleWindow_NextSetOfEvents();
-		break;
-	case 5:
-		JavaAdditions_NextSetOfEvents();
-		break;
-	case 6:
-		WinCap_NextSetOfEvents();
-		break;
-	case 7:
-		XyInputType_NextSetOfEvents();
-		break;
-	case 8:
-		MovingPointerCursor_NextSetOfEventsL();
-		break;
-	case 9:
-		RotatedMode_NextSetOfEventsL();
-		break;
-	case 10:
-		AnimEvent_NextSetOfEventsL();
-		break;
-	case 11:
-		FocusChanged_NextSetOfEventsL();
-		break;
-	case 12:
-		StopEvents_NextSetOfEventsL();
-		break;
-	case 13:
-		VirtualKeyboard_NextSetOfEventsL();
-		break;
-	case 14:
-		KeyClicks_NextSetOfEvents();
-		break;
-	case 15:
-		CaptureLong_NextSetOfEventsL();
-		break;
-	case 16:
-		Password_NextSetOfEvents();
-		break;
-	case 17:
-		GroupListChanged_NextSetOfEventsL();
-		break;
-	case 18:
-		RepeatableKeysL();
-		break;
-	case 19:
-		ScreenScaling_NextSetOfEventsL();
-		break;
-	case 20:
-		VisibilityChanged_NextSetOfEventsL();
-		break;
-	case 21:
-		CheckTimeStamp_NextSetOfEventsL();
-		break;
-	case 22:
-		PointerCapture_NextSetOfEventsL();
-		break;
-	case 23:
-		EventHandlerRemoval_NextSetOfEventsL();
-		break;	
-	// Note that case 24 (which is KTest24) does not use NextSetOfEventsL()	
-	case 25:
-		MismatchedCapture_NextSetOfEventsL();
-		break;
-	case 26:
-		PointerBufferPurge_NextSetOfEventsL();		
-		break;	
-	case 27:
-	    RawEventRepeatTest_NextSetOfEventsL();
-	    break;
-	    
-#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS	    
-#ifndef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA 	    
-    case 28:
-        SurfaceVisibilityChanged1_NextSetOfEventsL();
-        break;
-    case 29:
-        SurfaceVisibilityChanged2_NextSetOfEventsL();
-        break;
-    case 30:
-        SurfaceVisibilityChanged3_NextSetOfEventsL();
-        break;
-#endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-#endif // SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
-        
-	default:
-		AutoPanic(EAutoPanicWrongTest);
-		}
-	}
-
-void CTEventTest::TriggerOomMessage(TTimeIntervalMinutes aPeriod)
-	{
-	TTime time;
-	if (aPeriod.Int()!=0) // adjust time to affect Oom message triggering
-		{
-		time.HomeTime();
-		User::SetHomeTime(time+aPeriod);
-		}
-	RBlankWindow win(TheClient->iWs);
-	win.Construct(*(TheClient->iGroup->WinTreeNode()),1);
-	win.SetColor(TRgb::Gray4(1));
-	win.SetExtent(TPoint(10,10),TheClient->iGroup->Size()-TSize(20,20));
-	TheClient->iWs.HeapSetFail(RHeap::EDeterministic,1);
-	win.Activate();
-	TheClient->iWs.Flush();
-	TheClient->iWs.HeapSetFail(RHeap::ENone,0);
-	if (aPeriod.Int()!=0)
-		{
-		time.HomeTime();
-		User::SetHomeTime(time-aPeriod);
-		}
-	win.Close();
-	}
-
-TBool CTEventTest::SetClickType(TClickOutputModes aType)
-	{
-	TPckgBuf<TInt> intPkg;
-	intPkg()=aType;
-	TInt err=iClick.CommandReply(EClickCommandSetOutput,intPkg);
-	if (err!=KErrNone)
-		Failed();
-	return err;
-	}
-
-void CTEventTest::CreateEventTestGroup()
-	{
-	iEventTestGroup=RWindowGroup(TheClient->iWs);
-	iEventTestGroup.Construct(123, EFalse);
-	iEventTestGroup.SetName(_L("Fred"));
-	}
-
-void CTQueueClient::CreateEventTestGroupOnSecondScreenL()
-	{
-	const TInt KSndScreenNo=1;
-	iSndScreen=new(ELeave) CWsScreenDevice(iWs);
-	User::LeaveIfError(iSndScreen->Construct(KSndScreenNo));
-	iWinGp1 = new(ELeave) RWindowGroup(iWs);
-	User::LeaveIfError(iWinGp1->Construct((TUint32)iWinGp1,ETrue,iSndScreen));
-	iWinGp2 = new (ELeave) RWindowGroup(iWs);
-	User::LeaveIfError(iWinGp2->Construct((TUint32)iWinGp2,ETrue,iSndScreen));
-	}
-
-void CTQueueClient::CloseEventTestGroupOnSecondScreen()
-	{
-	if(iWinGp1)
-		{
-		iWinGp1->Close();
-		delete iWinGp1;
-		iWinGp1=NULL;
-		}
-	if(iWinGp2)
-		{
-		iWinGp2->Close();
-		delete iWinGp2;
-		iWinGp2=NULL;
-		}
-	if(iSndScreen)
-		{
-		delete iSndScreen;
-		iSndScreen = NULL;
-		}
-	}
-
-void CTEventTest::CloseEventTestGroup()
-	{
-	iEventTestGroup.Close();
-	}
-
-void CTEventTest::CreateAndCloseEventTestGroup()
-//
-// Create and close a window group to test sending of group changed messages
-//
-	{
-	CreateEventTestGroup();
-	CloseEventTestGroup();
-	}
-
-void CTEventTest::QueuePurge_NextSetOfEventsL()
-	{
-#if defined(LOGGING)
-	TLogMessageText logMessageText;
-	_LIT(KSet,"QueuePurge SetOfEvents: %d of 11");
-	logMessageText.Format(KSet,iEventSet);
-	TheClient->LogMessage(logMessageText);
-#endif
-	iTheClientFlush=TheClient->iWs.SetAutoFlush(ETrue);
-	iQuequeClientFlush=iQueueClient->iWs.SetAutoFlush(ETrue);
-	switch(iEventSet++)
-		{
-		case 0:
-			iTest->SimulateKey(TRawEvent::EKeyDown,32);
-			iTest->SimulateKey(TRawEvent::EKeyUp,32);
-			CreateAndCloseEventTestGroup();
-			SimulatePointer(TRawEvent::EButton1Down,10,20);
-			SimulatePointer(TRawEvent::EButton1Up,20,30);
-			iTest->SimulateEvent(TRawEvent::ESwitchOn);
-			CreateAndCloseEventTestGroup();
-		//
-			AddExpectedEvent(EEventFocusGained);
-			AddExpectedKey(EEventKeyDown,32);
-			AddExpectedKey(EEventKeyUp,32);
-			AddExpectedEvent(EEventWindowGroupsChanged);
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(10-EWinPositionX,20-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(20-EWinPositionX,30-EWinPositionY));
-			AddExpectedEvent(EEventSwitchOn);
-			break;
-		case 1:
-			{
-			for(TInt count=0;count<100;count++)
-				{
-				iTest->SimulateKey(TRawEvent::EKeyDown,'A'+(count%26));
-				iTest->SimulateKey(TRawEvent::EKeyUp,'A'+(count%26));
-				}
-			for(TInt count2=0;count2<EMaxEventQueueSize/3;count2++)
-				{
-				AddExpectedKey(EEventKeyDown,'A'+(count2%26));
-				AddExpectedKey(EEventKey,'A'+(count2%26),'a'+(count2%26));
-				AddExpectedKey(EEventKeyUp,'A'+(count2%26));
-				}
-			AddExpectedKey(EEventKeyDown,'A'+(99%26));
-			AddExpectedKey(EEventKeyUp,'A'+(99%26));
-			}
-			break;
-		case 2:
-			{
-			User::LeaveIfError(iQueueClient->iGroup->GroupWin()->EnableModifierChangedEvents(0xFFFFFFFF, EEventControlOnlyWhenVisible));
-			for(TInt count=0;count<20;count++)
-				{
-				iTest->SimulateEvent(TRawEvent::ESwitchOn);
-				iTest->SimulateEvent(TRawEvent::ESwitchOn);
-				iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeyLeftShift);
-				iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeyRightShift);
-				iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeyRightShift);
-				iTest->SimulateEvent(TRawEvent::ESwitchOn);
-				iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeyLeftShift);
-				}
-			for(TInt count2=0;count2<60;count2++)
-				iTest->SimulateKey(TRawEvent::EKeyDown,'A');
-			AddExpectedEvent(EEventSwitchOn);
-			AddExpectedModifiersChanged(EModifierLeftShift|EModifierRightShift|EModifierShift,0);
-			for(TInt count3=0;count3<EMaxEventQueueSize-2;count3++)
-				AddExpectedKey(EEventKeyDown,'A');
-			iQueueClient->iGroup->GroupWin()->DisableModifierChangedEvents();
-			}
-			break;
-		case 3:
-			{
-			SimulatePointer(TRawEvent::EButton1Up,10,20);
-			SimulatePointer(TRawEvent::EButton2Up,11,22);
-			SimulatePointer(TRawEvent::EButton1Down,12,23);
-			SimulatePointer(TRawEvent::EPointerMove,13,24);
-			SimulatePointer(TRawEvent::EButton3Down,15,25);
-			SimulatePointer(TRawEvent::EButton1Up,14,24);
-			for(TInt count2=0;count2<60;count2++)
-				iTest->SimulateKey(TRawEvent::EKeyDown,'A');
-			SimulatePointer(TRawEvent::EButton3Up,15,25); // Should get stripped by unmatched purged down handling code
-			iTest->SimulateKey(TRawEvent::EKeyUp,'A');	// To stop repeats
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(10-EWinPositionX,20-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton2Up, TPoint(11-EWinPositionX,22-EWinPositionY));
-			for(TInt count3=0;count3<EMaxEventQueueSize-2;count3++)
-				AddExpectedKey(EEventKeyDown,'A');
-			}
-			break;
-		case 4:
-			{
-			SimulatePointer(TRawEvent::EButton1Up,10,20);
-			SimulatePointer(TRawEvent::EButton2Up,11,22);
-			iTest->SimulateKey(TRawEvent::EKeyDown,'B');
-			SimulatePointer(TRawEvent::EButton1Down,12,23);
-			SimulatePointer(TRawEvent::EPointerMove,13,24);
-			iTest->SimulateKey(TRawEvent::EKeyUp,'B');
-			SimulatePointer(TRawEvent::EButton3Down,15,25);
-			SimulatePointer(TRawEvent::EButton1Up,14,24);
-			iQueueClient->iWs.PurgePointerEvents();
-			iTest->SimulateEvent(TRawEvent::ESwitchOn);
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(10-EWinPositionX,20-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton2Up, TPoint(11-EWinPositionX,22-EWinPositionY));
-			AddExpectedKey(EEventKeyDown,'B');
-			AddExpectedKey(EEventKey,'B','b');
-			AddExpectedKey(EEventKeyUp,'B');
-//			AddExpectedPointer(TPointerEvent::EButton3Down, TPoint(15-EWinPositionX,25-EWinPositionY));
-			AddExpectedEvent(EEventSwitchOn);	// To check pointer events purged okay
-			}
-			break;
-		case 5:
-			CreateEventTestGroup();
-			AddExpectedEvent(EEventWindowGroupsChanged);
-			break;
-		case 6:
-			CloseEventTestGroup();
-			AddExpectedEvent(EEventWindowGroupsChanged);
-			break;
-		case 7:
-			iQueueClient->iGroup->GroupWin()->DisableGroupChangeEvents();
-			CreateAndCloseEventTestGroup();
-			iTest->SimulateEvent(TRawEvent::ESwitchOn);
-			AddExpectedEvent(EEventSwitchOn);
-			break;
-		case 8:
-			SimulatePointer(TRawEvent::EButton1Down,12,23);
-			iQueueClient->iWs.PurgePointerEvents();
-			SimulatePointer(TRawEvent::EButton1Up,13,24);
-			SimulatePointer(TRawEvent::EButton2Down,12,23);
-			iQueueClient->iWs.PurgePointerEvents();
-			SimulatePointer(TRawEvent::EButton2Up,13,24);
-			SimulatePointer(TRawEvent::EButton3Down,12,23);
-			iQueueClient->iWs.PurgePointerEvents();
-			SimulatePointer(TRawEvent::EButton3Up,13,24);
-//
-			SendEvent(EEventUser);
-			AddExpectedEvent(EEventUser);
-			break;
-		case 9:
-			{
-			for(TInt count5=0;count5<500;count5++)
-				{
-				RWindowGroup group(TheClient->iWs);
-				group.Construct(ENullWsHandle);
-				group.EnableReceiptOfFocus(EFalse);
-				group.Close();
-				SimulatePointer(TRawEvent::EButton1Up,10,20);
-				}
-			for(TInt count4=0;count4<EMaxEventQueueSize;count4++)
-				AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(10-EWinPositionX,20-EWinPositionY));
-			}
-			break;
-		case 10:
-			{
-			RWindowGroup *group=iQueueClient->iGroup->GroupWin();
-			User::LeaveIfError(group->EnableOnEvents(EEventControlOnlyWithKeyboardFocus));
-			iTest->SimulateEvent(TRawEvent::ESwitchOn);
-			SimulatePointer(TRawEvent::EButton3Down,EWinPositionX,EWinPositionY);
-			AddExpectedEvent(EEventSwitchOn);
-			AddExpectedPointer(TPointerEvent::EButton3Down, TPoint(0,0));
-//
-			group->SetOrdinalPosition(-1);
-			TheClient->iWs.Finish();
-			iTest->SimulateEvent(TRawEvent::ESwitchOn);	// Shouldn't get it as in background this time
-			AddExpectedEvent(EEventFocusLost);
-			group->SetOrdinalPosition(0);
-			TheClient->iWs.Finish();
-			AddExpectedEvent(EEventFocusGained);
-//
-			User::LeaveIfError(group->EnableOnEvents(EEventControlOnlyWhenVisible));
-			User::LeaveIfError(group->EnableModifierChangedEvents(EModifierShift, EEventControlOnlyWhenVisible));
-			iTest->SimulateEvent(TRawEvent::ESwitchOn);	// Should get this as window still visible
-			AddExpectedEvent(EEventSwitchOn);
-			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeyLeftShift);	// Should get modifier changed event as window still visible
-			AddExpectedModifiersChanged(EModifierShift,EModifierShift);
-			AddExpectedKey(EEventKeyDown,EStdKeyLeftShift);
-			SimulatePointer(TRawEvent::EButton1Down,EWinPositionX,EWinPositionY);
-			SimulatePointer(TRawEvent::EButton1Up,EWinPositionX,EWinPositionY);
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(0,0));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(0,0));
-			iQueueClient->iWin->SetPos(TPoint(-EWinWidth,-EWinHeight));
-			TheClient->iWs.Finish();
-// The following two events shouldn't cause an on or mod changed event as the window is now hidden
-			iTest->SimulateEvent(TRawEvent::ESwitchOn);
-			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeyLeftShift);
-			AddExpectedKey(EEventKeyUp,EStdKeyLeftShift);
-//
-			iQueueClient->iWin->SetPos(TPoint(EWinPositionX,EWinPositionY));
-			TheClient->iWs.Finish();
-			}
-			break;
-		case 11:
-			{
-			RWindowGroup *group=iQueueClient->iGroup->GroupWin();
-			SendEvent(EEventUser);
-			AddExpectedEvent(EEventUser);
-
-			if(iTest->IsFullRomL())
-				break;
-//
-// Test focus only messages when with and without focus
-//
-			User::LeaveIfError(group->EnableErrorMessages(EEventControlOnlyWithKeyboardFocus));
-			TriggerOomMessage(TTimeIntervalMinutes(3));
-			AddExpectedErrorMessage(TWsErrorMessage::EDrawingRegion,KErrNoMemory);
-			SendEvent(EEventUser);
-			AddExpectedEvent(EEventUser);
-			group->SetOrdinalPosition(1);
-			TriggerOomMessage(TTimeIntervalMinutes(3));
-			AddExpectedEvent(EEventFocusLost);
-			group->SetOrdinalPosition(0);
-			AddExpectedEvent(EEventFocusGained);
-			SendEvent(EEventUser+1);
-			AddExpectedEvent(EEventUser+1);
-//
-// Test focus only messages when with visible and invisible
-//
-			User::LeaveIfError(group->EnableErrorMessages(EEventControlOnlyWhenVisible));
-			TriggerOomMessage(TTimeIntervalMinutes(3));
-			AddExpectedErrorMessage(TWsErrorMessage::EDrawingRegion,KErrNoMemory);
-			iQueueClient->iWin->SetPos(TPoint(-EWinWidth,-EWinHeight));
-			TriggerOomMessage(TTimeIntervalMinutes(3));
-			SendEvent(EEventUser+2);
-			AddExpectedEvent(EEventUser+2);
-			iQueueClient->iWin->SetPos(TPoint(EWinPositionX,EWinPositionY));
-//
-// Check always mode sends an event
-//
-			User::LeaveIfError(group->EnableErrorMessages(EEventControlAlways));
-			TriggerOomMessage(TTimeIntervalMinutes(3));
-			AddExpectedErrorMessage(TWsErrorMessage::EDrawingRegion,KErrNoMemory);
-//
-			iQueueClient->iWin->SetPos(TPoint(-EWinWidth,-EWinHeight));
-			TriggerOomMessage(TTimeIntervalMinutes(3));
-			AddExpectedErrorMessage(TWsErrorMessage::EDrawingRegion,KErrNoMemory);
-			iQueueClient->iWin->SetPos(TPoint(EWinPositionX,EWinPositionY));
-//
-			group->SetOrdinalPosition(1);
-			AddExpectedEvent(EEventFocusLost);
-			TriggerOomMessage(TTimeIntervalMinutes(3));
-			AddExpectedErrorMessage(TWsErrorMessage::EDrawingRegion,KErrNoMemory);
-			group->SetOrdinalPosition(0);
-			AddExpectedEvent(EEventFocusGained);
-//
-// Check timing of OOM messages
-//
-			TriggerOomMessage(TTimeIntervalMinutes(3));
-			AddExpectedErrorMessage(TWsErrorMessage::EDrawingRegion,KErrNoMemory);
-			TriggerOomMessage(TTimeIntervalMinutes(0));
-			User::After(TTimeIntervalMicroSeconds32(1100000));	// 1.1 second
-			TriggerOomMessage(TTimeIntervalMinutes(0));
-			SendEvent(EEventUser+3);
-			AddExpectedEvent(EEventUser+3);
-			TriggerOomMessage(TTimeIntervalMinutes(3));	// Forward by a 2 minutes plus the 1.1 from previous test should trigger an OOM event
-			AddExpectedErrorMessage(TWsErrorMessage::EDrawingRegion,KErrNoMemory);
-			SendEvent(EEventUser+4);
-			AddExpectedEvent(EEventUser+4);
-			TriggerOomMessage(TTimeIntervalMinutes(-1)); // Clock going backwards should trigger an event
-			AddExpectedErrorMessage(TWsErrorMessage::EDrawingRegion,KErrNoMemory);
-			User::After(TTimeIntervalMicroSeconds32(800000));	// 8/10ths of a second
-			TriggerOomMessage(TTimeIntervalMinutes(0));	// Shouldn't trigger an event
-			SendEvent(EEventUser+5);
-			AddExpectedEvent(EEventUser+5);
-			}
-			break;
-		default:
-			TheClient->iWs.DebugInfo(EWsDebugSetEventQueueTest,ETrue);
-			TRAPD(err, EventQueueExpansionTestL());
-			if (err!=KErrNone)
-				{
-				iFailed=ETrue;
-				}
-			TheClient->iWs.DebugInfo(EWsDebugSetEventQueueTest,EFalse);
-			CActiveScheduler::Stop();
-			break;
-		}
-	TheClient->iWs.SetAutoFlush(iTheClientFlush);
-	iQueueClient->iWs.SetAutoFlush(iQuequeClientFlush);
-	}
-
-// Used for testing PDEF112243.
-// Create RWsSession/RWindowGroup/RBlankWindow in a loop. In case of odd loop, 
-// close the session which causes the previous window to gain focus. Also go 
-// on adding events to the previous session. Along with some change in product
-// code and this test code we get some space/memory before globaleventqueue, 
-// which is the problem faced by licensee for this defect.
-void CTEventTest::EventQueueExpansionTestL()
-	{
-	const TInt numClients = 5;
-	TInt cliHanGrpWin = 777;
-	TInt cliHanBlkWin = 888;
-	TInt pushed=0;
-	RWsSession wsSession[numClients];
-	RWindowGroup groupWin[numClients];
-	RBlankWindow blankWin[numClients];
-	
-	for (TInt i = 0; i < numClients; i++)
-		{
-		User::LeaveIfError(wsSession[i].Connect());
-		CleanupClosePushL(wsSession[i]);
-		
-		groupWin[i] = RWindowGroup(wsSession[i]);
-		User::LeaveIfError(groupWin[i].Construct(cliHanGrpWin++));
-		CleanupClosePushL(groupWin[i]);
-		groupWin[i].DefaultOwningWindow();
-		
-		blankWin[i] = RBlankWindow(wsSession[i]);
-		User::LeaveIfError(blankWin[i].Construct(groupWin[i], cliHanBlkWin++));
-		if (i%2 == 0)
-			{
-			CleanupClosePushL(blankWin[i]);
-			pushed++;
-			}
-		blankWin[i].Activate();
-		
-		if (i%2 == 1)
-			{
-			CleanupStack::Pop(2, &wsSession[i]);
-			wsSession[i].Close();
-			
-			TRawEvent rawEvent;
-			for (TInt count=0; count < 40; count++)
-				{
-				rawEvent.Set(TRawEvent::EKeyDown,'A'+(i%26));
-				wsSession[i-1].SimulateRawEvent(rawEvent);
-
-				rawEvent.Set(TRawEvent::EKeyUp,'A'+(i%26));
-				wsSession[i-1].SimulateRawEvent(rawEvent);
-				}
-			}
-		}
-	CleanupStack::PopAndDestroy(pushed*3, &wsSession[0]);
-	}
-
-void CTEventTest::doSendEvent(TWsEvent &aEvent)
-	{
-	iQueueClient->iWs.SendEventToWindowGroup(iQueueClient->WindowGroupIdentifier(),aEvent);
-	}
-
-void CTEventTest::SendKey(TInt aEventCode, TInt aScanCode, TInt aCode/*=0*/, TInt iRepeats/*=0*/)
-	{
-	TWsEvent event;
-	if (aEventCode==EEventKey && aCode==0)
-		aCode=aScanCode;
-	event.SetType(aEventCode);
-	event.Key()->iCode=aCode;
-	event.Key()->iScanCode=aScanCode;
-	event.Key()->iModifiers=0;
-	event.Key()->iRepeats=iRepeats;
-	doSendEvent(event);
-	}
-
-void CTEventTest::SendEvent(TInt aEventCode)
-	{
-	TWsQTEvent event;
-	event.SetType(aEventCode);
-	doSendEvent(event);
-	}
-
-void CTEventTest::SimulateAndCheck(TPoint aOrigin,TSize aScale,TInt aXOffset,TInt aYOffset,TPointerEvent::TType aEventType,TRect aPointerCursorArea)
-	{
-	TPoint ptCheck=PhysicalToLogical(TPoint(aOrigin.iX+aXOffset,aOrigin.iY+aYOffset)-aOrigin,aScale);
-	if (ptCheck.iX < aPointerCursorArea.iTl.iX)
-		{
-		ptCheck.iX=aPointerCursorArea.iTl.iX;
-		}
-	else if (ptCheck.iX > aPointerCursorArea.iBr.iX)
-		{
-		ptCheck.iX=aPointerCursorArea.iBr.iX;
-		}
-	if (ptCheck.iY < aPointerCursorArea.iTl.iY)
-		{
-		ptCheck.iY=aPointerCursorArea.iTl.iY;
-		}
-	else if (ptCheck.iY > aPointerCursorArea.iBr.iY)
-		{
-		ptCheck.iY=aPointerCursorArea.iBr.iY;
-		}
-	AddExpectedPointer(aEventType,TPoint(ptCheck.iX-EWinPositionX,ptCheck.iY-EWinPositionY));
-	}
-
-void CTEventTest::CheckPointerCursorInDifferentScreenMode(TSizeMode aMode,TPoint aOrigin)
-	{
-	aMode.iOrigin=aOrigin;
-	iQueueClient->iScreen->SetCurrentScreenModeAttributes(aMode);
-	iQueueClient->iScreen->SetAppScreenMode(iCurrentMode);		//This makes the App pick up the new mode parameters
-	TheClient->iScreen->SetAppScreenMode(iCurrentMode);			//Ditto
-	iQueueClient->iScreen->SetScreenMode(iCurrentMode);			//This causes all the windows to be updated
-
-	//.. Tests the general pointer cursor area setting and getting
-	RWsSession& ws=iQueueClient->iWs;
-	TRect rect=ws.PointerCursorArea(iCurrentMode); //ws.PointerCursorArea() by default gets first screen mode's pointer cursor area so use other overloaded function
-	TPoint origin=iQueueClient->iScreen->GetScreenModeOrigin(iCurrentMode);
-	TSize scale=iQueueClient->iScreen->GetScreenModeScale(iCurrentMode);
-	TSize fullScreenModeSize=iQueueClient->iScreen->SizeInPixels();
-	TRect rect1(PhysicalToLogical(TPoint(),scale),PhysicalToLogical(fullScreenModeSize.AsPoint()-origin,scale));
-	TRect rect2=rect1;
-	rect2.Shrink(20,20);
-	ws.SetPointerCursorArea(iCurrentMode,rect1);
-	TEST(ws.PointerCursorArea(iCurrentMode)==rect1);
-	ws.SetPointerCursorArea(iCurrentMode,rect2);
-	TEST(ws.PointerCursorArea(iCurrentMode)==rect2);
-	ws.SetPointerCursorArea(iCurrentMode,rect);
-	TEST(ws.PointerCursorArea(iCurrentMode)==rect);
-
-	//.. Test events are restricted to correct pointer cursor area
-	TRect rectPointerCursorArea(10,10,51,51);
-	iQueueClient->iWs.SetPointerCursorArea(iCurrentMode,rectPointerCursorArea);
-	TPoint screenModeOrigin=iQueueClient->iScreen->GetDefaultScreenModeOrigin();
-
-	SimulatePointer(TRawEvent::EButton1Down,screenModeOrigin.iX+5,screenModeOrigin.iY+5);
-	SimulatePointer(TRawEvent::EButton1Up,screenModeOrigin.iX+25,screenModeOrigin.iY+25);
-	SimulatePointer(TRawEvent::EButton1Down,screenModeOrigin.iX+50,screenModeOrigin.iY+50);
-	SimulatePointer(TRawEvent::EButton1Up,screenModeOrigin.iX+75,screenModeOrigin.iY+75);
-
-	SimulatePointer(TRawEvent::EButton1Down,screenModeOrigin.iX+10,screenModeOrigin.iY+15);
-	SimulatePointer(TRawEvent::EButton1Up,screenModeOrigin.iX+20,screenModeOrigin.iY+5);
-	SimulatePointer(TRawEvent::EButton1Down,screenModeOrigin.iX+35,screenModeOrigin.iY+40);
-	SimulatePointer(TRawEvent::EButton1Up,screenModeOrigin.iX+45,screenModeOrigin.iY+70);
-
-	SimulateAndCheck(screenModeOrigin,aMode.iScreenScale,5,5,TPointerEvent::EButton1Down,rectPointerCursorArea);
-	SimulateAndCheck(screenModeOrigin,aMode.iScreenScale,25,25,TPointerEvent::EButton1Up,rectPointerCursorArea);
-	SimulateAndCheck(screenModeOrigin,aMode.iScreenScale,50,50,TPointerEvent::EButton1Down,rectPointerCursorArea);
-	SimulateAndCheck(screenModeOrigin,aMode.iScreenScale,75,75,TPointerEvent::EButton1Up,rectPointerCursorArea);
-
-	SimulateAndCheck(screenModeOrigin,aMode.iScreenScale,10,15,TPointerEvent::EButton1Down,rectPointerCursorArea);
-	SimulateAndCheck(screenModeOrigin,aMode.iScreenScale,20,5,TPointerEvent::EButton1Up,rectPointerCursorArea);
-	SimulateAndCheck(screenModeOrigin,aMode.iScreenScale,35,40,TPointerEvent::EButton1Down,rectPointerCursorArea);
-	SimulateAndCheck(screenModeOrigin,aMode.iScreenScale,45,70,TPointerEvent::EButton1Up,rectPointerCursorArea);
-	}
-
-void CTEventTest::SendEventTest_NextSetOfEvents()
-	{
-	TTimeIntervalMicroSeconds32 initialTime,time;
-	TheClient->iWs.GetKeyboardRepeatRate(initialTime,time);
-	switch(iEventSet++)
-		{
-		case 0:
-			SendKey(EEventKeyDown,1);
-			SendKey(EEventKeyDown,2);
-			SendEvent(EEventUser);
-			SendKey(EEventKeyUp,1);
-			SendKey(EEventKeyUp,2);
-			SendEvent(EEventUser+1);
-			SendEvent(EEventUser+2);
-//
-			AddExpectedEvent(EEventFocusGained);
-			AddExpectedKey(EEventKeyDown,1);
-			AddExpectedKey(EEventKeyDown,2);
-			AddExpectedEvent(EEventUser);
-			AddExpectedKey(EEventKeyUp,1);
-			AddExpectedKey(EEventKeyUp,2);
-			AddExpectedEvent(EEventUser+1);
-			AddExpectedEvent(EEventUser+2);
-			break;
-		case 1:
-	#if defined(SCREEN_MODE_TESTING)
-			if (iNumScrModes>1)
-				{
-				iQueueClient->iGroup->GroupWin()->EnableScreenChangeEvents();
-
-				if (SetClickType(EClickCheck))
-					return;
-				iAddToClick=ETrue;
-
-				iQueueClient->iScreen->SetScreenMode(1);
-
-				iAddToClick=EFalse;
-				SetClickType(EClickNone);
-
-				AddExpectedEvent(EEventScreenDeviceChanged);
-				SendEvent(EEventUser);
-				AddExpectedEvent(EEventUser);
-				iQueueClient->iGroup->GroupWin()->DisableScreenChangeEvents();
-				if (iQueueClient->iScreen->ScreenModeEnforcement()==ESizeEnforcementPixelsAndRotation)
-					AddExpectedEvent(EEventFocusLost);
-				}
-	#endif
-			SendEvent(EEventUser+1);
-			AddExpectedEvent(EEventUser+1);
-			break;
-		case 2:
-	#if defined(SCREEN_MODE_TESTING)
-			if (iNumScrModes>1)
-				{
-				iQueueClient->iGroup->GroupWin()->EnableScreenChangeEvents();
-
-				if (SetClickType(EClickCheck))
-					return;
-				iAddToClick=ETrue;
-
-				iQueueClient->iScreen->SetScreenMode(0);
-				iQueueClient->iScreen->SetScreenMode(1);
-				iQueueClient->iScreen->SetScreenMode(0);
-
-				iAddToClick=EFalse;
-				SetClickType(EClickNone);
-
-				AddExpectedEvent(EEventScreenDeviceChanged);	// Only one event should get queued
-				if (iQueueClient->iScreen->ScreenModeEnforcement()==ESizeEnforcementPixelsAndRotation)
-					AddExpectedEvent(EEventFocusGained);
-				SendEvent(EEventUser+2);
-				AddExpectedEvent(EEventUser+2);
-				iQueueClient->iGroup->GroupWin()->DisableScreenChangeEvents();
-				}
-	#endif
-			SendEvent(EEventUser+3);
-			AddExpectedEvent(EEventUser+3);
-			break;
-		case 3:
-	#if defined(SCREEN_MODE_TESTING)
-			if (iNumScrModes>1)
-				{
-				iQueueClient->iGroup->GroupWin()->EnableScreenChangeEvents();
-				iQueueClient->iGroup->GroupWin()->DisableScreenChangeEvents();
-
-				if (SetClickType(EClickCheck))
-					return;
-				iAddToClick=ETrue;
-
-				iQueueClient->iScreen->SetScreenMode(0);
-
-				iAddToClick=EFalse;
-				SetClickType(EClickNone);
-
-				SendEvent(EEventUser+1);
-				AddExpectedEvent(EEventUser+1);
-				}
-	#endif
-			SendEvent(EEventUser+4);
-			AddExpectedEvent(EEventUser+4);
-			break;
-		case 4:
-			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeySpace);
-			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+time.Int()/3);
-			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeySpace);
-			AddExpectedKey(EEventKeyDown,EStdKeySpace);
-			AddExpectedKey(EEventKey,EStdKeySpace,' ');
-			AddExpectedKey(EEventKey,EStdKeySpace,' ',1);
-			AddExpectedKey(EEventKeyUp,EStdKeySpace);
-			break;
-		case 5:			//To test sending a key event with iRepeats!=0
-			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeySpace);
-			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+time.Int()/3);
-			SendKey(EEventKey,EStdKeyHome,EKeyHome,0);
-			User::After(initialTime.Int()+time.Int()/3);
-			SendKey(EEventKey,EStdKeyEnd,EKeyEnd,12345);
-			User::After(initialTime.Int()+time.Int()/3);
-			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeySpace);
-			AddExpectedKey(EEventKeyDown,EStdKeySpace);
-			AddExpectedKey(EEventKey,EStdKeySpace,' ');
-			AddExpectedKey(EEventKey,EStdKeySpace,' ',1);
-			AddExpectedKey(EEventKey,EStdKeyHome,EKeyHome);
-			AddExpectedKey(EEventKey,EStdKeySpace,' ',1);
-			AddExpectedKey(EEventKey,EStdKeyEnd,EKeyEnd,1);
-			AddExpectedKey(EEventKeyUp,EStdKeySpace);
-			break;
-		default:
-			CActiveScheduler::Stop();
-			break;
-		}
-	TheClient->iWs.Flush();
-	}
-
-void CTEventTest::InvisibleWindow_NextSetOfEvents()
-	{
-	switch(iEventSet++)
-		{
-		case 0:
-			SimulatePointer(TRawEvent::EButton1Down,45,30);
-			SimulatePointer(TRawEvent::EButton1Up,45,30);
-			SimulatePointer(TRawEvent::EButton1Down,20,10);
-			SimulatePointer(TRawEvent::EButton1Up,20,10);
-			TheClient->iWs.Flush();
-			iQueueClient->iChildWin->BaseWin()->SetVisible(EFalse);
-			iQueueClient->iChildWin->BaseWin()->SetVisible(ETrue);
-			iQueueClient->iWs.Flush();
-			SimulatePointer(TRawEvent::EButton1Down,46,31);
-			SimulatePointer(TRawEvent::EButton1Up,46,31);
-			AddExpectedEvent(EEventFocusGained);
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(20-EWinPositionX,10-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(20-EWinPositionX,10-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(46-EWinPositionX,31-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(46-EWinPositionX,31-EWinPositionY));
-			break;
-		case 1:
-			SimulatePointer(TRawEvent::EButton1Down,21,11);
-			SimulatePointer(TRawEvent::EButton1Up,21,11);
-			SimulatePointer(TRawEvent::EButton1Down,44,30);
-			SimulatePointer(TRawEvent::EButton1Up,44,30);
-			TheClient->iWs.Flush();
-			iQueueClient->iWin->BaseWin()->SetVisible(EFalse);
-			iQueueClient->iWin->BaseWin()->SetVisible(ETrue);
-			iQueueClient->iWs.Flush();
-			SimulatePointer(TRawEvent::EButton1Down,19,12);
-			SimulatePointer(TRawEvent::EButton1Up,19,12);
-			SimulatePointer(TRawEvent::EButton1Down,47,32);
-			SimulatePointer(TRawEvent::EButton1Up,47,32);
-			/*AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(44-EWinPositionX,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(44-EWinPositionX,30-EWinPositionY));*/
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(19-EWinPositionX,12-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(19-EWinPositionX,12-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(47-EWinPositionX,32-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(47-EWinPositionX,32-EWinPositionY));
-			break;
-		default:
-			CActiveScheduler::Stop();
-			break;
-		}
-	TheClient->iWs.Flush();
-	}
-
-#define TOP16A 0xAAAA0000
-#define TOP16B 0x55550000
-void CTEventTest::JavaAdditions_NextSetOfEvents()
-	{
-	switch(iEventSet++)
-		{
-		case 0:
-			SimulatePointer(TRawEvent::EButton1Down,45,30);
-			SimulatePointer(TRawEvent::EButton1Up,45,30);
-			TheClient->iWs.Flush();
-			iQueueClient->iWin->BaseWin()->PointerFilter(EPointerMoveEvents,EPointerGenerateSimulatedMove);
-			iQueueClient->iWs.Flush();
-#if !defined(TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA)
-			SimulateButton1DownWithSimulatedMove(46,31);
-#else
-			SimulatePointer(TRawEvent::EButton1Down,46,31);
-#endif			
-			SimulatePointer(TRawEvent::EButton1Up,46,31);
-			TheClient->iWs.Flush();
-			iQueueClient->iWin->BaseWin()->PointerFilter(EPointerMoveEvents,0);
-			iQueueClient->iWs.Flush();			
-			SimulatePointer(TRawEvent::EButton1Down,20,10);
-			SimulatePointer(TRawEvent::EButton1Up,20,10);
-			TheClient->iWs.Flush();
-			iQueueClient->iWin->BaseWin()->PointerFilter(EPointerMoveEvents,EPointerGenerateSimulatedMove);
-			iQueueClient->iWs.Flush();
-#if !defined(TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA)
-			SimulateButton1DownWithSimulatedMove(21,11);
-#else	
-			SimulatePointer(TRawEvent::EButton1Down,21,11);			
-#endif
-			SimulatePointer(TRawEvent::EButton1Up,21,11);
-			TheClient->iWs.Flush();
-			iQueueClient->iWin->BaseWin()->PointerFilter(EPointerMoveEvents,EPointerMoveEvents);
-			iQueueClient->iWs.Flush();				
-			SimulatePointer(TRawEvent::EButton1Down,22,12);
-			SimulatePointer(TRawEvent::EButton1Up,22,12);
-			TheClient->iWs.Flush();
-			iQueueClient->iWin->BaseWin()->PointerFilter(EPointerMoveEvents,EPointerGenerateSimulatedMove);
-			iQueueClient->iWs.Flush();
-#if !defined(TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA)
-			SimulateButton1DownWithSimulatedMove(23,13);
-#else			
-			SimulatePointer(TRawEvent::EButton1Down,23,13);
-#endif
-			SimulatePointer(TRawEvent::EButton1Up,23,13);
-			TheClient->iWs.Flush();
-			iQueueClient->iWin->BaseWin()->PointerFilter(EPointerMoveEvents,EPointerFilterMove);
-			iQueueClient->iWs.Flush();		
-			SimulatePointer(TRawEvent::EButton1Down,24,14);
-			SimulatePointer(TRawEvent::EButton1Up,24,14);
-			AddExpectedEvent(EEventFocusGained);
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(45-EWinPositionX,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(45-EWinPositionX,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(46-EWinPositionX,31-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(46-EWinPositionX,31-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(46-EWinPositionX,31-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(20-EWinPositionX,10-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(20-EWinPositionX,10-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(21-EWinPositionX,11-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(21-EWinPositionX,11-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(21-EWinPositionX,11-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(22-EWinPositionX,12-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(22-EWinPositionX,12-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(23-EWinPositionX,13-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(23-EWinPositionX,13-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(23-EWinPositionX,13-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(24-EWinPositionX,14-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(24-EWinPositionX,14-EWinPositionY));
-			break;
-		#if defined(__WINS__)
-		case 1:
-			{
-			RWindowGroup *group=iQueueClient->iGroup->GroupWin();
-			group->SetOrdinalPosition(0);
-			iTest->SimulateKey(TRawEvent::EKeyDown,'2'|TOP16A);
-			iTest->SimulateKey(TRawEvent::EKeyUp,'2');
-			TheClient->iWs.Flush();
-			iQueueClient->iWs.SetRemoveKeyCode(EFalse);
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKey(TRawEvent::EKeyDown,'3'|TOP16B);
-			iTest->SimulateKey(TRawEvent::EKeyUp,'3');
-			TheClient->iWs.Flush();
-			iQueueClient->iWs.SetRemoveKeyCode(ETrue);
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKey(TRawEvent::EKeyDown,'4'|TOP16B);
-			iTest->SimulateKey(TRawEvent::EKeyUp,'4');
-			AddExpectedKey(EEventKeyDown,'2');
-			AddExpectedKey(EEventKey,'2',TOP16A>>16);
-			AddExpectedKey(EEventKeyUp,'2');
-			AddExpectedKey(EEventKeyDown,'3'|TOP16B);
-			AddExpectedKey(EEventKey,'3',TOP16B>>16);
-			AddExpectedKey(EEventKeyUp,'3');
-			AddExpectedKey(EEventKeyDown,'4');
-			AddExpectedKey(EEventKey,'4',TOP16B>>16);
-			AddExpectedKey(EEventKeyUp,'4');
-			break;
-			}
-		#endif
-		default:
-			CActiveScheduler::Stop();
-			break;
-		}
-	TheClient->iWs.Flush();
-	}
-
-void CTEventTest::WinCap_NextSetOfEvents()
-	{
-	switch(iEventSet++)
-		{
-		case 0:
-			//iQueueClient->SetChildCapture(RWindowBase::TCaptureEnabled);
-			SimulatePointer(TRawEvent::EButton1Down,35,27);
-			SimulatePointer(TRawEvent::EButton1Up,25,12);
-
-
-			AddExpectedEvent(EEventFocusGained);
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(35-EWinPositionX,27-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(25-EWinPositionX,12-EWinPositionY));
-			break;
-
-
-		default:
-			CActiveScheduler::Stop();
-			break;
-		}
-	TheClient->iWs.Flush();
-	}
-
-void CTEventTest::XyInputType_NextSetOfEvents()
-	{
-	switch(iEventSet++)
-		{
-		case 0:
-			iQueueClient->iWin->BaseWin()->PointerFilter(EPointerMoveEvents|EPointerFilterDrag,EPointerGenerateSimulatedMove);
-			iQueueClient->iWs.Flush();
-#if !defined(TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA)
-			SimulateButton1DownWithSimulatedMove(46,31);
-#else			
-			SimulatePointer(TRawEvent::EButton1Down,46,31);
-#endif
-			SimulatePointer(TRawEvent::EButton1Up,46,31);
-			AddExpectedEvent(EEventFocusGained);
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(46-EWinPositionX,31-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(46-EWinPositionX,31-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(46-EWinPositionX,31-EWinPositionY));
-			break;		//Must do something
-		case 1:
-			{
-			// check if RWindowGroup::SimulatePointerEvent is working (DEF131563)
-			RWindowGroup& group = *iQueueClient->iGroup->GroupWin();
-			TRawEvent event;
-			event.Set(TRawEvent::EButton1Down, 10, 10);
-			group.SimulatePointerEvent(event);
-			event.Set(TRawEvent::EButton1Up, 10, 10);
-			group.SimulatePointerEvent(event);
-			if(!iIs3DPointer)
-				{
-				// simulated move will be generated
-				AddExpectedPointer(TPointerEvent::EMove, TPoint(10 - EWinPositionX, 10 - EWinPositionY));
-				}
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(10 - EWinPositionX, 10 - EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(10 - EWinPositionX, 10 - EWinPositionY));
-			}
-			break;
-		#if defined(__WINS__)
-		case 2:
-#if !defined(TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA)
-			SimulateButton1DownWithSimulatedMove(45,32);
-#else		
-			SimulatePointer(TRawEvent::EButton1Down,45,32);
-#endif
-			SimulatePointer(TRawEvent::EButton1Up,45,32);
-			TheClient->iWs.SimulateXyInputType(EXYInputNone);
-			SimulatePointer(TRawEvent::EButton1Down,44,32);
-			SimulatePointer(TRawEvent::EPointerMove,43,32);
-			SimulatePointer(TRawEvent::EButton1Up,43,31);
-			SimulatePointer(TRawEvent::EButton2Down,44,33);
-			SimulatePointer(TRawEvent::EButton2Up,44,33);
-			SimulatePointer(TRawEvent::EButton3Down,43,32);
-			SimulatePointer(TRawEvent::EButton3Up,43,32);
-			SimulatePointer(TRawEvent::EPointerSwitchOn,48,32);
-			TheClient->iWs.SimulateXyInputType(EXYInputPointer);
-#if !defined(TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA)
-			SimulateButton1DownWithSimulatedMove(47,32);
-#else				
-			SimulatePointer(TRawEvent::EButton1Down,47,32);
-#endif
-			SimulatePointer(TRawEvent::EButton1Up,47,32);
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(45-EWinPositionX,32-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(45-EWinPositionX,32-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(45-EWinPositionX,32-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(47-EWinPositionX,32-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(47-EWinPositionX,32-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(47-EWinPositionX,32-EWinPositionY));
-			break;
-		case 3:
-			iQueueClient->iWin->BaseWin()->PointerFilter(EPointerGenerateSimulatedMove,0);
-			iQueueClient->iWs.Flush();
-			TheClient->iWs.SimulateXyInputType(EXYInputPointer);
-			SimulatePointer(TRawEvent::EButton1Down,49,32);
-			SimulatePointer(TRawEvent::EPointerMove,50,30);
-			SimulatePointer(TRawEvent::EButton1Up,50,30);
-			SimulatePointer(TRawEvent::EButton1Down,51,32);
-			SimulatePointer(TRawEvent::EPointerMove,52,30);
-			SimulatePointer(TRawEvent::EButton1Up,52,30);
-			TheClient->iWs.SimulateXyInputType(EXYInputPointer);
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(49-EWinPositionX,32-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EDrag, TPoint(50-EWinPositionX,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(50-EWinPositionX,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(51-EWinPositionX,32-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EDrag, TPoint(52-EWinPositionX,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(52-EWinPositionX,30-EWinPositionY));
-			break;
-		case 4:
-			SimulatePointer(TRawEvent::EButton1Down,49,31);
-			SimulatePointer(TRawEvent::EButton1Up,49,31);
-			TheClient->iWs.SimulateXyInputType(EXYInputMouse);
-			SimulatePointer(TRawEvent::EPointerMove,50,31);
-			SimulatePointer(TRawEvent::EButton1Down,50,31);
-			SimulatePointer(TRawEvent::EPointerMove,50,30);
-			SimulatePointer(TRawEvent::EButton1Up,50,30);
-			SimulatePointer(TRawEvent::EPointerMove,51,31);
-			SimulatePointer(TRawEvent::EButton1Down,51,31);
-			SimulatePointer(TRawEvent::EPointerMove,51,30);
-			SimulatePointer(TRawEvent::EButton1Up,51,30);
-			TheClient->iWs.SimulateXyInputType(EXYInputPointer);
-			SimulatePointer(TRawEvent::EButton1Down,52,31);
-			SimulatePointer(TRawEvent::EButton1Up,52,31);
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(49-EWinPositionX,31-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(49-EWinPositionX,31-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(50-EWinPositionX,31-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(50-EWinPositionX,31-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EDrag, TPoint(50-EWinPositionX,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(50-EWinPositionX,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(51-EWinPositionX,31-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(51-EWinPositionX,31-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EDrag, TPoint(51-EWinPositionX,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(51-EWinPositionX,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(52-EWinPositionX,31-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(52-EWinPositionX,31-EWinPositionY));
-			break;
-		case 5:
-			SimulatePointer(TRawEvent::EButton1Down,69,31);
-			SimulatePointer(TRawEvent::EButton1Up,69,31);
-			TheClient->iWs.SimulateXyInputType(EXYInputDeltaMouse);
-			SimulatePointer(TRawEvent::EPointerMove,-5,-5);
-			SimulatePointer(TRawEvent::EButton1Down,7,8);
-			SimulatePointer(TRawEvent::EPointerMove,10,-3);
-			SimulatePointer(TRawEvent::EButton1Up,-7,-8);
-			SimulatePointer(TRawEvent::EPointerMove,-4,9);
-			SimulatePointer(TRawEvent::EButton1Down,123,456);
-			SimulatePointer(TRawEvent::EPointerMove,15,13);
-			SimulatePointer(TRawEvent::EButton1Up,-2345,-6789);
-			TheClient->iWs.SimulateXyInputType(EXYInputPointer);
-			SimulatePointer(TRawEvent::EButton1Down,62,31);
-			SimulatePointer(TRawEvent::EButton1Up,62,31);
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(69-EWinPositionX,31-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(69-EWinPositionX,31-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(64-EWinPositionX,26-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(64-EWinPositionX,26-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EDrag, TPoint(74-EWinPositionX,23-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(74-EWinPositionX,23-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(70-EWinPositionX,32-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(70-EWinPositionX,32-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EDrag, TPoint(85-EWinPositionX,45-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(85-EWinPositionX,45-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(62-EWinPositionX,31-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(62-EWinPositionX,31-EWinPositionY));
-			break;
-		#endif
-		default:
-			CActiveScheduler::Stop();
-			break;
-		}
-	TheClient->iWs.Flush();
-	}
-
-void CTEventTest::MovingPointerCursor_NextSetOfEventsL()
-	{
-	switch(iEventSet++)
-		{
-		case 0:
-			iQueueClient->iWin->BaseWin()->PointerFilter(EPointerFilterMove|EPointerFilterDrag,0);
-			iQueueClient->iWin->BaseWin()->SetPointerGrab(EFalse);
-			iQueueClient->iChildWin->BaseWin()->PointerFilter(EPointerFilterMove|EPointerFilterDrag,0);
-			iQueueClient->iChildWin->BaseWin()->SetPointerGrab(EFalse);
-			iQueueClient->iWs.Flush();
-			//AddExpectedEvent(EEventFocusGained);
-			break;
-		#if defined(__WINS__)
-		case 1:
-			TheClient->iWs.SimulateXyInputType(EXYInputMouse);
-			iQueueClient->iChildWin->BaseWin()->PointerFilter(EPointerFilterMove|EPointerFilterDrag,0);
-			iQueueClient->iWin->BaseWin()->PointerFilter(EPointerFilterMove|EPointerFilterDrag,0);
-			iQueueClient->iWin->BaseWin()->SetPointerGrab(EFalse);
-			iQueueClient->iChildWin->BaseWin()->SetPointerGrab(EFalse);
-			iQueueClient->iWs.Flush();
-			SimulatePointer(TRawEvent::EPointerMove,46,31);
-			SimulatePointer(TRawEvent::EButton1Down,46,31);
-			SimulatePointer(TRawEvent::EPointerMove,47,32);
-			SimulatePointer(TRawEvent::EButton1Up,47,32);
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(46-EWinPositionX,31-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(46-EWinPositionX,31-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EDrag, TPoint(47-EWinPositionX,32-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(47-EWinPositionX,32-EWinPositionY));
-			break;
-		case 2:
-			TheClient->iWs.SimulateXyInputType(EXYInputDeltaMouse);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(62,24));
-			SimulatePointer(TRawEvent::EPointerMove,-5,-5);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(60,20));
-			SimulatePointer(TRawEvent::EPointerMove,6,7);
-			SimulatePointer(TRawEvent::EButton1Down,27,38);
-			SimulatePointer(TRawEvent::EPointerMove,0,0);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(55,25));
-			SimulatePointer(TRawEvent::EPointerMove,4,-13);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(58,20));
-			SimulatePointer(TRawEvent::EButton1Up,45,-678);
-			TheClient->iWs.Flush();
-			iQueueClient->iWin->BaseWin()->PointerFilter(EPointerFilterEnterExit,0);
-			iQueueClient->iChildWin->BaseWin()->PointerFilter(EPointerFilterEnterExit,0);
-			iQueueClient->iWs.Flush();
-			TheClient->iWs.SetPointerCursorPosition(TPoint(80,45));
-			TheClient->iWs.SimulateXyInputType(EXYInputPointer);
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(57-EWinPositionX,19-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(66-EWinPositionX,27-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(66-EWinPositionX,27-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EDrag, TPoint(66-EWinPositionX,27-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EDrag, TPoint(59-EWinPositionX,12-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(58-EWinPositionX,20-EWinPositionY));
-			AddExpectedEnterExit(EEventPointerEnter, TPoint(58-EWinPositionX,20-EWinPositionY));
-			AddExpectedEnterExit(EEventPointerExit, TPoint(58-EWinPositionX,20-EWinPositionY));
-			AddExpectedEnterExit(EEventPointerEnter, TPoint(80-EWinPositionX,45-EWinPositionY));
-			break;
-		case 3:
-			iQueueClient->iWin->BaseWin()->PointerFilter(EPointerFilterEnterExit,EPointerFilterEnterExit);
-			iQueueClient->iChildWin->BaseWin()->PointerFilter(EPointerFilterEnterExit,EPointerFilterEnterExit);
-			iQueueClient->iWs.Flush();
-			TheClient->iWs.SetPointerCursorArea(TRect(0,0,70,240));
-			TheClient->iWs.SimulateXyInputType(EXYInputDeltaMouse);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(65,30));
-			SimulatePointer(TRawEvent::EPointerMove,20,0);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(75,32));
-			SimulatePointer(TRawEvent::EPointerMove,-1,20);
-			SimulatePointer(TRawEvent::EButton1Down,29,37);
-			SimulatePointer(TRawEvent::EPointerMove,25,-13);
-			SimulatePointer(TRawEvent::EButton1Up,47,-648);
-			TheClient->iWs.SimulateXyInputType(EXYInputPointer);
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(69-EWinPositionX,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(68-EWinPositionX,52-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(68-EWinPositionX,52-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EDrag, TPoint(69-EWinPositionX,39-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(69-EWinPositionX,39-EWinPositionY));
-			break;
-		case 4:
-			TheClient->iWs.SetPointerCursorArea(TRect(EWinPositionX+2,EWinPositionY+2,EWinPositionX+99,EWinPositionY+49));
-			TheClient->iWs.SimulateXyInputType(EXYInputDeltaMouse);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(56,30));
-			SimulatePointer(TRawEvent::EPointerMove,0,-34);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(56,30));
-			SimulatePointer(TRawEvent::EPointerMove,0,0);
-			SimulatePointer(TRawEvent::EPointerMove,-77,-35);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(56,30));
-			SimulatePointer(TRawEvent::EPointerMove,0,0);
-			SimulatePointer(TRawEvent::EPointerMove,-78,0);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(56,30));
-			SimulatePointer(TRawEvent::EPointerMove,0,0);
-			SimulatePointer(TRawEvent::EPointerMove,-79,36);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(56,30));
-			SimulatePointer(TRawEvent::EPointerMove,0,0);
-			SimulatePointer(TRawEvent::EPointerMove,0,37);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(56,30));
-			SimulatePointer(TRawEvent::EPointerMove,0,0);
-			SimulatePointer(TRawEvent::EPointerMove,80,38);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(56,30));
-			SimulatePointer(TRawEvent::EPointerMove,0,0);
-			SimulatePointer(TRawEvent::EPointerMove,81,0);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(56,30));
-			SimulatePointer(TRawEvent::EPointerMove,0,0);
-			SimulatePointer(TRawEvent::EPointerMove,82,-39);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(2,2));
-			SimulatePointer(TRawEvent::EPointerMove,30,30);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(1,30));
-			SimulatePointer(TRawEvent::EPointerMove,1,0);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(2,88));
-			SimulatePointer(TRawEvent::EPointerMove,30,-30);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(56,88));
-			SimulatePointer(TRawEvent::EPointerMove,0,-1);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(123,88));
-			SimulatePointer(TRawEvent::EPointerMove,-30,-30);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(123,30));
-			SimulatePointer(TRawEvent::EPointerMove,-1,0);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(123,2));
-			SimulatePointer(TRawEvent::EPointerMove,-30,30);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(56,1));
-			SimulatePointer(TRawEvent::EPointerMove,0,1);
-			TheClient->iWs.SimulateXyInputType(EXYInputPointer);
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(56-EWinPositionX,2));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(56-EWinPositionX,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(2,2));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(56-EWinPositionX,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(2,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(56-EWinPositionX,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(2,48));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(56-EWinPositionX,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(56-EWinPositionX,48));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(56-EWinPositionX,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(98,48));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(56-EWinPositionX,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(98,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(56-EWinPositionX,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(98,2));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(32,32));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(3,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(32,18));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(56-EWinPositionX,47));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(68,18));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(97,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(68,32));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(56-EWinPositionX,3));
-			break;
-		case 5:
-			TheClient->iWs.SetPointerCursorArea(TRect(0,0,EWinPositionX+100,EWinPositionY+50));
-			TheClient->iWs.SimulateXyInputType(EXYInputDeltaMouse);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(57,31));
-			TheClient->iWs.SetPointerCursorArea(TRect(0,35,EWinPositionX+100,EWinPositionY+50));
-			SimulatePointer(TRawEvent::EPointerMove,1,0);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(10,55));
-			TheClient->iWs.SetPointerCursorArea(TRect(15,0,EWinPositionX+100,50));
-			SimulatePointer(TRawEvent::EPointerMove,1,1);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(57,31));
-			TheClient->iWs.SetPointerCursorArea(TRect(0,0,50,EWinPositionY+50));
-			SimulatePointer(TRawEvent::EPointerMove,0,1);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(10,10));
-			TheClient->iWs.SetPointerCursorArea(TRect(15,15,EWinPositionX+100,EWinPositionY+50));
-			SimulatePointer(TRawEvent::EPointerMove,1,-1);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(57,31));
-			TheClient->iWs.SetPointerCursorArea(TRect(0,0,EWinPositionX+100,30));
-			SimulatePointer(TRawEvent::EPointerMove,-1,0);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(100,10));
-			TheClient->iWs.SetPointerCursorArea(TRect(0,15,95,EWinPositionY+50));
-			SimulatePointer(TRawEvent::EPointerMove,-1,-1);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(57,31));
-			TheClient->iWs.SetPointerCursorArea(TRect(60,0,EWinPositionX+100,EWinPositionY+50));
-			SimulatePointer(TRawEvent::EPointerMove,0,-1);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(100,55));
-			TheClient->iWs.SetPointerCursorArea(TRect(0,0,95,50));
-			SimulatePointer(TRawEvent::EPointerMove,1,-1);
-			TheClient->iWs.SimulateXyInputType(EXYInputPointer);
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(58-EWinPositionX,35-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(16-EWinPositionX,49-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(49-EWinPositionX,32-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(16-EWinPositionX,15-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(56-EWinPositionX,29-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(93-EWinPositionX,15-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(60-EWinPositionX,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(94-EWinPositionX,48-EWinPositionY));
-			break;
-		#endif
-		default:
-			TheClient->iWs.SetPointerCursorArea(TRect(0,0,95,50));
-			CActiveScheduler::Stop();
-			break;
-		}
-	TheClient->iWs.Flush();
-	}
-
-void CTEventTest::RotatedMode_NextSetOfEventsL()
-	{
-#if defined(LOGGING)
-	TLogMessageText logMessageText;
-	_LIT(KSet,"RotatedMode SetOfEvents: %d  Max=4");
-	logMessageText.Format(KSet,iEventSet);
-	INFO_PRINTF1(logMessageText);
-#endif
-	switch(iEventSet++)
-		{
-		case 0:
-			{
-			iQueueClient->iWin->BaseWin()->PointerFilter(EPointerFilterMove|EPointerFilterDrag,0);
-			iQueueClient->iWin->BaseWin()->SetPointerGrab(EFalse);
-			iQueueClient->iWs.Flush();
-			TheClient->iWs.SetPointerCursorArea(TRect(10,10,51,51));
-			SimulatePointer(TRawEvent::EButton1Down,5,5);
-			SimulatePointer(TRawEvent::EButton1Up,25,5);
-			SimulatePointer(TRawEvent::EButton1Down,55,5);
-			SimulatePointer(TRawEvent::EButton1Up,55,35);
-			SimulatePointer(TRawEvent::EButton1Down,55,55);
-			SimulatePointer(TRawEvent::EButton1Up,25,55);
-			SimulatePointer(TRawEvent::EButton1Down,5,55);
-			SimulatePointer(TRawEvent::EButton1Up,5,35);
-			AddExpectedEvent(EEventFocusGained);
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(10-EWinPositionX,10-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(25-EWinPositionX,10-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(50-EWinPositionX,10-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(50-EWinPositionX,35-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(50-EWinPositionX,50-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(25-EWinPositionX,50-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(10-EWinPositionX,50-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(10-EWinPositionX,35-EWinPositionY));
-			}
-			break;
-		case 1:
-			{
-			TInt enforc=TheClient->iScreen->ScreenModeEnforcement();
-			iBlankWin->SetVisible(ETrue);
-		#if defined(LOGGING)
-			_LIT(KSet1,"AUTO  Rotating Events :1st ");
-			INFO_PRINTF1(KSet1);
-		#endif
-			INFO_PRINTF1(_L(" Set of Events"));
-			if (iScreenModeTests&EDoRot90)
-				{
-				TheClient->iScreen->SetScreenMode(1);
-				TheClient->iWs.Flush();
-				iTest->DelayIfFullRomL();
-				INFO_PRINTF1(_L(" Screen mode 1."));
-				TPoint screenModeOrigin=TheClient->iScreen->GetDefaultScreenModeOrigin();
-			#if defined(__WINS__)
-				iTest->SimulatePointer(TRawEvent::EButton1Down,20+screenModeOrigin.iX,20+screenModeOrigin.iY);
-				iTest->SimulatePointer(TRawEvent::EButton1Up,20+screenModeOrigin.iX,20+screenModeOrigin.iY);
-			#else
-				// simulate pointer at (20,20) on rotated screen by providing physical coordinates
-				iTest->SimulatePointer(TRawEvent::EButton1Down,iPhysicalScreenSize.iWidth-1-20+screenModeOrigin.iX,20+screenModeOrigin.iY);
-				iTest->SimulatePointer(TRawEvent::EButton1Up,iPhysicalScreenSize.iWidth-1-20+screenModeOrigin.iX,20+screenModeOrigin.iY);
-			#endif
-				INFO_PRINTF1(_L(" Sent Up and Down 90"));
-				}
-			if (iScreenModeTests&EDoRot180)
-				{
-				TheClient->iScreen->SetCurrentRotations(0,CFbsBitGc::EGraphicsOrientationRotated180);
-				TheClient->iScreen->SetScreenMode(0);
-				INFO_PRINTF1(_L(" Screen mode 0"));
-				TheClient->iWs.Flush();
-				iTest->DelayIfFullRomL();
-				INFO_PRINTF1(_L(" Upside Down"));
-			#if defined(__WINS__)
-				iTest->SimulatePointer(TRawEvent::EButton1Down,22,22);
-				iTest->SimulatePointer(TRawEvent::EButton1Up,22,22);
-			#else
-				// simulate pointer at (22,22) on rotated screen by providing physical coordinates
-				iTest->SimulatePointer(TRawEvent::EButton1Down,iPhysicalScreenSize.iWidth-1-22,iPhysicalScreenSize.iHeight-1-22);
-				iTest->SimulatePointer(TRawEvent::EButton1Up,iPhysicalScreenSize.iWidth-1-22,iPhysicalScreenSize.iHeight-1-22);
-			#endif
-				INFO_PRINTF1(_L(" Sent Up and Down 180"));
-				}
-			TheClient->iScreen->SetCurrentRotations(0,CFbsBitGc::EGraphicsOrientationNormal);
-			TheClient->iScreen->SetScreenMode(0);
-			TheClient->iWs.Flush();
-			iTest->DelayIfFullRomL();
-			INFO_PRINTF1(_L(" Normal Screen mode"));
-			if (iScreenModeTests&EDoRot0)
-				{
-				SimulatePointer(TRawEvent::EButton1Down,24,24);
-				SimulatePointer(TRawEvent::EButton1Up,24,24);
-				}
-			if (iScreenModeTests&EDoRot90)
-				{
-				if (enforc>ESizeEnforcementNone)
-					{
-					AddExpectedEvent(EEventFocusLost);
-					AddExpectedEvent(EEventFocusGained);
-					}
-				else
-					{
-                    AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(20-EWinPositionX,20-EWinPositionY-iYOffset));
-                    AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(20-EWinPositionX,20-EWinPositionY-iYOffset));
-                    }
-				}
-			if (iScreenModeTests&EDoRot180)
-				{
-                AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(22-EWinPositionX,22-EWinPositionY-iYOffset));
-                AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(22-EWinPositionX,22-EWinPositionY-iYOffset));
-				}
-			if (iScreenModeTests&EDoRot0)
-				{
-				AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(24-EWinPositionX,24-EWinPositionY));
-				AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(24-EWinPositionX,24-EWinPositionY));
-				}
-			INFO_PRINTF1(_L(" Added Expected"));
-			User::After(EPointerCursorUpdateGap);
-			iBlankWin->SetVisible(EFalse);
-			}
-			break;
-	#if defined(__WINS__)
-		case 2:
-			{
-			TInt enforc=TheClient->iScreen->ScreenModeEnforcement();
-			//INFO_PRINTF1("AUTO  Rotating Events ");
-			//INFO_PRINTF1(" :2nd Set of Events");
-			TheClient->iWs.SimulateXyInputType(EXYInputDeltaMouse);
-			TheClient->iWs.SetPointerCursorPosition(TPoint(24+EWinPositionX,24+EWinPositionY));
-			if (iScreenModeTests&EDoRot90)
-				{
-				TheClient->iScreen->SetScreenMode(1);
-				TheClient->iWs.Flush();
-				iTest->DelayIfFullRomL();
-				SimulatePointer(TRawEvent::EPointerMove,1,2);
-				SimulatePointer(TRawEvent::EButton1Down,56,89);
-				SimulatePointer(TRawEvent::EPointerMove,2,-1);
-				SimulatePointer(TRawEvent::EButton1Up,234,456);
-				}
-			else
-				TheClient->iWs.SetPointerCursorPosition(TPoint(27+EWinPositionX,25+EWinPositionY));
-			if (iScreenModeTests&EDoRot180)
-				{
-				TheClient->iScreen->SetCurrentRotations(0,CFbsBitGc::EGraphicsOrientationRotated180);
-				TheClient->iScreen->SetScreenMode(0);
-				TheClient->iWs.Flush();
-				iTest->DelayIfFullRomL();
-				SimulatePointer(TRawEvent::EPointerMove,-3,4);
-				SimulatePointer(TRawEvent::EButton1Down,156,289);
-				SimulatePointer(TRawEvent::EPointerMove,-4,-3);
-				SimulatePointer(TRawEvent::EButton1Up,2234,3456);
-				}
-			else
-				TheClient->iWs.SetPointerCursorPosition(TPoint(20+EWinPositionX,26+EWinPositionY));
-			TheClient->iScreen->SetCurrentRotations(0,CFbsBitGc::EGraphicsOrientationNormal);
-			TheClient->iScreen->SetScreenMode(0);
-			TheClient->iWs.Flush();
-			iTest->DelayIfFullRomL();
-			if (iScreenModeTests&EDoRot0)
-				{
-				SimulatePointer(TRawEvent::EButton1Down,24,24);
-				SimulatePointer(TRawEvent::EButton1Up,24,24);
-				}
-			TheClient->iWs.SimulateXyInputType(EXYInputPointer);
-			TheClient->iWs.Flush();
-			if (iScreenModeTests&EDoRot90)
-				{
-				if (enforc>ESizeEnforcementNone)
-					{
-					AddExpectedEvent(EEventFocusLost);
-					AddExpectedEvent(EEventFocusGained);
-					}
-				else
-					{
-					AddExpectedPointer(TPointerEvent::EMove, TPoint(25,26));
-					AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(25,26));
-					AddExpectedPointer(TPointerEvent::EDrag, TPoint(27,25));
-					AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(27,25));
-					}
-				}
-			if (iScreenModeTests&EDoRot180)
-				{
-				AddExpectedPointer(TPointerEvent::EMove, TPoint(24,29));
-				AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(24,29));
-				AddExpectedPointer(TPointerEvent::EDrag, TPoint(20,26));
-				AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(20,26));
-				}
-			if (iScreenModeTests&EDoRot0)
-				{
-				AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(20,26));
-				AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(20,26));
-				}
-			}
-			break;
-		case 3:
-			{
-		#if defined(LOGGING)
-			_LIT(KSet2,"AUTO  Rotating Events ");
-			INFO_PRINTF1(KSet2);
-		#endif
-			INFO_PRINTF1(_L(" :3rd Set of Events"));
-			if (iScreenModeTests&EDoScale)
-				{
-				INFO_PRINTF1(_L(" :Screen Scalling Supported"));
-				iBlankWin->SetVisible(ETrue);
-				iCurrentMode=iNumScrModes;
-				--iCurrentMode;
-				iTheClientFlush=TheClient->iWs.SetAutoFlush(ETrue);
-				iQuequeClientFlush=iQueueClient->iWs.SetAutoFlush(ETrue);
-				iQueueClient->iScreen->SetScreenMode(iCurrentMode);
-				TheClient->iScreen->SetAppScreenMode(iCurrentMode);
-				iQueueClient->iScreen->SetAppScreenMode(iCurrentMode);
-				iSizeMode=iQueueClient->iScreen->GetCurrentScreenModeAttributes();
-				TSizeMode testMode=iSizeMode;
-				for (TInt xScale=2;xScale<4;xScale++)
-					{
-				INFO_PRINTF1(_L(" :New X-Scale Value"));
-					for (TInt yScale=2;yScale<4;yScale++)
-						{
-						INFO_PRINTF1(_L(" :New Y-Scale Value"));
-						testMode.iScreenScale.SetSize(xScale,yScale);
-						CheckPointerCursorInDifferentScreenMode(testMode,TPoint(20,30));
-						}
-					}
-				User::After(EPointerCursorUpdateGap);
-				iBlankWin->SetVisible(EFalse);
-				break;
-				}
-			}
-		case 4:
-			{
-			if (iScreenModeTests&EDoScale)
-				{
-				TSizeMode testMode=iSizeMode;
-				iBlankWin->SetVisible(ETrue);
-				for (TInt xScale=2;xScale<4;xScale++)
-					{
-					for (TInt yScale=2;yScale<4;yScale++)
-						{
-						testMode.iScreenScale.SetSize(xScale,yScale);
-						CheckPointerCursorInDifferentScreenMode(testMode,TPoint(30,20));
-						}
-					}
-				User::After(EPointerCursorUpdateGap);
-				iBlankWin->SetVisible(EFalse);
-				break;
-				}
-			}
-	#endif
-		default:
-		#if defined(__WINS__)
-			if (iScreenModeTests&EDoScale)
-				{
-				iQueueClient->iScreen->SetScreenMode(iCurrentMode);
-				iQueueClient->iScreen->SetCurrentScreenModeAttributes(iSizeMode);
-				iQueueClient->iScreen->SetAppScreenMode(0);
-				TheClient->iScreen->SetAppScreenMode(0);
-				iQueueClient->iScreen->SetScreenMode(0);
-				iBlankWin->SetVisible(EFalse);
-				TheClient->iWs.SetAutoFlush(iTheClientFlush);
-				iQueueClient->iWs.SetAutoFlush(iQuequeClientFlush);
-				}
-		#endif
-			User::After(500000);		//0.5secs, to allow other screen devices to respond to the flip events
-			CActiveScheduler::Stop();
-			break;
-		}
-	TheClient->iWs.Flush();
-	}
-
-
-void CTEventTest::ScreenScaling_NextSetOfEventsL()
-	{
-#if defined(LOGGING)
-	TLogMessageText logMessageText;
-	_LIT(KSet,"ScreenScaling SetOfEvents: %d (Last=3)");
-	logMessageText.Format(KSet,iEventSet);
-	INFO_PRINTF1(logMessageText);
-#endif
-	if(! (iScreenModeTests & EDoScale))
-		{
-		User::After(500000);
-		CActiveScheduler::Stop();
-		return;
-		}
-	switch(iEventSet++)
-		{
-		case 0:
-			{
-			iTheClientFlush=TheClient->iWs.SetAutoFlush(ETrue);
-			iQuequeClientFlush=iQueueClient->iWs.SetAutoFlush(ETrue);
-			iBlankWin->SetVisible(ETrue);
-
-			TInt mode = TheClient->iScreen->CurrentScreenMode();
-
-			iSizeMode = iQueueClient->iScreen->GetCurrentScreenModeAttributes();
-
-			iQueueClient->iWin->BaseWin()->PointerFilter(EPointerFilterMove|EPointerFilterDrag,0);
-			iQueueClient->iWin->BaseWin()->SetPointerGrab(EFalse);
-
-			TSizeMode szMode2 = iSizeMode;
-
-			szMode2.iScreenScale.SetSize(2,2);
-
-			iQueueClient->iScreen->SetCurrentScreenModeAttributes(szMode2);
-			TheClient->iScreen->SetAppScreenMode(mode);
-			iQueueClient->iScreen->SetAppScreenMode(mode);
-			iQueueClient->iScreen->SetScreenMode(mode);
-
-			TPoint theScreenOrigin(iQueueClient->iScreen->GetScreenModeOrigin(mode));
-
-			SimulatePointer(TRawEvent::EButton1Down,
-				20+theScreenOrigin.iX, 20+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Up,
-				20+theScreenOrigin.iX, 20+theScreenOrigin.iY);
-			iQueueClient->iScreen->SetCurrentScreenModeAttributes(iSizeMode);
-			TheClient->iScreen->SetAppScreenMode(mode);
-			iQueueClient->iScreen->SetAppScreenMode(mode);
-			iQueueClient->iScreen->SetScreenMode(mode);
-
-			AddExpectedEvent(EEventFocusGained);
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(10-EWinPositionX,10-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(10-EWinPositionX,10-EWinPositionY));
-
-			break;
-			}
-		case 1:
-			{
-			TSizeMode szMode2 = iSizeMode;
-			TInt mode = TheClient->iScreen->CurrentScreenMode();
-
-			szMode2.iScreenScale.SetSize(2,2);
-			szMode2.iOrigin.SetXY(20,20);
-
-			iQueueClient->iScreen->SetCurrentScreenModeAttributes(szMode2);
-			TheClient->iScreen->SetAppScreenMode(mode);
-			iQueueClient->iScreen->SetAppScreenMode(mode);
-			iQueueClient->iScreen->SetScreenMode(mode);
-
-			TPoint theScreenOrigin(iQueueClient->iScreen->GetDefaultScreenModeOrigin());
-
-			SimulatePointer(TRawEvent::EButton1Down,
-				30+theScreenOrigin.iX, 30+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Up,
-				26+theScreenOrigin.iX, 20+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Down,
-				40+theScreenOrigin.iX, 60+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Up,
-				26+theScreenOrigin.iX, 20+theScreenOrigin.iY);
-
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(15-EWinPositionX,15-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(13-EWinPositionX,10-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(20-EWinPositionX,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(13-EWinPositionX,10-EWinPositionY));
-
-			iQueueClient->iScreen->SetCurrentScreenModeAttributes(iSizeMode);
-			TheClient->iScreen->SetAppScreenMode(mode);
-			iQueueClient->iScreen->SetAppScreenMode(mode);
-			iQueueClient->iScreen->SetScreenMode(mode);
-
-			theScreenOrigin = TPoint(iQueueClient->iScreen->GetDefaultScreenModeOrigin());
-
-			SimulatePointer(TRawEvent::EButton1Down,
-				30+theScreenOrigin.iX, 30+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Up,
-				26+theScreenOrigin.iX, 20+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Down,
-				40+theScreenOrigin.iX, 50+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Up,
-				26+theScreenOrigin.iX, 20+theScreenOrigin.iY);
-
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(30-EWinPositionX,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(26-EWinPositionX,20-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(40-EWinPositionX,50-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(26-EWinPositionX,20-EWinPositionY));
-			break;
-			}
-		case 2:
-			{
-			TInt mode = TheClient->iScreen->CurrentScreenMode();
-			TRect	theRect = TheClient->iWs.PointerCursorArea();
-
-			TSizeMode szMode2 = iSizeMode;
-
-			//-----------  scaling 2X2
-			szMode2.iScreenScale.SetSize(2,2);
-
-			iQueueClient->iScreen->SetCurrentScreenModeAttributes(szMode2);
-			iQueueClient->iWs.SetPointerCursorArea(mode, TRect(24,10,52,52));
-			TheClient->iScreen->SetAppScreenMode(mode);
-			iQueueClient->iScreen->SetAppScreenMode(mode);
-			iQueueClient->iScreen->SetScreenMode(mode);
-
-
-			TPoint theScreenOrigin(iQueueClient->iScreen->GetDefaultScreenModeOrigin());
-
-			SimulatePointer(TRawEvent::EButton1Down,
-				20+theScreenOrigin.iX, 20+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Up,
-				26+theScreenOrigin.iX, 20+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Down,
-				50+theScreenOrigin.iX, 30+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Up,
-				26+theScreenOrigin.iX, 20+theScreenOrigin.iY);
-
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(24-EWinPositionX,10-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(24-EWinPositionX,10-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(25-EWinPositionX,15-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(24-EWinPositionX,10-EWinPositionY));
-			//------------------------  scaling 1X2
-			szMode2.iScreenScale.SetSize(1,2);
-
-			iQueueClient->iScreen->SetCurrentScreenModeAttributes(szMode2);
-			iQueueClient->iWs.SetPointerCursorArea(mode, TRect(24,10,52,52));
-			TheClient->iScreen->SetAppScreenMode(mode);
-			iQueueClient->iScreen->SetAppScreenMode(mode);
-			iQueueClient->iScreen->SetScreenMode(mode);
-
-			theScreenOrigin = TPoint(iQueueClient->iScreen->GetDefaultScreenModeOrigin());
-
-			SimulatePointer(TRawEvent::EButton1Down,
-				20+theScreenOrigin.iX, 20+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Up,
-				26+theScreenOrigin.iX, 20+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Down,
-				50+theScreenOrigin.iX, 30+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Up,
-				26+theScreenOrigin.iX, 20+theScreenOrigin.iY);
-
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(24-EWinPositionX,10-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(26-EWinPositionX,10-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(50-EWinPositionX,15-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(26-EWinPositionX,10-EWinPositionY));
-			//------------------------  scaling 2X1
-			szMode2.iScreenScale.SetSize(2,1);
-
-			iQueueClient->iScreen->SetCurrentScreenModeAttributes(szMode2);
-			iQueueClient->iWs.SetPointerCursorArea(mode, TRect(24,10,52,52));
-			TheClient->iScreen->SetAppScreenMode(mode);
-			iQueueClient->iScreen->SetAppScreenMode(mode);
-			iQueueClient->iScreen->SetScreenMode(mode);
-
-			theScreenOrigin = TPoint(iQueueClient->iScreen->GetDefaultScreenModeOrigin());
-
-			SimulatePointer(TRawEvent::EButton1Down,
-				20+theScreenOrigin.iX, 20+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Up,
-				26+theScreenOrigin.iX, 20+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Down,
-				50+theScreenOrigin.iX, 30+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Up,
-				26+theScreenOrigin.iX, 20+theScreenOrigin.iY);
-
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(24-EWinPositionX,20-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(24-EWinPositionX,20-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(25-EWinPositionX,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(24-EWinPositionX,20-EWinPositionY));
-			//------------------------  scaling 3X1
-
-			szMode2.iScreenScale.SetSize(3,1);
-
-			iQueueClient->iScreen->SetCurrentScreenModeAttributes(szMode2);
-			iQueueClient->iWs.SetPointerCursorArea(mode, TRect(24,10,52,52));
-			TheClient->iScreen->SetAppScreenMode(mode);
-			iQueueClient->iScreen->SetAppScreenMode(mode);
-			iQueueClient->iScreen->SetScreenMode(mode);
-
-			theScreenOrigin = TPoint(iQueueClient->iScreen->GetDefaultScreenModeOrigin());
-
-			SimulatePointer(TRawEvent::EButton1Down,
-				21+theScreenOrigin.iX, 20+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Up,
-				30+theScreenOrigin.iX, 20+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Down,
-				75+theScreenOrigin.iX, 30+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Up,
-				30+theScreenOrigin.iX, 20+theScreenOrigin.iY);
-
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(24-EWinPositionX,20-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(24-EWinPositionX,20-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(25-EWinPositionX,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(24-EWinPositionX,20-EWinPositionY));
-			//------------------------  scaling 3X2
-
-			szMode2.iScreenScale.SetSize(3,2);
-
-			iQueueClient->iScreen->SetCurrentScreenModeAttributes(szMode2);
-			iQueueClient->iWs.SetPointerCursorArea(mode, TRect(24,10,52,52));
-			TheClient->iScreen->SetAppScreenMode(mode);
-			iQueueClient->iScreen->SetAppScreenMode(mode);
-			iQueueClient->iScreen->SetScreenMode(mode);
-
-			theScreenOrigin = TPoint(iQueueClient->iScreen->GetDefaultScreenModeOrigin());
-
-			SimulatePointer(TRawEvent::EButton1Down,
-				21+theScreenOrigin.iX, 20+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Up,
-				30+theScreenOrigin.iX, 20+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Down,
-				75+theScreenOrigin.iX, 30+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Up,
-				30+theScreenOrigin.iX, 20+theScreenOrigin.iY);
-
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(24-EWinPositionX,10-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(24-EWinPositionX,10-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(25-EWinPositionX,15-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(24-EWinPositionX,10-EWinPositionY));
-			//------------------------  scaling 3X3
-			szMode2.iScreenScale.SetSize(3,3);
-
-			iQueueClient->iScreen->SetCurrentScreenModeAttributes(szMode2);
-			iQueueClient->iWs.SetPointerCursorArea(mode, TRect(24,10,52,52));
-			TheClient->iScreen->SetAppScreenMode(mode);
-			iQueueClient->iScreen->SetAppScreenMode(mode);
-			iQueueClient->iScreen->SetScreenMode(mode);
-
-			theScreenOrigin = TPoint(iQueueClient->iScreen->GetDefaultScreenModeOrigin());
-
-			SimulatePointer(TRawEvent::EButton1Down,
-				21+theScreenOrigin.iX, 20+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Up,
-				30+theScreenOrigin.iX, 20+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Down,
-				75+theScreenOrigin.iX, 33+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Up,
-				30+theScreenOrigin.iX, 20+theScreenOrigin.iY);
-
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(24-EWinPositionX,10-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(24-EWinPositionX,10-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(25-EWinPositionX,11-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(24-EWinPositionX,10-EWinPositionY));
-			//------------------------
-			iQueueClient->iWs.SetPointerCursorArea(mode, theRect);
-			iQueueClient->iScreen->SetCurrentScreenModeAttributes(iSizeMode);
-			TheClient->iScreen->SetAppScreenMode(mode);
-			iQueueClient->iScreen->SetAppScreenMode(mode);
-			iQueueClient->iScreen->SetScreenMode(mode);
-			break;
-			}
-		case 3:
-			{
-			iQueueClient->iWs.SetAutoFlush(ETrue);
-			TInt theCurMode = iQueueClient->iScreen->CurrentScreenMode();
-			TPoint theScreenOrigin;
-			if (iNumScrModes>2)
-				{
-				TheClient->iScreen->SetAppScreenMode(2);
-				iQueueClient->iScreen->SetAppScreenMode(2);
-				TheClient->iScreen->SetScreenMode(2);
-
-				theScreenOrigin=iQueueClient->iScreen->GetDefaultScreenModeOrigin();
-				SimulatePointer(TRawEvent::EButton1Down,
-					30+theScreenOrigin.iX,30+theScreenOrigin.iY);
-				SimulatePointer(TRawEvent::EButton1Up,
-					26+theScreenOrigin.iX,20+theScreenOrigin.iY);
-				SimulatePointer(TRawEvent::EButton1Down,
-					40+theScreenOrigin.iX,60+theScreenOrigin.iY);
-				SimulatePointer(TRawEvent::EButton1Up,
-					26+theScreenOrigin.iX,20+theScreenOrigin.iY);
-
-				AddExpectedPointer(TPointerEvent::EButton1Down,
-					TPoint(15-EWinPositionX,15-EWinPositionY));
-				AddExpectedPointer(TPointerEvent::EButton1Up,
-					TPoint(13-EWinPositionX,10-EWinPositionY));
-				AddExpectedPointer(TPointerEvent::EButton1Down,
-					TPoint(20-EWinPositionX,30-EWinPositionY));
-				AddExpectedPointer(TPointerEvent::EButton1Up,
-					TPoint(13-EWinPositionX,10-EWinPositionY));
-				}
-
-			TheClient->iScreen->SetAppScreenMode(0);
-			iQueueClient->iScreen->SetAppScreenMode(0);
-			iQueueClient->iScreen->SetScreenMode(0);
-			iTest->DelayIfFullRomL();
-
-			theScreenOrigin = TPoint(iQueueClient->iScreen->GetDefaultScreenModeOrigin());
-
-			SimulatePointer(TRawEvent::EButton1Down,
-				30+theScreenOrigin.iX, 30+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Up,
-				26+theScreenOrigin.iX, 20+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Down,
-				40+theScreenOrigin.iX, 50+theScreenOrigin.iY);
-			SimulatePointer(TRawEvent::EButton1Up,
-				26+theScreenOrigin.iX, 20+theScreenOrigin.iY);
-
-		#if defined(__WINS__)
-			iQueueClient->iWs.SimulateXyInputType(EXYInputDeltaMouse);
-			iQueueClient->iWs.SetPointerCursorPosition(TPoint(24+theScreenOrigin.iX,24+theScreenOrigin.iY));
-			SimulatePointer(TRawEvent::EPointerMove,1,2);
-			iQueueClient->iWs.SimulateXyInputType(EXYInputPointer);
-		#endif
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(30-EWinPositionX,30-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(26-EWinPositionX,20-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(40-EWinPositionX,50-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(26-EWinPositionX,20-EWinPositionY));
-
-		#if defined(__WINS__)
-			AddExpectedPointer(TPointerEvent::EMove, TPoint(25-EWinPositionX,26-EWinPositionY));
-		#endif
-
-			iQueueClient->iScreen->SetAppScreenMode(theCurMode);
-			TheClient->iScreen->SetScreenMode(theCurMode);
-			break;
-			}
-		default:
-			User::After(EPointerCursorUpdateGap);
-			iBlankWin->SetVisible(EFalse);
-			TheClient->iWs.SetAutoFlush(iTheClientFlush);
-			iQueueClient->iWs.SetAutoFlush(iQuequeClientFlush);
-			iQueueClient->iScreen->SetCurrentScreenModeAttributes(iSizeMode);
-			User::After(500000);		//0.5secs, to allow other screen devices to respond to the flip events
-			CActiveScheduler::Stop();
-			break;
-		}
-	}
-
-void CTEventTest::AnimEvent_NextSetOfEventsL()
-	{
-#if defined(LOGGING)
-	TLogMessageText logMessageText;
-	_LIT(KSet,"AnimEvent SetOfEvents: %d  (Max=4)");
-	logMessageText.Format(KSet,iEventSet);
-	INFO_PRINTF1(logMessageText);
-#endif
-	switch(iEventSet++)
-		{
-		case 0:
-			iAnim=REventAnim::NewL(iQueueClient->iWin->BaseWin(), iAnimDll);
-			AddExpectedEvent(EEventFocusGained);
-			AddExpectedKeyAnim(TRawEvent::EKeyDown,32,ETrue);
-			AddExpectedKeyAnim(TRawEvent::EKeyUp,32,ETrue);
-			AddExpectedKeyAnim(TRawEvent::EKeyDown,33,EFalse);
-			AddExpectedKeyAnim(TRawEvent::EKeyUp,33,EFalse);
-			iTest->SimulateKey(TRawEvent::EKeyDown,32);
-			iTest->SimulateKey(TRawEvent::EKeyUp,32);
-			iTest->SimulateKey(TRawEvent::EKeyDown,33);
-			iTest->SimulateKey(TRawEvent::EKeyUp,33);
-			TheClient->iWs.Flush();
-			if (iAnim->TestFail(4))
-				Failed();
-			break;
-		case 1:
-			iQueueClient->iWin->BaseWin()->PointerFilter(EPointerFilterMove|EPointerFilterDrag,0);
-			iQueueClient->iWin->BaseWin()->SetPointerGrab(EFalse);
-			iQueueClient->iWs.Flush();
-			TheClient->iWs.SetPointerCursorArea(TRect(10,10,51,51));
-			AddExpectedPointerAnim(TRawEvent::EButton1Down, TPoint(10,10));
-			AddExpectedPointerAnim(TRawEvent::EButton1Up, TPoint(25,10));
-			AddExpectedPointerAnim(TRawEvent::EButton1Down, TPoint(50,10));
-			AddExpectedPointerAnim(TRawEvent::EButton1Up, TPoint(50,35));
-			AddExpectedPointerAnim(TRawEvent::EButton1Down, TPoint(50,50));
-			AddExpectedPointerAnim(TRawEvent::EButton1Up, TPoint(25,50));
-			AddExpectedPointerAnim(TRawEvent::EButton1Down, TPoint(10,50));
-			AddExpectedPointerAnim(TRawEvent::EButton1Up, TPoint(10,35));
-			AddExpectedPointerAnim(TRawEvent::EButton1Down, TPoint(30,30),EFalse);
-			AddExpectedPointerAnim(TRawEvent::EButton1Up, TPoint(30,30),EFalse);
-			SimulatePointer(TRawEvent::EButton1Down,5,5);
-			SimulatePointer(TRawEvent::EButton1Up,25,5);
-			SimulatePointer(TRawEvent::EButton1Down,55,5);
-			SimulatePointer(TRawEvent::EButton1Up,55,35);
-			SimulatePointer(TRawEvent::EButton1Down,55,55);
-			SimulatePointer(TRawEvent::EButton1Up,25,55);
-			SimulatePointer(TRawEvent::EButton1Down,5,55);
-			SimulatePointer(TRawEvent::EButton1Up,5,35);
-			SimulatePointer(TRawEvent::EButton1Down,30,30);
-			SimulatePointer(TRawEvent::EButton1Up,30,30);
-			TheClient->iWs.Flush();
-			if (iAnim->TestFail(10))
-				Failed();
-			break;
-		case 2:
-			{
-		#if defined(LOGGING)
-			_LIT(KLog," :2nd Set of Events  Modes=0x%x");
-			logMessageText.Format(KLog,iScreenModeTests);
-			INFO_PRINTF1(logMessageText);
-		#endif
-			TInt enforc=TheClient->iScreen->ScreenModeEnforcement();
-			iBlankWin->SetVisible(ETrue);
-			TInt expectedEvents=0;
-			if (iScreenModeTests&EDoRot90 && enforc==ESizeEnforcementNone)
-				{
-				INFO_PRINTF1(_L(" :Rotation 90"));
-				TheClient->iScreen->SetScreenMode(1);
-				TheClient->iWs.Flush();
-				iTest->DelayIfFullRomL();
-                AddExpectedPointerAnim(TRawEvent::EButton1Down, TPoint(20,20-iYOffset));
-                AddExpectedPointerAnim(TRawEvent::EButton1Up, TPoint(20,20-iYOffset));
-				expectedEvents+=2;
-				TPoint screenModeOrigin=TheClient->iScreen->GetDefaultScreenModeOrigin();
-			#if defined(__WINS__)
-				iTest->SimulatePointer(TRawEvent::EButton1Down,20+screenModeOrigin.iX,20+screenModeOrigin.iY);
-				iTest->SimulatePointer(TRawEvent::EButton1Up,20+screenModeOrigin.iX,20+screenModeOrigin.iY);
-			#else
-				// simulate pointer at (20,20) on rotated screen by providing physical coordinates
-				iTest->SimulatePointer(TRawEvent::EButton1Down,iPhysicalScreenSize.iWidth-1-20+screenModeOrigin.iX,20+screenModeOrigin.iY);
-				iTest->SimulatePointer(TRawEvent::EButton1Up,iPhysicalScreenSize.iWidth-1-20+screenModeOrigin.iX,20+screenModeOrigin.iY);
-			#endif
-				}
-			if (iScreenModeTests&EDoRot180)
-				{
-				INFO_PRINTF1(_L(" :Rotation 180"));
-				TheClient->iScreen->SetCurrentRotations(0,CFbsBitGc::EGraphicsOrientationRotated180);
-				TheClient->iScreen->SetScreenMode(0);
-				TheClient->iWs.Flush();
-				iTest->DelayIfFullRomL();
-                AddExpectedPointerAnim(TRawEvent::EButton1Down, TPoint(22,22-iYOffset));
-                AddExpectedPointerAnim(TRawEvent::EButton1Up, TPoint(22,22-iYOffset));
-               
-				expectedEvents+=2;
-			#if defined(__WINS__)
-				iTest->SimulatePointer(TRawEvent::EButton1Down,22,22);
-				iTest->SimulatePointer(TRawEvent::EButton1Up,22,22);
-			#else
-				// simulate pointer at (22,22) on rotated screen by providing physical coordinates
-				iTest->SimulatePointer(TRawEvent::EButton1Down,iPhysicalScreenSize.iWidth-1-22,iPhysicalScreenSize.iHeight-1-22);
-				iTest->SimulatePointer(TRawEvent::EButton1Up,iPhysicalScreenSize.iWidth-1-22,iPhysicalScreenSize.iHeight-1-22);
-			#endif
-				}
-			TheClient->iScreen->SetCurrentRotations(0,CFbsBitGc::EGraphicsOrientationNormal);
-			TheClient->iScreen->SetScreenMode(0);
-			TheClient->iWs.Flush();
-			iTest->DelayIfFullRomL();
-			if (iScreenModeTests&EDoRot0)
-				{
-				INFO_PRINTF1(_L(" :Rotation 0"));
-				AddExpectedPointerAnim(TRawEvent::EButton1Down, TPoint(24,24),EFalse);
-				AddExpectedPointerAnim(TRawEvent::EButton1Up, TPoint(24,24),EFalse);
-				expectedEvents+=2;
-				SimulatePointer(TRawEvent::EButton1Down,24,24);
-				SimulatePointer(TRawEvent::EButton1Up,24,24);
-				}
-		#if defined(LOGGING)
-			_LIT(KNumEvents," :Expected Number of Events=%d  Actual=%d");
-			logMessageText.Format(KNumEvents,expectedEvents,iAnim->GetNumEvents());
-			INFO_PRINTF1(logMessageText);
-			_LIT(KError," :Error Value %d ('0'=OK)");
-			logMessageText.Format(KError,iAnim->GetError());
-			INFO_PRINTF1(logMessageText);
-		#endif
-			if (iAnim->TestFail(expectedEvents))
-				Failed();
-			User::After(EPointerCursorUpdateGap);
-			iBlankWin->SetVisible(EFalse);
-			INFO_PRINTF1(_L(" :Finished 2nd Set"));
-			}
-			break;
-		case 3:
-			iAnim->Destroy(); iAnim=NULL;
-			// Create an EventPostingAnim, key down & key up events are simulated.
-			// The event posting anim sees the key events in turn, and creates duplicates.
-			// Test checks that each simulated event is received twice. 
-			TRAPD(err, iAnim=REventAnim::NewL(iQueueClient->iWin->BaseWin(), iAnimDll, REventAnimBase::EEventPostingAnim));
-			if (err!=KErrNone)
-				{
-				Failed();
-				return;
-				}
-			AddExpectedKeyAnim(TRawEvent::EKeyDown,32,ETrue);
-			AddExpectedKeyAnim(TRawEvent::EKeyDown,32,EFalse);
-			AddExpectedKeyAnim(TRawEvent::EKeyUp,32,ETrue);
-			AddExpectedKeyAnim(TRawEvent::EKeyUp,32,EFalse);
-			
-			iTest->SimulateKey(TRawEvent::EKeyDown,32);
-			iTest->SimulateKey(TRawEvent::EKeyUp,32);
-			break;
-		case 4:
-			// Simulate a key down event, which calls anim's offer raw event
-			// which inturn calls post key event with old and new API
-			// Test checks the repeat count for old and new API are as expected.
-			AddExpectedKeyAnim(TRawEvent::EKeyDown,45,ETrue);
-			
-			TKeyEvent event;
-			event.iCode='J';
-			event.iScanCode=0;
-			event.iModifiers=0;
-			event.iRepeats=0;
-			AddExpectedKey(1, event.iScanCode, event.iCode, event.iRepeats, event.iModifiers);
-			event.iRepeats=2;
-			AddExpectedKey(1, event.iScanCode, event.iCode, event.iRepeats, event.iModifiers);
-			
-			iTest->SimulateKey(TRawEvent::EKeyDown,45);
-			break;
-		default:
-			iAnim->Destroy();
-			iAnim=NULL;
-			CActiveScheduler::Stop();
-			break;
-		}
-	TheClient->iWs.Flush();
-	}
-
-void CTEventTest::FocusChanged_NextSetOfEventsL()
-	{
-#if defined(LOGGING)
-	TLogMessageText logMessageText;
-	_LIT(KSet,"FocusChanged SetOfEvents: %d ");
-	logMessageText.Format(KSet,iEventSet);
-	INFO_PRINTF1(logMessageText);
-#endif
-	switch(iEventSet++)
-		{
-		case 0:
-			{
-			_LIT(AutoFocusTest,"FocusEvents");
-			iQueueClient->EnableFocusChangeEvents();
-			iEventTestGroup2=new(ELeave) CTWindowGroup(TheClient);
-			iEventTestGroup2->ConstructL();
-			iEventTestGroup2->GroupWin()->SetName(AutoFocusTest);
-			AddExpectedEvent(EEventFocusGained);
-			AddExpectedEvent(EEventFocusLost);
-			AddExpectedEvent(EEventFocusGroupChanged);
-			AddExpectedEvent(EEventWindowGroupsChanged);
-			}
-			break;
-		case 1:
-			iEventTestGroup2->GroupWin()->EnableReceiptOfFocus(EFalse);
-			AddExpectedEvent(EEventFocusGained);
-			AddExpectedEvent(EEventFocusGroupChanged);
-			break;
-		case 2:
-			iEventTestGroup2->GroupWin()->EnableReceiptOfFocus(ETrue);
-			AddExpectedEvent(EEventFocusLost);
-			AddExpectedEvent(EEventFocusGroupChanged);
-			break;
-		case 3:
-			iEventTestGroup2->GroupWin()->SetOrdinalPosition(999);
-			AddExpectedEvent(EEventFocusGained);
-			AddExpectedEvent(EEventFocusGroupChanged);
-			break;
-		case 4:
-			iEventTestGroup2->GroupWin()->SetOrdinalPosition(0);
-			AddExpectedEvent(EEventFocusLost);
-			AddExpectedEvent(EEventFocusGroupChanged);
-			break;
-		case 5:
-			delete iEventTestGroup2;
-			iEventTestGroup2=NULL;
-			AddExpectedEvent(EEventWindowGroupsChanged);
-			AddExpectedEvent(EEventFocusGroupChanged);
-			break;
-		default:
-			CActiveScheduler::Stop();
-			break;
-		}
-	TheClient->iWs.Flush();
-	}
-
-	
-void CTEventTest::StopEvents_NextSetOfEventsL()
-	{
-	// we are not running tests 0,1,2 as they currently fail
-	if(iEventSet==0)
-		{
-		iEventSet=3;
-		AddExpectedEvent(EEventFocusGained);
-		}
-	TInt retVal	= KErrNone;
-				
-	switch(iEventSet++)
-		{
-		case 0: // doesn't work if shell gets the off events - will fail on User::LeaveIfError(....
-			iQueueClient->iWs.Flush();
-			User::LeaveIfError(iQueueClient->iWs.RequestOffEvents(ETrue,iQueueClient->iGroup->WinTreeNode()));
-			iTest->SimulateEvent(TRawEvent::ESwitchOff);
-			TheClient->iWs.Flush();
-			retVal = iQueueClient->iWs.RequestOffEvents(ETrue,iQueueClient->iWin->WinTreeNode());
-			TEST(retVal==KErrAlreadyExists);
-			if (retVal!=KErrAlreadyExists)
-				INFO_PRINTF3(_L("iQueueClient->iWs.RequestOffEvents(ETrue,iQueueClient->iWin->WinTreeNode()) return value - Expected: %d, Actual: %d"), KErrAlreadyExists, retVal);
-			User::LeaveIfError(iQueueClient->iWs.RequestOffEvents(EFalse,iQueueClient->iGroup->WinTreeNode()));
-			User::LeaveIfError(iQueueClient->iWs.RequestOffEvents(ETrue,iQueueClient->iGroup->WinTreeNode()));
-			iTest->SimulateEvent(TRawEvent::ESwitchOff);
-			TheClient->iWs.Flush();
-			retVal = iQueueClient->iWs.RequestOffEvents(ETrue,iQueueClient->iGroup->WinTreeNode());
-			TEST(retVal==KErrAlreadyExists);
-			if (retVal!=KErrAlreadyExists)
-				INFO_PRINTF3(_L("iQueueClient->iWs.RequestOffEvents(ETrue,iQueueClient->iGroup->WinTreeNode()) return value - Expected: %d, Actual: %d"), KErrAlreadyExists, retVal);
-			User::LeaveIfError(iQueueClient->iWs.RequestOffEvents(EFalse));
-			AddExpectedEvent(EEventFocusGained);
-			AddExpectedEvent(EEventSwitchOff);
-			AddExpectedEvent(EEventSwitchOff);
-			break;
-			
-		case 1: // doesn't work if shell gets the off events - will fail on User::LeaveIfError(....
-			{
-			TKeyEvent event; 
-			iQueueClient->iWs.Flush();
-			User::LeaveIfError(iQueueClient->iWs.RequestOffEvents(ETrue,iQueueClient->iGroup->WinTreeNode()));
-			event.iCode=EKeyOff;
-			event.iScanCode=EKeyOff;
-			event.iModifiers=0;
-			event.iRepeats=0;
-			TheClient->iWs.SimulateKeyEvent(event);
-			TheClient->iWs.Flush();
-			User::LeaveIfError(iQueueClient->iWs.RequestOffEvents(EFalse));
-			AddExpectedEvent(EEventKeySwitchOff);
-			}
-			break;
-		
-		case 2: // doesn't work if shell gets the off events - will fail on User::LeaveIfError(....
-			{
-			TKeyEvent event;
-			event.iCode=EKeyOff;
-			event.iScanCode=EKeyOff;
-			event.iModifiers=0;
-			event.iRepeats=0;
-			iQueueClient->iWs.Flush();
-			User::LeaveIfError(iQueueClient->iWs.RequestOffEvents(ETrue,iQueueClient->iGroup->WinTreeNode()));
-			iTest->SimulateEvent(TRawEvent::ESwitchOff);
-			TheClient->iWs.SimulateKeyEvent(event);
-			iTest->SimulateEvent(TRawEvent::ECaseClose);
-			TheClient->iWs.Flush();
-			retVal = iQueueClient->iWs.RequestOffEvents(ETrue,iQueueClient->iWin->WinTreeNode());
-			TEST(retVal==KErrAlreadyExists);
-			if (retVal!=KErrAlreadyExists)
-				INFO_PRINTF3(_L("iQueueClient->iWs.RequestOffEvents(ETrue,iQueueClient->iWin->WinTreeNode()) return value - Expected: %d, Actual: %d"), KErrAlreadyExists, retVal);
-			iTest->SimulateEvent(TRawEvent::ESwitchOff);
-			iTest->SimulateEvent(TRawEvent::ECaseClose);
-			TheClient->iWs.SimulateKeyEvent(event);
-			TheClient->iWs.Flush();
-			User::LeaveIfError(iQueueClient->iWs.RequestOffEvents(EFalse,iQueueClient->iGroup->WinTreeNode()));
-			User::LeaveIfError(iQueueClient->iWs.RequestOffEvents(ETrue,iQueueClient->iWin->WinTreeNode()));
-			iTest->SimulateEvent(TRawEvent::ECaseClose);
-			iTest->SimulateEvent(TRawEvent::ESwitchOff);
-			TheClient->iWs.SimulateKeyEvent(event);
-			TheClient->iWs.Flush();
-			User::LeaveIfError(iQueueClient->iWs.RequestOffEvents(EFalse));
-			User::LeaveIfError(iQueueClient->iWs.RequestOffEvents(ETrue,iQueueClient->iChildWin->WinTreeNode()));
-			iTest->SimulateEvent(TRawEvent::ESwitchOff);
-			TheClient->iWs.SimulateKeyEvent(event);
-			iTest->SimulateEvent(TRawEvent::ECaseClose);
-			TheClient->iWs.Flush();
-			User::LeaveIfError(iQueueClient->iWs.RequestOffEvents(EFalse));
-			AddExpectedEvent(EEventSwitchOff);
-			AddExpectedEvent(EEventKeySwitchOff);
-			AddExpectedEvent(EEventCaseClosed);
-			AddExpectedEvent(EEventSwitchOff);
-			AddExpectedEvent(EEventCaseClosed);
-			AddExpectedEvent(EEventKeySwitchOff);
-			AddExpectedEvent(EEventCaseClosed,iQueueClient->iWin);
-			AddExpectedEvent(EEventSwitchOff,iQueueClient->iWin);
-			AddExpectedEvent(EEventKeySwitchOff,iQueueClient->iWin);
-			AddExpectedEvent(EEventSwitchOff,iQueueClient->iChildWin);
-			AddExpectedEvent(EEventKeySwitchOff,iQueueClient->iChildWin);
-			AddExpectedEvent(EEventCaseClosed,iQueueClient->iChildWin);
-			}
-			break;
-			
-		case 3: 
-			iQueueClient->iWs.Flush();
-			//User::LeaveIfError(iQueueClient->iGroup->WinTreeNode()->EnableOnEvents(EEventControlAlways));
-			iTest->SimulateEvent(TRawEvent::ESwitchOn);
-			iTest->SimulateEvent(TRawEvent::ECaseOpen);
-			TheClient->iWs.Flush();
-			User::LeaveIfError(iQueueClient->iWin->WinTreeNode()->EnableOnEvents(EEventControlAlways));
-			iTest->SimulateEvent(TRawEvent::ECaseOpen);
-			iTest->SimulateEvent(TRawEvent::ESwitchOn);
-			TheClient->iWs.Flush();
-			iQueueClient->iWin->WinTreeNode()->DisableOnEvents();
-			AddExpectedEvent(EEventSwitchOn);
-			//AddExpectedEvent(EEventSwitchOn);
-			AddExpectedEvent(EEventCaseOpened);
-			AddExpectedEvent(EEventCaseOpened,iQueueClient->iWin);
-			AddExpectedEvent(EEventCaseOpened);
-			AddExpectedEvent(EEventSwitchOn,iQueueClient->iWin);
-			AddExpectedEvent(EEventSwitchOn);
-			break;
-			
-		case 4:
-			iQueueClient->iWs.Flush();
-			// switch off the device
-			iTest->SimulateEvent(TRawEvent::ESwitchOff);
-			// switch it back on. 
-			iTest->SimulateEvent(TRawEvent::ESwitchOn);
-			TheClient->iWs.Flush();	
-			// TRawEvent::ESwitchOff never actually comes back. The tests will hang if we look for one
-			AddExpectedEvent(EEventSwitchOn);
-			break;
-			
-		case 5:
-			{
-			TKeyEvent event; 
-			iQueueClient->iWs.Flush();
-			event.iCode=EKeyOff;
-			event.iScanCode=EKeyOff;
-			event.iModifiers=0;
-			event.iRepeats=0;
-			// switch off the device - this one seems to send it to standby rather than off
-			TheClient->iWs.SimulateKeyEvent(event);
-			// switch it back on or no further tests will complete
-			iTest->SimulateEvent(TRawEvent::ESwitchOn);
-			TheClient->iWs.Flush();	
-			// again we would expect EEventKeySwitchOff but it doesn't come back. The tests will hang if we look for one
-			AddExpectedEvent(EEventSwitchOn);
-			}
-			break;
-		
-		case 6:
-			iQueueClient->iWs.Flush();
-			iTest->SimulateEvent(TRawEvent::ESwitchOn);
-			iTest->SimulateEvent(TRawEvent::ECaseOpen);
-			TheClient->iWs.Flush();
-			User::LeaveIfError(iQueueClient->iWin->WinTreeNode()->EnableOnEvents(EEventControlAlways));
-			iTest->SimulateEvent(TRawEvent::ECaseOpen);
-			iTest->SimulateEvent(TRawEvent::ESwitchOn);
-			TheClient->iWs.Flush();
-			iQueueClient->iWin->WinTreeNode()->DisableOnEvents();
-			AddExpectedEvent(EEventSwitchOn);
-			AddExpectedEvent(EEventCaseOpened);
-			AddExpectedEvent(EEventCaseOpened,iQueueClient->iWin);
-			AddExpectedEvent(EEventCaseOpened);
-			AddExpectedEvent(EEventSwitchOn,iQueueClient->iWin);
-			AddExpectedEvent(EEventSwitchOn);
-			break;
-					
-		default:
-			CActiveScheduler::Stop();
-			break;
-		}
-	TheClient->iWs.Flush();
-	}
-	
-void CTEventTest::VirtualKeyboard_NextSetOfEventsL()
-	{
-	const TInt noVirtualKeys=10;
-	const TInt keyWidth=2*EWinWidth/noVirtualKeys/3;
-	const TInt keyHeight=EWinHeight/2;
-	const TInt keySpacing=EWinWidth/noVirtualKeys;
-	const TInt baseChar='1';
-	TInt startX=1;
-	TInt ii;
-	switch(iEventSet++)
-		{
-		case 0:
-			iQueueClient->iWin->BaseWin()->SetPointerGrab(EFalse);
-			for (ii=0;ii<noVirtualKeys;++ii)
-				{
-				iQueueClient->iWin->BaseWin()->AddKeyRect(TRect(startX,1,startX+keyWidth,keyHeight),baseChar+ii,EFalse);
-				startX+=keySpacing;
-				}
-			iQueueClient->iWs.Flush();
-			iTest->SimulatePointerDownUp(EWinPositionX+1,EWinPositionY+1+iYOffset);
-			//TheClient->iWs.Flush();
-			AddExpectedEvent(EEventFocusGained);
-			AddExpectedKeyDownUp(baseChar);
-			break;
-		case 1:
-			startX=3;
-			for (ii=0;ii<noVirtualKeys-2;++ii)		//Can't do all 10 as this will overflow the event buffer
-				{
-				iTest->SimulatePointerDownUp(startX+EWinPositionX+1,EWinPositionY+keyHeight-1+iYOffset);
-				AddExpectedKeyDownUp(baseChar+ii);
-				startX+=keySpacing;
-				}
-			break;
-		case 2:
-			SimulatePointerDownUpWin(keySpacing+1,1);
-			//SimulatePointerDownUp(EWinPositionX+keySpacing+1,EWinPositionY+1);
-			iTest->SimulatePointerDownUp(EWinPositionX+keyWidth,EWinPositionY+1+iYOffset);
-			iTest->SimulatePointerDownUp(EWinPositionX+1,EWinPositionY+keyHeight-1+iYOffset);
-			iTest->SimulatePointerDownUp(EWinPositionX+keyWidth,EWinPositionY+keyHeight-1+iYOffset);
-			AddExpectedKeyDownUp(baseChar+1);
-			AddExpectedKeyDownUp(baseChar);
-			AddExpectedKeyDownUp(baseChar);
-			AddExpectedKeyDownUp(baseChar);
-			break;
-		case 3:
-			SimulatePointerDownUpWin(keySpacing+3,4);
-			SimulatePointerDownUpWin(0,0);		//No Pointer event get through even if there are gaps
-			SimulatePointerDownUpWin(1,0);
-			SimulatePointerDownUpWin(0,1);
-			SimulatePointerDownUpWin(keyWidth+1,0);
-			SimulatePointerDownUpWin(keyWidth,0);
-			SimulatePointerDownUpWin(keyWidth+1,1);
-			SimulatePointerDownUpWin(0,keyHeight);
-			SimulatePointerDownUpWin(1,keyHeight);
-			SimulatePointerDownUpWin(0,keyHeight-1);
-			SimulatePointerDownUpWin(keyWidth+1,keyHeight);
-			SimulatePointerDownUpWin(keyWidth,keyHeight);
-			SimulatePointerDownUpWin(keyWidth+1,keyHeight-1);
-			SimulatePointerDownUpWin(2*keySpacing+3,4);
-			AddExpectedKeyDownUp(baseChar+1);
-			AddExpectedPointerDownUpScr(TPoint(EWinPositionX+0,EWinPositionY+0));		//No Pointer event get through even if there are gaps
-			AddExpectedPointerDownUpScr(TPoint(EWinPositionX+1,EWinPositionY+0));
-			AddExpectedPointerDownUpScr(TPoint(EWinPositionX+0,EWinPositionY+1));
-			AddExpectedPointerDownUpScr(TPoint(EWinPositionX+keyWidth+1,EWinPositionY+0));
-			AddExpectedPointerDownUpScr(TPoint(EWinPositionX+keyWidth,EWinPositionY+0));
-			AddExpectedPointerDownUpScr(TPoint(EWinPositionX+keyWidth+1,EWinPositionY+1));
-			AddExpectedPointerDownUpScr(TPoint(EWinPositionX+0,EWinPositionY+keyHeight));
-			AddExpectedPointerDownUpScr(TPoint(EWinPositionX+1,EWinPositionY+keyHeight));
-			AddExpectedPointerDownUpScr(TPoint(EWinPositionX+0,EWinPositionY+keyHeight-1));
-			AddExpectedPointerDownUpScr(TPoint(EWinPositionX+keyWidth+1,EWinPositionY+keyHeight));
-			AddExpectedPointerDownUpScr(TPoint(EWinPositionX+keyWidth,EWinPositionY+keyHeight));
-			AddExpectedPointerDownUpScr(TPoint(EWinPositionX+keyWidth+1,EWinPositionY+keyHeight-1));
-			AddExpectedKeyDownUp(baseChar+2);
-			break;
-		case 4:
-			SimulatePointerWin(TRawEvent::EButton1Down,keySpacing+2,6);
-			SimulatePointerWin(TRawEvent::EButton1Up,2*keySpacing+1,5);
-			SimulatePointerWin(TRawEvent::EButton1Down,2*keySpacing+2,7);
-			SimulatePointer(TRawEvent::EButton1Up,0,0);
-			AddExpectedKeyDownUp(baseChar+1);
-			AddExpectedKeyDownUp(baseChar+2);
-			break;
-		default:
-			CActiveScheduler::Stop();
-			break;
-		}
-	TheClient->iWs.Flush();
-	}
-
-TInt CTEventTest::ClickCommandReply(TInt aCommand,TInt aData)
-	{
-	TPckgBuf<TInt> intPkg;
-	intPkg()=aData;
-	return iClick.CommandReply(aCommand,intPkg);
-	}
-
-TInt CTEventTest::CreateGroupWindow(RWindowGroup& aWinGp,TClients aClient,TInt& aWinGpId)
-	{
-	ClickCommandReply(EClickCreateGroupWin,aClient);
-	TInt err=aWinGp.Construct(ENullWsHandle,EFalse);
-	if (!err)
-		{
-		aWinGpId=aWinGp.Identifier();
-		ClickCommandReply(EClickCheckGpWinId,aWinGpId);
-		}
-	return err;
-	}
-
-void CTEventTest::CloseGroupWindow(RWindowGroup& aWinGp,TInt aWinGpId)
-	{
-	ClickCommandReply(EClickCloseGroupWin,aWinGpId);
-	aWinGp.Close();
-	}
-
-void CTEventTest::CloseWindow(RWindowBase& aWin,TInt aHandle,TInt aWinGpId)
-	{
-	TPckgBuf<TWindowCloseData> winClose;
-	winClose().iClientHandle=aHandle;
-	winClose().iWindowGroupId=aWinGpId;
-	iClick.CommandReply(EClickCloseWin,winClose);
-	aWin.Close();
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0447
-
-@SYMCR				CR1164
-
-@SYMTestCaseDesc	Tests that Key Click Plug-in gets new event Information
-
-@SYMTestPriority	High
-
-@SYMTestStatus		Implemented
-
-@SYMTestActions		Do things that cause the new events to be sent into plug-in.
-Creating destroying windows, pointer events.  Provide test plug-in with information it needs to check events.
-
-@SYMTestExpectedResults When Test Plug-in is querried to see if events match what was expected it says that they were.
-*/
-void CTEventTest::KeyClicks_NextSetOfEvents()
-	{
-#if defined(LOGGING)
-	TLogMessageText logMessageText;
-	_LIT(KSet,"KeyClicks SetOfEvents: %d (last=13)");
-	logMessageText.Format(KSet,iEventSet);
-	INFO_PRINTF1(logMessageText);
-#endif
-	TInt events=-1;
-	switch(iEventSet++)
-		{
-		case 0:
-			if (SetClickType(EClickCheck))
-				return;
-			iAddToClick=ETrue;
-			iQueueClient->iWin->BaseWin()->SetPointerGrab(EFalse);
-			iQueueClient->iChildWin->BaseWin()->SetPointerGrab(EFalse);
-			AddExpectedEvent(EEventFocusGained);
-			AddExpectedKeyDownUp(EStdKeySpace,EKeySpace);
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKeyDownUp(EStdKeySpace);		//3 events
-			events=3;
-			break;
-		case 1:
-			AddExpectedKeyDownUp(EStdKeyEnter,EKeyEnter);
-			AddExpectedKeyDownUp('0');
-			AddExpectedKeyDownUp('A','a');
-			AddExpectedKeyDownUp('X','x');
-			AddExpectedKey(EEventKeyDown,EStdKeyLeftShift,0,0,EModifierLeftShift|EModifierShift);
-			AddExpectedKey(EEventKeyUp,EStdKeyLeftShift);
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKeyDownUp(EStdKeyEnter);		//3 events
-			iTest->SimulateKeyDownUp('0');		//3 events
-			iTest->SimulateKeyDownUp('A');		//3 events
-			iTest->SimulateKeyDownUp('X');		//3 events
-			iTest->SimulateKeyDownUp(EStdKeyLeftShift);		//2 events
-			events=14;
-			break;
-		case 2:
-			AddExpectedKey(EEventKeyDown,EStdKeyRightShift,0,0,EModifierRightShift|EModifierShift);
-			AddExpectedKeyDownUp('B','B',0,EModifierRightShift|EModifierShift);
-			AddExpectedKeyDownUp('W','W',0,EModifierRightShift|EModifierShift);
-			AddExpectedKey(EEventKeyUp,EStdKeyRightShift);
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeyRightShift);		//1 event
-			iTest->SimulateKeyDownUp('B');		//3 events
-			iTest->SimulateKeyDownUp('W');		//3 events
-			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeyRightShift);		//1 event
-			events=8;
-			break;
-		case 3:
-			AddExpectedKey(EEventKeyDown,'C');
-			AddExpectedKey(EEventKey,'C','c');
-			AddExpectedKey(EEventKeyDown,'V');
-			AddExpectedKey(EEventKey,'V','v');
-			AddExpectedKey(EEventKeyUp,'C');
-			AddExpectedKey(EEventKeyUp,'V');
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKey(TRawEvent::EKeyDown,'C');		//2 events
-			iTest->SimulateKey(TRawEvent::EKeyDown,'V');		//2 events
-			iTest->SimulateKey(TRawEvent::EKeyUp,'C');		//1 event
-			iTest->SimulateKey(TRawEvent::EKeyUp,'V');		//1 event
-			events=6;
-			break;
-		case 4:
-			{
-			AddExpectedKey(EEventKeyDown,'D');
-			AddExpectedKey(EEventKey,'D','d');
-			AddExpectedKey(EEventKey,'D','d',1);
-			AddExpectedKey(EEventKeyUp,'D');
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKey(TRawEvent::EKeyDown,'D');		//2 events
-			TTimeIntervalMicroSeconds32 initialTime,time;
-			TheClient->iWs.GetKeyboardRepeatRate(initialTime,time);
-			User::After(initialTime.Int()+time.Int()/4);		//1 event
-			iTest->SimulateKey(TRawEvent::EKeyUp,'D');		//1 event
-			events=4;
-			}
-			break;
-		case 5:
-			AddExpectedPointerDownUpScr(TPoint(40,25));
-			AddExpectedPointerDownUpScr(TPoint(95,30));
-			AddExpectedPointer(TPointerEvent::EButton1Down,TPoint(20-EWinPositionX,50-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EDrag,TPoint(45-EWinPositionX,42-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up,TPoint(45-EWinPositionX,42-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down,TPoint(98-EWinPositionX,15-EWinPositionY));
-			AddExpectedPointerClick(TPointerEvent::EDrag,TPoint(68-EWinPositionX,39-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EDrag,TPoint(41-EWinPositionX,42-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up,TPoint(50-EWinPositionX,58-EWinPositionY));
-			iQueueClient->iWs.Flush();
-			iTest->SimulatePointerDownUp(40,25+iYOffset);		//2 events
-			iTest->SimulatePointerDownUp(95,30+iYOffset);		//2 events
-			SimulatePointer(TRawEvent::EButton1Down,20,50);		//1 event
-			SimulatePointer(TRawEvent::EPointerMove,45,42);		//1 event
-			SimulatePointer(TRawEvent::EButton1Up,45,42);		//1 event
-			SimulatePointer(TRawEvent::EButton1Down,98,15);		//1 event
-			SimulatePointer(TRawEvent::EPointerMove,68,39);		//1 event
-			SimulatePointer(TRawEvent::EPointerMove,41,42);		//1 event
-			SimulatePointer(TRawEvent::EButton1Up,50,58);		//1 event
-			events=11;
-			break;
-		case 6:
-			AddExpectedKey(EEventKeyDown,'E');
-			AddExpectedKey(EEventKey,'E','e');
-			AddExpectedPointerDownUpScr(TPoint(41,24));
-			AddExpectedKey(EEventKeyUp,'E');
-			AddExpectedPointer(TPointerEvent::EButton1Down,TPoint(23-EWinPositionX,52-EWinPositionY));
-			AddExpectedKeyDownUp('1');
-			AddExpectedPointer(TPointerEvent::EButton1Up,TPoint(44-EWinPositionX,45-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Down,TPoint(33-EWinPositionX,53-EWinPositionY));
-			AddExpectedKey(EEventKeyDown,'F');
-			AddExpectedKey(EEventKey,'F','f');
-			AddExpectedPointer(TPointerEvent::EButton1Up,TPoint(34-EWinPositionX,47-EWinPositionY));
-			AddExpectedKey(EEventKeyUp,'F');
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKey(TRawEvent::EKeyDown,'E');		//2 events
-			iTest->SimulatePointerDownUp(41,24+iYOffset);		//2 events
-			iTest->SimulateKey(TRawEvent::EKeyUp,'E');		//1 event
-			SimulatePointer(TRawEvent::EButton1Down,23,52);		//1 event
-			iTest->SimulateKeyDownUp('1');		//3 events
-			SimulatePointer(TRawEvent::EButton1Up,44,45);		//1 event
-			SimulatePointer(TRawEvent::EButton1Down,33,53);		//1 event
-			iTest->SimulateKey(TRawEvent::EKeyDown,'F');		//2 events
-			SimulatePointer(TRawEvent::EButton1Up,34,47);		//1 event
-			iTest->SimulateKey(TRawEvent::EKeyUp,'F');		//1 event
-			events=15;
-			break;
-		case 7:
-			AddExpectedKeyDownUp('2');
-			iAddToClick=EFalse;
-			AddExpectedKeyDownUp('G','g');
-			iAddToClick=ETrue;
-			AddExpectedPointerDownUpScr(TPoint(42,26));
-			AddExpectedKeyDownUp('U','u');
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKeyDownUp('2');		//3 events
-			TheClient->iWs.Flush();
-			iQueueClient->iGroup->GroupWin()->DisableKeyClick(ETrue);
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKeyDownUp('G');
-			iTest->SimulatePointerDownUp(42,26+iYOffset);		//2 events
-			TheClient->iWs.Flush();
-			iQueueClient->iGroup->GroupWin()->DisableKeyClick(EFalse);
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKeyDownUp('U');		//3 events
-			events=8;
-			break;
-		case 8:
-			{
-			TPckgBuf<TPointerEventInfo> pointerEventInfo;
-			pointerEventInfo().iClientHandle=reinterpret_cast<TInt>(iQueueClient->iChildWin);
-			pointerEventInfo().iWinGpId=iQueueClient->iGroup->GroupWin()->Identifier();
-			pointerEventInfo().iWinOrigin=iQueueClient->ChildTopLeft();
-			pointerEventInfo().iParentOrigin.SetXY(EWinPositionX,EWinPositionY);
-			iClick.CommandReply(EClickPointerEvent,pointerEventInfo);
-			AddExpectedKeyDownUp('3');
-			AddExpectedPointerDownUpScr(TPoint(43,26));
-			AddExpectedKeyDownUp('H','h');
-			iAddToClick=EFalse;
-			AddExpectedPointerDownUpScr(TPoint(43,27));
-			AddExpectedKeyDownUp('4');
-			AddExpectedPointerDownUpScr(TPoint(42,27));
-			AddExpectedKeyDownUp('I','i');
-			iAddToClick=ETrue;
-			AddExpectedPointerDownUpScr(TPoint(44,27));
-			AddExpectedKeyDownUp('5');
-			AddExpectedPointerDownUpScr(TPoint(44,26));
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKeyDownUp('3');		//3 events
-			iTest->SimulatePointerDownUp(43,26+iYOffset);		//2 events
-			iClick.SetPenClick(EFalse);
-			iTest->SimulateKeyDownUp('H');		//3 events
-			iTest->SimulatePointerDownUp(43,27+iYOffset);
-			iClick.SetKeyClick(EFalse);
-			iTest->SimulateKeyDownUp('4');
-			iTest->SimulatePointerDownUp(42,27+iYOffset);
-			iClick.SetPenClick(ETrue);
-			iTest->SimulateKeyDownUp('I');
-			iTest->SimulatePointerDownUp(44,27+iYOffset);		//2 events
-			iClick.SetKeyClick(ETrue);
-			iTest->SimulateKeyDownUp('5');		//3 events
-			iTest->SimulatePointerDownUp(44,26+iYOffset);		//2 events
-			pointerEventInfo().iClientHandle=0;
-			pointerEventInfo().iWinGpId=0;
-			iClick.CommandReply(EClickPointerEvent,pointerEventInfo);
-			events=15;
-			}
-			break;
-		case 9:
-			{
-			RWindowGroup winGp(iQueueClient->iWs);
-			TInt winGpId;
-			TInt ii;
-			AddExpectedEvent(EEventWindowGroupsChanged);
-			for (ii=0;ii<2;++ii)	//events x2
-				{
-				if (CreateGroupWindow(winGp,EQueueClient,winGpId))		//1 event
-					Failed();
-				CloseGroupWindow(winGp,winGpId);		//1 event
-				iQueueClient->iWs.Flush();
-				}
-			events=4;
-			}
-			break;
-		case 10:
-			{
-			RWindowGroup winGp(TheClient->iWs);
-			RWindowGroup winGp1(iQueueClient->iWs);
-			RWindowGroup winGp2(iQueueClient->iWs);
-			TInt winGpId;
-			TInt winGpId1;
-			TInt winGpId2;
-			AddExpectedEvent(EEventWindowGroupsChanged);
-			if (CreateGroupWindow(winGp,ETheClient,winGpId))		//1 event
-				Failed();
-			CloseGroupWindow(winGp,winGpId);		//1 event
-			TheClient->iWs.Flush();
-			if (CreateGroupWindow(winGp1,EQueueClient,winGpId1))		//1 event
-				Failed();
-			if (CreateGroupWindow(winGp2,EQueueClient,winGpId2))		//1 event
-				Failed();
-			if (CreateGroupWindow(winGp,ETheClient,winGpId))		//1 event
-				Failed();
-			CloseGroupWindow(winGp2,winGpId2);		//1 event
-			iQueueClient->iWs.Flush();
-			CloseGroupWindow(winGp,winGpId);		//1 event
-			TheClient->iWs.Flush();
-			CloseGroupWindow(winGp1,winGpId1);		//1 event
-			iQueueClient->iWs.Flush();
-			events=8;
-			}
-			break;
-		case 11:
-			{
-			RWindowGroup winGp(iQueueClient->iWs);
-			TInt winGpId;
-			AddExpectedEvent(EEventWindowGroupsChanged);
-			if (CreateGroupWindow(winGp,EQueueClient,winGpId))		//1 event
-				Failed();
-			RWindow win(iQueueClient->iWs);
-			const TInt handle=79;
-			if (win.Construct(winGp,handle))
-				Failed();
-			win.Activate();
-			CloseWindow(win,handle,winGpId);		//1 event
-			iQueueClient->iWs.Flush();
-			CloseGroupWindow(winGp,winGpId);		//1 event
-			iQueueClient->iWs.Flush();
-			events=3;
-			}
-			break;
-		case 12:
-			{
-			RWindowGroup winGp1(iQueueClient->iWs);
-			RWindowGroup winGp2(TheClient->iWs);
-			TInt winGpId1;
-			TInt winGpId2;
-			AddExpectedEvent(EEventWindowGroupsChanged);
-			if (CreateGroupWindow(winGp2,ETheClient,winGpId2))		//1 event
-				Failed();
-			if (CreateGroupWindow(winGp1,EQueueClient,winGpId1))		//1 event
-				Failed();
-			RWindow win1(iQueueClient->iWs);
-			RWindow win2(iQueueClient->iWs);
-			RWindow win(TheClient->iWs);
-			const TInt handle1a=80;
-			const TInt handle1b=81;
-			const TInt handle2a=82;
-			const TInt handle2b=83;
-			const TInt handle=84;
-			if (win1.Construct(winGp1,handle1a))
-				Failed();
-			win1.Activate();
-			if (win2.Construct(win1,handle2a))
-				Failed();
-			win2.Activate();
-			if (win.Construct(winGp2,handle))
-				Failed();
-			win.Activate();
-			CloseWindow(win2,handle2a,winGpId1);		//1 event
-			iQueueClient->iWs.Flush();
-			if (win2.Construct(winGp1,handle2b))
-				Failed();
-			win2.Activate();
-			CloseWindow(win1,handle1a,winGpId1);		//1 event
-			iQueueClient->iWs.Flush();
-			CloseWindow(win,handle,winGpId2);		//1 event
-			TheClient->iWs.Flush();
-			if (win1.Construct(win2,handle1b))
-				Failed();
-			win1.Activate();
-			CloseWindow(win1,handle1b,winGpId1);		//1 event
-			iQueueClient->iWs.Flush();
-			CloseGroupWindow(winGp2,winGpId2);		//1 event
-			TheClient->iWs.Flush();
-			CloseWindow(win2,handle2b,winGpId1);		//1 event
-			iQueueClient->iWs.Flush();
-			CloseGroupWindow(winGp1,winGpId1);		//1 event
-			iQueueClient->iWs.Flush();
-			events=9;
-			}
-			break;
-		case 13:
-			{
-			TPckgBuf<TPointerEventInfo> pointerEventInfo;
-			pointerEventInfo().iClientHandle=reinterpret_cast<TInt>(iQueueClient->iWin);
-			pointerEventInfo().iWinGpId=iQueueClient->iGroup->GroupWin()->Identifier();
-			pointerEventInfo().iWinOrigin.SetXY(EWinPositionX,EWinPositionY);
-			pointerEventInfo().iParentOrigin.SetXY(0,0);
-			iClick.CommandReply(EClickPointerEvent,pointerEventInfo);
-			AddExpectedPointerDownUpScr(TPoint(43,18));
-			AddExpectedPointerDownUpScr(TPoint(43,17));
-			AddExpectedPointerDownUpScr(TPoint(42,52));
-			AddExpectedPointerDownUpScr(TPoint(24,27));
-			AddExpectedPointerDownUpScr(TPoint(94,26));
-			iQueueClient->iWs.Flush();
-			iTest->SimulatePointerDownUp(43,18+iYOffset);		//2 events
-			iTest->SimulatePointerDownUp(43,17+iYOffset);		//2 events
-			iTest->SimulatePointerDownUp(42,52+iYOffset);		//2 events
-			iTest->SimulatePointerDownUp(24,27+iYOffset);		//2 events
-			iTest->SimulatePointerDownUp(94,26+iYOffset);		//2 events
-			pointerEventInfo().iClientHandle=0;
-			pointerEventInfo().iWinGpId=0;
-			iClick.CommandReply(EClickPointerEvent,pointerEventInfo);
-			events=10;
-			}
-			break;
-		default:
-			iAddToClick=EFalse;
-			if (!SetClickType(EClickNone))
-				CActiveScheduler::Stop();
-			return;
-		}
-	TInt failedAt=iClick.CommandReply(EClickFailed,TPtrC8(NULL,0));
-	TInt eventsDone=iClick.CommandReply(EClickEvents,TPtrC8(NULL,0));
-	if (failedAt!=0 || eventsDone!=events)		//iEventSet (already incremented)
-		{
-	#if defined(LOGGING)
-		_LIT(KeyClickFailed,"KeyClick Failed EventSet=%d FailedAt=%d TotalEvents=%d EventsDone=%d");
-		logMessageText.Format(KeyClickFailed,iEventSet-1,failedAt,events,eventsDone);
-		INFO_PRINTF1(logMessageText);
-	#endif
-		Failed();
-		}
-	iClick.CommandReply(EClickReset,TPtrC8(NULL,0));
-	}
-
-void CTEventTest::CaptureLong_NextSetOfEventsL()
-	{
-	TTimeIntervalMicroSeconds32 initialTime,time;
-	TheClient->iWs.GetKeyboardRepeatRate(initialTime,time);
-	#if defined(LOGGING)
-		TLogMessageText logMessageText;
-		_LIT(KSet,"CaptureLong SetOfEvents: %d of 14");
-		logMessageText.Format(KSet,iEventSet);
-		INFO_PRINTF1(logMessageText);
-	#endif
-
-	switch(iEventSet++)
-		{
-		case 0:
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKeyDownUp('A');
-			AddExpectedEvent(EEventFocusGained);
-			AddExpectedKeyDownUp('A','a');
-			break;
-		case 1:
-			iCaptureKey=iQueueClient->iGroup->GroupWin()->CaptureLongKey(' ','a',0,0,2,ELongCaptureNormal);
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeySpace);
-			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+time.Int()/3);
-			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeySpace);
-			AddExpectedKey(EEventKeyDown,EStdKeySpace);
-			AddExpectedKey(EEventKey,EStdKeySpace,' ');
-			AddExpectedKey(EEventKey,EStdKeySpace,'a',1);
-			AddExpectedKey(EEventKeyUp,EStdKeySpace);
-			iQueueClient->iGroup->GroupWin()->CancelCaptureLongKey(iCaptureKey);
-			break;
-		case 2:
-			iCaptureKey=iQueueClient->iGroup->GroupWin()->CaptureLongKey(' ','a',0,0,2,ELongCaptureWaitShort);
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeySpace);
-			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+time.Int()/3);
-			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeySpace);
-			iTest->SimulateKeyDownUp(EStdKeySpace);
-			AddExpectedKey(EEventKeyDown,EStdKeySpace);
-			AddExpectedKey(EEventKey,EStdKeySpace,'a',1);
-			AddExpectedKey(EEventKeyUp,EStdKeySpace);
-			AddExpectedKeyDownUp(EStdKeySpace,' ');
-			iQueueClient->iGroup->GroupWin()->CancelCaptureLongKey(iCaptureKey);
-			break;
-		case 3:
-			iCaptureKey=iQueueClient->iGroup->GroupWin()->CaptureLongKey(' ','a',0,0,2,ELongCaptureNormal|ELongCaptureRepeatEvents);
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeySpace);
-			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+5*time.Int());
-			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeySpace);
-			AddExpectedKey(EEventKeyDown,EStdKeySpace);
-			AddExpectedKey(EEventKey,EStdKeySpace,' ');
-			AddExpectedKey(EEventKey,EStdKeySpace,'a',2);
-			AddExpectedKey(EEventKeyUp,EStdKeySpace);
-			iQueueClient->iGroup->GroupWin()->CancelCaptureLongKey(iCaptureKey);
-			break;
-		case 4:
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKey(TRawEvent::EKeyDown,'Z');
-			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+3*time.Int());
-			iTest->SimulateKey(TRawEvent::EKeyDown,'Y');
-			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+2*time.Int());
-			iTest->SimulateKey(TRawEvent::EKeyUp,'Z');
-			iTest->SimulateKey(TRawEvent::EKeyUp,'Y');
-			AddExpectedKey(EEventKeyDown,'Z');
-			AddExpectedKey(EEventKey,'Z','z');
-			AddExpectedKey(EEventKey,'Z','z',1);
-			AddExpectedKey(EEventKeyDown,'Y');
-			AddExpectedKey(EEventKey,'Y','y');
-			AddExpectedKey(EEventKey,'Y','y',1);
-			AddExpectedKey(EEventKeyUp,'Z');
-			AddExpectedKey(EEventKeyUp,'Y');
-			break;
-		case 5:
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKey(TRawEvent::EKeyDown,'Z');
-			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+3*time.Int());
-			iTest->SimulateKey(TRawEvent::EKeyDown,'Y');
-			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+5*time.Int()/2);
-			iTest->SimulateKey(TRawEvent::EKeyUp,'Y');
-			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+2*time.Int());
-			iTest->SimulateKey(TRawEvent::EKeyUp,'Z');
-			AddExpectedKey(EEventKeyDown,'Z');
-			AddExpectedKey(EEventKey,'Z','z');
-			AddExpectedKey(EEventKey,'Z','z',1);
-			AddExpectedKey(EEventKeyDown,'Y');
-			AddExpectedKey(EEventKey,'Y','y');
-			AddExpectedKey(EEventKey,'Y','y',1);
-			AddExpectedKey(EEventKeyUp,'Y');
-			AddExpectedKey(EEventKey,'Z','z',1);
-			AddExpectedKey(EEventKeyUp,'Z');
-			break;
-		case 6:
-			iCaptureKey=iQueueClient->iGroup->GroupWin()->CaptureLongKey(' ','b',0,0,2,ELongCaptureNormal);
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKey(TRawEvent::EKeyDown,'X');
-			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+3*time.Int());
-			iTest->SimulateKeyDownUp(EStdKeySpace);
-			TheClient->iWs.Flush();
-			if(!iTest->IsFullRomL())
-				{
-				User::After(initialTime.Int()+2*time.Int());
-				}
-			iTest->SimulateKey(TRawEvent::EKeyUp,'X');
-			AddExpectedKey(EEventKeyDown,'X');
-			AddExpectedKey(EEventKey,'X','x');
-			AddExpectedKey(EEventKey,'X','x',1);
-			AddExpectedKey(EEventKeyDown,EStdKeySpace);
-			AddExpectedKey(EEventKey,EStdKeySpace,' ');
-			AddExpectedKey(EEventKeyUp,EStdKeySpace);
-			if(!iTest->IsFullRomL())
-				{
-				AddExpectedKey(EEventKey,'X','x',1);
-				}
-			AddExpectedKey(EEventKeyUp,'X');
-			iQueueClient->iGroup->GroupWin()->CancelCaptureLongKey(iCaptureKey);
-			break;
-		case 7:
-			iCaptureKey=iQueueClient->iGroup->GroupWin()->CaptureLongKey(' ','b',0,0,2,ELongCaptureNormal|ELongCaptureRepeatEvents);
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKey(TRawEvent::EKeyDown,'X');
-			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+5*time.Int());
-			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeySpace);
-			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+time.Int()/3);
-			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeySpace);
-			TheClient->iWs.Flush();
-			User::ResetInactivityTime();
-			User::After(initialTime.Int()+4*time.Int());
-			iTest->SimulateKey(TRawEvent::EKeyUp,'X');
-			AddExpectedKey(EEventKeyDown,'X');
-			AddExpectedKey(EEventKey,'X','x');
-			AddExpectedKey(EEventKey,'X','x',1);
-			AddExpectedKey(EEventKeyDown,EStdKeySpace);
-			AddExpectedKey(EEventKey,EStdKeySpace,' ');
-			AddExpectedKey(EEventKey,EStdKeySpace,'b',1);
-			AddExpectedKey(EEventKeyUp,EStdKeySpace);
-			AddExpectedKey(EEventKey,'X','x',1);
-			AddExpectedKey(EEventKeyUp,'X');
-			iQueueClient->iGroup->GroupWin()->CancelCaptureLongKey(iCaptureKey);
-			break;
-		case 8:
-			iCaptureKey=iQueueClient->iGroup->GroupWin()->CaptureLongKey(' ','c',0,0,2,ELongCaptureRepeatEvents);
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeySpace);
-			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+5*time.Int());
-			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeySpace);
-			AddExpectedKey(EEventKeyDown,EStdKeySpace);
-			AddExpectedKey(EEventKey,EStdKeySpace,'c',1);
-			AddExpectedKey(EEventKeyUp,EStdKeySpace);
-			iQueueClient->iGroup->GroupWin()->CancelCaptureLongKey(iCaptureKey);
-			break;
-		case 9:
-			{
-			TInt captureKey=iQueueClient->iGroup->GroupWin()->CaptureLongKey(EKeyEscape,'e',0,0,2,ELongCaptureNormal|ELongCaptureRepeatEvents);
-			iCaptureKey=iQueueClient->iGroup->GroupWin()->CaptureLongKey(' ','d',0,0,2,ELongCaptureNormal|ELongCaptureRepeatEvents);
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeySpace);
-			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+5*time.Int()/2);
-			iTest->SimulateKeyDownUp(EStdKeyEscape);
-			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+3*time.Int());
-			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeySpace);
-			AddExpectedKey(EEventKeyDown,EStdKeySpace);
-			AddExpectedKey(EEventKey,EStdKeySpace,' ');
-			AddExpectedKey(EEventKey,EStdKeySpace,'d',1);
-			AddExpectedKey(EEventKeyDown,EStdKeyEscape);
-			AddExpectedKey(EEventKey,EStdKeyEscape,EKeyEscape);
-			AddExpectedKey(EEventKeyUp,EStdKeyEscape);
-			AddExpectedKey(EEventKeyUp,EStdKeySpace);
-			iQueueClient->iGroup->GroupWin()->CancelCaptureLongKey(iCaptureKey);
-			iQueueClient->iGroup->GroupWin()->CancelCaptureLongKey(captureKey);
-			}
-			break;
-		case 10:
-			//Cancel a long capture key event whilst a repeat is underway
-			iCaptureKey=iQueueClient->iGroup->GroupWin()->CaptureLongKey(' ','a',0,0,2,ELongCaptureNormal|ELongCaptureRepeatEvents);
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeySpace);
-			TheClient->iWs.Flush();
-			iQueueClient->iGroup->GroupWin()->CancelCaptureLongKey(iCaptureKey);
-			User::After(initialTime.Int()+5*time.Int());
-			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeySpace);
-			AddExpectedKey(EEventKeyDown,EStdKeySpace);
-			AddExpectedKey(EEventKey,EStdKeySpace,' ');
-			AddExpectedKey(EEventKeyUp,EStdKeySpace);
-			break;
-		case 11:
-			//Cancel a capture key up and down event whilst a repeat is underway
-			iCaptureKey=iQueueClient->iGroup->GroupWin()->CaptureKeyUpAndDowns(EStdKeySpace,0,0);
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKey(TRawEvent::EKeyDown,'X');
-			TheClient->iWs.Flush();
-			iQueueClient->iGroup->GroupWin()->CancelCaptureKeyUpAndDowns(iCaptureKey);
-			User::After(initialTime.Int()+5*time.Int());
-			iTest->SimulateKey(TRawEvent::EKeyUp,'X');
-			AddExpectedKey(EEventKeyDown,'X');
-			AddExpectedKey(EEventKey,'X','x');
-			AddExpectedKey(EEventKeyUp,'X');
-			break;
-		case 12:
-			//Cancel a capture key event whilst a repeat is underway
-			iCaptureKey=iQueueClient->iGroup->GroupWin()->CaptureKey(EStdKeySpace,0,0);
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKey(TRawEvent::EKeyDown,'Y');
-			TheClient->iWs.Flush();
-			iQueueClient->iGroup->GroupWin()->CancelCaptureKey(iCaptureKey);
-			User::After(initialTime.Int()+5*time.Int());
-			iTest->SimulateKey(TRawEvent::EKeyUp,'Y');
-			AddExpectedKey(EEventKeyDown,'Y');
-			AddExpectedKey(EEventKey,'Y','y');
-			AddExpectedKey(EEventKeyUp,'Y');
-			break;
-		case 13:
-			//Variation on case 12 i.e. change in the timing of the CancelCaptureKey call
-			iCaptureKey=iQueueClient->iGroup->GroupWin()->CaptureKey(EStdKeySpace,0,0);
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKey(TRawEvent::EKeyDown,'Z');
-			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+5*time.Int()/2);
-			iQueueClient->iGroup->GroupWin()->CancelCaptureKey(iCaptureKey);
-			User::After(initialTime.Int()+5*time.Int()/2);
-			iTest->SimulateKey(TRawEvent::EKeyUp,'Z');
-			AddExpectedKey(EEventKeyDown,'Z');
-			AddExpectedKey(EEventKey,'Z','z');
-			AddExpectedKey(EEventKey,'Z','z',2);
-			AddExpectedKey(EEventKeyUp,'Z');
-			break;
-		case 14:
-			{
-	    	// Cancel long capture key event when normal capture key is scheduled for different
-	    	// window group.
-			iCaptureKey=iQueueClient->iGroup->GroupWin()->CaptureLongKey(' ','a',0,0,2,ELongCaptureNormal);
-			TInt shortCaptKey = TheClient->iGroup->GroupWin()->CaptureKey(' ',0,0);
-
-			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeySpace);
-			TheClient->iWs.Flush();
-			iQueueClient->iGroup->GroupWin()->CancelCaptureLongKey(iCaptureKey);
-			User::After(initialTime.Int()+time.Int()/3);
-
-			TheClient->iGroup->GroupWin()->CancelCaptureKey(shortCaptKey);
-			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeySpace);
-			AddExpectedKey(EEventKeyDown,EStdKeySpace);
-			AddExpectedKey(EEventKeyUp,EStdKeySpace);
-			}
-			break;
-		default:
-			CActiveScheduler::Stop();
-			break;
-		}
-	TheClient->iWs.Flush();
-	}
-
-#define PASSWORD_START_OF_DAY 4
-void CTEventTest::Password_NextSetOfEvents()
-	{
-	switch(iEventSet++)
-		{
-		case 0:
-			iQueueClient->iWin->BaseWin()->PasswordWindow(EPasswordAlwaysTriggerNow);
-			iQueueClient->iWs.PasswordEntered();
-			iTest->SimulateKeyDownUp('2');
-			iQueueClient->iWs.Flush();
-			AddExpectedEvent(EEventFocusGained);
-			AddExpectedEvent(EEventPassword);
-			AddExpectedKeyDownUp('2');
-			break;
-		case 1:
-			iQueueClient->iWin->BaseWin()->PasswordWindow(EPasswordOnceADayTriggerNow);
-			iQueueClient->iWs.PasswordEntered();
-			iTest->SimulateKeyDownUp('3');
-			iQueueClient->iWs.Flush();
-			AddExpectedEvent(EEventPassword);
-			AddExpectedKeyDownUp('3');
-			break;
-		case 2:
-			{
-			TTime time;
-			time.HomeTime();
-			TInt day=time.DayNoInMonth();
-			if (day==0)
-				day=5;
-			time-=TTimeIntervalDays(day);
-			time+=TTimeIntervalHours(PASSWORD_START_OF_DAY);
-			User::SetHomeTime(time);
-			iQueueClient->iWin->BaseWin()->PasswordWindow(EPasswordOnceADayTriggerNow);
-			iQueueClient->iWs.PasswordEntered();
-			iTest->SimulateKeyDownUp('3');
-			iQueueClient->iWs.Flush();
-			AddExpectedEvent(EEventPassword);
-			AddExpectedKeyDownUp('3');
-			time+=TTimeIntervalDays(day);
-			time-=TTimeIntervalHours(PASSWORD_START_OF_DAY);
-			User::SetHomeTime(time);
-			}
-			break;
-		case 3:
-			{
-			TTime time;
-			time.HomeTime();
-			TInt day=time.DayNoInMonth();
-			time-=TTimeIntervalDays(day);
-			time+=TTimeIntervalHours(PASSWORD_START_OF_DAY);
-			User::SetHomeTime(time);
-			iQueueClient->iWin->BaseWin()->PasswordWindow(EPasswordOnceADay);
-			iQueueClient->iWs.PasswordEntered();
-			iTest->SimulateEvent(TRawEvent::ESwitchOn);
-			iTest->SimulateKeyDownUp('3');
-			iQueueClient->iWs.Flush();
-			AddExpectedEvent(EEventPassword);
-			AddExpectedEvent(EEventSwitchOn);
-			AddExpectedKeyDownUp('3');
-			time+=TTimeIntervalDays(day);
-			time-=TTimeIntervalHours(PASSWORD_START_OF_DAY);
-			User::SetHomeTime(time);
-			}
-			break;
-		default:
-			CActiveScheduler::Stop();
-			break;
-		}
-	TheClient->iWs.Flush();
-	}
-
-void CTEventTest::GroupListChanged_NextSetOfEventsL()
-	{
-	_LIT(WindowGroup1,"WindowGroupName1");
-	_LIT(WindowGroup2,"WindowGroupName2");
-	switch(iEventSet++)
-		{
-		case 0:
-			{
-			_LIT(TestGroup3,"GroupListEvents3");
-			iQueueClient->EnableGroupListChangeEvents();
-			iEventTestGroup3=new(ELeave) CTWindowGroup(TheClient);
-			iEventTestGroup3->ConstructL();
-			iEventTestGroup3->GroupWin()->SetName(TestGroup3);
-			AddExpectedEvent(EEventFocusGained);
-			AddExpectedEvent(EEventFocusLost);
-			AddExpectedEvent(EEventWindowGroupListChanged);
-			AddExpectedEvent(EEventWindowGroupsChanged);
-			}
-			break;
-		case 1:
-			{
-			_LIT(TestGroup4,"GroupListEvents4");
-			iEventTestGroup4=new(ELeave) CTWindowGroup(TheClient);
-			iEventTestGroup4->ConstructL();
-			iEventTestGroup4->GroupWin()->SetName(TestGroup4);
-			AddExpectedEvent(EEventWindowGroupListChanged);
-			AddExpectedEvent(EEventWindowGroupsChanged);
-			}
-			break;
-		case 2:
-			iEventTestGroup3->GroupWin()->SetOrdinalPosition(0);
-			AddExpectedEvent(EEventWindowGroupListChanged);
-			break;
-		case 3:
-			iEventTestGroup3->GroupWin()->SetOrdinalPosition(999);
-			AddExpectedEvent(EEventWindowGroupListChanged);
-			break;
-		case 4:
-			iEventTestGroup4->GroupWin()->SetOrdinalPosition(999);
-			AddExpectedEvent(EEventFocusGained);
-			AddExpectedEvent(EEventWindowGroupListChanged);
-            // Testcase for defect INC135635
-			// Since iWin has OrdinalPosition Zero (the front) clicking on it won't generate an 
-			// EEventWindowGroupListChanged event as there is no change in the order of the windows
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(20-EWinPositionX,11-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(20-EWinPositionX,11-EWinPositionY));
-			SimulatePointer(TRawEvent::EButton1Down,20,11);
-			SimulatePointer(TRawEvent::EButton1Up,20,11);
-			break;
-		case 5:
-			iEventTestGroup3->GroupWin()->SetOrdinalPosition(999);
-			AddExpectedEvent(EEventWindowGroupListChanged);
-			break;
-		case 6:
-			iEventTestGroup3->GroupWin()->SetOrdinalPosition(99);
-			SimulatePointer(TRawEvent::EButton1Down,20,11);
-			iEventTestGroup3->GroupWin()->SetName(WindowGroup1);
-			AddExpectedPointer(TPointerEvent::EButton1Down, TPoint(20-EWinPositionX,11-EWinPositionY));
-			AddExpectedEvent(EEventWindowGroupsChanged);
-			break;
-		case 7:
-			iEventTestGroup3->GroupWin()->SetName(WindowGroup2);
-			SimulatePointer(TRawEvent::EButton1Up,10,20);
-			AddExpectedEvent(EEventWindowGroupsChanged);
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(10-EWinPositionX,20-EWinPositionY));
-			break;
-		case 8:
-			iEventTestGroup3->GroupWin()->SetName(WindowGroup1);
-			SimulatePointer(TRawEvent::EButton2Down,20,30);
-			AddExpectedEvent(EEventWindowGroupsChanged);
-			AddExpectedPointer(TPointerEvent::EButton2Down, TPoint(20-EWinPositionX,30-EWinPositionY));
-			break;
-		case 9:
-			SimulatePointer(TRawEvent::EButton1Up,15,15);
-			iEventTestGroup3->GroupWin()->SetName(WindowGroup2);
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(15-EWinPositionX,15-EWinPositionY));
-			AddExpectedEvent(EEventWindowGroupsChanged);
-			break;
-		case 10:
-			SimulatePointer(TRawEvent::EButton2Down,25,20);
-			iEventTestGroup3->GroupWin()->SetName(WindowGroup2);
-			SimulatePointer(TRawEvent::EButton1Up,15,20);
-			iEventTestGroup3->GroupWin()->SetName(WindowGroup1);
-			AddExpectedPointer(TPointerEvent::EButton2Down, TPoint(25-EWinPositionX,20-EWinPositionY));
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(15-EWinPositionX,20-EWinPositionY));
-			AddExpectedEvent(EEventWindowGroupsChanged);
-			break;
-		case 11:
-			iEventTestGroup3->GroupWin()->SetName(WindowGroup1);
-			SimulatePointer(TRawEvent::EButton2Down,12,12);
-			iEventTestGroup3->GroupWin()->SetName(WindowGroup2);
-			SimulatePointer(TRawEvent::EButton1Up,12,12);
-			AddExpectedPointer(TPointerEvent::EButton2Down, TPoint(12-EWinPositionX,12-EWinPositionY));
-			AddExpectedEvent(EEventWindowGroupsChanged);
-			AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(12-EWinPositionX,12-EWinPositionY));
-			break;
-		case 12:
-			delete iEventTestGroup3;
-			iEventTestGroup3=NULL;
-			AddExpectedEvent(EEventWindowGroupsChanged);
-			AddExpectedEvent(EEventWindowGroupListChanged);
-			break;
-		case 13:
-			delete iEventTestGroup4;
-			iEventTestGroup4=NULL;
-			AddExpectedEvent(EEventWindowGroupsChanged);
-			AddExpectedEvent(EEventWindowGroupListChanged);
-			break;
-		default:
-			CActiveScheduler::Stop();
-			break;
-		}
-	TheClient->iWs.Flush();
-	}
-
-TInt CTEventTest::KeyRepeatTime() const
-	{
-	TTimeIntervalMicroSeconds32 initialTime;
-	TTimeIntervalMicroSeconds32 time;
-	TheClient->iWs.GetKeyboardRepeatRate(initialTime,time);
-	return(initialTime.Int());
-	}
-
-void CTEventTest::RepeatableKeysL()
-	{
-	// repeatable key event
-	TKeyEvent repKeyEvent; 
-	repKeyEvent.iCode='J';
-	repKeyEvent.iScanCode=0;
-	repKeyEvent.iModifiers=EModifierAutorepeatable;
-	repKeyEvent.iRepeats=0;
-	
-	// non-repeatable key event
-	TKeyEvent keyEvent; 
-	keyEvent.iCode='J';
-	keyEvent.iScanCode=0;
-	keyEvent.iModifiers=0;
-	keyEvent.iRepeats=0;
-	
-	switch(iEventSet++)
-		{
-		case 0:
-			{
-			TheClient->iWs.SimulateKeyEvent(repKeyEvent);	// Create a repeatable key event
-			TheClient->iWs.SimulateKeyEvent(repKeyEvent);	// Create a repeatable key event
-			TheClient->iWs.SimulateKeyEvent(keyEvent);		// Create a non-repeatable key event
-			TheClient->iWs.Flush();							// Send events
-			AddExpectedEvent(EEventFocusGained);			// Always get a focus gain at start
-			AddExpectedKey(1, repKeyEvent.iScanCode, repKeyEvent.iCode, repKeyEvent.iRepeats, repKeyEvent.iModifiers);// Expect the event that was created above
-			AddExpectedKey(1, repKeyEvent.iScanCode, repKeyEvent.iCode, repKeyEvent.iRepeats, repKeyEvent.iModifiers);// Expect the event that was created above
-			AddExpectedKey(1, keyEvent.iScanCode, keyEvent.iCode, keyEvent.iRepeats, keyEvent.iModifiers);// Expect the event that was created above
-			break;
-			}
-		case 1:
-			{
-			TheClient->iWs.SimulateKeyEvent(repKeyEvent);	// Create a repeatable key event
-			TheClient->iWs.SimulateKeyEvent(keyEvent);		// Create a non-repeatable key event
-			TheClient->iWs.Flush();
-			iTest->SimulateKey(TRawEvent::EKeyDown, 'A');	// Create a raw event
-			TheClient->iWs.Flush();
-			User::After(KeyRepeatTime()*3/2);
-			iTest->SimulateKey(TRawEvent::EKeyUp, 'A');		// Create a raw event
-			TheClient->iWs.Flush();
-			AddExpectedKey(1, repKeyEvent.iScanCode, repKeyEvent.iCode, repKeyEvent.iRepeats, repKeyEvent.iModifiers);// Expect the event that was created above
-			AddExpectedKey(1, keyEvent.iScanCode, keyEvent.iCode, keyEvent.iRepeats, keyEvent.iModifiers);// Expect the event that was created above
-			AddExpectedKey(EEventKeyDown, 'A');
-			AddExpectedKey(EEventKey,'A','a');
-			AddExpectedKey(EEventKey,'A','a',1);
-			AddExpectedKey(EEventKeyUp, 'A');
-			break;
-			}
-		case 2:
-			{
-			iTest->SimulateKey(TRawEvent::EKeyDown, 'A');	// Create a raw event
-			TheClient->iWs.Flush();
-			User::After(KeyRepeatTime()*3/2);
-			TheClient->iWs.SimulateKeyEvent(repKeyEvent);	// Create a repeatable key event
-			TheClient->iWs.SimulateKeyEvent(keyEvent);		// Create a non-repeatable key event
-			TheClient->iWs.Flush();							// Send event
-			iTest->SimulateKey(TRawEvent::EKeyUp, 'A');		// Create a raw event
-			TheClient->iWs.Flush();
-			AddExpectedKey(EEventKeyDown, 'A');
-			AddExpectedKey(EEventKey,'A','a');
-			AddExpectedKey(EEventKey,'A','a',1);
-			AddExpectedKey(1, repKeyEvent.iScanCode, repKeyEvent.iCode, repKeyEvent.iRepeats, repKeyEvent.iModifiers);// Expect the event that was created above
-			AddExpectedKey(1, keyEvent.iScanCode, keyEvent.iCode, keyEvent.iRepeats, keyEvent.iModifiers);// Expect the event that was created above
-			AddExpectedKey(EEventKeyUp, 'A');
-			break;
-			}
-		default:
-			CActiveScheduler::Stop();
-			break;
-		}
-	TheClient->iWs.Flush();
-	}
-
-CTBlankWindow* CTEventTest::NewBlueForgroundWindowL()
-	{
-	CTBlankWindow* window;
-	window=new (ELeave) CTBlankWindow;
-	CleanupStack::PushL(window);
-	window->ConstructL(*iQueueClient->iGroup);
-	User::LeaveIfError(window->BaseWin()->SetRequiredDisplayMode(EColor256));
-	CleanupStack::Pop(window);
-
-	window->SetColor(KRgbBlue);
-	window->SetExt(TPoint(40, 40), TSize(40,40));
-	window->BaseWin()->SetOrdinalPosition(0);
-	return window;
-	}
-
-CTBlankWindow* CTEventTest::NewBlueForgroundWindow()
-	{
-	CTBlankWindow* window = NULL;
-	TRAPD(err, window=NewBlueForgroundWindowL());
-	if (err != KErrNone)
-		Failed();
-	return window;
-	}
-
-#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
-#ifndef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-static void CreateSurfaceAttributes(RSurfaceManager::TSurfaceCreationAttributesBuf& aBuffer , const TSize& aSize)
-    {
-    RSurfaceManager::TSurfaceCreationAttributes& b = aBuffer();
-                
-    b.iSize.iWidth = aSize.iWidth;
-    b.iSize.iHeight = aSize.iHeight;
-    b.iBuffers = 1;              // number of buffers in the surface
-    b.iPixelFormat = EUidPixelFormatARGB_8888;
-    b.iStride = aSize.iWidth * 4;        // Number of bytes between start of one line and start of next
-    b.iOffsetToFirstBuffer = 0; // way of reserving space before the surface pixel data
-    b.iAlignment = 4;           // alignment, 1,2,4,8 byte aligned
-    b.iContiguous = EFalse;
-    b.iMappable = ETrue;
-    }
-
-static const TInt KFullyVisible = TWsVisibilityChangedEvent::EPartiallyVisible | TWsVisibilityChangedEvent::EFullyVisible;
-
-void CTEventTest::SurfaceVisibilityChanged1_NextSetOfEventsL()
-    {    
-    switch(iEventSet++)
-        {
-        case 0:
-            {
-            //Setup
-            LOG_MESSAGE(_L("case 0"));
-            TInt err = iSurfaceManager.Open();
-            if (err != KErrNone)
-                {
-                RDebug::Printf("RSurfaceManager::Open() failed", err);
-                User::Leave(err);
-                }
-            
-            iVisWins1=NewBlueForgroundWindowL();
-            iVisWins1->Activate();
-            iVisWins1->BaseWin()->EnableVisibilityChangeEvents();
-
-            AddExpectedEvent(EEventFocusGained);
-            AddExpectedVisibilityChange(KFullyVisible, iVisWins1);
-            break;
-            }
-        case 1:
-            {
-            LOG_MESSAGE(_L("case 1"));
-            iVisWins2=NewBlueForgroundWindowL(); // will cover iVisWins1
-            iVisWins2->BlankWin()->SetColor();  //remove colour to ensure window does not draw to UI layer
-            iVisWins2->Activate();
-            
-            AddExpectedVisibilityChange(TWsVisibilityChangedEvent::ENotVisible, iVisWins1);
-            break;
-            }
-        case 2:
-            {
-            // This case contains the actual test GRAPHICS-WSERV-2669-0015
-            LOG_MESSAGE(_L("case 2"));
-            RSurfaceManager::TSurfaceCreationAttributesBuf surfaceBuf;
-            CreateSurfaceAttributes(surfaceBuf, iVisWins2->BaseWin()->Size());
-            
-            iSurfaceId = TSurfaceId::CreateNullId();
-            TInt err = iSurfaceManager.CreateSurface(surfaceBuf, iSurfaceId);
-            if (err != KErrNone)
-                {
-                RDebug::Printf("RSurfaceManager::CreateSurface() error: %d", err);
-                TEST(EFalse);
-                }
-         
-            err = iVisWins2->BaseWin()->SetBackgroundSurface(iSurfaceId);
-            if (err != KErrNone)
-                {
-                RDebug::Printf("RWindow::SetBackgroundSurface() error: %d", err);
-                TEST(EFalse);
-                }
-            
-            iVisWins2->BaseWin()->SetSurfaceTransparency(ETrue); //iVisWins1 will become visible
-            
-            AddExpectedVisibilityChange(KFullyVisible, iVisWins1);
-            break;
-            }
-        default:
-            LOG_MESSAGE(_L("default"));
-            if (!iSurfaceId.IsNull())
-                {
-                iSurfaceManager.CloseSurface(iSurfaceId);
-                iSurfaceId = TSurfaceId::CreateNullId();
-                }
-            iSurfaceManager.Close();
-            delete iVisWins1;
-            iVisWins1 = NULL;
-            delete iVisWins2;
-            iVisWins2 = NULL;
-            CActiveScheduler::Stop();
-            break;
-        }
-    TheClient->iWs.Flush();
-    }
-
-void CTEventTest::SurfaceVisibilityChanged2_NextSetOfEventsL()
-    {
-    switch (iEventSet++)
-        {
-        case 0:
-            {
-            //Win1 - bottom window
-            //Win2 - middle window with semi-transparent background surface, which totally obscures win1
-            LOG_MESSAGE(_L("case 0"));
-            TInt err = iSurfaceManager.Open();
-            if (err != KErrNone)
-                {
-                RDebug::Printf("RSurfaceManager::Open() failed", err);
-                User::Leave(err);
-                }
-            
-            iVisWins1 = NewBlueForgroundWindowL();
-            iVisWins1->BaseWin()->EnableVisibilityChangeEvents();
-
-            iVisWins2 = NewBlueForgroundWindowL();
-            iVisWins2->BlankWin()->SetColor(); //remove colour to ensure window does not draw to UI layer
-            iVisWins2->BaseWin()->EnableVisibilityChangeEvents();
-            
-            iVisWins1->Activate(); //obscured
-            iVisWins2->Activate(); //visible
-            
-            // Create surface for background window    
-            RSurfaceManager::TSurfaceCreationAttributesBuf surfaceBuf;
-            CreateSurfaceAttributes(surfaceBuf, iVisWins2->BaseWin()->Size());
-
-            iSurfaceId = TSurfaceId::CreateNullId();
-            err = iSurfaceManager.CreateSurface(surfaceBuf, iSurfaceId);
-            if (err != KErrNone)
-                {
-                RDebug::Printf("RSurfaceManager::CreateSurface() error: %d", err);
-                TEST(EFalse);
-                }
-
-            err = iVisWins2->BaseWin()->SetBackgroundSurface(iSurfaceId);
-            if (err != KErrNone)
-                {
-                RDebug::Printf("RWindow::SetBackgroundSurface() error: %d", err);
-                TEST(EFalse);
-                }
-
-            iVisWins2->BaseWin()->SetSurfaceTransparency(ETrue); //win1 and win2 both visible
-
-            AddExpectedEvent(EEventFocusGained);
-            AddExpectedVisibilityChange(KFullyVisible, iVisWins2);
-            AddExpectedVisibilityChange(KFullyVisible, iVisWins1);
-            break;
-            }
-        case 1:
-            {
-            //Win3 - opaque top window which obscures win2 and win1
-            LOG_MESSAGE(_L("case 1"));
-            iVisWins3 = NewBlueForgroundWindowL();
-            iVisWins3->SetColor(KRgbRed);
-            iVisWins3->Activate();
-
-            AddExpectedVisibilityChange(TWsVisibilityChangedEvent::ENotVisible, iVisWins2);
-            AddExpectedVisibilityChange(TWsVisibilityChangedEvent::ENotVisible, iVisWins1);
-            break;
-            }
-        case 2:
-            {
-            //This case contains the actual test GRAPHICS-WSERV-2669-0016
-            LOG_MESSAGE(_L("case 2"));
-            delete iVisWins3;
-            iVisWins3 = NULL;
-
-            AddExpectedVisibilityChange(KFullyVisible, iVisWins2);
-            AddExpectedVisibilityChange(KFullyVisible, iVisWins1);
-            break;
-            }
-        default:
-            LOG_MESSAGE(_L("default"));
-            if (!iSurfaceId.IsNull())
-                {
-                iSurfaceManager.CloseSurface(iSurfaceId);
-                iSurfaceId = TSurfaceId::CreateNullId();
-                }
-            iSurfaceManager.Close();
-            delete iVisWins1;
-            iVisWins1 = NULL;
-            delete iVisWins2;
-            iVisWins2 = NULL;
-            delete iVisWins3;
-            iVisWins3 = NULL;
-            CActiveScheduler::Stop();
-            return;
-        }
-    TheClient->iWs.Flush();
-    }
-
-TInt CTEventTest::GenerateAnEvent(TAny* aEventTest)
-    {
-    CTEventTest* self = static_cast<CTEventTest*>(aEventTest);
-    self->LogMessage(((TText8*)__FILE__), __LINE__,_L("Negative test passed OK - no event was generated."));
-    //Now we must generate an event to get CTQueueTestEvent out of its wait loop 
-    self->SimulateRepeatEvent(32);
-    self->AddExpectedKey(EEventKey, 32);
-    return KErrNone;
-    }
-
-void CTEventTest::SurfaceVisibilityChanged3_NextSetOfEventsL()
-    {
-    switch (iEventSet++)
-        {
-        case 0:
-            {
-            //Win1 - Bottom window
-            //Win2 - Top window with semi-transparent background surface. Does not overlap win1.
-            LOG_MESSAGE(_L("case 0"));
-            TInt err = iSurfaceManager.Open();
-            if (err != KErrNone)
-                {
-                RDebug::Printf("RSurfaceManager::Open() failed", err);
-                User::Leave(err);
-                }
-            iTimeOutCallback = CPeriodic::NewL(CActive::EPriorityIdle);
-            
-            iVisWins1 = NewBlueForgroundWindowL();
-            iVisWins1->BaseWin()->EnableVisibilityChangeEvents();
-
-            iVisWins2 = NewBlueForgroundWindowL();
-            iVisWins2->BlankWin()->SetColor(); //remove colour to ensure window does not draw to UI layer
-            TPoint newPos(iVisWins1->Position() + iVisWins1->Size());
-            iVisWins2->SetPos(newPos); //to not overlap win1 
-            
-            iVisWins1->Activate(); //upper left
-            iVisWins2->Activate(); //lower right
-            
-            // Create surface for background window    
-            RSurfaceManager::TSurfaceCreationAttributesBuf surfaceBuf;
-            CreateSurfaceAttributes(surfaceBuf, iVisWins2->BaseWin()->Size());
-
-            iSurfaceId = TSurfaceId::CreateNullId();
-            err = iSurfaceManager.CreateSurface(surfaceBuf, iSurfaceId);
-            if (err != KErrNone)
-                {
-                RDebug::Printf("RSurfaceManager::CreateSurface() error: %d", err);
-                TEST(EFalse);
-                }
-
-            err = iVisWins2->BaseWin()->SetBackgroundSurface(iSurfaceId);
-            if (err != KErrNone)
-                {
-                RDebug::Printf("RWindow::SetBackgroundSurface() error: %d", err);
-                TEST(EFalse);
-                }
-
-            iVisWins2->BaseWin()->SetSurfaceTransparency(ETrue);
-
-            AddExpectedEvent(EEventFocusGained);
-            AddExpectedVisibilityChange(KFullyVisible, iVisWins1);            
-            break;
-            }
-        case 1:
-            {
-            //This case contains the actual test GRAPHICS-WSERV-2669-0017
-            LOG_MESSAGE(_L("case 1"));
-            iVisWins2->SetPos(iVisWins1->Position()); //Win2 now overlaps Win1, but because Win2 has 
-                                                      //a transparent surface Win1 is still fully visible
-
-            //Because we don't expect any events we need to generate one to avoid waiting forever.
-            TCallBack timeout(GenerateAnEvent, this);
-            iTimeOutCallback->Start(1000000, 10000000, timeout);
-            break;
-            }
-        default:            
-            LOG_MESSAGE(_L("default"));
-            iTimeOutCallback->Cancel();
-            delete iTimeOutCallback;
-            iTimeOutCallback = NULL;
-            if (!iSurfaceId.IsNull())
-                {
-                iSurfaceManager.CloseSurface(iSurfaceId);
-                iSurfaceId = TSurfaceId::CreateNullId();
-                }
-            iSurfaceManager.Close();
-            delete iVisWins1;
-            iVisWins1 = NULL;
-            delete iVisWins2;
-            iVisWins2 = NULL;
-            CActiveScheduler::Stop();
-            return;
-        }
-    TheClient->iWs.Flush();
-    }
-#endif //TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-#endif //SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
-
-void CTEventTest::VisibilityChanged_NextSetOfEventsL()
-	{
-	const TInt fullyVisible = TWsVisibilityChangedEvent::EPartiallyVisible | TWsVisibilityChangedEvent::EFullyVisible;
-
-	switch(iEventSet++)
-		{
-		case 0: //only this case can leave
-			{
-			iQueueClient->iWin->BackedUpWin()->MaintainBackup();
-			iVisWins1=NewBlueForgroundWindowL();
-			iVisWins2=NewBlueForgroundWindowL();
-
-			iVisWins1->BaseWin()->EnableVisibilityChangeEvents();
-			iVisWins1->Activate();
-			iVisWins2->SetColor(KRgbGreen);
-			iVisWins2->SetExt(TPoint(80, 80), TSize(120,120));
-			iVisWins2->Activate();
-
-			AddExpectedEvent(EEventFocusGained);
-			AddExpectedVisibilityChange(fullyVisible);
-			}
-			break;
-		case 1:
-			iVisWins1->BaseWin()->SetVisible(EFalse);
-			AddExpectedVisibilityChange(TWsVisibilityChangedEvent::ENotVisible);
-			break;
-		case 2:
-			iVisWins1->BaseWin()->SetVisible(ETrue);
-			AddExpectedVisibilityChange(fullyVisible);
-			break;
-		case 3:
-			iVisWins2->SetExt(TPoint(0,0), TSize(120,120));
-			AddExpectedVisibilityChange(TWsVisibilityChangedEvent::ENotVisible);
-			break;
-		case 4:
-			iVisWins2->BaseWin()->SetVisible(EFalse);
-			AddExpectedVisibilityChange(fullyVisible);
-			break;
-		case 5:
-			iVisWins2->BaseWin()->SetVisible(ETrue);
-			AddExpectedVisibilityChange(TWsVisibilityChangedEvent::ENotVisible);
-			break;
-		case 6:
-			iVisWins2->SetExt(TPoint(60,60), TSize(120,120));
-			AddExpectedVisibilityChange(TWsVisibilityChangedEvent::EPartiallyVisible);
-			break;
-		case 7:
-			iVisWins1->SetExt(TPoint(80,80), TSize(40,40));
-			AddExpectedVisibilityChange(TWsVisibilityChangedEvent::ENotVisible);
-			break;
-		case 8:
-			iVisWins1->BaseWin()->SetOrdinalPosition(0);
-			AddExpectedVisibilityChange(fullyVisible);
-
-			if(TransparencySupportedL() != KErrNone)
-				{
-				iEventSet += 2; //we shall skip set 9,10 as they work with transparency
-				}
-			break;
-		case 9:
-			{
-			TDisplayMode mode = EColor256;
-			iTransWin=CTransWindow::NewL(iQueueClient->iGroup, TRgb(255, 0, 0, 128), TRect(0,0,200,200), &mode);
-			iTransWin->CTWin::DrawNow();
-			// it gets put at ordinal position 0
-			iVisWins2->BaseWin()->SetOrdinalPosition(1);
-			AddExpectedVisibilityChange(TWsVisibilityChangedEvent::ENotVisible);
-			}
-			break;
-		case 10:
-			iVisWins1->BaseWin()->SetOrdinalPosition(1);
-			AddExpectedVisibilityChange(fullyVisible);
-			break;
-		case 11:
-			{
-			delete iVisWins1;
-			iVisWins1=NULL;
-			iVisWins1=NewBlueForgroundWindow();
-
-			iVisWins1->Activate();
-			iVisWins1->BaseWin()->EnableVisibilityChangeEvents();
-
-			AddExpectedVisibilityChange(fullyVisible);
-			}
-			break;
-		case 12:
-			{
-			delete iVisWins1;
-			iVisWins1=NULL;
-			iVisWins1=NewBlueForgroundWindow();
-
-			iVisWins1->Activate();
-			iVisWins1->BaseWin()->EnableVisibilityChangeEvents();
-			iVisWins1->BaseWin()->SetVisible(EFalse);
-
-			AddExpectedVisibilityChange(TWsVisibilityChangedEvent::ENotVisible);
-			}
-			break;
-		case 13:
-			{
-			delete iVisWins1;
-			iVisWins1=NULL;
-			iVisWins1=NewBlueForgroundWindow();
-
-			iVisWins1->BaseWin()->EnableVisibilityChangeEvents();
-			iVisWins1->Activate();
-
-			AddExpectedVisibilityChange(fullyVisible);
-			}
-			break;
-		case 14:
-			{
-			delete iVisWins1;
-			iVisWins1=NULL;
-			iVisWins1=NewBlueForgroundWindow();
-
-			iVisWins1->Activate();
-			iVisWins1->BaseWin()->SetVisible(EFalse);
-			iVisWins1->BaseWin()->EnableVisibilityChangeEvents();
-
-			AddExpectedVisibilityChange(TWsVisibilityChangedEvent::ENotVisible);
-			}
-			break;
-		default:
-			delete iVisWins1;
-			delete iVisWins2;
-			iVisWins1 = NULL;
-			iVisWins2 = NULL;
-			delete iTransWin;
-			iTransWin = NULL;
-			CActiveScheduler::Stop();
-			break;
-		}
-	TheClient->iWs.Flush();
-	}
-
-void CTEventTest::CheckTimeStamp_NextSetOfEventsL()
-	{
-	iQueueClient->EventQueue()->SetCheckTimeStamp(ETrue);
-	switch(iEventSet++)
-		{
-	case 0:
-		iTest->SimulateKey(TRawEvent::EKeyDown, 'A');	// Create a raw event
-		iTest->SimulateKey(TRawEvent::EKeyUp, 'A');	// Create a raw event
-		AddExpectedEvent(EEventFocusGained);
-		AddExpectedKey(EEventKeyDown,'A');
-		AddExpectedKey(EEventKey,'A','a');
-		AddExpectedKey(EEventKeyUp,'A','a');
-		break;
-	case 1:
-		{
-		_LIT8(KMsgParam,"CheckTimeStamp");
-		TBuf8<0x20> params(KMsgParam);
-		TInt err = TheClient->iWs.SendMessageToWindowGroup(iQueueClient->WindowGroupIdentifier(),TUid::Uid(123),params);
-		AddExpectedEvent(EEventMessageReady);
-		}
-		break;
-	default:
-		CActiveScheduler::Stop();
-		break;
-		}
-	TheClient->iWs.Flush();
-	}
-
-/**
- * @SYMTestCaseID GRAPHICS-WSERV-0001
- *
- * @SYMPREQ PREQ525
- *
- * @SYMTestCaseDesc Test Capture priority of different top most windows in a Group.
- *
- * @SYMTestPriority Critical
- *
- * @SYMTestStatus Implemented
- *
- * @SYMTestActions Create two different top client windows under one parent window
- *	in a same window group. Add pointer event by clicking various position on the
- *	window and Simulate the pointer event. Change the pointer capture flag, capture
- *	priority and simulate the pointer event.
- *
- * @SYMTestExpectedResults In general the expected event and the window server event should
- *	match same event handle, type and pointer position for following cases.
- *	When pointer capture is disabled and capture priorities are 0, the pointer position on window1
- *	window2 or parent window are same as expected.
- *	When pointer capture is enabled and capture priorities are 0, the pointer position on window2(which is top most now)
- *	is same as expected.
- *	When pointer capture is enabled and capture priorities of win1 is greater than win2
- *	the pointer position on win1 and win2 are same as expected.
- *	The combination of above cases should match the general expexted result.
- *
- */
-void CTEventTest::PointerCapture_NextSetOfEventsL()
-	{
-#if defined(LOGGING)
-	TLogMessageText logMessageText;
-	_LIT(KSet,"Pointer Capture SetOfEvents: %d (last=9)");
-	logMessageText.Format(KSet,iEventSet);
-	INFO_PRINTF1(logMessageText);
-#endif
-	switch(iEventSet++)
-		{
-		case 0:			//Create two top client windows of same group
-			iVisWins1=new (ELeave) CTBlankWindow;
-			iVisWins2=new (ELeave) CTBlankWindow;
-			iVisWins1->ConstructL(*iQueueClient->iGroup);
-			iVisWins2->ConstructL(*iQueueClient->iGroup);
-			iVisWins1->SetColor(KRgbBlue);
-			iVisWins1->SetExt(iQueueClient->ChildTopLeft(),iQueueClient->ChildSize());
-			iVisWins1->Activate();
-			iVisWins2->SetColor(KRgbGreen);
-			iVisWins2->SetExt(iQueueClient->ChildTopLeft()+TPoint(15,15),iQueueClient->ChildSize());
-			iVisWins2->Activate();
-			iQueueClient->iWs.Flush();
-			AddExpectedEvent(EEventFocusGained);
-			break;
-		case 1:			//Pointer capture are disabled and priorities are 0
-			iVisWins1->BaseWin()->SetPointerCapture(RWindowBase::TCaptureDisabled);
-			iVisWins1->BaseWin()->SetPointerCapturePriority(0);
-			iVisWins2->BaseWin()->SetPointerCapture(RWindowBase::TCaptureDisabled);
-			iVisWins2->BaseWin()->SetPointerCapturePriority(0);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(35,25));	//Pointer on the first window
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(35,25));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(50,30));	//Pointer on the second window(overlaping on first window)
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(50,30));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(60,50));	//Pointer on the second window
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(60,50));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(75,25));	//Pointer on the parent window
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(75,25));
-			iQueueClient->iWs.Flush();
-			SimulatePointer(TRawEvent::EButton1Down,35,25);
-			SimulatePointer(TRawEvent::EButton1Up,35,25);
-			SimulatePointer(TRawEvent::EButton1Down,50,30);
-			SimulatePointer(TRawEvent::EButton1Up,50,30);
-			SimulatePointer(TRawEvent::EButton1Down,60,50);
-			SimulatePointer(TRawEvent::EButton1Up,60,50);
-			SimulatePointer(TRawEvent::EButton1Down,75,25);
-			SimulatePointer(TRawEvent::EButton1Up,75,25);
-			break;
-		case 2:			//Pointer capture are enabled and priorities are 0
-			iVisWins1->BaseWin()->SetPointerCapture(RWindowBase::TCaptureEnabled);
-			iVisWins2->BaseWin()->SetPointerCapture(RWindowBase::TCaptureEnabled);
-			iVisWins1->BaseWin()->SetPointerCapturePriority(0);
-			iVisWins2->BaseWin()->SetPointerCapturePriority(0);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(35,25),(TInt)iVisWins2);	//Pointer on the first window
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(35,25),(TInt)iVisWins2);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(50,30));	//Pointer on the second window(overlaping on first window)
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(50,30));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(60,50));	//Pointer on the second window
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(60,50));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(75,25),(TInt)iVisWins2);	//Pointer on the parent window
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(75,25),(TInt)iVisWins2);
-			iQueueClient->iWs.Flush();
-			SimulatePointer(TRawEvent::EButton1Down,35,25);
-			SimulatePointer(TRawEvent::EButton1Up,35,25);
-			SimulatePointer(TRawEvent::EButton1Down,50,30);
-			SimulatePointer(TRawEvent::EButton1Up,50,30);
-			SimulatePointer(TRawEvent::EButton1Down,60,50);
-			SimulatePointer(TRawEvent::EButton1Up,60,50);
-			SimulatePointer(TRawEvent::EButton1Down,75,25);
-			SimulatePointer(TRawEvent::EButton1Up,75,25);
-			break;
-		case 3:			//Pointer capture are enabled and priorities of win1 is higher than win2
-			iVisWins1->BaseWin()->SetPointerCapture(RWindowBase::TCaptureEnabled);
-			iVisWins2->BaseWin()->SetPointerCapture(RWindowBase::TCaptureEnabled);
-			iVisWins1->BaseWin()->SetPointerCapturePriority(1);
-			iVisWins2->BaseWin()->SetPointerCapturePriority(0);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(35,25));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(35,25));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(50,30));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(50,30));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(60,50));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(60,50));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(75,25),(TInt)iVisWins2);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(75,25),(TInt)iVisWins2);
-			iQueueClient->iWs.Flush();
-			SimulatePointer(TRawEvent::EButton1Down,35,25);
-			SimulatePointer(TRawEvent::EButton1Up,35,25);
-			SimulatePointer(TRawEvent::EButton1Down,50,30);
-			SimulatePointer(TRawEvent::EButton1Up,50,30);
-			SimulatePointer(TRawEvent::EButton1Down,60,50);
-			SimulatePointer(TRawEvent::EButton1Up,60,50);
-			SimulatePointer(TRawEvent::EButton1Down,75,25);
-			SimulatePointer(TRawEvent::EButton1Up,75,25);
-			break;
-		case 4:			//Pointer capture are enabled and priorities of win1 is equal to win2
-			iVisWins1->BaseWin()->SetPointerCapture(RWindowBase::TCaptureEnabled);
-			iVisWins2->BaseWin()->SetPointerCapture(RWindowBase::TCaptureEnabled);
-			iVisWins1->BaseWin()->SetPointerCapturePriority(1);
-			iVisWins2->BaseWin()->SetPointerCapturePriority(1);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(35,25),(TInt)iVisWins2);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(35,25),(TInt)iVisWins2);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(50,30));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(50,30));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(60,50));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(60,50));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(75,25),(TInt)iVisWins2);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(75,25),(TInt)iVisWins2);
-			iQueueClient->iWs.Flush();
-			SimulatePointer(TRawEvent::EButton1Down,35,25);
-			SimulatePointer(TRawEvent::EButton1Up,35,25);
-			SimulatePointer(TRawEvent::EButton1Down,50,30);
-			SimulatePointer(TRawEvent::EButton1Up,50,30);
-			SimulatePointer(TRawEvent::EButton1Down,60,50);
-			SimulatePointer(TRawEvent::EButton1Up,60,50);
-			SimulatePointer(TRawEvent::EButton1Down,75,25);
-			SimulatePointer(TRawEvent::EButton1Up,75,25);
-			break;
-		case 5:			//Pointer capture are enabled and priorities of win2 is higher than win1
-			iVisWins1->BaseWin()->SetPointerCapture(RWindowBase::TCaptureEnabled);
-			iVisWins2->BaseWin()->SetPointerCapture(RWindowBase::TCaptureEnabled);
-			iVisWins1->BaseWin()->SetPointerCapturePriority(0);
-			iVisWins2->BaseWin()->SetPointerCapturePriority(1);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(35,25),(TInt)iVisWins2);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(35,25),(TInt)iVisWins2);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(50,30));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(50,30));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(60,50));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(60,50));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(75,25),(TInt)iVisWins2);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(75,25),(TInt)iVisWins2);
-			iQueueClient->iWs.Flush();
-			SimulatePointer(TRawEvent::EButton1Down,35,25);
-			SimulatePointer(TRawEvent::EButton1Up,35,25);
-			SimulatePointer(TRawEvent::EButton1Down,50,30);
-			SimulatePointer(TRawEvent::EButton1Up,50,30);
-			SimulatePointer(TRawEvent::EButton1Down,60,50);
-			SimulatePointer(TRawEvent::EButton1Up,60,50);
-			SimulatePointer(TRawEvent::EButton1Down,75,25);
-			SimulatePointer(TRawEvent::EButton1Up,75,25);
-			break;
-		case 6:			//Pointer capture are enabled for all groups and priorities of win1 is higher than win2
-			iVisWins1->BaseWin()->SetPointerCapture(RWindowBase::TCaptureEnabled|RWindowBase::TCaptureFlagAllGroups);
-			iVisWins2->BaseWin()->SetPointerCapture(RWindowBase::TCaptureEnabled|RWindowBase::TCaptureFlagAllGroups);
-			iVisWins1->BaseWin()->SetPointerCapturePriority(1);
-			iVisWins2->BaseWin()->SetPointerCapturePriority(0);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(35,25));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(35,25));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(50,30));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(50,30));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(60,50));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(60,50));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(75,25),(TInt)iVisWins2);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(75,25),(TInt)iVisWins2);
-			iQueueClient->iWs.Flush();
-			SimulatePointer(TRawEvent::EButton1Down,35,25);
-			SimulatePointer(TRawEvent::EButton1Up,35,25);
-			SimulatePointer(TRawEvent::EButton1Down,50,30);
-			SimulatePointer(TRawEvent::EButton1Up,50,30);
-			SimulatePointer(TRawEvent::EButton1Down,60,50);
-			SimulatePointer(TRawEvent::EButton1Up,60,50);
-			SimulatePointer(TRawEvent::EButton1Down,75,25);
-			SimulatePointer(TRawEvent::EButton1Up,75,25);
-			break;
-		case 7:			//Pointer capture are enabled and priorities of iWin is higher than the other windows
-			iVisWins1->BaseWin()->SetPointerCapture(RWindowBase::TCaptureEnabled);
-			iVisWins2->BaseWin()->SetPointerCapture(RWindowBase::TCaptureEnabled);
-			iVisWins1->BaseWin()->SetPointerCapturePriority(0);
-			iVisWins2->BaseWin()->SetPointerCapturePriority(0);
-			iQueueClient->iWin->BaseWin()->SetPointerCapture(RWindowBase::TCaptureEnabled);
-			iQueueClient->iWin->BaseWin()->SetPointerCapturePriority(1);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(80,20));	//Pointer on the parent window
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(80,20));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(35,25),(TInt)iVisWins2);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(35,25),(TInt)iVisWins2);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(60,50));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(60,50));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(50,30));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(50,30));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(75,25));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(75,25));
-			iQueueClient->iWs.Flush();
-			SimulatePointer(TRawEvent::EButton1Down,80,20);
-			SimulatePointer(TRawEvent::EButton1Up,80,20);
-			SimulatePointer(TRawEvent::EButton1Down,35,25);
-			SimulatePointer(TRawEvent::EButton1Up,35,25);
-			SimulatePointer(TRawEvent::EButton1Down,60,50);
-			SimulatePointer(TRawEvent::EButton1Up,60,50);
-			SimulatePointer(TRawEvent::EButton1Down,50,30);
-			SimulatePointer(TRawEvent::EButton1Up,50,30);
-			SimulatePointer(TRawEvent::EButton1Down,75,25);
-			SimulatePointer(TRawEvent::EButton1Up,75,25);
-			break;
-		case 8:			//Pointer capture are enabled and priorities of iWin is 0
-			iVisWins1->BaseWin()->SetPointerCapture(RWindowBase::TCaptureEnabled);
-			iVisWins2->BaseWin()->SetPointerCapture(RWindowBase::TCaptureEnabled);
-			iVisWins1->BaseWin()->SetPointerCapturePriority(1);
-			iVisWins2->BaseWin()->SetPointerCapturePriority(0);
-			iQueueClient->iWin->BaseWin()->SetPointerCapture(RWindowBase::TCaptureEnabled);
-			iQueueClient->iWin->BaseWin()->SetPointerCapturePriority(0);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(80,20),(TInt)iVisWins2);	//Pointer on the parent window
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(80,20),(TInt)iVisWins2);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(35,25));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(35,25));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(60,50));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(60,50));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(50,30));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(50,30));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(75,25),(TInt)iVisWins2);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(75,25),(TInt)iVisWins2);
-			iQueueClient->iWs.Flush();
-			SimulatePointer(TRawEvent::EButton1Down,80,20);
-			SimulatePointer(TRawEvent::EButton1Up,80,20);
-			SimulatePointer(TRawEvent::EButton1Down,35,25);
-			SimulatePointer(TRawEvent::EButton1Up,35,25);
-			SimulatePointer(TRawEvent::EButton1Down,60,50);
-			SimulatePointer(TRawEvent::EButton1Up,60,50);
-			SimulatePointer(TRawEvent::EButton1Down,50,30);
-			SimulatePointer(TRawEvent::EButton1Up,50,30);
-			SimulatePointer(TRawEvent::EButton1Down,75,25);
-			SimulatePointer(TRawEvent::EButton1Up,75,25);
-			break;
-		case 9:			//Pointer capture are enabled and with different groups
-			iVisWins1->BaseWin()->SetPointerCapture(RWindowBase::TCaptureEnabled|RWindowBase::TCaptureFlagAllGroups);
-			iVisWins2->BaseWin()->SetPointerCapture(RWindowBase::TCaptureEnabled|RWindowBase::TCaptureFlagAllGroups);
-			iVisWins1->BaseWin()->SetPointerCapturePriority(0);
-			iVisWins2->BaseWin()->SetPointerCapturePriority(0);
-			iQueueClient->iWin->BaseWin()->SetPointerCapture(RWindowBase::TCaptureEnabled|RWindowBase::TCaptureFlagAllGroups);
-			iQueueClient->iWin->BaseWin()->SetPointerCapturePriority(1);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(25,150),(TInt)iVisWins2);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(25,150),(TInt)iVisWins2);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(150,25),(TInt)iVisWins2);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(150,25),(TInt)iVisWins2);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(80,20));	//Pointer on the parent window
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(80,20));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(35,25),(TInt)iVisWins2);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(35,25),(TInt)iVisWins2);
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(60,50));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(60,50));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(50,30));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(50,30));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Down,TPoint(75,25));
-			AddExpectedPointerCapture(TPointerEvent::EButton1Up,TPoint(75,25));
-			iQueueClient->iWs.Flush();
-			SimulatePointer(TRawEvent::EButton1Down,25,150);
-			SimulatePointer(TRawEvent::EButton1Up,25,150);
-			SimulatePointer(TRawEvent::EButton1Down,150,25);
-			SimulatePointer(TRawEvent::EButton1Up,150,25);
-			SimulatePointer(TRawEvent::EButton1Down,80,20);
-			SimulatePointer(TRawEvent::EButton1Up,80,20);
-			SimulatePointer(TRawEvent::EButton1Down,35,25);
-			SimulatePointer(TRawEvent::EButton1Up,35,25);
-			SimulatePointer(TRawEvent::EButton1Down,60,50);
-			SimulatePointer(TRawEvent::EButton1Up,60,50);
-			SimulatePointer(TRawEvent::EButton1Down,50,30);
-			SimulatePointer(TRawEvent::EButton1Up,50,30);
-			SimulatePointer(TRawEvent::EButton1Down,75,25);
-			SimulatePointer(TRawEvent::EButton1Up,75,25);
-			break;
-		default:
-			delete iVisWins1;
-			delete iVisWins2;
-			iVisWins1=NULL;
-			iVisWins2=NULL;
-			CActiveScheduler::Stop();
-			break;
-		}
-	TheClient->iWs.Flush();
-	}
-
-/**
-PDEF110849
-Allocate a pointer buffer, send it some events and then disconnect.
-Now fill the event queue, causing a purge.
-The purge will call void CWsPointerBuffer::DiscardPointerMoveBuffer(TUint aHandle)
-in which an access violation occurred because iCurrentBuffer had not been set to NULL.
-*/
-void CTEventTest::PointerBufferPurge_NextSetOfEventsL()
-	{
-#if defined(LOGGING)
-	TLogMessageText logMessageText;
-	_LIT(KSet,"PointerBufferPurge SetOfEvents: %d of 1");
-	logMessageText.Format(KSet,iEventSet);
-	TheClient->LogMessage(logMessageText);
-#endif
-	iTheClientFlush=TheClient->iWs.SetAutoFlush(ETrue);
-	iQuequeClientFlush=iQueueClient->iWs.SetAutoFlush(ETrue);
-	switch(iEventSet++)
-		{
-		case 0:
-			{
-			RWindowBase& win = *iQueueClient->iWin->BaseWin();
-			
-			// Cause a connect to happen
-			RDebug::Print(_L("PointerBufferPurge - AllocPointerMoveBuffer()"));
-			win.AllocPointerMoveBuffer(10, 0);
-			
-			// Allow pen events to be received
-			RDebug::Print(_L("PointerBufferPurge - EnablePointerMoveBuffer()"));
-			win.EnablePointerMoveBuffer();
-			
-			// Simulate some pen events
-			RDebug::Print(_L("PointerBufferPurge - Events"));
-			SimulatePointer(TRawEvent::EPointerMove,10,20);
-			SimulatePointer(TRawEvent::EButton1Down,10,20);
-			SimulatePointer(TRawEvent::EPointerMove,11,21);
-			SimulatePointer(TRawEvent::EButton1Up,11,21);
-	
-			// Disconnect
-			RDebug::Print(_L("PointerBufferPurge - FreePointerMoveBuffer()"));
-			win.FreePointerMoveBuffer();
-			
-			// Send sufficient events to cause a purge to happen
-			for (TInt i=0; i<EMaxEventQueueSize; i++)
-				{
-				RDebug::Print(_L("PointerBufferPurge - Purge Loop %d"), i);
-				SimulatePointer(TRawEvent::EButton1Up,15,25);
-				}
-	
-			// Expected events
-			// - We only expect the focus and button up events because the other events have been purged
-			// - button up events which are not paired with button down take precedence 
-			// - but even some of our button up events will have been purged - hence the lower count
-			
-			AddExpectedEvent(EEventFocusGained);
-			
-			for (TInt i=0; i<EMaxEventQueueSize-1; i++)
-				{
-				AddExpectedPointer(TPointerEvent::EButton1Up, TPoint(15-EWinPositionX,25-EWinPositionY));
-				}
-				
-			break;
-			}
-		default:
-			CActiveScheduler::Stop();
-		break;
-		}
-	TheClient->iWs.SetAutoFlush(iTheClientFlush);
-	iQueueClient->iWs.SetAutoFlush(iQuequeClientFlush);
-	}
-
-/**
- * @SYMTestCaseID GRAPHICS-WSERV-0025
- *
- * @SYMDEF DEF085009
- *
- * @SYMTestCaseDesc Test removal of event handlers mid-way through processing an event.
- *
- * @SYMTestPriority Critical
- *
- * @SYMTestStatus Implemented
- *
- * @SYMTestActions The following tests use RRemovable anim to replicate the removal of
- * event handlers mid-way through processing an event (where an event is offered to each of the
- * listed event handlers).
- *
- * RRemovableAnim is an anim which removes itself from the event handler list
- * after receiving n events, where n is the 'lifetime' of the anim measured in events received.
- * By setting the lifetimes of a number of these anims, we replicate the removal of event handlers
- * mid-way through processing an event.
- *
- * Event set 0:
- *  Sends 2 events e1,e2 and expects them be received by wserv event processing.
- *
- * Event set 1: (Simple scenario)
- *  Adds 3 removable anims to event handler list
- *  Sets lifetimes as {1000,2,5}
- *  Sends 6 events
- *  Expected events to be received by anims: {6,2,5}
- *
- * Event set 2: (Manual removal and reset state)
- *  Manually remove all anims from event handler list
- *  Sends 2 events
- *  No events expected to be received by anims
- *  Resets all anims ready for next test
- *
- * Event set 3: (Removal of multiple anims on receipt of same event)
- *  Adds 10 removable anims in event handler list
- *  Set lifetimes: {1,5,9,3,8,8,8,10,5,2}
- *  Sends 12 events:
- *  Expected number of received events for anims: {1,5,9,3,8,8,8,10,5,2}
- *
- * Event set 4: (Manual removal and reset state)
- *  Manually remove all anims from event handler list
- *  Sends 2 events
- *  No events expected to be received by anims
- *  Resets all anims ready for next test
- *
- * Event set 5: (Addition of anims to non-empty event handler list, part 1)
- *  Adds 6 removable anims in the event handler list
- *  Set lifetimes: {1,1,1,5,5,5}
- *  Sends 2 events:
- *  Expected number of received events for anims: {1,1,1,2,2,2}
- *
- * Event set 6: (Addition of anims to non-empty event handler list, part 2)
- *  Readds first 3 anims to event handler list
- *  Sets lifetimes of these three anims {13,24,6}
- *  Sends 5 events:
- *  Expected number of received events for anims: {5,5,5,3,3,3}
- *
- * Event set 7: (Addition of anims to non-empty event handler list, part 3)
- *  Sends 16 events:
- *  Expected number of received events for anims: {8,16,1,0,0,0}
- *
- * Event set 8: (Manual Removal and reset state)
- *  Manually remove all anims from event handler list
- *  Sends 2 events
- *  No events expected to be received by anims
- *  Resets all anims ready for next test
- *
- * Event set 9: (Creating anims which again generate events.)
- *  Create 3 anims. One anims generates events in its OfferrawEvent function.
- *	Check the funtionality of ProcessRawEvent in Wserv when it is called
- *	recursively. Also check the fix for defect INC095892.
- *
- * @SYMTestExpectedResults
- *  All events should be received by wserv event processing
- *  Each anim should only receive events when (number of events received by anim) <= (lifetime of anim)
- */
-void CTEventTest::EventHandlerRemoval_NextSetOfEventsL()
-	{
-#if defined(LOGGING)
-	INFO_PRINTF1(_L("EventHandlerRemoval SetOfEvents: (Max=8)"));
-#endif
-	switch(iEventSet++)
-		{
-		case 0:
-		#if defined(LOGGING)
-			INFO_PRINTF1(_L("AUTO  Event Handler Removal Anim Events"));
-		#endif
-		#if defined(DETAILED)
-			INFO_PRINTF1(_L("No anims in event handler list"));
-			INFO_PRINTF1(_L(" Send 2 events"));
-			INFO_PRINTF1(_L(" - Expected to be received by wserv event processing"));
-		#endif
-			// Always get a focus gain at start
-			AddExpectedEvent(EEventFocusGained);
-			// All expected to be received by wserv event processing
-			AddExpectedKey(EEventKeyDown,32,ETrue);
-			AddExpectedKey(EEventKeyUp,32,ETrue);
-			// Send 2 events - none expected to be received by anims,
-			iTest->SimulateKey(TRawEvent::EKeyDown,32);
-			iTest->SimulateKey(TRawEvent::EKeyUp,32);
-			// Flush events to wserv
-			TheClient->iWs.Flush();
-			// Create all anims for all tests in first event set because
-			// first event set is only place where leaving functions can be called
-			EventHandlerRemoval_CreateAnimsL(10);
-			break;
-		case 1:
-			{
-		#if defined(DETAILED)
-			INFO_PRINTF1(_L(" Add 3 removable anims to event handler list"));
-			INFO_PRINTF1(_L(" Set lifetimes for anims: {1000,2,5}"));
-			INFO_PRINTF1(_L(" Send 6 events"));
-			INFO_PRINTF1(_L(" - Expected number of received events for anims: {6,2,5}"));
-			INFO_PRINTF1(_L(" All events expected to be received by wserv event processing"));
-		#endif
-			const TInt KLifetimes [] = {1000,2,5};
-			EventHandlerRemoval_PrepareAnims(KLifetimes, 3);
-			EventHandlerRemoval_CreateExpectedEvents(6,3);
-			// Flush events to wserv
-			TheClient->iWs.Flush();
-			// Check each anim has received the expected events
-			EventHandlerRemoval_CheckExpectedEventsReceivedByAnims();
-			}
-			break;
-		case 2:
-			{
-			// Remove all anims, check removal was successful
-			// and reset all anims ready for next test
-			EventHandlerRemoval_RemoveAndResetAllAnims();
-			}
-			break;
-		case 3:
-			{
-		#if defined(DETAILED)
-			INFO_PRINTF1(_L(" Add 10 removable anims in event handler list"));
-			INFO_PRINTF1(_L(" Set lifetimes: {1,5,9,3,8,8,8,10,5,2}"));
-			INFO_PRINTF1(_L(" Send 12 events"));
-			INFO_PRINTF1(_L(" - Expected number of received events for anims:{1,5,9,3,8,8,8,10,5,2}"));
-			INFO_PRINTF1(_L(" All expected to be received by wserv event processing"));
-		#endif
-			const TInt KLifetimes [] = {1,5,9,3,8,8,8,10,5,2};
-
-			// Create anims, set lifetimes, add to event handlers and add to iRemovableAnims array
-			EventHandlerRemoval_PrepareAnims(KLifetimes, 10);
-			EventHandlerRemoval_CreateExpectedEvents(12,10);
-			// Flush events to wserv
-			TheClient->iWs.Flush();
-			// Check each anim has received the expected events
-			EventHandlerRemoval_CheckExpectedEventsReceivedByAnims();
-			}
-			break;
-		case 4:
-			{
-			// Remove all anims, check removal was successful
-			// and reset all anims ready for next test
-			EventHandlerRemoval_RemoveAndResetAllAnims();
-			}
-			break;
-		case 5:
-			{
-		#if defined(DETAILED)
-			INFO_PRINTF1(_L(" Add 6 removable anims in event handler list"));
-			INFO_PRINTF1(_L(" Set lifetimes: {1,1,1,5,5,5}"));
-			INFO_PRINTF1(_L(" Send 2 events"));
-			INFO_PRINTF1(_L(" - Expected number of received events for anims:{1,1,1,2,2,2}"));
-			INFO_PRINTF1(_L(" All expected to be received by wserv event processing"));
-		#endif
-			const TInt KLifetimes [] = {1,1,1,5,5,5};
-
-			// Create anims, set lifetimes, add to event handlers and add to iRemovableAnims array
-			EventHandlerRemoval_PrepareAnims(KLifetimes, 6);
-			EventHandlerRemoval_CreateExpectedEvents(2, 6);
-			// Flush events to wserv
-			TheClient->iWs.Flush();
-			// Check each anim has received the expected events
-			EventHandlerRemoval_CheckExpectedEventsReceivedByAnims();
-			}
-			break;
-		case 6:
-			{
-		#if defined(DETAILED)
-			INFO_PRINTF1(_L(" Readds first 3 removable anims to event handler list"));
-			INFO_PRINTF1(_L(" Set lifetimes of these three anims {13,24,6}"));
-			INFO_PRINTF1(_L(" Send 5 events"));
-			INFO_PRINTF1(_L(" - Expected number of received events for anims: {5,5,5,3,3,3}"));
-			INFO_PRINTF1(_L(" All expected to be received by wserv event processing"));
-		#endif
-			const TInt KLifetimes [] = {13,24,6};
-
-			// Create anims, set lifetimes, add to event handlers and add to iRemovableAnims array
-			EventHandlerRemoval_PrepareAnims(KLifetimes, 3);
-			EventHandlerRemoval_CreateExpectedEvents(5, 6);
-			// Flush events to wserv
-			TheClient->iWs.Flush();
-			// Check each anim has received the expected events
-			EventHandlerRemoval_CheckExpectedEventsReceivedByAnims();
-			}
-			break;
-		case 7:
-			{
-		#if defined(DETAILED)
-			INFO_PRINTF1(_L(" Send 16 events"));
-			INFO_PRINTF1(_L(" - Expected number of received events for anims:{8,16,1,0,0,0}"));
-			INFO_PRINTF1(_L(" All expected to be received by wserv event processing"));
-		#endif
-			EventHandlerRemoval_CreateExpectedEvents(16, 3);
-			// Flush events to wserv
-			TheClient->iWs.Flush();
-			// Check each anim has received the expected events
-			EventHandlerRemoval_CheckExpectedEventsReceivedByAnims();
-			}
-			break;
-		case 8:
-			{
-			// Remove all anims, check removal was successful
-			// and reset all anims ready for next test
-			EventHandlerRemoval_RemoveAndResetAllAnims();
-			}
-			break;
-		case 9:
-			EventHandlerRemoval_CheckRecursionOfProcessRawEvent();
-			break;
-		case 10:
-			EventHandlerRemoval_AddEventHandlerMultipleTimes();
-			break;
-		default:
-		#if defined(DETAILED)
-			INFO_PRINTF1(_L(" Test postamble"));
-			INFO_PRINTF1(_L(" Destroy anims"));
-		#endif
-			// Destroy anims
-			EventHandlerRemoval_DestroyAllAnims();
-			iRemovableAnims->Close();
-			delete iRemovableAnims;
-			iRemovableAnims = NULL;
-			CActiveScheduler::Stop();
-			break;
-		}
-	TheClient->iWs.Flush();
-	}
-
-/**
- * Creates an array of aAnimCount anims on heap
- * Assigns array to iRemovableAnims for use in rest of tests
- */
-void CTEventTest::EventHandlerRemoval_CreateAnimsL(TInt aAnimCount)
-	{
-	RPointerArray<RRemovableAnim>* removableAnims = new (ELeave) RPointerArray<RRemovableAnim>();
-	CleanupStack::PushL(removableAnims);
-	for (TInt animIndex = 0; animIndex < aAnimCount; animIndex++)
-		{
-		RRemovableAnim* anim = RRemovableAnim::NewLC(iQueueClient->iWin->BaseWin(), iAnimDll);
-		removableAnims->AppendL(anim);
-		}
-	CleanupStack::Pop(aAnimCount, (*removableAnims)[0]);
-	CleanupStack::Pop(removableAnims);
-	iRemovableAnims = removableAnims;
-	}
-
-/**
- * Sets lifetimes of anims as specified in aLifeTimes
- * Adds anims to event handler list
- */
-void CTEventTest::EventHandlerRemoval_PrepareAnims(const TInt* aLifetimes, TInt aAnimCount)
-	{
-	for (TInt animIndex = 0; animIndex < aAnimCount; animIndex++)
-		{
-		RRemovableAnim* anim = (*iRemovableAnims)[animIndex];
-		anim->SetEventHandlerLifetime(aLifetimes[animIndex]);
-		anim->AddToEventHandlers();
-		}
-	}
-
-/**
- * Creates aEventCount key events to be used in test
- * Adds the expected event aEvent to the first aLiveAnimCount anims
- * Adds expected events observed by the rest of wserv
- * Simulates events on wserv
- */
-void CTEventTest::EventHandlerRemoval_CreateExpectedEvents(TInt aEventCount, TInt aLiveAnimCount)
-	{
-	RArray<TRawEvent> events;
-
-	// Add expected events to anims
-	for (TInt eventCount = 0; eventCount < aEventCount; eventCount++)
-		{
-		TRawEvent rawEvent;
-		TInt scanCode = 33 + eventCount;
-		// Alternate key down, key up events.
-		if (eventCount%2 == 0)
-			{
-			rawEvent.Set(TRawEvent::EKeyDown, scanCode);
-			}
-		else
-			{
-			rawEvent.Set(TRawEvent::EKeyUp, scanCode);
-			}
- 		EventHandlerRemoval_AddExpectedEvent(rawEvent, aLiveAnimCount);
-		events.Append(rawEvent);
-		}
-
-	// Simulates expected events
-	for (TInt eventCount = 0; eventCount < aEventCount; eventCount++)
-		{
-		TRawEvent event = events[eventCount];
-		iTest->SimulateKey(event.Type(), event.ScanCode());
-		}
-
-	events.Close();
-	}
-
-/**
- * Adds the expected event aEvent to the first aLiveAnimCount anims
- * Adds expected event observed by the rest of wserv
- */
-void CTEventTest::EventHandlerRemoval_AddExpectedEvent(TRawEvent aEvent, TInt aLiveAnimCount)
-	{
-	// Add event to each of the anims
-	for (TInt animIndex = 0; animIndex < aLiveAnimCount; animIndex++)
-		{
-		TInt err = (*iRemovableAnims)[animIndex]->AddExpectedEvent(aEvent);
-		}
-	TInt eventType = (aEvent.Type() == TRawEvent::EKeyDown ? EEventKeyDown : EEventKeyUp);
-	AddExpectedKey(eventType, aEvent.ScanCode(), ETrue);
-	}
-
-/**
- * Checks each anim has received the expected events
- */
-void CTEventTest::EventHandlerRemoval_CheckExpectedEventsReceivedByAnims()
-	{
-	for (TInt animIndex = iRemovableAnims->Count() - 1; animIndex >= 0; animIndex--)
-		{
-		if (!(*iRemovableAnims)[animIndex]->TestPassed())
-			{
-			Failed();
-			break;
-			}
-		}
-	}
-
-
-/**
- * Create three anims. In the first anim's Offer raw event generate two more events
- * which will call recursively the process raw event at the server side.
- * The second and third anims are just removable anims. To simulate the scenario 
- * for the defect INC095892. If teh fix for this is defect is not supplied then
- * wserv would panic for this test case.
- */
-void CTEventTest::EventHandlerRemoval_CheckRecursionOfProcessRawEvent()
-	{
-	iTheClientFlush=TheClient->iWs.SetAutoFlush(ETrue);
-	iQuequeClientFlush=iQueueClient->iWs.SetAutoFlush(ETrue);
-	
-	// Create 3 anims	
-	RRemovableAnim* eventRecurAnim = RRemovableAnim::NewLC(iQueueClient->iWin->BaseWin(), iAnimDll);
-	RRemovableAnim* removableAnim = RRemovableAnim::NewLC(iQueueClient->iWin->BaseWin(), iAnimDll);
-	RRemovableAnim* eventAnim = RRemovableAnim::NewLC(iQueueClient->iWin->BaseWin(), iAnimDll);
-
-	// Add these anim as event handlers and set thier respective life time
-	eventRecurAnim->AddToEventHandlers();
-	eventRecurAnim->SetEventHandlerLifetime(4);
-	
-	removableAnim->AddToEventHandlers();
-	removableAnim->SetEventHandlerLifetime(1);
-	
-	eventAnim->AddToEventHandlers();
-	eventAnim->SetEventHandlerLifetime(2);
-
-	TRawEvent rawEvent1;
-	TRawEvent rawEvent2;
-	TRawEvent rawEvent3;
-	rawEvent1.Set(TRawEvent::EKeyDown, 60);
-	rawEvent2.Set(TRawEvent::EKeyUp, 34);
-	rawEvent3.Set(TRawEvent::EKeyUp, 35);
-	
-	eventRecurAnim->AddExpectedEvent(rawEvent2);
-	eventRecurAnim->AddExpectedEvent(rawEvent3);
-	
-	removableAnim->AddExpectedEvent(rawEvent2);
-	
-	eventAnim->AddExpectedEvent(rawEvent2);
-	eventAnim->AddExpectedEvent(rawEvent3);
-
-	// Add these events to iQueueClient for testing	
-	AddExpectedKey(EEventKeyUp, 34, ETrue);
-	AddExpectedKey(EEventKeyUp, 35, ETrue);
-
-	iTest->SimulateKey(rawEvent1.Type(), rawEvent1.ScanCode());
-	
-	CleanupStack::PopAndDestroy(3, eventRecurAnim);
-	
-	TheClient->iWs.SetAutoFlush(iTheClientFlush);
-	iQueueClient->iWs.SetAutoFlush(iQuequeClientFlush);
-	}
-
-/**
- * Manually removes all anims from event handlers array
- */
-void CTEventTest::EventHandlerRemoval_ManuallyRemoveAllAnims()
-	{
-	// Manually remove all anims from event handler list
-	for (TInt animIndex = iRemovableAnims->Count() - 1; animIndex >= 0; animIndex--)
-		{
-		(*iRemovableAnims)[animIndex]->RemoveFromEventHandlers();
-		}
-	}
-
-/**
- * Manually removes all anims from event handlers array
- */
-void CTEventTest::EventHandlerRemoval_ResetAllAnims()
-	{
-	// Manually remove all anims from event handler list
-	for (TInt animIndex = iRemovableAnims->Count() - 1; animIndex >= 0; animIndex--)
-		{
-		(*iRemovableAnims)[animIndex]->Reset();
-		(*iRemovableAnims)[animIndex]->SetEventHandlerLifetime(0);
-		}
-	}
-
-/**
- *  Manually removes all anims from event handler list
- *  Sends 2 events
- *  Checks that no events have been received by anims
- *  Resets all anims ready for next test
- */
-void CTEventTest::EventHandlerRemoval_RemoveAndResetAllAnims()
-	{
-#if defined(DETAILED)
-	INFO_PRINTF1(_L(" Manually remove all anims from event handler list"));
-	INFO_PRINTF1(_L(" Send 2 events: none expected to be received by anims"));
-	INFO_PRINTF1(_L(" All expected to be received by wserv event processing"));
-#endif
-	// Manually remove all anims from event handler list
-	EventHandlerRemoval_ManuallyRemoveAllAnims();
-	// All expected to be received by wserv event processing
-	AddExpectedKey(EEventKeyDown,32,ETrue);
-	AddExpectedKey(EEventKeyUp,32,ETrue);
-	// Send 2 events - none expected to be received by anims,
-	iTest->SimulateKey(TRawEvent::EKeyDown,32);
-	iTest->SimulateKey(TRawEvent::EKeyUp,32);
-	// Flush events to wserv
-	TheClient->iWs.Flush();
-	// Check the anims have not received any events
-	EventHandlerRemoval_CheckExpectedEventsReceivedByAnims();
-#if defined(DETAILED)
-	INFO_PRINTF1(_L(" Cleanup before next step"));
-#endif
-	// Reset anims
-	EventHandlerRemoval_ResetAllAnims();
-	}
-
-/**
- * Destroys all anims in iRemovableAnims
- * Resets iRemovableAnims
- */
-void CTEventTest::EventHandlerRemoval_DestroyAllAnims()
-	{
-	if (iRemovableAnims)
-		{
-		// Destroy anims
-		for (TInt animIndex = iRemovableAnims->Count() - 1; animIndex >= 0; animIndex--)
-			{
-			RRemovableAnim* anim = (*iRemovableAnims)[animIndex];
-			if (anim)
-				{
-				anim->Destroy();
-				}
-			}
-		iRemovableAnims->Reset();
-		}
-	}
-
-/**
-SYMTestCaseID			GRAPHICS-WSERV-0496
-
-@SYMDEF					DEF133776
-
-@SYMTestCaseDesc		Cancels key captures using all combinations of 
- RWindowGroup::Capture...() and RWindowGroup::Cancel...() APIs.
-
-@SYMTestPriority 		High
-
-@SYMTestStatus 			Implemented
-
-@SYMTestActions 		Call each of the RWindowGroup::Capture***() APIs followed by
- each of the RWindowGroup::CancelCapture***() APIs.
- RWindowGroup::Capture***() APIs:
- 	CaptureKey(TUint, TUint, TUint)
- 	CaptureKey(TUint, TUint, TUint, TInt)
- 	CaptureKeyUpAndDowns(TUint, TUint, TUint)
- 	CaptureKeyUpAndDowns(TUint, TUint, TUint, TInt)
- 	CaptureLongKey(TUint, TUint, TUint, TUint, TInt, TUint)
-  	CaptureLongKey(TTimeIntervalMicroSeconds32, TUint, TUint, TUint, TUint, TInt, TUint)
- RWindowGroup::CancelCapture***() APIs:
-	CancelCaptureKey()
-	CancelCaptureKeyUpAndDowns()
-	CancelCaptureLongKey()
-
-@SYMTestExpectedResults WServ should handle matched and mismatched Cancel 
- and Capture calls without panicking.
- */
-void CTEventTest::MismatchedCapture_NextSetOfEventsL()
-	{
-	if (iEventSet == 0)
-		AddExpectedEvent(EEventFocusGained);
-	
-	if (iEventSet < (EMaxCaptureKeyApis*EMaxCancelCaptureKeyApis))
-		{
-		TestCaptureAndCancelCapturePair(static_cast<TCaptureKeyApis>(iEventSet%EMaxCaptureKeyApis), static_cast<TCancelCaptureKeyApis>(iEventSet/EMaxCaptureKeyApis));
-		iEventSet++;
-		}	
-	else
-		{
-		CActiveScheduler::Stop();				
-		}
-	}
-
-/** Helper function that applies a key capture and then cancels it using the
-passed capture and cancel RWindowGroup APIs.
-
-@param aCaptureApi Enum value specifying the capture API to use
-@param aCancelCaptureApi Enum value specifying the cancel capture API to use
- */
-void CTEventTest::TestCaptureAndCancelCapturePair(TCaptureKeyApis aCaptureApi, TCancelCaptureKeyApis aCancelCaptureApi)
-	{		
-#if defined(LOGGING)
-	_LIT(KCaptureKey, "CaptureKey");
-	_LIT(KCaptureKeyKeyUpAndDowns, "CaptureKeyKeyUpAndDowns");
-	_LIT(KCaptureLongKey, "CaptureLongKey");	
-	_LIT(KCancelCaptureKey, "CancelCaptureKey");
-	_LIT(KCancelCaptureKeyKeyUpAndDowns, "CancelCaptureKeyKeyUpAndDowns");
-	_LIT(KCancelCaptureLongKey, "CancelCaptureLongKey");
-	_LIT(KLog,"TestCaptureAndCancelCapturePair: %S, %S");
-	TPtrC captures[EMaxCaptureKeyApis] = {KCaptureKey(), KCaptureKey(), KCaptureKeyKeyUpAndDowns(), KCaptureKeyKeyUpAndDowns(), KCaptureLongKey(), KCaptureLongKey()};
-	TPtrC cancelCaptures[EMaxCancelCaptureKeyApis] = {KCancelCaptureKey(), KCancelCaptureKeyKeyUpAndDowns(), KCancelCaptureLongKey()};
-	TLogMessageText logMessageText;	
-	logMessageText.Format(KLog, &captures[aCaptureApi], &cancelCaptures[aCancelCaptureApi]);
-	INFO_PRINTF1(logMessageText);
-#endif // LOGGING	
-	
-	// Start a key capture using one of the six RWindowGroup Capture***() APIs
-	switch (aCaptureApi)
-		{
-		case ECaptureKey1:
-		case ECaptureKey2:
-			// Test RWindowGroup::CaptureKey()
-			if (aCaptureApi == ECaptureKey1) 				
-				iCaptureKey = iQueueClient->iGroup->GroupWin()->CaptureKey('A',0,0);
-			else
-				iCaptureKey = iQueueClient->iGroup->GroupWin()->CaptureKey('A',0,0,1); // priority 1 (default priority is 0)
-			iTest->SimulateKey(TRawEvent::EKeyDown, 'A');
-			TheClient->iWs.Flush();
-			User::After(KeyRepeatTime()*3/2);
-			iTest->SimulateKey(TRawEvent::EKeyUp, 'A');
-			TheClient->iWs.Flush();
-			AddExpectedKey(EEventKeyDown, 'A');
-			AddExpectedKey(EEventKey,'A','a');
-			AddExpectedKey(EEventKey,'A','a',1);			
-			AddExpectedKey(EEventKeyUp, 'A');
-			break;				
-			
-		case ECaptureKeyUpAndDowns1:
-		case ECaptureKeyUpAndDowns2:
-			// Test RWindowGroup::CaptureKeyUpAndDowns()
-			if (aCaptureApi == ECaptureKeyUpAndDowns1)			
-				iCaptureKey=iQueueClient->iGroup->GroupWin()->CaptureKeyUpAndDowns(EStdKeySpace,0,0);
-			else
-				iCaptureKey=iQueueClient->iGroup->GroupWin()->CaptureKeyUpAndDowns(EStdKeySpace,0,0,1); // priority 1 (default priority is 0)
-			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeySpace);
-			TheClient->iWs.Flush();			
-			User::After(KeyRepeatTime()*3/2);
-			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeySpace);
-			TheClient->iWs.Flush();
-			AddExpectedKey(EEventKeyDown,EStdKeySpace);
-			AddExpectedKey(EEventKey,EStdKeySpace,' ');
-			AddExpectedKey(EEventKey,EStdKeySpace,' ',1);
-			AddExpectedKey(EEventKeyUp,EStdKeySpace);
-			break;	
-			
-		case ECaptureLongKey1:
-		case ECaptureLongKey2:
-			{
-			// Test RWindowGroup::CaptureLongKey()
-			TTimeIntervalMicroSeconds32 repeat = KeyRepeatTime();
-			if (aCaptureApi == ECaptureLongKey1)
-				{
-				iCaptureKey = iQueueClient->iGroup->GroupWin()->CaptureLongKey(' ', 'a', 0, 0, 2, ELongCaptureNormal);	
-				}
-			else
-				{
-				repeat = KeyRepeatTime()/2;
-				iCaptureKey = iQueueClient->iGroup->GroupWin()->CaptureLongKey(repeat, ' ', 'a', 0, 0, 2, ELongCaptureNormal);
-				}					
-			iQueueClient->iWs.Flush();
-			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeySpace);
-			TheClient->iWs.Flush();
-			User::After(KeyRepeatTime()*3/2);
-			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeySpace);
-			TheClient->iWs.Flush();
-			AddExpectedKey(EEventKeyDown,EStdKeySpace);
-			AddExpectedKey(EEventKey,EStdKeySpace,' ');
-			AddExpectedKey(EEventKey,EStdKeySpace,'a',1);
-			AddExpectedKey(EEventKeyUp,EStdKeySpace);
-			}
-			break;
-				
-		default:
-			INFO_PRINTF1(_L("Unexpected TCaptureKeyApis value passed to CTEventTest::TestCaptureAndCancelCapturePair()"));
-			TEST(EFalse);
-			break;
-		}	
-	
-	if (iCaptureKey)
-		{
-		// End a capture using one of the three RWindowGroup CancelCapture***() APIs,
-		// for each Capture***() API each one of these will be called, therefore there will
-		// be one correct CancelCapture***() APIs called and two incorrect CancelCapture***() 
-		// APIs called for each Capture***() API.
-		switch (aCancelCaptureApi)
-			{
-			case ECancelCaptureKey:
-				iQueueClient->iGroup->GroupWin()->CancelCaptureKey(iCaptureKey);
-				break;
-			case ECancelCaptureKeyUpAndDowns:
-				iQueueClient->iGroup->GroupWin()->CancelCaptureKeyUpAndDowns(iCaptureKey);
-				break;
-			case ECancelCaptureLongKey:
-				iQueueClient->iGroup->GroupWin()->CancelCaptureLongKey(iCaptureKey);
-				break;
-			default:
-				INFO_PRINTF1(_L("Unexpected TCancelCaptureKeyApis value passed to CTEventTest::TestCaptureAndCancelCapturePair()"));
-				TEST(EFalse);
-				break;
-			}
-		
-		// If an mistmatched CancelCapture***() API was called, call the correct one now
-		// to make sure the Capture/CancelCapture state is clean before the next test starts
-		if ((aCaptureApi/2) != aCancelCaptureApi)
-			{
-			switch (aCaptureApi)				
-				{
-				case ECaptureKey1:
-				case ECaptureKey2:
-					iQueueClient->iGroup->GroupWin()->CancelCaptureKey(iCaptureKey);
-					break;
-				case ECaptureKeyUpAndDowns1:
-				case ECaptureKeyUpAndDowns2:
-					iQueueClient->iGroup->GroupWin()->CancelCaptureKeyUpAndDowns(iCaptureKey);
-					break;
-				case ECaptureLongKey1:
-				case ECaptureLongKey2:
-					iQueueClient->iGroup->GroupWin()->CancelCaptureLongKey(iCaptureKey);
-					break;
-				}
-			}
-		}
-		
-	TheClient->iWs.Flush();
-	}	
-
-/*void CTEventTest::_NextSetOfEvents()		//Template for these functions
-	{
-	switch(iEventSet++)
-		{
-		case 0:
-			iQueueClient->iWin->WinTreeNode()->;		//Set up window
-			iQueueClient->iWin->BaseWin()->;
-			iQueueClient->iGroup->GroupWin()->;
-			iQueueClient->iWs.Flush();					//Make take effect
-			SimulateEvent(TRawEvent::);					//Create an event
-			TheClient->iWs.Flush();						//Send event
-			AddExpectedEvent(EEventFocusGained);		//Always get a focus gain at start
-			AddExpectedEvent();							//Expect the event that was created above
-			break;
-		case 1:
-			iQueueClient->iWs.Flush();
-			SimulateEvent(TRawEvent::);
-			TheClient->iWs.Flush();
-			AddExpectedEvent();
-			break;
-		default:
-			CActiveScheduler::Stop();
-			break;
-		}
-	TheClient->iWs.Flush();
-	}*/
-
-/**
-	@SYMTestCaseID GRAPHICS-WSERV-CODEBASE-WSERV-0051
-  
-	@SYMPREQ PGM027
-  
-	@SYMTestCaseDesc Tests SetKeyboardRepeatRate API. 
-   
-	@SYMTestPriority 1 
-  
-	@SYMTestStatus Implemented
-   
-	@SYMTestActions This test tryes to call SetKeyboardRepeatRate with invalid time values\n
-			
-	@SYMTestExpectedResults KeyRepeatRateNegTest should tests the API SetKeyboardRepeatRate return value\n
-	The test should pass and API should return KErrArgument.
-
- */
-void CTEventTest::KeyRepeatRateNegTest(TInt aInitialRepeat, TInt aRepeat)
-	{
-	((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-CODEBASE-WSERV-0051"));
-	TInt ret=TheClient->iWs.SetKeyboardRepeatRate(TTimeIntervalMicroSeconds32(aInitialRepeat), TTimeIntervalMicroSeconds32(aRepeat));
-	TEST(ret==KErrArgument);
-	TRAPD(err,((CTEventTestStep*)iStep)->RecordTestResultL());
-   	if (err!=KErrNone)
-    		INFO_PRINTF1(_L("Failed to record test result"));
-	}
-
-void CTEventTest::RunTestsL(TBool aNeedChildWindows/*=EFalse*/)
-	{
-	iQueueClient=new(ELeave) CTQueueClient(this);
-	iQueueClient->SetScreenNumber(iTest->iScreenNumber);
-	iQueueClient->ConstructL(aNeedChildWindows);
-	iEventSet=0;
-	TRAPD(err,NextSetOfEventsL());
-	if (err!=KErrNone)
-		{
-		iFailed=ETrue;
-		return;
-		}
-//
-	CActiveScheduler::Start();
-//
-	TInt eventsLeft=iQueueClient->EventQueue()->EventsLeft();
-	if (eventsLeft>0)
-		iFailed=ETrue;
-	delete iVisWins1;
-	iVisWins1 = NULL;
-	delete iVisWins2;
-	iVisWins2 = NULL;
-	delete iQueueClient;
-	iQueueClient=NULL;
-	}
-
-void CTEventTest::RunTestsRestoreAreaL(TBool aNeedChildWindows)
-	{
-	TRect area(TheClient->iWs.PointerCursorArea());
-	RunTestsL(aNeedChildWindows);
-	TheClient->iWs.SetPointerCursorArea(area);
-	}
-
-/*void CTEventTest::QueuePurgingL()
-	{
-	RunTestsL(EFalse);
-	}
-
-void CTEventTest::SendEventL()
-	{
-	RunTestsL(EFalse);
-	}
-
-void CTEventTest::InvisibleWindowL()
-	{
-	RunTestsL(ETrue);
-	}
-
-void CTEventTest::JavaAdditionsL()
-	{
-	RunTestsL(EFalse);
-	}*/
-
-void CTEventTest::WindowCapBugL()
-	{
-	RunTestsL(ETrue);
-	}
-
-/*void CTEventTest::XyInputTypeL()
-	{
-	RunTestsL(EFalse);
-	}
-
-void CTEventTest::MovingPointerCursorL()
-	{
-	RunTestsRestoreAreaL(ETrue);
-	}
-
-void CTEventTest::RotatedModeL()
-	{
-	RunTestsRestoreAreaL(EFalse);
-	}*/
-
-/**
-* This test creates one anim and calls AddToEventHandlers() twenty times.
-* it shouldn't add the same anim to event handler if anim is already in handler.
-*/
-void CTEventTest::EventHandlerRemoval_AddEventHandlerMultipleTimes()
-	{
-	iTheClientFlush=TheClient->iWs.SetAutoFlush(ETrue);
-	iQuequeClientFlush=iQueueClient->iWs.SetAutoFlush(ETrue);
-
-	RRemovableAnim* eventTestAnim = RRemovableAnim::NewLC(iQueueClient->iWin->BaseWin(), iAnimDll);
-
-	// Call AddToEventHandlers() on same anim 20 times, it should add this anim in event handler only once
-	for (TInt count = 0; count < 20; count++)
-		eventTestAnim->AddToEventHandlers();
-	eventTestAnim->SetEventHandlerLifetime(1);
-
-	TRawEvent rawEvent1;
-	rawEvent1.Set(TRawEvent::EKeyUp, 34);
-
-	eventTestAnim->AddExpectedEvent(rawEvent1);
-
-	// Add these events to iQueueClient for testing
-	AddExpectedKey(EEventKeyUp, 34, ETrue);
-
-	iTest->SimulateKey(TRawEvent::EKeyUp, 34);
-
-	CleanupStack::PopAndDestroy(eventTestAnim);
-	TheClient->iWs.SetAutoFlush(iTheClientFlush);
-	iQueueClient->iWs.SetAutoFlush(iQuequeClientFlush);
-	}
-
-void CTEventTest::EventQueuePtrCrashTest()
-// Code designed to hit the defect reported in INC109199 & INC105430, needs a very specific sequence of
-// events and client disconnections to hit the exact problem state.
-	{
-	const TInt KNumTestEvents=6;
-	const TInt KMaxNumTestEvents=16;
-	// Number of iterations needs to be as high as the queue granularity to make sure at least
-	// once around we actually hit the code to change the queue size
-	const TInt KNumEvTestIterations=4;
-	const TInt KNumBaseTestSessions=KNumEvTestIterations+1;
-	const TInt KNumMainTestSessions=13;
-	const TInt KMaxNumSessions=KNumBaseTestSessions+KNumMainTestSessions+KNumEvTestIterations;
-	RWsSession wsSessions[KMaxNumSessions];
-	RWindowGroup wGroups[KMaxNumSessions];
-	for(TInt iterationLoop=0;iterationLoop<KNumEvTestIterations;iterationLoop++)
-		{
-		const TInt numTestSessions=KNumBaseTestSessions+KNumMainTestSessions+iterationLoop;
-	#if defined(LOGGING)
-		_LIT(KLog1,"EventQueuePtrCrashTest: Test Creating %d Clients");
-		LOG_MESSAGE2(KLog1,numTestSessions);
-	#endif
-		for(TInt testSessionIndex=0;testSessionIndex<numTestSessions;testSessionIndex++)
-			{
-			RWsSession& ws=wsSessions[testSessionIndex];
-			User::LeaveIfError(ws.Connect());
-			wGroups[testSessionIndex]=RWindowGroup(ws);
-			RWindowGroup& group=wGroups[testSessionIndex];
-			User::LeaveIfError(group.Construct(testSessionIndex+1,EFalse)); 
-			if (testSessionIndex>=KNumBaseTestSessions)
-				{
-				TWsEvent event;
-				for(TInt evLoop=0;evLoop<KNumTestEvents;evLoop++)
-					{
-					event.SetType(1001+evLoop);
-					ws.SendEventToWindowGroup(group.Identifier(),event);
-					}
-				if (testSessionIndex==(numTestSessions-1))
-					{
-					for(TInt eventIndex=0;eventIndex<KMaxNumTestEvents;eventIndex++)
-						{
-						event.SetType(1001+eventIndex);
-						ws.SendEventToAllWindowGroups(event);
-						}
-					}
-				}
-			}
-	#if defined(LOGGING)
-		_LIT(KLog2,"EventQueuePtrCrashTest: Closing Clients");
-		LOG_MESSAGE(KLog2);
-	#endif
-		TInt closeLoop=0;
-		while(closeLoop<KNumBaseTestSessions)
-			{
-			wsSessions[closeLoop++].Close();
-			}
-		RWsSession extraSession1;
-		User::LeaveIfError(extraSession1.Connect());
-		extraSession1.Close();
-		while(closeLoop<numTestSessions)
-			{
-			wsSessions[closeLoop++].Close();
-			}
-		}
-	}
-
-/**
-Test queue size of the new queue can be initialized to be at least EMinQueueSize.
-@param aEventReadyCancel whether there is inactive client. This parameter can be specified
-		to test different code path for expanding spaces for new queue. If the value is false, 
-		the space for the new queue is gained from current global queue or by growing global queue size. 
-		Otherwise, there are inactive clients which	cancel their listening to event, in addition, 
-		memory allocation is simulated to be failed when growing global queue size, 
-		so that space is gained by purging events from inactive clients. 
-*/
-void CTEventTest::InitializeQueueSizeTestL(TBool aEventReadyCancel)
-	{
-	const TInt numEvents = 50;
-	const TInt maxClients = 3; 
-	const TInt oneSecond = 1000000;
-	RWsSession wsSession[maxClients];
-	RWindowGroup groupWin[maxClients];
-	TRequestStatus status;
-	TInt cliHanGrpWin = 10000;
-	RTimer timer;
-	timer.CreateLocal();
-	CleanupClosePushL(timer);
-	// To have the test creating different number of clients is to make sure
-	// there is at least one of the tests meets the below requirement:
-	// the number of the connections when the new queue created for test is not multiple
-	// of queue granularity, so that the queue size initialization is not done by growing
-	// global queue size due to the increase of the connections.
-	for (TInt numClients = maxClients - 1; numClients <= maxClients; numClients++)
-		{
-		TInt clientIndex;
-		//Create test clients
-		for (clientIndex = 0; clientIndex < numClients; clientIndex++)
-			{
-			User::LeaveIfError(wsSession[clientIndex].Connect());
-			CleanupClosePushL(wsSession[clientIndex]);
-			groupWin[clientIndex] = RWindowGroup(wsSession[clientIndex]);
-			User::LeaveIfError(groupWin[clientIndex].Construct(cliHanGrpWin++));
-			CleanupClosePushL(groupWin[clientIndex]);
-			}
-		
-		// Cancel listening to event for the first client. 
-		// This is for testing PurgeInactiveEvents. 
-		if (aEventReadyCancel)
-			{
-			wsSession[0].EventReady(&status);
-			wsSession[0].EventReadyCancel();
-			User::WaitForRequest(status);
-			}
-
-		//send events to window group to make the queue full.
-		TWsEvent event;
-		TInt evLoop;
-		for(evLoop = 0; evLoop < numEvents; evLoop++)
-			{
-			event.SetType(2001 + evLoop);
-			TheClient->iWs.SendEventToWindowGroup(groupWin[0].Identifier(),event);
-			TheClient->iWs.SendEventToWindowGroup(groupWin[1].Identifier(),event);
-			}
-		
-		//To create a new client, although the queue is full, wserv will guarantee to initialize 
-		//the queue size of the new queue to at least EMinQueueSize. So that it can response to 
-		//the event.
-		RWsSession testWsSession;
-		RWindowGroup testGroupWin;
-		TRequestStatus testStatus;
-		if (aEventReadyCancel)
-			{
-			//Simulate the heap allocation failure to test expanding spaces by purge 
-			//events from inactive clients when initialize queue size.
-			TInt failAt = 1;
-			TInt err;
-			do	{
-				TheClient->iWs.HeapSetFail(RHeap::EFailNext, failAt++);
-				TheClient->iWs.Flush();
-				err = testWsSession.Connect();
-				TheClient->iWs.HeapSetFail(RHeap::ENone, 1);
-				} while (err == KErrNoMemory);
-			User::LeaveIfError(err);
-			}
-		else
-			{
-			User::LeaveIfError(testWsSession.Connect());
-			}
-		CleanupClosePushL(testWsSession);
-		testGroupWin = RWindowGroup(testWsSession);
-		User::LeaveIfError(testGroupWin.Construct(cliHanGrpWin++));
-		CleanupClosePushL(testGroupWin);
-	
-		//Send events to the newly created client.
-		// The Debug version of WServ puts a EEventFocusGained into the event 
-		// before this test's custom event, so leave one slot in the queue 
-		// for it.
-#if (defined _DEBUG)
-		TInt testEventCount = EMinQueueSize - 1; 
-#else
-		TInt testEventCount = EMinQueueSize; 
-#endif
-		for(TInt evLoop = 0; evLoop < testEventCount; evLoop++)
-			{
-			event.SetType(3001 + evLoop);
-			TheClient->iWs.SendEventToWindowGroup(testGroupWin.Identifier(),event);
-			}
-		
-		//Check the event queue.
-		//Having a timer here to avoid infinitely wait for event.
-		TInt expectedEvent = 3001;
-		for(TInt evLoop = 0; evLoop < EMinQueueSize; evLoop++)
-            {
-			testWsSession.EventReady(&testStatus);
-			TRequestStatus timerStatus;
-			timer.After(timerStatus, oneSecond);
-			User::WaitForRequest(testStatus, timerStatus);
-			TEST(testStatus == 0);
-			if (testStatus == 0) 
-				{
-				// Tests the event
-				testWsSession.GetEvent(event);
-				// WServ sometimes puts a EEventFocusGained event into the queue 
-				// before the test's custom event, so ignore it.
-				if (event.Type() != EEventFocusGained)
-					{
-					TEST(event.Type() == expectedEvent);
-					expectedEvent++;
-					}
-				// testStatus has been completed. Cancel the timer.
-				timer.Cancel();
-				User::WaitForRequest(timerStatus);
-				}
-			else
-				{
-				// Times out, cancel the event notification
-				testWsSession.EventReadyCancel();
-				User::WaitForRequest(testStatus);
-				}
-			}
-		CleanupStack::PopAndDestroy(2*numClients + 2, &wsSession[0]);
-		}
-	CleanupStack::PopAndDestroy(&timer);
-	}
-
-void CTEventTest::SimulateRepeatEvent(TInt aScanCode, TInt aRepeats/*=0*/)
-    {
-    TRawEvent rawEvent;
-    if (aRepeats)
-        rawEvent.Set(TRawEvent::EKeyRepeat, aScanCode, aRepeats);
-    else
-        rawEvent.Set(TRawEvent::EKeyRepeat, aScanCode);
-    UserSvr::AddEvent(rawEvent);
-    }
-
-void CTEventTest::RawEventRepeatTest_NextSetOfEventsL()
-    {
-    switch(iEventSet++)
-        {
-        case 0:
-            // Tests EKeyRepeat without repeat value set.
-            SimulateRepeatEvent(32);
-            
-            // Tests EKeyRepeat with repeat value set to 2.
-            SimulateRepeatEvent(33,2);
-          
-            AddExpectedEvent(EEventFocusGained);
-            AddExpectedKey(EEventKey, 32);
-            AddExpectedKey(EEventKey, 33, 0, 2);
-            break;
-        default:
-             CActiveScheduler::Stop();
-             break;
-        }
-    TheClient->iWs.Flush();
-    }
-
-void CTEventTest::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(KTest0,"General 1");
-	_LIT(KTest1,"Event queue purging");
-	_LIT(KTest2,"SendEvent");
-	_LIT(KTest3,"SendEventToAll");
-	_LIT(KTest4,"InvisibleWindow");
-	_LIT(KTest5,"JavaAdditions");
-	_LIT(KTest6,"WindowCaptureBug");
-	_LIT(KTest7,"XYInput Types");
-	_LIT(KTest8,"MovingPointerCursor");
-	_LIT(KTest9,"Rotated Modes");
-	_LIT(KTest10,"Anim Event");
-	_LIT(KTest11,"Focus Changed");
-	_LIT(KTest12,"On/Off Events");
-	_LIT(KTest13,"Virtual Keyboard");
-	_LIT(KTest14,"Key Clicks");
-	_LIT(KTest15,"Capture Long");
-	_LIT(KTest16,"Password Window");
-	_LIT(KTest17,"Group List Changed");
-	_LIT(KTest18,"Repeatable Key Events");
-	_LIT(KTest19,"Screen Scaling");
-	_LIT(KTest20,"Visibility Changed Events");
-	_LIT(KTest21,"Check Time Stamp Of Events");
-	_LIT(KTest22,"Pointer Capture Priority Events");
-	_LIT(KTest23,"Event Handler Removal");
-	_LIT(KTest24,"Event Queue ptr crash test");
-	_LIT(KTest25,"Mismatched Pointer Events");
-	_LIT(KTest26,"Pointer Buffer Purge");
-	_LIT(KTest27,"TRawEvent test for Repeats");
-#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS            
-#ifndef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA 
-	_LIT(KTest28,"Transparent Surface Visibility Changed Events 1");
-	_LIT(KTest29,"Transparent Surface Visibility Changed Events 2");
-	_LIT(KTest30,"Transparent Surface Visibility Changed Events 3");
-#endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-#endif // SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
-	_LIT(KTest31A,"Initialize Queue Size without inactive queue");
-	_LIT(KTest31B,"Initialize Queue Size with inactive queue");	
-	
-	if (!TestBase()->ConfigurationSupportsPointerEventTesting())
-	    {
-	    INFO_PRINTF1(_L("Test skipped because config does not support pointer event testing"));
-	    TestComplete();
-	    return;
-	    }
-	
-	//if (iTest->iState==1) iTest->iState=14;	//Use this line to skip to a particular test
-	((CTEventTestStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(iTest->iState)
-		{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0053
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Carry out general event tests on WServ
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     General events are sent via WServ
-
-@SYMTestExpectedResults The events are sent without error
-*/
-		case 0:
-			iTest->LogSubTest(KTest0);
-			General();
-			((CTEventTestStep*)iStep)->SetOverallTestStepID(_L("GRAPHICS-WSERV-0053"));
-			//iState=8;
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0054
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Carry out event queue purging
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Purge the event queue
-
-@SYMTestExpectedResults The events queue is purged without error
-*/
-		case 1:
-			((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0054"));
-			iTest->LogSubTest(KTest1);
-			RunTestsL();		//QueuePurgingL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0055
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test that events can be sent
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Send events in WServ
-
-@SYMTestExpectedResults The events are sent without error
-*/
-		case 2:
-			((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0055"));
-			iTest->LogSubTest(KTest2);
-			RunTestsL();		//SendEventL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0056
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Send an event to all window groups
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Send an event to all window groups
-
-@SYMTestExpectedResults The events are sent to all window groups
-						without error
-*/
-		case 3:
-			((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0056"));
-			iTest->LogSubTest(KTest3);
-			General2();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0057
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Send events to an invisible window
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Send events to an invisible window
-
-@SYMTestExpectedResults The events are sent to the window without
-						error
-*/
-		case 4:
-			((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0057"));
-			iTest->LogSubTest(KTest4);
-			RunTestsL(ETrue);		//InvisibleWindowL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0058
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Send events for java additions
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Send events for java additions
-
-@SYMTestExpectedResults The events are sent to the window without
-						error
-*/
-		case 5:
-			((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0058"));
-			iTest->LogSubTest(KTest5);
-			RunTestsL();		//JavaAdditionsL();
-			break;
-
-		case 6:
-			((CTEventTestStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			iTest->LogSubTest(KTest6);
-			//WindowCapBugL();		//Not finished
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0059
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Send events for x and y inputs
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Send events for x and y inputs
-
-@SYMTestExpectedResults The events are sent to the window without
-						error
-*/
-		case 7:
-			((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0059"));
-			iTest->LogSubTest(KTest7);
-			RunTestsL();		//XyInputTypeL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0060
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Send events for moving pointer cursor
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Send events for moving pointer cursor
-
-@SYMTestExpectedResults The events are sent to the window without
-						error
-*/
-		case 8:
-			((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0060"));
-			iTest->LogSubTest(KTest8);
-			RunTestsRestoreAreaL(ETrue);		//MovingPointerCursorL();
-		    break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0061
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Send events for rotate mode
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Send events for rotate mode
-
-@SYMTestExpectedResults The events are sent to the window without
-						error
-*/
-		case 9:
-			((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0061"));
-			iTest->LogSubTest(KTest9);
-			RunTestsRestoreAreaL(EFalse);		//RotatedModeL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0062
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Send events for an anim event
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Send events for an anim event
-
-@SYMTestExpectedResults The events are sent to the window without
-						error
-*/
-		case 10:
-			((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0062"));
-			iTest->LogSubTest(KTest10);
-			RunTestsRestoreAreaL(EFalse);		//AnimEvent();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0063
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Send events for focus changed
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Send events for focus changed
-
-@SYMTestExpectedResults The events are sent to the window without
-						error
-*/
-		case 11:
-			((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0063"));
-			iTest->LogSubTest(KTest11);
-			RunTestsL();		//FocusChanged();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0064
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Send stop events
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Send stop events
-
-@SYMTestExpectedResults The events are sent to the window without
-						error
-*/
-		case 12:
-			((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0064"));
-			iTest->LogSubTest(KTest12);
-			RunTestsL(ETrue);		//StopEvents();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0065
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Send events for the virtual keyboard
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Send events for the virtual keyboard
-
-@SYMTestExpectedResults The events are sent to the window without
-						error
-*/
-		case 13:
-			((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0065"));
-			iTest->LogSubTest(KTest13);
-			RunTestsL();		//VirtualKeyboard();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0066
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Send events for key clicks
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Send stop events
-
-@SYMTestExpectedResults The events are sent to the window without
-						error
-*/
-		case 14:
-			((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0066"));
-			iTest->LogSubTest(KTest14);
-			{
-			TBool changeable;
-			if (iClick.IsLoaded(changeable) && !iTest->IsFullRomL())
-				RunTestsL(ETrue);		//KeyClicks();
-			}
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0067
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Send events for capturing large areas of text
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Send events for capturing large areas of text
-
-@SYMTestExpectedResults The events are sent to the window without
-						error
-*/
-		case 15:
-			((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0067"));
-			iTest->LogSubTest(KTest15);
-			RunTestsL(ETrue);		//CaptureLong();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0068
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Send events for activating password
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Send events for activating password
-
-@SYMTestExpectedResults The events are sent to the window without
-						error
-*/
-		case 16:
-			((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0068"));
-			iTest->LogSubTest(KTest16);
-			if (!iTest->IsFullRomL())
-				RunTestsL();		//Password();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0069
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Send events for activating password
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Send events for activating password
-
-@SYMTestExpectedResults The events are sent to the window without
-						error
-*/
-		case 17:
-			((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0069"));
-			iTest->LogSubTest(KTest17);
-			RunTestsL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0070
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Send repeatable key events
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Send repeatable key events
-
-@SYMTestExpectedResults The events are sent to the window without
-						error
-*/
-		case 18:
-			((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0070"));
-			iTest->LogSubTest(KTest18);
-			RunTestsL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0071
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Send Screen Scaling events
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Send Screen Scaling events
-
-@SYMTestExpectedResults The events are sent to the window without
-						error
-*/
-		case 19:
-			((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0071"));
-			iTest->LogSubTest(KTest19);
-			if (iScreenModeTests&EDoScale)
-				{
-				RunTestsL();
-				}
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0072
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Send Visibility Changed events
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Send Visibility Changed events
-
-@SYMTestExpectedResults The events are sent to the window without
-						error
-*/
-		case 20:
-			((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0072"));
-			iTest->LogSubTest(KTest20);
-			RunTestsL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0073
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Check Time Stamp Of Sent Events
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Check Time Stamp Of Sent Events
-
-@SYMTestExpectedResults The time stamps for the events are correct
-*/
-		case 21:
-			((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0073"));
-			iTest->LogSubTest(KTest21);
-			RunTestsL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0074
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Send Pointer Capture Priority Events
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Send Pointer Capture Priority Events
-
-@SYMTestExpectedResults The events are sent to the window without
-						error
-*/
-		case 22:
-			((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0074"));
-			iTest->LogSubTest(KTest22);
-			RunTestsL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0343
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Send Event Handler Removal Events
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Send Event Handler Removal Events
-
-@SYMTestExpectedResults The events are sent to the window without
-						error
-*/
-		case 23:
-			((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0343"));
-			iTest->LogSubTest(KTest23);
-			RunTestsL();                   //EventHandlerRemoval();
-			break;
-		case 24:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0565
-*/
-			((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0565"));
-			iTest->LogSubTest(KTest24);
-			EventQueuePtrCrashTest();
-			break;
-/**
-@SYMTestCaseID 		GRAPHICS-WSERV-0496
-
-@SYMDEF 			DEF133776
-
-@SYMTestCaseDesc 	Cancels key captures using all combinations of 
-  RWindowGroup::Capture...() and RWindowGroup::Cancel...() APIs.
-
-@SYMTestPriority 	High
-
-@SYMTestStatus 		Implemented
-
-@SYMTestActions 	Call each of the RWindowGroup::Capture***() APIs followed by
- each of the RWindowGroup::CancelCapture***() APIs.
- RWindowGroup::Capture***() APIs:
- 	CaptureKey(TUint, TUint, TUint)
- 	CaptureKey(TUint, TUint, TUint, TInt)
- 	CaptureKeyUpAndDowns(TUint, TUint, TUint)
- 	CaptureKeyUpAndDowns(TUint, TUint, TUint, TInt)
- 	CaptureLongKey(TUint, TUint, TUint, TUint, TInt, TUint)
- 	CaptureLongKey(TTimeIntervalMicroSeconds32, TUint, TUint, TUint, TUint, TInt, TUint)
- RWindowGroup::CancelCapture***() APIs:
-	CancelCaptureKey()
-	CancelCaptureKeyUpAndDowns()
-	CancelCaptureLongKey()
- 
-@SYMTestExpectedResults WServ should handle matched and mismatched Cancel 
- and Capture calls without panicking.
-*/			
-		case 25:
-// Skip this test in debug on the emulator, run it always on hardware as debug ROMs include
-// a release version of the production code that doesn't panic
-			((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0496"));
-#if defined(_DEBUG) && !defined (__MARM__)
-			INFO_PRINTF1(_L("Skipping this test in _DEBUG on emulator to avoid debug only panics, see GRAPHICS-WSERV-0497 for the matching panic test"));				
-#else						
-			iTest->LogSubTest(KTest25);
-			RunTestsL();
-#endif
-			break;	
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0444
-
-@SYMDEF             PDEF110849
-
-@SYMTestCaseDesc    Pointer Buffer Exception After Event Queue Purge
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Connect to pointer buffer, send it some pointer events and disconnect.
-					Now send enough events to cause an event queue purge.  The purge will
-					attempt to empty the pointer buffer, but will fail because we have disconnected.
-
-@SYMTestExpectedResults The purge will realise it does not need to empty the pointer buffer and 
-						so there will not be an access violation - exception.
-						
-*/			
-		case 26:
-			((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0444"));
-			iTest->LogSubTest(KTest26);
-			RunTestsL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0484
-@SYMDEF             PDEF120721
-@SYMTestCaseDesc    Window server guarantees to initialize the queue size of the new queue to 
-					at least EMinQueueSize.
-@SYMTestPriority    High
-@SYMTestStatus      Implemented
-@SYMTestActions     Create multiple clients to connect to window server.
-					Send enough events to make the event queue full.
-					Create a new client to connect to window server.
-					Send events to the new client and test that the new client 
-					can get the events.
-@SYMTestExpectedResults Window server guarantees to initialize the size of the new event 
-						queue to EMinQueueSize, so that window server will not lock up
-						due to the full of global event queue.
-						
-*/			
-		case 27:
-		    iTest->LogSubTest(KTest27);
-		    RunTestsL();
-		    break;
-		    
-#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS            
-#ifndef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA            
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-2669-0015
-@SYMREQ             REQ13202: Possibility for external layers to appear above UI layer
-@SYMTestCaseDesc    Window obscured by transparent surface window receives 
-                    (EPartiallyVisible | EFullyVisible) when surface is made semi-transparent.
-@SYMTestPriority    2
-@SYMPrerequisites   Win1 – bottom window
-                    Win2 – middle window with background surface, which totally obscures win1
-@SYMTestActions     Call SetSurfaceTransparency(ETrue) on win2
-@SYMTestExpectedResults Win1 receives visibility event
-*/            
-        case 28:
-            ((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-2669-0015"));
-            iTest->LogSubTest(KTest28);
-            RunTestsL();
-            break;
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-2669-0016
-@SYMREQ             REQ13202: Possibility for external layers to appear above UI layer 
-@SYMTestCaseDesc    Window obscured by semi-transparent surface window receives   
-                    (EPartiallyVisible | EFullyVisible) when obscuring window is deleted
-@SYMTestPriority    2
-@SYMPrerequisites   Win1 – bottom window
-                    Win2 – middle window with semi-transparent background surface, which totally obscures win1
-                    Win3 – top window which totally obscures win2, and is opaque
-@SYMTestActions     Delete win3
-@SYMTestExpectedResults Both win1 and win2 receive visibility events
-*/            
-        case 29:
-            ((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-2669-0016"));
-            iTest->LogSubTest(KTest29);
-            RunTestsL();
-            break;
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-2669-0017
-@SYMREQ             REQ13202: Possibility for external layers to appear above UI layer 
-@SYMTestCaseDesc    Window does not receive any visibiliy event when a semi-transparent
-                    surface is moved onto/above it.
-@SYMTestPriority    2
-@SYMPrerequisites   Win1 – bottom window
-                    Win2 – top window which does not overlap win1
-@SYMTestActions     Move win2 to overlap win1
-@SYMTestExpectedResults No visibility event is received (win1 is still fully visible)
-*/            
-        case 30:
-            ((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-2669-0017"));
-            iTest->LogSubTest(KTest30);
-            RunTestsL();
-            break;
-#endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-#endif // SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS  
-
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0559
-@SYMDEF             INC140850
-@SYMTestCaseDesc    To check Wserv passes correct repeat value for TRawEvent of type EKeyRepeat.
-@SYMTestPriority    High
-@SYMTestStatus      Implemented
-@SYMTestActions     Simulate TRawEvent of type EKeyRepeat without Repeat value set.
-                    Simulate the above with repeat value set to 2.
-@SYMTestExpectedResults Simulated events should match expected events added to the array. 
-*/
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-		case 28:
-#else
-#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
-		case 31:
-#else
-		case 28:
-#endif
-#endif
-		    // This test was moved to be the last test in the test suite, because it sometimes leaves events in the event queue, 
-		    //it can affect the results of other tests. This test case should be the last test in the test suite. 
-		    ((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0484"));
-		    iTest->LogSubTest(KTest31A);
-		    InitializeQueueSizeTestL(EFalse);
-		    iTest->LogSubTest(KTest31B);
-		    InitializeQueueSizeTestL(ETrue);
-		    break;    
-			
-		default:
-            ((CTEventTestStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTEventTestStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-			break;
-		}
-	((CTEventTestStep*)iStep)->RecordTestResultL();
-	if (iFailed)
-		{
-		TEST(EFalse);
-		iFailed=EFalse;
-		}
-	++iTest->iState;
-	}
-
-__WS_CONSTRUCT_STEP__(EventTest)
-
--- a/windowing/windowserver/tauto/TFADE.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2126 +0,0 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test Fading and UnFading of windows
-// 
-//
-
-#include "TFADE.H"
-#define __DISPLAY_MODE_64K_COLOR
-
-//CRedrawWin
-
-CRedrawWin::CRedrawWin(CTFade *aTest) : CTWin(), iTest(aTest)
-	{}
-
-CRedrawWin::~CRedrawWin()
-	{
-	}
-
-void CRedrawWin::ConstructL(TRect aArea)
-	{
-
-	ConstructExtLD(*TheClient->iGroup,aArea.iTl,aArea.Size());
-	AssignGC(*TheClient->iGc);
-	Activate();
-	iWin.BeginRedraw();
-	iWin.EndRedraw();
-	}
-
-void CRedrawWin::Draw()
-	{
-	iTest->Drawing(iTest->Content(),iGc);
-	}
-
-
-//CFadeTest
-
-CTFade::CTFade(CTestStep* aStep) : CTWsGraphicsBase(aStep)
-	{
-#if defined (__MARM_THUMB__)
-	CanFade = false;
-	CanFadeSet = false;
-#endif
-	}
-
-void CTFade::ConstructL()
-	{
-	iDeviceDisplayMode=TheClient->iScreen->DisplayMode();
-	iTestWinSize=StdTestWindowSize();
-	iFadeDrawMode = iDeviceDisplayMode;
-	iTestWinCopy = new (ELeave) CFbsBitmap();
-	iTestWinCopy->Create(iTestWinSize,TheClient->iScreen->DisplayMode());
-	iCheckWinCopy = new (ELeave) CFbsBitmap();
-	iCheckWinCopy->Create(iTestWinSize,TheClient->iScreen->DisplayMode());
-	}
-
-CTFade::~CTFade()
-	{
-	__ASSERT_ALWAYS(!iBlankWin,AutoPanic(EAutoFadeWindow));
-	delete iTestWinCopy;
-	delete iCheckWinCopy;
-	}
-
-TInt CTFade::Content()
-	{
-	return iContent;
-	}
-
-void CTFade::CreateBlankWindowL()
-	{
-	__ASSERT_ALWAYS(!iBlankWin,AutoPanic(EAutoFadeWindow));
-	TSize scrSize(TheClient->iScreen->SizeInPixels());
-	iTestWinSize.SetSize(2*scrSize.iWidth/3-6,scrSize.iHeight-6);
-	iBlankWin=new(ELeave) CTBlankWindow();
-	iWindowRect.SetRect(TPoint(3+scrSize.iWidth/3,3),iTestWinSize);
-	iBlankWin->SetUpL(iWindowRect.iTl,iTestWinSize,TheClient->iGroup,*TheClient->iGc);
-	iBlankWin->BaseWin()->SetRequiredDisplayMode(EGray16);
-	}
-
-void CTFade::DestroyBlankWindow()
-	{
-	__ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
-	delete iBlankWin;
-	iBlankWin=NULL;
-	}
-
-void CTFade::CreateBackupWindowL(TBool aMaintainBackup)
-	{
-	__ASSERT_ALWAYS(!iWin,AutoPanic(EAutoFadeWindow));
-	CTBackedUpWin* backUpWin=new(ELeave) CTBackedUpWin(MODE_LT_64K(iDeviceDisplayMode)?iFadeDrawMode:iDeviceDisplayMode);
-	iWin=backUpWin;
-	iOwnWindow=ETrue;
-	iWindowRect.SetRect(TPoint(2*iTestWinSize.iWidth+35,7),iTestWinSize);
-	backUpWin->ConstructExtLD(*TheClient->iGroup,iWindowRect.iTl,iTestWinSize);
-	if (aMaintainBackup)
-		backUpWin->BackedUpWin()->MaintainBackup();
-	backUpWin->Activate();
-	TheClient->WaitForRedrawsToFinish();		//Without this bitmaps won't draw into the window
-	}
-
-void CTFade::CreateRedrawWindowL()
-	{
-	__ASSERT_ALWAYS(!iWin,AutoPanic(EAutoFadeWindow));
-	iWindowRect.SetRect(TPoint(2*iTestWinSize.iWidth+35,7),iTestWinSize);
-	CRedrawWin* redrawWin=new(ELeave) CRedrawWin(this);
-	redrawWin->ConstructL(iWindowRect);
-	redrawWin->Win()->EnableRedrawStore(EFalse);
-	iWin=redrawWin;
-	iOwnWindow=ETrue;
-	iWin->BaseWin()->SetRequiredDisplayMode(iFadeDrawMode);
-	}
-
-void CTFade::DestroyDrawableWindow()
-	{
-	__ASSERT_ALWAYS(iWin,AutoPanic(EAutoFadeWindow));
-	if (iOwnWindow)
-		delete iWin;
-	iWin=NULL;
-	}
-
-void CTFade::CreateBitmapsL()
-	{
-	iTestWinSize=BaseWin->Size();
-	iBaseRect.SetRect(BaseWin->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),iTestWinSize);
-	iNormalBitmap.Create(iTestWinSize,MODE_LT_64K(iDeviceDisplayMode)?iFadeDrawMode:iDeviceDisplayMode);
-	iFadedBitmap.Create(iTestWinSize,MODE_LT_64K(iDeviceDisplayMode)?iFadeDrawMode:iDeviceDisplayMode);
-	iNormalBitmapDevice=CFbsBitmapDevice::NewL(&iNormalBitmap);
-	iFadedBitmapDevice=CFbsBitmapDevice::NewL(&iFadedBitmap);
-	User::LeaveIfError(iNormalBitmapDevice->CreateContext(iNormalBitGc));
-	User::LeaveIfError(iFadedBitmapDevice->CreateContext(iFadedBitGc));
-	iFadedBitGc->SetFadeMode(ETrue);
-	iBaseWinMode=BaseWin->BaseWin()->DisplayMode();
-	BaseWin->BaseWin()->SetRequiredDisplayMode(iFadeDrawMode);
-	}
-
-void CTFade::DestroyBitmaps()
-	{
-	delete iNormalBitGc;
-	delete iFadedBitGc;
-	delete iNormalBitmapDevice;
-	delete iFadedBitmapDevice;
-	BaseWin->BaseWin()->SetRequiredDisplayMode(iBaseWinMode);
-	}
-
-void CTFade::Drawing(TInt aDrawFunc, CBitmapContext *gc)
-	{
-	TRgb grey=TRgb::Gray4(2);
-	TInt ii;
-	gc->Reset();
-	switch (aDrawFunc)
-		{
-	case 1:
-	case 2:
-		Draw(0,&grey,gc);
-		gc->Reset();
-		Draw(1,NULL,gc);
-		if (aDrawFunc==1)
-			break;
-		gc->Reset();
-		Draw(3,NULL,gc);
-		break;
-	case 3:
-		Draw(0,&grey,gc);
-		gc->Reset();
-		Draw(3,NULL,gc);
-		break;
-	case 4:
-		grey=TRgb::Gray4(1);
-		gc->Reset();
-		Draw(0,&grey,gc);
-		gc->Reset();
-		for (ii=1;ii<37;ii+=7)
-			Draw(2,&ii,gc);
-		break;
-	case 5:
-		Draw(0,&grey,gc);
-		gc->Reset();
-		Draw(1,NULL,gc);
-		gc->Reset();
-		for (ii=2;ii<60;ii+=11)
-			Draw(2,&ii,gc);
-		break;
-	case 6:
-	case 7:
-		Draw(0,&grey,gc);
-		gc->Reset();
-		Draw(3,NULL,gc);
-		gc->Reset();
-		for (ii=3;ii<70;ii+=13)
-			Draw(2,&ii,gc);
-		if (aDrawFunc==6)
-			break;
-		gc->Reset();
-		Draw(1,NULL,gc);
-		break;
-	default:;
-		}
-	}
-
-void CTFade::Draw(TInt aDrawFunc, TAny *aParam, TBool aAlternativeFade/*=EFalse*/, TBool aFade/*=EFalse*/)
-	{
-	CWindowGc *gc=TheClient->iGc;
-	gc->Activate(*iWin->DrawableWin());
-	gc->Reset();
-	if (aFade)
-		gc->SetFaded(ETrue);
-	iNormalBitGc->Reset();
-	iFadedBitGc->Reset();
-	iFadedBitGc->SetFadeMode(ETrue);
-	if (aAlternativeFade)
-		iFadedBitGc->SetFadingParameters(BLACK_ALTERNATE,WHITE_ALTERNATE);
-	Draw(aDrawFunc,aParam,gc);
-	Draw(aDrawFunc,aParam,iNormalBitGc);
-	Draw(aDrawFunc,aParam,iFadedBitGc);
-	gc->Deactivate();
-	if (aAlternativeFade)
-		iFadedBitGc->SetFadingParameters(BLACK_NORMAL,WHITE_NORMAL);
-	}
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA // CWindowGc fading is deprecated in NGA
-void CTFade::GCDraw(TInt aDrawFunc, TAny *aParam, TBool aAlternativeFade)
-	{
-	CWindowGc *gc=TheClient->iGc;
-	gc->Activate(*iWin->DrawableWin());
-	gc->Reset();
-	Draw(aDrawFunc,aParam,gc);
-	gc->Deactivate();
-	gc->Activate(*BaseWin->DrawableWin());
-	gc->Reset();
-	gc->SetFaded(ETrue);
-	if (aAlternativeFade)
-		gc->SetFadingParameters(BLACK_ALTERNATE,WHITE_ALTERNATE);
-	Draw(aDrawFunc,aParam,gc);
-	gc->Deactivate();
-	}
-#endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-
-void CTFade::Draw(TInt aDrawFunc, TAny *aParam, CBitmapContext *aGc)
-	{
-	switch(aDrawFunc)
-		{
-		case 0:
-			aGc->SetBrushColor(*((TRgb *)aParam));
-			aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-			aGc->SetPenStyle(CGraphicsContext::ENullPen);
-			aGc->DrawRect(TRect(iTestWinSize));
-			break;
-		case 1:
-			{
-			TSize half(iTestWinSize.iWidth/2,iTestWinSize.iHeight/2);
-			TRect rect(half);
-			aGc->DrawEllipse(rect);
-			aGc->DrawEllipse(TRect(TPoint(0,half.iHeight),half));
-			aGc->SetOrigin(TPoint(half.iWidth,0));
-			aGc->SetClippingRect(rect);
-			aGc->DrawEllipse(rect);
-			aGc->SetOrigin(TPoint(half.iWidth,half.iHeight));
-			aGc->SetClippingRect(rect);
-			aGc->DrawEllipse(rect);
-			aGc->SetOrigin(TPoint());
-			aGc->CancelClippingRect();
-			}
-			break;
-		case 2:
-			{
-			TInt param= *((TInt *)aParam);
-			if (param&0x1)
-				aGc->DrawLine(TPoint(param+(param*27)%iTestWinSize.iWidth,0),
-							 TPoint(iTestWinSize.iWidth-((param<<1)+(param*19)%iTestWinSize.iWidth),iTestWinSize.iHeight));
-			else
-				aGc->DrawLine(TPoint(0, (param<<1)+(param*7)%iTestWinSize.iHeight),
-							 TPoint(iTestWinSize.iWidth,param+(param*13)%iTestWinSize.iHeight));
-			}
-			break;
-		case 3:
-			{
-			TPoint pos;
-			for(;pos.iX<iTestWinSize.iWidth;pos.iX+=10)
-				aGc->DrawLine(pos,pos+TSize(0,iTestWinSize.iHeight));
-			for(pos.iX=0;pos.iY<iTestWinSize.iHeight;pos.iY+=10)
-				aGc->DrawLine(pos,pos+TSize(iTestWinSize.iWidth,0));
-			}
-			break;
-		}
-	}
-
-void CTFade::CompareWithBitmap(TBool aFade)
-	{
-	TBool match;
-	CWindowGc& gc=*TheClient->iGc;
-	CFbsBitmap* bitmap;
-	TheClient->iWs.Flush();
-	if (aFade)
-		bitmap=&iFadedBitmap;
-	else
-		bitmap=&iNormalBitmap;
-	gc.Activate(*BaseWin->DrawableWin());
-	gc.Reset();
-	gc.BitBlt(TPoint(),bitmap);
-	gc.Deactivate();
-	TheClient->iWs.Flush();
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-	match=TheClient->iScreen->RectCompare(iBaseRect,iWindowRect);
-#else // In NGA comparison has to be lossy because fading can be implemented on hardware
-	match=LossyCompareWindow(*TheClient->iScreen, *iTestWinCopy, *iCheckWinCopy, iWindowRect);
-#endif
-	TEST(match);
-	if (!match)
-			{
-			_LIT(KLog,"Windows content don't match when they should");
-			LOG_MESSAGE(KLog);
-			}
-	}
-
-void CTFade::CompareWindows(TBool aAlternativeFade/*=EFalse*/)
-	{
-	if (aAlternativeFade)
-		iWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly,BLACK_ALTERNATE,WHITE_ALTERNATE);
-	else
-		iWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
-	TheClient->iWs.Flush();
-	TBool retVal = TheClient->iScreen->RectCompare(iBaseRect,iWindowRect);
-	TEST(retVal);
-	if (!retVal)
-		INFO_PRINTF3(_L("TheClient->iScreen->RectCompare(iBaseRect,iWindowRect) return value - Expected: %d, Actual: %d"), ETrue, retVal);		
-
-	iWin->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
-	TheClient->iWs.Flush();
-	TheClient->WaitForRedrawsToFinish();
-	}
-
-#define FADE(n,col) n/2+col/2
-TInt CTFade::Fade4(TInt aGray4)
-	{
-#if defined(__WINS__)
-	return FADE(4,aGray4);
-#elif defined (__MARM_THUMB__)
-	return (CanFade ? FADE(4,aGray4):aGray4);
-#elif defined (__MARM__)
-	return FADE(4,aGray4);
-#else
-	return aGray4;
-#endif
-	}
-
-TInt CTFade::Fade16(TInt aGray16)
-	{
-#if defined(__WINS__)
-	return FADE(16,aGray16);
-#elif defined (__MARM_THUMB__)
-	return (CanFade ? FADE(16,aGray16):aGray16);
-#elif defined (__MARM__)
-	return FADE(16,aGray16);
-#else
-	return aGray16;
-#endif
-	}
-
-TRgb CTFade::FadeRgb(TRgb aColor)
-	{
-	switch (iFadeDrawMode)
-		{
-	case EColor16M:
-	case EColor16MU:		
-	case EColor16MA:
-	case EColor16MAP:
-		break; 
-	default:
-		aColor=TRgb::Color64K(aColor.Color64K());
-		break; 
-		}
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA // Color fading calculation differs in NGA
-	TInt fadeMapFactor=WHITE_NORMAL-BLACK_NORMAL+1;
-#else
-	TInt fadeMapFactor=WHITE_NORMAL-BLACK_NORMAL;
-#endif
-	TInt fadeMapOffset=BLACK_NORMAL;
-	TInt value = aColor.Internal();
-
-	TInt b = (((value & 0x000000ff) * fadeMapFactor) >> 8) + fadeMapOffset;
-	TInt g = (((value & 0x0000ff00) * fadeMapFactor) >> 16) + fadeMapOffset;
-	TInt r = (((value & 0x00ff0000) * fadeMapFactor) >> 24) + fadeMapOffset;
-	return TRgb(r,g,b);
-	}
-
-TRgb CTFade::FadeRgb(TRgb aColor, TInt aFadeMapFactor, TInt aFadeMapOffset)
-	{
-	switch (iFadeDrawMode)
-		{
-	case EColor16M:
-	case EColor16MU:
-	case EColor16MA:
-	case EColor16MAP:
-		break; 
-	default:
-		aColor=TRgb::Color64K(aColor.Color64K());
-		break; 
-		}
-	TInt value = aColor.Internal();
-
-	TInt b = (((value & 0x000000ff) * aFadeMapFactor) >> 8) + aFadeMapOffset;
-	TInt g = (((value & 0x0000ff00) * aFadeMapFactor) >> 16) + aFadeMapOffset;
-	TInt r = (((value & 0x00ff0000) * aFadeMapFactor) >> 24) + aFadeMapOffset;
-	return TRgb(r,g,b);
-	}
-
-inline void CTFade::ViewDelay()
-	//
-	//This routine can provide a delay which will allow the user to see the colors changing
-	//
-	{
-	TheClient->iWs.Finish();
-	/*TheClient->iWs.Flush();
-	User::After(1000000);*/		// 1 sec
-	}
-
-void CTFade::ColorTest()
-	{
-	__ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
-	TBool retVal;
-	TSize size(iTestWinSize);
-#if defined(SMALL_RECTS)
-	size.iWidth=Min(SIZE_X,size.iWidth);
-	size.iHeight=Min(SIZE_Y,size.iHeight);
-#endif
-	TRect windowRect(iBlankWin->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),size);
-	TInt ii;
-	iBlankWin->BaseWin()->SetRequiredDisplayMode(EGray4);
-	TheClient->WaitForRedrawsToFinish();		//Force the screen into 4 gray mode
-	TRgb fadedColor;
-	for (ii=1;ii<4;ii+=2)		//0 and 3 now give dithered colors when fading so causing this test to fail
-		{
-		iBlankWin->SetColor(TRgb::Gray4(ii));
-		ViewDelay();
-		INFO_PRINTF1(_L(" Testing Normal Color"));
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-		retVal = CheckBlankWindow(windowRect,TRgb::Gray4(ii),TheClient->iScreen);
-#else
-		TheClient->iScreen->CopyScreenToBitmap(iTestWinCopy, windowRect);
-		retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray4(ii));
-#endif
-		TEST(retVal);
-		if (!retVal)
-			INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray4(ii),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);		
-		iBlankWin->BaseWin()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
-		ViewDelay();
-		fadedColor=MODE_LT_64K(iDeviceDisplayMode)?TRgb::Gray4(Fade4(ii)):FadeRgb(TRgb::Gray4(ii));
-#if defined (__MARM_THUMB__)
-		if (ii==1)
-			{
-			CanFade=!CheckBlankWindow(windowRect,fadedColor,TheClient->iScreen);
-			CanFadeSet=ETrue;
-			fadedColor=MODE_LT_64K(iDeviceDisplayMode)?TRgb::Gray4(Fade4(ii)):FadeRgb(TRgb::Gray4(ii));
-			}
-#endif
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-		retVal = CheckBlankWindow(windowRect,fadedColor,TheClient->iScreen);
-#else
-		retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, fadedColor);
-#endif
-		TEST(retVal);
-		if (!retVal)
-			INFO_PRINTF3(_L("CheckBlankWindow(windowRect,fadedColor,TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);		
-	
-		iBlankWin->BaseWin()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
-		ViewDelay();
-		INFO_PRINTF1(_L(" Testing Unfaded Color"));
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-		retVal = CheckBlankWindow(windowRect,TRgb::Gray4(ii),TheClient->iScreen);
-#else
-		retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray4(ii));
-#endif
-		TEST(retVal);
-		if (!retVal)
-			INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray4(ii),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);		
-		}
-	iBlankWin->BaseWin()->SetRequiredDisplayMode(EGray16);
-
-	if (MaxGrays()==0 && MaxColors()<256)
-		return;
-
-	INFO_PRINTF1(_L(" Doing 16 Gray Colors"));
-	for (ii=0;ii<16;++ii)
-		{
-		iBlankWin->SetColor(TRgb::Gray16(ii));
-		ViewDelay();
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-		retVal = CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen);
-#else
-		retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray16(ii));
-#endif
-		TEST(retVal);
-		if (!retVal)
-			INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);		
-
-		iBlankWin->BaseWin()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
-		ViewDelay();
-		fadedColor=MODE_LT_64K(iDeviceDisplayMode)?TRgb::Gray16(Fade16(ii)):FadeRgb(TRgb::Gray16(ii));
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-		retVal = CheckBlankWindow(windowRect,fadedColor,TheClient->iScreen);
-#else
-		retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, fadedColor);
-#endif
-		TEST(retVal);
-		if (!retVal)
-			INFO_PRINTF3(_L("CheckBlankWindow(windowRect,fadedColor,TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);		
-
-		iBlankWin->BaseWin()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
-		ViewDelay();
-	
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-		retVal = CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen);
-#else
-		retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray16(ii));
-#endif
-		TEST(retVal);
-		if (!retVal)
-			INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);		
-		}
-	}
-
-void CTFade::BlankWindowL()
-	{
-	TBool retVal;
-	if (MaxGrays()==0 && MaxColors()<256)
-		return;
-
-	__ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
-	CTBlankWindow* blankWin=new(ELeave) CTBlankWindow();
-	TRect testArea(iWindowRect);
-	TRect windowRect(testArea);
-#if defined(SMALL_RECTS)
-	TSize size(testArea.Size());
-	size.iWidth=Min(2*SIZE_X,size.iWidth);
-	size.iHeight=Min(2*SIZE_Y,size.iHeight);
-	testArea.SetHeight(size.iHeight);
-	testArea.iTl.iX=testArea.iBr.iX-size.iWidth;
-	windowRect=testArea;
-	windowRect.Shrink(size.iWidth/4,size.iHeight/4);
-#else
-	windowRect.Shrink(30,30);
-#endif
-	blankWin->SetUpL(windowRect.iTl,windowRect.Size(),TheClient->iGroup,*TheClient->iGc);
-	for (TInt col=2;col<16;col+=6)
-		{
-		iBlankWin->SetColor(TRgb::Gray16(col));
-		TheClient->iScreen->CopyScreenToBitmap(iTestWinCopy, windowRect);
-		iBlankWin->BaseWin()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
-		blankWin->SetVisible(EFalse);
-		TheClient->iWs.Finish();
-		TRgb fadedColor=MODE_LT_64K(iDeviceDisplayMode)?TRgb::Gray16(Fade16(col)):FadeRgb(TRgb::Gray16(col));
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
- 		retVal = CheckBlankWindow(testArea,fadedColor,TheClient->iScreen);
-#else
-		retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, fadedColor);
-#endif
-		TEST(retVal);
-		if (!retVal)
-			INFO_PRINTF3(_L("LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, fadedColor) return value - Expected: %d, Actual: %d"), ETrue, retVal);		
-
- 		blankWin->SetVisible(ETrue);
-		iBlankWin->BaseWin()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
-		blankWin->SetVisible(EFalse);
-		TheClient->iWs.Finish();
-		retVal = CheckBlankWindow(testArea,TRgb::Gray16(col),TheClient->iScreen);
-		TEST(retVal);
-		if (!retVal)
-			INFO_PRINTF3(_L("CheckBlankWindow(testArea,TRgb::Gray16(col),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);		
-
- 		blankWin->SetVisible(ETrue);
-		iBlankWin->SetPos(iWindowRect.iTl+TPoint(15,-15));
-		iBlankWin->BaseWin()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
-		blankWin->SetVisible(EFalse);
-		iBlankWin->SetPos(iWindowRect.iTl);
-		fadedColor=MODE_LT_64K(iDeviceDisplayMode)?TRgb::Gray16(Fade16(col)):FadeRgb(TRgb::Gray16(col));
-		TheClient->iWs.Finish();
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-		retVal = CheckBlankWindow(testArea,fadedColor,TheClient->iScreen);
-#else
-		retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, fadedColor);
-#endif
-		TEST(retVal);
-		if (!retVal)
-			INFO_PRINTF3(_L("LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, fadedColor) return value - Expected: %d, Actual: %d"), ETrue, retVal);		
-
- 		blankWin->SetVisible(ETrue);
-		iBlankWin->SetPos(iWindowRect.iTl+TPoint(15,-15));
-		iBlankWin->BaseWin()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
-		blankWin->SetVisible(EFalse);
-		iBlankWin->SetPos(iWindowRect.iTl);
-		TheClient->iWs.Finish();
- 		retVal = CheckBlankWindow(testArea,TRgb::Gray16(col),TheClient->iScreen);
-		TEST(retVal);
-		if (!retVal)
-			INFO_PRINTF3(_L("CheckBlankWindow(testArea,TRgb::Gray16(col),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);		
-
-		blankWin->SetVisible(ETrue);
-		}
-	delete blankWin;
-	}
-
-void CTFade::TestStrips(TRect aRect,TInt aHeight,TInt aNumNotFaded,TBool aInvert/*=EFalse*/)
-	{
-	TBool isFaded;
-	TInt ii;
-	TRgb col;
-	for (ii=0;ii<16;++ii)
-		{
-		isFaded=((!aInvert)==(!(ii<aNumNotFaded)));
-		if (isFaded)
-			col=MODE_LT_64K(iDeviceDisplayMode)?TRgb::Gray16(Fade16(ii)):FadeRgb(TRgb::Gray16(ii));
-		else
-			col=TRgb::Gray16(ii);
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-		TBool retVal = CheckBlankWindow(aRect,col,TheClient->iScreen);
-#else
-		TBool retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, aRect, col);
-#endif
-		TEST(retVal);
-		if (!retVal)
-			INFO_PRINTF3(_L("CheckBlankWindow(aRect,col,TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);		
-
-		aRect.Move(0,aHeight);
-		}
-	}
-
-void CTFade::FadeChildrenL()
-	{
-	if (MaxGrays()==0 && MaxColors()<256)
-		return;
-	
-	TInt retVal;
-	TBool retBool;
-
-	__ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
-	iBlankWin->BaseWin()->SetRequiredDisplayMode(EGray16);
-	iBlankWin->SetColor(TRgb::Gray16(0));
-	CTBlankWindow* win[16];
-	win[0]=iBlankWin;
-	TRect rect(iTestWinSize);
-	TInt height=iTestWinSize.iHeight/16;
-	rect.iTl.iY=height;
-	TInt ii;
-	for (ii=1;ii<16;++ii)		//Causes memory leakage under OOM
-		{
-		win[ii]=new(ELeave) CTBlankWindow();
-		win[ii]->SetUpL(rect.iTl,rect.Size(),win[ii-1],*TheClient->iGc);
-		win[ii]->BaseWin()->SetRequiredDisplayMode(EGray16);
-		win[ii]->SetColor(TRgb::Gray16(ii));
-		rect.iBr.iY-=height;
-		}
-	rect=iWindowRect;
-	rect.SetHeight(height);
-#if defined(SMALL_RECTS)
-	TSize size(rect.Size());
-	size.iWidth=Min(SIZE_X,size.iWidth);
-	size.iHeight=Min(SIZE_Y,size.iHeight);
-	rect.SetSize(size);
-#endif
-	for (ii=0;ii<15;++ii)
-		{
-		win[ii]->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
-		retVal = win[ii]->BaseWin()->IsFaded();
-		TEST(retVal==1);
-		if (retVal!=1)
-			INFO_PRINTF3(_L("win[ii]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), 1, retVal);		
-
-		TestStrips(rect,height,ii);
-		win[ii]->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
-		retBool = !win[ii]->BaseWin()->IsFaded();
-		TEST(retBool);
-		if (!retBool)
-			INFO_PRINTF3(_L("!win[ii]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), ETrue, retBool);		
-
-		TestStrips(rect,height,16);
-		}
-	TheClient->iGroup->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
-	TestStrips(rect,height,0);
-	TheClient->iGroup->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
-	TestStrips(rect,height,16);
-	for (ii=0;ii<16;++ii)
-		{
-		win[ii]->BaseWin()->FadeBehind(ETrue);
-		retBool = !win[ii]->BaseWin()->IsFaded();
-		TEST(retBool);
-		if (!retBool)
-			INFO_PRINTF3(_L("!win[ii]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), ETrue, retBool);		
-
-		retVal = win[0]->BaseWin()->IsFaded();
-		TEST(retVal==(ii>0));
-		if (retVal!=(ii>0))
-			INFO_PRINTF3(_L("win[0]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), (ii>0), retVal);		
-
-		TestStrips(rect,height,ii,ETrue);
-		win[ii]->BaseWin()->FadeBehind(EFalse);
-		TestStrips(rect,height,16);
-		}
-	iBlankWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
-	TestStrips(rect,height,0);
-	iBlankWin->WinTreeNode()->SetNonFading(ETrue);
-	TestStrips(rect,height,16);
-	win[8]->WinTreeNode()->SetNonFading(EFalse);
-	TestStrips(rect,height,8);
-	iBlankWin->WinTreeNode()->SetNonFading(EFalse);
-	TestStrips(rect,height,0);
-	iBlankWin->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
-	TestStrips(rect,height,16);
-	win[8]->WinTreeNode()->SetNonFading(ETrue);
-	TestStrips(rect,height,16);
-	iBlankWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
-	TestStrips(rect,height,8,ETrue);
-	win[8]->WinTreeNode()->SetNonFading(EFalse);
-	TestStrips(rect,height,0);
-	iBlankWin->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
-	TestStrips(rect,height,16);
-	for (ii=15;ii>0;--ii)
-		delete win[ii];
-	}
-
-static void ResetAndDestroyWindows(TAny* aPtr)
-	{
-	RPointerArray<CTBlankWindow>& win = *(static_cast<RPointerArray<CTBlankWindow>*>(aPtr));
-	win.Remove(0);
-	win.ResetAndDestroy();
-	win.Close();
-	}
-
-void CTFade::FadeChildrenAfterNewChildIsCreatedL()
-	{
-	if (MaxGrays()==0 && MaxColors()<256)
-		return;
-	
-	TBool retBool;
-	TInt retVal;
-
-	__ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
-	iBlankWin->BaseWin()->SetRequiredDisplayMode(iFadeDrawMode);
-	iBlankWin->SetColor(TRgb::Gray16(0));
-	RPointerArray<CTBlankWindow> win;
-	CleanupStack::PushL(TCleanupItem(ResetAndDestroyWindows, &win));
-	TInt height=iTestWinSize.iHeight/NUMBER_OF_WINDOWS;
-	CTBlankWindow* window=NULL;
-	TInt ii;
-	for (TInt firstLoop=0;firstLoop<NUMBER_OF_WINDOWS-1;)
-		{
-		win.ResetAndDestroy();
-		TheClient->iGroup->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
-		TRect rect(iTestWinSize);
-		rect.iTl.iY=height;
-		CTBlankWindow* parent=iBlankWin;
-		for (TInt secondLoop=0;secondLoop<=firstLoop;)
-			{
-			window=new(ELeave) CTBlankWindow();
-			CleanupStack::PushL(window);
-			User::LeaveIfError(win.Append(window));
-			CleanupStack::Pop(window);
-			window->SetUpL(rect.iTl,rect.Size(),parent,*TheClient->iGc);
-			window->BaseWin()->SetRequiredDisplayMode(iFadeDrawMode);
-			window->SetColor(TRgb::Gray16(++secondLoop));
-			rect.iBr.iY-=height;
-			parent=window;
-			retBool = window->BaseWin()->IsFaded();
-			TEST(retBool);
-			if (!retBool)
-				INFO_PRINTF3(_L("window->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), ETrue, retBool);		
-
-			}
-		++firstLoop;
-		TheClient->iGroup->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
-		const TInt count=win.Count();
-		for(TInt index=0;index<count;++index)
-			{
-			retBool = win[index]->BaseWin()->IsFaded();
-			TEST(!retBool);
-			if (retBool)
-				INFO_PRINTF3(_L("win[index]->BaseWin()->IsFaded return value - Expected: %d, Actual: %d"), EFalse, retBool);		
-
-			}
-		}
-	User::LeaveIfError(win.Insert(iBlankWin,0));
-	TRect testRect=iWindowRect;
-	testRect.SetHeight(height);
-#if defined(SMALL_RECTS)
-	TSize size(testRect.Size());
-	size.iWidth=Min(SIZE_X,size.iWidth);
-	size.iHeight=Min(SIZE_Y,size.iHeight);
-	testRect.SetSize(size);
-#endif
-	for (ii=0;ii<NUMBER_OF_WINDOWS;++ii)
-		{
-		win[ii]->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
-		retVal = win[ii]->BaseWin()->IsFaded();
-		TEST(retVal==1);
-		if (retVal!=1)
-			INFO_PRINTF3(_L("win[index]->BaseWin()->IsFaded return value - Expected: %d, Actual: %d"), 1, retVal);		
-
-		TestStrips(testRect,height,ii);
-		win[ii]->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
-		retBool = !win[ii]->BaseWin()->IsFaded();
-		TEST(retBool);
-		if (!retBool)
-			INFO_PRINTF3(_L("!win[ii]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), EFalse, retBool);		
-
-		TestStrips(testRect,height,NUMBER_OF_WINDOWS);
-		}
-	TheClient->iGroup->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
-	TestStrips(testRect,height,0);
-	TheClient->iGroup->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
-	TestStrips(testRect,height,16);
-	for (ii=0;ii<NUMBER_OF_WINDOWS;++ii)
-		{
-		win[ii]->BaseWin()->FadeBehind(ETrue);
-		retBool = !win[ii]->BaseWin()->IsFaded();
-		TEST(retBool);
-		if (!retBool)
-			INFO_PRINTF3(_L("!win[ii]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), EFalse, retBool);		
-		
-		retVal = win[0]->BaseWin()->IsFaded();
-		TEST(retVal==(ii>0));
-		if (retVal!=(ii>0))
-			INFO_PRINTF3(_L("win[index]->BaseWin()->IsFaded return value - Expected: %d, Actual: %d"), (ii>0), retVal);		
-
-		TestStrips(testRect,height,ii,ETrue);
-		win[ii]->BaseWin()->FadeBehind(EFalse);
-		TestStrips(testRect,height,NUMBER_OF_WINDOWS);
-		}
-	iBlankWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
-	TestStrips(testRect,height,0);
-	iBlankWin->WinTreeNode()->SetNonFading(ETrue);
-	TestStrips(testRect,height,NUMBER_OF_WINDOWS);
-	win[8]->WinTreeNode()->SetNonFading(EFalse);
-	TestStrips(testRect,height,NUMBER_OF_WINDOWS/2);
-	iBlankWin->WinTreeNode()->SetNonFading(EFalse);
-	TestStrips(testRect,height,0);
-	iBlankWin->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
-	TestStrips(testRect,height,NUMBER_OF_WINDOWS);
-	win[8]->WinTreeNode()->SetNonFading(ETrue);
-	TestStrips(testRect,height,NUMBER_OF_WINDOWS);
-	iBlankWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
-	TestStrips(testRect,height,NUMBER_OF_WINDOWS/2,ETrue);
-	win[8]->WinTreeNode()->SetNonFading(EFalse);
-	TestStrips(testRect,height,0);
-	iBlankWin->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
-	TestStrips(testRect,height,NUMBER_OF_WINDOWS);
-
-	CleanupStack::PopAndDestroy(&win);
-	}
-
-void CTFade::TestBlocks(TRect aRect,TSize aSize,TInt aNumNotFaded,TBool aInvert/*=EFalse*/)
-	{
-	TInt count=0;
-	TInt ii,jj;
-	TRgb col;
-	for (ii=0;ii<4;++ii)
-		{
-		for (jj=0;jj<4;++jj)
-			{
-			if ((!aInvert)!=(!(count<aNumNotFaded)))
-				col=TRgb::Gray16(count);
-			else
-				{
-				col = TRgb::Gray16(count);
-				col = MODE_LT_64K(iDeviceDisplayMode)?TRgb::Gray16(Fade16(count)):FadeRgb(col);
-				}
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-			TBool retBool = CheckBlankWindow(aRect,col,TheClient->iScreen);
-#else
-			TBool retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, aRect, col);
-#endif
-			TEST(retBool);
-			if (!retBool)
-				INFO_PRINTF3(_L("CheckBlankWindow(aRect,col,TheClient->iScreen) return value - Expected: %d, Actual: %d"), EFalse, retBool);		
-	
-			aRect.Move(0,aSize.iHeight);
-			count++;
-			}
-		aRect.Move(aSize.iWidth,-jj*aSize.iHeight);
-		}
-	}
-
-void CTFade::FadeBehindL()
-	{
-	if (MaxGrays()==0 && MaxColors()<256)
-		return;
-	
-	TBool retBool;
-	TInt retVal;
-
-	__ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
-	iBlankWin->BaseWin()->SetRequiredDisplayMode(EGray16);
-	iBlankWin->SetColor(TRgb::Gray16(0));
-	CTBlankWindow* win[4][4];
-	win[0][0]=iBlankWin;
-	TSize size=iTestWinSize;
-	TInt height=iTestWinSize.iHeight/4;
-	TInt width=iTestWinSize.iWidth/4;
-	TRect rect(iWindowRect.iTl,TSize(width,height));
-	TSize rectSize(rect.Size());
-	TPoint offset(0,height);
-	TPoint topLeft;
-	TInt ii,jj;
-	CTWinBase* parent;
-#if defined(SMALL_RECTS)
-	TSize rSize(rectSize);
-	rSize.iWidth=Min(SIZE_X,rSize.iWidth);
-	rSize.iHeight=Min(SIZE_Y,rSize.iHeight);
-	rect.SetSize(rSize);
-#endif
-	for (ii=0;ii<4;++ii)		//Causes memory leakage under OOM
-		{
-		parent=TheClient->iGroup;
-		topLeft=iWindowRect.iTl+TPoint(ii*width,0);
-		size.iHeight=iTestWinSize.iHeight;
-		for (jj=0;jj<4;++jj)
-			{
-			if (ii+jj>0)
-				{
-				win[ii][jj]=new(ELeave) CTBlankWindow();
-				win[ii][jj]->SetUpL(topLeft,size,parent,*TheClient->iGc);
-				win[ii][jj]->BaseWin()->SetRequiredDisplayMode(EGray16);
-				win[ii][jj]->SetColor(TRgb::Gray16(4*ii+jj));
-				}
-			size.iHeight-=height;
-			topLeft=offset;
-			parent=win[ii][jj];
-			}
-		size.iWidth-=width;
-		}
-	for (ii=0;ii<4;++ii)
-		{
-		for (jj=0;jj<4;++jj)
-			{
-			win[ii][jj]->BaseWin()->FadeBehind(ETrue);
-			retVal = win[0][0]->BaseWin()->IsFaded();
-			TEST(retVal==(ii>0||jj>0));
-			if (retVal!=(ii>0||jj>0))
-				INFO_PRINTF3(_L("win[0][0]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), (ii>0||jj>0), retVal);		
-
-			retBool = !win[ii][jj]->BaseWin()->IsFaded();
-			TEST(retBool);
-			if (!retBool)
-				INFO_PRINTF3(_L("!win[ii][jj]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), ETrue, retBool);		
-
-			TestBlocks(rect,rectSize,4*ii+jj,ETrue);
-			win[ii][jj]->BaseWin()->FadeBehind(EFalse);
-			TestBlocks(rect,rectSize,16);
-			}
-		}
-   	for (ii=0;ii<4;++ii)
-		{
-		for (jj=0;jj<4;++jj)
-			{
-			win[ii][jj]->BaseWin()->FadeBehind(ETrue);
-			TestBlocks(rect,rectSize,4*ii+jj,ETrue);
-			}
-		retVal = win[ii][0]->BaseWin()->IsFaded();
-		TEST(retVal==3);
-		if (retVal!=3)
-			INFO_PRINTF3(_L("win[ii][0]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), 3, retVal);		
-		}
-   	for (ii=3;ii>=0;--ii)
-		{
-		retVal = win[ii][0]->BaseWin()->IsFaded();
-		TEST(retVal==3);
-		if (retVal!=3)
-			INFO_PRINTF3(_L("win[ii][0]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), 3, retVal);		
-
-		for (jj=3;jj>=0;--jj)
-			{
-			TestBlocks(rect,rectSize,4*ii+jj,ETrue);
-			win[ii][jj]->BaseWin()->FadeBehind(EFalse);
-			}
-		}
- 	TestBlocks(rect,rectSize,0,ETrue);
-   	for (ii=0;ii<4;++ii)
-		{
-		for (jj=0;jj<4;++jj)
-			{
-			win[ii][jj]->BaseWin()->FadeBehind(ETrue);
-			}
-		}
-	TInt fadeCount;
-   	for (ii=0;ii<4;++ii)
-		{
-		for (jj=0;jj<4;++jj)
-			{
-			fadeCount=15-(4*ii+jj);
-			retVal = win[0][0]->BaseWin()->IsFaded();
-			TEST(retVal==Min(15,fadeCount+1));
-			if (retVal!=Min(15,fadeCount+1))
-				INFO_PRINTF3(_L("win[0][0]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), Min(15,fadeCount+1), retVal);		
-
-			retVal = win[ii][jj]->BaseWin()->IsFaded();
-			TEST(retVal==Max(0,fadeCount));
-			if (retVal!=Max(0,fadeCount))
-				INFO_PRINTF3(_L("win[ii][jj]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), Max(0,fadeCount), retVal);		
-
-			TestBlocks(rect,rectSize,15,ETrue);
-			win[ii][jj]->BaseWin()->FadeBehind(EFalse);
-			retVal = win[ii][jj]->BaseWin()->IsFaded();
-			TEST(retVal==Max(0,fadeCount));
-			if (retVal!=Max(0,fadeCount))
-				INFO_PRINTF3(_L("win[ii][jj]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), Max(0,fadeCount), retVal);		
-
-			}
-		}
- 	TestBlocks(rect,rectSize,0,ETrue);
-	if (Fade16(15)==15)			
-		{
-		win[3][3]->BaseWin()->FadeBehind(ETrue);		//All faded as the only unfaded one is white
-		for (ii=3;ii>=0;--ii)
-			{
-			retVal = win[ii][0]->BaseWin()->IsFaded();
-			TEST(retVal==1);
-			if (retVal!=1)
-				INFO_PRINTF3(_L("win[ii][0]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), 1, retVal);		
-
-			retBool = !win[ii][1]->BaseWin()->IsNonFading();
-			TEST(retBool);
-			if (!retBool)
-				INFO_PRINTF3(_L("!win[ii][1]->BaseWin()->IsNonFading() return value - Expected: %d, Actual: %d"), ETrue, retBool);		
-
-			win[ii][0]->WinTreeNode()->SetNonFading(ETrue);
-			retBool = win[ii][1]->BaseWin()->IsNonFading();
-			TEST(retBool);
-			if (!retBool)
-				INFO_PRINTF3(_L("win[ii][1]->BaseWin()->IsNonFading() return value - Expected: %d, Actual: %d"), ETrue, retBool);		
-
-			TestBlocks(rect,rectSize,4*ii,ETrue);
-			}
-		for (ii=3;ii>=0;--ii)
-			{
-			retVal = win[ii][0]->BaseWin()->IsFaded();
-			TEST(retVal==1);
-			if (retVal!=1)
-				INFO_PRINTF3(_L("win[ii][0]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), 1, retVal);		
-			
-			retBool = win[ii][1]->BaseWin()->IsNonFading();
-			TEST(retBool);
-			if (!retBool)
-				INFO_PRINTF3(_L("win[ii][1]->BaseWin()->IsNonFading() return value - Expected: %d, Actual: %d"), ETrue, retBool);		
-
-			win[ii][0]->WinTreeNode()->SetNonFading(EFalse);
-			retBool = !win[ii][1]->BaseWin()->IsNonFading();
-			TEST(retBool);
-			if (!retBool)
-				INFO_PRINTF3(_L("win[ii][1]->BaseWin()->IsNonFading() return value - Expected: %d, Actual: %d"), ETrue, retBool);		
-
-			TestBlocks(rect,rectSize,4*ii);
-			}
-		win[3][3]->BaseWin()->FadeBehind(EFalse);
-		}
-	for (ii=3;ii>=0;--ii)
-		{
-		for (jj=3;jj>=0;--jj)
-			{
-			if (ii+jj>0)
-				delete win[ii][jj];
-			}
-		}
-	}
-
-void CTFade::ColorTest2()
-	{
-#if defined(__MARM__)
-	return;
-#else
-	__ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
-	TSize size=iTestWinSize;
-#if defined(SMALL_RECTS)
-	size.iWidth=Min(SIZE_X,size.iWidth);
-	size.iHeight=Min(SIZE_Y,size.iHeight);
-#endif
-	if (MaxGrays()==0 && MaxColors()<256)
-		return;
-	TRect windowRect(iBlankWin->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),size);
-	TUint8 bm;
-	TUint8 wm;
-	TInt test=0;
-	TInt ii;
-	FOREVER
-		{
-		TInt fadeMapFactor = 0;
-		TInt fadeMapOffset = 0;
-
-		switch (test)
-			{
-		case 0:			//Nothing
-			bm=0;
-			wm=15;
-			break;
-		case 1:			//Shadowing or Quartz fading
-			bm=0;
-			wm=7;
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-			TheClient->iWs.SetDefaultFadingParameters(0,127);
-			fadeMapFactor = 128;
-#else
-			TheClient->iWs.SetDefaultFadingParameters(STATIC_CAST(TUint8,bm*17),127);
-			fadeMapFactor = 127-STATIC_CAST(TUint8,bm*17);
-#endif
-			break;
-		default:
-			TheClient->iWs.SetDefaultFadingParameters(BLACK_NORMAL,WHITE_NORMAL);
-			return;
-			}
-		if (wm!=7)
-			{
-			fadeMapOffset = STATIC_CAST(TUint8,bm*17);
-			fadeMapFactor = STATIC_CAST(TUint8,wm*17) - fadeMapOffset;
-			TheClient->iWs.SetDefaultFadingParameters(STATIC_CAST(TUint8,bm*17),STATIC_CAST(TUint8,wm*17));
-			}
-
-		for (ii=0;ii<16;ii+=5)
-			{
-			iBlankWin->SetColor(TRgb::Gray16(ii));
-			ViewDelay();
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-			TBool retBool=CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen);
-#else
-			TBool retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray16(ii));
-#endif
-			TEST(retBool);
-			if (!retBool)
-				{
-				_LIT(KLog,"Setting color on blank window failed  mappings=%d  color=%d");
-				LOG_MESSAGE3(KLog,test,ii);
-				}
-			iBlankWin->BaseWin()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
-			ViewDelay();
-		
-			TRgb col1 = FadeRgb(TRgb::Gray16(ii), fadeMapFactor, fadeMapOffset);
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-			retBool=CheckBlankWindow(windowRect,col1,TheClient->iScreen);
-#else
-			retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, col1);
-#endif
-			TEST(retBool);
-			if (!retBool)
-				{
-				_LIT(KLog,"Fading the window gave wrong color  mappings=%d  color=%d");
-				LOG_MESSAGE3(KLog,test,ii);
-				}
-			iBlankWin->BaseWin()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
-			ViewDelay();
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-			retBool=CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen);
-#else
-			retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray16(ii));
-#endif
-			TEST(retBool);
-			if (!retBool)
-				{
-				_LIT(KLog,"Unfading the window gave wrong color  mappings=%d  color=%d");
-				LOG_MESSAGE3(KLog,test,ii);
-				}
-			}
-		++test;
-		}
-#endif	//__MARM__
-	}
-
-void CTFade::FadeTest()
-	{
-#if defined(__MARM__)
-	return;
-#else
-	__ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
-	TSize size=iTestWinSize;
-#if defined(SMALL_RECTS)
-	size.iWidth=Min(SIZE_X,size.iWidth);
-	size.iHeight=Min(SIZE_Y,size.iHeight);
-#endif
-	if (MaxGrays()==0 && MaxColors()<256)
-		return;
-	TRect windowRect(iBlankWin->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),size);
-	TUint8 bm;
-	TUint8 wm;
-	TUint8 fb;
-	TUint8 fw;
-	TInt test=0;
-	TInt ii;
-	FOREVER
-		{
-		TInt fadeMapFactor = 0;
-		TInt fadeMapOffset = 0;
-		fw=0;
-		switch (test)
-			{
-			case 0:			//Nothing
-				bm=0;
-				wm=15;
-				break;
-			case 1:			//Shadowing or Quartz fading
-
-			bm=0;
-			wm=7;
-			fw=127;
-			break;
-		default:
-			return;
-			}
-		fb=STATIC_CAST(TUint8,17*bm);
-		if (!fw)
-			fw=STATIC_CAST(TUint8,17*wm);
-		fadeMapFactor = fw - fb;
-		fadeMapOffset = fb;
-		for (ii=0;ii<16;ii+=5)
-			{
-			iBlankWin->SetColor(TRgb::Gray16(ii));
-			ViewDelay();
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-			TBool retBool = CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen);
-#else
-			TBool retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray16(ii));
-#endif
-			TEST(retBool);
-			if (!retBool)
-				INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retBool);
-	
-			TRgb col3 = TRgb::Gray16(ii).Internal();
-			TRgb col1 = FadeRgb(col3, fadeMapFactor, fadeMapOffset);
-			iBlankWin->BaseWin()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly,fb,fw);
-			ViewDelay();
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-			retBool = CheckBlankWindow(windowRect,col1,TheClient->iScreen);
-#else
-			retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, col1);
-#endif
-			TEST(retBool);
-			if (!retBool)
-				INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray16((ii*wb+add)/15),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retBool);
-	
-			iBlankWin->BaseWin()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
-			ViewDelay();
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA			
-			retBool = CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen);
-#else
-			retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray16(ii));
-#endif
-			TEST(retBool);
-			if (!retBool)
-				INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retBool);
-
-			}
-		++test;
-		}
-#endif	//__MARM__
-	}
-
-void CTFade::Draw(TBool aAlternativeFade/*=EFalse*/)
-	{
-	__ASSERT_ALWAYS(iWin,AutoPanic(EAutoFadeWindow));
-	TRgb grey=TRgb::Gray4(2);
-	Draw(0,&grey,aAlternativeFade);
-	Draw(1,NULL,aAlternativeFade);
-	iContent=1;
-	CompareWithBitmap(EFalse);
-	if (aAlternativeFade)
-		iWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly,BLACK_ALTERNATE,WHITE_ALTERNATE);
-	else
-		iWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
-	CompareWithBitmap(ETrue);
-	Draw(3,NULL,aAlternativeFade);
-	iContent=2;
-	CompareWithBitmap(ETrue);
-	iWin->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
-	CompareWithBitmap(EFalse);
-	}
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-void CTFade::GCDraw()
-	{
-	__ASSERT_ALWAYS(iWin,AutoPanic(EAutoFadeWindow));
-	TRgb grey=TRgb::Gray4(2);
-	TInt ii;
-	GCDraw(0,&grey);
-	GCDraw(3,NULL);
-	for (ii=3;ii<70;ii+=13)
-		GCDraw(2,&ii);
-	iContent=6;
-	CompareWindows();
-	GCDraw(0,&grey,ETrue);
-	GCDraw(3,NULL,ETrue);
-	for (ii=3;ii<70;ii+=13)
-		GCDraw(2,&ii,ETrue);
-	GCDraw(1,NULL,ETrue);
-	iContent=7;
-	CompareWindows(ETrue);
-	}
-#endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-
-void CTFade::ObscuredL()
-	{
-	CTBlankWindow* blankWin=new(ELeave) CTBlankWindow();
-	TRect windowRect(iWindowRect);
-	windowRect.Shrink(30,30);
-	blankWin->SetUpL(windowRect.iTl,windowRect.Size(),TheClient->iGroup,*TheClient->iGc);
-
-	__ASSERT_ALWAYS(iWin,AutoPanic(EAutoFadeWindow));
-	TRgb grey=TRgb::Gray4(2);
-	Draw(0,&grey);
-	Draw(3,NULL);
-	iContent=3;
- 	iWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
-	blankWin->SetVisible(EFalse);
-	CompareWithBitmap(ETrue);
-	blankWin->SetVisible(ETrue);
-	grey=TRgb::Gray4(1);
-	Draw(0,&grey);
-	for (TInt ii=1;ii<37;ii+=7)
-		Draw(2,&ii);
-	iContent=4;
-	blankWin->SetVisible(EFalse);
-	CompareWithBitmap(ETrue);
-	blankWin->SetVisible(ETrue);
- 	iWin->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
- 	blankWin->SetVisible(EFalse);
-	CompareWithBitmap(EFalse);
-
-	delete blankWin;
-	}
-
-void CTFade::MovingL()
-	{
-	CTBlankWindow* blankWin=new(ELeave) CTBlankWindow();
-	TRect windowRect(iWindowRect);
-	windowRect.Shrink(40,40);
-	blankWin->SetUpL(windowRect.iTl,windowRect.Size(),TheClient->iGroup,*TheClient->iGc);
-
-	__ASSERT_ALWAYS(iWin,AutoPanic(EAutoFadeWindow));
-	TRgb grey=TRgb::Gray4(2);
-	Draw(0,&grey);
-	Draw(1,NULL);
-	for (TInt ii=2;ii<60;ii+=11)
-		Draw(2,&ii);
-	iContent=5;
-	blankWin->SetPos(windowRect.iTl+TPoint(25,-25));
- 	iWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
- 	blankWin->SetPos(windowRect.iTl+TPoint(10,25));
-	blankWin->SetVisible(EFalse);
-	CompareWithBitmap(ETrue);
-	blankWin->SetVisible(ETrue);
-	blankWin->SetPos(windowRect.iTl+TPoint(25,-25));
- 	iWin->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
-	blankWin->SetPos(windowRect.iTl+TPoint(-5,10));
- 	blankWin->SetVisible(EFalse);
-	CompareWithBitmap(EFalse);
-
-	delete blankWin;
-	}
-
-void CTFade::SystemFadeL()
-	{
-	if (MaxGrays()==0 && MaxColors()<256)
-		return;
-
-	CTBlankWindow* win[16];
-	TInt height=iTestWinSize.iHeight/16;
-	TRect rect(iWindowRect);
-	rect.SetHeight(height);
-	TInt ii;
-	for (ii=0;ii<16;++ii)		//Causes memory leakage under OOM
-		{
-		win[ii]=new(ELeave) CTBlankWindow();
-		win[ii]->SetUpL(rect.iTl,rect.Size(),TheClient->iGroup,*TheClient->iGc);
-		win[ii]->BaseWin()->SetRequiredDisplayMode(EGray16);
-		win[ii]->SetColor(TRgb::Gray16(ii));
-		rect.Move(0,height);
-		}
-	rect=iWindowRect;
-	rect.SetHeight(height);
-#if defined(SMALL_RECTS)
-	TSize size(rect.Size());
-	size.iWidth=Min(SIZE_X,size.iWidth);
-	size.iHeight=Min(SIZE_Y,size.iHeight);
-	rect.SetSize(size);
-#endif
-
-	TBool retBool;
-
-	// system fade on
-	TheClient->iWs.SetSystemFaded(ETrue);
-	for (ii=0;ii<16;++ii)
-		{
-		retBool = win[ii]->BaseWin()->IsFaded();
-		TEST(retBool);
-		if (!retBool)
-			INFO_PRINTF3(_L("win[ii]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), ETrue, retBool);
-		}
-	TestStrips(rect,height,0);
-
-	// system fade off
-	TheClient->iWs.SetSystemFaded(EFalse);
-	for (ii=0;ii<16;++ii)
-		{
-		retBool = !win[ii]->BaseWin()->IsFaded();
-		TEST(retBool);
-		if (!retBool)
-			INFO_PRINTF3(_L("!win[ii]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), ETrue, retBool);
-		}
-	TestStrips(rect,height,16);
-
-	// Now with half non fading
-	for (ii=8;ii<16;++ii)
-		win[ii]->WinTreeNode()->SetNonFading(ETrue);
-
-	// system fade on
-	TheClient->iWs.SetSystemFaded(ETrue);
-	TestStrips(rect,height,8,ETrue);
-
-	// system fade off
-	TheClient->iWs.SetSystemFaded(EFalse);
-	TestStrips(rect,height,16);
-
-	for (ii=0;ii<16;++ii)
-		delete win[ii];
-	}
-
-void CTFade::SystemAlternateFadeL()
-	{
-#if defined(__MARM__)
-	return;
-#else
-	__ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
-	TSize size=iTestWinSize;
-#if defined(SMALL_RECTS)
-	size.iWidth=Min(SIZE_X,size.iWidth);
-	size.iHeight=Min(SIZE_Y,size.iHeight);
-#endif
-	if (MaxGrays()==0 && MaxColors()<256)
-		return;
-	TRect windowRect(iBlankWin->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),size);
-	TUint8 bm;
-	TUint8 wm;
-	TUint8 fb;
-	TUint8 fw;
-	TInt wb;
-	TInt add;
-	TInt test=0;
-	TInt ii;
-	TBool retBool;
-	FOREVER
-		{
-		TInt fadeMapFactor = 0;
-		TInt fadeMapOffset = 0;
-		fw=0;
-		switch (test)
-			{
-			case 0:			//Nothing
-				bm=0;
-				wm=15;
-				break;
-			case 1:			//Shadowing or Quartz fading
-			bm=0;
-			wm=7;
-			fw=127;
-			break;
-		default:
-			return;
-			}
-		wb=wm-bm;
-		add=15*bm+7;
-		fb=STATIC_CAST(TUint8,17*bm);
-		if (!fw)
-			fw=STATIC_CAST(TUint8,17*wm);
-		fadeMapFactor = fw - fb;
-		fadeMapOffset = fb;
-		for (ii=0;ii<16;ii+=5)
-			{
-			iBlankWin->SetColor(TRgb::Gray16(ii));
-			ViewDelay();
-			TheClient->iWs.Finish();
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-			retBool = CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen);
-#else
-			retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray16(ii));
-#endif
-			TEST(retBool);
-			if (!retBool)
-				INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retBool);
-
-			TheClient->iWs.SetSystemFaded(ETrue,fb,fw);
-			ViewDelay();
-
-			TRgb col3 = TRgb::Gray16(ii).Internal();
-			TRgb col1 = FadeRgb(col3, fadeMapFactor, fadeMapOffset);
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-			retBool = CheckBlankWindow(windowRect,col1,TheClient->iScreen);
-#else
-			retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, col1);
-#endif
-			TEST(retBool);
-			if (!retBool)
-				INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray16((ii*wb+add)/15),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retBool);
-
-			TheClient->iWs.SetSystemFaded(EFalse);
-			ViewDelay();
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-			retBool = CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen);
-#else
-			retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray16(ii));
-#endif
-			TEST(retBool);
-			if (!retBool)
-				INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retBool);
-			}
-		++test;
-		}
-#endif	//__MARM__
-	}
-
-void CTFade::FadeBehindWhenMovedL()
-	{
-	__ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
-	TDisplayMode displayMode=iBlankWin->BaseWin()->DisplayMode();
-	iBlankWin->BaseWin()->SetRequiredDisplayMode(EGray16);
-	iBlankWin->SetColor(TRgb::Gray16(1));
-	TSize size(iTestWinSize.iHeight/4,iTestWinSize.iWidth/4);
-	CTBlankWindow* blankWinTemp=new(ELeave) CTBlankWindow();
-	CleanupStack::PushL(blankWinTemp);
-	blankWinTemp->SetUpL(TPoint(5,5),size,iBlankWin,*TheClient->iGc);
-	blankWinTemp->BaseWin()->SetRequiredDisplayMode(EGray16);
-	blankWinTemp->SetColor(TRgb::Gray16(15));
-	blankWinTemp->BaseWin()->FadeBehind(ETrue);
-	TheClient->Flush();
-	blankWinTemp->SetPos(TPoint(5,120));
-	//Check whether the back window is faded or not
-	TBool retBool = iBlankWin->BaseWin()->IsFaded();
-	TEST(retBool);
-	if (!retBool)
-		INFO_PRINTF3(_L("iBlankWin->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), ETrue, retBool);
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-	CheckRect(iWindowRect.iTl+TPoint(5,5),iWindowRect.iTl+TPoint(75,5),size,_L("CTFade::FadeBehindWhenMovedL()"));
-#else
-	TInt res = LossyCompareWindow(*TheClient->iScreen, *iTestWinCopy, *iCheckWinCopy, TRect(iWindowRect.iTl+TPoint(75,5),size));
-	TEST(res);
-#endif
-	
-	//Check whether the area behind the moved window and any other area on same window are identical
-	blankWinTemp->BaseWin()->FadeBehind(EFalse);
-	iBlankWin->BaseWin()->SetRequiredDisplayMode(displayMode);
-	CleanupStack::PopAndDestroy(blankWinTemp);
-	}
-
-void CTFade::FadeBehindTransparentWindowL()
-	{
-	const TInt KNumberOfWindows = 3;
-	CRedrawWin* win[KNumberOfWindows];
-	TRect rect(iWindowRect);
-	rect.Resize(-iWindowRect.Width()/3,-iWindowRect.Height()/3);
-	rect.Move(iWindowRect.Width()/10,iWindowRect.Height()/5);
-	TRect rectWin[KNumberOfWindows];
-	
-	for (TInt ii=0; ii<KNumberOfWindows; ++ii)		//Causes memory leakage under OOM
-		{
-		rectWin[ii] = rect;
-		win[ii]=new(ELeave) CRedrawWin(this);
-		win[ii]->ConstructExtLD(*TheClient->iGroup,rectWin[ii].iTl,rectWin[ii].Size());
-		win[ii]->AssignGC(*TheClient->iGc);
-		win[ii]->Win()->EnableRedrawStore(EFalse);
-		win[ii]->BaseWin()->SetRequiredDisplayMode(EColor16MA);
-		if (ii==0)
-			{
-			win[ii]->Win()->SetBackgroundColor(TRgb(200,0,0,255));
-			}
-		else
-			{
-			TEST(KErrNone == win[ii]->Win()->SetTransparencyAlphaChannel());
-			if (iStep->TestStepResult() != EPass)
-				{
-				INFO_PRINTF1(_L("Transparency Alpha channel failed to be enabled"));
-				}
-			win[ii]->Win()->SetBackgroundColor(TRgb(40,100,0,0)); //RGB colour is of minor importance, as the window is fully transparent (Alpha=0)
-			}
-		win[ii]->Activate();
-
-		//Make sure each window is drawn to the screen now when the new background 
-		//colour have been set but before the call to SetFaded
-		win[ii]->Win()->BeginRedraw();
-		win[ii]->Win()->EndRedraw();
-		
-		rect.Resize(0,-iWindowRect.Height()/10);
-		rect.Move(iWindowRect.Width()/10,iWindowRect.Height()/20);
-		}
-	TheClient->iWs.Flush();
-	TheClient->iWs.Finish();
-	
-	win[0]->Win()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
-	win[1]->Win()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
-	win[2]->Win()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
-	
-	TheClient->iWs.Flush();
-	TheClient->iWs.Finish();
-	
-	// As the windows ovelap on their left side, compare the top left corners of the faded windows in order to verify that 
-	// for the opaque window the directly on top faded area and the faded area under the transparent window (the area that 
-	// overlaps with the transparent windows) have the same colour.
-	TRgb rgbWin[KNumberOfWindows];
-	TheClient->iScreen->GetPixel(rgbWin[0], rectWin[0].iTl);
-	TheClient->iScreen->GetPixel(rgbWin[1], rectWin[1].iTl);
-	TheClient->iScreen->GetPixel(rgbWin[2], rectWin[2].iTl);
-	
-	TEST( ETrue == (rgbWin[0].Red()==rgbWin[1].Red())&&(rgbWin[0].Green()==rgbWin[1].Green())&&(rgbWin[0].Blue()==rgbWin[1].Blue()) );
-	TEST( ETrue == (rgbWin[0].Red()==rgbWin[2].Red())&&(rgbWin[0].Green()==rgbWin[2].Green())&&(rgbWin[0].Blue()==rgbWin[2].Blue()) );
-	
-	for (TInt ii=0; ii<KNumberOfWindows; ++ii)
-		{
-		delete win[ii];
-		}
-	}
-
-#define BACKUPWIN 11
-#define REDRAWWIN 20
-void CTFade::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	((CTFadeStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(++iTest->iState)
-		{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0218
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test fading colours in windows
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Fade the colours in windows and check they fade correctly
-
-@SYMTestExpectedResults Colour fade correctly
-*/
-	case 1:
-		((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0218"));
-		iTest->LogSubTest(_L("Color Check"));
-		CreateBlankWindowL();
-		ColorTest();
-		//iTest->iState=5;
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0219
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test fading in a blank window
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Fade in a blank window and check the fading occurs correctly
-
-@SYMTestExpectedResults Fading in a blank window occurs correctly
-*/
-	case 2:
-		((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0219"));
-		iTest->LogSubTest(_L("Blank Window"));
-		BlankWindowL();
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0220
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test fading in child windows
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Fade in child windows and check the fading occurs correctly
-
-@SYMTestExpectedResults Fading in the child windows occurs correctly
-*/
-	case 3:
-		((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0220"));
-		iTest->LogSubTest(_L("Fade Children"));
-		FadeChildrenL();
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0221
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test fading in newly created child windows
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Fade in newly created child windows and check the fading occurs correctly
-
-@SYMTestExpectedResults Fading in the newly created child windows occurs correctly
-*/
-	case 4:
-		((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0221"));
-		iTest->LogSubTest(_L("Fade Children newly created"));
-		FadeChildrenAfterNewChildIsCreatedL();
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0222
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test fading in window behind another window
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Fade in window behind another window and check the fading occurs correctly
-
-@SYMTestExpectedResults Fading in window occurs correctly
-*/
-	case 5:
-		((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0222"));
-		iTest->LogSubTest(_L("Fade Behind"));
-		FadeBehindL();
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0223
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test differnt fading techniques in a window
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Fade using different fading techniques in a window
-					and check the fading occurs correctly
-
-@SYMTestExpectedResults Fading in window occurs correctly
-*/
-	case 6:
-		((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0223"));
-#if(defined(__DISPLAY_MODE_64K_COLOR))  //The test case Alternative Fadings1&2 & System Fade are not executed for EColor64k
-		iTest->LogSubTest(_L("Alternative Fadings1"));
-		ColorTest2();
-#else
-		LOG_MESSAGE(_L("Alternative Fadings1 test not run"));
-#endif
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0224
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test differnt fading techniques in a window
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Fade using different fading techniques in a window
-					and check the fading occurs correctly
-
-@SYMTestExpectedResults Fading in window occurs correctly
-*/
-	case 7:
-		((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0224"));
-#if(defined(__DISPLAY_MODE_64K_COLOR))  //The test case Alternative Fadings1&2 & System Fade are not executed for EColor64k
-		iTest->LogSubTest(_L("Alternative Fadings2"));
-		FadeTest();
-#else
-		LOG_MESSAGE(_L("Alternative Fadings2 test not run"));
-#endif
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0225
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test differnt system wide fading techniques in a window
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Fade using different system wide fading techniques in a window
-					and check the fading occurs correctly
-
-@SYMTestExpectedResults Fading in system occurs correctly
-*/
-	case 8:
-		((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0225"));
-		iTest->LogSubTest(_L("System Fade"));
-		SystemFadeL();
-		SystemAlternateFadeL();
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0226
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test fading in window behind another window when the window has been moved
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Fade in window behind another window and check the fading occurs correctly
-
-@SYMTestExpectedResults Fading in window occurs correctly
-*/
-	case 9:
-		((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0226"));
-		iTest->LogSubTest(_L("Fade behind moved"));
-		FadeBehindWhenMovedL();
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0227
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Destroy the blnk window used for fading
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Destroy the blnk window used for fading and check it was deleted correctly
-
-@SYMTestExpectedResults The window is destroyed
-*/
-	case 10:
-		((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0227"));
-		DestroyBlankWindow();
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0228
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test backup window creation and drawing
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Create a backup window and draw in it
-
-@SYMTestExpectedResults The drawing is correct in the window
-*/
-	case BACKUPWIN:
-		((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0228"));
-		iTest->LogSubTest(_L("BackupWin Draw"));
-		CreateBitmapsL();
-		CreateBackupWindowL(EFalse);
-		Draw();
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0229
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test fading with backup window obscured
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Test fading with the backup window obscured
-
-@SYMTestExpectedResults Fading occurs correctly with window obscured
-*/
-	case BACKUPWIN+1:
-	((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0229"));
-		iTest->LogSubTest(_L("BackupWin Obscured"));
-		ObscuredL();
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0230
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test fading with backup window being moved
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Test fading with the backup window being moved
-
-@SYMTestExpectedResults Fading occurs correctly with window moved
-*/
-	case BACKUPWIN+2:
-	((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0230"));
-		iTest->LogSubTest(_L("BackupWin Moving"));
-		MovingL();
-		DestroyDrawableWindow();
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0231
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test backup window creation and drawing
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Create a backup window and draw in it
-
-@SYMTestExpectedResults The drawing is correct in the window
-*/
-	case BACKUPWIN+3:
-	((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0231"));
-		iTest->LogSubTest(_L("BackupWin Draw"));
-		CreateBackupWindowL(ETrue);
-		Draw();
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0232
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test fading with backup window obscured
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Test fading with the backup window obscured
-
-@SYMTestExpectedResults Fading occurs correctly with window obscured
-*/
-	case BACKUPWIN+4:
-	((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0232"));
-		iTest->LogSubTest(_L("BackupWin Obscured"));
-		ObscuredL();
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0233
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test fading with backup window being moved
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Test fading with the backup window being moved
-
-@SYMTestExpectedResults Fading occurs correctly with window moved
-*/
-	case BACKUPWIN+5:
-	((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0233"));
-		iTest->LogSubTest(_L("BackupWin Moving"));
-		MovingL();
-		DestroyDrawableWindow();
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0234
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test redraw window creation and drawing
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Create a redraw window and draw in it
-
-@SYMTestExpectedResults The drawing is correct in the window
-*/
-	case REDRAWWIN:
-		((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0234"));
-		iTest->LogSubTest(_L("RedrawWin Draw"));
-		CreateRedrawWindowL();
-		Draw();
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0235
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test fading with redraw window obscured
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Test fading with the redraw window obscured
-
-@SYMTestExpectedResults Fading occurs correctly with window obscured
-*/
-	case REDRAWWIN+1:
-	((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0235"));
-		iTest->LogSubTest(_L("RedrawWin Obscured"));
-		ObscuredL();
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0236
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test fading with redraw window being moved
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Test fading with the redraw window being moved
-
-@SYMTestExpectedResults Fading occurs correctly with window moved
-*/
-	case REDRAWWIN+2:
-	((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0236"));
-		iTest->LogSubTest(_L("RedrawWin Moving"));
-		MovingL();
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0237
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test different fading techniques within a redraw window
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Test different fading techniques within a redraw window
-
-@SYMTestExpectedResults Fading occurs correctly for the different techniques
-*/
-	case REDRAWWIN+3:
-	((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0237"));
-		iTest->LogSubTest(_L("AlternativeFadeDraw"));
-		Draw(ETrue);
-		break;
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0238
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test fading within a redraw window using the graphic context
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Test fading within a redraw window using the graphic context
-
-@SYMTestExpectedResults Fading occurs correctly in the window
-*/
-	case REDRAWWIN+4:
-		((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0238"));
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-		iTest->LogSubTest(_L("GC Test"));
-		GCDraw();
-		DestroyDrawableWindow();
-		DestroyBitmaps();
-#endif
-		break;
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0538
-
-@SYMDEF             DEF120965
-
-@SYMTestCaseDesc    Test fading under transparent window
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Construct opaque window lying under two transparent windows. Fade the opaque and the transparent windows.
-
-@SYMTestExpectedResults Each of the overlapping areas should be faded only once.
-*/
-	case REDRAWWIN+5:
-		{
-		((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0538"));
-		iTest->LogSubTest(_L("Fade behind transparent window"));
-		CRedrawWin* win = new(ELeave) CRedrawWin(this);
-		win->ConstructL(TRect(0,0,0,0));
-		TInt transparency = win->Win()->SetTransparencyAlphaChannel(); 
-		if (transparency!=KErrNotSupported)
-			{
-			FadeBehindTransparentWindowL();
-			}
-		else
-			{
-			WARN_PRINTF1(_L("Transparency not supported. Skipping test."));
-			}
-		delete win;
-		break;
-		}
-	case REDRAWWIN+6:
-		((CTFadeStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-		iTest->LogSubTest(_L("Test complete\n"));
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-		DestroyDrawableWindow();
-		DestroyBitmaps();
-#endif
-		((CTFadeStep*)iStep)->CloseTMSGraphicsStep();
-		TestComplete();
-		break;
-	default:
-		((CTFadeStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-		break;
-		}
-	((CTFadeStep*)iStep)->RecordTestResultL();
-	}
-
-__WS_CONSTRUCT_STEP__(Fade)
--- a/windowing/windowserver/tauto/TFADE.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TFADE_H__
-#define __TFADE_H__
-
-#include "AUTO.H"
-
-#if defined(__MARM__)
-	#define SMALL_RECTS
-#endif
-#define SIZE_X 10
-#define SIZE_Y 5
-#define DRAW_MODE EColor64K		//Mode used for testing fadded drawing
-#define BLACK_NORMAL 128
-#define WHITE_NORMAL 255
-#define BLACK_ALTERNATE 0
-#define WHITE_ALTERNATE 127
-#define NUMBER_OF_WINDOWS	16
-
-#define MODE_LT_64K(mode)	(TDisplayModeUtils::NumDisplayModeColors(mode)<65536)
-
-#define ETrue	1
-#define EFalse	0
-
-class CTFade : public CTWsGraphicsBase
-	{
-public:
-	CTFade(CTestStep* aStep);
-	~CTFade();
-	void ConstructL();
-	TInt Content();
-	void Drawing(TInt aDrawFunc, CBitmapContext *gc);
-	//Different Tests
-	void ColorTest();
-	void BlankWindowL();
-	void FadeChildrenL();
-	void FadeChildrenAfterNewChildIsCreatedL();
-	void FadeBehindL();
-	void ColorTest2();
-	void FadeTest();
-	void Draw(TBool aAlternativeFade=EFalse);
-	void ObscuredL();
-	void MovingL();
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-	void GCDraw();
-#endif
-	void SystemFadeL();
-	void SystemAlternateFadeL();
-	void FadeBehindWhenMovedL();
-	void FadeBehindTransparentWindowL();
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	void CreateBlankWindowL();
-	void DestroyBlankWindow();
-	void CreateBackupWindowL(TBool aMaintainBackup);
-	void CreateRedrawWindowL();
-	void DestroyDrawableWindow();
-	void CreateBitmapsL();
-	void DestroyBitmaps();
-	void Draw(TInt aDrawFunc, TAny *aParam, TBool aAlternativeFade=EFalse, TBool aFade=EFalse);
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-	void GCDraw(TInt aDrawFunc, TAny *aParam, TBool aAlternativeFade=EFalse);
-#endif
-	void Draw(TInt aDrawFunc, TAny *aParam, CBitmapContext *gc);
-	void CompareWithBitmap(TBool aFade);
-	void CompareWindows(TBool aAlternativeFade=EFalse);
-	void TestStrips(TRect aRect,TInt aHeight,TInt aNumNotFaded,TBool aInvert=EFalse);
-	void TestBlocks(TRect aRect,TSize aSize,TInt aNumNotFaded,TBool aInvert=EFalse);
-	TInt Fade4(TInt aGray4);
-	TInt Fade16(TInt aGray16);
-	TRgb FadeRgb(TRgb aColor);
-	TRgb FadeRgb(TRgb aColor, TInt aFadeMapFactor, TInt aFadeMapOffset);
-	inline void ViewDelay();
-private:
-	CTBlankWindow* iBlankWin;
-	CTDrawableWin* iWin;
-	TBool iOwnWindow;
-	TRect iWindowRect;
-	TRect iBaseRect;
-	CFbsBitmap iNormalBitmap;
-	CFbsBitmap iFadedBitmap;
-	CFbsBitGc *iNormalBitGc;
-	CFbsBitGc *iFadedBitGc;
-	CFbsDevice *iNormalBitmapDevice;
-	CFbsDevice *iFadedBitmapDevice;
-	TInt iContent;
-	TDisplayMode iBaseWinMode;
-	TDisplayMode iDeviceDisplayMode;
-	TSize iTestWinSize;
-	TDisplayMode iFadeDrawMode;
-	CFbsBitmap *iTestWinCopy;
-	CFbsBitmap *iCheckWinCopy;
-#if defined (__MARM_THUMB__)
-GLDEF_D TBool CanFade;
-GLDEF_D TBool CanFadeSet;
-#endif
-	};
-
-class CRedrawWin : public CTWin
-	{
-public:
-	CRedrawWin(CTFade *aTest);
-	void ConstructL(TRect aArea);
-	~CRedrawWin();
-	void Draw();
-	
-protected:
-	CTFade* iTest;
-	};
-
-class CTFadeStep : public CTGraphicsStep
-	{
-public:
-	CTFadeStep();
-protected:
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTFadeStep,"TFade");
-
-
-#endif
--- a/windowing/windowserver/tauto/TFADINGBITMAP.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,250 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// The fix enables the fading effect with alpha-blending, which was not applied bofore.
-// The test will load a bitmap and two different masks: on/off and alpha-blend.
-// The bitmap will be masked with these masks and displayed before and after
-// setting the fading effect.
-// All different colour modes are being tested for both mask types.
-// The test will check the colour of a specific pixel in the scene before and after the
-// fading. The higher values in the After circle means that it has been highlighted.
-// The result will be printed in wstest log file.
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TFADINGBITMAP.H"
-
-//===================================================
-// CBaseWin Declaration
-//===================================================
-
-CBaseWin::CBaseWin(): CTWin()
-	{
-	}
-
-CBaseWin::~CBaseWin()
-	{
-	delete iTempBitmap;
-	delete iMaskGray256;
-	delete iMaskGray2;
-	delete iTempMask;
-	delete iBitmap;
-	}
-
-void CBaseWin::ConstructWinL(TPoint aPos, TSize aSize, TBool aVisible)
-	{	
-	/*** Setting up the window ***/
-	iSize = aSize;
-	SetUpL(aPos, aSize, TheClient->iGroup, *TheClient->iGc, aVisible);
-	Win()->SetBackgroundColor(TRgb(20, 80, 20));	// dark green background
-	BaseWin()->SetRequiredDisplayMode(EColor64K);
-
-	/*** 24 bit bitmap ***/
-	// the original 24b bitmap to mask
-	iTempBitmap = new (ELeave) CFbsBitmap();
-	User::LeaveIfError(iTempBitmap->Load(_L("Z:\\WSTEST\\WSAUTOTEST.MBM"), EMbmWsautotestCircles24b));
-	iBitmap = new (ELeave) CFbsBitmap();
-
-	/*** on/off mask ***/
-	iMaskGray2 = new (ELeave) CFbsBitmap();
-	User::LeaveIfError(iMaskGray2->Load(_L("Z:\\WSTEST\\WSAUTOTEST.MBM"), EMbmWsautotestCircles_mask2b));
-
-	/*** alpha-blend mask ***/
-	// holds the 24bit copy of the alpha blend mask which will be 
-	// copied into the proper Gray256 mask, iMaskGray256.
-	iTempMask = new (ELeave) CFbsBitmap();
-	User::LeaveIfError(iTempMask->Load(_L("Z:\\WSTEST\\WSAUTOTEST.MBM"), EMbmWsautotestCircles_mask256));	
-	// alpha blend mask; copying its data from iTempMask
-	iMaskGray256 = new (ELeave) CFbsBitmap();
-	User::LeaveIfError(iMaskGray256->Create(iTempBitmap->SizeInPixels(),EGray256));
-	CFbsBitmapDevice *dev = CFbsBitmapDevice::NewL(iMaskGray256);
-	CleanupStack::PushL(dev);
-	CFbsBitGc *gc;
-	User::LeaveIfError(dev->CreateContext(gc));
-	// performing the copying here
-	gc->BitBlt(TPoint(0,0), iTempMask);
-	// cleaning up
-	CleanupStack::Pop();
-	delete gc;
-	gc = NULL;	
-	delete dev;
-	dev = NULL;	
-	}
-
-void CBaseWin::Draw()
-	{
-	iGc->Clear();
-
-	// Font intialization
-	CFont* myFont;    	
-	_LIT(KMyFontName,"Swiss");
-	TFontSpec myFontSpec = TFontSpec(KMyFontName,16); // to get smallest Swiss font
-	TFontStyle style = TFontStyle (EPostureUpright, EStrokeWeightBold,   EPrintPosNormal);
-	myFontSpec.iFontStyle = style;
-	User::LeaveIfError(TheClient->iScreen->GetNearestFontInPixels(myFont, myFontSpec));
-	iGc->UseFont(myFont);
-	iGc->SetPenStyle(CGraphicsContext::ESolidPen);
-	iGc->SetPenColor(TRgb(255, 255, 255));
-	
-	// drawing text
-	iGc->DrawText(_L("Fading = OFF"), TPoint(130,15));
-	iGc->DrawText(_L("Fading = ON"),  TPoint(275,15));
-	iGc->DrawText(_L("Alpha blend"), TPoint(15,90));
-	iGc->DrawText(_L("on/off mask"),  TPoint(15,190));
-	TBuf <30> displayMode(_L("Display Mode = "));
-	displayMode.Append(iMode);	
-	iGc->DrawText(displayMode, TPoint(385,100));		
-	
-	/*** drawing bitmap with its on/off mask and alpha-blending 
-		 before and after fading ***/
-	iGc->BitBltMasked(TPoint(140,25), iBitmap, 
-						   TRect(0,0,100,100), iMaskGray256, EFalse);	
-	// Save the pixel colour of a pixel on the outer ring of the circle 
-	// before fading enabled.
-	TheClient->iScreen->GetPixel(iNonFadedPixel, TPoint(190,30));	
-
-	iGc->SetFaded(ETrue);
-	iGc->BitBltMasked(TPoint(270,25), iBitmap, 
-						   TRect(0,0,100,100), iMaskGray256, EFalse);
-	// Save the pixel colour of a pixel on the outer ring of the circle 
-	// after fading enabled.
-	TheClient->iScreen->GetPixel(iFadedPixel, TPoint(320,30));	
-
-	iGc->SetFaded(EFalse);
-	
-	iGc->BitBltMasked(TPoint(140,125), iBitmap, 
-						   TRect(0,0,100,100), iMaskGray2, EFalse);
-	iGc->SetFaded(ETrue);
-	iGc->BitBltMasked(TPoint(270,125), iBitmap, 
-						   TRect(0,0,100,100), iMaskGray2, EFalse);
-	iGc->SetFaded(EFalse);
-
-	iGc->DiscardFont();
-	TheClient->iScreen->ReleaseFont(myFont);
-	}
-
-
-//===================================================
-// CTFadingBitmap Definition
-//===================================================
-
-CTFadingBitmap::CTFadingBitmap(CTestStep* aStep):
-	CTWsGraphicsBase(aStep), iTestResult(ETrue)
-	{
-	}
-
-CTFadingBitmap::~CTFadingBitmap()
-	{
-	delete iBgWin;
-	}
-
-void CTFadingBitmap::TestFadingL()
-	{
-	// Modes to test
-	TDisplayMode modes[] = 
-		{
-		EGray2, EGray4, EGray16, EGray256, 
-		EColor16, EColor256, EColor4K, EColor64K, 
-		EColor16M, EColor16MU, EColor16MA, EColor16MAP   
-		};
-	
-	TBuf <12> modesTxt []= 
-		{
-		_L("EGray2"), _L("EGray4"), _L("EGray16"), _L("EGray256"), 
-		_L("EColor16"), _L("EColor256"), _L("EColor4K"), _L("EColor64K"), 
-		_L("EColor16M"), _L("EColor16MU"), _L("EColor16MA"), _L("EColor16MAP")
-		};
-	
-	TBuf <100> testTxt;		 
-	for( int i = 0; i < 12; i++)
-		{
-		testTxt.Format(modesTxt[i]);
-		INFO_PRINTF1(testTxt);
-		// Here we copy the content of the temp bitmap, which holds the test bitmap,
-		// into the bitmap created with alternating color depths.
-		User::LeaveIfError(iBgWin->iBitmap->Create(iBgWin->iTempBitmap->SizeInPixels(), modes[i]));
-		CFbsBitmapDevice *dev = CFbsBitmapDevice::NewL(iBgWin->iBitmap);
-		CleanupStack::PushL(dev);
-		CFbsBitGc *gc;
-		User::LeaveIfError(dev->CreateContext(gc));
-		// performing the copying here
-		gc->BitBlt(TPoint(0,0), iBgWin->iTempBitmap);
-		// setting the mode text to display it
-		iBgWin->iMode = modesTxt[i];
-		// draws the bitmap on screen 
-		iBgWin->DrawNow();
-		TheClient->Flush();
-		User::After(5000);
-		// cleaning up		
-		CleanupStack::Pop();
-		delete gc;
-		gc = NULL;	
-		delete dev;
-		dev = NULL;		
-		
-		// Here the colours of pixels before and after fading are printed in wstest log
-		testTxt.Format(_L("Nonfaded circle - color of the outside ring: R=%d G=%d B=%d"), iBgWin->iNonFadedPixel.Red(), iBgWin->iNonFadedPixel.Green(), iBgWin->iNonFadedPixel.Blue());
-		INFO_PRINTF1(testTxt);
-		testTxt.Format(_L("Faded circle  - color of the outside ring: R=%d G=%d B=%d"), iBgWin->iFadedPixel.Red(), iBgWin->iFadedPixel.Green(), iBgWin->iFadedPixel.Blue());
-		INFO_PRINTF1(testTxt);
-		
-		// Checks if the colors are the same before and after the fading.
-		// The color will be the same only in EGray2 and EGray4 as there are no enough 
-		// color variations to represent the fading and nonfading effects.
-		if(iTestResult &&
-		   iBgWin->iNonFadedPixel.Red()   == iBgWin->iFadedPixel.Red() &&
-		   iBgWin->iNonFadedPixel.Green() == iBgWin->iFadedPixel.Green() &&
-		   iBgWin->iNonFadedPixel.Blue()  == iBgWin->iFadedPixel.Blue() &&
-		   modes[i] != EGray2 && modes[i] != EGray4)
-			iTestResult = EFalse;
-		}
-	}
-
-void CTFadingBitmap::ConstructL()
-	{
-	// construct the base window of the test in the background
-	TSize scrSize = TSize(TheClient->iScreen->SizeInPixels());
-	iBgWin = new (ELeave) CBaseWin();
-	iBgWin->ConstructWinL(TPoint(0,0), scrSize, ETrue);	
-	}
-
-void CTFadingBitmap::RunTestCaseL(TInt aCurTestCase)
-	{
-    	((CTFadingBitmapStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(aCurTestCase)
-		{
-		case 1:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0566
-*/
-            		((CTFadingBitmapStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0566"));
-			TestFadingL();
-			// Fails or passes the test
-			if(!iTestResult)
-				TEST(EFalse);
-			break;
-		default:
-            		((CTFadingBitmapStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTFadingBitmapStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-		}
-	((CTFadingBitmapStep*)iStep)->RecordTestResultL();
-	}
-
-__WS_CONSTRUCT_STEP__(FadingBitmap)
--- a/windowing/windowserver/tauto/TFADINGBITMAP.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TFADINGBITMAP_H__
-#define __TFADINGBITMAP_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-
-//===================================================
-// CBaseWin Definition
-// The plain green background window
-//===================================================
-
-class CBaseWin : public CTWin
-	{
-public:
-	CBaseWin();
-	~CBaseWin();
-	void Draw();
-	void ConstructWinL(TPoint, TSize, TBool);
-
-public:
-	CFbsBitmap *iTempBitmap;
-	CFbsBitmap *iMaskGray256;
-	CFbsBitmap *iMaskGray2;
-	CFbsBitmap *iTempMask;
-	CFbsBitmap *iBitmap;
-	
-	TRgb iFadedPixel;
-	TRgb iNonFadedPixel;
-
-	TBuf <11> iMode;
-	};
-
-
-//===================================================
-// CTFadingBitmap Definition
-// Bitmaps to be tested
-//===================================================
-
-class CTFadingBitmap : public CTWsGraphicsBase
-	{
-public:
-	CTFadingBitmap(CTestStep* aStep);
-	~CTFadingBitmap();
-	/*Sets the windowing environment,*/
-	void ConstructL();
-
-protected:
-	//from 	CTGraphicsStep - Calls the fading bitmap test.
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	void TestFadingL ();
-
-private:
-	CBaseWin *iBgWin;
-	TBool iTestResult;
-	};
-
-class CTFadingBitmapStep : public CTGraphicsStep
-	{
-public:
-	CTFadingBitmapStep();
-protected:
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTFadingBitmapStep,"TFadingBitmap");
-
-#endif
--- a/windowing/windowserver/tauto/TFLICKERFREE.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// TMULSCREENS.CPP
-// Tests the newly API function added to RWindow which enables/disables
-// the usage of Off-Screen Bitmap (OSB).
-// The test will draw squares with random colours on screen filling the
-// whole drawable area. The drawing will start first with flickering screen
-// and will switch to flicker free in 4 seconds.
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TFLICKERFREE.H"
-
-//===================================================
-// CBGWin Declaration
-//===================================================
-
-CBGWin::CBGWin(): CTWin()
-	{
-	}
-
-CBGWin::~CBGWin()
-	{
-	}
-
-void CBGWin::ConstructWin(TPoint aPos, TSize aSize, TBool aVisible)
-	{
-	iSize = aSize;
-	SetUpL(aPos,iSize,TheClient->iGroup,*TheClient->iGc, aVisible);
-	BaseWin()->SetRequiredDisplayMode(EColor256);
-	}
-
-void CBGWin::Draw()
-	{
-	iGc->Clear();
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-
-	TUint propW = iSize.iWidth/32;
-	TUint propH = iSize.iHeight/12;
-
-	for(TInt i = 0; i < iSize.iWidth ; i+=propW)
-		{
-		for(TInt j = 0; j < iSize.iHeight; j+=propH)
-			{
-			iGc->SetBrushColor(TRgb( (TInt)(Math::Random()%255), (TInt)(Math::Random()%255), (TInt)(Math::Random()%255) ));
-			iGc->DrawRect(TRect(i, j, i+propW-1, j+propH-1));
-			}
-		}
-	}
-
-void CBGWin::EnableOSBd(TBool aState)
-	{
-	iWin.EnableOSB(aState);
-	}
-
-//===================================================
-// CFlickerTest Declaration
-//===================================================
-
-/* This function will be called periodically to draw the rects
-   on screen.*/
-void CTFlickerFree::TestFlickering()
-	{
-	for( int i = 0; i < 40; ++i)
-		{
-		// for the first 3 seconds draw with flicker
-		if(i < 20 )
-			iBgWin->EnableOSBd(EFalse);
-		// for the next 3 seconds draw with flicker free
-		else if(i >=20 )
-			iBgWin->EnableOSBd(ETrue);
-
-		iBgWin->DrawNow();
-
-		// this draws 20 frames per second for 4 seconds
-		User::After(50000);
-		}
-	}
-
-CTFlickerFree::CTFlickerFree(CTestStep* aStep):
-	CTWsGraphicsBase(aStep)
-	{
-	}
-
-CTFlickerFree::~CTFlickerFree()
-	{
-	delete iBgWin;
-	}
-
-void CTFlickerFree::ConstructL()
-	{
-	// get the size of the current client to assign it to the background window
-	TSize scrSize = TSize(TheClient->iScreen->SizeInPixels());
-
-	// construct the window in the background
-	iBgWin = new (ELeave) CBGWin();
-	iBgWin->ConstructWin(TPoint(0,0), scrSize, ETrue);
-	}
-
-/* Sets the windowing environment, constructs the CPeriod object and
-	starts the CPeriod object.*/
-void CTFlickerFree::RunTestCaseL(TInt aCurTestCase)
-	{
-	((CTFlickerFreeStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(aCurTestCase)
-		{
-		case 1:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0567
-*/
-			((CTFlickerFreeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0567"));
-			TestFlickering();
-			break;
-		default:
-			((CTFlickerFreeStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTFlickerFreeStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-		}
-	((CTFlickerFreeStep*)iStep)->RecordTestResultL();
-	}
-
-__WS_CONSTRUCT_STEP__(FlickerFree)
--- a/windowing/windowserver/tauto/TFLICKERFREE.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Tests the usage of Off-Screen Bitmap
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TFLICKERFREE_H__
-#define __TFLICKERFREE_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include <e32math.h>    //to include math finction rand()
-#include "TGraphicsHarness.h"
-
-//===================================================
-// CBGWin Definition
-//===================================================
-
-class CBGWin : public CTWin
-	{
-public:
-	CBGWin();
-	~CBGWin();
-	/*Draws and colors the rectagles that are to fill the screen.*/
-	void Draw();
-	void ConstructWin(TPoint, TSize, TBool);
-	void EnableOSBd(TBool);
-	};
-
-
-//===================================================
-// CFlickerTest Definition
-//===================================================
-class CTFlickerFree : public CTWsGraphicsBase
-	{
-public:
-	CTFlickerFree(CTestStep* aStep);
-	~CTFlickerFree();
-	/*Sets the windowing environment,*/
-	void ConstructL();
-
-protected:
-//from 	CTGraphicsStep - Calls the flicker-drawing test.
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	/*Starts first with flickering screen and after 4 senconds it
-	  switches to flicker free drawing.*/
-	void TestFlickering();
-
-private:
-	CBGWin *iBgWin;
-	};
-
-class CTFlickerFreeStep : public CTGraphicsStep
-	{
-public:
-	CTFlickerFreeStep();
-protected:
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTFlickerFreeStep,"TFlickerFree");
-
-#endif
--- a/windowing/windowserver/tauto/TGDI.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1289 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// GDI.CPP
-// Test GDI functions
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TGDI.H"
-
-#define TAUTO_BITMAP_NAME _L("Z:\\WSTEST\\TAUTO.MBM")
-
-//#define LOGGING on		//Uncomment this line to get extra test logging - useful if debugging a failure of one of the tests
-
-typedef CGdiTestLowLevel *(*GdiTestFunc)();
-
-_LIT(KMonospaceTestFontTypefaceName,"Arial");
-const TInt KMaxFontSize = 200;
-
-static inline TBool IsLengthEqual(TInt aLLen, TInt aRLen, TInt aBbLen)
-	{
-// The bounding box of a 'w' is one pixel wider than it should be. W overlaps in to the bounding box of 'x' as the two  
-// are stuck together. So add a tolerance of -1.
-	return (((aLLen+aRLen)==aBbLen) || ((aLLen+aRLen-1)==aBbLen));
-	}
-
-struct GdiTest
-	{
-	GdiTestFunc func;
-	const TText *txt;
-	};
-
-GdiTest GdiTestFuncs[]={
-	{BoxTextTest,_S("BoxText")},
-	{VertTextTest,_S("VertText")},
-	/*{JustifiedTextTest,_S("JustifiedText")},*/ // DEF107985 The test for JustifiedText has been removed as it was a bad/useless test
-	{VertBoxTextTest,_S("VertBoxText")},
-	{SetOriginTest,_S("SetOrigin")},
-	{PolyLineTest,_S("PolyLine")},
-	{PolygonTest,_S("Polygon")},
-	{DrawArcTest,_S("DrawArc")},
-	{DrawPieTest,_S("DrawPie")},
-	{DrawRoundRectTest,_S("DrawRoundRect")},
-	{WideLineTest,_S("WideLine")},
-	{DrawTextTest,_S("DrawText")},
-	{DrawRectTest,_S("DrawRect")},
-	};
-
-CTestWindow::CTestWindow(TRgb aCol) : CBlankWindow(aCol)
-	{
-	}
-
-CTestWindow::~CTestWindow()
-	{
-	}
-
-void CTestWindow::ConstructL(TPoint aPos,TSize aSize,CTWinBase* aParent, CWindowGc& aGc)
-	{
-	iWin=RWindow(TheClient->iWs);
-	User::LeaveIfError(iWin.Construct(*(aParent->WinTreeNode()),ENullWsHandle));
-	SetExt(aPos,aSize);
-	Activate();
-	AssignGC(aGc);
-	}
-
-void CGdiTestLowLevel::SetGdiTest(CTGdi *aGdiTest)
-	{
-	iGdiTest=aGdiTest;
-	}
-
-void CGdiTestLowLevel::AssignGdi(CWindowGc *aGc)
-	{
-	iGdi=aGc;
-	}
-
-void CGdiTestLowLevel::ConstructL(TInt)
-	{
-	}
-
-void CGdiTestLowLevel::PreTestSetupL(const TRect &,TInt)
-	{
-	}
-
-//=======================================//
-// Individual GDI low level test classes //
-//=======================================//
-
-
-void CGdiRect::ConstructL(TInt)
-	{
-	}
-
-void CGdiRect::PreTestSetupL(const TRect &, TInt aCount)
-	{
-	iBrushCol=TRgb::Gray256(aCount&0x1 ? 0xFF : 0x60);
-	iPenCol=TRgb::Gray256(aCount&0x1 ? 0xA0 : 0x0);
-	}
-
-TInt CGdiRect::Count(TBool )
-	{
-	return(1);
-	}
-
-void CGdiDrawRect::BaseTest(const TRect &aRect, TInt aCount)
-	{
-	TheTest(aRect,aCount);
-	}
-
-void CGdiDrawRect::TheTest(const TRect &aRect, TInt)
-	{
-	iGdi->SetBrushColor(iBrushCol);
-	iGdi->SetPenColor(iPenCol);
-	iGdi->DrawRect(aRect);
-	}
-
-TInt CGdiDrawRect::Count(TBool aMode)
-	{
-	return(aMode ? 4:1);
-	}
-
-TInt CGdiDrawRoundRect::Count(TBool aMode)
-	{
-	return(aMode ? 4:1);
-	}
-
-void CGdiDrawRoundRect::BaseTest(const TRect &aRect, TInt aCount)
-	{
-	TheTest(aRect,aCount);
-	}
-
-void CGdiDrawRoundRect::TheTest(const TRect &aRect, TInt aCount)
-	{
-	iGdi->SetBrushColor(iBrushCol);
-	iGdi->SetPenColor(iPenCol);
-	TSize size((aRect.iBr.iX-aRect.iTl.iX)/4,(aRect.iBr.iY-aRect.iTl.iY)/4);
-	switch(aCount)
-		{
-		case 0:
-			size.SetSize((aRect.iBr.iX-aRect.iTl.iX)/4,(aRect.iBr.iY-aRect.iTl.iY)/4);
-			break;
-		case 1:
-			size.SetSize(0,0);
-			break;
-		case 2:
-			size.SetSize((aRect.iBr.iX-aRect.iTl.iX)/2,(aRect.iBr.iY-aRect.iTl.iY)/2);
-			break;
-		case 3:
-			size.SetSize((aRect.iBr.iX-aRect.iTl.iX),(aRect.iBr.iY-aRect.iTl.iY));
-			break;
-		}
-	iGdi->DrawRoundRect(aRect,size);
-	}
-
-TInt CGdiDrawACP::Count(TBool )
-	{
-	return(1);
-	}
-
-void CGdiDrawACP::ConstructL(TInt)
-	{
-	}
-
-void CGdiDrawACP::PreTestSetupL(const TRect &, TInt )
-	{
-	iBrushCol=TRgb::Gray256(0xff);
-	iPenCol=TRgb(0,0,0);
-	}
-
-void CGdiDrawArc::BaseTest(const TRect &aRect, TInt aCount)
-	{
-	TheTest(aRect,aCount);
-	}
-
-void CGdiDrawArc::TheTest(const TRect &aRect, TInt)
-	{
-	iGdi->SetBrushColor(iBrushCol);
-	iGdi->SetPenColor(iPenCol);
-	TPoint start(aRect.iTl.iX/2+aRect.iBr.iX,aRect.iTl.iY/2+aRect.iBr.iY);
-	iGdi->DrawArc(aRect,start,TPoint(0,0));
-	}
-
-void CGdiDrawPie::BaseTest(const TRect &aRect, TInt aCount)
-	{
-	TheTest(aRect,aCount);
-	}
-
-void CGdiDrawPie::TheTest(const TRect &aRect, TInt)
-	{
-	iGdi->SetBrushColor(iBrushCol);
-	iGdi->SetPenColor(iPenCol);
-	TPoint start(aRect.iTl.iX/2+aRect.iBr.iX,aRect.iTl.iY/2+aRect.iBr.iY);
-	iGdi->DrawPie(aRect,start,TPoint(0,0));
-	}
-
-//
-// Polyline tests
-//
-
-CGdiPolyLine::CGdiPolyLine() : iPnts(5)
-	{}
-
-void CGdiPolyLine::PreTestSetupL(const TRect &aRect, TInt aCount)
-	{
-	iPnts.Reset();
-	TInt wid=aRect.Width();
-	TInt hgt=aRect.Height();
-	if (aCount==0)
-		{
-		TInt pos;
-		for(pos=0;pos<wid;pos+=10)
-			{
-			iPnts.AppendL(TPoint(aRect.iTl.iX+pos,aRect.iTl.iY));
-			iPnts.AppendL(TPoint(aRect.iTl.iX+pos+5,aRect.iBr.iY));
-			}
-		for(pos=0;pos<hgt;pos+=10)
-			{
-			iPnts.AppendL(TPoint(aRect.iTl.iX,aRect.iTl.iY+pos));
-			iPnts.AppendL(TPoint(aRect.iBr.iX,aRect.iTl.iY+pos+5));
-			}
-		}
-	else
-		{
-		TInt hgt=aRect.Height();
-		iPnts.AppendL(TPoint(aRect.iTl.iX,aRect.iTl.iY));
-		iPnts.AppendL(TPoint(aRect.iBr.iX,aRect.iTl.iY+hgt/2));
-		iPnts.AppendL(TPoint(aRect.iTl.iX,aRect.iBr.iY));
-		iPnts.AppendL(TPoint(aRect.iBr.iX,aRect.iBr.iY));
-		iPnts.AppendL(TPoint(aRect.iTl.iX,aRect.iTl.iY+hgt/2));
-		iPnts.AppendL(TPoint(aRect.iBr.iX,aRect.iTl.iY));
-		iPnts.AppendL(TPoint(aRect.iTl.iX,aRect.iTl.iY));
-		}
-	}
-
-void CGdiPolyLine::ConstructL(TInt )
-	{
-	}
-
-TInt CGdiPolyLine::Count(TBool aMainTests)
-	{
-	return(aMainTests ? 2 : 1);
-	}
-
-void CGdiPolyLine::BaseTest(const TRect &, TInt )
-	{
-	TPoint prev;
-	TInt index;
-	for(index=0;index<iPnts.Count();index++)
-		{
-		if (index>0)
-			iGdi->DrawLine(prev,iPnts[index]);
-		prev=iPnts[index];
-		}
-	if (index>0)
-		iGdi->Plot(iPnts[index-1]);
-	}
-
-void CGdiPolyLine::TheTest(const TRect &, TInt )
-	{
-	iGdi->DrawPolyLine(&iPnts);
-	}
-
-//
-// Polygon tests //
-//
-
-CGdiPolygon::CGdiPolygon() : iPnts(5)
-	{}
-
-void CGdiPolygon::PreTestSetupL(const TRect &aRect, TInt )
-	{
-	iPnts.Reset();
-	TPoint pnt;
-	TInt maxPoints=Min((TInt)KMaxPolygonPoints,Min(aRect.Width(),aRect.Height())/KPolygonStep);
-	TInt numPoints=0;
-	if (maxPoints>0)
-		{
-		iPnts.AppendL(aRect.iTl);
-		while(numPoints<maxPoints)
-			{
-			if (numPoints&1)
-				pnt.SetXY(aRect.iTl.iX+(numPoints+1)*KPolygonStep,aRect.iTl.iY+numPoints*KPolygonStep);
-			else
-				pnt.SetXY(aRect.iTl.iX+numPoints*KPolygonStep,aRect.iTl.iY+(numPoints+1)*KPolygonStep);
-			iPnts.AppendL(pnt);
-			numPoints++;
-			}
-		pnt.SetXY(aRect.iTl.iX+numPoints*KPolygonStep,aRect.iTl.iY+numPoints*KPolygonStep);
-		iPnts.AppendL(pnt);
-		while(numPoints>0)
-			{
-			numPoints--;
-			if (numPoints&1)
-				pnt.SetXY(aRect.iTl.iX+numPoints*KPolygonStep,aRect.iTl.iY+(numPoints+1)*KPolygonStep);
-			else
-				pnt.SetXY(aRect.iTl.iX+(numPoints+1)*KPolygonStep,aRect.iTl.iY+numPoints*KPolygonStep);
-			iPnts.AppendL(pnt);
-			}
-		}
-	}
-
-void CGdiPolygon::ConstructL(TInt )
-	{
-	}
-
-TInt CGdiPolygon::Count(TBool aMainTests)
-	{
-	return(aMainTests ? 2 : 1);
-	}
-
-void CGdiPolygon::BaseTest(const TRect &aRect, TInt )
-	{
-	iGdi->SetPenColor(TRgb::Gray4(2));
-	iGdi->SetBrushColor(TRgb::Gray4(1));
-	iGdi->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TInt maxPoints=Min((TInt)KMaxPolygonPoints,Min(aRect.Width(),aRect.Height())/KPolygonStep);
-	for(TInt numPoints=0;numPoints<maxPoints;numPoints++)
-		iGdi->DrawRect(TRect(aRect.iTl.iX+numPoints*KPolygonStep + 1,aRect.iTl.iY+numPoints*KPolygonStep + 1,
-							 aRect.iTl.iX+(numPoints+1)*KPolygonStep ,aRect.iTl.iY+(numPoints+1)*KPolygonStep));
-	}
-
-void CGdiPolygon::TheTest(const TRect &, TInt )
-//This is the only one that can leave so it's not worth adding an 'L'
-	{
-	iGdi->SetPenColor(TRgb::Gray4(2));
-	iGdi->SetBrushColor(TRgb::Gray4(1));
-	iGdi->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	User::LeaveIfError(iGdi->DrawPolygon(&iPnts,CGraphicsContext::EAlternate));
-	}
-
-//
-
-TInt CGdiWideLine::Count(TBool aMainTests)
-	{
-	return(aMainTests ? EMainNumWidths : EMinorNumWidths);
-	}
-
-void CGdiWideLine::ConstructL(TInt)
-	{
-	}
-
-void CGdiWideLine::PreTestSetupL(const TRect &, TInt aCount)
-	{
-	TInt widths[]={1,4,50,-2,
-				   48,12345,0,3,
-				   48,123,0,3,
-				   4,111,555,1000,
-				   10,-1,-10,-100};
-	iWidth=widths[aCount];
-	}
-
-void CGdiWideLine::BaseTest(const TRect &aRect, TInt)
-	{
-	iGdi->SetPenSize(TSize(iWidth,iWidth));
-	iGdi->DrawLine(aRect.iTl,aRect.iBr);
-	iGdi->MoveTo(aRect.iTl+TPoint(0,10));
-	iGdi->DrawLineBy(aRect.iBr-aRect.iTl);
-	iGdi->MoveBy(aRect.iTl-aRect.iBr+TPoint(0,10));
-	iGdi->DrawLineTo(aRect.iBr+TPoint(0,20));
-	}
-
-void CGdiWideLine::TheTest(const TRect &aRect, TInt)
-	{
-	iGdi->SetPenSize(TSize(iWidth,iWidth));
-	iGdi->MoveTo(aRect.iTl);
-	iGdi->DrawLineBy(aRect.iBr-aRect.iTl);
-	iGdi->MoveBy(aRect.iTl-aRect.iBr+TPoint(0,10));
-	iGdi->DrawLineTo(aRect.iBr+TPoint(0,10));
-	iGdi->DrawLine(aRect.iTl+TPoint(0,20),aRect.iBr+TPoint(0,20));
-	}
-
-//
-// Set Origin //
-//
-
-CGdiSetOrigin::~CGdiSetOrigin()
-	{
-	delete iPolylineArray;
-	delete iPolygonArray;
-	TheClient->iScreen->ReleaseFont(iFont);
-	}
-
-TInt CGdiSetOrigin::Count(TBool )
-	{
-	return(1);
-	}
-
-void CGdiSetOrigin::ConstructL(TInt)
-	{
-	iPolylineArray=new(ELeave) CArrayFixFlat<TPoint>(3);
-	iPolylineArray->AppendL(TPoint(40,1));
-	iPolylineArray->AppendL(TPoint(50,11));
-	iPolylineArray->AppendL(TPoint(40,21));
-	iPolygonArray=new(ELeave) CArrayFixFlat<TPoint>(3);
-	iPolygonArray->AppendL(TPoint(40,30));
-	iPolygonArray->AppendL(TPoint(50,40));
-	iPolygonArray->AppendL(TPoint(40,45));
-	TFontSpec fspec(KMonospaceTestFontTypefaceName,KMaxFontSize);
-	User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInTwips((CFont *&)iFont,fspec));
-	}
-
-void CGdiSetOrigin::PreTestSetupL(const TRect &, TInt )
-	{
-	}
-
-void CGdiSetOrigin::DrawIt(const TPoint &aOffset)
-	{
-	iGdi->DrawLine(TPoint(10,10)+aOffset,TPoint(20,30)+aOffset);
-	iGdi->DrawLineBy(TPoint(-10,5));
-	iGdi->DrawLineTo(TPoint(20,5)+aOffset);
-	iGdi->MoveTo(TPoint(20,10)+aOffset);
-	iGdi->DrawLineTo(TPoint(30,15)+aOffset);
-	iGdi->MoveBy(TPoint(-10,2));
-	iGdi->DrawLineBy(TPoint(10,0));
-	iGdi->UseFont(iFont);
-	iGdi->DrawText(_L("Set Origin Test"),TPoint(40,20)+aOffset);
-	iGdi->DiscardFont();
-	iGdi->DrawRect(TRect(TPoint(10,45)+aOffset,TPoint(20,55)+aOffset));
-	iGdi->DrawRoundRect(TRect(TPoint(21,45)+aOffset,TPoint(30,55)+aOffset),TSize(3,2));
-	iGdi->DrawEllipse(TRect(TPoint(31,45)+aOffset,TPoint(40,55)+aOffset));
-	TInt index;
-	for(index=0;index<iPolylineArray->Count();index++)
-		(*iPolylineArray)[index]+=aOffset;
-	iGdi->DrawPolyLine(iPolylineArray);
-	for(index=0;index<iPolylineArray->Count();index++)
-		(*iPolylineArray)[index]-=aOffset;
-	for(index=0;index<iPolygonArray->Count();index++)
-		(*iPolygonArray)[index]+=aOffset;
-	iGdi->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	User::LeaveIfError(iGdi->DrawPolygon(iPolygonArray,CGraphicsContext::EAlternate));		//Doesn't cause any harm if it leaves
-	for(index=0;index<iPolygonArray->Count();index++)
-		(*iPolygonArray)[index]-=aOffset;
-	}
-
-void CGdiSetOrigin::BaseTest(const TRect &aRect, TInt)
-	{
-	DrawIt(aRect.iTl);
-	}
-
-void CGdiSetOrigin::TheTest(const TRect &aRect, TInt)
-	{
-	iGdi->SetOrigin(aRect.iTl);
-	DrawIt(TPoint(0,0));
-	}
-
-//
-// Draw text //
-//
-
-CGdiDrawText::~CGdiDrawText()
-	{
-	TheClient->iScreen->ReleaseFont(iFont);
-	}
-
-TInt CGdiDrawText::Count(TBool )
-	{
-	return(1);
-	}
-
-void CGdiDrawText::ConstructL(TInt)
-	{
-	TFontSpec fspec(KMonospaceTestFontTypefaceName,KMaxFontSize);
-	User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInTwips((CFont *&)iFont,fspec));
-	TInt index;
-	for(index=0;index<iBigBuffer.MaxLength();index++)
-		iBigBuffer.Append(TChar((index%26)+'a'));
-	const TInt characters=iBigBuffer.Length();
-	TInt bbLen=iFont->TextWidthInPixels(iBigBuffer);
-	for(index=0;index<iBigBuffer.MaxLength();index+=33)
-		{
-		TInt lLen=iFont->TextWidthInPixels(iBigBuffer.Left(index));
-		TInt rLen=iFont->TextWidthInPixels(iBigBuffer.Right(characters-index));
-		TBool result = IsLengthEqual(lLen,rLen,bbLen);
-		iGdiTest->TEST(result);
-		if (!result)
-			{
-			_LIT(KLog,"Font width metrics error, Width(%dchars)=%d, Width(%dchars)=%d, Width(%dchars)=%d");
-			iGdiTest->LOG_MESSAGE7(KLog,index,lLen,characters-index,rLen,characters,bbLen);
-			}
-		}
-	}
-
-void CGdiDrawText::PreTestSetupL(const TRect&,TInt)
-	{}
-
-void CGdiDrawText::BaseTest(const TRect& aRect,TInt)
-	{
-	TInt bbLen=iFont->TextWidthInPixels(iBigBuffer);
-	TInt fAscent=iFont->AscentInPixels();
-	TInt fHeight=iFont->HeightInPixels();
-	iGdi->UseFont(iFont);
-//
-	iGdi->DrawText(_L("Hello"), TPoint(aRect.iTl.iX, aRect.iTl.iY+fAscent));
-	TInt missingChars=iFont->TextCount(iBigBuffer,bbLen-aRect.iBr.iX)-1;	// -1 so one off screen char is drawn to handle overhang
-	if (missingChars>=0)
-		{
-		TPtrC bbb=iBigBuffer.Right(iBigBuffer.Length()-missingChars);
-		TInt lLen=iFont->TextWidthInPixels(iBigBuffer.Left(missingChars));
-		TInt rLen=iFont->TextWidthInPixels(bbb);
-		TBool result = IsLengthEqual(lLen,rLen,bbLen);
-		iGdiTest->TEST(result);
-		if (!result)
-			{
-			_LIT(KLog,"Font width metrics error, missingChars=%d  %d+%d=%d");
-			iGdiTest->LOG_MESSAGE5(KLog,missingChars,lLen,rLen,bbLen);
-			}
-		iGdi->DrawText(bbb,TPoint(aRect.iBr.iX-rLen,aRect.iTl.iY+fAscent+fHeight));
-		}
-	iGdi->DiscardFont();
-	}
-
-void CGdiDrawText::TheTest(const TRect& aRect,TInt)
-	{
-	TInt bbLen=iFont->TextWidthInPixels(iBigBuffer);
-	TInt fAscent=iFont->AscentInPixels();
-	TInt fHeight=iFont->HeightInPixels();
-	iGdi->UseFont(iFont);
-//
-	iGdi->DrawText(_L("Hello"), TPoint(aRect.iTl.iX, aRect.iTl.iY+fAscent));
-	iGdi->DrawText(iBigBuffer,TPoint(aRect.iBr.iX-bbLen,aRect.iTl.iY+fAscent+fHeight));
-	iGdi->DiscardFont();
-	}
-
-//
-// Draw vertical text //
-//
-
-CGdiDrawVertText::~CGdiDrawVertText()
-	{
-	TheClient->iScreen->ReleaseFont(iFont);
-	}
-
-TInt CGdiDrawVertText::Count(TBool )
-	{
-	return(1);
-	}
-
-void CGdiDrawVertText::ConstructL(TInt)
-	{
-	TFontSpec fspec(KMonospaceTestFontTypefaceName,KMaxFontSize);
-	User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInTwips((CFont *&)iFont,fspec));
-	TInt index;
-	for(index=0;index<iBigBuffer.MaxLength();index++)
-		iBigBuffer.Append(TChar((index%26)+'a'));
-//
-	TInt bbLen=iFont->TextWidthInPixels(iBigBuffer);
-	for(index=0;index<iBigBuffer.MaxLength();index+=33)
-		{
-		TInt lLen=iFont->TextWidthInPixels(iBigBuffer.Left(index));
-		TInt rLen=iFont->TextWidthInPixels(iBigBuffer.Right(iBigBuffer.Length()-index));
-		TBool result = IsLengthEqual(lLen,rLen,bbLen);
-		iGdiTest->TEST(result);
-		if (!result)
-			iGdiTest->INFO_PRINTF3(_L("iFont->TextWidthInPixels(iBigBuffer) return value - Expected: %d, Actual: %d"), lLen+rLen, bbLen);		
-		}
-	}
-
-void CGdiDrawVertText::PreTestSetupL(const TRect &, TInt )
-	{
-	}
-
-void CGdiDrawVertText::BaseTest(const TRect &aRect, TInt)
-	{
-	TInt bbLen=iFont->TextWidthInPixels(iBigBuffer);
-	TInt fAscent=iFont->AscentInPixels();
-	TInt fHeight=iFont->HeightInPixels();
-	iGdi->UseFont(iFont);
-//
-	TInt tlen=iFont->TextWidthInPixels(_L("Hello"));
-	iGdi->DrawTextVertical(_L("Hello"), TPoint(aRect.iTl.iX+fAscent, aRect.iTl.iY+tlen), ETrue);
-	iGdi->DrawTextVertical(_L("Hello"), TPoint(aRect.iBr.iX-fAscent, aRect.iTl.iY), EFalse);
-	TInt missingChars=iFont->TextCount(iBigBuffer,bbLen-aRect.iBr.iY)-1;	// -1 so one off screen char is drawn to handle overhang
-	if (missingChars>=0)
-		{
-		TPtrC bbb=iBigBuffer.Right(iBigBuffer.Length()-missingChars);
-		TInt lLen=iFont->TextWidthInPixels(iBigBuffer.Left(missingChars));
-		TInt rLen=iFont->TextWidthInPixels(bbb);
-		TBool result = IsLengthEqual(lLen,rLen,bbLen);
-		iGdiTest->TEST(result);
-		if (!result)
-			iGdiTest->INFO_PRINTF3(_L("iFont->TextWidthInPixels(iBigBuffer) return value - Expected: %d, Actual: %d"), lLen+rLen, bbLen);		
-
-		iGdi->DrawTextVertical(bbb,TPoint(aRect.iTl.iX+fHeight-fAscent+fHeight,aRect.iBr.iY-rLen),EFalse);
-		}
-	iGdi->DiscardFont();
-	}
-
-void CGdiDrawVertText::TheTest(const TRect &aRect, TInt)
-	{
-	TInt bbLen=iFont->TextWidthInPixels(iBigBuffer);
-	TInt fAscent=iFont->AscentInPixels();
-	TInt fHeight=iFont->HeightInPixels();
-	iGdi->UseFont(iFont);
-//
-	TInt tlen=iFont->TextWidthInPixels(_L("Hello"));
-	iGdi->DrawTextVertical(_L("Hello"), TPoint(aRect.iTl.iX+fAscent, aRect.iTl.iY+tlen), ETrue);
-	iGdi->DrawTextVertical(_L("Hello"), TPoint(aRect.iBr.iX-fAscent, aRect.iTl.iY), EFalse);
-	iGdi->DrawTextVertical(iBigBuffer,TPoint(aRect.iTl.iX+fHeight-fAscent+fHeight,aRect.iBr.iY-bbLen),EFalse);
-	iGdi->DiscardFont();
-	}
-
-//
-// Draw Justified text //
-//
-
-// DEF107985 The test for JustifiedText has been removed as it was a bad/useless test. The original test was 
-// broken after it was migrated to TEF TGdi test. It was not worth fixing as the purpose of test was not clear, 
-// and fixing it basically required rewriting the whole test. 
-//  
-
-
-//
-// Box text //
-//
-
-CGdiBoxText::~CGdiBoxText()
-	{
-	TheClient->iScreen->ReleaseFont(iFont);
-	}
-
-TInt CGdiBoxText::Count(TBool )
-	{
-	return(1);
-	}
-
-void CGdiBoxText::ConstructL(TInt)
-	{
-	TFontSpec fspec(KMonospaceTestFontTypefaceName,KMaxFontSize);
-	User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInTwips((CFont *&)iFont,fspec));
-	for(TInt index=0;index<iBigBuffer.MaxLength();index++)
-		iBigBuffer.Append(TChar((index%26)+'a'));
-	iBbLen=iFont->TextWidthInPixels(iBigBuffer);
-	}
-
-void CGdiBoxText::PreTestSetupL(const TRect &, TInt )
-	{
-	}
-
-void CGdiBoxText::BaseTest(const TRect &aRect, TInt)
-	{
-	TInt rWid=aRect.iBr.iX-aRect.iTl.iX;
-	TInt fAscent=iFont->AscentInPixels();
-	TInt fHeight=iFont->HeightInPixels();
-	iGdi->UseFont(iFont);
-	iGdi->SetBrushStyle(CGraphicsContext::ESolidBrush);
-//
-	TRect rect(aRect);
-	rect.iBr.iY=rect.iTl.iY+fHeight;
-//
-	TInt missingChars=iFont->TextCount(iBigBuffer,iBbLen-rWid);
-	TPtrC bbb=iBigBuffer.Right(iBigBuffer.Length()-missingChars);
-	TInt lLen=iFont->TextWidthInPixels(iBigBuffer.Left(missingChars));
-	TInt rLen=iFont->TextWidthInPixels(bbb);
-	TBool result = IsLengthEqual(lLen,rLen,iBbLen);
-	iGdiTest->TEST(result);	
-	if (!result)
-			iGdiTest->INFO_PRINTF3(_L("(lLen+rLen)==iBbLen return value - Expected: %d, Actual: %d"), lLen+rLen, iBbLen);		
-
-	iGdi->DrawText(bbb, rect, fAscent,CGraphicsContext::ELeft, rWid-rLen);
-//
-	rect.Move(TPoint(0,fHeight));
-	iGdi->DrawText(iBigBuffer, rect, fAscent,CGraphicsContext::ELeft, 0);
-//
-	TBuf<10> buf2(_L("1234567890"));
-	rect.Move(TPoint(0,fHeight));
-	iGdi->DrawText(buf2,rect,fAscent,CGraphicsContext::ERight,rect.Width()-iFont->TextWidthInPixels(buf2));
-	}
-
-void CGdiBoxText::TheTest(const TRect &aRect, TInt)
-	{
-	TInt rWid=aRect.iBr.iX-aRect.iTl.iX;
-	TInt fAscent=iFont->AscentInPixels();
-	TInt fHeight=iFont->HeightInPixels();
-	iGdi->UseFont(iFont);
-	iGdi->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TRect rect(aRect);
-	rect.iBr.iY=rect.iTl.iY+fHeight;
-//
-	iGdi->DrawText(iBigBuffer, rect, fAscent, CGraphicsContext::ELeft, rWid-iBbLen);
-//
-	rect.Move(TPoint(0,fHeight));
-	iGdi->Clear(rect);
-	iGdi->SetClippingRegion(TRegionFix<1>(rect));
-	iGdi->DrawText(iBigBuffer, rect.iTl+TPoint(0,fAscent));
-	TBuf<10> buf2(_L("1234567890"));
-	rect.Move(TPoint(0,fHeight));
-	iGdi->CancelClippingRegion();
-	iGdi->DrawText(buf2,rect,fAscent);
-	}
-
-//
-// Vert Box text //
-//
-
-CGdiVertBoxText::~CGdiVertBoxText()
-	{
-	TheClient->iScreen->ReleaseFont(iFont);
-	}
-
-TInt CGdiVertBoxText::Count(TBool )
-	{
-	return(1);
-	}
-
-void CGdiVertBoxText::ConstructL(TInt)
-	{
-	TFontSpec fspec(KMonospaceTestFontTypefaceName,KMaxFontSize);
-	User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInTwips((CFont *&)iFont,fspec));
-	for(TInt index=0;index<iBigBuffer.MaxLength();index++)
-		iBigBuffer.Append(TChar((index%26)+'a'));
-	iBbLen=iFont->TextWidthInPixels(iBigBuffer);
-	}
-
-void CGdiVertBoxText::PreTestSetupL(const TRect &, TInt )
-	{
-	}
-
-void CGdiVertBoxText::BaseTest(const TRect &aRect, TInt)
-	{
-	TInt rWid=aRect.iBr.iY-aRect.iTl.iY;
-	TInt fAscent=iFont->AscentInPixels();
-	TInt fHeight=iFont->HeightInPixels();
-	iGdi->UseFont(iFont);
-	iGdi->SetBrushStyle(CGraphicsContext::ESolidBrush);
-//
-	TRect rect(aRect);
-	rect.iBr.iX=rect.iTl.iX+fHeight;
-//
-	TInt missingChars=iFont->TextCount(iBigBuffer,iBbLen-rWid);
-	TPtrC bbb=iBigBuffer.Right(iBigBuffer.Length()-missingChars+1);
-	TInt lLen=iFont->TextWidthInPixels(iBigBuffer.Left(missingChars-1));
-	TInt rLen=iFont->TextWidthInPixels(bbb);
-	TBool result = IsLengthEqual(lLen,rLen,iBbLen);
-	iGdiTest->TEST(result);
-	if (!result)
-			iGdiTest->INFO_PRINTF3(_L("(lLen+rLen)==iBbLen return value - Expected: %d, Actual: %d"), lLen+rLen, iBbLen);		
-
-	iGdi->DrawTextVertical(bbb, rect, fAscent, ETrue,CGraphicsContext::ELeft, rWid-rLen);
-//
-	rect.iTl.iX=rect.iBr.iX;
-	rect.iBr.iX=rect.iTl.iX+fHeight;
-	iGdi->DrawTextVertical(iBigBuffer, rect, fAscent, ETrue,CGraphicsContext::ELeft, 0);
-	}
-
-void CGdiVertBoxText::TheTest(const TRect &aRect, TInt)
-	{
-	TInt rWid=aRect.iBr.iY-aRect.iTl.iY;
-	TInt fAscent=iFont->AscentInPixels();
-	TInt fHeight=iFont->HeightInPixels();
-	iGdi->UseFont(iFont);
-	iGdi->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TRect rect(aRect);
-	rect.iBr.iX=rect.iTl.iX+fHeight;
-//
-	iGdi->DrawTextVertical(iBigBuffer, rect, fAscent, ETrue, CGraphicsContext::ELeft, rWid-iBbLen);
-//
-	rect.iTl.iX=rect.iBr.iX;
-	rect.iBr.iX=rect.iTl.iX+fHeight;
-	iGdi->Clear(rect);
-	iGdi->SetClippingRegion(TRegionFix<1>(rect));
-	iGdi->DrawTextVertical(iBigBuffer, TPoint(rect.iTl.iX+fAscent,rect.iBr.iY), ETrue);
-	}
-
-
-//
-//
-CGdiBlitMasked::~CGdiBlitMasked()
-	{
-	for(TInt index=0;index<ENumMasks;index++)
-		delete iMask[index];
-	delete iBitmap;
-	delete iScratch;
-	delete iScratchDevice;
-	delete iScratchGc;
-	delete iScratchMask;
-	delete iScratchMaskDevice;
-	delete iScratchMaskGc;
-	}
-
-TInt CGdiBlitMasked::Count(TBool aMainTests)
-	{
-	return(aMainTests ? ENumMasks*2 : ENumMasks*2);
-	}
-
-void CGdiBlitMasked::doCreateTestBitmapL(CFbsBitmap *aBitmap, CFbsBitGc *&aGc, CFbsBitmapDevice *&aDevice, const TSize &aSize)
-	{
-	User::LeaveIfNull(aDevice=CFbsBitmapDevice::NewL(aBitmap));
-	User::LeaveIfError(aDevice->CreateContext(aGc));
-//
-	aGc->SetBrushColor(TRgb(128,128,128));
-	aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	aGc->SetPenStyle(CGraphicsContext::ENullPen);
-	aGc->DrawRect(TRect(aBitmap->SizeInPixels()));
-	aGc->SetPenStyle(CGraphicsContext::ESolidPen);
-	for(TInt index=(-aSize.iHeight);index<aSize.iWidth;index+=5)
-		{
-		aGc->DrawLine(TPoint(index,0),TPoint(index+aSize.iHeight,aSize.iHeight));
-		aGc->DrawLine(TPoint(index,aSize.iHeight),TPoint(index+aSize.iHeight,0));
-		}
-	}
-
-void CGdiBlitMasked::createTestBitmapL(CFbsBitmap *&aBitmap, const TSize &aSize)
-	{
-	CFbsBitGc *gc=NULL;
-	CFbsBitmapDevice *device=NULL;
-	aBitmap=new(ELeave) CFbsBitmap();
-	User::LeaveIfError(aBitmap->Create(aSize,EGray16));
-	TRAPD(err,doCreateTestBitmapL(aBitmap, gc, device, aSize));
-	delete gc;
-	delete device;
-	User::LeaveIfError(err);
-	}
-
-void CGdiBlitMasked::ConstructL(TInt)
-	{
-	TSize max(0,0);
-	for(TInt index=0;index<ENumMasks;index++)
-		{
-		iMask[index]=new(ELeave) CFbsBitmap();
-		User::LeaveIfError(iMask[index]->Load(TAUTO_BITMAP_NAME,2+index));
-		TSize size=iMask[index]->SizeInPixels();
-		if (max.iWidth<size.iWidth)
-			max.iWidth=size.iWidth;
-		if (max.iHeight<size.iHeight)
-			max.iHeight=size.iHeight;
-		}
-	iScratch=new(ELeave) CFbsBitmap();
-	User::LeaveIfError(iScratch->Create(max,EGray16));
-	iScratchDevice=CFbsBitmapDevice::NewL(iScratch);
-	User::LeaveIfError(iScratchDevice->CreateContext(iScratchGc));
-
-	iScratchMask=new(ELeave) CFbsBitmap();
-	User::LeaveIfError(iScratchMask->Create(max,EGray16));
-	iScratchMaskDevice=CFbsBitmapDevice::NewL(iScratchMask);
-	User::LeaveIfError(iScratchMaskDevice->CreateContext(iScratchMaskGc));
-//
-	createTestBitmapL(iBitmap, max);
-	}
-
-void CGdiBlitMasked::PreTestSetupL(const TRect &, TInt aCount)
-	{
-	iInvertMask=aCount&0x1;
-	aCount>>=1;
-	iCurrMask= iMask[aCount%ENumMasks];
-	iDrawMode=CGraphicsContext::EDrawModePEN;
-	}
-
-void CGdiBlitMasked::BaseTest(const TRect &aRect, TInt)
-	{
-// needs re-writing to emulate tiling of the source rect
-	if (!aRect.Intersects(TRect(BaseWin->Size())))
-		return;
-	TSize size(aRect.Size());
-	TSize bitSize=iBitmap->SizeInPixels();
-	if (size.iWidth>bitSize.iWidth)
-		size.iWidth=bitSize.iWidth;
-	if (size.iHeight>bitSize.iHeight)
-		size.iHeight=bitSize.iHeight;
-//
-// Set up the scratch mask as a black and white bitmap containing the mask to blit
-// The mask pattern is replicated all over the scratchmask bitmap
-//
-	iScratchMaskGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	iScratchMaskGc->SetPenStyle(CGraphicsContext::ENullPen);
-	iScratchMaskGc->SetBrushColor(TRgb(0,0,0));
-	iScratchMaskGc->DrawRect(TRect(iScratchMask->SizeInPixels()));
-	iScratchMaskGc->SetPenColor(TRgb(255,255,255));
-	iScratchMaskGc->SetPenStyle(CGraphicsContext::ESolidPen);
-	TSize maskSize(iCurrMask->SizeInPixels());
-	TPoint pos;
-	TRgb *rgbBuf=(TRgb *)User::AllocL(maskSize.iWidth*sizeof(TRgb));		//Doesn't do any harm if it leaves
-	for(pos.iY=0;pos.iY<maskSize.iHeight;pos.iY++)
-		{
-		TPtr8 ptr((TUint8 *)rgbBuf,maskSize.iWidth*sizeof(TRgb));
-		iCurrMask->GetScanLine(ptr, pos, maskSize.iWidth, ERgb);
-		for(TInt index=0;index<maskSize.iWidth;index++)
-			{
-			iScratchMaskGc->SetPenColor(rgbBuf[index]);
-//			if ((isLow && !iLowCutOff) || (!isLow && iLowCutOff))
-				iScratchMaskGc->Plot(TPoint(index,pos.iY));
-			}
-		}
-	User::Free(rgbBuf);
-
-	for(pos.iY=0;pos.iY<size.iHeight;pos.iY+=maskSize.iHeight)
-		for(pos.iX=0;pos.iX<size.iWidth;pos.iX+=maskSize.iWidth)
-			iScratchMaskGc->CopyRect(pos, TRect(maskSize));
-//
-// Blit this to the screen in ANDNOT mode to clear all the pixels we want the mask blit to draw to
-//
-	iGdi->SetDrawMode(CGraphicsContext::EDrawModeANDNOT);
-	iGdi->BitBlt(aRect.iTl, iScratchMask, TRect(size));
-//
-// Copy the test bitmap to the scratch bitmap then use the scratch mask to clear all the bits
-// that should masked out of the draw to the screen
-//
-	iScratchGc->SetDrawMode(CGraphicsContext::EDrawModePEN);
-	iScratchGc->BitBlt(TPoint(0,0), iBitmap);
-	iScratchGc->SetDrawMode(CGraphicsContext::EDrawModeAND);
-	iScratchGc->BitBlt(TPoint(0,0), iScratchMask);
-//
-// Now copy the scratch bitmap to the screen in OR mode to get the final result
-//
-	iGdi->SetDrawMode(CGraphicsContext::EDrawModeOR);
-	iGdi->BitBlt(aRect.iTl, iScratch, TRect(size));
-	}
-
-void CGdiBlitMasked::TheTest(const TRect &aRect, TInt)
-	{
-	iGdi->BitBltMasked(aRect.iTl,iBitmap,TRect((aRect.iBr-aRect.iTl).AsSize()),
-						iCurrMask,iInvertMask);
-	}
-//
-//
-
-CTGdi::CTGdi(CTestStep* aStep) : CTWsGraphicsBase(aStep), iGdiTest (NULL), iTextOffsetX(10),iTextOffsetY(10)
-	{
-	}
-
-void CTGdi::ConstructL()
-	{
-	iWinSize=TestWin->Size();
-	}
-
-TSize CTGdi::WinSize()
-	{
-	return(iWinSize);
-	}
-
-void CTGdi::DoGdiTestL(const TRect &aRect, TInt aNum)
-	{
-//
-	iGdiTest->PreTestSetupL(aRect,aNum);
-//
-	BaseWin->Win()->Invalidate();
-	BaseWin->Win()->BeginRedraw();
-	TheGc->Activate(*BaseWin->Win());
-	iTest->DrawTestBackground(EFalse,BaseWin->Size());
-	iGdiTest->BaseTest(aRect,aNum);
-	TheGc->Deactivate();
-	BaseWin->Win()->EndRedraw();
-//
-	TestWin->Win()->Invalidate();
-	TestWin->Win()->BeginRedraw();
-	TheGc->Activate(*TestWin->Win());
-	iTest->DrawTestBackground(EFalse,TestWin->Size());
-	iGdiTest->TheTest(aRect,aNum);
-	TheGc->Deactivate();
-	TestWin->Win()->EndRedraw();
-//
-	TheClient->iWs.Flush();
-	TheClient->WaitForRedrawsToFinish();
-	TheClient->iWs.Finish();
-//
-	_LIT(KLog,"GDI Substate=%d  test=%d  rect=(%d,%d,%d,%d) ");
-	TBuf<64> buf;
-	buf.Format(KLog,iSubState,aNum,aRect.iTl.iX,aRect.iTl.iY,aRect.iBr.iX,aRect.iBr.iY);
-	iTestPassing=CompareWindows(buf);
-	}
-
-void CTGdi::GdiTestL(CGdiTestLowLevel *aTest)
-	{
-	TTestRects::ResetSeed();
-	iTestPassing=ETrue;
-	iGdiTest=aTest;
-	iGdiTest->SetGdiTest(this);
-	iGdiTest->AssignGdi(TheGc);
-	iGdiTest->ConstructL(iTest->iTestRects.Count1());
-	TInt index;
-	TInt index2;
-	for(index=0; iTestPassing && index<iTest->iTestRects.Count2(); ++index)
-		{
-		TInt max=iGdiTest->Count(index<iTest->iTestRects.Count1());
-		TRect rect=iTest->iTestRects[index];
-	#if defined(LOGGING)
-		_LIT(KLog1,"Testing rectangle %d (%d,%d,%d,%d) 1st pass");
-		LOG_MESSAGE6(KLog1,index,rect.iTl.iX,rect.iTl.iY,rect.iBr.iX,rect.iBr.iY);
-	#endif
-		for(index2=0; iTestPassing && index2<max; ++index2)
-			DoGdiTestL(rect,index2);
-		if (!iTestPassing)
-			{
-			_LIT(KLog,"Test fail on rectangle %d at iteration %d");
-			LOG_MESSAGE3(KLog,index,index2);
-			}
-		}
-	for(; iTestPassing && index<iTest->iTestRects.Count3(); index++)
-		{
-		TRect rect=iTest->iTestRects[index];
-	#if defined(LOGGING)
-		_LIT(KLog2,"Testing rectangle %d (%d,%d,%d,%d) 2nd pass");
-		LOG_MESSAGE6(KLog2,index,rect.iTl.iX,rect.iTl.iY,rect.iBr.iX,rect.iBr.iY);
-	#endif
-		DoGdiTestL(rect,0);
-		}
-	delete iGdiTest;
-	iGdiTest=NULL;
-	}
-
-void CTGdi::NonDrawing()
-//
-// Test all non-drawing GDI functions
-//
-	{
-	TDisplayMode mode=TheClient->iScreen->DisplayMode();
-	TEST((mode!=ERgb) && (mode!=ENone));
-
-	RWsSession session;
-	TInt res = session.Connect();
-	TEST(res == KErrNone);
-	
-	CArrayFixFlat<TInt>* modeList= new CArrayFixFlat<TInt> (15);
-	if(!modeList)
-		return;
-	
-#if defined(SYMBIAN_GRAPHICS_GCE)
-	res = session.GetColorModeList(iTest->iScreenNumber, modeList);
-#else
-	res = session.GetColorModeList(modeList);
-#endif //SYMBIAN_GRAPHICS_GCE
-	session.Close();
-	TEST(res == KErrNone);
-	if(res != KErrNone)
-		{
-		modeList->Reset();
-		delete modeList;
-		return;
-		}
-	
-	TBool found = EFalse;
-	for(TInt ii = 0; ii < modeList->Count() && !found; ii++)
-		{
-		TDisplayMode mode1 = (TDisplayMode) ((*modeList)[ii]);
-		if(mode == mode1)
-			{
-			found = ETrue;
-			}
-		}
-	modeList->Reset();
-	delete modeList;
-
-	TEST(found);	
-	}
-
-//
-// Auxiliary Fn for Test Case ID CTGdi_TestDefetct_DEF045746
-// This method draws the text represented by aText parameter on the window
-// passed to it.
-//
-void CTGdi::DrawTextOnWindow(const TDesC& aText,CTWin* aWin)
-	{
-	aWin->Win()->BeginRedraw();
-	TheGc->Activate(*aWin->Win());
-	TheGc->Device()->GetNearestFontToDesignHeightInTwips(iFont,TFontSpec(_L("Arial"),250));
-	TheGc->UseFont(iFont);
-	TheGc->Clear();
-	TheGc->DrawRect(TRect(aWin->Win()->Size()));
-	TheGc->DrawText(aText,TPoint(iTextOffsetX,iTextOffsetY));
-	TheGc->Device()->ReleaseFont(iFont);
-	TheGc->Deactivate();
-	aWin->Win()->EndRedraw();
-	}
-
-
-void CTGdi::TestDefetct_DEF045746L()
-	{
-	_LIT(KString,"This is a test window for the defect fix DEF045746 \
-		propagated from Opera browser. Most window graphics context drawing\
-		functions map to equivalent CFbsBitGc functions they are implemented\
-		on the screen with any co-ordinates being relative to the top left\
-		corner of the window. However extra clipping is applied. The drawing\
-		will always be clipped to the visible part of the window, in addition\
-		it will be clipped to the non-invalid part if you are not doing a\
-		redraw and to the region being validated if you are doing a redraw.");
-
-	TPtrC TestText(KString().Ptr(),100);
-	TPtrC LargeText(KString().Ptr());
-	TPtrC ShortText(KString().Ptr(),200);
-
-	TSize scrSize=TheClient->iScreen->SizeInPixels();
-	TSize winSize;
-	const TInt windowGap=5;
-	winSize.SetSize(scrSize.iWidth -2* windowGap,scrSize.iHeight/2 - windowGap);
-
-	iWin=new(ELeave) CTestWindow(TRgb(0,0,0));
-	iWin->ConstructL(TPoint(5,5),TSize(winSize),TheClient->iGroup,*TheClient->iGc);
-	CTestWindow* expectWin= new(ELeave) CTestWindow(TRgb(0,0,0));
-	expectWin->ConstructL(TPoint(5,scrSize.iHeight/2 + windowGap),TSize(winSize),TheClient->iGroup,*TheClient->iGc);
-	DrawTextOnWindow(ShortText,iWin);
-	DrawTextOnWindow(TestText,expectWin);
-	TInt fHeight=iFont->HeightInPixels();//Used to compare only pixels where text is drawn
-	TRect iRect=winSize;
-	iRect.iTl.iX=iTextOffsetX;
-	iRect.iTl.iY=iTextOffsetY;
-	iRect.iBr.iY=iTextOffsetY+fHeight;
-	CheckRect(iWin,expectWin,iRect,_L("TestDefetct_DEF045746L A"));
-	iWin->Invalidate();
-	DrawTextOnWindow(LargeText,iWin);
-	CheckRect(iWin,expectWin,iRect,_L("TestDefetct_DEF045746L B"));
-	delete iWin;
-	iWin=NULL;
-	delete expectWin;
-	expectWin=NULL;
-	}
-
-void CTGdi::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	//_LIT(KTest1,"NonDrawing"); this test is not running
-	_LIT(KTest2,"DEF045746");
-	_LIT(KTest3,"Drawing Tests");
-	((CTGdiStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	static TTime startTime;
-	switch(++iTest->iState)
-		{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0262
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test all non-drawing GDI functions
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Check all non-drawing GDI functions operate correctly
-
-@SYMTestExpectedResults Non-drawing GDI functions operate correctly
-*/
-		case 1:
-		    // start time log
-		    startTime.HomeTime();
-			((CTGdiStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0262"));
-			//iTest->LogSubTest(KTest1);
-			//PeterI this tests whether the display mode is EGray4 or EGray16.
-			//The actual display mode is EColor16MU so this test will always fail
-			//NonDrawingL();
-			break;
-/**
- * @SYMTestCaseID GRAPHICS-WSERV-0263
- *
- * @SYMPREQ DEF045746
- *
- * @SYMTestCaseDesc Test defect fix for DEF045746
- *
- * @SYMTestPriority  High
- *
- * @SYMTestStatus Implemented
- *
- * @SYMTestActions The method tests CWindowGc::DrawText().The test is carried
- * out by writing small & very large strings to the window graphic context.
- *
- * @SYMTestExpectedResults The window with large / small strings written is
- * compared with an expected result window. In both the cases strings should
- * be displayed.
- *
- */
-		case 2:
-			((CTGdiStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0263"));
-			iTest->LogSubTest(KTest2);
-			TestDefetct_DEF045746L();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0264
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test all drawing GDI functions
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Check all drawing GDI functions operate correctly
-
-@SYMTestExpectedResults Drawing GDI functions operate correctly
-*/
-		case 3:
-			{
-			((CTGdiStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0264"));
-			iTest->LogSubTest(KTest3);
-			iSubState = 0;
-			TheClient->WaitForRedrawsToFinish();		//Just in case the two test windows have any invalid areas
-			TInt numTests = sizeof(GdiTestFuncs) / sizeof(GdiTestFuncs[0]);
-			while (iSubState < numTests)
-				{
-				LOG_MESSAGE(TPtrC(GdiTestFuncs[iSubState].txt));
-				GdiTestL((*GdiTestFuncs[iSubState].func)());
-				iSubState++;
-				}
-			}
-			break;
-		default:
-            ((CTGdiStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTGdiStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-			// log time and print duration
-			TTime endTime;
-			endTime.HomeTime();
-			TInt64 duration = endTime.MicroSecondsFrom(startTime).Int64();
-			float time = (float) I64LOW(duration) / 1000.0f;
-			_LIT(KDuration,"Total test duration is %f millisec");
-			RDebug::Print(KDuration, time);
-			break;
-		}
-	((CTGdiStep*)iStep)->RecordTestResultL();
-	}
-
-CGdiTestLowLevel *SetOriginTest()
-	{
-	return(new(ELeave) CGdiSetOrigin());
-	}
-
-CGdiTestLowLevel *PolyLineTest()
-	{
-	return(new(ELeave) CGdiPolyLine());
-	}
-
-CGdiTestLowLevel *PolygonTest()
-	{
-	return(new(ELeave) CGdiPolygon());
-	}
-
-CGdiTestLowLevel *BlitMaskedTest()
-	{
-	return(new(ELeave) CGdiBlitMasked());
-	}
-
-CGdiTestLowLevel *DrawArcTest()
-	{
-	return(new(ELeave) CGdiDrawArc());
-	}
-
-CGdiTestLowLevel *DrawPieTest()
-	{
-	return(new(ELeave) CGdiDrawPie());
-	}
-
-CGdiTestLowLevel *DrawRoundRectTest()
-	{
-	return(new(ELeave) CGdiDrawRoundRect());
-	}
-
-CGdiTestLowLevel *BoxTextTest()
-	{
-	return(new(ELeave) CGdiBoxText());
-	}
-
-CGdiTestLowLevel *VertTextTest()
-	{
-	return(new(ELeave) CGdiDrawVertText());
-	}
-
-CGdiTestLowLevel *VertBoxTextTest()
-	{
-	return(new(ELeave) CGdiVertBoxText());
-	}
-
-CGdiTestLowLevel *WideLineTest()
-	{
-	return(new(ELeave) CGdiWideLine());
-	}
-
-CGdiTestLowLevel *DrawTextTest()
-	{
-	return(new(ELeave) CGdiDrawText());
-	}
-
-CGdiTestLowLevel *DrawRectTest()
-	{
-	return(new(ELeave) CGdiDrawRect());
-	}
-
-__WS_CONSTRUCT_STEP__(Gdi)
--- a/windowing/windowserver/tauto/TGDI.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,355 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TGDI_H__
-#define __TGDI_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include <bitstd.h>
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-class CGdiTestLowLevel;
-
-CGdiTestLowLevel *SetOriginTest();
-CGdiTestLowLevel *PolyLineTest();
-CGdiTestLowLevel *PolygonTest();
-CGdiTestLowLevel *BlitMaskedTest();
-CGdiTestLowLevel *DrawArcTest();
-CGdiTestLowLevel *DrawPieTest();
-CGdiTestLowLevel *DrawRoundRectTest();
-CGdiTestLowLevel *BoxTextTest();
-CGdiTestLowLevel *VertTextTest();
-CGdiTestLowLevel *JustifiedTextTest();
-CGdiTestLowLevel *VertBoxTextTest();
-CGdiTestLowLevel *WideLineTest();
-CGdiTestLowLevel *DrawTextTest();
-CGdiTestLowLevel *DrawRectTest();
-
-class CTGdi;
-class CGdiTestLowLevel : public CBase
-//
-// BaseTest uses code that is assumed to be good to draw to one window
-// TheTest uses the code beng tested to draw a matching pattern
-//
-	{
-public:
-	void AssignGdi(CWindowGc *aGc);
-	void SetGdiTest(CTGdi *aGdiTest);
-	virtual void PreTestSetupL(const TRect &aRect, TInt aCount);
-	virtual void BaseTest(const TRect &aRect, TInt aCount)=0;
-	virtual void TheTest(const TRect &aRect, TInt aCount)=0;
-	virtual void ConstructL(TInt aNumOfRects);
-	virtual TInt Count(TBool aMainTests)=0;
-protected:
-	CWindowGc *iGdi;
-	CTGdi *iGdiTest;
-	};
-
-class CGdiRect : public CGdiTestLowLevel
-	{
-public:
-	void PreTestSetupL(const TRect &aRect, TInt aCount);
-	void ConstructL(TInt aNumOfRects);
-	TInt Count(TBool aMainTests);
-protected:
-	TRgb iBrushCol;
-	TRgb iPenCol;
-	};
-
-
-class CGdiDrawRect : public CGdiRect
-	{
-public:
-	TInt Count(TBool aMainTests);
-	void BaseTest(const TRect &aRect, TInt aCount);
-	void TheTest(const TRect &aRect, TInt aCount);
-	};
-
-class CGdiDrawRoundRect : public CGdiRect
-	{
-public:
-	TInt Count(TBool aMainTests);
-	void BaseTest(const TRect &aRect, TInt aCount);
-	void TheTest(const TRect &aRect, TInt aCount);
-	};
-
-class CGdiDrawACP : public CGdiTestLowLevel
-	{
-public:
-	void PreTestSetupL(const TRect &aRect, TInt aCount);
-	void ConstructL(TInt aNumOfRects);
-	TInt Count(TBool aMainTests);
-protected:
-	TRgb iBrushCol;
-	TRgb iPenCol;
-	};
-
-class CGdiDrawArc : public CGdiDrawACP
-	{
-public:
-	void BaseTest(const TRect &aRect, TInt aCount);
-	void TheTest(const TRect &aRect, TInt aCount);
-	};
-
-class CGdiDrawPie : public CGdiDrawACP
-	{
-public:
-	void BaseTest(const TRect &aRect, TInt aCount);
-	void TheTest(const TRect &aRect, TInt aCount);
-	};
-
-class CGdiPolyLine : public CGdiTestLowLevel
-	{
-public:
-	CGdiPolyLine();
-	void PreTestSetupL(const TRect &aRect, TInt aCount);
-	void ConstructL(TInt aNumOfRects);
-	TInt Count(TBool aMainTests);
-	void BaseTest(const TRect &aRect, TInt aCount);
-	void TheTest(const TRect &aRect, TInt aCount);
-private:
-	CArrayFixSeg<TPoint> iPnts;
-	};
-
-class CGdiPolygon : public CGdiTestLowLevel
-	{
-private:
-	enum {KMaxPolygonPoints=100};
-	enum {KPolygonStep=4};
-public:
-	CGdiPolygon();
-	void PreTestSetupL(const TRect &aRect, TInt aCount);
-	void ConstructL(TInt aNumOfRects);
-	TInt Count(TBool aMainTests);
-	void BaseTest(const TRect &aRect, TInt aCount);
-	void TheTest(const TRect &aRect, TInt aCount);
-private:
-	CArrayFixSeg<TPoint> iPnts;
-	};
-
-class CGdiWideLine : public CGdiTestLowLevel
-	{
-private:
-	enum TMaxWidths {
-		EMainNumWidths=16,
-		EMinorNumWidths=4};
-public:
-	void PreTestSetupL(const TRect &aRect, TInt aCount);
-	void BaseTest(const TRect &aRect, TInt aCount);
-	void TheTest(const TRect &aRect, TInt aCount);
-	void ConstructL(TInt aNumOfRects);
-	TInt Count(TBool aMainTests);
-private:
-	TInt iWidth;
-	};
-
-class CGdiSetOrigin : public CGdiTestLowLevel
-	{
-public:
-	~CGdiSetOrigin();
-	void PreTestSetupL(const TRect &aRect, TInt aCount);
-	void DrawIt(const TPoint &aOffset);
-	void BaseTest(const TRect &aRect, TInt aCount);
-	void TheTest(const TRect &aRect, TInt aCount);
-	void ConstructL(TInt aNumOfRects);
-	TInt Count(TBool aMainTests);
-private:
-	CFbsFont *iFont;
-	CArrayFixFlat<TPoint> *iPolylineArray;
-	CArrayFixFlat<TPoint> *iPolygonArray;
-	};
-
-class CGdiDrawText : public CGdiTestLowLevel
-	{
-public:
-	~CGdiDrawText();
-	void PreTestSetupL(const TRect &aRect, TInt aCount);
-	void BaseTest(const TRect &aRect, TInt aCount);
-	void TheTest(const TRect &aRect, TInt aCount);
-	void ConstructL(TInt aNumOfRects);
-	TInt Count(TBool aMainTests);
-private:
-	TInt iWidth;
-	CFbsFont *iFont;
-	TBuf<0x400> iBigBuffer;
-	};
-
-class CGdiDrawVertText : public CGdiTestLowLevel
-	{
-public:
-	~CGdiDrawVertText();
-	void PreTestSetupL(const TRect &aRect, TInt aCount);
-	void BaseTest(const TRect &aRect, TInt aCount);
-	void TheTest(const TRect &aRect, TInt aCount);
-	void ConstructL(TInt aNumOfRects);
-	TInt Count(TBool aMainTests);
-private:
-	TInt iWidth;
-	CFbsFont *iFont;
-	TBuf<0x400> iBigBuffer;
-	};
-
-//class CGdiDrawJustifiedText : public CGdiTestLowLevel
-//DEF107985 The test for JustifiedText has been removed as it was a bad/useless test
-
-class CGdiBoxText : public CGdiTestLowLevel
-	{
-public:
-	~CGdiBoxText();
-	void PreTestSetupL(const TRect &aRect, TInt aCount);
-	void BaseTest(const TRect &aRect, TInt aCount);
-	void TheTest(const TRect &aRect, TInt aCount);
-	void ConstructL(TInt aNumOfRects);
-	TInt Count(TBool aMainTests);
-private:
-	TInt iWidth;
-	TInt iBbLen;
-	CFbsFont *iFont;
-	TBuf<0x400> iBigBuffer;
-	};
-
-class CGdiVertBoxText : public CGdiTestLowLevel
-	{
-public:
-	~CGdiVertBoxText();
-	void PreTestSetupL(const TRect &aRect, TInt aCount);
-	void BaseTest(const TRect &aRect, TInt aCount);
-	void TheTest(const TRect &aRect, TInt aCount);
-	void ConstructL(TInt aNumOfRects);
-	TInt Count(TBool aMainTests);
-private:
-	TInt iWidth;
-	TInt iBbLen;
-	CFbsFont *iFont;
-	TBuf<0x400> iBigBuffer;
-	};
-/*
-class CGdiDottedLine : public CGdiTestLowLevel
-	{
-	enum TMaxPatterns {
-		EMainMaxPatterns=5,
-		EMinorMaxPatterns=3};
-public:
-	void SetGridRegion(TRegion &grid,const TRect &aRect);
-	void PreTestSetupL(const TRect &aRect, TInt aCount);
-	void BaseTest(const TRect &aRect, TInt aCount);
-	void TheTest(const TRect &aRect, TInt aCount);
-	void ConstructL(TInt aNumOfRects);
-	TInt Count(TBool aMainTests);
-private:
-	TUint iPattern;
-	TInt iPattLen;
-	static TUint iPatterns[EMainMaxPatterns];
-	static TInt iPattLens[EMainMaxPatterns];
-	};
-TUint CGdiDottedLine::iPatterns[]={
-		0x55FF0033,
-		0xFF00,
-		0x1,
-		0xFFFF,
-		0xF0F0F0};
-TInt CGdiDottedLine::iPattLens[]={
-		32,
-		16,
-		2,
-		32,
-		24};
-*/
-class CTestWindow : public CBlankWindow
-	{
-public:
-	CTestWindow(TRgb aCol);
-	~CTestWindow();
-	void ConstructL(TPoint aPos,TSize aSize,CTWinBase* aParent, CWindowGc& aGc );
-	};
-
-class CGdiBlitMasked: public CGdiTestLowLevel
-	{
-	enum TNumMasks {ENumMasks=2};
-public:
-	~CGdiBlitMasked();
-	void PreTestSetupL(const TRect &aRect, TInt aCount);
-	void BaseTest(const TRect &aRect, TInt aCount);
-	void TheTest(const TRect &aRect, TInt aCount);
-	void ConstructL(TInt aNumOfRects);
-	TInt Count(TBool aMainTests);
-private:
-	void doCreateTestBitmapL(CFbsBitmap *aBitmap, CFbsBitGc *&aGc, CFbsBitmapDevice *&aDevice, const TSize &aSize);
-	void createTestBitmapL(CFbsBitmap *&aBitmap, const TSize &aSize);
-private:
-	CFbsBitmap *iMask[ENumMasks];
-	CFbsBitmap *iBitmap;
-//
-	CFbsBitmap *iScratch;
-	CFbsBitmapDevice *iScratchDevice;
-	CFbsBitGc *iScratchGc;
-//
-	CFbsBitmap *iScratchMask;
-	CFbsBitmapDevice *iScratchMaskDevice;
-	CFbsBitGc *iScratchMaskGc;
-//
-	TBool iInvertMask;
-	CFbsBitmap *iCurrMask;
-	CGraphicsContext::TDrawMode iDrawMode;
-	};
-
-class CTGdi : public CTWsGraphicsBase
-	{
-public:
-	CTGdi(CTestStep* aStep);
-	void ConstructL();
-	TSize WinSize();
-	void GdiTestL(CGdiTestLowLevel *aTest);
-	void TestDefetct_DEF045746L();
-	void DrawTextOnWindow(const TDesC& aText,CTWin* aWin);
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	void DoGdiTestL(const TRect &aRect, TInt aNum);
-	void NonDrawing();
-private:
-	TSize iWinSize;
-	TInt iSubState;
-	CGdiTestLowLevel *iGdiTest;
-	CTestWindow* iWin;
-	CFont* iFont;
-	TInt iTextOffsetX;
-	TInt iTextOffsetY;
-	TBool iTestPassing;
-	};
-	
-class CTGdiStep : public CTGraphicsStep
-	{
-public:
-	CTGdiStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTGdiStep,"TGdi");
-
-
-#endif
--- a/windowing/windowserver/tauto/TGETPIXEL.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,395 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// GETPIXEL.CPP
-// Automatically test GetPixel
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TGETPIXEL.H"
-
-CTGetPixel::CTGetPixel(CTestStep* aStep):
-	CTWsGraphicsBase(aStep)
-	{
-	}
-
-CTGetPixel::~CTGetPixel()
-	{
-	iWindow.Close();
-	User::Free(iRgbBuf);
-	}
-
-LOCAL_C TInt DoPanicTest(TInt aFunc, TAny *aScreenNumber)
-	{
-	RWsSession ws;
-	if (ws.Connect()==KErrNone)
-		switch(aFunc)
-			{
-			case 1:	// Get pixels into a TPtr 1 pixel too small
-				{
-				CWsScreenDevice *screen = new(ELeave) CWsScreenDevice(ws);
-				User::LeaveIfError(screen->Construct((TInt)aScreenNumber));
-				CFbsBitmap *bitmap=new(ELeave) CFbsBitmap();
-				TInt bitWid=80;
-				TRgb *buf=NULL;
-				if (bitmap->Create(TSize(1,bitWid), EGray16)==KErrNone && (buf=(TRgb *)User::Alloc((bitWid-1)*sizeof(TRgb)))!=NULL)
-					{
-					TPtr8 desc((TUint8 *)buf,(bitWid-1)*sizeof(TRgb));
-    				screen->GetScanLine(desc,TPoint(0,0),bitWid, ERgb);
-					}
-				}
-				break;
-			}
-	return(EWsExitReasonBad);
-	}
-
-void CTGetPixel::ClearOutRedraws()
-// This has been added because partial redraw store can be triggered to request a
-// low priority redraw from the window even though in normal circumstances the window
-// would not expect to receive any sort of redraw event.
-	{
-	iWindow.BeginRedraw();
-	iWindow.EndRedraw();
-	}
-
-void CTGetPixel::TestPanicsL()
-	{
-	if (!iTest->IsFullRomL())
-		{
-		TEST(iTest->TestWsPanicL(DoPanicTest,EWservPanicInvalidParameter,1,(TAny*)iTest->iScreenNumber));
-		}
-	}
-
-void CTGetPixel::DrawAndCheckLine(const TPoint &aPos,TInt aLen,TRgb aColor)
-	{
-	TheGc->Activate(iWindow);
-	TheGc->SetPenColor(aColor);
-	iWindow.BeginRedraw(TRect(aPos,TSize(aLen, 1)));
-	TheGc->DrawLine(aPos,aPos+TSize(aLen,0));
-	iWindow.EndRedraw();
-	TheGc->Deactivate();
-	iRgbBuf=(TRgb *)User::ReAlloc(iRgbBuf,aLen*sizeof(TRgb));
-	TPtr8 ptr((TUint8 *)iRgbBuf,aLen*sizeof(TRgb));
-	TheClient->iScreen->GetScanLine(ptr, aPos+iWindow.InquireOffset(*TheClient->iGroup->WinTreeNode()), aLen, EColor16MA);
-	TRgb result(TRgb::Gray16(aColor.Gray16()));
-	if (TheClient->iScreen->DisplayMode()==EColor64K)
-		result=TRgb::Color64K(result.Color64K());
-	for(TInt index=0;index<aLen;index++)
-		{
-		TEST(iRgbBuf[index]==result);
-		}
-	}
-
-void CTGetPixel::ConstructL()
-	{
-	iWindow = TheClient->iWs;
-	TheGc->Activate(*BaseWin->Win());
-	TheGc->Clear();
-	TheGc->SetBrushColor(TRgb::Gray16(0));
-	TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TheGc->SetPenStyle(CGraphicsContext::ENullPen);
-	TheGc->DrawRect(TRect(iWinSize));
-	TheGc->Deactivate();
-	
-	iWindow.Construct(*TheClient->iGroup->GroupWin(),ENullWsHandle);
-	iWinSize=TSize(TheClient->iScreen->SizeInPixels());
-	iWinSize.iWidth/=3;
-	iWinSize.iHeight/=3;
-	iWindow.SetRequiredDisplayMode(EGray16);
-	TheClient->iWs.Flush();
-	iTest->DelayIfFullRomL();	// Need to wait for view server to mess around when display mode changed
-	TheClient->WaitForRedrawsToFinish();// otherwise it will stomp on top of our window invalidating it.
-	iWindow.SetExtent(TPoint(iWinSize.iWidth,iWinSize.iHeight),iWinSize);
-	iWindow.EnableRedrawStore(EFalse);	// Otherwise drawing might trigger a redraw when purging redraw store
-	
-	iWindow.Activate();
-	iWindow.BeginRedraw();
-	iWindow.EndRedraw();
-		
-	}
-
-void CTGetPixel::TestCheckRect()
-	{
-	TSize size(TheClient->iScreen->SizeInPixels());
-	TEST(TheClient->iScreen->RectCompare(TRect(size),TRect(TPoint(iTest->StdTestWindowSize().iWidth>>1,0),iTest->StdTestWindowSize()))==EFalse);
-	}
-
-void CTGetPixel::DrawColorsL()
-	{
-	TPoint point(0,0);
-	TInt color=-1;
-	iWindow.BeginRedraw();
-	FOREVER
-		{
-		TheGc->SetPenColor(TRgb::Color256(++color));
-		TheGc->Plot(point);
-		if (color==255)
-			break;
-		if (++point.iX==iWinSize.iWidth)
-			{
-			point.iX=0;
-			if (++point.iY==iWinSize.iHeight)
-				break;
-			}
-		}
-	iWindow.EndRedraw();
-	}
-
-void CTGetPixel::TestColors(CPalette* aPalette)
-	{
-	TInt numColors=iWinSize.iWidth;
-	TPtr8 ptr(REINTERPRET_CAST(TUint8*,iRgbBuf),numColors*sizeof(TRgb));
-	TPtr8 paletteData(NULL,0);
-	TInt color=0;
-	TPoint point(iWinSize.AsPoint());
-	do	{
-		if (color+numColors>256)
-			numColors=256-color;
-		TheClient->iScreen->GetScanLine(ptr,point,numColors,EColor16MA);
-		aPalette->GetDataPtr(color,numColors,paletteData);
-		TEST(ptr==paletteData);
-		color+=numColors;
-		} while (color<256 && ++point.iY<2*iWinSize.iHeight);
-	}
-
-void CTGetPixel::CheckPaletteL(CPalette*& aPalette)
-	{
-	User::LeaveIfError(TheClient->iScreen->SetCustomPalette(aPalette));
-	TestColors(aPalette);
-	delete aPalette;
-	User::LeaveIfError(TheClient->iScreen->GetPalette(aPalette));
-	TestColors(aPalette);
-	}
-
-inline TInt Inc(TInt& aValue)
-	{
-	if (aValue>255-83)
-		aValue-=256-83;
-	else
-		aValue+=83;
-	return aValue;
-	}
-
-inline TInt Inc2(TInt& aValue)
-	{
-	if (aValue>255-41)
-		aValue-=256-41;
-	else
-		aValue+=41;
-	return aValue;
-	}
-
-void CTGetPixel::PaletteTestL()
-	{
-	//INFO_PRINTF1(_L("AUTO  PaletteTest "));
-	TInt numEntries;
-	TBool modifiable;
-	TheClient->iScreen->PaletteAttributes(modifiable,numEntries);
-	INFO_PRINTF2(_L("Number of entries in the palette %d"), numEntries);
-	if(numEntries > 65536)
-		{
-		INFO_PRINTF1(_L("These test cases has been skipped, as the screen is set up in true colour display mode, where palette is not applicable"));
-		return; 
-		}
-	CPalette* palette=NULL;
-	if (!modifiable)
-		{
-		if (numEntries==4)
-			palette=CPalette::NewDefaultL(EGray4);
-		else if (numEntries==16)
-			palette=CPalette::NewDefaultL(EGray16);
-		else
-			palette=CPalette::NewL(numEntries);
-		//INFO_PRINTF1(_L(" Creating Empty Palette, setting it as palette"));
-		TInt err=TheClient->iScreen->SetCustomPalette(palette);
-		TEST(err==KErrNoMemory || err==KErrNotSupported || (err==KErrNone && numEntries<=16));		//Series5MX palettes are changeable even though they say they aren't
-		//INFO_PRINTF1(_L(" Palette setting test passed OK"));
-		delete palette;
-		}
-	TInt err=iWindow.SetRequiredDisplayMode(EColor256);
-	TheGc->Activate(iWindow);
-	DrawColorsL();
-	//INFO_PRINTF1(_L(" Drawn Colors"));
-	TheClient->iScreen->PaletteAttributes(modifiable,numEntries);
-	iRgbBuf=STATIC_CAST(TRgb*,User::ReAllocL(iRgbBuf,Max(256,iWinSize.iWidth)*sizeof(TRgb)));
-	if (err<KErrNone || modifiable==EFalse)
-		{
-		//INFO_PRINTF1(_L(" Palette Fixed"));
-		TInt err=TheClient->iScreen->GetPalette(palette);
-		if (err==KErrNotSupported)
-			return;
-		User::LeaveIfError(err);
-		TestColors(palette);
-		delete palette;
-		//INFO_PRINTF1(_L(" Tested Palette OK"));
-		return;
-		}
-	//INFO_PRINTF1(_L(" Palette Changeable"));
-	TEST(numEntries==256);
-	CPalette* defPalette=CPalette::NewDefaultL(EColor256);
-	CleanupStack::PushL(defPalette);
-	TestColors(defPalette);
-	User::LeaveIfError(TheClient->iScreen->GetPalette(palette));
-	TestColors(palette);
-	TInt color;
-	TInt index=0;
-	for (color=0;color<256;++color)
-		palette->SetEntry(color,TRgb::Gray256(color));
-	CheckPaletteL(palette);
-	for (color=0;color<256;++color)
-		palette->SetEntry(color,TRgb(Inc(index),Inc(index),Inc(index)));
-	CheckPaletteL(palette);
-	for (color=0;color<256;++color)
-		palette->SetEntry(color,TRgb(Inc2(index),Inc2(index),Inc2(index)));
-	CheckPaletteL(palette);
-	delete palette;
-	User::LeaveIfError(TheClient->iScreen->SetCustomPalette(defPalette));
-	TestColors(defPalette);
-	CleanupStack::PopAndDestroy(defPalette);
-	ClearOutRedraws();
-	}
-
-void CTGetPixel::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	((CTGetPixelStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(++iTest->iState)
-		{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0212
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Draw lines and check them by scanning the lines
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Draw lines and then scan them to check that they have
-					been drawn correctly
-
-@SYMTestExpectedResults Scanning the lines reveals they have been drawn correctly
-*/
-		case 1:
-			((CTGetPixelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0212"));
-			TheClient->iWs.SetAutoFlush(ETrue);
-			iTest->LogSubTest(_L("Basic"));
-			DrawAndCheckLine(TPoint(0,2),iWinSize.iWidth-2,TRgb::Gray4(0));
-			DrawAndCheckLine(TPoint(0,iWinSize.iHeight-2),iWinSize.iWidth,TRgb::Gray4(1));
-			DrawAndCheckLine(TPoint(iWinSize.iWidth-1,iWinSize.iHeight-1),1,TRgb::Gray4(2));
-			ClearOutRedraws();
-			TheClient->iWs.SetAutoFlush(EFalse);
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0213
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Draw line on every line of a window and
-					check them by scanning the lines
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Draw lines on every line of a window and
-					check them by scanning the lines
-
-@SYMTestExpectedResults Scanning the lines reveals they have been drawn correctly
-*/
-
-		case 2:
-			{
-			((CTGetPixelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0213"));
-			iTest->LogSubTest(_L("Full window"));
-			for(TInt ypos=0;ypos<iWinSize.iHeight;ypos++)
-				DrawAndCheckLine(TPoint(0,ypos),iWinSize.iWidth,TRgb::Gray4(0));
-			ClearOutRedraws();
-			}
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0214
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test the check rect method 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Use the check rect method to check the image in a window
-
-@SYMTestExpectedResults The check rect method functions correctly
-*/
-		case 3:
-			((CTGetPixelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0214"));
-			iTest->LogSubTest(_L("Check Rect"));
-			TestCheckRect();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0215
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test that the GetScanLine method panics correctly 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Cause the GetScanLine method to panic and chekc the response
-
-@SYMTestExpectedResults The panic for the GetScanLine method is correct
-*/
-		case 4:
-			((CTGetPixelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0215"));
-			iTest->LogSubTest(_L("Panic"));
-			TestPanicsL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0216
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test that CPalette class functions correctly 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Create a CPalette object and exercise all its methods
-
-@SYMTestExpectedResults The palette functions as exepcted
-*/
-		case 5:
-			((CTGetPixelStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0216"));
-			iTest->LogSubTest(_L("Palette Test"));
-			PaletteTestL();
-			break;
-		case 6:
-            		((CTGetPixelStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTGetPixelStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-			break;
-		}
-	((CTGetPixelStep*)iStep)->RecordTestResultL();
-	}
-	
-__WS_CONSTRUCT_STEP__(GetPixel)
--- a/windowing/windowserver/tauto/TGETPIXEL.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TGETPIXEL_H__
-#define __TGETPIXEL_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-class CTGetPixel : public CTWsGraphicsBase
-	{
-public:
-	CTGetPixel(CTestStep* aStep);
-	~CTGetPixel();
-	void DrawAndCheckLine(const TPoint &aPos,TInt aLen,TRgb aColor);
-	void TestCheckRect();
-	void GetPixelTest();
-	void ConstructL();
-	void TestPanicsL();
-	void PaletteTestL();
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	void DrawColorsL();
-	void TestColors(CPalette* aPalette);
-	void CheckPaletteL(CPalette*& aPalette);
-	void ClearOutRedraws();
-private:
-	TSize iWinSize;
-	TRgb *iRgbBuf;
-	RWindow iWindow;
-	};
-
-class CTGetPixelStep : public CTGraphicsStep
-	{
-public:
-	CTGetPixelStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTGetPixelStep,"TGetPixel");
-
-
-#endif
--- a/windowing/windowserver/tauto/TGRAPHICSDRAWER.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Tests for the TWsGraphicMsgBufParser 
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TGRAPHICSDRAWER.H"
-#include "Graphics/WSGRAPHICMSGBUF.H"
-
-CTGraphicsDrawer::CTGraphicsDrawer(CTestStep* aStep):
-	CTGraphicsBase(aStep)
-	{
-	INFO_PRINTF1(_L("Testing TWsGraphicMsgBufParser"));
-	}
-		
-void CTGraphicsDrawer::RunTestCaseL(TInt aCurTestCase)
-	{	
-	((CTGraphicsDrawerStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(aCurTestCase)
-		{
-	case 1:		
-		((CTGraphicsDrawerStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0449"));
-		INFO_PRINTF1(_L("TWsGraphicMsgBufParser Indefinite Loop Test"));		
-		IndefiniteLoopL();
-		break;
-		
-	case 2:
-		((CTGraphicsDrawerStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-		((CTGraphicsDrawerStep*)iStep)->CloseTMSGraphicsStep();
-		INFO_PRINTF1(_L("Test complete\n"));
-		TestComplete();
-		break;
-		}
-	((CTGraphicsDrawerStep*)iStep)->RecordTestResultL();
-	}
-
-
-void CTGraphicsDrawer::ConstructL()
-	{
-	}
-	
-CTGraphicsDrawer::~CTGraphicsDrawer()
-	{
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0449
-
-@SYMDEF  			DEF110513, PDEF112710
-
-@SYMTestCaseDesc    Tests that a zero length buffer does not cause an indefinate loop during verify 
-
-@SYMTestPriority    Normal
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions    	Creates a buffer, puts it into a TWsGraphicMsgBufParser and calls verify on it
-					then removes the message from the buffer and re-tests verify.
-
-@SYMTestExpectedResults Test should pass and not timeout
-*/
-
-void CTGraphicsDrawer::IndefiniteLoopL()
-	{
-	RWsGraphicMsgBuf msgBuffer;
-	msgBuffer.CleanupClosePushL();
-	msgBuffer.Append(TUid::Uid(0x12345670),KNullDesC8);
-	TWsGraphicMsgBufParser msgParser(msgBuffer.Pckg());
-	
-	// test the verify method with a single message in the buffer
-	if(msgParser.Verify() != KErrNone)
-		{
-		INFO_PRINTF1(_L("TWsGraphicMsgBufParser::Verify() failed for buffer length 1"));
-		TEST(EFalse);
-		}
-		
-	// remove the (only) message so the message buffer now has a length of zero
-	msgBuffer.Remove(0);
-	TEST(msgBuffer.Count()==0);
-	
-	// test the verify method with an zero length buffer
-	if(msgParser.Verify() != KErrNone)
-		{
-		INFO_PRINTF1(_L("TWsGraphicMsgBufParser::Verify() failed for zero length buffer"));
-		TEST(EFalse);
-		}
-	
-	CleanupStack::PopAndDestroy(&msgBuffer);
-	}
-
-//--------------
-__CONSTRUCT_STEP__(GraphicsDrawer)
-
-
-
--- a/windowing/windowserver/tauto/TGRAPHICSDRAWER.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TGRAPHICSDRAWER_H__
-#define __TGRAPHICSDRAWER_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-class CTGraphicsDrawer : public CTGraphicsBase
-	{
-public:
-	CTGraphicsDrawer(CTestStep* aStep);
-	~CTGraphicsDrawer();
-
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-public:
-	void ConstructL();
-	void IndefiniteLoopL();
-
-private:
-	CTestBase *iTest;
-	};
-
-class CTGraphicsDrawerStep : public CTGraphicsStep
-	{
-public:
-	CTGraphicsDrawerStep();
-protected:	
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTGraphicsDrawerStep,"TGraphicsDrawer");
-
-
-#endif
--- a/windowing/windowserver/tauto/TGWHANDLE.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1870 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// GWHANDLE.CPP
-// Test group window handle functions
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TGWHANDLE.H"
-
-
-CTGwHandle::CTGwHandle(CTestStep* aStep):
-	CTWsGraphicsBase(aStep)
-	{
-	}
-
-void CTGwHandle::ConstructL()
-	{
-	}
-
-CTGwHandle::~CTGwHandle()
-	{
-	}
-
-TInt CTGwHandle::NumberOfWndGroupsWithZeroPriority(TInt aScreenNumber)
-	{
-	__ASSERT_ALWAYS(aScreenNumber <= 1, User::Invariant());
-	return TheClient->iWs.NumWindowGroups(aScreenNumber,0);
-	}
-
-void CTGwHandle::GetGwListL(CArrayFixFlat<TInt> *aWindowHandles)
-	{
-	User::LeaveIfError(TheClient->iWs.WindowGroupList(aWindowHandles));
-	}
-
-void CTGwHandle::GetGwListL(CArrayFixFlat<TInt> *aWindowHandles, TInt aScreenNumber)
-	{
-	User::LeaveIfError(TheClient->iWs.WindowGroupList(aWindowHandles, aScreenNumber));
-	}
-
-void CTGwHandle::GetGwListL(TInt aPriority, CArrayFixFlat<TInt> *aWindowHandles)
-	{
-	User::LeaveIfError(TheClient->iWs.WindowGroupList(aPriority,aWindowHandles));
-	}
-
-void CTGwHandle::GetGwListL(RArray<RWsSession::TWindowGroupChainInfo>* aWindowHandles)
-	{
-	User::LeaveIfError(TheClient->iWs.WindowGroupList(aWindowHandles));
-	}
-
-void CTGwHandle::GetGwListL(TInt aPriority, RArray<RWsSession::TWindowGroupChainInfo>* aWindowHandles)
-	{
-	User::LeaveIfError(TheClient->iWs.WindowGroupList(aPriority, aWindowHandles));
-	}
-
-void CTGwHandle::GwNamesL()
-	{
-	enum {EConnectHandle1=123456};
-	enum {EWindowGroupHandle1=234567};
-	enum {EWindowGroupHandle2=666666};
-//
-	TInt foreground;
-	User::LeaveIfError(foreground=TheClient->iWs.GetFocusWindowGroup());
-	RWsSession ws1;
-	User::LeaveIfError(ws1.Connect());
-
-	// assign to the correct screen
-	CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws1);
-	CleanupStack::PushL(screen);
-	User::LeaveIfError(screen->Construct(iTest->iScreenNumber));
-
-	RWindowGroup gw1(ws1);
-	User::LeaveIfError(gw1.Construct(EWindowGroupHandle1));
-	gw1.SetOwningWindowGroup(foreground);
-	RWindowGroup gw2(ws1);
-	User::LeaveIfError(gw2.Construct(EWindowGroupHandle2));
-	gw2.SetOwningWindowGroup(foreground);
-//
-	TBuf<8> getName;
-//
-// Check default name is simply a null string
-//
-	TInt retVal = gw1.Name(getName);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("gw1.Name(getName) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
-
-	TEST(getName==_L(""));
-	if (getName!=_L(""))
-		INFO_PRINTF3(_L("getName==_L() - Expected: %d, Actual: %d"), ETrue, EFalse);
-//
-	TBuf<8> name1(_L("A_Name1"));
-	TBuf<8> name2(_L("A_Name2"));
-//
-	retVal = gw1.SetName(name1);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("gw1.SetName(name1) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
-
-	retVal = gw2.SetName(name2);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("(gw2.SetName(name2) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
-
-	retVal = gw1.Name(getName);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("(gw1.Name(getName) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
-
-	TEST(getName==name1);
-	if (getName!=name1)
-		INFO_PRINTF3(_L("getName==name1 - Expected: %d, Actual: %d"), ETrue, EFalse);
-//
-	retVal = gw2.Name(getName);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("(gw2.Name(getName) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
-
-	TEST(getName==name2);
-	if (getName!=name2)
-		INFO_PRINTF3(_L("getName==name2 - Expected: %d, Actual: %d"), ETrue, EFalse);
-
-//
-// A few weird characters in the name should work fine
-//
-	retVal = gw2.SetName(_L("xx*"));
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("(gw2.SetName(_L(xx*)) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
-
-	retVal = gw2.Name(getName);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("(gw2.Name(getName) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
-
-	TEST(getName==_L("xx*"));
-	if (getName!=_L("xx*"))
-		INFO_PRINTF3(_L("getName==_L(xx*) - Expected: %d, Actual: %d"), ETrue, EFalse);
-
-//
-	retVal = gw2.SetName(_L(":"));
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("(gw2.SetName(_L(:)) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
-
-	retVal = gw2.Name(getName);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("(gw2.Name(getName) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
-
-	TEST(getName==_L(":"));
-	if (getName!=_L(":"))
-		INFO_PRINTF3(_L("getName==_L(:) - Expected: %d, Actual: %d"), ETrue, EFalse);
-
-//
-// Setting the name back to a null name
-//
-	retVal = gw2.SetName(_L(""));
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("gw2.SetName(_L()) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
-
-	retVal = gw2.Name(getName);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("gw2.Name(getName) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
-
-	TEST(getName==_L(""));
-	if (getName!=_L(""))
-		INFO_PRINTF3(_L("getName==_L() - Expected: %d, Actual: %d"), ETrue, EFalse);
-
-//
-// Getting a name into a too short buffer should fill thew whole buffer from the left hand part
-// of the window name and return KErrOverflow
-//
-	gw2.SetName(name2);
-	TBuf<4> shortBuf;
-	retVal = gw2.Name(shortBuf);
-	TEST(retVal==KErrOverflow);
-	if (retVal!=KErrOverflow)
-		INFO_PRINTF3(_L("gw2.Name(shortBuf) return value - Expected: %d, Actual: %d"), KErrOverflow, retVal);
-
-	TEST(shortBuf==name2.Left(4));
-	if (shortBuf!=name2.Left(4))
-		INFO_PRINTF3(_L("shortBuf==name2.Left(4) - Expected: %d, Actual: %d"), ETrue, EFalse);
-
-//
-// passing a 0 length TPtr pointing to NULL should be safe, simply returning KErrOverflow
-//
-	TPtr nullPtr(NULL,0);
-	retVal = gw2.Name(nullPtr);
-	TEST(retVal==KErrOverflow);
-	if (retVal!=KErrOverflow)
-		INFO_PRINTF3(_L("gw2.Name(nullPtr) return value - Expected: %d, Actual: %d"), KErrOverflow, retVal);
-
-	TEST(nullPtr==_L(""));
-	if (nullPtr!=_L(""))
-		INFO_PRINTF3(_L("nullPtr==_L() - Expected: %d, Actual: %d"), ETrue, EFalse);
-
-//
-// Getting a null name into a null descriptor
-//
-	gw2.SetName(_L(""));
-	TPtr nullPtr2(NULL,0);
-	retVal = gw2.Name(nullPtr);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("gw2.Name(nullPtr) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
-
-	TEST(nullPtr2==_L(""));
-	if (nullPtr2!=_L(""))
-		INFO_PRINTF3(_L("nullPtr2==_L() - Expected: %d, Actual: %d"), ETrue, EFalse);
-//
-	gw1.Close();
-	gw2.Close();
-	CleanupStack::PopAndDestroy(screen);
-	ws1.Close();
-	}
-
-void CTGwHandle::GwIdentifierTestL()
-	{
-	enum {EWindowGroupHandle1=234567};
-	enum {EWindowGroupHandle2=666666};
-	enum {EWindowGroupHandle3=999};
-//
-	CArrayFixFlat<TInt>* windowHandles=new(ELeave) CArrayFixFlat<TInt>(5);
-	CleanupStack::PushL(windowHandles);
-	GetGwListL(0, windowHandles);
-	TInt retVal = TheClient->iWs.GetFocusWindowGroup();
-	TEST(retVal==(*windowHandles)[0]);
-	if (retVal!=(*windowHandles)[0])
-		INFO_PRINTF3(_L("TheClient->iWs.GetFocusWindowGroup() return value - Expected: %d, Actual: %d"), (*windowHandles)[0], retVal);
-
-//
-	RWsSession ws1;
-	User::LeaveIfError(ws1.Connect());
-	CleanupClosePushL(ws1);
-
-	// assign to the correct screen
-	CWsScreenDevice* screen1 = new (ELeave) CWsScreenDevice(ws1);
-	CleanupStack::PushL(screen1);
-	User::LeaveIfError(screen1->Construct(iTest->iScreenNumber));
-
-	RWindowGroup gw1(ws1);
-	User::LeaveIfError(gw1.Construct(EWindowGroupHandle1));
-	gw1.SetOwningWindowGroup((*windowHandles)[0]);
-	RWsSession ws2;
-	User::LeaveIfError(ws2.Connect());
-	CleanupClosePushL(ws2);
-
-	// assign to the correct screen
-	CWsScreenDevice* screen2 = new (ELeave) CWsScreenDevice(ws2);
-	CleanupStack::PushL(screen2);
-	User::LeaveIfError(screen2->Construct(iTest->iScreenNumber));
-
-	RWindowGroup gw2(ws2);
-	User::LeaveIfError(gw2.Construct(EWindowGroupHandle2));
-//
-	GetGwListL(0, windowHandles);
-//
-
-	retVal = gw2.Identifier();
-	TEST(retVal==(*windowHandles)[0]);
-	if (retVal!=(*windowHandles)[0])
-		INFO_PRINTF3(_L("gw2.Identifier() return value - Expected: %d, Actual: %d"), (*windowHandles)[0], retVal);
-
-	retVal = gw1.Identifier();
-	TEST(retVal==(*windowHandles)[1]);
-	if (retVal!=(*windowHandles)[1])
-		INFO_PRINTF3(_L("gw1.Identifier() return value - Expected: %d, Actual: %d"), (*windowHandles)[1], retVal);
-
-	retVal = TheClient->iWs.GetWindowGroupHandle((*windowHandles)[0]);
-	TEST(retVal==EWindowGroupHandle2);
-	if (retVal!=EWindowGroupHandle2)
-		INFO_PRINTF3(_L("TheClient->iWs.GetWindowGroupHandle((*windowHandles)[0]) return value - Expected: %d, Actual: %d"), EWindowGroupHandle2, retVal);
-
-	retVal = TheClient->iWs.GetWindowGroupHandle((*windowHandles)[1]);
-	TEST(retVal==EWindowGroupHandle1);
-	if (retVal!=EWindowGroupHandle1)
-		INFO_PRINTF3(_L("TheClient->iWs.GetWindowGroupHandle((*windowHandles)[1]) return value - Expected: %d, Actual: %d"), EWindowGroupHandle1, retVal);
-//
-	retVal = TheClient->iWs.GetWindowGroupOrdinalPriority((*windowHandles)[1]);
-	TEST(retVal==0);
-	if (retVal!=0)
-		INFO_PRINTF3(_L("TheClient->iWs.GetWindowGroupOrdinalPriority((*windowHandles)[1]) return value - Expected: %d, Actual: %d"), 0, retVal);
-
-	retVal = TheClient->iWs.GetWindowGroupOrdinalPriority((*windowHandles)[0]);
-	TEST(retVal==0);
-	if (retVal!=0)
-		INFO_PRINTF3(_L("TheClient->iWs.GetWindowGroupOrdinalPriority((*windowHandles)[0]) return value - Expected: %d, Actual: %d"), 0, retVal);
-
-//
-	TThreadId threadId;
-	TheClient->iWs.GetWindowGroupClientThreadId((*windowHandles)[0],threadId);
-
-	TUint64 ret = RThread().Id();
-	TEST(ret==threadId);
-	if (ret!=threadId)
-		INFO_PRINTF3(_L("RThread().Id() return value - Expected: %d, Actual: %d"), (TInt)threadId, (TInt)ret);
-
-	TheClient->iWs.GetWindowGroupClientThreadId((*windowHandles)[1],threadId);
-
-	TUint64 retVal2 = RThread().Id();
-	TEST(retVal2==threadId);
-	if (retVal2!=threadId)
-		INFO_PRINTF3(_L("RThread().Id() return value - Expected: %d, Actual: %d"), (TInt)threadId, (TInt)retVal2);
-//
-	retVal = gw1.OrdinalPosition();
-	TEST(retVal==1);
-	if (retVal!=1)
-		INFO_PRINTF3(_L("gw1.OrdinalPosition() return value - Expected: %d, Actual: %d"), 1, retVal);
-
-	retVal = gw2.OrdinalPosition();
-	TEST(retVal==0);
-	if (retVal!=0)
-		INFO_PRINTF3(_L("gw2.OrdinalPosition() return value - Expected: %d, Actual: %d"), 0, retVal);
-
-	retVal = TheClient->iWs.SetWindowGroupOrdinalPosition((*windowHandles)[1],0);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("TheClient->iWs.SetWindowGroupOrdinalPosition((*windowHandles)[1],0) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
-
-	retVal = gw1.OrdinalPosition();
-	TEST(retVal==0);
-	if (retVal!=0)
-		INFO_PRINTF3(_L("gw1.OrdinalPosition() return value - Expected: %d, Actual: %d"), 0, retVal);
-
-	retVal = gw2.OrdinalPosition();
-	TEST(retVal==1);
-	if (retVal!=1)
-		INFO_PRINTF3(_L("gw2.OrdinalPosition() return value - Expected: %d, Actual: %d"), 1, retVal);
-//
-	retVal = TheClient->iWs.SetWindowGroupOrdinalPosition((*windowHandles)[1],1);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("TheClient->iWs.SetWindowGroupOrdinalPosition((*windowHandles)[1],1) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
-
-	retVal = gw1.OrdinalPosition();
-	TEST(retVal==1);
-	if (retVal!=1)
-		INFO_PRINTF3(_L("gw1.OrdinalPosition() return value - Expected: %d, Actual: %d"), 1, retVal);
-
-	retVal = gw2.OrdinalPosition();
-	TEST(retVal==0);
-	if (retVal!=0)
-		INFO_PRINTF3(_L("gw2.OrdinalPosition() return value - Expected: %d, Actual: %d"), 0, retVal);
-
-	retVal = TheClient->iWs.SetWindowGroupOrdinalPosition((*windowHandles)[0],1);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("TheClient->iWs.SetWindowGroupOrdinalPosition((*windowHandles)[0],1) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
-
-	GetGwListL(0, windowHandles);
-	retVal = TheClient->iWs.GetWindowGroupHandle((*windowHandles)[0]);
-	TEST(retVal==EWindowGroupHandle1);
-	if (retVal!=EWindowGroupHandle1)
-		INFO_PRINTF3(_L("TheClient->iWs.GetWindowGroupHandle((*windowHandles)[0]) return value - Expected: %d, Actual: %d"), EWindowGroupHandle1, retVal);
-
-	retVal = TheClient->iWs.GetWindowGroupHandle((*windowHandles)[1]);
-	TEST(retVal==EWindowGroupHandle2);
-	if (retVal!=EWindowGroupHandle2)
-		INFO_PRINTF3(_L("TheClient->iWs.GetWindowGroupHandle((*windowHandles)[1]) return value - Expected: %d, Actual: %d"), EWindowGroupHandle2, retVal);
-//
-	RWindowGroup gw3(ws2);
-	User::LeaveIfError(gw3.Construct(EWindowGroupHandle3));
-	gw1.SetOrdinalPosition(0,100000);	// Assume nothing else in the system is higher, else test will fail
-	gw3.SetOrdinalPosition(0,100000);
-	ws1.Flush();
-	ws2.Flush();
-//
-	GetGwListL(100000, windowHandles);
-	retVal = windowHandles->Count();
-	TEST(retVal==2);
-	if (retVal!=2)
-		INFO_PRINTF3(_L("windowHandles->Count() return value - Expected: %d, Actual: %d"), 2, retVal);
-
-	retVal = TheClient->iWs.GetWindowGroupHandle((*windowHandles)[0]);
-	TEST(retVal==EWindowGroupHandle3);
-	if (retVal!=EWindowGroupHandle3)
-		INFO_PRINTF3(_L("TheClient->iWs.GetWindowGroupHandle((*windowHandles)[0]) return value - Expected: %d, Actual: %d"), EWindowGroupHandle3, retVal);
-
-	retVal = TheClient->iWs.GetWindowGroupHandle((*windowHandles)[1]);
-	TEST(retVal==EWindowGroupHandle1);
-	if (retVal!=EWindowGroupHandle1)
-		INFO_PRINTF3(_L("TheClient->iWs.GetWindowGroupHandle((*windowHandles)[1]) return value - Expected: %d, Actual: %d"), EWindowGroupHandle1, retVal);
-
-//
-	retVal = TheClient->iWs.GetWindowGroupOrdinalPriority((*windowHandles)[0]);
-	TEST(retVal==100000);
-	if (retVal!=100000)
-		INFO_PRINTF3(_L("TheClient->iWs.GetWindowGroupOrdinalPriority((*windowHandles)[0]) return value - Expected: %d, Actual: %d"), 100000, retVal);
-
-	retVal = TheClient->iWs.GetWindowGroupOrdinalPriority((*windowHandles)[1]);
-	TEST(retVal==100000);
-	if (retVal!=100000)
-		INFO_PRINTF3(_L("TheClient->iWs.GetWindowGroupOrdinalPriority((*windowHandles)[1]) return value - Expected: %d, Actual: %d"), 100000, retVal);
-//
-	GetGwListL(-12453, windowHandles);	// Test 0 count, Assumes no window with priority
-	retVal = windowHandles->Count();
-	TEST(retVal==0);
-	if (retVal!=0)
-		INFO_PRINTF3(_L("windowHandles->Count() return value - Expected: %d, Actual: %d"), 0, retVal);
-
-//
-	GetGwListL(windowHandles, iTest->iScreenNumber);
-	retVal = TheClient->iWs.GetWindowGroupHandle((*windowHandles)[0]);
-	TEST(retVal==EWindowGroupHandle3);
-	if (retVal!=EWindowGroupHandle3)
-		INFO_PRINTF3(_L("TheClient->iWs.GetWindowGroupHandle((*windowHandles)[0]) return value - Expected: %d, Actual: %d"), EWindowGroupHandle3, retVal);
-
-	retVal = TheClient->iWs.GetWindowGroupHandle((*windowHandles)[1]);
-	TEST(retVal==EWindowGroupHandle1);
-	if (retVal!=EWindowGroupHandle1)
-		INFO_PRINTF3(_L("TheClient->iWs.GetWindowGroupHandle((*windowHandles)[1]) return value - Expected: %d, Actual: %d"), EWindowGroupHandle1, retVal);
-//
-// Check passing bad identifiers
-//
-	retVal = TheClient->iWs.SetWindowGroupOrdinalPosition(-1,0);
-	TEST(retVal==KErrNotFound);
-	if (retVal!=KErrNotFound)
-		INFO_PRINTF3(_L("TheClient->iWs.SetWindowGroupOrdinalPosition(-1,0) return value - Expected: %d, Actual: %d"), KErrNotFound, retVal);
-
-	retVal = TheClient->iWs.GetWindowGroupHandle(-3);
-	TEST(retVal==KErrNotFound);
-	if (retVal!=KErrNotFound)
-		INFO_PRINTF3(_L("TTheClient->iWs.GetWindowGroupHandle(-3) return value - Expected: %d, Actual: %d"), KErrNotFound, retVal);
-
-//
-	gw1.Close();
-	gw2.Close();
-	gw3.Close();
-	
-	CleanupStack::PopAndDestroy(5, windowHandles);
-	}
-
-void CTGwHandle::OwnerToForegroundL()
-	{
-	enum {EWindowGroupHandle1=234567};
-	enum {EWindowGroupHandle2a=666666};
-	enum {EWindowGroupHandle2b=666667};
-//
-	CArrayFixFlat<TInt> *windowHandles=new(ELeave) CArrayFixFlat<TInt>(5);
-	CleanupStack::PushL(windowHandles);
-	GetGwListL(0, windowHandles);
-	TInt oldForeground=(*windowHandles)[0];
-//
-	RWsSession ws1;
-	User::LeaveIfError(ws1.Connect());
-	CleanupClosePushL(ws1);
-
-	// assign to the correct screen
-	CWsScreenDevice* screen1 = new (ELeave) CWsScreenDevice(ws1);
-	CleanupStack::PushL(screen1);
-	User::LeaveIfError(screen1->Construct(iTest->iScreenNumber));
-
-	RWindowGroup gw1(ws1);
-	User::LeaveIfError(gw1.Construct(EWindowGroupHandle1));
-	CleanupClosePushL(gw1);
-	RWsSession ws2;
-	User::LeaveIfError(ws2.Connect());
-	CleanupClosePushL(ws2);
-
-	// assign to the correct screen
-	CWsScreenDevice* screen2 = new (ELeave) CWsScreenDevice(ws2);
-	CleanupStack::PushL(screen2);
-	User::LeaveIfError(screen2->Construct(iTest->iScreenNumber));
-
-	RWindowGroup gw2a(ws2);
-	User::LeaveIfError(gw2a.Construct(EWindowGroupHandle2a));
-	CleanupClosePushL(gw2a);
-	RWindowGroup gw2b(ws2);
-	User::LeaveIfError(gw2b.Construct(EWindowGroupHandle2b));
-	CleanupClosePushL(gw2b);
-	gw1.SetOrdinalPosition(1);
-//
-// Turn auto flushing on as we're using multiple connections and it would be easy to forget to flush one
-//
-	ws1.SetAutoFlush(ETrue);
-	ws2.SetAutoFlush(ETrue);
-	TheClient->iWs.SetAutoFlush(ETrue);
-//
-	GetGwListL(0, windowHandles);
-//
-	TInt  retVal = gw2b.Identifier();
-	TEST(retVal==(*windowHandles)[0]);
-	if (retVal!=(*windowHandles)[0])
-		INFO_PRINTF3(_L("gw2b.Identifier() return value - Expected: %d, Actual: %d"), (*windowHandles)[0], retVal);
-
-	retVal = gw1.Identifier();
-	TEST(retVal==(*windowHandles)[1]);
-	if (retVal!=(*windowHandles)[1])
-		INFO_PRINTF3(_L("gw1.Identifier() return value - Expected: %d, Actual: %d"), (*windowHandles)[1], retVal);
-
-	retVal = gw2a.Identifier();
-	TEST(retVal==(*windowHandles)[2]);
-	if (retVal!=(*windowHandles)[2])
-		INFO_PRINTF3(_L("gw2a.Identifier() return value - Expected: %d, Actual: %d"), (*windowHandles)[2], retVal);
-
-	retVal = oldForeground;
-	TEST(retVal==(*windowHandles)[3]);
-	if (retVal!=(*windowHandles)[3])
-		INFO_PRINTF3(_L("oldForeground - Expected: %d, Actual: %d"), (*windowHandles)[3], oldForeground);
-//
-	CleanupStack::PopAndDestroy(&gw2b);
-	GetGwListL(0, windowHandles);
-
-	retVal = gw2a.Identifier();
-	TEST(retVal==(*windowHandles)[0]);
-	if (retVal!=(*windowHandles)[0])
-		INFO_PRINTF3(_L("gw2a.Identifier() return value - Expected: %d, Actual: %d"), (*windowHandles)[0], retVal);
-	// Check 2a jumped over 1 in the ordinal list
-
-	retVal = gw1.Identifier();
-	TEST(retVal==(*windowHandles)[1]);
-	if (retVal!=(*windowHandles)[1])
-		INFO_PRINTF3(_L("gw1.Identifier() return value - Expected: %d, Actual: %d"), (*windowHandles)[1], retVal);
-
-	retVal = oldForeground;
-	TEST(retVal==(*windowHandles)[2]);
-	if (retVal!=(*windowHandles)[2])
-		INFO_PRINTF3(_L("oldForeground - Expected: %d, Actual: %d"), (*windowHandles)[2], oldForeground);
-
-//
-	User::LeaveIfError(gw2b.Construct(EWindowGroupHandle2b));
-	CleanupClosePushL(gw2b);
-	gw2b.SetOwningWindowGroup(oldForeground);
-	CleanupStack::PopAndDestroy(&gw2b);
-	GetGwListL(0, windowHandles);
-	retVal = oldForeground;
-	TEST(retVal==(*windowHandles)[0]);
-	if (retVal!=(*windowHandles)[0])
-		INFO_PRINTF3(_L("oldForeground - Expected: %d, Actual: %d"), (*windowHandles)[0], oldForeground);
-	// Check old foreground bought to foreground
-
-	retVal = gw2a.Identifier();
-	TEST(retVal==(*windowHandles)[1]);
-	if (retVal!=(*windowHandles)[1])
-		INFO_PRINTF3(_L("gw2a.Identifier() return value - Expected: %d, Actual: %d"), (*windowHandles)[1], retVal);
-
-	retVal = gw1.Identifier();
-	TEST(retVal==(*windowHandles)[2]);
-	if (retVal!=(*windowHandles)[2])
-		INFO_PRINTF3(_L("gw1.Identifier() return value - Expected: %d, Actual: %d"), (*windowHandles)[2], retVal);
-
-	TheClient->iWs.SetWindowGroupOrdinalPosition((*windowHandles)[0],2);
-//
-	User::LeaveIfError(gw2b.Construct(EWindowGroupHandle2b));
-	CleanupClosePushL(gw2b);
-	gw2b.SetOwningWindowGroup((*windowHandles)[1]);
-	gw2b.SetOrdinalPosition(KOrdinalPositionSwitchToOwningWindow);	// Should bring 2a to foreground
-	GetGwListL(0, windowHandles);
-
-	retVal = gw2a.Identifier();
-	TEST(retVal==(*windowHandles)[0]);
-	if (retVal!=(*windowHandles)[0])
-		INFO_PRINTF3(_L("gw2a.Identifier() return value - Expected: %d, Actual: %d"), (*windowHandles)[0], retVal);
-
-	retVal = gw2b.Identifier();
-	TEST(retVal==(*windowHandles)[1]);
-	if (retVal!=(*windowHandles)[1])
-		INFO_PRINTF3(_L("gw2b.Identifier() return value - Expected: %d, Actual: %d"), (*windowHandles)[1], retVal);
-
-	retVal = gw1.Identifier();
-	TEST(retVal==(*windowHandles)[2]);
-	if (retVal!=(*windowHandles)[2])
-		INFO_PRINTF3(_L("gw1.Identifier() return value - Expected: %d, Actual: %d"), (*windowHandles)[2], retVal);
-//
-	CleanupStack::PopAndDestroy(&gw2b);
-	GetGwListL(0, windowHandles);
-	retVal = gw2a.Identifier();
-	TEST(retVal==(*windowHandles)[0]);
-	if (retVal!=(*windowHandles)[0])
-		INFO_PRINTF3(_L("gw2a.Identifier() return value - Expected: %d, Actual: %d"), (*windowHandles)[0], retVal);
-
-	retVal = gw1.Identifier();
-	TEST(retVal==(*windowHandles)[1]);
-	if (retVal!=(*windowHandles)[1])
-		INFO_PRINTF3(_L("gw1.Identifier() return value - Expected: %d, Actual: %d"), (*windowHandles)[1], retVal);
-//
-	CleanupStack::PopAndDestroy(&gw2a);		// Should bring shell to foreground
-	GetGwListL(0, windowHandles);
-
-// check whether the shell is on
-	TThreadId threadId;
-	ws2.GetWindowGroupClientThreadId((*windowHandles)[0],threadId);
-	TBool shellRunning=ETrue;
-
-	TFullName shellName;
-	// apply to primary screen only where SHELL is running
-	TFindThread findThread(iTest->iScreenNumber==KDefaultScreen?_L("WSHELL*::*"):_L("WxSHELL*::*"));
-	if(findThread.Next(shellName)==KErrNone)
-		{
-		RThread shell;
-		User::LeaveIfError(shell.Open(shellName));
-		TEST(shell.Id()==threadId);
-		if (retVal!=(*windowHandles)[1])
-		INFO_PRINTF3(_L("gw1.Identifier() return value - Expected: %d, Actual: %d"), (*windowHandles)[1], retVal);
-
-		shell.Close();
-		}
-	else
-		{
-		shellRunning=EFalse;
-		}
-
-
-	// Check gw1 second
-	retVal = gw1.Identifier();
-	TEST(retVal==(*windowHandles)[shellRunning ? 1 : 0]);
-	if (retVal!=(*windowHandles)[shellRunning ? 1 : 0])
-		INFO_PRINTF3(_L("gw1.Identifier() return value - Expected: %d, Actual: %d"), (*windowHandles)[shellRunning ? 1 : 0], retVal);
-
-	retVal = oldForeground;
-	TEST(retVal==(*windowHandles)[shellRunning ? 2 : 1]);
-	if (retVal!=(*windowHandles)[shellRunning ? 2 : 1])
-		INFO_PRINTF3(_L("gw1.Identifier() return value - Expected: %d, Actual: %d"), (*windowHandles)[shellRunning ? 2 : 1], retVal);
-	// and oldforeground second
-
-//
-	CleanupStack::PopAndDestroy(5, &ws1);
-//
-// Kick shell back into background, 'cause that's where it belongs
-//
-	TheClient->iWs.SetWindowGroupOrdinalPosition((*windowHandles)[0],-1);
-	TheClient->iWs.SetAutoFlush(EFalse);
-//
-	CleanupStack::PopAndDestroy(windowHandles);
-	}
-
-void CTGwHandle::FindWindowGroupIdentifierTestL()
-	{
-	enum {EWindowGroupHandle1=234567};
-	enum {EWindowGroupHandle2=666666};
-	enum {EWindowGroupHandle3=123};
-	TInt foreground=TheClient->iWs.GetFocusWindowGroup();
-	RWsSession ws1;
-	User::LeaveIfError(ws1.Connect());
-
-	// assign to the correct screen
-	CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws1);
-	CleanupStack::PushL(screen);
-	User::LeaveIfError(screen->Construct(iTest->iScreenNumber));
-	CleanupStack::Pop(screen);
-
-	CleanupClosePushL(ws1);
-//
-	RWindowGroup gw1(ws1);
-	User::LeaveIfError(gw1.Construct(EWindowGroupHandle1));
-	CleanupClosePushL(gw1);
-	gw1.SetOwningWindowGroup(foreground);
-	RWindowGroup gw2(ws1);
-	User::LeaveIfError(gw2.Construct(EWindowGroupHandle2));
-	CleanupClosePushL(gw2);
-	gw1.SetOwningWindowGroup(foreground);
-	RWindowGroup gw3(ws1);
-	User::LeaveIfError(gw3.Construct(EWindowGroupHandle3));
-	CleanupClosePushL(gw3);
-	gw3.SetOwningWindowGroup(foreground);
-//
-	TInt id1=gw1.Identifier();
-	TInt id2=gw2.Identifier();
-	TInt id3=gw3.Identifier();
-//
-	gw1.SetName(_L("qwerty123abcd"));
-	gw2.SetName(_L("123"));
-	gw3.SetName(_L("qqqabcdxxx123"));
-//
-	TInt retVal = ws1.FindWindowGroupIdentifier(0,_L("123"),0);
-	TEST(retVal==id2);
-	if (retVal!=id2)
-		INFO_PRINTF3(_L("ws1.FindWindowGroupIdentifier(0,_L(123),0) return value - Expected: %d, Actual: %d"), id2, retVal);
-
-//
-	retVal = ws1.FindWindowGroupIdentifier(0,_L("*123*"),0);
-	TEST(retVal==id3);
-	if (retVal!=id3)
-		INFO_PRINTF3(_L("ws1.FindWindowGroupIdentifier(0,_L(*123*),0) return value - Expected: %d, Actual: %d"), id3, retVal);
-
-	retVal = ws1.FindWindowGroupIdentifier(id3,_L("*123*"),0);
-	TEST(retVal==id2);
-	if (retVal!=id2)
-		INFO_PRINTF3(_L("ws1.FindWindowGroupIdentifier(id3,_L(*123*),0) return value - Expected: %d, Actual: %d"), id2, retVal);
-
-	retVal = ws1.FindWindowGroupIdentifier(id2,_L("*123*"),0);
-	TEST(retVal==id1);
-	if (retVal!=id1)
-		INFO_PRINTF3(_L("ws1.FindWindowGroupIdentifier(id2,_L(*123*),0) return value - Expected: %d, Actual: %d"), id1, retVal);
-
-//
-	retVal = ws1.FindWindowGroupIdentifier(0,_L("*abcd*"),0);
-	TEST(retVal==id3);
-	if (retVal!=id3)
-		INFO_PRINTF3(_L("ws1.FindWindowGroupIdentifier(0,_L(*abcd*),0) return value - Expected: %d, Actual: %d"), id3, retVal);
-
-	retVal = ws1.FindWindowGroupIdentifier(id3,_L("*abcd*"),0);
-	TEST(retVal==id1);
-	if (retVal!=id1)
-		INFO_PRINTF3(_L("ws1.FindWindowGroupIdentifier(id3,_L(*abcd*),0)return value - Expected: %d, Actual: %d"), id1, retVal);
-//
-	retVal = ws1.FindWindowGroupIdentifier(0,_L("*123*"),7);
-	TEST(retVal==id3);
-	if (retVal!=id3)
-		INFO_PRINTF3(_L("ws1.FindWindowGroupIdentifier(0,_L(*123*),7)return value - Expected: %d, Actual: %d"), id3, retVal);
-
-	retVal = ws1.FindWindowGroupIdentifier(id3,_L("*123*"),7);
-	TEST(retVal==KErrNotFound);
-	if (retVal!=KErrNotFound)
-		INFO_PRINTF3(_L("ws1.FindWindowGroupIdentifier(id3,_L(*123*),7) return value - Expected: %d, Actual: %d"), KErrNotFound, retVal);
-
-	retVal = ws1.FindWindowGroupIdentifier(0,_L("*abc*"),4);
-	TEST(retVal==id1);
-	if (retVal!=id1)
-		INFO_PRINTF3(_L("ws1.FindWindowGroupIdentifier(0,_L(*abc*),4) return value - Expected: %d, Actual: %d"), id1, retVal);
-
-	retVal = ws1.FindWindowGroupIdentifier(id1,_L("*abc*"),4);
-	TEST(retVal==KErrNotFound);
-	if (retVal!=KErrNotFound)
-		INFO_PRINTF3(_L("ws1.FindWindowGroupIdentifier(id1,_L(*abc*),4) return value - Expected: %d, Actual: %d"), KErrNotFound, retVal);
-
-	retVal = ws1.FindWindowGroupIdentifier(0,_L("xxx*"),7);
-	TEST(retVal==id3);
-	if (retVal!=id3)
-		INFO_PRINTF3(_L("ws1.FindWindowGroupIdentifier(0,_L(xxx*),7) return value - Expected: %d, Actual: %d"), id3, retVal);
-
-	retVal = ws1.FindWindowGroupIdentifier(0,_L("xxx*"),8);
-	TEST(retVal==KErrNotFound);
-	if (retVal!=KErrNotFound)
-		INFO_PRINTF3(_L("ws1.FindWindowGroupIdentifier(0,_L(xxx*),8) return value - Expected: %d, Actual: %d"), KErrNotFound, retVal);
-//
-	retVal = ws1.FindWindowGroupIdentifier(id1,_L("12"),0);
-	TEST(retVal==KErrNotFound);
-	if (retVal!=KErrNotFound)
-		INFO_PRINTF3(_L("ws1.FindWindowGroupIdentifier(id1,_L(12),0) return value - Expected: %d, Actual: %d"), KErrNotFound, retVal);
-
-	retVal = ws1.FindWindowGroupIdentifier(id1,_L("qqq"),0);
-	TEST(retVal==KErrNotFound);
-	if (retVal!=KErrNotFound)
-		INFO_PRINTF3(_L("ws1.FindWindowGroupIdentifier(id1,_L(qqq),0) return value - Expected: %d, Actual: %d"), KErrNotFound, retVal);
-
-	retVal = ws1.FindWindowGroupIdentifier(id1,_L("abcd"),3);
-	TEST(retVal==KErrNotFound);
-	if (retVal!=KErrNotFound)
-		INFO_PRINTF3(_L("ws1.FindWindowGroupIdentifier(id1,_L(abcd),3) return value - Expected: %d, Actual: %d"), KErrNotFound, retVal);
-//
-	delete screen;
-	CleanupStack::PopAndDestroy(4, &ws1);
-	}
-
-void CTGwHandle::DefaultOwningWindowL()
-	{
-	TInt foreground=TheClient->iWs.GetFocusWindowGroup();
-	RWsSession ws1;
-	User::LeaveIfError(ws1.Connect());
-
-	// assign to the correct screen
-	CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws1);
-	CleanupStack::PushL(screen);
-	User::LeaveIfError(screen->Construct(iTest->iScreenNumber));
-
-//
-	INFO_PRINTF1(_L("DefaultOwningWindow1"));
-	RWindowGroup gw1(ws1);
-	User::LeaveIfError(gw1.Construct(1));
-	gw1.SetOwningWindowGroup(foreground);
-	RWindowGroup gw2(ws1);
-	User::LeaveIfError(gw2.Construct(2));
-	gw2.SetOwningWindowGroup(foreground);
-	RWindowGroup gw3(ws1);
-	User::LeaveIfError(gw3.Construct(3));
-	gw3.SetOwningWindowGroup(foreground);
-	RWindowGroup gw4(ws1);
-	User::LeaveIfError(gw4.Construct(4));
-	gw4.SetOwningWindowGroup(foreground);
-	INFO_PRINTF1(_L(" Created Group Window"));
-//
-	TInt prevOwningGroup=ws1.GetDefaultOwningWindow();
-	gw1.DefaultOwningWindow();
-	TEST(gw1.Identifier()==ws1.GetDefaultOwningWindow());
-	if (gw1.Identifier()!=ws1.GetDefaultOwningWindow())
-		INFO_PRINTF3(_L("gw1.Identifier()==ws1.GetDefaultOwningWindow() - Expected: %d, Actual: %d"), ws1.GetDefaultOwningWindow(), gw1.Identifier());
-
-	gw2.DefaultOwningWindow();
-	TEST(gw2.Identifier()==ws1.GetDefaultOwningWindow());
-	if (gw2.Identifier()!=ws1.GetDefaultOwningWindow())
-		INFO_PRINTF3(_L("gw2.Identifier()==ws1.GetDefaultOwningWindow() - Expected: %d, Actual: %d"), ws1.GetDefaultOwningWindow(), gw2.Identifier());
-
-	gw2.Close();
-	TEST(gw1.Identifier()==ws1.GetDefaultOwningWindow());
-	if (gw1.Identifier()!=ws1.GetDefaultOwningWindow())
-		INFO_PRINTF3(_L("gw1.Identifier()==ws1.GetDefaultOwningWindow() - Expected: %d, Actual: %d"), ws1.GetDefaultOwningWindow(), gw1.Identifier());
-
-	gw3.DefaultOwningWindow();
-	gw4.DefaultOwningWindow();
-	gw3.Close();
-	TEST(gw4.Identifier()==ws1.GetDefaultOwningWindow());
-	if (gw4.Identifier()!=ws1.GetDefaultOwningWindow())
-		INFO_PRINTF3(_L("gw4.Identifier()==ws1.GetDefaultOwningWindow() - Expected: %d, Actual: %d"), ws1.GetDefaultOwningWindow(), gw4.Identifier());
-
-	gw4.Close();
-	TEST(gw1.Identifier()==ws1.GetDefaultOwningWindow());
-	if (gw1.Identifier()!=ws1.GetDefaultOwningWindow())
-		INFO_PRINTF3(_L("gw1.Identifier()==ws1.GetDefaultOwningWindow() - Expected: %d, Actual: %d"), ws1.GetDefaultOwningWindow(), gw1.Identifier());
-
-	gw1.Close();
-	TEST(prevOwningGroup==ws1.GetDefaultOwningWindow());
-	if (prevOwningGroup!=ws1.GetDefaultOwningWindow())
-		INFO_PRINTF3(_L("prevOwningGroup==ws1.GetDefaultOwningWindow() - Expected: %d, Actual: %d"), ws1.GetDefaultOwningWindow(), prevOwningGroup);
-
-	INFO_PRINTF1(_L(" Closed Group Window"));
-
-	User::LeaveIfError(gw1.Construct(1));
-	gw1.SetOwningWindowGroup(foreground);
-	User::LeaveIfError(gw2.Construct(2));
-	gw2.SetOwningWindowGroup(foreground);
-	User::LeaveIfError(gw3.Construct(3));
-	gw3.SetOwningWindowGroup(foreground);
-	INFO_PRINTF1(_L(" ReCreated Group Window"));
-	gw1.DefaultOwningWindow();
-	gw1.DefaultOwningWindow();
- 	gw1.Close();
-	gw2.DefaultOwningWindow();
-	gw2.DefaultOwningWindow();
-	gw3.Close();
-	gw2.Close();
-	INFO_PRINTF1(_L(" Re-Closed Group Window"));
-
-	User::LeaveIfError(gw1.Construct(1));
-	gw1.SetOwningWindowGroup(foreground);
-	User::LeaveIfError(gw2.Construct(2));
-	gw2.SetOwningWindowGroup(foreground);
-	User::LeaveIfError(gw3.Construct(3));
-	gw3.SetOwningWindowGroup(foreground);
-	User::LeaveIfError(gw4.Construct(4));
-	gw4.SetOwningWindowGroup(foreground);
-	INFO_PRINTF1(_L(" ReCreated Group Window Again"));
-	gw1.DefaultOwningWindow();
-	gw2.DefaultOwningWindow();
-	gw1.DefaultOwningWindow();
- 	gw1.Close();
-	gw2.Close();
-	gw3.DefaultOwningWindow();
-	gw4.DefaultOwningWindow();
-	gw3.DefaultOwningWindow();
- 	gw4.Close();
-	gw3.Close();
-	INFO_PRINTF1(_L(" Re-Closed Group Window Again"));
-
-	User::LeaveIfError(gw1.Construct(1));
-	gw1.DefaultOwningWindow();
-	TEST(gw1.Identifier()==ws1.GetDefaultOwningWindow());
-	if (gw1.Identifier()!=ws1.GetDefaultOwningWindow())
-		INFO_PRINTF3(_L("gw1.Identifier()==ws1.GetDefaultOwningWindow() - Expected: %d, Actual: %d"), ws1.GetDefaultOwningWindow(), gw1.Identifier());
-
-	gw1.DefaultOwningWindow();
-	TEST(gw1.Identifier()==ws1.GetDefaultOwningWindow());
-	if (gw1.Identifier()!=ws1.GetDefaultOwningWindow())
-		INFO_PRINTF3(_L("gw1.Identifier()==ws1.GetDefaultOwningWindow() - Expected: %d, Actual: %d"), ws1.GetDefaultOwningWindow(), gw1.Identifier());
-
-	User::LeaveIfError(gw2.Construct(2));
-	TEST(gw1.Identifier()==ws1.GetDefaultOwningWindow());
-	if (gw1.Identifier()!=ws1.GetDefaultOwningWindow())
-		INFO_PRINTF3(_L("gw1.Identifier()==ws1.GetDefaultOwningWindow() - Expected: %d, Actual: %d"), ws1.GetDefaultOwningWindow(), gw1.Identifier());
-
-	gw2.Close();
-	gw1.Close();
-
-	CleanupStack::PopAndDestroy(screen);
-	ws1.Close();
-	}
-
-void CTGwHandle::DefaultOwningWindow2L()
-//This test originally resulted in a crash, while the above test originally resulted in lockups.
-	{
-	RWsSession ws1;
-	User::LeaveIfError(ws1.Connect());
-
-	// assign to the correct screen
-	CWsScreenDevice* screen1 = new (ELeave) CWsScreenDevice(ws1);
-	CleanupStack::PushL(screen1);
-	User::LeaveIfError(screen1->Construct(iTest->iScreenNumber));
-
-	RWsSession ws2;
-	User::LeaveIfError(ws2.Connect());
-
-	// assign to the correct screen
-	CWsScreenDevice* screen2 = new (ELeave) CWsScreenDevice(ws2);
-	CleanupStack::PushL(screen2);
-	User::LeaveIfError(screen2->Construct(iTest->iScreenNumber));
-
-//
-	RWindowGroup gw1(ws1);
-	User::LeaveIfError(gw1.Construct(1));
-	RWindowGroup gw2(ws2);
-	User::LeaveIfError(gw2.Construct(2));
-	RWindowGroup gw3(ws1);
-	User::LeaveIfError(gw3.Construct(3));
-//
-	const TInt gw1Id=gw1.Identifier();
-	gw1.DefaultOwningWindow();
-	gw2.DefaultOwningWindow();
-	/*const TInt gw2Id=*/gw2.Identifier();
-	gw1.DefaultOwningWindow();
-	TEST(gw1Id==ws1.GetDefaultOwningWindow());
-	if (gw1Id!=ws1.GetDefaultOwningWindow())
-		INFO_PRINTF3(_L("gw1Id==ws1.GetDefaultOwningWindow() - Expected: %d, Actual: %d"), ws1.GetDefaultOwningWindow(), gw1Id);
-
-	gw3.DefaultOwningWindow();
-	gw3.Close();
-	TEST(gw1Id==ws1.GetDefaultOwningWindow());
-	if (gw1Id!=ws1.GetDefaultOwningWindow())
-		INFO_PRINTF3(_L("gw1Id==ws1.GetDefaultOwningWindow() - Expected: %d, Actual: %d"), ws1.GetDefaultOwningWindow(), gw1Id);
-
-	gw1.Close();
-	TInt gw2Id=gw2.Identifier();
-	TEST(gw2Id==ws1.GetDefaultOwningWindow());
-	if (gw2Id!=ws1.GetDefaultOwningWindow())
-		INFO_PRINTF3(_L("gw2Id==ws1.GetDefaultOwningWindow() - Expected: %d, Actual: %d"), ws1.GetDefaultOwningWindow(), gw2Id);
-
-	gw2.SetOrdinalPosition(0);
-	gw2.Close();
-	ws2.Flush();
-	TRawEvent rawEvent;
-	rawEvent.Set(TRawEvent::EKeyDown,32);
-	TheClient->iWs.SimulateRawEvent(rawEvent);
-	TheClient->iWs.Flush();
-//
-	CleanupStack::PopAndDestroy(2,screen1);
-	ws1.Close();
-	ws2.Close();
-	}
-
-#define FREQ 500
-void CTGwHandle::IdentifierWrapAroundTestL()
-	{
-	TInt report=-1;
-	RWsSession ws1;
-	User::LeaveIfError(ws1.Connect());
-
-	// assign to the correct screen
-	CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws1);
-	CleanupStack::PushL(screen);
-	User::LeaveIfError(screen->Construct(iTest->iScreenNumber));
-
-	RWindowGroup gw1(ws1);
-	User::LeaveIfError(gw1.Construct(1));
-	gw1.EnableReceiptOfFocus(EFalse);
-	TInt id1=gw1.Identifier();
-	RWindowGroup gw2(ws1);
-	User::LeaveIfError(gw2.Construct(2));
-	gw2.EnableReceiptOfFocus(EFalse);
-	TInt id2=gw2.Identifier();
-	gw2.Close();	// Allow gw2 id to be re-used
-	TInt id3;
-
-	do
-		{
-		RWindowGroup gw3(ws1);
-		User::LeaveIfError(gw3.Construct(2));
-		gw3.EnableReceiptOfFocus(EFalse);
-		id3=gw3.Identifier();
-		if ((id3/FREQ)!=(report/FREQ))	// || id3<=10)
-			{
-			report=id3;
-			iTest->LogMessage(id3);
-			}
-		TEST(id3!=id1);	// Check id1 is not re-used as the window hasn't been freed yet
-		if (id3==id1)
-			{
-			_LIT(KErr,"Window Group Id Reused!");
-			LOG_MESSAGE(KErr);
-			}
-		gw3.Close();
-		} while(id3!=id2);
-
-	CleanupStack::PopAndDestroy(screen);
-	ws1.Close();
-	}
-
-void GwHandleDestroyWindow(TAny* aWindow)
-	{
-	static_cast<RWindowTreeNode*>(aWindow)->Destroy();
-	}
-
-RWindowGroup* CTGwHandle::CreateWindowGroupLC(RWsSession& aWs,TUint32 aClientHandle,TInt aParentId/*=0*/)
-	{
-	RWindowGroup* gw=new(ELeave) RWindowGroup(aWs);
-	CleanupStack::PushL(TCleanupItem(&GwHandleDestroyWindow,gw));
-	if (aParentId>0)
-		{
-		User::LeaveIfError(gw->ConstructChildApp(aParentId,aClientHandle,EFalse));
-		}
-	else
-		{
-		User::LeaveIfError(gw->Construct(aClientHandle,EFalse));
-		}
-	return gw;
-	}
-
-void CTGwHandle::CreateGroupWindowsLC(RWsSession& aWs)
-	{
-	for(TInt ii=ENumGroups-1;ii>=0;--ii)
-		iGroups[ii]=CreateWindowGroupLC(aWs,ii);
-	}
-
-void CTGwHandle::CreateChainedGroupWindowsLC(RWsSession& aWs,TBool aSecondChain)
-	{
-	TInt parentId=0;
-	for(TInt ii=ENumChained-1;ii>=0;--ii)
-		{
-		iChained[ii]=CreateWindowGroupLC(aWs,ENumGroups+ii,parentId);
-		parentId=iChained[ii]->Identifier();
-		}
-	if(aSecondChain)
-		{
-		parentId =0;
-		for(TInt ii=ENumChained-1;ii>=0;--ii)
-			{
-			iChained2[ii]=CreateWindowGroupLC(aWs,ENumGroups+ENumGroups+ii,parentId);
-			parentId=iChained2[ii]->Identifier();
-			}
-		}
-	}
-
-void CTGwHandle::MoveGroups(RWindowGroup** aGroups,TInt aGp,TInt aNum,TInt aPos,TInt aInc/*=2*/)
-	{
-	TInt ii;
-	for(ii=aNum;ii>0;--ii)
-		{
-		aGroups[aGp]->SetOrdinalPosition(aPos);
-		aGp+=(aInc>0?1:-1);
-		aPos+=aInc;
-		}
-	}
-
-void CTGwHandle::TestGroups(TInt aPos)
-	{
-	TInt retVal;
-	TInt ii = 0;
-	for(ii=0;ii<ENumChained;++ii)
-		{
-		retVal = iChained[ii]->OrdinalPosition();
-		TEST(retVal==aPos+ii);
-		if (retVal!=aPos+ii)
-			INFO_PRINTF3(_L("iChained[ii]->OrdinalPosition() return value - Expected: %d, Actual: %d"), aPos+ii, retVal);
-		}
-
-	for(ii=0;ii<ENumGroups;++ii)
-		{
-		retVal = iGroups[ii]->OrdinalPosition();
-		TInt ret = (ii<aPos?ii:ii+ENumChained);
-		TEST(retVal==ret);
-		if (retVal!=ret)
-			INFO_PRINTF3(_L("iGroups[ii]->OrdinalPosition() return value - Expected: %d, Actual: %d"), ret, retVal);
-		}
-	}
-
-void CTGwHandle::TestGroupsBefore(TInt aPos)
-	{
-	TInt ii;
-	TInt retVal;
-	if (aPos>0)
-		{
-		for (ii=0;ii<aPos;++ii)
-			{
-			retVal = iGroups[ii]->OrdinalPosition();
-			TEST(retVal==ii);
-			if (retVal!=ii)
-				INFO_PRINTF3(_L("iGroups[ii]->OrdinalPosition() return value - Expected: %d, Actual: %d"), ii, retVal);
-			}
-		}
-	for (ii=0;ii<ENumChained;++ii)
-		{
-		retVal = iChained[ii]->OrdinalPosition();
-		TEST(retVal==aPos+2*ii);
-		if (retVal!=aPos+2*ii)
-			INFO_PRINTF3(_L("iChained[ii]->OrdinalPosition() return value - Expected: %d, Actual: %d"), aPos+2*ii, retVal);
-		}
-	for (ii=0;ii<ENumChained-1;++ii)
-		{
-		retVal = iGroups[aPos+ii]->OrdinalPosition();
-		TEST(retVal==aPos+1+2*ii);
-		if (retVal!=aPos+1+2*ii)
-			INFO_PRINTF3(_L("iGroups[aPos+ii]->OrdinalPosition() return value - Expected: %d, Actual: %d"), aPos+1+2*ii, retVal);
-		}
-	for (ii=aPos+ENumChained-1;ii<ENumGroups;++ii)
-		{
-		retVal = iGroups[ii]->OrdinalPosition();
-		TEST(retVal==ii+ENumChained);
-		if (retVal!=ii+ENumChained)
-			INFO_PRINTF3(_L("iGroups[ii]->OrdinalPosition() return value - Expected: %d, Actual: %d"), ii+ENumChained, retVal);
-		}
-	}
-
-void CTGwHandle::WindowGroupChaining()
-	{
-	RWsSession& ws=TheClient->iWs;
-	CreateGroupWindowsLC(ws);
-	CreateChainedGroupWindowsLC(ws);
-	TestGroups(0);
-	TInt start,target,moveGp;
-	for(moveGp=0;moveGp<ENumChained;++moveGp)
-		{
-		for(target=0;target<ENumGroups+1;++target)
-			{
-			for(start=0;start<ENumGroups-ENumChained+2;++start)
-				{
-				if (target>start+1)
-					MoveGroups(iGroups,target-1,target-start-1,ENumChained+target-1,-1);
-				if (target<start && start>0)
-					MoveGroups(iGroups,0,start,0,1);
-				MoveGroups(iGroups,start,ENumChained-1,start+1);
-				TestGroupsBefore(start);
-				iChained[moveGp]->SetOrdinalPosition(target+moveGp);
-				TestGroups(target);
-				}
-			}
-		iChained[0]->SetOrdinalPosition(0);
-		TestGroups(0);
-		}
-	CleanupStack::PopAndDestroy(ENumGroups+ENumChained,iGroups[ENumGroups-1]);
-	}
-
-void CTGwHandle::WindowGroupChaining2()
-	{
-	RWsSession& ws=TheClient->iWs;
-	RWindowGroup* chain1=CreateWindowGroupLC(ws,1);
-	chain1->SetOrdinalPosition(0,1);
-	RWindowGroup* chain2=CreateWindowGroupLC(ws,2,chain1->Identifier());
-	TInt retVal = chain2->OrdinalPriority();
-	TEST(retVal==1);
-	if (retVal!=1)
-			INFO_PRINTF3(_L("chain2->OrdinalPriority() return value - Expected: %d, Actual: %d"), 1, retVal);
-
-	chain1->SetOrdinalPosition(0,2);
-	retVal = chain2->OrdinalPriority();
-	TEST(retVal==2);
-	if (retVal!=2)
-			INFO_PRINTF3(_L("chain2->OrdinalPriority() return value - Expected: %d, Actual: %d"), 2, retVal);
-
-	chain2->SetOrdinalPosition(0,3);
-	retVal = chain1->OrdinalPriority();
-	TEST(retVal==3);
-	if (retVal!=3)
-			INFO_PRINTF3(_L("chain1->OrdinalPriority() return value - Expected: %d, Actual: %d"), 3, retVal);
-
-	CleanupStack::PopAndDestroy(2,chain1);
-	
-	//Test that two different sessions can't chain window-groups without permisson.
-	//Both sessions must use the same screen.
-	RWsSession ws2;
-	User::LeaveIfError(ws2.Connect());
-	CleanupClosePushL(ws2);
-	chain1=CreateWindowGroupLC(ws2,1);
-	TInt id1=chain1->Identifier();
-	
-	RWsSession ws3;
-	User::LeaveIfError(ws3.Connect());
-	CleanupClosePushL(ws3);
-	RWindowGroup chain(ws3);
-	
-	RDebug::Print(KPlatsecBegin);
-	retVal = chain.ConstructChildApp(id1,2);
-	TEST(retVal==KErrPermissionDenied);
-	if (retVal!=KErrPermissionDenied)
-			INFO_PRINTF3(_L("chain.ConstructChildApp(id1,2) return value - Expected: %d, Actual: %d"), KErrPermissionDenied, retVal);
-
-	RDebug::Print(KPlatsecEnd);
-	chain1->AllowProcessToCreateChildWindowGroups(TUid::Uid(0x10205152));	//Secure ID
-	retVal = chain.ConstructChildApp(id1,2);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-			INFO_PRINTF3(_L("chain.ConstructChildApp(id1,2) return value - Expected: %d, Actual: %d"), KErrNone, retVal);
-
-	chain.Close();
-	CleanupStack::PopAndDestroy(3,&ws2);
-	}
-
-void CTGwHandle::UnchainWindowGroupsL()
-	{
-	RArray<RWsSession::TWindowGroupChainInfo>* windowHandles=new(ELeave) RArray<RWsSession::TWindowGroupChainInfo>;
-	CleanupStack::PushL(windowHandles);
-	GetGwListL(0,windowHandles);
-	TInt shellWindow=windowHandles->Count();
-	//Creating chained window groups.
-	CreateChainedGroupWindowsLC(TheClient->iWs);
-	GetGwListL(0,windowHandles);
-	//Test total window groups in the list
-	TInt retVal = windowHandles->Count();
-	TEST(retVal==ENumChained+shellWindow);
-	if (retVal!=ENumChained+shellWindow)
-			INFO_PRINTF3(_L("windowHandles->Count() return value - Expected: %d, Actual: %d"), ENumChained+shellWindow, retVal);
-	//Two unchained group windows
-
-	//Test Parent Id
-	TInt parentId=0;
-	for(TInt ii=ENumChained-1;ii>=0;ii--)
-		{
-		RWsSession::TWindowGroupChainInfo window;
-		window.iId=iChained[ii]->Identifier();
-		TInt loc=windowHandles->Find(window);
-		TEST(loc!=KErrNotFound);
-		if (loc==KErrNotFound)
-			INFO_PRINTF3(_L("windowHandles->Find(window) return value - Expected: %d, Actual: %d"), KErrNotFound, loc);
-
-		if(loc!=KErrNotFound)
-			{
-			TEST((*windowHandles)[loc].iParentId==parentId);
-			if ((*windowHandles)[loc].iParentId!=parentId)
-				INFO_PRINTF3(_L("(*windowHandles)[loc].iParentId==parentId - Expected: %d, Actual: %d"), parentId, (*windowHandles)[loc].iParentId);
-
-			parentId=window.iId;
-			}
-		}
-	//Test unchaining of chained window groups
-	for(TInt count=ENumChained-1;count>=0;count--)
-		{
-		iChained[count]->Close();
-		GetGwListL(0,windowHandles);
-		TEST(windowHandles->Count()== count+shellWindow);
-		if (windowHandles->Count()!= count+shellWindow)
-				INFO_PRINTF3(_L("windowHandles->Count()==count+shellWindow - Expected: %d, Actual: %d"), count+shellWindow, windowHandles->Count());
-
-		}
-	CleanupStack::PopAndDestroy(ENumChained,iChained[ENumChained-1]);
-
-	//delete middle windowgroup of chain which should kill all the child windows
-	CreateChainedGroupWindowsLC(TheClient->iWs);
-	TInt windowPos=2;
-	CleanupStack::Pop(2,iChained[1]);	//Pop first 2 items iChained[0] and iChained[1]
-	iChained[windowPos]->Close();//Close the 3rd WindowGroup in the chain.should unchain 4 and 5 window group.
-	CleanupStack::PopAndDestroy(iChained[windowPos]);
-	CleanupStack::PushL(TCleanupItem(&GwHandleDestroyWindow,iChained[1]));
-	CleanupStack::PushL(TCleanupItem(&GwHandleDestroyWindow,iChained[0]));
-	GetGwListL(0,windowHandles);
-	retVal = ChainedWindowCount(windowHandles);
-	TEST(retVal==ENumChained-windowPos-1);
-	if (retVal!=ENumChained-windowPos-1)
-				INFO_PRINTF3(_L("ChainedWindowCount(windowHandles) return value - Expected: %d, Actual: %d"), ENumChained-windowPos-1, retVal);
-
-//	CleanupStack::PopAndDestroy(ENumChained-1,iChained[ENumChained-1]);
-
-	windowPos=3;
-	CleanupStack::Pop(2,iChained[1]);
-	iChained[windowPos]->Close();//Close the 2nd WindowGroup in the chain.
-								//should unchain all .
-	CleanupStack::PopAndDestroy(iChained[windowPos]);
-	CleanupStack::PushL(TCleanupItem(&GwHandleDestroyWindow,iChained[1]));
-	CleanupStack::PushL(TCleanupItem(&GwHandleDestroyWindow,iChained[0]));
-	GetGwListL(0,windowHandles);
-	retVal = ChainedWindowCount(windowHandles);
-	TEST(retVal==ENumChained-windowPos-2);
-	if (retVal!=ENumChained-windowPos-2)
-				INFO_PRINTF3(_L("ChainedWindowCount(windowHandles) return value - Expected: %d, Actual: %d"), ENumChained-windowPos-2, retVal);
-
-	windowPos=4;
-	CleanupStack::Pop(2,iChained[1]);
-	iChained[windowPos]->Close();//Closing parent window group in chain. There should be no chain
-	CleanupStack::PopAndDestroy(iChained[windowPos]);
-	CleanupStack::PushL(TCleanupItem(&GwHandleDestroyWindow,iChained[1]));
-	CleanupStack::PushL(TCleanupItem(&GwHandleDestroyWindow,iChained[0]));
-	GetGwListL(0,windowHandles);
-	retVal = ChainedWindowCount(windowHandles);
-	TEST(retVal==ENumChained-windowPos-1);
-	if (retVal!=ENumChained-windowPos-1)
-				INFO_PRINTF3(_L("ChainedWindowCount(windowHandles) return value - Expected: %d, Actual: %d"), ENumChained-windowPos-1, retVal);
-
-	CleanupStack::PopAndDestroy(ENumChained-3,iChained[ENumChained-4]);
-	windowHandles->Close();
-	CleanupStack::PopAndDestroy(windowHandles);
-	}
-
-TInt CTGwHandle::ChainedWindowCount(RArray<RWsSession::TWindowGroupChainInfo>* aWindowHandles)
-	{
-	TInt wndGrpCount=0;
-	for(TInt ii=0;ii<aWindowHandles->Count();ii++)
-		{
-		if((*aWindowHandles)[ii].iParentId!=-1)
-			wndGrpCount++;
-		}
-	return wndGrpCount;
-	}
-
-void CTGwHandle::TestOrdinalPositionL()
-	{
-	TInt noOfGroupWnds = NumberOfWndGroupsWithZeroPriority(iTest->iScreenNumber);
-	//Creating the chained window groups
-	CreateChainedGroupWindowsLC(TheClient->iWs);
-	TestOrdinalPos(0);
-	//Test the ordinal position of all chained windows by setting the WndPos window
-	//to chainPos position
-	for(TInt wndPos=0;wndPos<ENumChained;wndPos++)
-		{
-		for(TInt chainPos=0;chainPos<15;chainPos++)
-			{
-			iChained[wndPos]->SetOrdinalPosition(chainPos);
-			TInt dung = chainPos-wndPos;
-			if(dung > noOfGroupWnds)
-				{
-				dung = noOfGroupWnds;
-				}
-			dung = Max(dung, 0);
-			TestOrdinalPos(chainPos - wndPos > noOfGroupWnds ? noOfGroupWnds : Max(chainPos - wndPos, 0));
-			}
-		}
-	//Test for negative ordinal number
-	iChained[0]->SetOrdinalPosition(-2);
-	TestOrdinalPos(noOfGroupWnds);
-	CleanupStack::PopAndDestroy(ENumChained,iChained[ENumChained-1]);
-	}
-
-void CTGwHandle::TestOrdinalPositionNoDebugL()
-	{
-	TInt noOfGroupWnds = NumberOfWndGroupsWithZeroPriority(iTest->iScreenNumber);
-	//Creating the chained window groups
-	CreateChainedGroupWindowsLC(TheClient->iWs);
-	//Test the ordinal position of all chained windows
-	TestOrdinalPosNoDebug(0);
-	//Test the ordinal position of all chained windows by setting the WndPos window
-	//to chainPos position
-	for(TInt wndPos=0;wndPos<ENumChained;wndPos++)
-		{
-		for(TInt chainPos=0;chainPos<15;chainPos++)
-			{
-			iChained[wndPos]->SetOrdinalPosition(chainPos);
-			TestOrdinalPosNoDebug(chainPos - wndPos > noOfGroupWnds ? noOfGroupWnds : Max(chainPos - wndPos, 0));
-			}
-		}
-	//Test for negative ordinal number
-	iChained[0]->SetOrdinalPosition(-2);
-	TestOrdinalPosNoDebug(noOfGroupWnds);
-	CleanupStack::PopAndDestroy(ENumChained,iChained[ENumChained-1]);
-	}
-
-void CTGwHandle::TestOrdinalPos(TInt aPos)
-	{
-	for(TInt ii=0;ii<ENumChained;ii++)
-		{
-		TInt iCha = iChained[ii]->OrdinalPosition();
-		TEST(iCha==aPos++);
-		if (iCha!=aPos-1)
-			{
-			INFO_PRINTF3(_L("iChained[ii]->OrdinalPosition() return value - Expected: %d, Actual: %d"), aPos-1, iCha);
-			}
-		}
-	}
-
-void CTGwHandle::TestOrdinalPosNoDebug(TInt aPos)
-	{
-	for(TInt ii=0;ii<ENumChained;ii++)
-		{
-		TInt iCha = iChained[ii]->OrdinalPosition();
-		TEST(iCha==aPos++);
-		if (iCha!=aPos-1)
-			INFO_PRINTF3(_L("iChained[ii]->OrdinalPosition() return value - Expected: %d, Actual: %d"), aPos-1, iCha);
-
-		}
-	}
-
-void CTGwHandle:: TestclosingclientL()
-	{
-	RWsSession ws1;
-	User::LeaveIfError(ws1.Connect());
-	CleanupClosePushL(ws1);
-
-	// assign to the correct screen
-	CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws1);
-	CleanupStack::PushL(screen);
-	User::LeaveIfError(screen->Construct(iTest->iScreenNumber));
-
-	// Creating first Window Group
-	RWindowGroup gw1(ws1);
-	User::LeaveIfError(gw1.Construct(ENullWsHandle));
-	ws1.SetWindowGroupOrdinalPosition(gw1.Identifier(),0);
-
-	// Creating second Window Group
-	RWindowGroup gw2(ws1);
-	User::LeaveIfError(gw2.Construct(ENullWsHandle));
-	gw2.SetOwningWindowGroup(gw1.Identifier());
-	gw2.SetOrdinalPosition(1);
-	CleanupStack::PopAndDestroy(screen);
-	CleanupStack::PopAndDestroy(&ws1);
-	}
-
-void CTGwHandle::TestClearingAndSettingChildGroupsL()
-	{
-	RArray<RWsSession::TWindowGroupChainInfo> windowHandles;
-	CleanupClosePushL(windowHandles);
-	//Creating a chain of 5 window groups.
-	CreateChainedGroupWindowsLC(TheClient->iWs);
-	TInt ret=KErrNone;
-	// Want to test clearing and setting of window groups for chain lengths of 5 down to 2
-	for(TInt jj=ENumChained-1;jj>0;jj--)
-		{
-		// For each window group in the chain, test clearing and setting a child group
-		for(TInt ii=jj;ii>0;ii--)
-			{
-			RWsSession::TWindowGroupChainInfo window1;
-			window1.iId=iChained[ii]->Identifier();
-			GetGwListL(0,&windowHandles);
-			TInt loc=windowHandles.Find(window1);
-			TEST(loc!=KErrNotFound);
-			if(loc!=KErrNotFound)
-				{
-				RWsSession::TWindowGroupChainInfo window2;
-				window2.iId=iChained[ii-1]->Identifier();
-				loc = windowHandles.Find(window2);
-				TEST(loc!=KErrNotFound);
-				// First test that the parent of the next window in the chain is the previous in the chain
-				if(loc!=KErrNotFound)
-					{
-					TEST(windowHandles[loc].iParentId==window1.iId);
-					}
-				// Then clear and test that the parent of the next window in the chain
-				// is no longer the previous window in the chain
-				ret=iChained[ii]->ClearChildGroup();
-				TEST(ret==KErrNone);
-				// Try to clear a child group when it's already cleared - should return KErrArgument
-				ret=iChained[ii]->ClearChildGroup();
-				TEST(ret==KErrArgument);
-				GetGwListL(0,&windowHandles);
-				loc = windowHandles.Find(window2);
-				TEST(loc!=KErrNotFound);
-				// Test that it has no parent (0) or is unchained (-1)
-				if(loc!=KErrNotFound)
-					{
-					if(ii==1) // last in chain therefore unchained, should return -1
-						TEST(windowHandles[loc].iParentId==-1);
-					else // otherwise should return 0 signifying in a chain but with no parent
-						TEST(windowHandles[loc].iParentId==0);
-					}
-				// Reset the former child group as a child to the current group
-				ret=iChained[ii]->SetChildGroup(window2.iId);
-				TEST(ret==KErrNone);
-				// Test that it has now got it's parent back
-				GetGwListL(0,&windowHandles);
-				loc = windowHandles.Find(window2);
-				TEST(loc!=KErrNotFound);
-				if(loc!=KErrNotFound)
-					{
-					TEST(windowHandles[loc].iParentId==window1.iId);
-					}
-				}
-			}
-			// Reduce chain length by 1
-			ret=iChained[jj]->ClearChildGroup();
-			TEST(ret==KErrNone);
-		}
-	// Try to clear the child group of a window that's not in a queue - returns KErrArgument
-	ret=iChained[0]->ClearChildGroup();
-	TEST(ret==KErrArgument);
-	// Test calling set on a non-existent window group - fictional id, larger than what exists
-	ret=iChained[0]->SetChildGroup(9999);
-	TEST(ret==KErrArgument);
-	// Cleanup
-	CleanupStack::PopAndDestroy(ENumChained,iChained[ENumChained-1]);
-	CleanupStack::PopAndDestroy(&windowHandles);
-	}
-
-void CTGwHandle::TestAgainstLoopsWhenAddingChildGroupsL()
-	{
-	//Creating two chains of 5 window groups.
-	CreateChainedGroupWindowsLC(TheClient->iWs,ETrue);
-	TInt ret=KErrNone;
-	
-	//Try to append any of element of this chain to the lastone (itself included)
-	//All these attempts should fail (otherwise a infinite loop will be set up)
-	for(TInt ii=ENumChained-1;ii>=0;ii--)
-		{
-		TInt windowId = iChained[ii]->Identifier();
-		// Try to append it to the last one
-		ret=iChained[0]->SetChildGroup(windowId);
-		TEST(ret==KErrArgument);
-		if(ret!=KErrArgument)
-			{
-			_LIT(KLog,"Error: SetChildGroup with a GpWin belonging to the same queue succeeded, return value :%d");
-			LOG_MESSAGE2(KLog,ret);
-			}
-		}
-	//Try to append any elements belonging to another chain to the last one of this chain
-	//All these trials should fail (otherwise a infinite loop will be set up)
-	//Except for the parent of the second chain.
-	for(TInt ii=0;ii<ENumChained;ii++)
-		{
-		TInt windowId = iChained2[ii]->Identifier();
-		// Try to append it to the last one
-		ret=iChained[0]->SetChildGroup(windowId);
-		if(ii != ENumChained-1)
-			{
-			TEST(ret==KErrArgument);
-			if(ret!=KErrArgument)
-				{
-				_LIT(KLog,"Error: SetChildGroup with a GpWin which already has a parent succeeded, return value :%d");
-				LOG_MESSAGE2(KLog,ret);
-				}
-			iChained[0]->ClearChildGroup();
-			}
-		else
-			{
-			TEST(ret==KErrNone);
-			if(ret!=KErrNone)
-				{
-				_LIT(KLog,"Error: SetChildGroup with a GpWin with no parent failed, return value :%d");
-				LOG_MESSAGE2(KLog,ret);
-				}
-			}
-		}
-	TInt windowId = iChained2[ENumChained-1]->Identifier();
-	ret=iChained[ENumChained-1]->SetChildGroup(windowId);
-	TEST(ret==KErrArgument);
-	if(ret!=KErrArgument)
-		{
-		_LIT(KLog,"Error: SetChildGroup successful on a GpWin which already has a child, return value :%d");
-		LOG_MESSAGE2(KLog,ret);
-		}
-	//Now take a window group not belonging to any queue
-	//just take the parent's chain and pop it 
-	//and try to append it to itself
-	ret=iChained[ENumChained-1]->ClearChildGroup();
-	TEST(ret==KErrNone);
-	ret=iChained[ENumChained-1]->SetChildGroup(iChained[ENumChained-1]->Identifier());
-	TEST(ret==KErrArgument);
-	if(ret!=KErrArgument)
-		{
-		_LIT(KLog,"Error: Setting GpWin as a child of itself succeeded, return value :%d");
-		LOG_MESSAGE2(KLog,ret);
-		}
-    CleanupStack::PopAndDestroy(ENumChained+ENumChained,iChained[ENumChained-1]);
-	}
-void CTGwHandle::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(KTest0,"Window group names");
-	_LIT(KTest1,"Window group identifiers");
-	_LIT(KTest2,"Owner to foreground");
-	_LIT(KTest3,"FindWindowGroupIdentifier test");
-	_LIT(KTest4,"IdentifierWrapAround test");
-	_LIT(KTest5,"DefaultOwningWindow test");
-	_LIT(KTest6,"DefaultOwningWindow2 test");
-	_LIT(KTest7,"Window Group Chaining");
-	_LIT(KTest8,"Window Group Chaining2");
-	_LIT(KTest9,"Unchaining window group");
-	_LIT(KTest10,"Ordinal Postion Test");
-	_LIT(KTest11,"CrashTest on closing client");
-	_LIT(KTest12,"Setting and Clearing Child Groups");
-	_LIT(KTest13,"No Infinite Loops in Setting Child Groups");
-	((CTGwHandleStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(++iTest->iState)
-		{
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0316
-
-  @SYMDEF             DEF081259
-
-  @SYMTestCaseDesc Test setting window group names
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Set the name of a window group to different values and check the
-  					value is set correctly
-
-  @SYMTestExpectedResults The window group name is set correctly
-
-*/
-		case 1:
-			((CTGwHandleStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0316"));
-			//iState=9; break;
-			iTest->LogSubTest(KTest0);
-			GwNamesL();
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0317
-
-  @SYMDEF             DEF081259
-
-  @SYMTestCaseDesc Test setting window group identifiers
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Set the identifiers of a window groups. manipulate the window groups and
-  					check the identifiers remain correct
-
-  @SYMTestExpectedResults The identifiers are correct for each window group after
-  							manipulation
-
-*/
-		case 2:
-			((CTGwHandleStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0317"));
-			iTest->LogSubTest(KTest1);
-			GwIdentifierTestL();
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0318
-
-  @SYMDEF             DEF081259
-
-  @SYMTestCaseDesc Test moving different window groups to the foreground and bringing
-  					back the backgorund
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Create some window groups and move them in turn to the foreground before
-  					restoring the background
-
-  @SYMTestExpectedResults Window groups move to and from the foreground with error
-
-*/
-		case 3:
-			((CTGwHandleStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0318"));
-			iTest->LogSubTest(KTest2);
-			OwnerToForegroundL();
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0319
-
-  @SYMDEF             DEF081259
-
-  @SYMTestCaseDesc Test returning different window groups identifiers by searching
-  					on the name
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Create some window groups and return their identifiers by searching on
-  					their names
-
-  @SYMTestExpectedResults The correct identifiers are returned for each name
-
-*/
-		case 4:
-			((CTGwHandleStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0319"));
-			iTest->LogSubTest(KTest3);
-			FindWindowGroupIdentifierTestL();
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0320
-
-  @SYMDEF             DEF081259
-
-  @SYMTestCaseDesc Test that a windows group identifier is not used twice
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Assign a window group identifier to one window group and check
-  					the same identifier can not be used for a second group
-
-  @SYMTestExpectedResults Window group identifier can not be reused
-
-*/
-		case 5:
-			((CTGwHandleStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0320"));
-			iTest->LogSubTest(KTest4);
-			IdentifierWrapAroundTestL();
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0321
-
-  @SYMDEF             DEF081259
-
-  @SYMTestCaseDesc Test that the default owning window for window groups is set
-  					correctly
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Set different default owning windows for different window groups.
-  					Check the windows have been set correctly.
-
-  @SYMTestExpectedResults The default owning windows for the groups are set correctly
-
-*/
-		case 6:
-			((CTGwHandleStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0321"));
-			iTest->LogSubTest(KTest5);
-			DefaultOwningWindowL();
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0322
-
-  @SYMDEF             DEF081259
-
-  @SYMTestCaseDesc Test that the default owning window for window groups is set
-  					correctly
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Set different default owning windows for different window groups.
-  					Check the windows have been set correctly.
-
-  @SYMTestExpectedResults The default owning windows for the groups are set correctly
-
-*/
-		case 7:
-			((CTGwHandleStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0322"));
-			iTest->LogSubTest(KTest6);
-			DefaultOwningWindow2L();
-			TheClient->iGroup->WinTreeNode()->SetOrdinalPosition(0);
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0323
-
-  @SYMDEF             DEF081259
-
-  @SYMTestCaseDesc Test that window groups can be chained correctly
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Create a chain of window groups and check that the chain of groups
-  					can be manipluated correctly
-
-  @SYMTestExpectedResults The chain can be manipulated correctly
-
-*/
-		case 8:
-			((CTGwHandleStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0323"));
-			iTest->LogSubTest(KTest7);
-			WindowGroupChaining();
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0324
-
-  @SYMDEF             DEF081259
-
-  @SYMTestCaseDesc Test that window groups can be chained correctly
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Create a chain of window groups and check that the chain of groups
-  					can be manipluated correctly
-
-  @SYMTestExpectedResults The chain can be manipulated correctly
-
-*/
-		case 9:
-			((CTGwHandleStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0324"));
-			iTest->LogSubTest(KTest8);
-			WindowGroupChaining2();
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0325
-
-  @SYMDEF             DEF081259
-
-  @SYMTestCaseDesc Test that window groups can be unchained correctly
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Create chains of window groups and check that the window groups can be
-  					unchained correctly
-
-  @SYMTestExpectedResults The chain can be unchained correctly
-
-*/
-		case 10:
-			((CTGwHandleStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0325"));
-			iTest->LogSubTest(KTest9);
-			UnchainWindowGroupsL();
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0326
-
-  @SYMDEF             DEF081259
-
-  @SYMTestCaseDesc Test the ordinal position of chained window groups
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Create chains of window groups and check their ordinal position is correct
-  					for different scenarios
-
-  @SYMTestExpectedResults Ordinal position of chained window group is correct
-
-*/
-		case 11:
-			((CTGwHandleStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0326"));
-			iTest->LogSubTest(KTest10);
-			TestOrdinalPositionL();
-			break;
-		case 12:
-			((CTGwHandleStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0326"));
-			iTest->LogSubTest(KTest10);
-			TestOrdinalPositionNoDebugL();
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0327
-
-  @SYMDEF             DEF081259
-
-  @SYMTestCaseDesc Test that window groups are dealt with correctly if their client is closed
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Create window groups and then close there client.
-
-  @SYMTestExpectedResults The window groups of the closed client are handled without error
-
-*/
-		case 13:
-			((CTGwHandleStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0327"));
-			iTest->LogSubTest(KTest11);
-			TestclosingclientL();
-			break;
-		case 14:
-			((CTGwHandleStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0327"));
-			iTest->LogSubTest(KTest12);
-			TestClearingAndSettingChildGroupsL();
-			break;
-		case 15:
-			((CTGwHandleStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0327"));
-			iTest->LogSubTest(KTest13);
-			TestAgainstLoopsWhenAddingChildGroupsL();
-			break;
-		default:
-			((CTGwHandleStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTGwHandleStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-			break;
-		}
-	((CTGwHandleStep*)iStep)->RecordTestResultL();
-	}
-
-__WS_CONSTRUCT_STEP__(GwHandle)
--- a/windowing/windowserver/tauto/TGWHANDLE.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TGWHANDLE_H__
-#define __TGWHANDLE_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-class CTGwHandle : public CTWsGraphicsBase
-	{
-public:
-	CTGwHandle(CTestStep* aStep);
-	~CTGwHandle();
-	void ConstructL();
-	TInt NumberOfWndGroupsWithZeroPriority(TInt aScreenNumber);
-	void GetGwListL(CArrayFixFlat<TInt> *aWindowHandles);
-	void GetGwListL(CArrayFixFlat<TInt> *aWindowHandles, TInt aScreenNumber);
-	void GetGwListL(TInt aPriority, CArrayFixFlat<TInt> *aWindowHandles);
-	void GetGwListL(RArray<RWsSession::TWindowGroupChainInfo>* aWindowHandles);
-	void GetGwListL(TInt aPriority, RArray<RWsSession::TWindowGroupChainInfo>* aWindowHandles);
-	void GwNamesL();
-	void GwIdentifierTestL();
-	void OwnerToForegroundL();
-	void FindWindowGroupIdentifierTestL();
-	void IdentifierWrapAroundTestL();
-	void DefaultOwningWindowL();
-	void DefaultOwningWindow2L();
-	void WindowGroupChaining();
-	void WindowGroupChaining2();
-	void UnchainWindowGroupsL();
-	void TestclosingclientL();
-	void TestClearingAndSettingChildGroupsL();
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	enum {ENumGroups=10,ENumChained=5};
-private:
-	RWindowGroup* CreateWindowGroupLC(RWsSession& aWs,TUint32 aClientHandle,TInt aParentId=0);
-	void CreateGroupWindowsLC(RWsSession& aWs);
-	void CreateChainedGroupWindowsLC(RWsSession& aWs,TBool aSecondChain = EFalse);
-	void TestAgainstLoopsWhenAddingChildGroupsL();
-	void MoveGroups(RWindowGroup** aGroups,TInt aGp,TInt aNum,TInt aPos,TInt aInc=2);
-	void TestGroups(TInt aPos);
-	void TestGroupsBefore(TInt aPos);
-	void TestOrdinalPositionL();
-	void TestOrdinalPositionNoDebugL();
-	void TestOrdinalPos(TInt awndPos);
-	void TestOrdinalPosNoDebug(TInt awndPos);
-	TInt ChainedWindowCount(RArray<RWsSession::TWindowGroupChainInfo>*);
-private:
-	TFullName iFullName;
-	TSize iWinSize;
-	RWindowGroup* iGroups[ENumGroups];
-	RWindowGroup* iChained[ENumChained];
-	RWindowGroup* iChained2[ENumChained];
-	};
-
-class CTGwHandleStep : public CTGraphicsStep
-	{
-public:
-	CTGwHandleStep();
-protected:
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTGwHandleStep,"TGwHandle");
-
-
-#endif
--- a/windowing/windowserver/tauto/THeartBeat.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,659 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test the Wserv heart beat switch on and off
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "THeartBeat.h"
-#include <w32debug.h>
-
-CTHeartBeatTest::CTHeartBeatTest(CTestStep* aStep) :
-	CTWsGraphicsBase(aStep)
-	{
-	}
-
-CTHeartBeatTest::~CTHeartBeatTest()
-	{
-	iAnimDll.Close();
-	delete iHbTestWin;
-	}
-
-void CTHeartBeatTest::ConstructL()
-	{
-	TSize screenSize=TheClient->iGroup->Size();
-	TInt winWidth=(screenSize.iWidth/3)-10;
-	TInt winHeight=screenSize.iHeight-10;
-	iHbTestWin=new(ELeave) CAnimWindow(EFalse, CAnimWindow::ERedraw);
-	iHbTestWin->ConstructL(TPoint(screenSize.iWidth/3*2+5,5),TSize(winWidth,winHeight));
-	iAnimDll=RAnimDll(TheClient->iWs);
-	User::LeaveIfError(iAnimDll.Load(KAnimDLLName));
-	}
-
-void CTHeartBeatTest::SetCursor(const TPoint& aPos,const TSize& aSize, TUint aFlags/*=0*/)
-	{ // Default aFlags=0 gives a flashing cursor
-	TTextCursor tc;
-	tc.iType=TTextCursor::ETypeRectangle;
-	tc.iHeight=aSize.iHeight;
-	tc.iAscent=aSize.iHeight*4/5;
-	tc.iWidth=aSize.iWidth;
-	tc.iFlags=aFlags;	
-	tc.iColor=KRgbGreen;
-	TheClient->iGroup->GroupWin()->SetTextCursor(*iHbTestWin->BaseWin(),TPoint(aPos.iX,aPos.iY+tc.iAscent),tc);
-	}
-
-TBool CTHeartBeatTest::SetAutoHeartBeatPauseState(TBool aState) const
-	{
-	return(TheClient->iWs.DebugInfo(EWsDebugSetAutoHeartBeatPauseState,aState));
-	}
-
-TBool CTHeartBeatTest::GetHeartBeatTimerState() const
-	{
-	return(TheClient->iWs.DebugInfo(EWsDebugHeartBeatState));
-	}
-
-void CTHeartBeatTest::CancelTextCursor()
-	{
-	TheClient->iGroup->GroupWin()->CancelTextCursor();
-	}
-
-void CTHeartBeatTest::TestTextCursorTimerL()
-	{
-	TEST(!GetHeartBeatTimerState());
-	SetCursor(TPoint(0,0),TSize(10,10));
-	TEST(GetHeartBeatTimerState());
-	CancelTextCursor();
-	TEST(!GetHeartBeatTimerState());
-//
-	TPoint testCursorPos;
-	TSize testCursorSize(10,10);
-	SetCursor(testCursorPos,testCursorSize);
-	TEST(GetHeartBeatTimerState());
-	iHbTestWin->BaseWin()->SetVisible(EFalse);
-	TEST(!GetHeartBeatTimerState());
-	iHbTestWin->BaseWin()->SetVisible(ETrue);
-	TEST(GetHeartBeatTimerState());
-//
-// Cover the cursor and check heartbeat disabled
-	RWindow coverCursor(TheClient->iWs);
-	CleanupClosePushL(coverCursor);
-	User::LeaveIfError(coverCursor.Construct(*iHbTestWin->BaseWin(), 0xBADBAD));
-	coverCursor.SetExtent(testCursorPos,testCursorSize);
-	coverCursor.Activate();
-	TEST(!GetHeartBeatTimerState());
-// Now fractionally expose the cursor and check heartbeat re-enabled
-	coverCursor.SetExtent(testCursorPos+TPoint(1,1),testCursorSize);
-	TEST(GetHeartBeatTimerState());
-// Re-cover it
-	coverCursor.SetExtent(testCursorPos,testCursorSize);
-	TEST(!GetHeartBeatTimerState());
-// Enlarge cursor to expose itself then check heartbeat
-	SetCursor(testCursorPos,TSize(testCursorSize.iWidth+1,testCursorSize.iHeight));
-	TEST(GetHeartBeatTimerState());
-// Shrink cursor then check heartbeat
-	SetCursor(testCursorPos,testCursorSize);
-	TEST(!GetHeartBeatTimerState());
-// Turn off auto heart beat pausing, should turn timer back on
-	SetAutoHeartBeatPauseState(EFalse);
-	TEST(GetHeartBeatTimerState());
-// With auto pausing enabled covering/uncovering the cursor should have no effect,
-// timer will always be on
-	coverCursor.SetVisible(EFalse);
-	TEST(GetHeartBeatTimerState());
-	coverCursor.SetVisible(ETrue);
-	TEST(GetHeartBeatTimerState());
-// Re-enable auto-pause should turn timer back off
-	SetAutoHeartBeatPauseState(ETrue);
-	TEST(!GetHeartBeatTimerState());
-// Destroy covering window and check heartbeat re-enabled
-	CleanupStack::PopAndDestroy(&coverCursor);
-	TEST(GetHeartBeatTimerState());
-// Check using no flash flag turns timer off
-	SetCursor(testCursorPos,testCursorSize,TTextCursor::EFlagNoFlash);
-	TEST(!GetHeartBeatTimerState());
-// and turning no flash flag off turns timer back on
-	SetCursor(testCursorPos,testCursorSize);
-	TEST(GetHeartBeatTimerState());
-// Preparing for switch off should disable the heartbeat until another event is received
-	TheClient->iWs.PrepareForSwitchOff();
-	TEST(!GetHeartBeatTimerState());
-// Any event should wake the hearbeat back up again
-	TRawEvent rawEvent;
-	rawEvent.Set(TRawEvent::EPointerMove,0,0);
-	TheClient->iWs.SimulateRawEvent(rawEvent);
-	TEST(GetHeartBeatTimerState());
-//
-	CancelTextCursor();
-	TEST(!GetHeartBeatTimerState());
-// Check heartbeat still off as expected
-	TheClient->iWs.PrepareForSwitchOff();
-	TEST(!GetHeartBeatTimerState());
-// Check when hearbeat not required that it's not turned back when coming out of PrepareForSwitchOff() mode.
-	TheClient->iWs.SimulateRawEvent(rawEvent);
-	TheClient->Flush();
-	TEST(!GetHeartBeatTimerState());
-	}
-
-void CTHeartBeatTest::doTestActiveInactiveEvents(TBool aCursorOn, TBool aAutoPauseOn)
-	{
-	SetAutoHeartBeatPauseState(aAutoPauseOn);
-	if (aCursorOn)
-		SetCursor(TPoint(0,0),TSize(10,10));
-// Should disable timer, regardless of other states
-	TRawEvent event;
-	event.Set(TRawEvent::EInactive);
-	UserSvr::AddEvent(event);
-	TEST(!GetHeartBeatTimerState());
-// ...and switch it back on
-	event.Set(TRawEvent::EActive);
-	UserSvr::AddEvent(event);
-	TBool testResult1=EFalse;
-	if (aAutoPauseOn)
-		testResult1=aCursorOn; // Only on if cursor is on without auto pause enabled
-	else
-		testResult1=ETrue; // Always on if auto pause disabled
-	TBool hbState=GetHeartBeatTimerState();
-	if ((!hbState)!=(!testResult1))
-		{
-		_LIT(KLog,"Fail in TestActiveInactiveEvents(%d.%d)  HBState=%d result=%d");
-		LOG_MESSAGE5(KLog,aCursorOn,aAutoPauseOn,hbState,testResult1);
-		}
-	TEST((!GetHeartBeatTimerState())==(!testResult1));		//Works with any positive value for True
-//
-	if (aCursorOn)
-		CancelTextCursor();
-	}
-
-void CTHeartBeatTest::TestActiveInactiveEvents()
-	{
-	doTestActiveInactiveEvents(EFalse,EFalse);
-	doTestActiveInactiveEvents(ETrue,EFalse);
-	doTestActiveInactiveEvents(EFalse,ETrue);
-	doTestActiveInactiveEvents(ETrue,ETrue);
-	}
-
-void CTHeartBeatTest::FailCursorHbTest(const TDesC& aErrorBase, const TDesC* aExtraText, TBool aHbState, TBool aHbCheckState)
-	{
-	TBuf<256> error(aErrorBase);
-	if (aExtraText)
-		{
-		error.Append(*aExtraText);
-		}
-	_LIT(KHbErrorAppendFmt," HB=%d (Testing for %d)");
-	error.AppendFormat(KHbErrorAppendFmt,aHbState,aHbCheckState);
-	LOG_MESSAGE(error);
-	TEST(EFalse);
-	}
-
-TBool CTHeartBeatTest::ChangeTransAndCheckHeartBeat(TInt aTestMode, RWindow& aTransWin, const TRect& aGraphicRect, TInt aExtraWinTestMode, const TDesC* aErrorMsg, TBool aSetVisibleAfterTransUpdate)
-	{
-	TRect cursorRect(aGraphicRect);
-	cursorRect.Move(iHbTestWin->BaseWin()->InquireOffset(aTransWin));
-	TRect winRect(aTransWin.Size());
-	__ASSERT_ALWAYS(winRect.Contains(cursorRect.iTl) && winRect.Contains(cursorRect.iBr),AutoPanic(EAutoPanicHeartBeatCursorRect));
-//
-	TRegionFix<8> transRegion;
-	TBool heartBeatCheck=EFalse;
-	switch(aTestMode)
-		{
-		case ECursorTransWinTestModeFullTrans:
-			transRegion.AddRect(winRect);
-			heartBeatCheck=ETrue;
-			break;
-		case ECursorTransWinTestNoTrans:
-			break;
-		case ECursorTransWinTestPartialTransCoveringCursor:
-			transRegion.AddRect(winRect);
-			transRegion.SubRect(cursorRect);
-			break;
-		case ECursorTransWinTestPartialTransExposingCursor:
-			transRegion.AddRect(cursorRect);
-			heartBeatCheck=ETrue;
-			break;
-		default:
-			ASSERT(EFalse);
-		}
-	TBool invisHeartBeatCheck=ETrue;
-	switch(aExtraWinTestMode)
-		{
-		case ECursorTransWinTestNoTrans:
-		case ECursorTransWinTestPartialTransCoveringCursor:
-			heartBeatCheck=EFalse;
-			invisHeartBeatCheck=EFalse;
-			break;
-		default:
-			break;
-		}
-//
-	ASSERT(!transRegion.CheckError());
-	if (aSetVisibleAfterTransUpdate)
-		aTransWin.SetVisible(EFalse);
-	aTransWin.SetTransparentRegion(transRegion);
-	if (aSetVisibleAfterTransUpdate)
-		aTransWin.SetVisible(ETrue);
-//
-	TBool testSuccess=ETrue;
-	TBool heartBeatState=GetHeartBeatTimerState();
-	TBool failed1stTest=EFalse;
-	if ((!heartBeatState)!=(!heartBeatCheck))		//Works with any positive value for True
-		{
-		failed1stTest=ETrue;
-		_LIT(KFailedHbTest,"Failed ");
-		FailCursorHbTest(KFailedHbTest,aErrorMsg,heartBeatState,heartBeatCheck);
-		testSuccess=EFalse;
-		}
-//
-	aTransWin.SetVisible(EFalse);
-	heartBeatState=GetHeartBeatTimerState();
-	_LIT(KGoingInvisAfterTestAppend," after %S");
-	TBuf<256> errorExtra;
-	if (aErrorMsg)
-		{
-		errorExtra.Format(KGoingInvisAfterTestAppend,aErrorMsg);
-		}
-	if ((!heartBeatState)!=(!invisHeartBeatCheck))		//Works with any positive value for True
-		{
-		_LIT(KFailedGoingInvis,"Failed setting trans win invisible");
-		FailCursorHbTest(KFailedGoingInvis,&errorExtra,heartBeatState,invisHeartBeatCheck);
-		testSuccess=EFalse;
-		}
-//
-	aTransWin.SetVisible(ETrue);
-	heartBeatState=GetHeartBeatTimerState();
-	if (!failed1stTest && (!heartBeatState)!=(!heartBeatCheck))		//Works with any positive value for True
-		{
-		_LIT(KFailedResettingVis,"Failed re-setting trans win visible");
-		FailCursorHbTest(KFailedResettingVis,&errorExtra,heartBeatState,heartBeatCheck);
-		testSuccess=EFalse;
-		}
-	return(testSuccess);
-	}
-
-void CTHeartBeatTest::LoopThroughTransWinTestModes(RWindow& aTransWin, const TRect& aGraphicRect, TInt aExtraWinTestMode)
-	{
-	TBuf<256> error;
-	for(TInt setVisMode=0;setVisMode<2;setVisMode++)
-		{
-		if (setVisMode==0)
-			continue;	// zzz setinvis/makevis needed to flush out changes it seems
-		const TBool setVisibleAfterTransUpdate=setVisMode>0;
-		for(TInt startTestMode=0;startTestMode<ENumCursorTransWinTestModes;startTestMode++)
-			{
-			if (startTestMode==ECursorTransWinTestNoTrans)
-				continue;// zzz bugged trans win problem
-			_LIT(KTcHbModeSetFail,"setting test mode %d (vis mode %d)");
-			error.Format(KTcHbModeSetFail,startTestMode,setVisibleAfterTransUpdate);
-			for(TInt switchToTestMode=0;switchToTestMode<ENumCursorTransWinTestModes;switchToTestMode++)
-				{
-				if (switchToTestMode==ECursorTransWinTestNoTrans)
-					continue;// zzz bugged trans win problem
-				if (startTestMode==switchToTestMode)
-					continue;
-				if (ChangeTransAndCheckHeartBeat(startTestMode, aTransWin, aGraphicRect, aExtraWinTestMode, &error, setVisibleAfterTransUpdate))
-					{
-					_LIT(KTcHbModeSwitchFail,"switching from test mode %d to %d (vis mode %d)");
-					error.Format(KTcHbModeSwitchFail, startTestMode, switchToTestMode, setVisibleAfterTransUpdate);
-					ChangeTransAndCheckHeartBeat(switchToTestMode, aTransWin, aGraphicRect, aExtraWinTestMode, &error, setVisibleAfterTransUpdate);
-					}
-				}
-			}
-		ChangeTransAndCheckHeartBeat(0, aTransWin, aGraphicRect, aExtraWinTestMode, NULL, setVisibleAfterTransUpdate);
-		}
-	}
-
-void CTHeartBeatTest::RunTransWinTestsL(const TRect& aGraphicRect)
-	{
-// Test a variety of patterns of changing the layout of transparent windows over the cursor
-// cause the heartbeat state to be modified accordingly.
-//
-// Each transparent window has four specific states to test:
-// i) Transparency area is the whole window
-// ii) Partial transparency that exposes the cursor
-// iii) Partial transparency that covers the cursor
-// iv) Empty transparent region, i.e. totally opaque
-//
-// We need to test various transitions between these states, first on a single window, then
-// in a various layouts with transparent windows layered over each other.
-//
-	RWindow transWin1(TheClient->iWs);
-	User::LeaveIfError(transWin1.Construct(*TheClient->iGroup->GroupWin(),0xDEADBAD1));
-	CleanupClosePushL(transWin1);
-	if (transWin1.SetTransparencyFactor(TRgb::Gray256(128))!=KErrNone)
-		{	// Transparency not enabled, skip tests
-		CleanupStack::PopAndDestroy(&transWin1);
-		return;
-		}
-	transWin1.Activate();
-	TEST(GetHeartBeatTimerState());
-// First simply check activating default full screen transparent window doesn't disable the heartbeat
-	_LIT(KBasicTransCursorTests,"Running basic transparent window cursor heartbeat tests");
-	LOG_MESSAGE(KBasicTransCursorTests);
-	LoopThroughTransWinTestModes(transWin1, aGraphicRect, ECursorTransWinTestNA);
-//
-//  Lots of test code disabled due to bugs in handling of transparent window regions
-// See DEF110677, hopefully when the issues in there are addressed the rest of the
-// test code here can be enabled
-//  See sections marked with zzz for places where certain tests are disabled, once DEF110677
-// is marked as fixed these sections should be re-enabled and if problems still occur they
-// need to be investigated.
-//
-//
-// Now check more complex modes with two transparent windows over the test window
-	RWindow transWin2(TheClient->iWs);
-	User::LeaveIfError(transWin2.Construct(*TheClient->iGroup->GroupWin(),0xDEADBAD2));
-	CleanupClosePushL(transWin2);
-	User::LeaveIfError(transWin2.SetTransparencyFactor(TRgb::Gray256(128)));
-	TSize screenSize=TheClient->iGroup->Size();
-	screenSize.iWidth-=10;
-	transWin1.SetExtent(TPoint(0,0),screenSize);
-	transWin2.SetExtent(TPoint(10,0),screenSize);
-	transWin2.Activate();
-	for(TInt win1OrdPos=0;win1OrdPos<2;win1OrdPos++)
-		{
-		transWin1.SetOrdinalPosition(win1OrdPos);
-		_LIT(KOrdinalTransCursorTests,"Running tests with transwin1 ordinal pos=%d");
-		LOG_MESSAGE2(KOrdinalTransCursorTests,win1OrdPos);
-		for(TInt topWinTestMode=0;topWinTestMode<ENumCursorTransWinTestModes;topWinTestMode++)
-			{
-			if (topWinTestMode==ECursorTransWinTestNoTrans)
-				continue;// zzz bugged transparent window problem
-			if (topWinTestMode==ECursorTransWinTestPartialTransCoveringCursor)
-				continue;// zzz bugged transparent window problem
-			_LIT(KTopTransWinCursorTest,"Setting top trans win mode %d");
-			TBuf<256> msg;
-			msg.Format(KTopTransWinCursorTest,topWinTestMode);
-			LOG_MESSAGE(msg);
-			ChangeTransAndCheckHeartBeat(0, transWin2, aGraphicRect, topWinTestMode, NULL, ETrue);
-			LoopThroughTransWinTestModes(transWin1, aGraphicRect, topWinTestMode);
-			}
-		}
-	ChangeTransAndCheckHeartBeat(0, transWin2, aGraphicRect, 0, NULL, ETrue);
-	CleanupStack::PopAndDestroy(&transWin2);
-	TEST(GetHeartBeatTimerState());
-//
-	CleanupStack::PopAndDestroy(&transWin1);
-	TEST(GetHeartBeatTimerState());
-	}
-
-void CTHeartBeatTest::TestTextCursorTimerTransL()
-	{
-	TSize testWinSize(iHbTestWin->BaseWin()->Size());
-	TRect cursorRect(testWinSize.iWidth/4,testWinSize.iHeight/3,testWinSize.iWidth*3/4,testWinSize.iHeight*2/3);
-	TEST(!GetHeartBeatTimerState());
-	SetCursor(cursorRect.iTl,cursorRect.Size());
-	TEST(GetHeartBeatTimerState());
-	RunTransWinTestsL(cursorRect);
-	CancelTextCursor();
-	TEST(!GetHeartBeatTimerState());
-	}
-
-void CTHeartBeatTest::TestHeartBeatStopStart(TBool aHeartbeatStateOff,TBool aHeartbeatStateOn,const TDesC& aOffText,const TDesC& aOnText)
-	{
-	TEST(!aHeartbeatStateOff);
-	if (aHeartbeatStateOff)
-		LOG_MESSAGE2(_L("%S failed to disable heartbeat timer"),&aOffText);
-	TEST(aHeartbeatStateOn);
-	if (!aHeartbeatStateOn)
-		LOG_MESSAGE2(_L("%S failed to re-enable heartbeat timer"),&aOnText);
-	}
-
-void CTHeartBeatTest::TestAnimDllL(TBool aSpriteMode, TUint aSpriteFlags)
-	{
-	RTestAnim anim(iAnimDll);
-	TEST(!GetHeartBeatTimerState());
-	TSize testWinSize(iHbTestWin->BaseWin()->Size());
-	TRect animRect(1,1,testWinSize.iWidth/3,testWinSize.iWidth/5);
-	TPckgC<TRect> rectPckg(animRect);
-	RWsSprite sprite(TheClient->iWs);
-	CleanupClosePushL(sprite);
-	if (aSpriteMode)
-		{
-		sprite.Construct(*iHbTestWin->BaseWin(),TPoint(),aSpriteFlags);
-		CFbsBitmap* bitmap1=new(ELeave) CFbsBitmap();
-		CleanupStack::PushL(bitmap1);
-		CFbsBitmap* bitmap2=new(ELeave) CFbsBitmap();
-		CleanupStack::PushL(bitmap2);
-		CFbsBitmap* bitmap3=new(ELeave) CFbsBitmap();
-		CleanupStack::PushL(bitmap3);
-		TSize animSize(animRect.Size());
-		User::LeaveIfError(bitmap1->Create(TSize(animSize.iWidth/2,animSize.iHeight/2),EGray4));
-		User::LeaveIfError(bitmap2->Create(TSize(animSize.iWidth,animSize.iHeight/3),EGray4));
-		User::LeaveIfError(bitmap3->Create(TSize(animSize.iWidth/3,animSize.iHeight),EGray4));
-//
-		TSpriteMember member1;
-		member1.iMaskBitmap=NULL;
-		member1.iInvertMask=EFalse;
-		member1.iDrawMode=CGraphicsContext::EDrawModePEN;
-		member1.iOffset=TPoint();
-		member1.iInterval=TTimeIntervalMicroSeconds32(1);
-		member1.iBitmap=bitmap1;
-		member1.iMaskBitmap=bitmap1;
-		sprite.AppendMember(member1);
-//
-		TSpriteMember member2;
-		member2.iInvertMask=EFalse;
-		member2.iDrawMode=CGraphicsContext::EDrawModeXOR;
-		member2.iOffset=TPoint(1,2);
-		member2.iInterval=TTimeIntervalMicroSeconds32(2);
-		member2.iBitmap=bitmap2;
-		member2.iMaskBitmap=bitmap2;
-		sprite.AppendMember(member2);
-//
-		TSpriteMember member3;
-		member3.iInvertMask=ETrue;
-		member3.iDrawMode=CGraphicsContext::EDrawModeOR;
-		member3.iOffset=TPoint(3,4);
-		member3.iInterval=TTimeIntervalMicroSeconds32(3);
-		member3.iBitmap=bitmap3;
-		member3.iMaskBitmap=bitmap3;
-		sprite.AppendMember(member3);
-//
-		User::LeaveIfError(anim.Construct(sprite,EAnimTypeSprite,rectPckg));
-		CleanupStack::PopAndDestroy(3,bitmap1);
-		}
-	else
-		{
-		User::LeaveIfError(anim.Construct(*iHbTestWin->BaseWin(),EAnimTypeTest3,rectPckg));
-		}
-	CleanupClosePushL(anim);
-	TEST(GetHeartBeatTimerState());
-
-	// Cover up the window with the animation and check this disables the heartbeat timer.
-	RBlankWindow blankwin1(TheClient->iWs);
-	User::LeaveIfError(blankwin1.Construct(*TheClient->iGroup->GroupWin(),123));
-	TPoint winOffset(iHbTestWin->BaseWin()->InquireOffset(*TheClient->iGroup->GroupWin()));
-	if (aSpriteMode)
-		blankwin1.SetExtent(winOffset,testWinSize);
-	else
-		blankwin1.SetExtent(winOffset+animRect.iTl,animRect.Size());
-	blankwin1.Activate();
-	TBool heartbeatStateOff=GetHeartBeatTimerState();
-	TEST(!heartbeatStateOff);
-	if (heartbeatStateOff)
-		{
-		LOG_MESSAGE(_L("Covering window failed to disable heartbeat timer"));
-		}
-	TBool heartbeatStateOn;
-	if (!aSpriteMode)
-		{
-		// Resize the anim so it becomes visible, then shrink back down again
-		animRect.iBr.iX++;
-		anim.Command(EADllSetRect,rectPckg);
-		heartbeatStateOn=GetHeartBeatTimerState();
-		animRect.iBr.iX--;
-		anim.Command(EADllSetRect,rectPckg);
-		heartbeatStateOff=GetHeartBeatTimerState();
-		TestHeartBeatStopStart(heartbeatStateOff,heartbeatStateOn,_L("Shrinking anim"),_L("Growing anim"));
-		}
-//
-	blankwin1.Close();
-	heartbeatStateOn=GetHeartBeatTimerState();
-	TEST(heartbeatStateOn);
-	if (!heartbeatStateOn)
-		{
-		LOG_MESSAGE(_L("Un-covering window failed to disable heartbeat timer"));
-		}
-
-	// Put a transparent window over the animation and check the heartbeat timer is not disabled
-	RWindow transWin(TheClient->iWs);
-	User::LeaveIfError(transWin.Construct(*TheClient->iGroup->GroupWin(),123));
-	if (transWin.SetTransparencyFactor(TRgb::Gray256(128))==KErrNone)
-		{
-		transWin.Activate();
-		heartbeatStateOn=GetHeartBeatTimerState();
-		TEST(heartbeatStateOn);
-		if (!heartbeatStateOn)
-			LOG_MESSAGE(_L("Transparent window caused heartbeat timer to be disabled"));
-		TRegionFix<1> emptyRegion;
-		transWin.SetTransparentRegion(emptyRegion);
-		heartbeatStateOff=GetHeartBeatTimerState();
-		TRegionFix<1> fullRegion(transWin.Size());
-		transWin.SetTransparentRegion(fullRegion);
-		heartbeatStateOn=GetHeartBeatTimerState();
-		TestHeartBeatStopStart(heartbeatStateOff,heartbeatStateOn,_L("Making covering window opaque"),_L("Making covering window transparent"));
-		if (aSpriteMode)
-			{
-			RBlankWindow blankwin2(TheClient->iWs);
-			User::LeaveIfError(blankwin2.Construct(*iHbTestWin->BaseWin(),1234));
-			blankwin2.Activate();
-			heartbeatStateOn=GetHeartBeatTimerState();
-			// With ESpriteNoChildClip the heartbeat should still be on as the sprite will still be visible
-			// Without it blankwin2 will cover up the sprite and cancel the heartbeat
-			TBool heartBeatCheck=aSpriteFlags&ESpriteNoChildClip;
-			TEST((!heartbeatStateOn)==(!heartBeatCheck));		//Works with any positive value for True
-			blankwin2.Close();
-			}
-		transWin.SetTransparentRegion(emptyRegion);
-		heartbeatStateOff=GetHeartBeatTimerState();
-		transWin.Close();
-		heartbeatStateOn=GetHeartBeatTimerState();
-		TestHeartBeatStopStart(heartbeatStateOff,heartbeatStateOn,_L("Making covering window opaque"),_L("Un-covering window"));
-		}
-	else
-		transWin.Close();
-
-	// Make the window with the animation invisible and check this disables the heartbeat timer.
-	iHbTestWin->BaseWin()->SetVisible(EFalse);
-	heartbeatStateOff=GetHeartBeatTimerState();
-	iHbTestWin->BaseWin()->SetVisible(ETrue);
-	heartbeatStateOn=GetHeartBeatTimerState();
-	TestHeartBeatStopStart(heartbeatStateOff,heartbeatStateOn,_L("Making window invisible"),_L("Making window visible"));
-
-	// Move the window with the animation off screen and check this disables the heartbeat timer.
-	TSize screenSize=TheClient->iGroup->Size();
-	TPoint oldPos(iHbTestWin->BaseWin()->Position());
-	iHbTestWin->BaseWin()->SetPosition(screenSize.AsPoint());
-	heartbeatStateOff=GetHeartBeatTimerState();
-	iHbTestWin->BaseWin()->SetPosition(oldPos);
-	heartbeatStateOn=GetHeartBeatTimerState();
-	TestHeartBeatStopStart(heartbeatStateOff,heartbeatStateOn,_L("Moving window offscreen"),_L("Moving window back onscreen"));
-	TEST(GetHeartBeatTimerState());
-	CleanupStack::PopAndDestroy(&anim);
-	TEST(!GetHeartBeatTimerState());
-	CleanupStack::PopAndDestroy(&sprite);
-	}
-
-void CTHeartBeatTest::TestAnimDllTransL()
-	{
-	RTestAnim anim(iAnimDll);
-	TSize testWinSize(iHbTestWin->BaseWin()->Size());
-	TRect animRect(testWinSize.iWidth/4,testWinSize.iHeight/3,testWinSize.iWidth*3/4,testWinSize.iHeight*2/3);
-	TPckgBuf<TRect> rectPckg;
-	rectPckg()=animRect;
-	TEST(!GetHeartBeatTimerState());
-	User::LeaveIfError(anim.Construct(*iHbTestWin->BaseWin(),EAnimTypeTest3,rectPckg));
-	CleanupClosePushL(anim);
-	TEST(GetHeartBeatTimerState());
-//
-	RunTransWinTestsL(animRect);
-//
-	CleanupStack::PopAndDestroy(&anim);
-	TEST(!GetHeartBeatTimerState());
-	}
-
-void CTHeartBeatTest::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	
-	switch(++iTest->iState)
-		{
-		case 1:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0568
-*/
-			((CTHeartBeatTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0568"));
-			_LIT(KTestTextCursorTimer,"Basic heartbeat timer test");
-			iTest->LogSubTest(KTestTextCursorTimer);
-			TestTextCursorTimerL();
-			break;
-		case 2:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0569
-*/
-			((CTHeartBeatTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0569"));
-			_LIT(KTestTextCursorTimerTrans,"Heartbeat timer test with transparent windows");
-			iTest->LogSubTest(KTestTextCursorTimerTrans);
-			TestTextCursorTimerTransL();
-			break;
-		case 3:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0570
-*/
-			((CTHeartBeatTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0570"));
-			_LIT(KTestAnimDll1,"Anim DLL Heartbeat check (Win)");
-			iTest->LogSubTest(KTestAnimDll1);
-			TestAnimDllL(EFalse,0);
-			break;
-		case 4:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0571
-*/
-			((CTHeartBeatTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0571"));
-			_LIT(KTestAnimDll2,"Anim DLL Heartbeat check (Sprite)");
-			iTest->LogSubTest(KTestAnimDll2);
-			TestAnimDllL(ETrue,0);
-			TestAnimDllL(ETrue,ESpriteNoChildClip);
-			break;
-		case 5:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0572
-*/
-			((CTHeartBeatTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0572"));
-			_LIT(KTestAnimDllTrans,"Anim DLL Heartbeat check with transparent windows");
-			iTest->LogSubTest(KTestAnimDllTrans);
-			TestAnimDllTransL();
-			break;
-		case 6:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0573
-*/
-			((CTHeartBeatTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0573"));
-			_LIT(KTestActiveInactiveEvents,"Handling of TRawEvent::EInactive and EActive");
-			iTest->LogSubTest(KTestActiveInactiveEvents);
-			TestActiveInactiveEvents();
-			break;
-		default:
-			((CTHeartBeatTestStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTHeartBeatTestStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-			break;
-		}
-	((CTHeartBeatTestStep*)iStep)->RecordTestResultL();
-	}
-
-__WS_CONSTRUCT_STEP__(HeartBeatTest)
--- a/windowing/windowserver/tauto/THeartBeat.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __THEARTBEAT_H__
-#define __THEARTBEAT_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "AUTO.H"
-#include "TAUTODLL.H"
-
-class CTHeartBeatTest : public CTWsGraphicsBase
-	{
-public:
-	CTHeartBeatTest(CTestStep* aStep);
-	~CTHeartBeatTest();
-protected:
-//from MTestCases
-	void RunTestCaseL(TInt aCurTestCase);
-private:
-	enum TCursorTransWinTestMode
-		{
-		ECursorTransWinTestNA=-1,
-		ECursorTransWinTestModeFullTrans,
-		ECursorTransWinTestNoTrans,
-		ECursorTransWinTestPartialTransExposingCursor,
-		ECursorTransWinTestPartialTransCoveringCursor,
-		ENumCursorTransWinTestModes,
-		};
-private:
-	void SetCursor(const TPoint& aPos,const TSize& aSize, TUint aFlags=0);
-	void CancelTextCursor();
-	void ConstructL();
-	void TestTextCursorTimerL();
-	void TestTextCursorTimerTransL();
-	void RunTransWinTestsL(const TRect& aGraphicRect);
-	void LoopThroughTransWinTestModes(RWindow& aTransWin, const TRect& aGraphicRect, TInt aExtraWinTestMode);
-	TBool ChangeTransAndCheckHeartBeat(TInt aTestMode, RWindow& aTransWin, const TRect& aGraphicRect, TInt aExtraWinTestMode, const TDesC* aErrorMsg, TBool aSetVisibleAfterTransUpdate);
-	void FailCursorHbTest(const TDesC& aErrorBase, const TDesC* aExtraText, TBool aHbState, TBool aHbCheckState);
-	void TestHeartBeatStopStart(TBool aHeartbeatStateOff,TBool aHeartbeatStateOn,const TDesC& aOffText,const TDesC& aOnText);
-	TBool GetHeartBeatTimerState() const;
-	TBool SetAutoHeartBeatPauseState(TBool aState) const;
-	void TestActiveInactiveEvents();
-	void TestAnimDllL(TBool aSpriteMode, TUint aSpriteFlags);
-	void TestAnimDllTransL();
-	void doTestActiveInactiveEvents(TBool aCursorOn, TBool aAutoPauseOn);
-	static TInt DoPanicTest(TInt aInt, TAny* aScreenNumber);
-private:
-	RAnimDll iAnimDll;
-	CAnimWindow* iHbTestWin;
-	};
-
-class CTHeartBeatTestStep : public CTGraphicsStep
-	{
-public:
-	CTHeartBeatTestStep();
-protected:	
-	//from CTGraphicsStep
-	CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTHeartBeatTestStep,"THeartBeatTest");
-
-#endif
--- a/windowing/windowserver/tauto/TKEY.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1119 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Testing key event, capturing keys and hot keys
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-
-#include "TKEY.H"
-
-#define LOGGING 1	//Uncomment this when there is a fail so that you get more logging
-
-GLDEF_D ClientToKill *SecondClient=NULL;
-
-GLDEF_C CTClient *CreateClientToKillL()
-	{
-	return(SecondClient=new(ELeave) ClientToKill());
-	}
-
-GLDEF_C TInt ProcToKill(TAny *aScreenNumber)
-	{
-	TInt ret=KErrNone;
-	ret=TestLibStartUp(CreateClientToKillL,(TInt)aScreenNumber);
-	return(ret);
-	}
-
-CVisibleGroup::CVisibleGroup(TInt aScreenNo): iScreenNo(aScreenNo)
-	{}
-
-void CVisibleGroup::ConstructL()
-	{
-	User::LeaveIfError(iWs.Connect());
-	iScr=new(ELeave) CWsScreenDevice(iWs);
-	User::LeaveIfError(iScr->Construct(iScreenNo));
-	iScr->SetAppScreenMode(iMode);
-	iGroup=RWindowGroup(iWs);
-	User::LeaveIfError(iGroup.Construct(NULL,ETrue));
-	TInt id=TheClient->iGroup->GroupWin()->Identifier();
-	iGroup.SetOwningWindowGroup(id);
-#if defined(LOGGING)
-	TLogMessageText buf;
-	_LIT(KIds,"Window Group Id: Main=%d, 2nd Client=%d");
-	buf.Format(KIds,id,iGroup.Identifier());
-	iWs.LogMessage(buf);
-#endif
-	iWs.Flush();
-	}
-
-CVisibleGroup::~CVisibleGroup()
-	{
-	iGroup.Close();
-	delete iScr;
-	iWs.Close();
-	}
-
-void CVisibleGroup::SetMode(TInt aMode)
-	{
-	iMode=aMode;
-	iScr->SetAppScreenMode(iMode);
-	iWs.Flush();
-	}
-
-ClientToKill::ClientToKill()
-	{}
-
-void ClientToKill::ConstructL()
-	{
-	CTClient::ConstructL();
-	RSemaphore sem;
-	sem.OpenGlobal(KSemaphoreName);
-
-	iGroup=new(ELeave) TestWindowGroup(this);
-	iGroup->ConstructL();
-
-	iScreen->SetScreenMode(0);
-	TSize screenSize=iScreen->SizeInPixels();
-
-	TInt winWidth=3*screenSize.iWidth/4;
-	TInt winHeight=3*screenSize.iHeight/4;
-	iTestWin=new(ELeave) TestWindow();
-	iTestWin->SetUpL(TPoint((screenSize.iWidth+4)/8,(screenSize.iHeight+4)/8),TSize(winWidth,winHeight),iGroup,*iGc);
-
-#if defined(LOGGING)
-	TLogMessageText buf;
-	_LIT(KId,"Window Group Id in 2nd Process=%d");
-	buf.Format(KId,iGroup->GroupWin()->Identifier());
-	LogMessage(buf);
-#endif
-	sem.Signal();	// Signal thread fully initialised
-	sem.Close();
-	}
-
-ClientToKill::~ClientToKill()
-	{
-	delete iTestWin;
-	}
-
-
-// CTKey
-
-CTKey::CTKey(CTestStep* aStep) : CTWsGraphicsBase(aStep)
-	{
-	}
-
-
-
-void CTKey::ConstructL()
-	{
-	iSem.CreateGlobal(KSemaphoreName,0,KOwnerType);
-	iVisibleGroup=new(ELeave) CVisibleGroup(iTest->iScreenNumber);
-	iVisibleGroup->ConstructL();
-	}
-
-CTKey::~CTKey()
-	{
-	delete iVisibleGroup;
-	iSem.Close();
-	// Set focus back to this screen as it went to primary screen when iVisibleGroup was destroyed
-	// Wserv focus handling made focus screen switch to another screen if there is no
-	// focusable window group on that particular screen.
-	TheClient->iWs.SetFocusScreen(iTest->iScreenNumber);
-	}
-
-void CTKey::SendKey(TInt aScanCode)
-	{
-	TKeyEvent keyEvent;
-	keyEvent.iCode=aScanCode;
-	keyEvent.iScanCode=aScanCode;
-	keyEvent.iModifiers=0;
-	keyEvent.iRepeats=0;
-	TheClient->iWs.SimulateKeyEvent(keyEvent);
-	TheClient->iWs.Flush();
-	}
-
-void CTKey::SendUpDown(TInt aScanCode)
-	{
-	TRawEvent rawEvent;
-	rawEvent.Set(TRawEvent::EKeyDown,aScanCode);
-	TheClient->iWs.SimulateRawEvent(rawEvent);
-	rawEvent.Set(TRawEvent::EKeyUp,aScanCode);
-	TheClient->iWs.SimulateRawEvent(rawEvent);
-	}
-
-void CTKey::SendCtrlAltShift(TRawEvent::TType aType)
-	{
-	TRawEvent rawEvent;
-	rawEvent.Set(aType,EStdKeyLeftFunc);
-	TheClient->iWs.SimulateRawEvent(rawEvent);
-	rawEvent.Set(aType,EStdKeyLeftCtrl);
-	TheClient->iWs.SimulateRawEvent(rawEvent);
-	rawEvent.Set(aType,EStdKeyLeftShift);
-	TheClient->iWs.SimulateRawEvent(rawEvent);
-	}
-
-void CTKey::SendCtrlAltShift(TInt aScanCode)
-	{
-	SendCtrlAltShift(TRawEvent::EKeyDown);
-	SendUpDown(aScanCode);
-	SendCtrlAltShift(TRawEvent::EKeyUp);
-	TheClient->iWs.Flush();
-	}
-
-void CTKey::LogWindowGroupIds()
-	{
-	CArrayFixFlat<TInt>* idList=new(ELeave) CArrayFixFlat<TInt>(5);
-	if (!idList)
-		return;
-	TheClient->iWs.WindowGroupList(0,idList);
-	TLogMessageText buf;
-	_LIT(KWinGp,"Window Group Id's: %d");
-	_LIT(KId,", %d");
-	TInt ii=0;
-	buf.Format(KWinGp,(*idList)[ii]);
-	while (++ii<idList->Count())
-		buf.AppendFormat(KId,(*idList)[ii]);
-	LOG_MESSAGE(buf);
-	delete idList;
-	}
-
-void CTKey::SetHotKey(THotKey aType, TUint aKeyCode)
-	{
-	TheClient->iWs.SetHotKey(aType,aKeyCode-'A'+1,EFuncCtrlShift,EFuncCtrlShift);
-	}
-
-void CTKey::KeyOfOrientation()
-	{	
-	TInt numScreenModes = TheClient->iScreen->NumScreenModes();
-	TInt originalScreenMode = TheClient->iScreen->CurrentScreenMode();
-	if(numScreenModes >= 2)
-		{
-		//1 possible rotation of 180deg found in wsini.ini screenmode 8
-		iVisibleGroup->SetMode(numScreenModes-1);
-		TheClient->iScreen->SetScreenMode(numScreenModes-1);
-		SendCtrlAltShift('O');
-		TheClient->iWs.Flush();
-		//1 possible rotation of 90deg found in wsini.ini screenmode 7
-		iVisibleGroup->SetMode(numScreenModes-2);
-		TheClient->iScreen->SetScreenMode(numScreenModes-2);
-		SendCtrlAltShift('O');
-		TheClient->iWs.Flush();
-		//reset to original screenmode
-		iVisibleGroup->SetMode(originalScreenMode);
-		TheClient->iScreen->SetScreenMode(originalScreenMode);
-		}	
-	else
-		{
-		TEST(numScreenModes>2);
-		INFO_PRINTF2(_L("numScreenModes - Expected: >2, Actual: %d"), numScreenModes);
-		}
-	TPixelsAndRotation originalSizeAndRotation;
-	TheClient->iScreen->GetScreenModeSizeAndRotation(TheClient->iScreen->CurrentScreenMode(),originalSizeAndRotation);
-	SendCtrlAltShift('O');
-	TheClient->iWs.Flush();
-	TPixelsAndRotation sizeAndRotation;
-	TheClient->iScreen->GetScreenModeSizeAndRotation(TheClient->iScreen->CurrentScreenMode(),sizeAndRotation);
-	TEST(sizeAndRotation.iRotation!=originalSizeAndRotation.iRotation);
-	if (sizeAndRotation.iRotation==originalSizeAndRotation.iRotation)
-		INFO_PRINTF3(_L("iRotation - Not Expected: %d, Actual: %d"), originalSizeAndRotation.iRotation, sizeAndRotation.iRotation);
-	SendCtrlAltShift('O');
-	TheClient->iWs.Flush();
-	}
-
-void CTKey::CycleDisplaySize()
-	{
-	// The test does nothing if there is only one possible screen mode -> return
-	TInt numScreenModes = TheClient->iScreen->NumScreenModes();
-	if (numScreenModes<2)
-		{
-		TEST(numScreenModes>2);
-		INFO_PRINTF2(_L("numScreenModes - Expected: >2, Actual: %d"), numScreenModes);
-		return;
-		}
-	//Get original screen mode and size values
-	TInt originalScreenMode = TheClient->iScreen->CurrentScreenMode();	
-	TPixelsAndRotation sizeAndRotation;
-	TheClient->iScreen->GetScreenModeSizeAndRotation(TheClient->iScreen->CurrentScreenMode(),sizeAndRotation);
-	TSize originalScreenSize = sizeAndRotation.iPixelSize;
-	
-	SendCtrlAltShift('U');
-	TheClient->iWs.Flush();
-	TheClient->iScreen->GetScreenModeSizeAndRotation(TheClient->iScreen->CurrentScreenMode(),sizeAndRotation);
-	TEST(sizeAndRotation.iPixelSize.iHeight!=originalScreenSize.iHeight && sizeAndRotation.iPixelSize.iWidth!=originalScreenSize.iWidth);
-	if (sizeAndRotation.iPixelSize.iHeight==originalScreenSize.iHeight || sizeAndRotation.iPixelSize.iWidth==originalScreenSize.iWidth)
-		INFO_PRINTF5(_L("iPixelSize - Expected: !%d !%d, Actual: %d %d"), originalScreenSize.iHeight, originalScreenSize.iWidth, sizeAndRotation.iPixelSize.iHeight, sizeAndRotation.iPixelSize.iWidth);
-	TheClient->iScreen->SetScreenMode(originalScreenMode);
-	TheClient->iWs.Flush();
-	}
-
-void CTKey::KeyOfDeathL()
-	{
-	//Key of Death
-#if defined(LOGGING)
-	TLogMessageText buf;
-	_LIT(KNum1,"Priority Zero Window Groups=%d Total=%d (Before Process Creation)");
-	buf.Format(KNum1,TheClient->iWs.NumWindowGroups(0),TheClient->iWs.NumWindowGroups());
-	LOG_MESSAGE(buf);
-	LogWindowGroupIds();
-#endif
-	CProcess* process = CProcess::NewL(CProcess::eProcessKeyTest,iTest->iScreenNumber);
-	RWindowGroup group(TheClient->iWs);
-	group.Construct(1234);
-	TheClient->Flush();		//Make sure the window group above is created before the one in the other process
-	TInt id=TheClient->iGroup->GroupWin()->Identifier();
-	group.SetOwningWindowGroup(id);
-	group.DefaultOwningWindow();
-
-	iSem.Wait();
-	User::After(TTimeIntervalMicroSeconds32(100000));		//0.1 secs
-	TInt numGroups=TheClient->iWs.NumWindowGroups();
-	TInt numGroups0=TheClient->iWs.NumWindowGroups(0);
-
-#if defined(LOGGING)
-	_LIT(KNum2,"NewWinGpId=%d Priority Zero Window Groups=%d Total=%d (After Process Creation)");
-	buf.Format(KNum2,id,numGroups0,numGroups);
-	LOG_MESSAGE(buf);
-	_LIT(KLog1,"Sending Key Of Death");
-	buf.Copy(KLog1);
-	LOG_MESSAGE(buf);
-	LogWindowGroupIds();
-#endif
-	group.SetOrdinalPosition(1);		//Make sure that the window group we have just created is behind the one created by the other process (belt and braces)
-	SendCtrlAltShift('K');
-	TheClient->iWs.Flush();
-#if defined(LOGGING)
-	_LIT(KLog2,"Sent Key Of Death");
-	buf.Copy(KLog2);
-	LOG_MESSAGE(buf);
-#endif
-	TInt numGroups2;
-	TInt numGroups0b;
-	TInt tries=3;
-	FOREVER		//On multi-core platforms need to wait for the Key of Death procedure to complete
-		{
-		numGroups2=TheClient->iWs.NumWindowGroups();
-		numGroups0b=TheClient->iWs.NumWindowGroups(0);
-		if (--tries==0)
-			break;
-		if (numGroups!=numGroups2 || numGroups0!=numGroups0b)
-			{
-			tries=1;
-			continue;
-			}
-		User::After(100000);		//0.1secs
-		}
-	TEST(numGroups==numGroups2+1);
-	_LIT(KLog,"KeyOfDeath Num WinGps Before=%d After=%d (should be one less)");
-	if (numGroups!=numGroups2+1)
-		LOG_MESSAGE3(KLog,numGroups,numGroups2);
-	TEST(numGroups0==numGroups0b+1);
-	if (numGroups0!=numGroups0b+1)
-		LOG_MESSAGE3(KLog,numGroups0,numGroups0b);
-	group.Close();
-
-	TBool processDead=!process->StillAlive();
-	TEST(processDead);
-	if (!processDead)
-		{
-		_LIT(KLog,"Other Thread Still Alive");
-		LOG_MESSAGE(KLog);
-		}
-	delete process;
-
-#if defined(LOGGING)
-	_LIT(KLog3,"Finished KeyOfDeath Test");
-	buf.Copy(KLog3);
-	LOG_MESSAGE(buf);
-	LogWindowGroupIds();
-#endif
-	}
-
-#define CONTRAST_UP 'A'		//'a'-'a'+1
-#define CONTRAST_DOWN 'B'		//'b'-'a'+1
-
-void CTKey::TestContrastL(TBool aChange)
-	{
-	TInt contrast=0;
-	TInt newContrast=0;
-	TInt maxContrast=0;
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EDisplayContrastMax,maxContrast));
-	TInt diff=aChange ? 1:0;
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EDisplayContrast,contrast));
-
-	SendCtrlAltShift(CONTRAST_UP);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EDisplayContrast,newContrast));
-	if ((contrast==maxContrast) && aChange)
-		{
-		TEST(newContrast==0);
-		if (newContrast!=0)
-			INFO_PRINTF3(_L("newContrast==0 - Expected: %d, Actual: %d"), 0, newContrast);		
-		}
-	else
-		{
-		TEST(contrast+diff==newContrast);
-		if (contrast+diff!=newContrast)
-			INFO_PRINTF3(_L("contrast+diff==newContrast - Expected: %d, Actual: %d"), contrast+diff, newContrast);
-		}
-
-	SendCtrlAltShift(CONTRAST_DOWN);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EDisplayContrast,newContrast));
-	TEST(contrast==newContrast);
-	if (contrast!=newContrast)
-			INFO_PRINTF3(_L("contrast==newContrast - Expected: %d, Actual: %d"), contrast, newContrast);
-
-	SendCtrlAltShift(CONTRAST_DOWN);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EDisplayContrast,newContrast));
-	if (contrast==0)
-		{
-		TEST(maxContrast==newContrast);
-		if (maxContrast!=newContrast)
-			INFO_PRINTF3(_L("maxContrast==newContrast - Expected: %d, Actual: %d"), maxContrast, newContrast);
-
-		}
-	else
-		{
-		TEST(contrast-diff==newContrast);
-		if (contrast-diff!=newContrast)
-			INFO_PRINTF3(_L("contrast-diff==newContrast - Expected: %d, Actual: %d"), contrast-diff, newContrast);
-
-		}
-
-	SendCtrlAltShift(CONTRAST_UP);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EDisplayContrast,newContrast));
-	TEST(contrast==newContrast);
-	if (contrast!=newContrast)
-		INFO_PRINTF3(_L("contrast==newContrast - Expected: %d, Actual: %d"), contrast, newContrast);
-
-	}
-
-void CTKey::TestDefaultContrastL(TBool aChange)
-	{
-	TInt contrast=0;
-	TInt newContrast=0;
-	TInt maxContrast=0;
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EDisplayContrastMax,maxContrast));
-	TInt diff=aChange ? 1:0;
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EDisplayContrast,contrast));
-
-	SendKey(EKeyIncContrast);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EDisplayContrast,newContrast));
-	if ((contrast==maxContrast) && aChange)
-		{
-		TEST(newContrast==0);
-		if (0!=newContrast)
-			INFO_PRINTF3(_L("newContrast==0 - Expected: %d, Actual: %d"), 0, newContrast);
-		}
-	else
-		{
-		TEST(contrast+diff==newContrast);
-		if (contrast+diff!=newContrast)
-			INFO_PRINTF3(_L("newContrast==contrast+diff - Expected: %d, Actual: %d"), contrast+diff, newContrast);
-		}
-
-	SendKey(EKeyDecContrast);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EDisplayContrast,newContrast));
-	TEST(contrast==newContrast);
-	if (contrast!=newContrast)
-			INFO_PRINTF3(_L("contrast==newContrast - Expected: %d, Actual: %d"), contrast, newContrast);
-
-	SendKey(EKeyDecContrast);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EDisplayContrast,newContrast));
-	if (contrast==0)
-		{
-		TEST(maxContrast==newContrast);
-		if (maxContrast!=newContrast)
-			INFO_PRINTF3(_L("maxContrast==newContrast - Expected: %d, Actual: %d"), maxContrast, newContrast);
-		}
-	else
-		{
-		TEST(contrast-diff==newContrast);
-		if (contrast-diff!=newContrast)
-			INFO_PRINTF3(_L("contrast-diff==newContrast - Expected: %d, Actual: %d"), contrast-diff, newContrast);
-		}
-
-	SendKey(EKeyIncContrast);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EDisplayContrast,newContrast));
-	TEST(contrast==newContrast);
-	if (contrast!=newContrast)
-		INFO_PRINTF3(_L("contrast==newContrast - Expected: %d, Actual: %d"), contrast, newContrast);
-
-	}
-
-void CTKey::ContrastKeysL()
-	{
-	TInt maxContrast=0;
-	TInt contrast=0;
-	TInt err=HAL::Get(iTest->iScreenNumber,HALData::EDisplayContrastMax,maxContrast);
-	if (err==KErrNotSupported)
-		return;
-	else if (err==KErrNone)
-		err=HAL::Get(iTest->iScreenNumber,HALData::EDisplayContrast,contrast);
-	if (err==KErrNotSupported)
-		return;
-	TEST(err==KErrNone);
-	if (err!=KErrNone)
-		INFO_PRINTF3(_L("HAL::Get(iTest->iScreenNumber,HALData::EDisplayContrast,contrast)=KErrNone - Expected: %d, Actual: %d"), KErrNone, err);
-
-	if (contrast==0)
-		err=HAL::Set(iTest->iScreenNumber,HALData::EDisplayContrast,++contrast);
-	else if (contrast==maxContrast)
-		err=HAL::Set(iTest->iScreenNumber,HALData::EDisplayContrast,--contrast);
-	if (err==KErrNotSupported)
-		return;
-	TEST(err==KErrNone);
-	if (err!=KErrNone)
-		INFO_PRINTF3(_L("HAL::Get(iTest->iScreenNumber,HALData::EDisplayContrast,contrast)=KErrNone - Expected: %d, Actual: %d"), KErrNone, err);
-	TestDefaultContrastL(ETrue);
-
-	SetHotKey(EHotKeyIncContrast,CONTRAST_UP);
-	SetHotKey(EHotKeyDecContrast,CONTRAST_DOWN);
-	TestContrastL(ETrue);
-	TestDefaultContrastL(ETrue);
-
-	TheClient->iWs.ClearHotKeys(EHotKeyIncContrast);
-	TheClient->iWs.ClearHotKeys(EHotKeyDecContrast);
-	TestContrastL(EFalse);
-	TestDefaultContrastL(EFalse);
-
-	TheClient->iWs.RestoreDefaultHotKey(EHotKeyIncContrast);
-	TheClient->iWs.RestoreDefaultHotKey(EHotKeyDecContrast);
-	TestContrastL(EFalse);
-	TestDefaultContrastL(ETrue);
-
-	SetHotKey(EHotKeyIncContrast,CONTRAST_UP);
-	SetHotKey(EHotKeyDecContrast,CONTRAST_DOWN);
-	TestContrastL(ETrue);
-	TestDefaultContrastL(ETrue);
-
-	TheClient->iWs.RestoreDefaultHotKey(EHotKeyIncContrast);
-	TheClient->iWs.RestoreDefaultHotKey(EHotKeyDecContrast);
-	TestContrastL(EFalse);
-	TestDefaultContrastL(ETrue);
-	}
-
-#define BACKLIGHT_ON 'A'	//'o'-'a'+1
-#define BACKLIGHT_OFF 'B'	//'p'-'a'+1
-#define BACKLIGHT_TOGGLE 'C'	//'q'-'a'+1
-/** Test for reaction against backlight ON/OFF/TOGGLE buttons defined above.
-  If aChange is false button presses must not affect the state of backlight.
-*/
-void CTKey::TestBackLightL(TBool aChange)
-	{
-	TBool state;
-	SendCtrlAltShift(BACKLIGHT_ON);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EBacklightState,state));
-	TEST(state==aChange);
-	if (state!=aChange)
-		INFO_PRINTF3(_L("state==aChange - Expected: %d, Actual: %d"), aChange, state);
-
-	SendCtrlAltShift(BACKLIGHT_TOGGLE);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EBacklightState,state));
-	TEST(state==EFalse);
-	if (state!=EFalse)
-		INFO_PRINTF3(_L("state==EFalse - Expected: %d, Actual: %d"), EFalse, state);
-
-	SendCtrlAltShift(BACKLIGHT_TOGGLE);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EBacklightState,state));
-	TEST(state==aChange);
-	if (state!=aChange)
-		INFO_PRINTF3(_L("state==aChange - Expected: %d, Actual: %d"), aChange, state);
-
-	SendCtrlAltShift(BACKLIGHT_OFF);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EBacklightState,state));
-	TEST(state==EFalse);
-	if (state!=EFalse)
-		INFO_PRINTF3(_L("state==EFalse - Expected: %d, Actual: %d"), EFalse, state);
-
-	SendCtrlAltShift(BACKLIGHT_TOGGLE);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EBacklightState,state));
-	TEST(state==aChange);
-		if (state!=aChange)
-		INFO_PRINTF3(_L("state==aChange - Expected: %d, Actual: %d"), aChange, state);
-
-	SendCtrlAltShift(BACKLIGHT_TOGGLE);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EBacklightState,state));
-	TEST(state==EFalse);
-	if (state!=EFalse)
-		INFO_PRINTF3(_L("state==EFalse - Expected: %d, Actual: %d"), EFalse, state);
-
-	}
-
-/** Test for reaction against default backlight ON/OFF/TOGGLE buttons.
-  If aChange is false button presses must not affect the state of backlight.
-*/
-void CTKey::TestDefaultBackLightL(TBool aChange)
-	{
-	TBool state;
-	SendKey(EKeyBacklightOn);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EBacklightState,state));
-	TEST(state==aChange);
-	if (state!=aChange)
-		INFO_PRINTF3(_L("state==aChange - Expected: %d, Actual: %d"), aChange, state);
-
-	SendKey(EKeyBacklightToggle);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EBacklightState,state));
-	TEST(state==EFalse);
-	if (state!=EFalse)
-		INFO_PRINTF3(_L("state==EFalse - Expected: %d, Actual: %d"), EFalse, state);
-
-	SendKey(EKeyBacklightToggle);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EBacklightState,state));
-	TEST(state==aChange);
-	if (state!=aChange)
-		INFO_PRINTF3(_L("state==aChange - Expected: %d, Actual: %d"), aChange, state);
-
-	SendKey(EKeyBacklightOff);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EBacklightState,state));
-	TEST(state==EFalse);
-	if (state!=EFalse)
-		INFO_PRINTF3(_L("state==EFalse - Expected: %d, Actual: %d"), EFalse, state);
-
-	SendKey(EKeyBacklightToggle);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EBacklightState,state));
-	TEST(state==aChange);
-	if (state!=aChange)
-		INFO_PRINTF3(_L("state==aChange - Expected: %d, Actual: %d"), aChange, state);
-
-	SendKey(EKeyBacklightToggle);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EBacklightState,state));
-	TEST(state==EFalse);
-	if (state!=EFalse)
-		INFO_PRINTF3(_L("state==EFalse - Expected: %d, Actual: %d"), EFalse, state);
-
-	}
-
-void CTKey::BackLightKeysL()
-	{
-	// Turns backlight off
-	TBool prevState;
-	TInt err=HAL::Get(iTest->iScreenNumber,HALData::EBacklightState,prevState);
-	if (err==KErrNotSupported)
-		{
-		_LIT(KLog,"Cannot test BackLight Key presses as cannot read its state on screen %d");
-		LOG_MESSAGE2(KLog,iTest->iScreenNumber);
-		return;
-		}
-	else if (err==KErrNone)
-		err=HAL::Set(iTest->iScreenNumber,HALData::EBacklightState,EFalse);
-	if (err==KErrNotSupported)
-		{
-		_LIT(KLog,"Cannot test BackLight Key presses as cannot set its state on screen %d");
-		LOG_MESSAGE2(KLog,iTest->iScreenNumber);
-		return;
-		}
-	TEST(err==KErrNone);
-	if (err!=KErrNone)
-		{
-		_LIT(KLog,"Reading or Setting BackLight state gave error %d on screen %d");
-		LOG_MESSAGE3(KLog,err,iTest->iScreenNumber);
-		}
-
-	// Tests that default backlight ON/OFF/TOGGLE buttons work
-	TestDefaultBackLightL(ETrue);
-
-	// Sets user defined backlight buttons and tests that both default and user defined buttons work
-	SetHotKey(EHotKeyBacklightOn,BACKLIGHT_ON);
-	SetHotKey(EHotKeyBacklightOff,BACKLIGHT_OFF);
-	SetHotKey(EHotKeyBacklightToggle,BACKLIGHT_TOGGLE);
-	TestBackLightL(ETrue);
-	TestDefaultBackLightL(ETrue);
-
-	// Calls RWsSession::ClearHotKeys and tests that both default and user defined buttons don't work
-	TheClient->iWs.ClearHotKeys(EHotKeyBacklightOn);
-	TheClient->iWs.ClearHotKeys(EHotKeyBacklightOff);
-	TheClient->iWs.ClearHotKeys(EHotKeyBacklightToggle);
-	TestBackLightL(EFalse);
-	TestDefaultBackLightL(EFalse);
-
-	// Calls RWsSession::RestoreDefaultHotKey and tests that only default buttons work
-	TheClient->iWs.RestoreDefaultHotKey(EHotKeyBacklightOn);
-	TheClient->iWs.RestoreDefaultHotKey(EHotKeyBacklightOff);
-	TheClient->iWs.RestoreDefaultHotKey(EHotKeyBacklightToggle);
-	TestBackLightL(EFalse);
-	TestDefaultBackLightL(ETrue);
-
-	// Sets user defined backlight buttons and tests that both default and user defined buttons work
-	SetHotKey(EHotKeyBacklightOn,BACKLIGHT_ON);
-	SetHotKey(EHotKeyBacklightOff,BACKLIGHT_OFF);
-	SetHotKey(EHotKeyBacklightToggle,BACKLIGHT_TOGGLE);
-	TestBackLightL(ETrue);
-	TestDefaultBackLightL(ETrue);
-
-	// Calls RWsSession::RestoreDefaultHotKey and tests that only default buttons work
-	TheClient->iWs.RestoreDefaultHotKey(EHotKeyBacklightOn);
-	TheClient->iWs.RestoreDefaultHotKey(EHotKeyBacklightOff);
-	TheClient->iWs.RestoreDefaultHotKey(EHotKeyBacklightToggle);
-	TestBackLightL(EFalse);
-	TestDefaultBackLightL(ETrue);
-
-	//Restores previous backlight state
-	//err=UserHal::SetBacklightOn(prevState);
-	err=HAL::Set(iTest->iScreenNumber,HALData::EBacklightState,prevState);
-	TEST(err==KErrNone);
-	if (err!=KErrNone)
-		{
-		_LIT(KLog,"Failed to set BackLight state back to previous state: %d on screen %d, error code: %d");
-		LOG_MESSAGE4(KLog,prevState,iTest->iScreenNumber,err);
-		}
-	}
-
-#define BRIGHTNESS_UP 'N'
-#define BRIGHTNESS_DOWN 'J'
-/** If aChange is true, checks that programmicaly defined brightness buttons increase and decrease brightness properly.
- If aChange is false, checks that programmicaly defined brightness buttons don't affect brightness.
-*/
-void CTKey::TestBrightnessL(TBool aChange)
-	{
-	TInt brightness;
-	TInt newBrightness;
-	TInt diff=aChange ? 1:0;
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EDisplayBrightness,brightness));
-
-	SendCtrlAltShift(BRIGHTNESS_UP);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EDisplayBrightness,newBrightness));
-	TEST(brightness+diff==newBrightness);
-	if (brightness+diff!=newBrightness)
-		INFO_PRINTF3(_L("brightness+diff==newBrightness - Expected: %d, Actual: %d"), newBrightness, brightness+diff);
-
-	SendCtrlAltShift(BRIGHTNESS_DOWN);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EDisplayBrightness,newBrightness));
-	TEST(brightness==newBrightness);
-	if (brightness!=newBrightness)
-		INFO_PRINTF3(_L("brightness==newBrightness - Expected: %d, Actual: %d"), newBrightness, brightness);
-
-	SendCtrlAltShift(BRIGHTNESS_DOWN);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EDisplayBrightness,newBrightness));
-	TEST(brightness-diff==newBrightness);
-	if (brightness-diff!=newBrightness)
-		INFO_PRINTF3(_L("brightness-diff==newBrightness - Expected: %d, Actual: %d"), newBrightness, brightness-diff);
-
-	SendCtrlAltShift(BRIGHTNESS_UP);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EDisplayBrightness,newBrightness));
-	TEST(brightness==newBrightness);
-	if (brightness!=newBrightness)
-		INFO_PRINTF3(_L("brightness==newBrightness - Expected: %d, Actual: %d"), newBrightness, brightness);
-	}
-
-/** If aChange is true, checks that default brightness buttons increase and decrease brightness properly (increase/decrease by 1).
-  If aChange is false, checks that default brightness buttons don't affect brightness.
-*/
-void CTKey::TestDefaultBrightnessL(TBool aChange)
-	{
-	TInt brightness;
-	TInt newBrightness;
-	TInt diff=aChange ? 1:0;
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EDisplayBrightness,brightness));
-
-	SendKey(EKeyIncBrightness);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EDisplayBrightness,newBrightness));
-	TEST(brightness+diff==newBrightness);
-	if (brightness+diff!=newBrightness)
-		INFO_PRINTF3(_L("brightness+diff==newBrightness - Expected: %d, Actual: %d"), newBrightness, brightness+diff);
-
-	SendKey(EKeyDecBrightness);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EDisplayBrightness,newBrightness));
-	TEST(brightness==newBrightness);
-	if (brightness!=newBrightness)
-		INFO_PRINTF3(_L("brightness==newBrightness - Expected: %d, Actual: %d"), newBrightness, brightness);
-
-	SendKey(EKeyDecBrightness);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EDisplayBrightness,newBrightness));
-	TEST(brightness-diff==newBrightness);
-	if (brightness-diff!=newBrightness)
-		INFO_PRINTF3(_L("brightness-diff==newBrightness - Expected: %d, Actual: %d"), newBrightness, brightness-diff);
-
-	SendKey(EKeyIncBrightness);
-	User::LeaveIfError(HAL::Get(iTest->iScreenNumber,HALData::EDisplayBrightness,newBrightness));
-	TEST(brightness==newBrightness);
-	if (brightness!=newBrightness)
-		INFO_PRINTF3(_L("brightness==newBrightness - Expected: %d, Actual: %d"), newBrightness, brightness);
-	}
-
-void CTKey::BrightnessKeysL()
-	{
-	INFO_PRINTF1(_L("AUTO  Brightness Key Test "));
-	TInt maxBrightness;
-	TInt brightness=0;		//To stop warning
-	// get maximum brightness and current
-	TInt err=HAL::Get(iTest->iScreenNumber,HALData::EDisplayBrightnessMax,maxBrightness);
-	if (err==KErrNotSupported)
-		return;
-	else if (err==KErrNone)
-		err=HAL::Get(iTest->iScreenNumber,HALData::EDisplayBrightness,brightness);
-	if (err==KErrNotSupported)
-		return;
-	INFO_PRINTF1(_L(" Supported"));
-	TEST(err==KErrNone);
-	if (err!=KErrNone)
-		INFO_PRINTF3(_L("HAL::Get(iTest->iScreenNumber,HALData::EDisplayBrightness,brightness) return value - Expected: %d, Actual: %d"), KErrNone, err);
-
-	// sets brightness to be neither maximal nor minimal
-	if (brightness==0)
-		err=HAL::Set(iTest->iScreenNumber,HALData::EDisplayBrightness,++brightness);
-	else if (brightness==maxBrightness)
-		err=HAL::Set(iTest->iScreenNumber,HALData::EDisplayBrightness,--brightness);
-	if (err==KErrNotSupported)
-		return;
-	INFO_PRINTF1(_L(" Changeable"));
-	TEST(err==KErrNone);
-	if (err!=KErrNone)
-		INFO_PRINTF3(_L("HAL::Get(iTest->iScreenNumber,HALData::EDisplayBrightness,brightness) return value - Expected: %d, Actual: %d"), KErrNone, err);
-
-	// Test default brightness buttons increase/decrease brightness by 1
-	TestDefaultBrightnessL(ETrue);
-
-	// Add new inc/dec buttons, test that default and program defined brightness buttons increase/decrease brightness by 1
-	INFO_PRINTF1(_L(" First Test"));
-	SetHotKey(EHotKeyIncBrightness,BRIGHTNESS_UP);
-	SetHotKey(EHotKeyDecBrightness,BRIGHTNESS_DOWN);
-	TestBrightnessL(ETrue);
-	TestDefaultBrightnessL(ETrue);
-
-	// Clear brightness buttons, test that default and program defined brightness buttons doesn't affect brightness
-	INFO_PRINTF1(_L(" Second Test"));
-	TheClient->iWs.ClearHotKeys(EHotKeyIncBrightness);
-	TheClient->iWs.ClearHotKeys(EHotKeyDecBrightness);
-	TestBrightnessL(EFalse);
-	TestDefaultBrightnessL(EFalse);
-
-	// Restore default brightness buttons, test that only default brightness buttons increase/decrease brightness by 1
-	INFO_PRINTF1(_L(" Third Test"));
-	TheClient->iWs.RestoreDefaultHotKey(EHotKeyIncBrightness);
-	TheClient->iWs.RestoreDefaultHotKey(EHotKeyDecBrightness);
-	TestBrightnessL(EFalse);
-	TestDefaultBrightnessL(ETrue);
-
-	// Add new inc/dec buttons, test that default and program defined brightness buttons increase/decrease brightness by 1
-	INFO_PRINTF1(_L(" Fourth Test"));
-	SetHotKey(EHotKeyIncBrightness,BRIGHTNESS_UP);
-	SetHotKey(EHotKeyDecBrightness,BRIGHTNESS_DOWN);
-	TestBrightnessL(ETrue);
-	TestDefaultBrightnessL(ETrue);
-
-	// Restore default brightness buttons, test that only default brightness buttons increase/decrease brightness by 1
-	INFO_PRINTF1(_L(" Fifth Test"));
-	TheClient->iWs.RestoreDefaultHotKey(EHotKeyIncBrightness);
-	TheClient->iWs.RestoreDefaultHotKey(EHotKeyDecBrightness);
-	TestBrightnessL(EFalse);
-	TestDefaultBrightnessL(ETrue);
-	}
-
-void CTKey::TestDefaultScreenSizeModeL(TInt aKeys,TBool aChange)
-	{
-	TInt screenMode=TheClient->iScreen->CurrentScreenMode();
-	TInt key;
-	TInt retVal;
-	for (key=0;key<aKeys;++key)
-		{
-		iVisibleGroup->SetMode(key);
-		SendKey(EKeyScreenDimension0+key);
-		if (aChange)
-			{
-			retVal = TheClient->iScreen->CurrentScreenMode();
-			TEST(retVal==key);
-			if (retVal!=key)
-				INFO_PRINTF3(_L("TheClient->iScreen->CurrentScreenMode() return value - Expected: %d, Actual: %d"), key, retVal);
-			}
-		else
-			{
-			retVal = TheClient->iScreen->CurrentScreenMode();
-			TEST(retVal==screenMode);
-			if (retVal!=screenMode)
-				INFO_PRINTF3(_L("TheClient->iScreen->CurrentScreenMode() return value - Expected: %d, Actual: %d"), screenMode, retVal);
-			}
-		}
-	}
-
-#define DIMENSION0 'P'
-#define DIMENSION1 'Q'
-#define DIMENSION2 'R'
-#define DIMENSION3 'N'
-void CTKey::TestScreenSizeModeL(TInt aKeys,TBool aChange)
-	{
-	TInt screenMode=TheClient->iScreen->CurrentScreenMode();
-	TInt key;
-	TInt retVal;
-	for (key=0;key<aKeys;++key)
-		{
-		iVisibleGroup->SetMode(key);
-		switch (key)
-		{
-		case 0:
-			SendCtrlAltShift(DIMENSION0);
-			break;
-		case 1:
-			SendCtrlAltShift(DIMENSION1);
-			break;
-		case 2:
-			SendCtrlAltShift(DIMENSION2);
-			break;
-		case 3:
-			SendCtrlAltShift(DIMENSION3);
-			break;
-		default:
-			INFO_PRINTF2(_L("Error Invalid Key: %d"),key);
-			TEST(EFalse);
-			break;
-		}
-			
-		
-		if (aChange)
-			{
-			retVal = TheClient->iScreen->CurrentScreenMode();
-			TEST(retVal==key);
-			if (retVal!=key)
-				INFO_PRINTF3(_L("TheClient->iScreen->CurrentScreenMode() return value - Expected: %d, Actual: %d"), key, retVal);
-	
-			}
-		else
-			{
-			retVal = TheClient->iScreen->CurrentScreenMode();
-			TEST(retVal==screenMode);
-			if (retVal!=screenMode)
-				INFO_PRINTF3(_L("TheClient->iScreen->CurrentScreenMode() return value - Expected: %d, Actual: %d"), screenMode, retVal);
-	
-			}
-		}
-	}
-
-void CTKey::ScreenSizeModeKeysL()
-	{
-	// The test does nothing if there is only one possible screen mode -> return
-	TInt numScreenModes=TheClient->iScreen->NumScreenModes();
-	if (numScreenModes<2)
-		return;
-
-	// Use at most 4 different modes for the test
-	if (numScreenModes>4) {numScreenModes=4;}
-
-	// Set screen mode 3
-	TInt screenMode=TheClient->iScreen->CurrentScreenMode();
-	iVisibleGroup->SetMode(numScreenModes-1);
-	TheClient->iScreen->SetScreenMode(numScreenModes-1);
-
-	// Test default screen mode switch buttons
-	TestDefaultScreenSizeModeL(numScreenModes,ETrue);
-
-	// Add new screen mode switch buttons. Test that default and program defined screen mode switch buttons switch modes.
-	SetHotKey(EHotKeyScreenDimension0,DIMENSION0);
-	SetHotKey(EHotKeyScreenDimension1,DIMENSION1);
-	SetHotKey(EHotKeyScreenDimension2,DIMENSION2);
-	SetHotKey(EHotKeyScreenDimension3,DIMENSION3);
-	TestDefaultScreenSizeModeL(numScreenModes,ETrue);
-	TestScreenSizeModeL(numScreenModes,ETrue);
-
-	// Clear all screen mode switch buttons. Test that default and program defined screen mode switch buttons don't affect screen modes
-	TheClient->iWs.ClearHotKeys(EHotKeyScreenDimension0);
-	TheClient->iWs.ClearHotKeys(EHotKeyScreenDimension1);
-	TheClient->iWs.ClearHotKeys(EHotKeyScreenDimension2);
-	TheClient->iWs.ClearHotKeys(EHotKeyScreenDimension3);
-	TestDefaultScreenSizeModeL(numScreenModes,EFalse);
-	TestScreenSizeModeL(numScreenModes,EFalse);
-
-	// Restore default screen mode switch buttons. Test that only default screen mode switch buttons switch screen modes
-	TheClient->iWs.RestoreDefaultHotKey(EHotKeyScreenDimension0);
-	TheClient->iWs.RestoreDefaultHotKey(EHotKeyScreenDimension1);
-	TheClient->iWs.RestoreDefaultHotKey(EHotKeyScreenDimension2);
-	TheClient->iWs.RestoreDefaultHotKey(EHotKeyScreenDimension3);
-	TestDefaultScreenSizeModeL(numScreenModes,ETrue);
-	TestScreenSizeModeL(numScreenModes,EFalse);
-
-	// Add new screen mode switch buttons. Test that default and program defined screen mode switch buttons switch modes.
-	SetHotKey(EHotKeyScreenDimension0,DIMENSION0);
-	SetHotKey(EHotKeyScreenDimension1,DIMENSION1);
-	SetHotKey(EHotKeyScreenDimension2,DIMENSION2);
-	SetHotKey(EHotKeyScreenDimension3,DIMENSION3);
-	TestDefaultScreenSizeModeL(numScreenModes,ETrue);
-	TestScreenSizeModeL(numScreenModes,ETrue);
-
-	// Restore default screen mode switch buttons. Test that only default screen mode switch buttons switch screen modes
-	TheClient->iWs.RestoreDefaultHotKey(EHotKeyScreenDimension0);
-	TheClient->iWs.RestoreDefaultHotKey(EHotKeyScreenDimension1);
-	TheClient->iWs.RestoreDefaultHotKey(EHotKeyScreenDimension2);
-	TheClient->iWs.RestoreDefaultHotKey(EHotKeyScreenDimension3);
-	TestDefaultScreenSizeModeL(numScreenModes,ETrue);
-	TestScreenSizeModeL(numScreenModes,EFalse);
-
-	// Restore initial screen mode
-	iVisibleGroup->SetMode(screenMode);
-	TheClient->iScreen->SetScreenMode(screenMode);
-	}
-
-void CTKey::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(KTest0,"KeyOfDeath");
-	_LIT(KTest1,"Contrast");
-	_LIT(KTest2,"BackLight");
-	_LIT(KTest3,"Brightness");
-	_LIT(KTest4,"Screen Size Mode");
-	((CTKeyStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-#ifdef _DEBUG
-	_LIT(KTest5,"Orientation");
-	_LIT(KTest6,"CycleDisplaySize");
-#endif
-	switch(++iTest->iState)
-		{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0106
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Key of Death test
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates a new client process and runs it.
-					Waits until the process is started and simulates Ctrl-Alt-Shift-K press.
-					When starts the process assumes that TAutoServer.exe exists in z:\sys\bin directory.
-					Otherwise the test will not exit a wait-state and will be aborted.
-
-@SYMTestExpectedResults Checks that the process is dead after the Ctrl-Alt-Shift-K press.
-					Check also that the difference between amounts of window groups efore
-					death-key press and after death-key press is 1.
-*/
-		case 1:
-			((CTKeyStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0106"));
-			iTest->LogSubTest(KTest0);
-			KeyOfDeathL();
-			break;
-		case 2:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0539
-*/
-			((CTKeyStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0539"));
-			iTest->LogSubTest(KTest1);
-			ContrastKeysL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0107
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test backlight
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Does nothing if hardware attributes are not supported.
-					1. Turns backlight off.
-					2. Tests that default backlight ON/OFF/TOGGLE buttons work.
-					3. Sets user defined backlight buttons and tests that both default and user defined buttons work.
-					4. Calls RWsSession::ClearHotKeys and tests that both default and user defined buttons don't work.
-					5. Calls RWsSession::RestoreDefaultHotKey and tests that only default buttons work.
-					6. Sets user defined backlight buttons and tests that both default and user defined buttons work.
-					7. Calls RWsSession::RestoreDefaultHotKey and tests that only default buttons work.
-					8. Restores previous backlight state.
-
-@SYMTestExpectedResults Expects that actions described above give positive result.
-						The test also checks that programmatic turn off/on doesn't fail.
-*/
-		case 3:
-			((CTKeyStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0107"));
-			iTest->LogSubTest(KTest2);
-			BackLightKeysL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0108
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test brightness
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Does nothing if hardware attributes are not supported.
-					1. Get maximum brightness and current, test that those operations don't fail
-					2. Sets brightness to be neither maximal nor minimal, test that those operations don't fail
-					3. Test default brightness buttons increase/decrease brightness by 1
-					4. Add new inc/dec buttons, test that default and program defined brightness buttons increase/decrease brightness by 1
-					5. Clear brightness buttons, test that default and program defined brightness buttons doesn't affect brightness
-					6. Restore default brightness buttons, test that only default brightness buttons increase/decrease brightness by 1
-					7. Add new inc/dec buttons, test that default and program defined brightness buttons increase/decrease brightness by 1
-					8. Restore default brightness buttons, test that only default brightness buttons increase/decrease brightness by 1
-
-@SYMTestExpectedResults Expects that actions described above give positive result.
-						The test also checks that programmatic brightness increase and decrease doesn't fail.
-*/
-		case 4:
-			((CTKeyStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0108"));
-			iTest->LogSubTest(KTest3);
-			BrightnessKeysL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0109
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test screen mode switching
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     The test does nothing if there is only one possible screen mode. It uses at most 4 different modes for the test.
-					1. Test default screen mode switch buttons
-					2. Add new screen mode switch buttons. Test that default and program defined screen mode switch buttons switch modes.
-					3. Clear all screen mode switch buttons. Test that default and program defined screen mode switch buttons don't affect screen modes
-					4. Restore default screen mode switch buttons. Test that only default screen mode switch buttons switch screen modes
-					5. Add new screen mode switch buttons. Test that default and program defined screen mode switch buttons switch modes.
-					6. Restore default screen mode switch buttons. Test that only default screen mode switch buttons switch screen modes
-					7. Restore initial screen mode
-
-
-
-@SYMTestExpectedResults Expects that actions described above give positive result.
-*/
-		case 5:
-			((CTKeyStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0109"));
-			iTest->LogSubTest(KTest4);
-			ScreenSizeModeKeysL();
-			break;
-#ifdef _DEBUG			
-		case 6:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0540
-*/
-			((CTKeyStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0540"));
-			iTest->LogSubTest(KTest5);
-			KeyOfOrientation();
-			break;
-		case 7:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0541
-*/
-			((CTKeyStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0541"));
-			iTest->LogSubTest(KTest6);
-			CycleDisplaySize();
-			break;
-#endif		
-		default:
-			((CTKeyStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTKeyStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-		}
-	((CTKeyStep*)iStep)->RecordTestResultL();
-	}
-
-
-__WS_CONSTRUCT_STEP__(Key)
--- a/windowing/windowserver/tauto/TKEY.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TKEY_H__
-#define __TKEY_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include <hal.h>
-#include "TGraphicsHarness.h"
-
-_LIT(KSemaphoreName,"KeyProcSem");
-
-
-class CVisibleGroup: public CBase
-	{
-public:
-	CVisibleGroup(TInt aScreenNo);
-	~CVisibleGroup();
-	void ConstructL();
-	void SetMode(TInt aMode);
-private:
-	RWsSession iWs;
-	RWindowGroup iGroup;
-	CWsScreenDevice* iScr;
-	TInt iScreenNo;
-	TInt iMode;
-	};
-
-
-class ClientToKill : public CTClient
-	{
-public:
-	ClientToKill();
-	~ClientToKill();
-	void ConstructL();
-private:
-	TestWindow *iTestWin;
-	};
-
-
-
-class CTKey : public CTWsGraphicsBase
-	{
-public:
-	enum {EFuncCtrlShift=EModifierFunc|EModifierCtrl|EModifierShift};
-public:
-	CTKey(CTestStep* aStep);
-	~CTKey();
-	void ConstructL();
-
-	void KeyOfDeathL();
-	void KeyOfOrientation();
-	void CycleDisplaySize();
-	void ContrastKeysL();
-	void BackLightKeysL();
-	void BrightnessKeysL();
-	void ScreenSizeModeKeysL();
-protected:
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	void SendKey(TInt aScanCode);
-	void SendUpDown(TInt aScanCode);
-	void SendCtrlAltShift(TInt aScanCode);
-	void SendCtrlAltShift(TRawEvent::TType aType);
-	void SetHotKey(THotKey aType, TUint aKeyCode);
-	void LogWindowGroupIds();
-	void TestContrastL(TBool aChange);
-	void TestDefaultContrastL(TBool aChange);
-	void TestBackLightL(TBool aChange);
-	void TestDefaultBackLightL(TBool aChange);
-	void TestBrightnessL(TBool aChange);
-	void TestDefaultBrightnessL(TBool aChange);
-	void TestScreenSizeModeL(TInt aKeys,TBool aChange);
-	void TestDefaultScreenSizeModeL(TInt aKeys,TBool aChange);
-
-private:
-	RSemaphore iSem;
-	TSize iWinSize;
-	CVisibleGroup* iVisibleGroup;
-	};
-
-class CTKeyStep : public CTGraphicsStep
-	{
-public:
-	CTKeyStep();
-protected:
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTKeyStep,"TKey");
-
-
-#endif
--- a/windowing/windowserver/tauto/TKRepeat.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,464 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Converted from TMan test code May 2001
-// Keyboard repeat test
-// 
-//
-
-#include "TKRepeat.H"
-
-#define LOGGING 1
-
-//
-// CRKWindow, class //
-//
-
-CRKWindow::CRKWindow(CTKRepeat *aTest) : CTWin(), iTest(aTest)
-	{
-	}
-
-void CRKWindow::SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc)
-	{
-	ConstructExtLD(*parent,pos,size);
-	iWin.SetBackgroundColor(TRgb::Gray256(230));
-	Activate();
-	AssignGC(aGc);
-	}
-
-void CRKWindow::Draw()
-	{
-	iGc->Clear();
-	switch(iState)
-		{
-		case EStateWaitingForKeyDown:
-			iGc->DrawText(_L("Press and hold the space bar"), TPoint(10,20));
-			break;
-		case EStateWaitingForFirstRepeat:
-		case EStateWaitingForNthRepeat:
-			{
-			TBuf<0x40> buf;
-			buf.Format(TRefByValue<const TDesC>(_L("Keep space bar down (%d repeats so far)")),iRepCount);
-			iGc->DrawText(buf, TPoint(10,20));
-			}
-			break;
-		case EStateWaitingForKeyUp:
-			iGc->DrawText(_L("Release space bar"), TPoint(10,20));
-		default:
-			break;
-		}
-	}
-
-void CRKWindow::SetState(TRKStates aState)
-	{
-#if defined(LOGGING)
-	TLogMessageText logMessageText;
-	_LIT(KStateChange,"State Change  Old=%d  New=%d");
-	logMessageText.Format(KStateChange,iState,aState);
-	iTest->LOG_MESSAGE(logMessageText);
-#endif
-	iState=aState;
-	DrawNow();
-	TheClient->WaitForRedrawsToFinish();
-	SendEvent();
-	}
-
-void CRKWindow::SendEvent()
-	{
-	switch (iState)
-		{
-	case EStateWaitingForKeyDown:
-	case EStateWaitingForKeyUp:
-	#if defined(LOGGING)
-		_LIT(KKeyUp,"Send key up event  substate 0");
-		_LIT(KKeyDown,"Send key down event  substate 4");
-		iTest->LOG_MESSAGE(iState==EStateWaitingForKeyDown ? KKeyDown() : KKeyUp());
-	#endif
-		iTest->TestBase()->SimulateKey((iState==EStateWaitingForKeyDown ? TRawEvent::EKeyDown : TRawEvent::EKeyUp),EStdKeySpace);
-		break;
-	case EStateWaitingForKeyCode:
-	case EStateWaitingForFirstRepeat:
-	case EStateWaitingForNthRepeat:
-	case EStateInactive:
-	case EStateError:
-	#if defined(LOGGING)
-		_LIT(KLog,"SendEvent:  substate %d so no event to send");
-		iTest->LOG_MESSAGE2(KLog,iState);
-	#endif
-		break;
-		}
-	}
-
-TBool CRKWindow::CheckResults()
-	{
-//
-// Checks repeat results, first convert everything to 10th's as that what is actually used 
-// for the timer in the window server.
-//
-// Return ETrue if the inacuracy in the average time is greater than 1/10th either way
-// Allow initial 2/10ths either
-// Allow min 2/10ths below
-// Allow max 2/10ths above
-//
-	if (iState!=EStateInactive)
-		return(ETrue);
-	TInt initial=iInitialGap.Int()/100000;
-	TInt initialX=iInitialRepeatSet.Int()/100000;
-	if (initialX==0)
-		initialX=1;
-	TInt average=(iTotalGap.Int()/100000)/(iRepCount-1);
-	TInt repeatX=iRepeatSet.Int()/100000;
-	if (repeatX==0)
-		repeatX=1;
-	TInt min=iMinGap.Int()/100000;
-	TInt max=iMaxGap.Int()/100000;
-	if (average>(repeatX+1) || average<(repeatX-1))
-		return(ETrue);
-	if (initial>(initialX+2) || initial<(initialX-2))
-		return(ETrue);
-#if defined(__MARM_ARM4__)
-	if (min>(repeatX+1) || min<(repeatX-2) || max>(repeatX+3) || max<repeatX)
-		{
-		if (max<min || (max+min)<2*(repeatX-2) || (max+min)>2*(repeatX+2))
-			return(ETrue);
-		}
-#else
-	if (min>(repeatX+1) || min<(repeatX-2))
-		return(ETrue);
-	if (max>(repeatX+3) || max<repeatX)
-		return(ETrue);
-#endif
-	return(EFalse);
-	}
-
-TDesC& CRKWindow::Report()
-	{
-	if (iState!=EStateInactive)
-		{
-		iReport.Format(_L("Error, test not completed"));
-		}
-	else
-		{
-		TInt initial=iInitialGap.Int()/10000;
-		TInt initialX=iInitialRepeatSet.Int()/10000;
-		TInt average=(iTotalGap.Int()/10000/(iRepCount-1));
-		TInt repeatX=iRepeatSet.Int()/10000;
-		TInt min=iMinGap.Int()/10000;
-		TInt max=iMaxGap.Int()/10000;
-		iReport.Format(TRefByValue<const TDesC>(_L("Initial=%d [%d], Av=%d [%d], Min=%d, Max=%d")),initial,initialX,average,repeatX,min,max);
-		}
-	return(iReport);
-	}
-
-void CRKWindow::KeyDownL(const TKeyEvent &aKey,const TTime &)
-	{
-#if defined(LOGGING)
-	TLogMessageText logMessageText;
-	_LIT(KKeyDown,"CRKWindow::KeyDownL  Code=%d '%c'  State=%d (0)");
-	logMessageText.Format(KKeyDown,aKey.iScanCode,aKey.iScanCode,iState);
-	iTest->LOG_MESSAGE(logMessageText);
-#endif
-	switch(iState)
-		{
-		case EStateWaitingForKeyDown:
-			SetState(EStateWaitingForKeyCode);
-			iDownCode=aKey.iScanCode;
-			break;
-		default:;
-		}
-	}
-
-void CRKWindow::KeyUpL(const TKeyEvent &aKey,const TTime &)
-	{
-#if defined(LOGGING)
-	TLogMessageText logMessageText;
-	_LIT(KKeyUp,"CRKWindow::KeyUpL  Code=%d (%c)  State=%d  Down=%d");
-	logMessageText.Format(KKeyUp,aKey.iScanCode,aKey.iScanCode,iState,iDownCode);
-	iTest->LOG_MESSAGE(logMessageText);
-#endif
-	if (aKey.iScanCode==iDownCode)
-		{
-		switch(iState)
-			{
-			case EStateWaitingForKeyUp:
-				SetState(EStateInactive);
-				break;
-			default:
-				SetState(EStateError);
-				break;
-			}
-		CActiveScheduler::Stop();
-		}
-	}
-
-void CRKWindow::WinKeyL(const TKeyEvent &aKey,const TTime &aTime)
-	{
-	if (aKey.iCode==EKeyEscape)
-		{
-		CActiveScheduler::Stop();
-		iTest->iAbort=ETrue;
-		}
-#if defined(LOGGING)
-	TLogMessageText logMessageText;
-	_LIT(KKey,"CRKWindow::WinKeyL  Code=%d (%c)  State=%d  RepeatCount=%d");
-	logMessageText.Format(KKey,aKey.iScanCode,aKey.iScanCode,iState,iRepCount);
-	iTest->LOG_MESSAGE(logMessageText);
-#endif
-	if (aKey.iCode==32)
-		{
-		switch(iState)
-			{
-			case EStateWaitingForKeyCode:
-				SetState(EStateWaitingForFirstRepeat);
-				iPrevTime=aTime;
-				break;
-			case EStateWaitingForFirstRepeat:
-				iRepCount=1;
-				iInitialGap = I64LOW(aTime.MicroSecondsFrom(iPrevTime).Int64());
-				SetState(EStateWaitingForNthRepeat);
-				break;
-			case EStateWaitingForNthRepeat:
-				if (iRepCount==5)
-					SetState(EStateWaitingForKeyUp);
-				else
-					{
-					TTimeIntervalMicroSeconds32 gap(I64LOW(aTime.MicroSecondsFrom(iPrevTime).Int64()));
-				#if defined(LOGGING)
-					TLogMessageText logMessageText;
-					_LIT(KRepeatGap,"Repeat after %d");
-					logMessageText.AppendFormat(KRepeatGap,gap.Int());
-					iTest->LOG_MESSAGE(logMessageText);
-					TheClient->Flush();
-				#endif
-					if (gap<iMinGap)
-						iMinGap=gap;
-					if (gap>iMaxGap)
-						iMaxGap=gap;
-					iTotalGap=iTotalGap.Int()+gap.Int();	// Horrible way to do a +=
-					iRepCount++;
-					SetState(EStateWaitingForNthRepeat);
-					}
-			case EStateWaitingForKeyUp: 	// Do nothing here
-				break;
-			default:
-				//iTest->Test(EFalse);
-				iTest->TestBase()->SimulateKey(TRawEvent::EKeyUp,EStdKeySpace);
-				CActiveScheduler::Stop();
-			}
-		iPrevTime=aTime;
-		}
-	}
-
-void CRKWindow::SetKeyboardRepeatRate(const TTimeIntervalMicroSeconds32 &aInitialTime, const TTimeIntervalMicroSeconds32 &aTime)
-	{
-	iInitialRepeatSet=aInitialTime;
-	iRepeatSet=aTime;
-	iMinGap=TTimeIntervalMicroSeconds32(100000000);	// Any very big number will do
-	iMaxGap=TTimeIntervalMicroSeconds32(0);
-	iTotalGap=TTimeIntervalMicroSeconds32(0);
-	SetState(EStateWaitingForKeyDown);
-	Client()->iWs.Flush();
-	}
-
-//
-
-CTKRepeat::CTKRepeat(CTestStep* aStep) : CTWsGraphicsBase(aStep)
-	{
-	}
-
-CTKRepeat::~CTKRepeat()
-	{
-	CTWin::Delete(iWin);
-	Client()->iWs.SetKeyboardRepeatRate(iOldInitialTime, iOldTime);
-	}
-
-void CTKRepeat::ConstructL()
-	{
-	TheClient->iWs.SetFocusScreen(iTest->iScreenNumber);
-	iWin=new(ELeave) CRKWindow(this);
-	TSize screenSize=Client()->iGroup->Size();
-	iWin->SetUpL(TPoint(5,5),TSize(Min(Max(screenSize.iWidth/2,250),screenSize.iWidth-10),screenSize.iHeight-10),Client()->iGroup,*Client()->iGc);
-	Client()->iGroup->WinTreeNode()->SetOrdinalPosition(0);
-	Client()->iGroup->SetCurrentWindow(iWin);
-	Client()->iWs.GetKeyboardRepeatRate(iOldInitialTime, iOldTime);
-	iTest->SimulateKeyDownUp(EStdKeyLeftCtrl);
-	iTest->SimulateKeyDownUp(EStdKeyRightCtrl);
-	TInt mods=Client()->iWs.GetModifierState();
-	TheClient->WaitForRedrawsToFinish();		//Let all pending events be processed before test begins
-	_LIT(KLog,"Initial Modifiers state 0x%x (ideally should be zero)");
-	LOG_MESSAGE2(KLog,mods);
-	}
-
-TInt CTKRepeat::CheckReportL()
-	{
-	if (iWin->CheckResults())
-		{
-		/*CTDialog *dialog=new(ELeave) CTDialog();
-		dialog->SetTitle(_L("Keyboard repeat innacuracies"));
-		dialog->SetLine1(iWin->Report());
-		dialog->SetNumButtons(3);
-		dialog->SetButtonText(0,_L("Okay"));
-		dialog->SetButtonText(1,_L("Retest"));
-		dialog->SetButtonText(2,_L("Fail"));
-		dialog->ConstructLD(*Client()->iGroup,*Client()->iGc);
-		switch(dialog->Display())
-			{
-			case 0:
-				break;
-			case 1:
-				return(ETrue);	// Redo test
-			case 2:
-				Client()->iGroup->ClearCurrentWindow();
-				Test(EFalse);
-				break;
-			}
-		*/}
-	return(EFalse);
-	}
-
-void CTKRepeat::TestKeyboardRepeatRateL(const TTimeIntervalMicroSeconds32 &aInitialTime, const TTimeIntervalMicroSeconds32 &aTime)
-	{
-	do
-		{
-	#if defined(LOGGING)
-		const TInt KOneSec=1000000;
-		const TInt KOneHundrethSec=KOneSec/100;
-		TLogMessageText logMessageText;
-		_LIT(KRepeatRate,"Repeat Rate Initial=%d.%02dsecs, Subsequent=%d.%02dsecs");
-		logMessageText.Format(KRepeatRate,aInitialTime.Int()/KOneSec,(aInitialTime.Int()%KOneSec)/KOneHundrethSec
-																	,aTime.Int()/KOneSec,(aTime.Int()%KOneSec)/KOneHundrethSec);
-		LOG_MESSAGE(logMessageText);
-	#endif
-		TheClient->iWs.SetKeyboardRepeatRate(aInitialTime, aTime);
-		iWin->SetKeyboardRepeatRate(aInitialTime, aTime);
-		CActiveScheduler::Start();
-		if (iAbort)
-			{
-			iTest->AbortL();
-			}
-		} while(CheckReportL());
-	}
-	
-void CTKRepeat::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(KTestName1,"Keyboard Repeat 1");
-	_LIT(KTestName2,"Keyboard Repeat 2");
-	_LIT(KTestName3,"Keyboard Repeat 3");
-	_LIT(KTestName4,"Keyboard Repeat 4");
-	((CTKRepeatStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(++iTest->iState)
-		{
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0311
-  
-  @SYMDEF             DEF081259
- 
-  @SYMTestCaseDesc Test that a key can be repeatedly struck after a second, then every half second
-    
-  @SYMTestPriority High
- 
-  @SYMTestStatus Implemented
- 
-  @SYMTestActions Simulate a key being struck first after a second and then repeatedly every
-  					half second and check the response time to the key strike is correct 
-  
-  @SYMTestExpectedResults Response time each time the key is struck is correct
- 
-*/
-		case 1:
-			((CTKRepeatStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0311"));
-			iTest->LogSubTest(KTestName1);
-			TestKeyboardRepeatRateL(TTimeIntervalMicroSeconds32(1000000), TTimeIntervalMicroSeconds32(500000));
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0312
-  
-  @SYMDEF             DEF081259
- 
-  @SYMTestCaseDesc Test that a key can be repeatedly struck after a 5th of a second, then every 10th of a second
-    
-  @SYMTestPriority High
- 
-  @SYMTestStatus Implemented
- 
-  @SYMTestActions Simulate a key being struck first after a 5th of a second and then repeatedly every
-  					10th of a second and check the response time to the key strike is correct 
-  
-  @SYMTestExpectedResults Response time each time the key is struck is correct
- 
-*/
-		case 2:
-			((CTKRepeatStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0312"));
-			iTest->LogSubTest(KTestName2);
-			TestKeyboardRepeatRateL(TTimeIntervalMicroSeconds32(200000), TTimeIntervalMicroSeconds32(100000));
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0313
-  
-  @SYMDEF             DEF081259
- 
-  @SYMTestCaseDesc Test that a key can be repeatedly struck immediately, then every 10th of a second
-    
-  @SYMTestPriority High
- 
-  @SYMTestStatus Implemented
- 
-  @SYMTestActions Simulate a key being struck first immediately and then repeatedly every
-  					10th of a second and check the response time to the key strike is correct 
-  
-  @SYMTestExpectedResults Response time each time the key is struck is correct
- 
-*/
-		case 3:
-			((CTKRepeatStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0313"));
-			iTest->LogSubTest(KTestName3);
-			TestKeyboardRepeatRateL(TTimeIntervalMicroSeconds32(0), TTimeIntervalMicroSeconds32(100000));
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0314
-  
-  @SYMDEF             DEF081259
- 
-  @SYMTestCaseDesc Test that a key can be repeatedly struck after a 10 of a second, then every 10th of a second
-    
-  @SYMTestPriority High
- 
-  @SYMTestStatus Implemented
- 
-  @SYMTestActions Simulate a key being struck first after a 10th of a second and then repeatedly every
-  					10th of a second and check the response time to the key strike is correct 
-  
-  @SYMTestExpectedResults Response time each time the key is struck is correct
- 
-*/
-
-		case 4:
-			((CTKRepeatStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0314"));
-			iTest->LogSubTest(KTestName4);
-			TestKeyboardRepeatRateL(TTimeIntervalMicroSeconds32(100000), TTimeIntervalMicroSeconds32(100000));
-			break;
-		case 5:
-			((CTKRepeatStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTKRepeatStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-			break;
-		}
-	((CTKRepeatStep*)iStep)->RecordTestResultL();
-	}
-	
-__WS_CONSTRUCT_STEP__(KRepeat)
-
--- a/windowing/windowserver/tauto/TKRepeat.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TKREPEAT_H__
-#define __TKREPEAT_H__
-
-#include <e32std.h>
-#include <e32svr.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-class CRKWindow;
-
-class CTKRepeat : public CTWsGraphicsBase
-	{
-	friend class CRKWindow;
-public:
-	CTKRepeat(CTestStep* aStep);
-	~CTKRepeat();
-	void ConstructL();
-	void TestKeyboardRepeatRateL(const TTimeIntervalMicroSeconds32 &aInitialTime, const TTimeIntervalMicroSeconds32 &aTime);
-	TBool CheckReportL();
-public:
-	TBool iAbort;
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	inline TestClient *Client() {return TheClient;}
-private:
-	TTimeIntervalMicroSeconds32 iOldInitialTime;
-	TTimeIntervalMicroSeconds32 iOldTime;
-	CRKWindow *iWin;
-	TSize iWinSize;
-	TInt iState;
-	};
-
-class CRKWindow : public CTWin
-	{
-	enum TRKStates {
-		EStateWaitingForKeyDown,
-		EStateWaitingForKeyCode,
-		EStateWaitingForFirstRepeat,
-		EStateWaitingForNthRepeat,
-		EStateWaitingForKeyUp,
-		EStateInactive,
-		EStateError,
-		};
-public:
-	CRKWindow(CTKRepeat *aTest);
-	void SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
-	void SetState(TRKStates aState);
-	void SetKeyboardRepeatRate(const TTimeIntervalMicroSeconds32 &aInitialTime, const TTimeIntervalMicroSeconds32 &aTime);
-	void WinKeyL(const TKeyEvent &,const TTime &);
-	void KeyUpL(const TKeyEvent &aKey,const TTime &aTime);
-	void KeyDownL(const TKeyEvent &aKey,const TTime &aTime);
-	void Draw();
-	TDesC& Report();
-	TBool CheckResults();
-	void SendEvent();
-protected:
-	TInt iConnIndex;
-	CTKRepeat *iTest;
-	TRgb iBack;
-	TRKStates iState;
-	TInt iDownCode;
-	TInt iRepCount;
-	TTimeIntervalMicroSeconds32 iInitialRepeatSet;
-	TTimeIntervalMicroSeconds32 iRepeatSet;
-	TTime iPrevTime;
-	TTimeIntervalMicroSeconds32 iInitialGap;
-	TTimeIntervalMicroSeconds32 iTotalGap;
-	TTimeIntervalMicroSeconds32 iMinGap;
-	TTimeIntervalMicroSeconds32 iMaxGap;
-	TBuf<0x40> iReport;
-	};
-
-class CTKRepeatStep : public CTGraphicsStep
-	{
-public:
-	CTKRepeatStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTKRepeatStep,"TKRepeat");
-
-
-#endif
--- a/windowing/windowserver/tauto/TMDISPLAY.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,232 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Multiple display test
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-
-
-#include "TMDISPLAY.H"
-#include <hal.h>
-//
-//
-CTClient* CreateClientL()
-	{
-	return (TheClient=new(ELeave) TestClient());
-	}
-	
-TInt ProcMultiDisplay(TAny* aScreenNo)
-	{
-	return TestLibStartUp(CreateClientL,(TInt)aScreenNo);
-	}
-
-
-//
-//
-
-CTMultiDisplay::CTMultiDisplay(CTestStep* aStep) : CTWsGraphicsBase(aStep)
-	{
-	INFO_PRINTF1(_L("Testing Mutli display functions"));
-	}
-
-void CTMultiDisplay::ConstructL()
-	{
-	}
-	
-CTMultiDisplay::~CTMultiDisplay()
-	{
-	}
-
-TInt DoSetFocusScreenL(TInt aFocusScreen,TAny* /*aArg*/)
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	ws.SetFocusScreen(aFocusScreen);
-	ws.Close();
-	return EWsExitReasonBad;
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0051
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test focusing on the two different screens
-					available
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Test the response to different calls to focus
-					on the two screens available
-
-@SYMTestExpectedResults Foucisng on the different screens is correct
-*/	
-void CTMultiDisplay::DoFocusScreenTestL()
-	{
-	_LIT(KSubTitle,"FocusScreen API");
-	INFO_PRINTF1(KSubTitle);
-	
-	TInt numberOfScreens;
-	HAL::Get(HALData::EDisplayNumberOfScreens, numberOfScreens);
-	TInt oldFocus=TheClient->iWs.GetFocusScreen();
-		
-	// test case #1: out of bounds screen number
-	// expected result: client panic and focus stays on current screen
-	TEST(iTest->TestWsPanicL(&DoSetFocusScreenL,EWservPanicScreenNumber,-1,NULL));
-	TEST(TheClient->iWs.GetFocusScreen()==oldFocus);
-	if (TheClient->iWs.GetFocusScreen()!=oldFocus)
-		INFO_PRINTF3(_L("TheClient->iWs.GetFocusScreen() return value - Expected: %d, Actual: %d"), oldFocus, TheClient->iWs.GetFocusScreen());		
-
-	TEST(iTest->TestWsPanicL(&DoSetFocusScreenL,EWservPanicScreenNumber,numberOfScreens,NULL));
-	TEST(TheClient->iWs.GetFocusScreen()==oldFocus);
-	if (TheClient->iWs.GetFocusScreen()!=oldFocus)
-		INFO_PRINTF3(_L("TheClient->iWs.GetFocusScreen() return value - Expected: %d, Actual: %d"), oldFocus, TheClient->iWs.GetFocusScreen());		
-
-	
-	// test case #2: new focus equals to current focus
-	// expected result: KErrNone and focus stays on current screen
-	TInt ret = TheClient->iWs.SetFocusScreen(oldFocus);
-	TEST(ret==KErrNone && TheClient->iWs.GetFocusScreen()==oldFocus);
-	if (ret!=KErrNone || TheClient->iWs.GetFocusScreen()!=oldFocus)
-		INFO_PRINTF5(_L("TheClient->iWs.SetFocusScreen(oldFocus)==KErrNone && TheClient->iWs.GetFocusScreen()==oldFocus - Expected: %d and %d, Actual: %d and %d"),KErrNone,  oldFocus, ret, TheClient->iWs.GetFocusScreen());		
-
-	
-	// test case #3: set focus to screen N where screen N is empty (doesn't have any windows)
-	// expected result: KErrNotFound and focus stays on current screen
-	TInt i;
-	for(i=1;i<numberOfScreens;++i)
-		{
-		ret = TheClient->iWs.SetFocusScreen(i);
-		TEST(ret==KErrNotReady && TheClient->iWs.GetFocusScreen()==oldFocus);
-		if (ret!=KErrNotReady || TheClient->iWs.GetFocusScreen()!=oldFocus)
-			INFO_PRINTF5(_L("TheClient->iWs.SetFocusScreen(i)==KErrNotReady && TheClient->iWs.GetFocusScreen()==oldFocus - Expected: %d and %d, Actual: %d and %d"),KErrNotReady,  oldFocus, ret, TheClient->iWs.GetFocusScreen());
-		}
-				
-	// test case #4: set focus to screen N where screen N has focus-able window
-	// expected result: KErrNone and focus is set to screen N
-	CArrayPtrFlat<CMinWin>* wins;
-	wins=new(ELeave) CArrayPtrFlat<CMinWin>(numberOfScreens);
-	CleanupStack::PushL(wins);
-	for(i=0;i<numberOfScreens;++i)
-		{
-		CMinWin* win=new(ELeave) CMinWin(i);
-		CleanupStack::PushL(win);
-		win->ConstructL();
-		wins->AppendL(win);
-		}
-		
-	for(i=1;i<numberOfScreens;++i)
-		{
-		ret = TheClient->iWs.SetFocusScreen(i);
-		TEST(ret==KErrNone && TheClient->iWs.GetFocusScreen()==i);
-		if (ret!=KErrNone || TheClient->iWs.GetFocusScreen()!=i)
-			INFO_PRINTF5(_L("TheClient->iWs.SetFocusScreen(i)==KErrNone && TheClient->iWs.GetFocusScreen()==i - Expected: %d and %d, Actual: %d and %d"),KErrNone,  i, ret, TheClient->iWs.GetFocusScreen());
-
-		}		
-	
-	// test case #5: set focus back from screen N to main screen (screen 0)
-	// expected result: KErrNone and focus is set to screen 0
-	ret = TheClient->iWs.SetFocusScreen(0);
-	TEST(ret==KErrNone && TheClient->iWs.GetFocusScreen()==0);
-	if (ret!=KErrNone || TheClient->iWs.GetFocusScreen()!=0)
-		INFO_PRINTF5(_L("TheClient->iWs.SetFocusScreen(0)==KErrNone && TheClient->iWs.GetFocusScreen()==0 - Expected: %d and %d, Actual: %d and %d"),KErrNone,  0, ret, TheClient->iWs.GetFocusScreen());
-	
-	CleanupStack::PopAndDestroy(numberOfScreens+1,wins);
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0052
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Launch a test from a new process and check
-					that it passes indepenedent of screen focus
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Focus on a screen, launch a test process,
-					switch to focus on the other screen, then
-					then check the test process passed
-
-@SYMTestExpectedResults The test in the process passed
-*/		
-void CTMultiDisplay::DoScreenTestL(TInt aScreenNo)
-	{
-	_LIT(KSubTest,"Screen %d");
-	TBuf<16> subMsg;
-
-	const TInt numScreens=TheClient->iWs.NumberOfScreens();
-	if (numScreens<=aScreenNo)
-		{
-		_LIT(KLog,"WARNING!! Cannot run test for screen %d as the device only has %d screens.");
-		LOG_MESSAGE3(KLog,aScreenNo,numScreens);
-		aScreenNo=numScreens-1;
-		}
-
-	subMsg.AppendFormat(KSubTest,aScreenNo);
-	LOG_MESSAGE(subMsg);
-
-	// Must switch focus screen to relevant screen manually 
-	CMinWin* win=new(ELeave) CMinWin(aScreenNo);
-	CleanupStack::PushL(win);
-	win->ConstructL();
-	TheClient->iWs.SetFocusScreen(aScreenNo);
-
-	CleanupStack::PopAndDestroy(win);
-	TheClient->iWs.SetFocusScreen(0);
-	CTestBase::iScreenNo=aScreenNo;
-
-	//Set CTestBase::iNumberOfGrpWndsOnPrimaryScreenWithZeroPriority with the number of window groups
-	//in default screen with priority zero. This will be used in TGwHandle test case.
-	CTestBase::iNumberOfGrpWndsOnPrimaryScreenWithZeroPriority = TheClient->iWs.NumWindowGroups(0) - 1;
-	}
-
-void CTMultiDisplay::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(KTest1,"Focus Screen");
-	_LIT(KTest2,"Screen");
-	((CTMultiDisplayStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-
-	switch (++iTest->iState)
-		{
-		case 1:
-			((CTMultiDisplayStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0051"));
-			iTest->LogSubTest(KTest1);
-			DoFocusScreenTestL();
-			break;
-		case 2:
-			((CTMultiDisplayStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0052"));
-			iTest->LogSubTest(KTest2);
-			DoScreenTestL(1);
-			break;
-		default:
-			((CTMultiDisplayStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTMultiDisplayStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-			break;	
-		}
-	((CTMultiDisplayStep*)iStep)->RecordTestResultL();
-	}
-
-__WS_CONSTRUCT_STEP__(MultiDisplay)
--- a/windowing/windowserver/tauto/TMDISPLAY.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// TBLANK.H
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TMDISPLAY_H__
-#define __TMDISPLAY_H__
-
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-#include "../tlib/testbase.h"
-
-class CTMultiDisplay : public CTWsGraphicsBase
-	{
-public:
-	CTMultiDisplay(CTestStep* aStep);
-	CTMultiDisplay();
-	void ConstructL();
-	TestState DoTestL();
-	~CTMultiDisplay();
-
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-	
-private:
-	void DoFocusScreenTestL();
-	void DoScreenTestL(TInt aScreenNo);
-	};
-
-class CTMultiDisplayStep : public CTGraphicsStep
-	{
-public:
-	CTMultiDisplayStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTMultiDisplayStep,"TMultiDisplay");
-
-
-#endif
--- a/windowing/windowserver/tauto/TMESSAGE.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,471 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-
-#include "TMESSAGE.H"
-
-const TInt KTotalNumberOfTestMessages=5;
-const TInt KMaxNumOfMessagesInActiveQueue=21;
-const TInt KMaxNumOfSyncMessages=25;
-const TInt KNumOfTestCases=7;
-TInt MsgCountCheck=0;
-TInt SyncSendReceiveCount=0;
-TUid UidAtFirstLocation;
-TUid UidAtLastLocation;
-TBool TestNeedsExtraCheck=EFalse;
-
-CTMessage::CTMessage(CTestStep* aStep) : CTWsGraphicsBase(aStep), iSyncSendReceiveFlag(EFalse), iCounter(-1), iState(0)
-	{
-	}
-
-TInt CTMessage::CreateAndSendMessages(TInt aCount,TInt aNoOfMessages)
-	{
-	CMessageReceiver* msgReceiver=(*iMessageReceiver)[iState];
-	TInt identifer=msgReceiver->GroupWin()->Identifier();
-	TInt length=aCount*2;
-	TUint8 modificationFactor=(TUint8 )(aCount*3+1);
-	TUint8 msgValue=0;
-	if(!iSyncSendReceiveFlag && TestNeedsExtraCheck)
-		{
-		if(aCount==0)
-			{
-			UidAtFirstLocation=TUid::Uid(length+(modificationFactor<<24));
-			}
-		else if(aCount==(aNoOfMessages-1))
-			{
-			UidAtLastLocation=TUid::Uid(length+(modificationFactor<<24));
-			}
-		}
-	iMsg->Des().Zero();
-	for(TInt index=0;index<length;index++)
-		{
-		msgValue=(TUint8)(msgValue+modificationFactor);
-		iMsg->Des().Append(msgValue);
-		}
-	return TheClient->iWs.SendMessageToWindowGroup(identifer, TUid::Uid(length+(modificationFactor<<24)), *iMsg);
-	}
-
-TInt CTMessage::CallbackLowPriority(TAny* aMessageTest)
-	{
-	return static_cast<CTMessage*>(aMessageTest)->SendSyncMessages();
-	}
-
-TInt CTMessage::SendSyncMessages()
-	{
-	if(iSyncSendReceiveFlag && iCounter++<SyncSendReceiveCount)
-		{
-		TEST(CreateAndSendMessages(iCounter,SyncSendReceiveCount)==KErrNone);
-		return ETrue;
-		}
-	TheClient->iWs.NumWindowGroups();		//Make sure all asyncronus calls have been processed
-	CTEventBase& eventHandler=*TheClient->EventHandler();
-	if (eventHandler.iStatus.Int()==KRequestPending)
-		CActiveScheduler::Stop();
-	else
-		return ETrue;
-	return EFalse;
-	}
-
-CTMessage::~CTMessage()
-	{
-	iMessageReceiver->ResetAndDestroy();
-	iMessageReceiver->Close();
-	delete iMessageReceiver;
- 	iLowPriorityObject->Cancel();
-	delete iLowPriorityObject;
-	iLowPriorityObject=NULL;
-	delete iMsg;
-	}
-
-void CTMessage::ConstructL()
-	{
-	iLowPriorityObject= new(ELeave) CLowPriorityIdle();
-	iMessageReceiver=new(ELeave) RPointerArray<CMessageReceiver>(KNumOfTestCases);
-	iMsg=HBufC8::NewL(KMaxNumOfSyncMessages*2);
-	for(TInt index=0;index<KNumOfTestCases;index++)
-		{
-		CMessageReceiver* messageReceiver=new(ELeave) CMessageReceiver(TheClient, this);
-		messageReceiver->ConstructL();
-		iMessageReceiver->AppendL(messageReceiver);
-		}
-	}
-
-
-CLowPriorityIdle::CLowPriorityIdle() : CIdle(EPriorityIdle)
-	{
-	CActiveScheduler::Add(this);
-	}
-
-TInt CLowPriorityIdle::RunError(TInt /*aError*/)
-	{
-	CActiveScheduler::Stop();
-	return KErrNone;
-	}
-
-LOCAL_C TInt DoPanicTest(TInt aInt, TAny *)
-	{
-	switch(aInt)
-		{
-		case 1:
-			User::Panic(KWSERV,EWservPanicGcActive);
-			break;
-		}
-	return(EWsExitReasonBad);
-	}
-
-CMessageReceiver::CMessageReceiver(CTClient *aClient, CTMessage *aTMessage) : CTWindowGroup(aClient), iMsgCount(0)
-	{
-	iTMessage = aTMessage;
-	}
-
-#define MESSAGES_READ 1		//Change to 2 to test the 16-bit functions too.
-void CMessageReceiver::MessageReady(const TWsEvent& aEvent)
-	{
-	iTMessage->OnMessageReceived(aEvent, iMsgCount);
-	}
-
-void CTMessage::OnMessageReceived(const TWsEvent& aEvent, TInt& aMsgCount)
-	{
-	aMsgCount++;
-	if(aMsgCount>MsgCountCheck)
-		{
-		return;
-		}
-	if (MESSAGES_READ*(aMsgCount/MESSAGES_READ)<aMsgCount)
-		{
-		return;
-		}
-	TPtr8 msgPtr(NULL,0);
-	//TPtr16 msgPtr2(NULL,0);
-	TUid uid;
-	TInt retValue=TheClient->iWs.FetchMessage(uid, msgPtr, aEvent);
-	TEST(retValue==KErrNone);
-	//GroupWin()->FetchMessage(uid, msgPtr2);
-	if(TestNeedsExtraCheck)
-		{
-		TEST(uid==(aMsgCount==1?UidAtFirstLocation:UidAtLastLocation));
-		}
-	TInt msgLength=(uid.iUid)&0xFFFFFF;
-	TUint8 uidFactor=(TUint8)((uid.iUid&0xFF000000)>>24);
-	TBool retVal = msgPtr.Length()==msgLength;
-	TEST(retVal);
-	if (!retVal)
-		INFO_PRINTF3(_L("msgPtr.Length()==msgLength  - Expected: %d, Actual: %d"), msgLength, msgPtr.Length());
-
-	TUint8 check=0;
-	for(TInt index=0;index<msgLength;index++)
-		{
-		check=(TUint8)(check+uidFactor);
-		retVal = msgPtr[index]==check;
-		TEST(retVal);
-		if (!retVal)
-			INFO_PRINTF3(_L("msgPtr[index]==check  - Expected: %d, Actual: %d"), check, msgPtr[index]);
-
-		}
-	/*CTestBase::Test(msgPtr.Length()/2==msgPtr2.Length());
-	TPtrC8 data2((const TUint8*) msgPtr2.Ptr(),msgPtr2.Size());
-	CTestBase::Test(data2==msgPtr.Left(msgPtr2.Size()));*/
-	User::Free((TAny *)msgPtr.Ptr());
-	//User::Free((TAny *)msgPtr2.Ptr());
-	}
-
-void CTMessage::TestPanicsL()
-	{	
-	TEST(iTest->TestWsPanicL(&DoPanicTest,EWservPanicGcActive,1));
-	iTest->CloseAllPanicWindows();
-	}
-
-void CTMessage::MessageTests(TInt aNoOfMessages,TInt aMsgCountCheck,TBool aSyncSendReceiveFlag,TBool aTestNeedsExtraCheck)
-	{
-	iSyncSendReceiveFlag=aSyncSendReceiveFlag;
-	TestNeedsExtraCheck=aTestNeedsExtraCheck;
-	MsgCountCheck=aMsgCountCheck;
-	iLowPriorityObject->Start(TCallBack(CallbackLowPriority,this));
-
-	if(iSyncSendReceiveFlag)
-		{
-		//Messages will be sent and received one by one using the function SendSyncMessages().
-		CActiveScheduler::Start();
-		}
-	else
-		{
-		for(TInt count=0;count<aNoOfMessages;count++)
-			{
-			TInt err=CreateAndSendMessages(count,aNoOfMessages);
-			TEST(err==KErrNone);
-			if (err!=KErrNone)
-				{
-				_LIT(KLog,"Error %d when trying to send Messages");
-				LOG_MESSAGE2(KLog,err);
-				}
-			}
-		CActiveScheduler::Start();
-		TInt msgCount=(*iMessageReceiver)[iState]->MessageCount();
-		TEST(msgCount==MsgCountCheck);
-		if (msgCount!=MsgCountCheck)
-			{
-			_LIT(KLog,"Number of messages recieved=%d expected=%d");
-			LOG_MESSAGE3(KLog,msgCount,MsgCountCheck);
-			}
-		}
-	}
-
-/**
- Test delivery group messages in case when event queue is overflow
- */
-void CTMessage::TestMessageQueueOverflowL()
-	{
-	const TInt numMaxMessages = 60;
-	TInt numWasteMessages = 0;
-	TInt numWgMessages = 5;
-
-	TInt gotRealWasteMessages = 0;
-	TInt gotRealWgMessages = 0;
-
-	const TInt oneSecond = 1000000;
-	const TInt allPossibleMessages = 500;
-
-	RWsSession senderWsSession;
-	RWindowGroup senderGroupWin;
-	TInt sndrHanGrpWin = 7777;
-
-	RWsSession receiverWsSession;
-	RWindowGroup receiverGroupWin;
-	TInt rcvrHanGrpWin = 8888;
-
-	TRequestStatus testStatus;
-	TRequestStatus timerStatus;
-	TWsEvent wasteEvent;
-	TWsEvent event;
-
-	RTimer timer;
-	timer.CreateLocal();
-	CleanupClosePushL(timer);
-
-	// Create sender WsSession and the window group
-	User::LeaveIfError(senderWsSession.Connect());
-	CleanupClosePushL(senderWsSession);
-
-	senderGroupWin = RWindowGroup(senderWsSession);
-	User::LeaveIfError(senderGroupWin.Construct(sndrHanGrpWin));
-	CleanupClosePushL(senderGroupWin);
-
-	// Create reciever WsSession and the window group
-	User::LeaveIfError(receiverWsSession.Connect());
-	CleanupClosePushL(receiverWsSession);
-
-	receiverGroupWin = RWindowGroup(receiverWsSession);
-	User::LeaveIfError(receiverGroupWin.Construct(rcvrHanGrpWin));
-	CleanupClosePushL(receiverGroupWin);
-
-	TInt err = KErrNone;
-
-	// Send waste events to the receiver and overflow the event queue
-	for (TInt ind = 0; ind < numMaxMessages; ind++)
-		{
-		wasteEvent.SetType(sndrHanGrpWin);
-		err = senderWsSession.SendEventToWindowGroup(receiverGroupWin.Identifier(), wasteEvent);
-		if (err != KErrNone)
-			{
-			numWasteMessages = ind; // Real number waste messages that was sent
-			break;
-			}
-		}
-
-	// Send messages to the receiver
-	for (TInt ind = 0; ind < numWgMessages; ind++)
-		{
-		TInt uidData = ind + sndrHanGrpWin;
-		TPtr8 msg((unsigned char*) &uidData, sizeof(uidData));
-		err = senderWsSession.SendMessageToWindowGroup(receiverGroupWin.Identifier(), TUid::Uid(uidData), msg);
-		if (err != KErrNone)
-			{
-			LOG_MESSAGE2(_L("UnExpected Error Code = %d"),err);
-			numWgMessages = ind; // Real number window group messages that was sent
-			}
-		}
-
-	// Check and count sent messages 
-	for (TInt ind = 0; ind < allPossibleMessages; ind++)
-		{
-		receiverWsSession.EventReady(&testStatus);
-		timer.After(timerStatus, oneSecond);
-		User::WaitForRequest(testStatus, timerStatus);
-		if (testStatus == 0)
-			{
-			// Test incoming events
-			receiverWsSession.GetEvent(event);
-			if (event.Type() == sndrHanGrpWin)
-				{
-				++gotRealWasteMessages;
-				}
-			else if (event.Type() == EEventMessageReady)
-				{
-				if (gotRealWgMessages == 0)
-					{
-					for (TInt ind = 0; ind < numMaxMessages; ind++)
-						{
-						wasteEvent.SetType(sndrHanGrpWin);
-						err = senderWsSession.SendEventToWindowGroup(receiverGroupWin.Identifier(), wasteEvent);
-						if (err == KErrNone)
-							{
-							++numWasteMessages;
-							}
-						else
-							{
-							break;
-							}
-						}
-					}
-				++gotRealWgMessages;
-				TUid uid;
-				TPtr8 msgPtr(NULL,0);
-				err = receiverWsSession.FetchMessage(uid, msgPtr, event);
-				User::Free((TAny *) msgPtr.Ptr());
-				}
-			// testStatus has been completed. Hence, Cancel the timer.
-			timer.Cancel();
-			User::WaitForRequest(timerStatus);
-			}
-		else
-			{
-			// Times out, cancel the event notification
-			receiverWsSession.EventReadyCancel();
-			User::WaitForRequest(testStatus);
-			// All events were recieved
-			break;
-			}
-		}
-
-	LOG_MESSAGE3(_L("Got Waste message = %d expected =%d"),gotRealWasteMessages,numWasteMessages);
-	LOG_MESSAGE3(_L("Got Group message = %d expected =%d"),gotRealWgMessages,numWgMessages);
-	TEST(gotRealWasteMessages == numWasteMessages);
-	TEST(gotRealWgMessages == numWgMessages);
-
-	CleanupStack::PopAndDestroy(&receiverGroupWin);
-	CleanupStack::PopAndDestroy(&receiverWsSession);
-	CleanupStack::PopAndDestroy(&senderGroupWin);
-	CleanupStack::PopAndDestroy(&senderWsSession);
-	CleanupStack::PopAndDestroy(&timer);
-
-	TheClient->iWs.Flush();
-
-	}
-
-void CTMessage::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(KMsgTest0,"Message test 1");
-	_LIT(KMsgTest1,"Message test 2");
-	_LIT(KMsgTest2,"Message test 3");
-	_LIT(KMsgTest3,"Message test 4");
-	_LIT(KMsgTest4,"Message test 5");
-	_LIT(KMsgTest5,"Message test 6");
-	_LIT(KMsgTest6,"Message test 7");
-	_LIT(KMsgTest7,"Message test 8 - when event queue is overflow");
-
-	iState=iTest->iState; // used by iMessageReceiver array 
-	((CTMessageStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(++iTest->iState)
-		{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0084
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test message sending and receiving
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Generates 5 short messages and sends them to window group, window group receives them
-
-@SYMTestExpectedResults Expects that received messages have the same length and the same content as those sent
-*/		
-		case 1:
-			((CTMessageStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0084"));
-			iTest->LogSubTest(KMsgTest0);
-			MessageTests(KTotalNumberOfTestMessages,KTotalNumberOfTestMessages,EFalse,EFalse);
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0406
-
-@SYMDEF             DEF102201,DEF141447
-
-@SYMTestCaseDesc    Test message sending and receiving
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Generates some diffrent size of messages and sends them to window group, window group receives them
-
-@SYMTestExpectedResults Expects that received messages have the same length and the same content as those sent
-*/		
-		case 2:
-			((CTMessageStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0406"));
-			iTest->LogSubTest(KMsgTest1);
-			MessageTests(KMaxNumOfMessagesInActiveQueue-1,KMaxNumOfMessagesInActiveQueue-1,EFalse,EFalse);
-			break;
-		case 3:
-			((CTMessageStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0406"));
-			iTest->LogSubTest(KMsgTest2);
-			MessageTests(KMaxNumOfMessagesInActiveQueue,2,EFalse,ETrue);
-			break;
-		case 4:
-			((CTMessageStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0406"));
-			iTest->LogSubTest(KMsgTest3);
-			MessageTests(KMaxNumOfMessagesInActiveQueue+1,2,EFalse,ETrue);
-			break;
-		case 5:
-			((CTMessageStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0406"));
-			iTest->LogSubTest(KMsgTest4);
-			MessageTests(KMaxNumOfMessagesInActiveQueue+2,2,EFalse,ETrue);
-			break;
-		case 6:
-			((CTMessageStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0406"));
-			iTest->LogSubTest(KMsgTest5);
-			SyncSendReceiveCount=KMaxNumOfSyncMessages;
-			MessageTests(KMaxNumOfSyncMessages,KMaxNumOfSyncMessages,ETrue,EFalse);
-			break;
-		case 7:
-			((CTMessageStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0406"));
-			iTest->LogSubTest(KMsgTest6);
-			MessageTests(KMaxNumOfMessagesInActiveQueue+1,2,EFalse,ETrue);
-			((*iMessageReceiver)[iState])->ResetMessageCount();
-			SyncSendReceiveCount=KTotalNumberOfTestMessages;
-			MessageTests(KTotalNumberOfTestMessages,KTotalNumberOfTestMessages,ETrue,EFalse);
-			break;
-		case 8:
-			((CTMessageStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0406"));
-			iTest->LogSubTest(KMsgTest7);
-			TestMessageQueueOverflowL();
-			((CTMessageStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTMessageStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-			return;
-		}
-	((*iMessageReceiver)[iState])->ResetMessageCount();
-	((CTMessageStep*)iStep)->RecordTestResultL();
-	}
-	
-
-__WS_CONSTRUCT_STEP__(Message)
--- a/windowing/windowserver/tauto/TMESSAGE.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TMESSAGE_H__
-#define __TMESSAGE_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-class CMessageReceiver;
-
-class CLowPriorityIdle : public CIdle
-	{
-public:
-	CLowPriorityIdle();
-	virtual TInt RunError(TInt aError);
-	};
-
-class CTMessage : public CTWsGraphicsBase
-	{
-public:
-	CTMessage(CTestStep* aStep);
-	~CTMessage();
-	void ConstructL();
-	void TestPanicsL();
-	void MessageTests(TInt aNoOfMessages,TInt aMsgCountCheck,TBool aSyncSendReceiveFlag,TBool aTestNeedsExtraCheck);
-	void OnMessageReceived(const TWsEvent &aEvent, TInt& aMsgCount);
-	TInt SendSyncMessages();
-	static TInt CallbackLowPriority(TAny *aMessageTest);
-	TInt CreateAndSendMessages(TInt aCount,TInt aNoOfMessages);
-	void TestMessageQueueOverflowL();
-	
-protected:
-	virtual void RunTestCaseL(TInt aCurTestCase);
-
-private:
-	TBool iSyncSendReceiveFlag;
-	TInt iCounter;
-	HBufC8* iMsg;
-	RPointerArray<CMessageReceiver>* iMessageReceiver;
-	CLowPriorityIdle* iLowPriorityObject;
-	TInt iState;
-	};
-	
-	
-class CMessageReceiver : public CTWindowGroup
-	{
-public:
-	CMessageReceiver(CTClient *aClient, CTMessage *aTMessage);
-	void MessageReady(const TWsEvent &aTime);
-	inline TInt MessageCount()
-		{return iMsgCount;}
-	inline void ResetMessageCount()
-		{iMsgCount=0;}
-private:
-	CTMessage *iTMessage; // CTMessage, to call it's OnMessageReceived when message is received
-	TInt iMsgCount;	
-	};
-
-	
-
-class CTMessageStep : public CTGraphicsStep
-	{
-public:
-	CTMessageStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTMessageStep,"TMessage");
-
-
-#endif
--- a/windowing/windowserver/tauto/TMODCHG.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,511 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Coverted from TMan test code (TMMODCHG.CPP) August 2000
-// Test modifier changed message
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TMODCHG.H"
-
-#define LOGGING on	//Uncoment this line to get extra logging
-
-struct TModifierChangedTestsParams
-	{
-	TText *txt;			// Text message telling user what to do
-	TUint changed;
-	TUint state;
-	TUint stateMask;
-	};
-
-LOCAL_D TModifierChangedTestsParams ModifierChangedTests[]={
-	{(TText *)_S("Press Caps"),EModifierCapsLock,EModifierCapsLock,EModifierCapsLock},
-	{(TText *)_S("Press Caps (again)"),EModifierCapsLock,0,EModifierCapsLock},
-	{(TText *)_S("Press left shift"),EModifierShift|EModifierLeftShift,EModifierShift|EModifierLeftShift,EModifierShift|EModifierLeftShift},
-	{(TText *)_S("Release left shift"),EModifierShift|EModifierLeftShift,0,EModifierShift|EModifierLeftShift},
-	{(TText *)_S("Press right shift"),EModifierShift|EModifierRightShift,EModifierShift|EModifierRightShift,EModifierShift|EModifierRightShift},
-	{(TText *)_S("Release right shift"),EModifierShift|EModifierRightShift,0,EModifierShift|EModifierRightShift},
-	{(TText *)_S("Press (left) func"),EModifierFunc|EModifierLeftFunc,EModifierFunc|EModifierLeftFunc,EModifierFunc|EModifierLeftFunc},
-	{(TText *)_S("Release (left) func"),EModifierFunc|EModifierLeftFunc,0,EModifierFunc|EModifierLeftFunc},
-	{(TText *)_S("Press (left) control"),EModifierCtrl|EModifierLeftCtrl,EModifierCtrl|EModifierLeftCtrl,EModifierCtrl|EModifierLeftCtrl},
-	{(TText *)_S("Release (left) control"),EModifierCtrl|EModifierLeftCtrl,0,EModifierCtrl|EModifierLeftCtrl},
-	};
-
-// list of ModifierEvents that should be monitored
-LOCAL_D TInt ModifierChangedEvents=EModifierShift|EModifierLeftShift|EModifierRightShift|
-	EModifierCapsLock|EModifierFunc|EModifierLeftFunc|EModifierCtrl|EModifierLeftCtrl;
-
-const TInt numTests=sizeof(ModifierChangedTests)/sizeof(ModifierChangedTests[0]);
-
-
-//
-// CTEventWindowGroup class //
-//
-
-CTEventWindowGroup::CTEventWindowGroup(CTClient *aClient, CTModifiersChanged *aTest) : CTWindowGroup(aClient), iTest(aTest)
-	{}
-
-void CTEventWindowGroup::ConstructL()
-	{
-	CTWindowGroup::ConstructL();
-	iGroupWin.EnableModifierChangedEvents(ModifierChangedEvents,EEventControlAlways);
-	}
-
-void CTEventWindowGroup::ModifiersChanged(const TModifiersChangedEvent &aModifiersChanged, const TTime &)
-	{
-	iTest->TestModifiersState(aModifiersChanged); // tests if event is correct
-	}
-
-void CTEventWindowGroup::KeyL(const TKeyEvent &aKey,const TTime &)
-	{
-	if (aKey.iCode==EKeyEscape || (aKey.iCode==' ' && iTest->iModSetTest))
-		iTest->EndTest(); // not really needed, because timer cancels long running tests
-	}
-
-//
-// CMCWindow, class //
-//
-
-CMCWindow::CMCWindow(CTModifiersChanged *aTest) : CTWin(), iTest(aTest)
-	{
-	iBack=TRgb::Gray256(230);
-	}
-
-void CMCWindow::SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc)
-	{
-	ConstructExtLD(*parent,pos,size);
-	iWin.SetBackgroundColor(iBack);
-	Activate();
-	AssignGC(aGc);
-	iLineHeight=iFont->HeightInPixels()*5/4;
-	iFontAscent=iFont->AscentInPixels();
-	iXpos1=4;
-	iXpos2=iXpos1+12*iFont->TextWidthInPixels(_L("M"));
-	}
-
-void CMCWindow::DrawModSetLine(const TDesC &aDes,TInt aModifier,TInt iSettableModifiers)
-	{
-	iYpos+=iLineHeight;
-	iGc->DrawText(aDes, TPoint(iXpos1,iYpos));
-	iGc->DrawText(aModifier&iSettableModifiers ? _L("Yes"):_L("No"), TPoint(iXpos2,iYpos));
-	}
-
-void CMCWindow::Draw()
-	{
-	iGc->Clear();
-	if (iTest->iModSetTest)
-		{
-		iYpos=iFontAscent+3;
-		TBuf<32> buf;
-		buf.Format(TRefByValue<const TDesC>(_L("Settable? [0x%4x]")), iTest->iSettable);
-		iGc->DrawText(_L("Modifier"), TPoint(iXpos1,iYpos));
-		iGc->DrawText(buf, TPoint(iXpos2,iYpos));
-		DrawModSetLine(_L("Shift"),EModifierShift,iTest->iSettable);
-		DrawModSetLine(_L("Left Shift"),EModifierLeftShift,iTest->iSettable);
-		DrawModSetLine(_L("Func"),EModifierFunc,iTest->iSettable);
-		DrawModSetLine(_L("Caps"),EModifierCapsLock,iTest->iSettable);
-		DrawModSetLine(_L("NumLock"),EModifierNumLock,iTest->iSettable);
-		DrawModSetLine(_L("Double Click"),EModifierDoubleClick,iTest->iSettable);
-		}
-	else
-		iGc->DrawText(TPtrC(ModifierChangedTests[iTest->SubState()].txt), TPoint(10,20));
-	}
-
-//
-
-CTModifiersChanged::CTModifiersChanged(CTestStep* aStep): CTWsGraphicsBase(aStep), 
-	iSkipFirstModifierEvents(EFalse), iSubSchedulerRunning(EFalse)
-	{
-	}
-
-CTModifiersChanged::~CTModifiersChanged()
-	{
-	delete iTimeOut;
-	delete iWin;
-	delete iEventGroup;
-	}
-
-void CTModifiersChanged::ConstructL()
-	{
-	iTimeOut=new(ELeave) CTimeOut();
-	iTimeOut->ConstructL();
-	iWin=new(ELeave) CMCWindow(this);
-	iWin->SetUpL(TPoint(10,10),TSize(240,200),Client()->iGroup, *Client()->iGc);
-	}
-
-TInt CTModifiersChanged::TimeOut(TAny* aTest) // static
-	{
-	static_cast<CTModifiersChanged*>(aTest)->TimeOut();
-	return(KErrNone);
-	}
-
-void CTModifiersChanged::TimeOut()
-	{
-	#if defined(LOGGING)
-		_LIT(KLogTimeOut,"Test timed out after %d secs.");
-		LOG_MESSAGE2(KLogTimeOut,KTimeOutAfter/1000000);
-	#endif
-	EndTest();
-	}
-
-void CTModifiersChanged::EndTest() 
-	{
-	TEST(EFalse); // test failed (timeout or manually cancelled)
-	if (iModSetTest)
-		{
-		iModSetTest=EFalse;
-		iWin->Invalidate();
-		}
-	_LIT(KLogEndTest,"EndTest - State %d - SubState %d");
-	LOG_MESSAGE3(KLogEndTest,iTest->iState,iSubState);
-	if (iSubSchedulerRunning) 
-		{
-		iSubSchedulerRunning = EFalse;
-		CActiveScheduler::Stop(); // stop the sub-scheduler, so test-framework can execute the next test
-		}		
-	}
-
-TInt CTModifiersChanged::SubState() const
-	{
-	return(iSubState);
-	}
-
-void CTModifiersChanged::IncSubState()
-	{
-	if (iSubState<numTests-1)
-		{
-		iSubState++;
-		iWin->Invalidate();
-		TheClient->WaitForRedrawsToFinish();
-		SendEvents();
-		}
-	else if (iSubState>=numTests-1) // test finished successfully
-		{
-		if (iSubSchedulerRunning)
-			{
-			iSubSchedulerRunning = EFalse;
-			CActiveScheduler::Stop(); // stop the sub-scheduler, so test-framework can execute the next test
-			}
-		}
-	}
-
-void CTModifiersChanged::TestModifiersState(const TModifiersChangedEvent &aModifiersChanged)
-	{
-	if (iTest->iState==1) // only if currently in test 1 (add another if for further tests)
-		{
-		TInt getMods=Client()->iWs.GetModifierState();	// double check the modifiers
-		#if defined(LOGGING)
-			if (iSkipFirstModifierEvents)
-				{
-				_LIT(KLogIgnored,"### This Event is part of the initial setup and is ignored for the test. ###");
-				LOG_MESSAGE(KLogIgnored);
-				}			
-			TLogMessageText buf;
-			_LIT(KLog1,"##MC1  SS=%x  Test-Modifiers=0x%x  Test-Changed=0x%x  Test-Mask=0x%x");
-			buf.Format(KLog1,iSubState,ModifierChangedTests[iSubState].state,ModifierChangedTests[iSubState].changed,ModifierChangedTests[iSubState].stateMask);
-			LOG_MESSAGE(buf);
-			_LIT(KLog2,"##MC2  Event-Modifiers=0x%x  Event-Changed=0x%x  Get-Modifiers=0x%x");
-			buf.Format(KLog2,aModifiersChanged.iModifiers,aModifiersChanged.iChangedModifiers,getMods);
-			LOG_MESSAGE(buf);
-			_LIT(KLog3,"##MC3  Changed:              (Event) 0x%x==0x%x (Test)");
-			buf.Format(KLog3,aModifiersChanged.iChangedModifiers,ModifierChangedTests[iSubState].changed);
-			LOG_MESSAGE(buf);
-			_LIT(KLog4,"##MC4  Modifier (with mask): (Event) 0x%x==0x%x (Test)");
-			buf.Format(KLog4,aModifiersChanged.iModifiers&ModifierChangedTests[iSubState].stateMask,ModifierChangedTests[iSubState].state);
-			LOG_MESSAGE(buf);
-			_LIT(KLog5,"##MC5  Modifier (with mask):   (Get) 0x%x==0x%x (Test)");
-			buf.Format(KLog5,getMods&ModifierChangedTests[iSubState].stateMask,ModifierChangedTests[iSubState].state);
-			LOG_MESSAGE(buf);
-		#endif
-		if (iSkipFirstModifierEvents) // skip the events caused by the initialization
-			{
-			if(--iSkipCounter<=0)
-				{
-				iSkipFirstModifierEvents = EFalse;
-				}
-			}
-		else
-			{
-			if (aModifiersChanged.iChangedModifiers==ModifierChangedTests[iSubState].changed && 
-					(aModifiersChanged.iModifiers&ModifierChangedTests[iSubState].stateMask)==ModifierChangedTests[iSubState].state &&
-					(getMods&ModifierChangedTests[iSubState].stateMask)==ModifierChangedTests[iSubState].state)
-				{
-				IncSubState(); // subtest is successfull
-				}
-			else
-				{				
-				TEST(EFalse); // subtest failed
-				_LIT(KLogTestFailed,"Modifier Change test failed.");
-				LOG_MESSAGE(KLogTestFailed);
-				}
-			}
-		} // if test 1
-	}
-
-void CTModifiersChanged::BadParams()
-	{
-	}
-
-/**
- * Resets all the modifiers after the test is finished. Make sure that all keys used in the
- * test are in the up-state.
- */
-void CTModifiersChanged::ResetModifiers()
-	{
-	_LIT(KLogResetModifiersError,"Error %d occured while turning off modifier 0x%x");
-	TInt err;
-	if ((err = Client()->iWs.SetModifierState(EModifierCapsLock,ETurnOffModifier)) != KErrNone)
-		LOG_MESSAGE3(KLogResetModifiersError,err, EModifierCapsLock);
-	if ((err = Client()->iWs.SetModifierState(EModifierShift,ETurnOffModifier)) != KErrNone)
-		LOG_MESSAGE3(KLogResetModifiersError,err, EModifierShift);
-	if ((err = Client()->iWs.SetModifierState(EModifierLeftShift,ETurnOffModifier)) != KErrNone)
-		LOG_MESSAGE3(KLogResetModifiersError,err, EModifierLeftShift);
-	if ((err = Client()->iWs.SetModifierState(EModifierRightShift,ETurnOffModifier)) != KErrNone)
-		LOG_MESSAGE3(KLogResetModifiersError,err, EModifierRightShift);
-	if ((err = Client()->iWs.SetModifierState(EModifierFunc,ETurnOffModifier)) != KErrNone)
-		LOG_MESSAGE3(KLogResetModifiersError,err, EModifierFunc);
-	if ((err = Client()->iWs.SetModifierState(EModifierLeftFunc,ETurnOffModifier)) != KErrNone)
-		LOG_MESSAGE3(KLogResetModifiersError,err, EModifierLeftFunc);
-	if ((err = Client()->iWs.SetModifierState(EModifierCtrl,ETurnOffModifier)) != KErrNone)
-		LOG_MESSAGE3(KLogResetModifiersError,err, EModifierCtrl);
-	if ((err = Client()->iWs.SetModifierState(EModifierLeftCtrl,ETurnOffModifier)) != KErrNone)
-		LOG_MESSAGE3(KLogResetModifiersError,err, EModifierLeftCtrl);
-	}
-
-/**
- * Initialises the Modifier state. All tested modifiers must be in the up-state before the
- * test starts. The number of sent key simulations needed for initialization is recorded.
- * Each key simulation during initialization causes a ModifierChanged event which should be 
- * ignored because it's not part of the actual test.
- */
-void CTModifiersChanged::ModifierChangedEventsL()
-	{
-	iEventGroup=new(ELeave) CTEventWindowGroup(Client(), this);
-	iEventGroup->ConstructL();
-	TInt modifiers=Client()->iWs.GetModifierState();
-	
-	if ((ModifierChangedEvents&modifiers)>0) // reset modifiers if they are in the down-state
-		{
-		iSkipFirstModifierEvents = ETrue;
-		if ((modifiers&EModifierCapsLock)>0)
-			{
-			iTest->SimulateKeyDownUp(EStdKeyCapsLock);
-			++iSkipCounter;
-			modifiers=Client()->iWs.GetModifierState();
-			}
-		if ((modifiers&EModifierLeftShift)>0)
-			{
-			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeyLeftShift);
-			++iSkipCounter;
-			modifiers=Client()->iWs.GetModifierState();
-			}
-		if ((modifiers&EModifierRightShift)>0)
-			{
-			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeyRightShift);
-			++iSkipCounter;
-			modifiers=Client()->iWs.GetModifierState();
-			}
-		if ((modifiers&EModifierLeftFunc)>0)
-			{
-			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeyLeftFunc);
-			++iSkipCounter;
-			modifiers=Client()->iWs.GetModifierState();
-			}
-		if ((modifiers&EModifierLeftCtrl)>0)
-			{
-			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeyLeftCtrl);
-			++iSkipCounter;
-			}
-		}
-	modifiers=Client()->iWs.GetModifierState();
-	_LIT(KLog,"Initial Modifiers state 0x%x (ideally should be zero)");
-	LOG_MESSAGE2(KLog,modifiers);
-	}
-
-void CTModifiersChanged::CheckModifier(TEventModifier aModifier)
-	{
-	TBool retVal;
-	TInt oldMods=Client()->iWs.GetModifierState();
-	Client()->iWs.SetModifierState(aModifier,EToggleModifier);
-	TInt getMods=Client()->iWs.GetModifierState();
-	if (oldMods!=getMods)
-		{
-		_LIT(KLogOff,"Attempted to turn off modifiers 0x%x, 0x%x still on");
-		_LIT(KLogOn,"Attempted to turn on modifiers 0x%x, 0x%x still off");
-		iSettable|=aModifier;
-		Client()->iWs.SetModifierState(aModifier,ETurnOffModifier);
-		getMods=Client()->iWs.GetModifierState();
-		retVal=!(getMods&aModifier);
-		TEST(retVal);
-		if (!retVal)
-			LOG_MESSAGE3(KLogOff,aModifier,getMods&aModifier);
-		Client()->iWs.SetModifierState(aModifier,ETurnOnModifier);
-		getMods=Client()->iWs.GetModifierState();
-		retVal=getMods&aModifier;
-		TEST(retVal);
-		if (!retVal)
-			LOG_MESSAGE3(KLogOn,aModifier,getMods&aModifier);
-		Client()->iWs.SetModifierState(aModifier,ETurnOffModifier);
-		getMods=Client()->iWs.GetModifierState();
-		retVal=!(getMods&aModifier);
-		TEST(retVal);
-		if (!retVal)
-			LOG_MESSAGE3(KLogOff,aModifier,getMods&aModifier);
-		if (oldMods&aModifier)
-			Client()->iWs.SetModifierState(aModifier,ETurnOnModifier);
-		}
-	else
-		{
-		Client()->iWs.SetModifierState(aModifier,ETurnOffModifier);
-		retVal=oldMods==Client()->iWs.GetModifierState();
-		TEST(retVal);
-		if (!retVal)
-			{
-			_LIT(KLog,"Attempted to turn off modifiers 0x%x, suceeded when it should have failed");
-			LOG_MESSAGE2(KLog,aModifier);
-			}
-		Client()->iWs.SetModifierState(aModifier,ETurnOnModifier);
-		retVal=oldMods==Client()->iWs.GetModifierState();
-		TEST(retVal);
-		if (!retVal)
-			{
-			_LIT(KLog,"Attempted to turn on modifiers 0x%x, suceeded when it should have failed");
-			LOG_MESSAGE2(KLog,aModifier);
-			}
-		}
-	}
-
-void CTModifiersChanged::SetModifiers()
-	{
-	iModSetTest=ETrue;
-	for(TInt mod=1;mod!=0;mod<<=1)
-		CheckModifier((TEventModifier)mod);
-	iWin->Invalidate();
-	Client()->iWs.Flush();
-	}
-
-void CTModifiersChanged::SendEvents()
-	{
-	iTest->LogSubState(iSubState);
-	switch (iSubState)
-		{
-	case 0:
-		iTest->SimulateKeyDownUp(EStdKeyCapsLock);
-		break;
-	case 1:
-		iTest->SimulateKeyDownUp(EStdKeyCapsLock);
-		break;
-	case 2:
-		iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeyLeftShift);
-		break;
-	case 3:
-		iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeyLeftShift);
-		break;
-	case 4:
-		iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeyRightShift);
-		break;
-	case 5:
-		iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeyRightShift);
-		break;
-	case 6:
-		iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeyLeftFunc);
-		break;
-	case 7:
-		iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeyLeftFunc);
-		break;
-	case 8:
-		iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeyLeftCtrl);
-		break;
-	case 9:
-		iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeyLeftCtrl);
-		break;
-	default:
-		TEST(EFalse);
-		return;
-		}
-	TheClient->iWs.Flush();
-	}
-
-void CTModifiersChanged::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(KModChange,"Modifier Change");
-	_LIT(KTestErrors,"Bad Parameter");
-	((CTModifiersChangedStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(++iTest->iState)
-		{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0239
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test modifier changed message
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Test that modifier changed message functions correctly
-
-@SYMTestExpectedResults The message functions correctly
-*/
-		case 1:
-			((CTModifiersChangedStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0239"));
-			iTest->LogSubTest(KModChange);
-			ModifierChangedEventsL();
-			// start a timer to cancel the sub-scheduler
-			iTimeOut->Start(KTimeOutAfter,TCallBack(CTModifiersChanged::TimeOut,this));
-			SendEvents();
-			iSubSchedulerRunning = ETrue;
-			CActiveScheduler::Start(); // sub-scheduler blocks this AO (test-framework) until completion
-			iTimeOut->Cancel();
-			((CTModifiersChangedStep*)iStep)->RecordTestResultL();
-			((CTModifiersChangedStep*)iStep)->CloseTMSGraphicsStep();
-			break;	
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0240
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test bad parameters for modifier changed message
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Test using bad parameters for a modifier changed message
-
-@SYMTestExpectedResults Responds correctly when bad parameters are used
-*/
-		case 2:
-			((CTModifiersChangedStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0240"));
-			iTest->LogSubTest(KTestErrors);
-			BadParams();
-			((CTModifiersChangedStep*)iStep)->RecordTestResultL();			
-			break;
-		default:
-			ResetModifiers(); // reset modifiers, so further tests are not influenced
-			((CTModifiersChangedStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTModifiersChangedStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-		}
-	
-	
-	}
-
-__WS_CONSTRUCT_STEP__(ModifiersChanged)
--- a/windowing/windowserver/tauto/TMODCHG.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TMODCHG_H__
-#define __TMODCHG_H__
-
-#include <e32std.h>
-#include <e32svr.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-
-class CTModifiersChanged;
-
-class CMCWindow : public CTWin
-	{
-public:
-	CMCWindow(CTModifiersChanged *aTest);
-	void SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
-	void Draw();
-	void DrawModSetLine(const TDesC &aDes,TInt aModifier,TInt iSettableModifiers);
-protected:
-	CTModifiersChanged *iTest;
-	TRgb iBack;
-	TInt iLineHeight;
-	TInt iFontAscent;
-	TInt iYpos;
-	TInt iXpos1;
-	TInt iXpos2;
-	};
-
-class CTEventWindowGroup : public CTWindowGroup
-	{
-public:
-	CTEventWindowGroup(CTClient *aClient, CTModifiersChanged *iTest);
-	void ConstructL();
-	void ModifiersChanged(const TModifiersChangedEvent &aModifiersChanged ,const TTime &aTime);
-	void KeyL(const TKeyEvent &aKey,const TTime &aTime);
-private:
-	CTModifiersChanged *iTest;	
-	};
-	
-class CTModifiersChanged : public CTWsGraphicsBase
-	{
-public:
-	CTModifiersChanged(CTestStep* aStep);
-	~CTModifiersChanged();
-	TestState DoTestL();
-	void ConstructL();
-	void EndTest();
-	TInt SubState() const;
-	void IncSubState();
-	void BadParams();
-	void ModifierChangedEventsL();
-	void SetModifiers();
-	void CheckModifier(TEventModifier aModifier);
-	void TestModifiersState(const TModifiersChangedEvent &aModifiersChanged);
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	inline TestClient* Client() {return TheClient;}
-	void SendEvents();
-	void ResetModifiers();
-	static TInt TimeOut(TAny* aTest);
-	void TimeOut();
-public:
-	TBool iModSetTest;
-	TInt iSettable;
-private:
-	enum {KTimeOutAfter=30000000};	// 30 seconds (test takes 8 sec on h4)
-private:
-	TSize iWinSize;	
-	TInt iSubState;
-	CTEventWindowGroup *iEventGroup;
-	CMCWindow *iWin;
-	TBool iSkipFirstModifierEvents;
-	TInt iSkipCounter;
-	CTimeOut* iTimeOut;
-	TBool iSubSchedulerRunning;
-	};
-
-class CTModifiersChangedStep : public CTGraphicsStep
-	{
-public:
-	CTModifiersChangedStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTModifiersChangedStep,"TModifiersChanged");
-
-
-#endif
--- a/windowing/windowserver/tauto/TMULSCREENS.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,666 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Enable Multiple Displays
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TMULSCREENS.h"
-
-const TInt KFstScreenNo = 0;
-const TInt KSndScreenNo = 1;
-
-CTMulScreens::CTMulScreens(CTestStep* aStep):
-	CTWsGraphicsBase(aStep)
-	{
-	}
-
-void CTMulScreens::ConstructL()
-	{
-	User::LeaveIfError(iRws.Connect());
-	iFstScreenDevice =new(ELeave) CWsScreenDevice(iRws);
-	TInt err = iFstScreenDevice->Construct(KFstScreenNo);
-	iTest->LogLeave(err);
-	User::LeaveIfError(err);
-	iNumScreens = iRws.NumberOfScreens();
-	if(KSndScreenNo<iNumScreens)
-		{
-		iSndScreenDevice =new(ELeave) CWsScreenDevice(iRws);
-		err = iSndScreenDevice->Construct(KSndScreenNo);
-		iTest->LogLeave(err);
-		User::LeaveIfError(err);
-		}
-	INFO_PRINTF2(_L("The number of screens supported on this device is %d"),iNumScreens);
-	}
-
-CTMulScreens::~CTMulScreens()
-	{
-	iFstWinGp.Close();
-	if(KSndScreenNo<iNumScreens)
-		{
-		iSndWinGp.Close();
-		delete iSndScreenDevice;
-		}
-	delete iFstScreenDevice;
-	iRws.Close();
-	}
-
-/**
-   @SYMTestCaseID          GRAPHICS-WSERV-0383
-
-   @SYMPREQ					PREQ1227
-
-   @SYMREQ					REQ5541
-
-   @SYMTestCaseDesc			Create Window Group(s) on each screen.
-
-   @SYMTestPriority			High
-
-   @SYMTestStatus			Implemented
-
-   @SYMTestActions			Call RWsSession::NumWindowGroups() to get the number of window groups of a given window group priority running on a specified screen.
-   							Test the number of Window Groups on each screen.
-   							Test the size of the list of window group on each screen.
-   							Test the Window Group which has the keyboard focus on the second screen.
-							API Calls:\n
-							TInt RWsSession::NumWindowGroups(TInt aScreenNumber,TInt aPriority) const
-							TInt RWsSession::WindowGroupList(CArrayFixFlat<TInt>* aWindowList,TInt aScreenNumber,TInt aPriority)
-							TInt RWindowGroup::Construct(TUint32 aClientHandle,CWsScreenDevice* aScreenDevice)
-							TInt RWsSession::GetFocusWindowGroup(TInt aScreenNumber)
-
-   @SYMTestExpectedResults	Provided that a second screen is configured in the epoc.ini and the wsini.ini, this test case will create one window group on the first screen
-   							and two window groups on the second screen.
-							If only one screen is configured, then it will create one group on the primary screen.
-							Otherwise this function leaves with a system-wide error.
-*/
-
-void CTMulScreens::TestCreateGroupWindowsL()
-	{
-	const TInt fstNumWinGps = iRws.NumWindowGroups(KFstScreenNo,EAllPriorities);
-	CArrayFixFlat<TInt>* fstList = new(ELeave) CArrayFixFlat<TInt>(1);
-	CleanupStack::PushL(fstList);
-	TInt err = iRws.WindowGroupList(fstList,KFstScreenNo,EAllPriorities);
-	TEST(err==KErrNone);
-	TEST(fstList->Count()==fstNumWinGps);
-	err = iRws.WindowGroupList(fstList); //test existing api
-	TEST(err==KErrNone);
-	TEST(fstList->Count()==(iRws.NumWindowGroups())); 
-	iFstWinGp = RWindowGroup(iRws);
-	TRAP(err,iFstWinGp.Construct(ENullWsHandle,iFstScreenDevice));
-	TEST(err==KErrNone);
-	if(err==KErrNone)
-		{
-		TEST(iRws.NumWindowGroups(KFstScreenNo,EAllPriorities) == (fstNumWinGps+1));
-		}
-	CleanupStack::PopAndDestroy(fstList);
-
-	//Second screen has been configured.
-	if(KSndScreenNo<iNumScreens)
-		{
-		TInt winId = iRws.GetFocusWindowGroup(KSndScreenNo);
-		TEST(winId==KErrGeneral);
-		iSndWinGp = RWindowGroup(iRws);
-		TRAP(err,iSndWinGp.Construct(ENullWsHandle,ETrue,iSndScreenDevice));
-		TEST(err==KErrNone);
-		if(err==KErrNone)
-			{
-			winId = iRws.GetFocusWindowGroup(KSndScreenNo);
-			TEST(winId==iSndWinGp.Identifier());
-			TEST(iRws.NumWindowGroups(KFstScreenNo,EAllPriorities) == (fstNumWinGps+1)); //test that the no. of screens unchanged on first screen
-			CArrayFixFlat<TInt>* sndList =new(ELeave) CArrayFixFlat<TInt>(1);
-			CleanupStack::PushL(sndList);
-			TInt sndNumWinGps = iRws.NumWindowGroups(KSndScreenNo,iSndWinGp.OrdinalPriority());
-			err = iRws.WindowGroupList(sndList,KSndScreenNo,iSndWinGp.OrdinalPriority());
-			TEST(err==KErrNone);
-			TEST(sndList->Count()==sndNumWinGps);
-
-			iSndWinGp.SetOrdinalPosition(iSndWinGp.OrdinalPosition(),EAllPriorities);
-			TInt allPriNumWinGps= iRws.NumWindowGroups(EAllPriorities);
-			CArrayFixFlat<TInt>* allPriList =new(ELeave) CArrayFixFlat<TInt>(1);
-			CleanupStack::PushL(allPriList);
-			err = iRws.WindowGroupList(EAllPriorities,allPriList);
-			TEST(err==KErrNone);
-			TEST(allPriList->Count()==allPriNumWinGps);
-
-			CleanupStack::PopAndDestroy(2,sndList);
-			}
-		RWindowGroup trdWinGp = RWindowGroup(iRws);
-		TRAP(err,trdWinGp.Construct(ENullWsHandle,ETrue,iSndScreenDevice));
-		TEST(err==KErrNone);
-		if(err==KErrNone)
-			{
-			winId = iRws.GetFocusWindowGroup(KSndScreenNo);
-			TEST(winId==trdWinGp.Identifier());
-			trdWinGp.Close();
-			}
-		}
-	}
-
-/**
-   @SYMTestCaseID          GRAPHICS-WSERV-0384
-
-   @SYMPREQ					PREQ1227
-
-   @SYMREQ					REQ5541
-
-   @SYMTestCaseDependencies	SYMTestCaseID GRAPHICS-WSERV-0383
-
-   @SYMTestCaseDesc			Create a blank window on each screen.
-
-   @SYMTestPriority			High
-
-   @SYMTestStatus			Implemented
-
-   @SYMTestActions			Test that each blank window is created on a different screen.
-							API Calls:\n
-							TInt RBlankWindow::Construct(const RWindowTreeNode &parent, TUint32 aClientHandle) where parent is
-							a Window Group created on each screen.
-
-   @SYMTestExpectedResults	The background colour of the first screen changes to blue and that of the second one changes to green.
-   							Otherwise this function leaves with a system-wide error.
-*/
-void CTMulScreens::TestCreateBlankWindowsL()
-	{
-	RBlankWindow fstBlankWin(iRws);
-	CleanupClosePushL(fstBlankWin);
-	TRAPD(err,fstBlankWin.Construct(iFstWinGp,ENullWsHandle));
-	TEST(err==KErrNone);
-	if(err==KErrNone)
-		{
-		fstBlankWin.SetRequiredDisplayMode(EColor256);
-		fstBlankWin.SetColor(TRgb(0,0,255)); // paint the screen blue
-		fstBlankWin.Activate();
-		iRws.Flush();
-		TheClient->WaitForRedrawsToFinish();
-		User::After(6000000);
-		}
-	CleanupStack::PopAndDestroy();//fstBlankWin	
-	
-	// Second screen
-	if(KSndScreenNo<iNumScreens)
-		{
-		RBlankWindow sndBlankWin(iRws);
-		CleanupClosePushL(sndBlankWin);
-		TRAP(err,sndBlankWin.Construct(iSndWinGp,ENullWsHandle));
-		TEST(err==KErrNone);
-		if(err==KErrNone)
-			{
-			sndBlankWin.SetRequiredDisplayMode(EColor256);
-			sndBlankWin.SetColor(TRgb(0,255,0));	//paint the screen green
-			sndBlankWin.Activate(); //there is a defect in Activate() because there is a delay before the second screen turns green
-			iRws.Flush();
-			TheClient->WaitForRedrawsToFinish();
-			User::After(6000000);
-			}
-		CleanupStack::PopAndDestroy(); //sndBlankWin
-		}
-	}
-
-
-/**
-   @SYMTestCaseID          GRAPHICS-WSERV-0385
-
-   @SYMPREQ					PREQ1227
-
-   @SYMREQ					REQ5541
-
-   @SYMTestCaseDependencies	SYMTestCaseID GRAPHICS-WSERV-0383
-
-   @SYMTestCaseDesc			Test the Window Group that has the keyboard focus for each screen.
-
-   @SYMTestPriority			High
-
-   @SYMTestStatus			Implemented
-
-   @SYMTestActions			Call RWsSession::GetFocusWindowGroup on each screen.
-							API Calls:\n
-							TInt RWsSession::GetFocusWindowGroup(TInt aScreenNumber)
-
-   @SYMTestExpectedResults	The identifier returned by the API for each screen is tested to see if it is the expected Window Group ID; ie the
-   							ID of the window group created in the first test case.
-*/
-void CTMulScreens::TestGetFocusWindow()
-	{
-	TInt winId = iRws.GetFocusWindowGroup(KFstScreenNo);
-	TEST(winId==iFstWinGp.Identifier());
-	if(KSndScreenNo<iNumScreens)
-		{
-		winId = iRws.GetFocusWindowGroup(KSndScreenNo);
-		TEST(winId==iSndWinGp.Identifier());
-		TEST(iRws.GetFocusWindowGroup()==iFstWinGp.Identifier());
-		}
-	}
-
-/**
-   @SYMTestCaseID          GRAPHICS-WSERV-0386
-
-   @SYMPREQ					PREQ1227
-
-   @SYMREQ					REQ5541
-
-   @SYMTestCaseDependencies	SYMTestCaseID GRAPHICS-WSERV-0383
-
-   @SYMTestCaseDesc			Test the default owning window on each screen.
-
-   @SYMTestPriority			High
-
-   @SYMTestStatus			Implemented
-
-   @SYMTestActions			Call RWsSession::GetDefaultOwningWindow() to return the ID of the default owning window.
-   							Call RWsSession::DefaultOwningWindow() on the second Window Group to set it as the default owning window on the second screen.
-   							Call new API RWsSession::GetDefaultOwningWindow(TInt aScreenNumber) to get the default owning window on the second screen.
-   							API Calls:\n
-							TInt RWsSession::GetFocusWindowGroup()
-							TInt RWsSession::GetFocusWindowGroup(TInt aScreenNumber)
-
-   @SYMTestExpectedResults	The identifier returned by the API for each screen is tested to see that they are not the same.
-*/
-void CTMulScreens::TestGetDefaultOwningWindow()
-	{
-	if(KSndScreenNo<iNumScreens)
-		{
-		TInt prevWinId = iRws.GetDefaultOwningWindow();
-		iSndWinGp.DefaultOwningWindow();
-		TInt winId = iRws.GetDefaultOwningWindow(KSndScreenNo);
-		TEST(winId==iSndWinGp.Identifier());
-		TEST(prevWinId!=winId);
-		}
-	}
-
-/**
-   @SYMTestCaseID          GRAPHICS-WSERV-0387
-
-   @SYMPREQ					PREQ1227
-
-   @SYMREQ					REQ5541
-
-   @SYMTestCaseDesc			Test the background colour.
-
-   @SYMTestPriority			High
-
-   @SYMTestStatus			Implemented
-
-   @SYMTestActions			Call RWsSession::GetBackgroundColor() to store the default value;Change the background colour by calling RWsSession::SetBackgroundColor();
-   							Test that the background has changed; Restore the background colour.
-   							API Calls:\n
-   							TRgb RWsSession::GetBackgroundColor() const
-							void RWsSession::SetBackgroundColor(TRgb colour)
-
-   @SYMTestExpectedResults	 Background color should change when SetBackgroundColor is called.
-*/
-void CTMulScreens::TestSetBackgroundColour()
-	{
-	TRgb rgb_b4 = iRws.GetBackgroundColor();
-	iRws.SetBackgroundColor(KRgbBlack);
-	TEST(iRws.GetBackgroundColor()==KRgbBlack);
-	iRws.SetBackgroundColor(rgb_b4);
-	TEST(iRws.GetBackgroundColor()==rgb_b4);
-	}
-
-/**
-   @SYMTestCaseID          GRAPHICS-WSERV-0388
-
-   @SYMPREQ					PREQ1227
-
-   @SYMREQ					REQ5541
-
-   @SYMTestCaseDesc			Test the shadow vector.
-
-   @SYMTestPriority			High
-
-   @SYMTestStatus			Implemented
-
-   @SYMTestActions			Call RWsSession::ShadowVector() to store the default value;Call RWsSession::SetShadowVector() to change the shadow vector;
-   							Test that the shadow vector has changed; Restore the shadow vector.
-   							API Calls:\n
-   							TPoint RWsSession::ShadowVector() const
-							void RWsSession::SetShadowVector(const TPoint &aVector);
-
-   @SYMTestExpectedResults	 The shadow vector should change when SetShadowVector is called.
-*/
-void CTMulScreens::TestSetShadowVector()
-	{
-	TPoint point_b4 = iRws.ShadowVector();
-	
-	iRws.SetShadowVector(TPoint(3,3));
-	
-	#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-	TEST(iRws.ShadowVector()==TPoint(0,0)); // in NGA SetShadowVector & ShadowVector are deprecated
-	#else
-	TEST(iRws.ShadowVector()==TPoint(3,3));
-	#endif
-	
-	iRws.SetShadowVector(point_b4);
-	
-	#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-	TEST(iRws.ShadowVector()==TPoint(0,0)); // in NGA SetShadowVector & ShadowVector are deprecated
-	#else
-	TEST(iRws.ShadowVector()==point_b4);
-	#endif
-	}
-
-/**
-   @SYMTestCaseID          GRAPHICS-WSERV-0389
-
-   @SYMPREQ					PREQ1227
-
-   @SYMREQ					REQ5541
-
-   @SYMTestCaseDesc			Negative tests for the APIs listed below.
-
-   @SYMTestPriority			High
-
-   @SYMTestStatus			Implemented
-
-   @SYMTestActions			Launch a thread to call TestInvalidScreenNumber. Pass an invalid screen number to the APIs listed below.
-   							API Calls:\n
-   							TInt RWsSession::NumWindowGroups(TInt aScreenNumber,TInt aPriority) const
-							TInt RWsSession::WindowGroupList(CArrayFixFlat<TInt>* aWindowList,TInt aScreenNumber,TInt aPriority)
-							TInt RWsSession::GetFocusWindowGroup(TInt aScreenNumber)
-							TInt GetDefaultOwningWindow(TInt aScreenNumber)
-							TDisplayMode GetDefModeMaxNumColors(TInt aScreenNumber,TInt& aColor,TInt& aGray) const
-   							TInt GetColorModeList(TInt aScreenNumber,CArrayFixFlat<TInt>* aModeList) const
-
-   @SYMTestExpectedResults	 The thread panics and exits with reason EWservPanicScreenNumber.
-*/
-void CTMulScreens::TestPanicsL()
-	{
-	TInt firstTest = 1;
-	TInt lastTest = 6;
-	const TInt KInvalidScreenNumber = 2;
-	for (TInt option=firstTest;option<=lastTest;option++)
-		{
-		TEST(iTest->TestWsPanicL(&TestInvalidScreenNumberL,EWservPanicScreenNumber,option,(TAny*)KInvalidScreenNumber));
-		}
-	}
-
-TInt CTMulScreens::TestInvalidScreenNumberL(TInt aOption, TAny *aScreenNumber)
-	{
-	RWsSession wsSession;
-	wsSession.Connect();
-	switch((TInt)aOption)
-		{
-		case 1:
-			wsSession.NumWindowGroups((TInt)aScreenNumber,EAllPriorities);
-			break;
-		case 2:
-			{
-			CArrayFixFlat<TInt>* list = new(ELeave) CArrayFixFlat<TInt>(1);
-			wsSession.WindowGroupList(list,(TInt)aScreenNumber,EAllPriorities);
-			}
-			break;
-		case 3:
-			wsSession.GetFocusWindowGroup((TInt)aScreenNumber);
-			break;
-		case 4:
-			wsSession.GetDefaultOwningWindow((TInt)aScreenNumber);
-			break;
-		case 5:
-			{
-			CArrayFixFlat<TInt>* list = new(ELeave) CArrayFixFlat<TInt>(1);
-			wsSession.GetColorModeList((TInt)aScreenNumber,list);
-			}
-			break;
-		case 6:
-			{
-			TInt color,gray;
-			wsSession.GetDefModeMaxNumColors((TInt)aScreenNumber,color,gray);
-			}
-			break;
-		default:
-			User::Panic(_L("Default panic"),KErrGeneral);
-			break;
-		}
-	return KErrNone;
-	}
-
-
-/**
-   @SYMTestCaseID          GRAPHICS-WSERV-0390
-
-   @SYMPREQ					PREQ1227
-
-   @SYMREQ					REQ5541
-
-   @SYMTestCaseDependencies	SYMTestCaseID GRAPHICS-WSERV-0383
-
-   @SYMTestCaseDesc			Test that CWindowGc updates its screendevice each time it is activated on a window.
-
-   @SYMTestPriority			High
-
-   @SYMTestStatus			Implemented
-
-   @SYMTestActions			Activate the gc on both RWindows.CWindowGc::Device() is called after each activation has taken place.
-   							API Calls:\n
-   							void CWindowGc::Activate(RDrawableWindow &aDevice);
-   							void CWindowGc::Deactivate();
-   							CGraphicsDevice* CWindowGc::Device() const
-   							TInt RWindow::Construct(const RWindowTreeNode &parent,TUint32 aHandle);
-
-   @SYMTestExpectedResults	CWindowGc::Device() returns the screendevice on which the gc was last activated.
-*/
-void CTMulScreens::TestDeviceL()
-	{
-	RWindow fstWin(iRws);
-	User::LeaveIfError(fstWin.Construct(iFstWinGp,ENullWsHandle));
-	CleanupClosePushL(fstWin);
-	fstWin.Activate();
-
-	CWindowGc* gc=new (ELeave) CWindowGc(iFstScreenDevice);
-	User::LeaveIfError(gc->Construct());
-	CleanupStack::PushL(gc);
-	gc->Activate(fstWin);
-
-	TEST((CWsScreenDevice*)gc->Device()==iFstScreenDevice);
-	gc->Deactivate();
-
-	if(KSndScreenNo<iNumScreens)
-		{
-		RWindow sndWin(iRws);
-		User::LeaveIfError(sndWin.Construct(iSndWinGp,ENullWsHandle));
-		CleanupClosePushL(sndWin);
-		sndWin.Activate();
-
-		gc->Activate(sndWin);
-		TEST((CWsScreenDevice*)gc->Device()==iSndScreenDevice);
-		gc->Deactivate();
-		CleanupStack::PopAndDestroy();
-		}
-
-	CleanupStack::PopAndDestroy(2,&fstWin);
-	}
-
-/**
-   @SYMTestCaseID          GRAPHICS-WSERV-0034
-
-   @SYMPREQ					PREQ1227
-
-   @SYMREQ					REQ5541
-
-   @SYMTestCaseDesc			Test that the order of creating a screen device and window group does not matter.
-
-   @SYMTestPriority			High
-
-   @SYMTestStatus			Implemented
-
-   @SYMTestActions			Create a window group before creating the screen device. Create a graphics context and call activate on it.
-   							API Calls:\n
-   							TInt RWindowGroup::Construct(TUint32 aClientHandle)
-   							TInt CWsScreenDevice::Construct()
-    						void CWindowGc::Activate(RDrawableWindow &aDevice);
-   							void CWindowGc::Deactivate();
-   							TInt RWindow::Construct(const RWindowTreeNode &parent,TUint32 aHandle);
-
-   @SYMTestExpectedResults	 The test code does not panic with EWservPanicGroupWinScreenDeviceDeleted
-*/
-void CTMulScreens::TestInitaliseScreenDeviceL()
-	{
-	RWsSession rws1;
-	User::LeaveIfError(rws1.Connect());
-	CleanupClosePushL(rws1);
-
-	RWindowGroup gw1(rws1);
-	User::LeaveIfError(gw1.Construct(ENullWsHandle));
-	CleanupClosePushL(gw1);
-
-	CWsScreenDevice* screen1 = new (ELeave) CWsScreenDevice(rws1);
-	User::LeaveIfError(screen1->Construct());
-	CleanupStack::PushL(screen1);
-
-	RWindow win1(rws1);
-	User::LeaveIfError(win1.Construct(gw1,ETrue));
-	CleanupClosePushL(win1);
-	win1.Activate();
-
-	CWindowGc* gc=new (ELeave) CWindowGc(screen1);
-	User::LeaveIfError(gc->Construct());
-	CleanupStack::PushL(gc);
-	gc->Activate(win1);
-
-	CleanupStack::PopAndDestroy(5,&rws1);
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0492
-
-@SYMDEF             PDEF126432
-
-@SYMTestCaseDesc    Test the screen number that a window is located on
-
-@SYMTestPriority    Medium
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Create two windows on two screens respectively 
-					and check the screen number that each window is located on
-
-@SYMTestExpectedResults The screen numbers should match the expected ones
-*/
-void CTMulScreens::TestScreenNumbersOfWindowsL()
-	{
-	// First screen
-	RWindow fstWin(iRws);
-	CleanupClosePushL(fstWin);
-	TRAPD(err,fstWin.Construct(iFstWinGp,ENullWsHandle));
-	TEST(err==KErrNone);
-	if(err==KErrNone)
-		{
-		fstWin.Activate();
-		iRws.Flush();
-		}
-	TEST(fstWin.ScreenNumber()==KFstScreenNo);
-	CleanupStack::PopAndDestroy();//fstWin	
-	
-	// Second screen
-	if(KSndScreenNo<iNumScreens)
-		{
-		RWindow sndWin(iRws);
-		CleanupClosePushL(sndWin);
-		TRAP(err,sndWin.Construct(iSndWinGp,ENullWsHandle));
-		TEST(err==KErrNone);
-		if(err==KErrNone)
-			{
-			sndWin.Activate(); 
-			iRws.Flush();
-			}
-		TEST(sndWin.ScreenNumber()==KSndScreenNo);
-		CleanupStack::PopAndDestroy(); //sndWin
-		}
-	}	
-	
-void CTMulScreens::RunTestCaseL(TInt aCurTestCase)
-	{
-	_LIT(KTest0,"Create a window group on each screen");
-	_LIT(KTest1,"Create a blank window on each screen");
-	_LIT(KTest2,"Get focus window");
-	_LIT(KTest3,"Get default owning window");
-	_LIT(KTest4,"Change background colour");
-	_LIT(KTest5,"Change shadow vector");
-	_LIT(KTest6,"Panic Tests");
-	_LIT(KTest7,"Test device pointer returned by GC");
-	_LIT(KTest8,"Initialise ScreenDevice");
-	_LIT(KTest9,"Test screen numbers that windows are located on");
-	((CTMulScreensStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-
-	switch(aCurTestCase)
-		{
-		case 1:
-			((CTMulScreensStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0383"));
-			INFO_PRINTF1(KTest0);
-			TestCreateGroupWindowsL();
-			break;
-		case 2:
-			((CTMulScreensStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0384"));
-			INFO_PRINTF1(KTest1);
-			TestCreateBlankWindowsL();
-			break;
-		case 3:
-			((CTMulScreensStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0385"));
-			INFO_PRINTF1(KTest2);
-			TestGetFocusWindow();
-		case 4:
-			((CTMulScreensStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0386"));
-			INFO_PRINTF1(KTest3);
-			TestGetDefaultOwningWindow();
-			break;
-		case 5:
-			((CTMulScreensStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0387"));
-			INFO_PRINTF1(KTest4);
-			TestSetBackgroundColour();
-			break;
-		case 6:
-			((CTMulScreensStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0388"));
-			INFO_PRINTF1(KTest5);
-			TestSetShadowVector();
-			break;
-		case 7:
-			((CTMulScreensStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0389"));
-			INFO_PRINTF1(KTest6);
-			TestPanicsL();
-			break;
-		case 8:
-			((CTMulScreensStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0390"));
-			INFO_PRINTF1(KTest7);
-			TestDeviceL();
-			break;
-		case 9:
-			((CTMulScreensStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0034"));
-			INFO_PRINTF1(KTest8);
-			TestInitaliseScreenDeviceL();
-			break;
-		case 10:
-			((CTMulScreensStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0492"));
-			INFO_PRINTF1(KTest9);
-			TestScreenNumbersOfWindowsL();
-		case 11:
-			((CTMulScreensStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTMulScreensStep*)iStep)->CloseTMSGraphicsStep();
-			INFO_PRINTF1(_L("All tests completed.\n"));
-			TestComplete();
-			break;
-		default:
-			((CTMulScreensStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTMulScreensStep*)iStep)->CloseTMSGraphicsStep();
-			INFO_PRINTF1(_L("CTMulScreens::RunTestCaseL default case\n"));
-			break;
-		}
-	((CTMulScreensStep*)iStep)->RecordTestResultL();
-	}
-
-__WS_CONSTRUCT_STEP__(MulScreens)
--- a/windowing/windowserver/tauto/TMULSCREENS.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Enable Multiple Displays
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TMULSCREENS_H__
-#define __TMULSCREENS_H__
-
-#include <e32err.h>
-#include <w32std.h>
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-class CTMulScreens : public CTWsGraphicsBase
-	{
-public:
-	CTMulScreens(CTestStep* aStep);
-	~CTMulScreens();
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	void ConstructL();
-	void TestCreateGroupWindowsL();
-	void TestCreateBlankWindowsL();
-	void TestGetFocusWindow();
-	void TestGetDefaultOwningWindow();
-	void TestSetBackgroundColour();
-	void TestSetShadowVector();
-	void TestPanicsL();
-	static TInt TestInvalidScreenNumberL(TInt aOption,TAny* aScreenNumber);
-	void TestInitaliseScreenDeviceL();
-	void TestScreenNumbersOfWindowsL();
-	void TestDeviceL();
-private:
-	RWsSession iRws;
-	CWsScreenDevice* iFstScreenDevice;
-	CWsScreenDevice* iSndScreenDevice;
-	RWindowGroup iFstWinGp;
-	RWindowGroup iSndWinGp;
-	TInt iNumScreens;
-	};
-
-class CTMulScreensStep : public CTGraphicsStep
-	{
-public:
-	CTMulScreensStep();
-protected:
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTMulScreensStep,"TMulScreens");
-
-#endif
--- a/windowing/windowserver/tauto/TMULTCON.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,478 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test multiple connections to the window server
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TMULTCON.H"
-
-const TInt EMaxSubState=3;
-
-//#define LOGGING on		//Uncomment this line to get extra logging
-
-_LIT(ClickOnMe,"Click on me");
-_LIT(KError,"ERROR");
-
-
-CTMultiCon::CTMultiCon(CTestStep* aStep) : CTWsGraphicsBase(aStep)
-	{
-	}
-
-CTMultiCon::~CTMultiCon()
-	{
-	delete iConn1;
-	delete iConn2;
-	delete iConn3;
-	delete iTimeOut;
-	}
-
-void CTMultiCon::EndAutoForegroundTest()
-	{
-#if defined(LOGGING)
-	_LIT(KLog,"EndAutoForegroundTest  SubState %d");
-	LOG_MESSAGE2(KLog,iSubState);
-#endif
-	iConn1->iGroup->GroupWin()->EnableReceiptOfFocus(EFalse);
-	iConn2->iGroup->GroupWin()->EnableReceiptOfFocus(EFalse);
-	iConn3->iGroup->GroupWin()->EnableReceiptOfFocus(EFalse);
-	CActiveScheduler::Stop();
-	}
-
-void CTMultiCon::ConstructL()
-	{
-	iTimeOut=new(ELeave) CTimeOut();
-	iTimeOut->ConstructL();
-	TheClient->iWs.SetPointerCursorArea(iTest->iNormalPointerCursorArea);
-	iScreenSize=TSize(TheClient->iScreen->SizeInPixels());
-	iConn3=new(ELeave) CMcConnectionDef(this);
-	iConn3->ConstructL();
-	iConn2=new(ELeave) CMcConnection(this);
-	iConn2->ConstructL();
-	iConn1=new(ELeave) CMcConnectionAf(this);
-	iConn1->ConstructL();
-	iTest->SimulateKeyDownUp(EStdKeyLeftCtrl);
-	iTest->SimulateKeyDownUp(EStdKeyRightCtrl);
-	TInt mods=TheClient->iWs.GetModifierState();
-	_LIT(KLog,"Initial Modifiers state 0x%x (ideally should be zero)");
-	LOG_MESSAGE2(KLog,mods);
-	}
-
-TInt CTMultiCon::TimeOut(TAny* aTest)		//static
-	{
-	static_cast<CTMultiCon*>(aTest)->TimeOut();
-	return(KErrNone);
-	}
-
-void CTMultiCon::TimeOut()
-	{
-	TLogMessageText buf;
-	_LIT(KMultiConTimeOut,"TIMEOUT: Multiple Conection Test, %d, %S");
-	buf.AppendFormat(KMultiConTimeOut,iTest->iState,&iTest->iSubTitle);
-	TheClient->LogMessage(buf);
-	++iTimeOutCount;
-	EndAutoForegroundTest();
-	}
-
-
-//
-// CMcConnection //
-//
-
-CMcConnectionBase::CMcConnectionBase(CTMultiCon *aTest) : iTest(aTest)
-	{
-	}
-
-CMcConnectionBase::~CMcConnectionBase()
-	{
-	CTWin::Delete(iWin);
-	delete iGc;
-	}
-
-void CMcConnectionBase::SubStateChanged()
-	{
-	iWin->Invalidate();
-	iWs.Flush();
-	}
-
-void CMcConnectionBase::ConstructL()
-	{
-	CTClient::SetScreenNumber(iTest->ScreenNumber());
-	CTClient::ConstructL();
-	User::LeaveIfError(iScreen->CreateContext(iGc));
-	}
-
-CMcConnection::CMcConnection(CTMultiCon *aTest) : CMcConnectionBase(aTest)
-	{
-	}
-
-void CMcConnection::ConstructL()
-	{
-	CMcConnectionBase::ConstructL();
-	iGroup=new(ELeave) CTWindowGroup(this);
-	iGroup->ConstructL();
-	TSize screenSize=iGroup->Size();
-	TInt winWidth=screenSize.iWidth/3;
-	TInt winHeight=screenSize.iHeight/2-10;
-	iGroup->GroupWin()->AutoForeground(EFalse);
-	CMcWindow *win=new(ELeave) CMcWindow(iTest);
-	win->SetUpL(TPoint(5,5),TSize(winWidth,winHeight),iGroup,*iGc);
-	iWin=win;
-	iWs.Flush();
-	}
-
-CMcConnectionAf::CMcConnectionAf(CTMultiCon *aTest) : CMcConnectionBase(aTest)
-	{
-	}
-
-void CMcConnectionAf::ConstructL()
-	{
-	CMcConnectionBase::ConstructL();
-	iGroup=new(ELeave) CMcWindowGroupAf(this);
-	iGroup->ConstructL();
-	TSize screenSize=iGroup->Size();
-	TInt winWidth=screenSize.iWidth/3;
-	TInt winHeight=screenSize.iHeight/2-10;
-	iGroup->GroupWin()->AutoForeground(ETrue);
-	CMcWindowAf *win=new(ELeave) CMcWindowAf(iTest);
-	win->SetUpL(TPoint(winWidth,5),TSize(winWidth,winHeight),iGroup,*iGc);
-	iWin=win;
-	iWs.Flush();
-	}
-
-void CMcConnectionAf::KeyL(const TKeyEvent &aKey)
-	{
-#if defined(LOGGING)
-	_LIT(KLog1,"KeyL  SS=%d (0)  GpWinOrdPos=%d (0)  Code=%d (32)");
-	_LIT(KLog2," '%c'");
-	TLogMessageText buf;
-	buf.Format(KLog1,iTest->SubState(),iGroup->GroupWin()->OrdinalPosition(),aKey.iCode);
-	if (aKey.iCode>0)
-		buf.AppendFormat(KLog2,aKey.iCode);
-	iTest->LOG_MESSAGE(buf);
-#endif
-	switch(aKey.iCode)
-		{
-		case ' ':
-			if (iTest->SubState()==0)
-				{
-				iTest->TEST(iGroup->GroupWin()->OrdinalPosition()==0);
-				iTest->IncSubState();
-				}
-			break;
-		case EKeyEscape:
-			iTest->EndAutoForegroundTest();
-			break;
-		}
-	}
-
-CMcConnectionDef::CMcConnectionDef(CTMultiCon *aTest) : CMcConnectionBase(aTest)
-	{
-	}
-
-void CMcConnectionDef::ConstructL()
-	{
-	CMcConnectionBase::ConstructL();
-	iGroup=new(ELeave) CTWindowGroup(this);
-	iGroup->ConstructL();
-	iGroup->GroupWin()->EnableReceiptOfFocus(EFalse);
-	TSize screenSize=iGroup->Size();
-	TInt winWidth=screenSize.iWidth/3-10;
-	TInt winHeight=(screenSize.iHeight/2)-10;
-	CMcWindowDef *win=new(ELeave) CMcWindowDef(iTest);
-	win->SetUpL(TPoint(5+winWidth/2,screenSize.iHeight/2),TSize(winWidth,winHeight),iGroup,*iGc);
-	iWin=win;
-	iWs.Flush();
-	}
-
-//
-// CMcWindow, base class //
-//
-
-CMcWindowBase::CMcWindowBase(CTMultiCon *aTest) : CTWin(), iTest(aTest)
-	{
-	}
-
-void CMcWindowBase::SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc)
-	{
-	ConstructExtLD(*parent,pos,size);
-	iWin.SetBackgroundColor(iBack);
-	Activate();
-	AssignGC(aGc);
-	}
-
-//
-// CMcWindow, window used to test multiple connections //
-//
-
-CMcWindow::CMcWindow(CTMultiCon *aTest) : CMcWindowBase(aTest)
-	{
-	iBack=TRgb::Gray256(221);
-	}
-
-void CMcWindow::PointerL(const TPointerEvent &pointer,const TTime &)
-	{
-#if defined(LOGGING)
-	_LIT(KLog,"Pointer  SS=%d (1)  Type=%d (%d)  GpWinOrdPos=%d (1)");
-	iTest->LOG_MESSAGE5(KLog,iTest->SubState(),pointer.iType,TPointerEvent::EButton1Down,Client()->iGroup->GroupWin()->OrdinalPosition());
-#endif
-	if (pointer.iType==TPointerEvent::EButton1Down)
-		{
-		switch(iTest->SubState())
-			{
-			case 1:
-				iTest->TEST(Client()->iGroup->GroupWin()->OrdinalPosition()==1);
-				iTest->IncSubState();
-				break;
-			}
-		}
-	}
-
-void CMcWindow::Draw()
-	{
-	iGc->Clear();
-	TBuf<0x40> buf;
-	switch(iTest->SubState())
-		{
-		case 1:
-			buf.Copy(ClickOnMe);
-			break;
-		case 0:
-		case 2:
-		case 3:
-			buf.Copy(KNullDesC);
-			break;
-		default:
-			buf.Copy(KError);
-		}
-	iGc->DrawText(buf, TPoint(10,20));
-	}
-
-//
-// CMcWindowAf, Auto foreground version of CMcWindow //
-//
-
-CMcWindowAf::CMcWindowAf(CTMultiCon *aTest) : CMcWindowBase(aTest)
-	{
-	iBack=TRgb::Gray256(150);
-	}
-
-void CMcWindowAf::PointerL(const TPointerEvent &pointer,const TTime &)
-	{
-#if defined(LOGGING)
-	_LIT(KLog,"PointerL  SS=%d (2)  Type=%d (%d)  GpWinOrdPos=%d (0)");
-	iTest->LOG_MESSAGE5(KLog,iTest->SubState(),pointer.iType,TPointerEvent::EButton1Down,Client()->iGroup->GroupWin()->OrdinalPosition());
-#endif
-	if (pointer.iType==TPointerEvent::EButton1Down)
-		{
-		switch(iTest->SubState())
-			{
-			case 2:
-				iTest->TEST(Client()->iGroup->GroupWin()->OrdinalPosition()==0);
-				iTest->IncSubState();
-				break;
-			}
-		}
-	}
-
-void CMcWindowAf::Draw()
-	{
-	_LIT(PressSpace,"Press <Space>");
-	iGc->Clear();
-	TBuf<0x40> buf;
-	switch(iTest->SubState())
-		{
-		case 1:
-		case 3:
-			break;
-		case 0:
-			buf.Copy(PressSpace);
-			break;
-		case 2:
-			buf.Copy(ClickOnMe);
-			break;
-		default:
-			buf.Copy(KError);
-		}
-	iGc->DrawText(buf, TPoint(10,20));
-	}
-
-//
-
-CMcWindowGroupAf::CMcWindowGroupAf(CTClient *aClient) : CTWindowGroup(aClient)
-	{}
-
-void CMcWindowGroupAf::KeyL(const TKeyEvent &aKey, const TTime &)
-	{
-	((CMcConnectionAf *)iClient)->KeyL(aKey);
-	}
-
-//
-// CMcWindowDef, Default auto foreground version of CMcWindow //
-//
-
-CMcWindowDef::CMcWindowDef(CTMultiCon *aTest) : CMcWindowBase(aTest)
-	{
-	iBack=TRgb::Gray256(236);
-	}
-
-void CMcWindowDef::PointerL(const TPointerEvent &pointer,const TTime &)
-	{
-#if defined(LOGGING)
-	_LIT(KLog,"PointerL  SS=%d (3)  Type=%d (%d)  GpWinOrdPos=%d (0)");
-	iTest->LOG_MESSAGE5(KLog,iTest->SubState(),pointer.iType,TPointerEvent::EButton1Down,Client()->iGroup->GroupWin()->OrdinalPosition());
-#endif
-	if (pointer.iType==TPointerEvent::EButton1Down)
-		{
-		switch(iTest->SubState())
-			{
-			case 3:
-				iTest->TEST(Client()->iGroup->GroupWin()->OrdinalPosition()==0);
-				iTest->IncSubState();
-				break;
-			}
-		}
-	}
-
-void CMcWindowDef::Draw()
-	{
-	iGc->Clear();
-	TBuf<0x40> buf;
-	switch(iTest->SubState())
-		{
-		case 0:
-		case 1:
-		case 2:
-			break;
-		case 3:
-			buf.Copy(ClickOnMe);
-			break;
-		default:
-			buf.Copy(KError);
-		}
-	iGc->DrawText(buf, TPoint(10,20));
-	}
-
-//
-
-TInt CTMultiCon::SubState() const
-	{
-	return(iSubState);
-	}
-
-void CTMultiCon::IncSubState()
-	{
-	if (iSubState==EMaxSubState)
-		EndAutoForegroundTest();
-	else
-		{
-		iSubState++;
-	#if defined(LOGGING)
-		_LIT(KLog,"New SubState %d");
-		LOG_MESSAGE2(KLog,iSubState);
-	#endif
-		iConn1->SubStateChanged();
-		iConn2->SubStateChanged();
-		iConn3->SubStateChanged();
-		TheClient->WaitForRedrawsToFinish();
-		SendEvents();
-		}
-	}
-
-void CTMultiCon::SendEvents()
-	{
-#if defined(LOGGING)
-	_LIT(KLog,"Sending event for substate %d");
-	LOG_MESSAGE2(KLog,iSubState);
-#endif
-
-	switch (iSubState)
-		{
-	case 0:
-		iTest->SimulateKeyDownUp(EStdKeySpace);
-		break;
-	case 1:
-		iTest->SimulatePointerDownUp(iScreenSize.iWidth/6+5,iScreenSize.iHeight/4);
-		break;
-	case 2:
-		iTest->SimulatePointerDownUp(iScreenSize.iWidth/2,iScreenSize.iHeight/4);
-		break;
-	case 3:
-		iTest->SimulatePointerDownUp(iScreenSize.iWidth/3,3*iScreenSize.iHeight/4-5);
-		break;
-	default:
-		TEST(EFalse);
-		}
-	TheClient->iWs.Flush();
-	}
-
-void CTMultiCon::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(KTestMultiCon1,"MultiCon 1");
-	_LIT(KTimeOut,"Test Timed Out after %dsecs.  SubState=%d");
-	((CTMultiConStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	
-	if (!TestBase()->ConfigurationSupportsPointerEventTesting())
-	    {
-	    INFO_PRINTF1(_L("Test skipped because config does not support pointer event testing"));
-	    TestComplete();
-	    return;
-	    }
-    
-	switch(++iTest->iState)
-		{
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0289
-  
-  @SYMDEF             DEF081259
- 
-  @SYMTestCaseDesc Test multiple connections to the window server
-    
-  @SYMTestPriority High
- 
-  @SYMTestStatus Implemented
- 
-  @SYMTestActions Make mutiple connections to the window server and check
-  				  that the connections are made corectly
-  
-  @SYMTestExpectedResults The connections are made correctly
- 
-*/		
-		case 1:
-			((CTMultiConStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0289"));
-			iTest->LogSubTest(KTestMultiCon1);
-			iTimeOut->Start(KTimeOutAfter,TCallBack(CTMultiCon::TimeOut,this));
-			SendEvents();
-			CActiveScheduler::Start();
-			iTimeOut->Cancel();
-			TEST(iTimeOutCount==0);
-			if (iTimeOutCount!=0)
-				LOG_MESSAGE3(KTimeOut,KTimeOutAfter/1000000,iSubState);
-			break;
-		default:
-			((CTMultiConStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTMultiConStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-			break;
-		}
-	((CTMultiConStep*)iStep)->RecordTestResultL();
-	}
-
-__WS_CONSTRUCT_STEP__(MultiCon)
--- a/windowing/windowserver/tauto/TMULTCON.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,157 +0,0 @@
-
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TMULTCON_H__
-#define __TMULTCON_H__
-
-#include <e32std.h>
-#include <e32svr.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-class CTMultiCon;
-class CMcWindowBase;
-
-class CMcConnectionBase : public CTClient
-	{
-public:
-	CMcConnectionBase(CTMultiCon *aTest);
-	~CMcConnectionBase();
-	virtual void ConstructL();
-	void SubStateChanged();
-protected:
-	CTMultiCon *iTest;
-	CMcWindowBase *iWin;
-	CWindowGc *iGc;
-	};
-
-class CMcConnection : public CMcConnectionBase	// Sets AutoForeground off
-	{
-public:
-	CMcConnection(CTMultiCon *aTest);
-	void ConstructL();
-	};
-
-class CMcWindowGroupAf : public CTWindowGroup
-	{
-public:
-	CMcWindowGroupAf(CTClient *aClient);
-	void KeyL(const TKeyEvent &aKey, const TTime &aTime);
-	};
-
-class CMcConnectionAf : public CMcConnectionBase	// Sets AutoForeground on
-	{
-public:
-	CMcConnectionAf(CTMultiCon *aTest);
-	void ConstructL();
-	void KeyL(const TKeyEvent &aKey);
-	};
-
-class CMcConnectionDef : public CMcConnectionBase	// Leaves AutoForeground as the default value
-	{
-public:
-	CMcConnectionDef(CTMultiCon *aTest);
-	void ConstructL();
-	};
-
-class CMcWindowBase : public CTWin
-	{
-public:
-	CMcWindowBase(CTMultiCon *aTest);
-	void SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
-	virtual void Draw()=0;
-	virtual void PointerL(const TPointerEvent &pointer,const TTime &)=0;
-protected:
-	CTMultiCon *iTest;
-	TRgb iBack;
-	};
-
-class CMcWindow : public CMcWindowBase
-	{
-public:
-	CMcWindow(CTMultiCon *aTest);
-	virtual void Draw();
-	virtual void PointerL(const TPointerEvent &pointer,const TTime &);
-	};
-
-class CMcWindowAf : public CMcWindowBase
-	{
-public:
-	CMcWindowAf(CTMultiCon *aTest);
-	virtual void Draw();
-	virtual void PointerL(const TPointerEvent &pointer,const TTime &);
-	void ConstructL();
-	};
-
-class CMcWindowDef : public CMcWindowBase
-	{
-public:
-	CMcWindowDef(CTMultiCon *aTest);
-	virtual void Draw();
-	virtual void PointerL(const TPointerEvent &pointer,const TTime &);
-	};
-
-class CTMultiCon : public CTWsGraphicsBase
-	{
-public:
-	enum {KTimeOutAfter=10000000};	//10secs
-public:
-	CTMultiCon(CTestStep* aStep);
-	~CTMultiCon();
-	void ConstructL();
-	void EndAutoForegroundTest();
-	TInt SubState() const;
-	void IncSubState();
-	static TInt TimeOut(TAny* aTest);
-	void TimeOut();
-	inline TInt ScreenNumber() const {return(iTest->ScreenNumber());}
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	void SendEvents();
-private:
-	CTimeOut* iTimeOut;
-	TInt iTimeOutCount;
-	CMcConnectionAf *iConn1;
-	CMcConnection *iConn2;
-	CMcConnectionDef *iConn3;
-	TSize iScreenSize;
-	//TInt iState;
-	TInt iSubState;
-	};
-
-class CTMultiConStep : public CTGraphicsStep
-	{
-public:
-	CTMultiConStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTMultiConStep,"TMultiCon");
-
-
-#endif
--- a/windowing/windowserver/tauto/TMemLeakMode.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Enable Wserv memory leak checks
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TMemLeakMode.h"
-#include <w32debug.h>
-
-//
-//
-CTMemLeakCheckEnable::CTMemLeakCheckEnable(CTestStep* aStep) : CTWsGraphicsBase(aStep)
-	{
-	INFO_PRINTF1(_L("Enabling memory leak checks"));
-	}
-
-void CTMemLeakCheckEnable::ConstructL()
-	{
-	iIsWsTestMode = !iTest->IsFullRomL();
-	if (iIsWsTestMode)
-		{
-		TheClient->iWs.DebugInfo(EWsDebugSetCheckHeapOnDisconnectMode,EWsCheckHeapOnDisconnectModeAlways);
-		}
-	}
-
-void CTMemLeakCheckEnable::RunTestCaseL(TInt )
-	{
-	if (!iIsWsTestMode)
-		{
-#if defined(__WINS__)
-		WARN_PRINTF1(_L("Test skipped as TechView appears to be running\n"));
-#else
-		INFO_PRINTF1(_L("Test skipped as TechView appears to be running\n"));
-#endif
-		}
-	TestComplete();
-	}
-	
-__WS_CONSTRUCT_STEP__(MemLeakCheckEnable)
-
-//
-//
-
-CTMemLeakCheckOneShot::CTMemLeakCheckOneShot(CTestStep* aStep) : CTWsGraphicsBase(aStep)
-	{
-	INFO_PRINTF1(_L("Triggering one shot memory leak check"));
-	}
-
-void CTMemLeakCheckOneShot::ConstructL()
-	{
-	iIsWsTestMode = !iTest->IsFullRomL();
-	if (iIsWsTestMode)
-		{
-		TheClient->iWs.DebugInfo(EWsDebugSetCheckHeapOnDisconnectMode,EWsCheckHeapOnDisconnectModeOnce);
-		}
-	}
-
-void CTMemLeakCheckOneShot::RunTestCaseL(TInt )
-	{
-	if (!iIsWsTestMode)
-		{
-#if defined(__WINS__)
-		WARN_PRINTF1(_L("Test skipped as TechView appears to be running\n"));
-#else
-		INFO_PRINTF1(_L("Test skipped as TechView appears to be running\n"));
-#endif
-		}
-	TestComplete();
-	}
-
-__WS_CONSTRUCT_STEP__(MemLeakCheckOneShot)
--- a/windowing/windowserver/tauto/TMemLeakMode.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-// CTMemLeakCheckEnable
-
-class CTMemLeakCheckEnable : public CTWsGraphicsBase
-	{
-public:
-	CTMemLeakCheckEnable(CTestStep* aStep);
-	void ConstructL();
-protected:
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	TBool iIsWsTestMode;
-	};
-
-class CTMemLeakCheckEnableStep : public CTGraphicsStep
-	{
-public:
-	CTMemLeakCheckEnableStep();
-	TestState DoTestL();
-protected:	
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTMemLeakCheckEnableStep,"TMemLeakCheckEnable");
-
-// CTMemLeakCheckOneShot
-
-class CTMemLeakCheckOneShot : public CTWsGraphicsBase
-	{
-public:
-	CTMemLeakCheckOneShot(CTestStep* aStep);
-	void ConstructL();
-protected:
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	TBool iIsWsTestMode;
-	};
-
-class CTMemLeakCheckOneShotStep : public CTGraphicsStep
-	{
-public:
-	CTMemLeakCheckOneShotStep();
-	TestState DoTestL();
-protected:	
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTMemLeakCheckOneShotStep,"TMemLeakCheckOneShot");
--- a/windowing/windowserver/tauto/TMulTran.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1111 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test multiple level transparent window
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TMulTran.H"
-
-
-LOCAL_D TDisplayMode DisplayMode=EColor64K;
-LOCAL_D TSize WinSize;
-
-static const TRgb KRed=TRgb(255, 0, 0, 128);
-static const TRgb KGreen=TRgb(0, 255, 0, 128);
-static const TRgb KYellow=TRgb(255, 255, 0, 128);
-static const TRgb KBlue=TRgb(0, 0, 255, 128);
-static const TRgb KCyan=TRgb(0, 255, 255, 128);
-
-/*CTransWindow*/
-
-CTransWindow* CTransWindow::NewL(RPointerArray<CTransWindow>& aWindows,TRgb aColor,TRect aPos)
-	{
-	CTransWindow* self=NewL(TheClient->iGroup,aColor,aPos,&DisplayMode);
-	aWindows.Insert(self,0);
-	return self;
-	}
-
-CTransWindow* CTransWindow::NewL(CTWinBase* aParent,TRgb aColor,TRect aPos, TDisplayMode* aDisplayMode)
-	{
-	CTransWindow* self=new(ELeave) CTransWindow(aColor);
-	CleanupStack::PushL(self);
-	self->SetUpL(aPos.iTl,aPos.Size(),aParent,*TheClient->iGc,aDisplayMode);
-	User::LeaveIfError(self->iError);
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-//the following function doesn't activate a window
-CTransWindow* CTransWindow::NewL(CTWinBase* aParent,TRgb aColor,TDisplayMode* aDisplayMode)
-	{
-	CTransWindow* self=new(ELeave) CTransWindow(aColor);
-	CleanupStack::PushL(self);
-	self->ConstructL(*aParent);
-	if (aDisplayMode)
-		{
-		self->BaseWin()->SetRequiredDisplayMode(*aDisplayMode);
-		}
-	User::LeaveIfError((self->iError) && (self->iError != KErrNotSupported));
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-void CTransWindow::InitWin()
-	{
-	AdjustShadow(-1);
-	iShadowHight=0;
-	iWin.SetShadowDisabled(ETrue);
-	iShadowing=EFalse;
-	iError = iWin.SetTransparencyAlphaChannel();
-	iWin.SetBackgroundColor(iCol);
-	iDrawOpaque=EFalse;
-	}
-
-void CTransWindow::ToggleVisibility()
-	{
-	iVisible=!iVisible;
-	SetVisible(iVisible);
-	}
-
-void CTransWindow::SetOrdinal(RPointerArray<CTransWindow>& aWindows,TInt aOldPos,TInt aNewPos)
-	{
-	CTransWindow* win=aWindows[aOldPos];
-	aWindows.Remove(aOldPos);
-	aWindows.Insert(win,aNewPos);
-	win->iWin.SetOrdinalPosition(aNewPos);
-	}
-
-void CTransWindow::SetShadowDisabled(TBool aState)
-	{
-	iWin.SetShadowDisabled(aState);
-	iShadowing=!aState;
-	}
-
-void CTransWindow::AdjustShadow(TInt aAdjust)
-	{
-	CBlankWindow::AdjustShadow(aAdjust);
-	iShadowHight+=aAdjust;
-	}
-
-TPoint CTransWindow::Position() const
-	{
-	return CBlankWindow::Position()+iPosOffset;
-	}
-
-void CTransWindow::Draw()
-	{
-	//don't call CBlankWindow::Draw() since the background is already drawn
-
-	if(iDrawOpaque)
-		{
-		iGc->SetPenStyle(CGraphicsContext::ESolidPen);
-		iGc->SetPenSize(TSize(4,4));
-		iGc->SetBrushStyle(CGraphicsContext::ENullBrush);
-		iGc->SetPenColor(~iCol);
-		iGc->SetOpaque(ETrue);
-		iGc->DrawLine(TPoint(0,0),TPoint(1000,1000));
-		iGc->SetOpaque(EFalse);
-		}
-	}
-
-/*CTMultipleTrans*/
-
-CTMultipleTrans::CTMultipleTrans(CTestStep* aStep) : CTWsGraphicsBase(aStep), iWindows(5), iShadows(EFalse)
-	{
-	}
-
-CTMultipleTrans::~CTMultipleTrans()
-	{
-	((CTMultipleTransStep*)iStep)->CloseTMSGraphicsStep();
-	delete iBackgroundWin;
-	delete iCheckWin;
-	delete iCheckBitmap;
-	iWindows.ResetAndDestroy();
-	iBlankWin.Close();
-	}
-
-void CTMultipleTrans::ConstructL()
-	{
-	if(TransparencySupportedL() == KErrNotSupported)
-		return;
-	iMajorTest=0;
-	const TSize scrSize(TheClient->iScreen->SizeInPixels());
-	WinSize.SetSize(scrSize.iWidth/2,scrSize.iHeight);
-	iBackgroundWin=new(ELeave) CTBlankWindow();
-	iBackgroundWin->SetUpL(TPoint(),WinSize,TheClient->iGroup,*TheClient->iGc);
-	TheClient->WaitForRedrawsToFinish();
-	CTBackedUpWin* checkWin=new(ELeave) CTBackedUpWin(DisplayMode);
-	checkWin->ConstructExtLD(*TheClient->iGroup,TPoint(WinSize.iWidth,0),WinSize);
-	iCheckWin=checkWin;
-	RBackedUpWindow& backWin=*iCheckWin->BackedUpWin();
-	backWin.SetShadowHeight(0);
-	iCheckWin->Activate();
-	backWin.MaintainBackup();
-	iCheckBitmap=CBitmap::NewL(backWin.BitmapHandle());
-	iCheckBitmap->Gc().SetPenStyle(CGraphicsContext::ENullPen);
-	iCheckBitmap->Gc().SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	RecreateWindowsL();
-	iBlankWin=RBlankWindow(TheClient->iWs);
-	User::LeaveIfError(iBlankWin.Construct(*TheClient->iGroup->WinTreeNode(),ENullWsHandle));
-	iBlankWinVis=EFalse;
-	iBlankWin.SetVisible(iBlankWinVis);
-	User::LeaveIfError(iBlankWin.SetRequiredDisplayMode(EColor256));
-	iBlankWinCol=TRgb(170,170,170);		//Grey
-	iBlankWin.SetColor(iBlankWinCol);
-	iBlankWin.SetOrdinalPosition(0,1);		//Set the priority to 1 so that the 4 main windows are the first 4 with priory 0
-	iBlankWin.Activate();
-	iOpacitySupported=EFalse;
-	}
-
-void CTMultipleTrans::ShadowRegion(TRegion& aRegion,TInt aWin)
-	{
-	TRect rect;
-	TInt height;
-	TInt window;
-	aRegion.Clear();
-	RRegion single;
-	RRegion noShadow1;
-	RRegion noShadow2;
-	RRegion temp;
-	RRegion temp2;
-	for (window=0;window<aWin;++window)
-		{
-		CTransWindow& win=*iWindows[window];
-		if (win.IsVisible())
-			{
-			rect.SetRect(win.Position(),win.Size());
-			height=win.ShadowHeight();
-			temp.Copy(single);
-			temp.ClipRect(rect);
-			noShadow1.Union(temp);
-			temp.Clear();
-			temp.AddRect(rect);
-			temp.SubRegion(noShadow1);
-			temp.SubRegion(noShadow2);
-			temp.SubRegion(aRegion,&temp2);
-			noShadow2.Union(temp2);
-			temp2.Clear();
-			single.Union(temp);
-			if (win.IsShadowing())
-				aRegion.AddRect(rect);
-			aRegion.Offset(2*height,2*height);
-			aRegion.Tidy();
-			noShadow1.Tidy();
-			noShadow2.Tidy();
-			single.Tidy();
-			}
-		}
-	if (window<iWindows.Count())
-		{
-		CTransWindow& win=*iWindows[window];
-		rect.SetRect(win.Position(),win.Size());
-		aRegion.ClipRect(rect);
-		}
-	aRegion.SubRegion(noShadow1);
-	aRegion.SubRegion(noShadow2);
-	aRegion.Tidy();
-	noShadow1.Close();
-	noShadow2.Close();
-	single.Close();
-	temp.Close();
-	temp2.Close();
-	}
-
-void CTMultipleTrans::CheckDisplay()
-	{
-	RRegion shadowRegion;
-	CFbsBitGc& gc=iCheckBitmap->Gc();
-	gc.SetBrushColor(KRgbWhite);
-	gc.DrawRect(TRect(WinSize));
-	TInt windows=iWindows.Count();
-	if (iShadows)
-		{
-		ShadowRegion(shadowRegion,windows);
-		gc.ShadowArea(&shadowRegion);
-		}
-	TInt window;
-	for (window=windows;window>0;)
-		{
-		CTransWindow& win=*iWindows[--window];
-		if (win.IsVisible())
-			{
-			gc.SetBrushColor(win.Color());
-			const TPoint& winTopLeft=win.Position();
-			gc.DrawRect(TRect(winTopLeft, win.Size()));
-
-			if(win.DrawOpaque())
-				{
-				gc.SetPenColor(~(win.Color()));
-				gc.SetPenSize(TSize(4,4));
-				gc.SetPenStyle(CGraphicsContext::ESolidPen);
-				gc.SetClippingRect(TRect(TPoint(winTopLeft.iX,winTopLeft.iY),TPoint(winTopLeft.iX + win.Size().iWidth, winTopLeft.iY + win.Size().iHeight)));
-				gc.DrawLine(TPoint(winTopLeft.iX,winTopLeft.iY),TPoint(winTopLeft.iX+1000, winTopLeft.iY+1000));
-				gc.SetPenStyle(CGraphicsContext::ENullPen);
-				gc.SetClippingRect(TRect(WinSize));
-				}
-			
-			if (iShadows)
-				{
-				ShadowRegion(shadowRegion,window);
-				gc.ShadowArea(&shadowRegion);
-				}
-			}
-		}
-	iCheckWin->BackedUpWin()->UpdateScreen();
-	TheClient->Flush();
-	if (windows>=4)
-		{
-		AdvancedCheckRect();
-		}
-	_LIT(KTest,"Multiple Transparent Test, SubTest %d, OpacityOn=%d");
-	TBuf<128> buf;
-	buf.Format(KTest,iTest->iState,iMajorTest);
-	CheckRect(iBackgroundWin,iCheckWin,TRect(WinSize),buf);
-	shadowRegion.Close();
-	}
-
-#define OFFSET 2
-void CTMultipleTrans::AdvancedCheckRect()
-	{
-	const TSize compareSize(5,5);
-	const TInt OFFSET2=OFFSET+compareSize.iWidth;
-	TPoint comparePos=iCheckWin->Position();
-	TPoint checkPos;
-	//Check Single Level for Top Left Win
-	checkPos=iTopLeft->Position()+TPoint(OFFSET,OFFSET);
-	CheckRect(checkPos,checkPos+comparePos,compareSize);
-	//Check Single Level for Top Right Win
-	checkPos=iTopRight->Position()+TPoint(iTopRight->Size().iWidth-OFFSET2,OFFSET);
-	CheckRect(checkPos,checkPos+comparePos,compareSize);
-	//Check Single Level for Bottom Left Win
-	checkPos=iBotLeft->Position()+TPoint(OFFSET,iBotLeft->Size().iHeight-OFFSET2);
-	CheckRect(checkPos,checkPos+comparePos,compareSize);
-	//Check Single Level for Bottom Right Win
-	checkPos=iBotRight->Position()+TPoint(iBotRight->Size().iWidth-OFFSET2,iBotRight->Size().iHeight-OFFSET2);
-	CheckRect(checkPos,checkPos+comparePos,compareSize);
-	//Double level top 2 windows
-	checkPos=iTopRight->Position()+TPoint(OFFSET,OFFSET);
-	CheckRect(checkPos,checkPos+comparePos,compareSize);
-	//Double level left 2 windows
-	checkPos=iBotLeft->Position()+TPoint(OFFSET,OFFSET);
-	CheckRect(checkPos,checkPos+comparePos,compareSize);
-	//Double level bot 2 windows
-	checkPos=iBotRight->Position()+TPoint(OFFSET,iBotRight->Size().iHeight-OFFSET2);
-	CheckRect(checkPos,checkPos+comparePos,compareSize);
-	//Double level right 2 windows
-	checkPos=iBotRight->Position()+TPoint(iBotRight->Size().iWidth-OFFSET2,OFFSET);
-	CheckRect(checkPos,checkPos+comparePos,compareSize);
-	//Triple level all but bot right
-	checkPos=iTopRight->Position()+TPoint(OFFSET,iTopRight->Size().iHeight-OFFSET2);
-	CheckRect(checkPos,checkPos+comparePos,compareSize);
-	//Triple level all but bot left
-	checkPos=iBotRight->Position()+TPoint(OFFSET,OFFSET);
-	CheckRect(checkPos,checkPos+comparePos,compareSize);
-	//Triple level all but top right
-	checkPos=iTopLeft->Position()+TPoint(iTopLeft->Size().iWidth-OFFSET2,iTopLeft->Size().iHeight-OFFSET2);
-	CheckRect(checkPos,checkPos+comparePos,compareSize);
-	//Triple level all but top left
-	checkPos=iBotLeft->Position()+TPoint(iBotLeft->Size().iWidth-OFFSET2,OFFSET);
-	CheckRect(checkPos,checkPos+comparePos,compareSize);
-	//Quad level
-	checkPos=TPoint(iBotRight->Position().iX,iBotLeft->Position().iY)+TPoint(OFFSET,OFFSET);
-	CheckRect(checkPos,checkPos+comparePos,compareSize);
-	}
-
-void CTMultipleTrans::SimpleTest()
-	{
-	CheckDisplay();
-	}
-
-void CTMultipleTrans::ChangeVisibility()
-	{
-	TUint toggle;
-	TUint toggle2;
-	TInt win;
-	TInt ii=0;
-	for (ii=2;ii>0;--ii)
-		{
-		for (toggle=1;toggle<16;++toggle)
-			{
-			win=0;
-			toggle2=toggle;
-			while ((toggle2&0x1)==0)
-				{
-				++win;
-				toggle2/=2;
-				}
-			iWindows[win]->ToggleVisibility();
-			CheckDisplay();
-			}
-		}
-	}
-
-void CTMultipleTrans::ChangeVisibility2()
-	{
-	iBlankWin.SetOrdinalPosition(0,0);
-	iBlankWin.SetVisible(ETrue);
-	iBlankWin.SetVisible(EFalse);
-	CheckDisplay();
-	const TInt xSteps=4;
-	const TInt ySteps=3;
-	iBlankWinSize.SetSize(WinSize.iWidth/xSteps,WinSize.iHeight/ySteps);
-	iBlankWin.SetSize(iBlankWinSize);
-	TInt ordPos,xx,yy;
-	for (ordPos=0;ordPos<=4;++ordPos)
-		{
-		iBlankWin.SetOrdinalPosition(ordPos);
-		for (xx=0;xx<xSteps;++xx)
-			{
-			TInt xPos=xx*WinSize.iWidth/xSteps;
-			for (yy=0;yy<ySteps;++yy)
-				{
-				iBlankWin.SetPosition(TPoint(xPos,yy*WinSize.iHeight/ySteps));
-				iBlankWin.SetVisible(ETrue);
-				iBlankWin.SetVisible(EFalse);
-				CheckDisplay();
-				}
-			}
-		}
-	iBlankWin.SetOrdinalPosition(0,1);
-	}
-
-void CTMultipleTrans::OrdinalPos()
-	{
-	TInt ii,jj,kk;
-	for (kk=2;kk>=0;--kk)
-		{
-		for (jj=3;jj>kk;--jj)
-			{
-			for (ii=jj;ii>=kk;--ii)
-				{
-				CTransWindow::SetOrdinal(iWindows,jj,kk);
-				CheckDisplay();
-				}
-			}
-		}
-	for (kk=2;kk>=0;--kk)
-		{
-		for (jj=3;jj>kk;--jj)
-			{
-			for (ii=jj;ii>=kk;--ii)
-				{
-				CTransWindow::SetOrdinal(iWindows,kk,jj);
-				CheckDisplay();
-				}
-			}
-		}
-	}
-
-TSize CTMultipleTrans::GetSize(TInt aPos)
-	{		//Comments show values for 640x240 screen
-	const TInt halfSize=40;
-	const TPoint topLeft=iTopLeft->Position();	//10,10
-	const TInt xLeft=WinSize.iWidth/2-topLeft.iX-halfSize;		//110
-	const TInt xRight=xLeft+2*halfSize;		//190
-	const TInt yTop=WinSize.iHeight/2-topLeft.iY-halfSize;		//70
-	const TInt yBot=yTop+2*halfSize;		//150
-	if (aPos<6)
-		return TSize(xLeft+16*aPos-8,yTop);		//1->118, 5->182
-	if (aPos<11)
-		return TSize(xRight,yTop+16*aPos-88);		//6->78, 10->142
-	if (aPos<16)
-		return TSize(xRight-16*aPos+168,yBot);		//11->182, 15->118
-	return TSize(xLeft,yBot-16*aPos+248);			//16->142, 20->78
-	}
-
-void CTMultipleTrans::SizeChange(TInt aJump)
-	{
-	TInt ii=aJump;
-	TSize size;
-	while (ii<20)
-		{
-		size=GetSize(ii);
-		iTopLeft->SetSize(size);
-		if(iTopLeft->DrawOpaque())
-			{
-			iTopLeft->CTWin::DrawNow();
-			TheClient->Flush();
-			}
-		CheckDisplay();
-		ii+=aJump;
-		if (ii>20)
-			ii-=20;	
-		}
-	}
-
-void CTMultipleTrans::SizeChange()
-	{
-	CTransWindow::SetOrdinal(iWindows,2,1);
-	TSize size=iBotLeft->Size();
-	TInt change;
-	for (change=70;change>=0;change-=14)
-		{
-		iBotLeft->SetSize(TSize(size.iWidth-change,size.iHeight));
-		if(iBotLeft->DrawOpaque())
-			{
-			iBotLeft->CTWin::DrawNow();
-			TheClient->Flush();
-			}
-		CheckDisplay();
-		}
-	size=iTopRight->Size();
-	for (change=25;change>-50;change-=14)
-		{
-		iTopRight->SetSize(TSize(size.iWidth,size.iHeight+change));
-		if(iTopRight->DrawOpaque())
-			{
-			iTopRight->CTWin::DrawNow();
-			TheClient->Flush();
-			}
-		CheckDisplay();
-		}
-	iTopRight->SetSize(size);
-	if(iTopRight->DrawOpaque())
-		{
-		iTopRight->CTWin::DrawNow();
-		TheClient->Flush();
-		}
-	CTransWindow::SetOrdinal(iWindows,1,0);
-	CheckDisplay();
-	size=iTopLeft->Size();
-	SizeChange(3);
-	iTopLeft->SetSize(size);
-	if(iTopLeft->DrawOpaque())
-		{
-		iTopLeft->CTWin::DrawNow();
-		TheClient->Flush();
-		}
-	CheckDisplay();
-	CTransWindow::SetOrdinal(iWindows,0,2);
-	CheckDisplay();
-	SizeChange(7);
-	iTopLeft->SetSize(size);
-	if(iTopLeft->DrawOpaque())
-		{
-		iTopLeft->CTWin::DrawNow();
-		TheClient->Flush();
-		}
-	CheckDisplay();
-	}
-
-void CTMultipleTrans::MoveWin()
-	{
-	const TPoint topLeftPos=iTopLeft->Position();
-	const TPoint topRightPos=iTopRight->Position();
-	const TPoint botLeftPos=iBotLeft->Position();
-	const TPoint botRightPos=iBotRight->Position();
-	const TInt maxMove=Min(topRightPos.iX,botRightPos.iY)-10;
-	TInt steps,move;
-	for (steps=2;steps>=0;--steps)
-		{
-		move=maxMove*(3-steps)/3;
-		iTopLeft->SetPos(TPoint(topLeftPos.iX+move,topLeftPos.iY+move));
-		CheckDisplay();
-		iTopRight->SetPos(TPoint(topRightPos.iX-move,topRightPos.iY+move));
-		CheckDisplay();
-		iBotRight->SetPos(TPoint(botRightPos.iX-move,botRightPos.iY-move));
-		CheckDisplay();
-		iBotLeft->SetPos(TPoint(botLeftPos.iX+move,botLeftPos.iY-move));
-		CheckDisplay();
-		}
-	for (steps=4;steps>=0;--steps)
-		{
-		move=maxMove*steps/5;
-		iBotLeft->SetPos(TPoint(botLeftPos.iX+move,botLeftPos.iY-move));
-		CheckDisplay();
-		iTopLeft->SetPos(TPoint(topLeftPos.iX+move,topLeftPos.iY+move));
-		CheckDisplay();
-		iBotRight->SetPos(TPoint(botRightPos.iX-move,botRightPos.iY-move));
-		CheckDisplay();
-		iTopRight->SetPos(TPoint(topRightPos.iX-move,topRightPos.iY+move));
-		CheckDisplay();
-		}
-	}
-
-void CTMultipleTrans::GroupWinL()
-	{
-	CTWindowGroup* group=new(ELeave) CTWindowGroup(TheClient);
-	CleanupStack::PushL(group);
-	group->ConstructL();
-	CTransWindow* win=CTransWindow::NewL(group,KCyan,TRect(40,40,WinSize.iWidth-40,WinSize.iHeight-40),&DisplayMode);
-	win->CTWin::DrawNow();
-	if(iMajorTest==1)
-		{
-		win->SetDrawOpaque(ETrue);
-		win->Invalidate();
-		TheClient->WaitForRedrawsToFinish();
-		}
-	iWindows.Insert(win,0);
-	CheckDisplay();
-	group->GroupWin()->SetOrdinalPosition(1);
-	iWindows.Remove(0);
-	CheckDisplay();
-	group->GroupWin()->SetOrdinalPosition(0);
-	iWindows.Insert(win,0);
-	CheckDisplay();
-	iWindows.Remove(0);
-	delete win;		//Would be better to delete this after the group window but the test window don't support this behaviour currently.
-	CleanupStack::PopAndDestroy(group);
-	CheckDisplay();
-	}
-
-void CTMultipleTrans::FadeTranWin()
-	{
-	// system fade on
-	TheClient->iWs.SetSystemFaded(ETrue);
-	// system fade off
-	TheClient->iWs.SetSystemFaded(EFalse);
-	CheckDisplay();
-	}
-
-void CTMultipleTrans::StartShadows()
-	{
-	iShadows=ETrue;
-	iTopLeft->SetShadowDisabled(EFalse);
-	iTopLeft->AdjustShadow(1);
-	iTopRight->SetShadowDisabled(EFalse);
-	iTopRight->AdjustShadow(1);
-	iBotLeft->SetShadowDisabled(EFalse);
-	iBotLeft->AdjustShadow(1);
-	iBotRight->SetShadowDisabled(EFalse);
-	iBotRight->AdjustShadow(1);
-	if(!iOpacitySupported)
-		{
-		iTopRight->ToggleVisibility();		// In 8.1 this isn't needed.
-		iTopRight->ToggleVisibility();
-		}
-	CheckDisplay();
-	}
-
-void CTMultipleTrans::ShadowsOnOff()
-	{
-	if(!iOpacitySupported)
-		return;								// In 8.1 this isn't needed.
-	iBotRight->SetShadowDisabled(EFalse);
-	iBotRight->AdjustShadow(1);
-	CheckDisplay();
-	iBotRight->SetShadowDisabled(ETrue);
-	CheckDisplay();
-	iTopLeft->SetShadowDisabled(EFalse);
-	iTopLeft->AdjustShadow(1);
-	CheckDisplay();
-	iTopLeft->SetShadowDisabled(ETrue);
-	CheckDisplay();
-	iTopRight->SetShadowDisabled(ETrue);
-	CheckDisplay();
-	iBotLeft->SetShadowDisabled(EFalse);
-	iBotLeft->AdjustShadow(1);
-	CheckDisplay();
-	iBotLeft->SetShadowDisabled(ETrue);
-	CheckDisplay();
-	iTopLeft->SetShadowDisabled(EFalse);
-	iTopRight->SetShadowDisabled(EFalse);
-	iBotLeft->SetShadowDisabled(EFalse);
-	iBotRight->SetShadowDisabled(EFalse);
-	iTopLeft->ToggleVisibility();
-	CheckDisplay();
-	iTopLeft->ToggleVisibility();
-	CheckDisplay();
-	iTopRight->ToggleVisibility();
-	CheckDisplay();
-	iTopRight->ToggleVisibility();
-	CheckDisplay();
-	iBotLeft->ToggleVisibility();
-	CheckDisplay();
-	iBotLeft->ToggleVisibility();
-	CheckDisplay();
-	iBotRight->ToggleVisibility();
-	CheckDisplay();
-	iBotRight->ToggleVisibility();
-	CheckDisplay();
-	}
-
-void CTMultipleTrans::StartChildL()
-	{
-	CTransWindow* win;
-	TInt windows=iWindows.Count();
-	TInt window;
-	//Delete the first 4 windows from the array, could use ResetAndDestroy but would be broken by other uses of the array
-	for (window=windows;window>0;--window)
-		{
-		win=iWindows[0];
-		iWindows.Remove(0);
-		delete win;
-		}
-	RecreateWindowsL(iBackgroundWin);
-	CheckDisplay();	
-	}
-
-void CTMultipleTrans::StartChild2L()
-	{
-	CTransWindow* win;
-	TInt windows=iWindows.Count();
-	TInt window;
-	//Delete the first 4 windows from the array, could use ResetAndDestroy but would be broken by other uses of the array
-	for (window=windows;window>0;--window)
-		{
-		win=iWindows[0];
-		iWindows.Remove(0);
-		delete win;
-		}
-	iShadows=EFalse;
-	TRect rect=WinSize;
-	rect.Shrink(10,10);
-	iBotRight=CTransWindow::NewL(iBackgroundWin,KBlue,rect,&DisplayMode);
-	iBotRight->CTWin::DrawNow();
-	iWindows.Insert(iBotRight,0);
-	CheckDisplay();	
-	rect.Resize(-20,-20);
-	iTopLeft=CTransWindow::NewL(iBotRight,KRed,rect,&DisplayMode);
-	iTopLeft->CTWin::DrawNow();
-	iTopLeft->SetPosOffset(TPoint(10,10));
-	iWindows.Insert(iTopLeft,0);
-	CheckDisplay();	
-	rect.Resize(-20,-20);
-	iTopRight=CTransWindow::NewL(iTopLeft,KGreen,rect,&DisplayMode);
-	iTopRight->CTWin::DrawNow();
-	iTopRight->SetPosOffset(TPoint(20,20));
-	iWindows.Insert(iTopRight,0);
-	CheckDisplay();	
-	rect.Resize(-20,-20);
-	iBotLeft=CTransWindow::NewL(iTopRight,KYellow,rect,&DisplayMode);
-	iBotLeft->CTWin::DrawNow();
-	iBotLeft->SetPosOffset(TPoint(30,30));
-	iWindows.Insert(iBotLeft,0);
-	if(iMajorTest==1)
-		{
-		for (TInt window = 0; window < iWindows.Count(); ++window)
-			{
-			iWindows[window]->SetDrawOpaque(ETrue);
-			iWindows[window]->Invalidate();
-			}
-		TheClient->WaitForRedrawsToFinish();
-		}
-	CheckDisplay();	
-	}
-	
-void CTMultipleTrans::RecreateWindowsL(CTWinBase *aParent)
-	{
-	CTransWindow* win;
-	TInt windows=iWindows.Count();
-	TInt window;
-	//Delete existing windows:
-	for (window=windows;window>0;--window)
-		{
-		win=iWindows[0];
-		iWindows.Remove(0);
-		delete win;
-		}
-
-	if(!aParent)
-		aParent = TheClient->iGroup;
-		
-	iBotRight=CTransWindow::NewL(aParent,KBlue,TRect(WinSize.iWidth/2-10,WinSize.iHeight/2-30,WinSize.iWidth-20,WinSize.iHeight-20),&DisplayMode);
-	iBotRight->CTWin::DrawNow();
-	iWindows.Insert(iBotRight,0);
-	iTopLeft=CTransWindow::NewL(aParent,KRed,TRect(10,10,WinSize.iWidth/2+10,WinSize.iHeight/2+30),&DisplayMode);
-	iTopLeft->CTWin::DrawNow();
-	iWindows.Insert(iTopLeft,0);
-	iTopRight=CTransWindow::NewL(aParent,KGreen,TRect(WinSize.iWidth/2-30,20,WinSize.iWidth-10,WinSize.iHeight/2+10),&DisplayMode);
-	iTopRight->CTWin::DrawNow();
-	iWindows.Insert(iTopRight,0);
-	iBotLeft=CTransWindow::NewL(aParent,KYellow,TRect(20,WinSize.iHeight/2-10,WinSize.iWidth/2+30,WinSize.iHeight-10),&DisplayMode);
-	iBotLeft->CTWin::DrawNow();
-	iWindows.Insert(iBotLeft,0);
-	iShadows=EFalse;
-
-	if(iMajorTest==1)
-		{
-		for (TInt window=0;window<iWindows.Count();++window)
-			{
-			iWindows[window]->SetDrawOpaque(ETrue);
-			iWindows[window]->Invalidate();
-			}
-		TheClient->WaitForRedrawsToFinish();
-		}
-	}
-
-void CTMultipleTrans::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(KCheck,"Check");
-	_LIT(KSimple,"Simple Test");
-	_LIT(KVisibility,"Change Visibility");
-	_LIT(KVisibility2,"Change Visibility 2");
-	_LIT(KOrdinal,"Ordinal Position");
-	_LIT(KSizeChange,"Size Change");
-	_LIT(KMoveWin,"Move Window");
-	_LIT(KGroupWin,"Group Window Ordinal");
-	_LIT(KBackground,"Background Color Changes");
-	_LIT(KShadowsOnOff,"Shadows On Off");
-	_LIT(KChild1,"Child 1");
-	_LIT(KChild2,"Child 2");
-	_LIT(KOpacity,"Opaque Drawing");
-	_LIT(KTranWinFade,"Fading Transparent Windows");
-	((CTMultipleTransStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-
-	switch(iTest->iState)
-		{
-		case 0:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0500
-*/
-			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0500"));
-			// Check to see if Transparency is enabled before running tests
-			iTest->LogSubTest(KCheck);
-			if (TransparencySupportedL()==KErrNotSupported)
-				{
-				LOG_MESSAGE(_L("Transparency is not supported\n"));
-				TestComplete();
-				return;
-				}
-			++iTest->iState;		//Fall Through
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0111
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Simple transparent windows test.
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Four overlapping transparent windows (RWindow) are created before the test on the screen's left side.
-					The test draws the windows on the screen's right side using FBS bitmaps direcly.
-					The test does nothing if transparency is not enabled on the screen.
-
-@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
-*/		
-		case 1:
-			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0111"));
-			iTest->LogSubTest(KSimple);
-			SimpleTest();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0112
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    On/off switching of visibility of transparent windows
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Four overlapping transparent windows (RWindow) are created before the test on the screen's left side.
-					The test toggles visibility of those four windows going through all
-					combinations. For each combination it draws visible windows on the screen's right side using FBS bitmaps direcly.
-					The test does nothing if transparency is not enabled on the screen.
-
-@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
-*/		
-		case 2:
-		case 23:
-		case 42:
-			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0112"));
-			iTest->LogSubTest(KVisibility);
-			ChangeVisibility();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0113
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    On/off switching of visibility of a small transparent window on top of existing transparent windows
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Four overlapping transparent windows (RWindow) are created before the test on the screen's left side.
-					Toggles visibility of 5th blank little window making this appear in different places 
-					with different ordinal position. Draws visible windows on the screen's right side using FBS bitmaps direcly
-					each time when the 5th window becomes invisible.
-					The test does nothing if transparency is not enabled on the screen.
-
-@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
-*/		
-		case 3:
-			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0113"));
-			iTest->LogSubTest(KVisibility2);
-			ChangeVisibility2();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0114
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Ordinal positions' switches of intersecting transparent windows
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Four overlapping transparent windows (RWindow) are created before the test on the screen's left side.
-					Switches ordinal positions of the four windows trying all combinations. Draws visible windows on the screen's right side
-					using FBS bitmaps direcly each time when a new combination is applied.
-					The test does nothing if transparency is not enabled on the screen.
-
-
-@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
-*/		
-		case 4:
-		case 43:
-			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0114"));
-			iTest->LogSubTest(KOrdinal);
-			OrdinalPos();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0115
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Changing sizes of intersecting transparent windows
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Four overlapping transparent windows (RWindow) are created before the test on the screen's left side.
-					Plays with sizes of each of the four windows to affect overlapping. 
-					Draws visible windows on the screen's right side using FBS bitmaps direcly
-					each time when a new size for a particular window is applied.
-					The test does nothing if transparency is not enabled on the screen.
-
-
-@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
-*/		
-		case 5:
-		case 24:
-			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0115"));
-			iTest->LogSubTest(KSizeChange);
-			SizeChange();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0116
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Moving intersecting transparent windows
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Four overlapping transparent windows (RWindow) are created before the test on the screen's left side.
-					Performs moves of those windows one by one making little steps in direction of the center of intersection and backwards.
-					Draws visible windows on the screen's right side using FBS bitmaps direcly
-					each time when a position of a particular window changes.
-					The test does nothing if transparency is not enabled on the screen.
-
-@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
-*/		
-		case 6:
-			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0116"));
-			iTest->LogSubTest(KMoveWin);
-			MoveWin();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0117
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test with a second window group
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Four overlapping transparent windows (RWindow, within the same group) are created before the test on the screen's left side.
-					Creates a 5th transparent window in a separate window group
-					on top of existing windows which covers the intersection area of initial 4 windows. 
-					Changes the ordinal position of the group to 1, changes ordinal position 
-					back to 0, removes the new group.
-					Redraws visible windows on the screen's right side using FBS bitmaps direcly
-					each time when any change on the screen's left side is performed.
-					The test does nothing if transparency is not enabled on the screen.
-
-@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
-*/		
-		case 7:
-			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0117"));
-			iTest->LogSubTest(KGroupWin);
-			GroupWinL();
-			break;
-		case 8:
-			((CTMultipleTransStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			iTest->LogSubTest(KBackground);
-			//Change the background color of the 4 test windows and the window behind them
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0118
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    On/off switching of fading
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Four overlapping transparent windows (RWindow) are created before the test on the screen's left side.
-					Switches system fading on and right after that back to off.
-					Draws visible windows on the screen's right side using FBS bitmaps direcly
-					after that.
-					The test does nothing if transparency is not enabled on the screen.
-
-@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
-*/		
-		case 9:
-			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0118"));
-			iTest->LogSubTest(KTranWinFade);
-			FadeTranWin();
-			break;
-		case 10:
-			((CTMultipleTransStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			iTest->iState=21-1;
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0120
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Shadows' on/off test.
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Four overlapping transparent windows (RWindow) with shadowing enabled are created before the test on the screen's left side.
-					The test plays with on/off-switching of shadowing and visibility for the windows.
-					The test redraws visible windows on the screen's right side using FBS bitmaps direcly
-					each time when state of ony window changes.
-					The test does nothing if transparency is not enabled on the screen.
-					The test also repeats GRAPHICS-WSERV-0111 - GRAPHICS-WSERV-015 foor the shadowed windows.
-
-@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
-*/		
-		case 22:
-			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0120"));
-			iTest->LogSubTest(KShadowsOnOff);
-			ShadowsOnOff();
-			break;
-		case 25:
-			((CTMultipleTransStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			iTest->iState=41-1;
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0121
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Transparent child-windows of a bacground window 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Four overlapping transparent windows (RWindow) with shadowing enabled are created before the test on the screen's left side.
-					The test removes those windows and creates new four overlapping transparent windows 
-					but as children of existing background window. After that the test redraws visible windows on the screen's right side using FBS bitmaps direcly.
-					The test does nothing if transparency is not enabled on the screen.
-					The test also repeats GRAPHICS-WSERV-0111 - GRAPHICS-WSERV-014 foor the shadowed windows.
-
-@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
-*/		
-		case 41:
-			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0121"));
-			iTest->LogSubTest(KChild1);
-			StartChildL();
-			break;
-		case 44:
-			((CTMultipleTransStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			iTest->iState=61-1;
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0122
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Four overlapping transparent windows (RWindow) with shadowing enabled are created before the test on the screen's left side.
-					The test removes those windows and creates new four transparent windows 
-					so that each one (except first) is a child of prevoiusly created window. 
-					The test redraws visible windows on the screen's right side using FBS bitmaps direcly
-					after each window's creation.
-					The test does nothing if transparency is not enabled on the screen.
-
-@SYMTestExpectedResults Expects that left and rightside bitmaps are identical
-*/		
-		case 61:
-			((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0122"));
-			iTest->LogSubTest(KChild2);
-			StartChild2L();
-			break;
-		default:
-				((CTMultipleTransStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0123"));
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0123
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     The test draws four overlapping transparent windows (RWindow) on the screen's left side.
-					Each window has an opaque diagonal line (\) which goes from the top-left corner of each window.
-					The test repeats all tests from GRAPHICS-WSERV-0111 to GRAPHICS-WSERV-0122 
-					with those four windows and diagonaly lines on them.
-
-@SYMTestExpectedResults Expects that all tests will obtain results they expected. 
-*/		
-			if (iMajorTest==1 || !iOpacitySupported)
-				{
-				if (!iOpacitySupported)
-					{
-					_LIT(KNoOpacity,"Opacity is not supported");
-					LOG_MESSAGE(KNoOpacity);
-					}
-                		((CTMultipleTransStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-				TestComplete();
-				return;
-				}
-			LOG_MESSAGE(KOpacity);
-			iTest->iState=0;
-			iMajorTest=1;
-			RecreateWindowsL();
-			break;
-		}
-	((CTMultipleTransStep*)iStep)->RecordTestResultL();
-	++iTest->iState;
-	}
-
-
-__WS_CONSTRUCT_STEP__(MultipleTrans)
--- a/windowing/windowserver/tauto/TMulTran.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TMULTRAN_H__
-#define __TMULTRAN_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-
-class CTMultipleTrans : public CTWsGraphicsBase
-	{
-public:
-	CTMultipleTrans(CTestStep* aStep);
-	~CTMultipleTrans();
-	void ConstructL();
-	void CheckDisplay();
-	void SimpleTest();
-	void ChangeVisibility();
-	void ChangeVisibility2();
-	void OrdinalPos();
-	void SizeChange();
-	void MoveWin();
-	void GroupWinL();
-	void StartShadows();
-	void ShadowsOnOff();
-	void StartChildL();
-	void StartChild2L();
-	void FadeTranWin();
-protected:	//Pure virtual function from MTestCase
-	void RunTestCaseL(TInt aCurTestCase);
-private:
-	void RecreateWindowsL(CTWinBase *aParent=0);
-	void ShadowRegion(TRegion& aRegion,TInt aWin);
-	void AdvancedCheckRect();
-	void SizeChange(TInt aJump);
-	TSize GetSize(TInt aPos);
-
-
-private:
-	CTBlankWindow* iBackgroundWin;
-	CTBackedUpWin* iCheckWin;
-	CBitmap* iCheckBitmap;
-	RPointerArray<CTransWindow> iWindows;
-	CTransWindow* iTopLeft;
-	CTransWindow* iTopRight;
-	CTransWindow* iBotLeft;
-	CTransWindow* iBotRight;
-	RBlankWindow iBlankWin;
-	TRgb iBlankWinCol;
-	TPoint iBlankWinPos;
-	TSize iBlankWinSize;
-	TBool iBlankWinVis;
-	TBool iShadows;
-	TInt iMajorTest;
-	TBool iOpacitySupported;
-	};
-
-class CTMultipleTransStep : public CTGraphicsStep
-	{
-public:
-	CTMultipleTransStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTMultipleTransStep,"TMultipleTrans");
-
-#endif
--- a/windowing/windowserver/tauto/TOOM.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1583 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Out of memory tests
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-
-#include "TOOM.H"
-
- 
-typedef COomFailBase *(*COmmCreate)(CTOom *aTest);
-
-COomFailBase *CreateOomConnect(CTOom *aTest)
-	{return(new(ELeave) COomConnect(aTest));}
-
-COomFailBase *CreateOomWindow(CTOom *aTest)
-	{return(new(ELeave) COomWindow(aTest));}
-
-COomFailBase *CreateOomWindowGroup(CTOom *aTest)
-	{return(new(ELeave) COomWindowGroup(aTest));}
-
-COomFailBase *CreateOomBackedUpWindow(CTOom *aTest)
-	{return(new(ELeave) COomBackedUpWindow(aTest));}
-
-COomFailBase *CreateOomBackupResize(CTOom *aTest)
-	{return(new(ELeave) COomBackupResize(aTest));}
-
-COomFailBase *CreateOomBlankWindow(CTOom *aTest)
-	{return(new(ELeave) COomBlankWindow(aTest));}
-
-COomFailBase *CreateOomGc(CTOom *aTest)
-	{return(new(ELeave) COomGc(aTest));}
-
-COomFailBase *CreateOomScreenDevice(CTOom *aTest)
-	{return(new(ELeave) COomScreenDevice(aTest));}
-
-COomFailBase *CreateOomPointerBuffer(CTOom *aTest)
-	{return(new(ELeave) COomPointerBuffer(aTest));}
-
-COomFailBase *CreateOomPolygon(CTOom *aTest)
-	{return(new(ELeave) COomPolygon(aTest));}
-
-COomFailBase *CreateOomPriorityKey(CTOom *aTest)
-	{return(new(ELeave) COomPriorityKey(aTest));}
-
-COomFailBase *CreateOomCaptureKey(CTOom *aTest)
-	{return(new(ELeave) COomCaptureKey(aTest));}
-
-COomFailBase *CreateOomCaptureKeyUpDown(CTOom *aTest)
-	{return(new(ELeave) COomCaptureKeyUpDown(aTest));}
-
-COomFailBase *CreateOomHotKey(CTOom *aTest)
-	{return(new(ELeave) COomHotKey(aTest));}
-
-COomFailBase *CreateOomGroupName(CTOom *aTest)
-	{return(new(ELeave) COomGroupName(aTest));}
-
-COomFailBase *CreateOomMessageSend(CTOom *aTest)
-	{return(new(ELeave) COomMessageSend(aTest));}
-
-COomFailBase *CreateOomMessageFetch(CTOom *aTest)
-	{return(new(ELeave) COomMessageFetch(aTest));}
-
-COomFailBase *CreateOomSprite(CTOom *aTest)
-	{return(new(ELeave) COomSprite(aTest));}
-
-COomFailBase *CreateOomPointerCursor(CTOom *aTest)
-	{return(new(ELeave) COomPointerCursor(aTest));}
-
-COomFailBase *CreateOomCopyScreen(CTOom *aTest)
-	{return(new(ELeave) COomCopyScreen(aTest));}
-
-COomFailBase *CreateOomRequestEvents(CTOom *aTest)
-	{return(new(ELeave) COomRequestEvents(aTest));}
-
-COomFailBase *CreateOomCustomTextCursor(CTOom *aTest)
-	{return(new(ELeave) COomCustomTextCursor(aTest));}
-
-COomFailBase *CreateOomTranspWindow(CTOom *aTest)
-	{return(new(ELeave) COomTranspWindow(aTest));}
-
-COomFailBase *CreateOomObscuredWindow(CTOom *aTest)
-	{return(new(ELeave) COomObscuredWindow(aTest));}
-
-COmmCreate CreateOomFailTest[]={
-	CreateOomConnect,
-	CreateOomWindow,
-	CreateOomWindowGroup,
-	CreateOomBackedUpWindow,
-	CreateOomBackupResize,
-	CreateOomBlankWindow,
-	CreateOomGc,
-	CreateOomScreenDevice,
-	CreateOomPointerBuffer,
-	CreateOomPolygon,
-	CreateOomPriorityKey,
-	CreateOomCaptureKey,
-	CreateOomCaptureKeyUpDown,
-	CreateOomHotKey,
-	CreateOomGroupName,
-	CreateOomSprite,
-	CreateOomPointerCursor,
-	CreateOomCopyScreen,
-	CreateOomRequestEvents,
-	CreateOomMessageSend,
-	CreateOomMessageFetch,
-	CreateOomCustomTextCursor,
-	CreateOomTranspWindow,
-	CreateOomObscuredWindow,
-	};
-
-//
-// Individual out of memory test classes //
-//
-
-COomFailBase::COomFailBase(CTOom *aTest) : iTest(aTest)
-	{}
-
-void COomFailBase::ConstructL()
-	{
-	iTest->INFO_PRINTF1(TestName());
-	}
-
-void COomFailBase::PreFail()
-	{}
-
-void COomFailBase::ClearUpL()
-	{}
-
-void COomFailBase::Flush()
-	{
-	iWs.Flush();
-	}
-
-COomConnect::COomConnect(CTOom *aTest) : COomFailBase(aTest)
-	{}
-
-TOomTestName COomConnect::TestName()
-	{
-	return(_L("Connect"));
-	}
-
-/** Creates a wserv session, connects and creates CWsScreenDevice object
-*/
-TInt COomConnect::Fail()
-	{
-	TInt err = iWs.Connect();
-	if (err!=KErrNone)
-		return err;
-	
-	TRAP(err, iDummyScreen = new (ELeave) CWsScreenDevice(iWs));
-	if (err!=KErrNone)
-		{
-		iWs.Close();
-		return err;
-		}
-		
-	if ((err=iDummyScreen->Construct(iTest->ScreenNumber()))!=KErrNone)
-		{
-		delete iDummyScreen;
-		iDummyScreen = NULL;
-		iWs.Close();
-		return err;
-		}
-		
-	return err;
-	}
-
-void COomConnect::ClearUpL()
-	{
-	if (iDummyScreen)
-		{
-		delete iDummyScreen;
-		iDummyScreen = NULL;
-		}
-	iWs.Close();
-	}
-
-//
-
-COomSetup::COomSetup(CTOom *aTest) : COomFailBase(aTest)
-	{}
-
-void COomSetup::ConstructL()
-	{
-	COomFailBase::ConstructL();
-	User::LeaveIfError(iWs.Connect());
-	iDummyScreen = new (ELeave) CWsScreenDevice(iWs);
-	User::LeaveIfError(iDummyScreen->Construct(iTest->ScreenNumber()));
-	
-	iWinGroup=RWindowGroup(iWs);
-	iWinGroup.Construct(556);
-	iWinGroup.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
-	}
-
-COomSetup::~COomSetup()
-	{
-	iWinGroup.Close();
-	delete iDummyScreen;
-	iDummyScreen = NULL;
-	
-	iTest->TEST(iWs.ResourceCount()==0);
-	if (iWs.ResourceCount()!=0)
-		iTest->INFO_PRINTF3(_L("iWs.ResourceCount() return value - Expected: %d, Actual: %d"), 0, iWs.ResourceCount());			
-
-	iWs.Close();
-	}
-
-//
-
-COomWindowGroup::COomWindowGroup(CTOom *aTest) : COomSetup(aTest)
-	{}
-
-TOomTestName COomWindowGroup::TestName()
-	{
-	return(_L("Window Group"));
-	}
-
-/** Creates a RWindowGroup object
-*/
-TInt COomWindowGroup::Fail()
-	{
-	iFailWinGroup=RWindowGroup(iWs);
-	return(iFailWinGroup.Construct(987));
-	}
-
-void COomWindowGroup::ClearUpL()
-	{
-	iFailWinGroup.Close();
-	}
-
-//
-
-COomWindow::COomWindow(CTOom *aTest) : COomSetup(aTest)
-	{}
-
-TOomTestName COomWindow::TestName()
-	{
-	return(_L("Window"));
-	}
-
-/** Creates a RWindow object
-*/
-TInt COomWindow::Fail()
-	{
-	iFailWin=RWindow(iWs);
-	return(iFailWin.Construct(iWinGroup,11));
-	}
-
-void COomWindow::ClearUpL()
-	{
-	iFailWin.Close();
-	}
-
-//
-
-COomBackedUpWindow::COomBackedUpWindow(CTOom *aTest) : COomSetup(aTest)
-	{}
-
-TOomTestName COomBackedUpWindow::TestName()
-	{
-	return(_L("Backed up window"));
-	}
-
-/** Creates a RBackedUpWindow object
-*/
-TInt COomBackedUpWindow::Fail()
-	{
-	iFailWin=RBackedUpWindow(iWs);
-	return(iFailWin.Construct(iWinGroup,EGray16,22));
-	}
-
-void COomBackedUpWindow::ClearUpL()
-	{
-	iFailWin.Close();
-	}
-
-//
-
-COomBackupResize::COomBackupResize(CTOom *aTest) : COomSetup(aTest)
-	{}
-
-COomBackupResize::~COomBackupResize()
-	{
-	iFailWin.Close();
-	}
-
-TOomTestName COomBackupResize::TestName()
-	{
-	return(_L("Resize backed up window"));
-	}
-
-void COomBackupResize::ConstructL()
-	{
-	COomSetup::ConstructL();
-	iFailWin=RBackedUpWindow(iWs);
-	User::LeaveIfError(iFailWin.Construct(iWinGroup,EGray16,33));
-	User::LeaveIfError(iFailWin.SetSizeErr(TSize(10,10)));
-	iFailWin.Activate();
-	}
-	
-/** Sets the size of previously created backed-up window
-*/
-TInt COomBackupResize::Fail()
-	{
-	return(iFailWin.SetSizeErr(TSize(100,100)));
-	}
-
-void COomBackupResize::ClearUpL()
-//Virtual fn declared in CoomFailBase. This is the only one that can leave, I think, but one is enough
-	{
-	User::LeaveIfError(iFailWin.SetSizeErr(TSize(10,10)));
-	}
-
-//
-
-COomBlankWindow::COomBlankWindow(CTOom *aTest) : COomSetup(aTest)
-	{}
-
-TOomTestName COomBlankWindow::TestName()
-	{
-	return(_L("Blank window"));
-	}
-
-/** Creates a RBlankWindow object
-*/
-TInt COomBlankWindow::Fail()
-	{
-	iFailWin=RBlankWindow(iWs);
-	return(iFailWin.Construct(iWinGroup,44));
-	}
-
-void COomBlankWindow::ClearUpL()
-	{
-	iFailWin.Close();
-	}
-
-//
-
-COomPointerBuffer::COomPointerBuffer(CTOom *aTest) : COomSetup(aTest)
-	{}
-
-COomPointerBuffer::~COomPointerBuffer()
-	{
-	iFailWin.Close();
-	}
-
-TOomTestName COomPointerBuffer::TestName()
-	{
-	return(_L("Pointer buffer"));
-	}
-
-void COomPointerBuffer::ConstructL()
-	{
-	COomSetup::ConstructL();
-	iFailWin=RBackedUpWindow(iWs);
-	User::LeaveIfError(iFailWin.Construct(iWinGroup,EGray16,55));
-	User::LeaveIfError(iFailWin.SetSizeErr(TSize(10,10)));
-	iFailWin.Activate();
-	}
-
-/** Allocates a buffer for storing pointer movements for previously created backed-up window
-*/
-TInt COomPointerBuffer::Fail()
-	{
-	return(iFailWin.AllocPointerMoveBuffer(10,0));
-	}
-
-void COomPointerBuffer::ClearUpL()
-	{
-	iFailWin.FreePointerMoveBuffer();
-	}
-
-//
-
-COomPriorityKey::COomPriorityKey(CTOom *aTest) : COomSetup(aTest)
-	{}
-
-COomPriorityKey::~COomPriorityKey()
-	{
-	}
-
-TOomTestName COomPriorityKey::TestName()
-	{
-	return(_L("Priority key"));
-	}
-
-void COomPriorityKey::ConstructL()
-	{
-	COomSetup::ConstructL();
-	}
-
-/** Adds a priority key for a previously created window group
-*/
-TInt COomPriorityKey::Fail()
-	{
-	return(iWinGroup.AddPriorityKey(1,0,0));
-	}
-
-void COomPriorityKey::ClearUpL()
-	{
-	iWinGroup.RemovePriorityKey(1,0,0);
-	}
-
-//
-
-COomCaptureKey::COomCaptureKey(CTOom *aTest) : COomSetup(aTest)
-	{}
-
-COomCaptureKey::~COomCaptureKey()
-	{
-	}
-
-TOomTestName COomCaptureKey::TestName()
-	{
-	return(_L("Capture key"));
-	}
-
-void COomCaptureKey::ConstructL()
-	{
-	COomSetup::ConstructL();
-	}
-
-/** Requests a capture keys for a previously created window group
-*/
-TInt COomCaptureKey::Fail()
-	{
-	for (iIndex=0;iIndex<(TInt)(sizeof(iCapKey)/sizeof(iCapKey[0]));iIndex++)
-		{
-		TInt ret=iWinGroup.CaptureKey('a',0,0);
-		if (ret<0)
-			return(ret);
-		iCapKey[iIndex]=ret;
-		}
-	return(KErrNone);
-	}
-
-void COomCaptureKey::ClearUpL()
-	{
-	for (TInt index=0;index<iIndex;index++)
-		iWinGroup.CancelCaptureKey(iCapKey[index]);
-	}
-
-//
-
-COomCaptureKeyUpDown::COomCaptureKeyUpDown(CTOom *aTest) : COomSetup(aTest)
-	{}
-
-COomCaptureKeyUpDown::~COomCaptureKeyUpDown()
-	{
-	}
-
-TOomTestName COomCaptureKeyUpDown::TestName()
-	{
-	return(_L("Capture up/down keys"));
-	}
-
-void COomCaptureKeyUpDown::ConstructL()
-	{
-	COomSetup::ConstructL();
-	}
-
-/** Requests the capture of key-up and key-down events for a previously created window group
-*/
-TInt COomCaptureKeyUpDown::Fail()
-	{
-	for (iIndex=0;iIndex<(TInt)(sizeof(iCapKey)/sizeof(iCapKey[0]));iIndex++)
-		{
-		TInt ret=iWinGroup.CaptureKeyUpAndDowns('a',0,0);
-		if (ret<0)
-			return(ret);
-		iCapKey[iIndex]=ret;
-		}
-	return(KErrNone);
-	}
-
-void COomCaptureKeyUpDown::ClearUpL()
-	{
-	for (TInt index=0;index<iIndex;index++)
-		iWinGroup.CancelCaptureKeyUpAndDowns(iCapKey[index]);
-	}
-
-//
-
-COomHotKey::COomHotKey(CTOom *aTest) : COomSetup(aTest)
-	{}
-
-COomHotKey::~COomHotKey()
-	{
-	}
-
-TOomTestName COomHotKey::TestName()
-	{
-	return(_L("hot keys"));
-	}
-
-void COomHotKey::ConstructL()
-	{
-	COomSetup::ConstructL();
-	}
-
-/** Sets hot key for the session.
-*/
-TInt COomHotKey::Fail()
-	{
-	return(iWs.SetHotKey(EHotKeyEnableLogging,'a',0,0));
-	}
-
-void COomHotKey::ClearUpL()
-	{
-	iWs.RestoreDefaultHotKey(EHotKeyEnableLogging);
-	}
-
-//
-
-COomGroupName::COomGroupName(CTOom *aTest) : COomSetup(aTest)
-	{}
-
-COomGroupName::~COomGroupName()
-	{
-	}
-
-TOomTestName COomGroupName::TestName()
-	{
-	return(_L("Group name"));
-	}
-
-void COomGroupName::ConstructL()
-	{
-	COomSetup::ConstructL();
-	}
-
-/** Sets the window group's name.
-*/
-TInt COomGroupName::Fail()
-	{
-	return(iWinGroup.SetName(_L("A Name")));
-	}
-
-void COomGroupName::ClearUpL()
-	{
-	iWinGroup.SetName(_L(""));
-	}
-
-//
-
-COomMessageSend::COomMessageSend(CTOom *aTest) : COomSetup(aTest)
-	{}
-
-COomMessageSend::~COomMessageSend()
-	{
-	}
-
-TOomTestName COomMessageSend::TestName()
-	{
-	return(_L("MessageSend"));
-	}
-
-void COomMessageSend::ConstructL()
-	{
-	COomSetup::ConstructL();
-	}
-
-void COomMessageSend::PreFail()
-	{
-	iWinGroup2=RWindowGroup(iWs);
-	iWinGroup2.Construct(557);
-	iWinGroup2.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
-	}
-
-/** Sends a message to another window group
-*/
-TInt COomMessageSend::Fail()
-	{
-	TBuf8<0x20> params(_L8("SomeParams"));
-	return(iWs.SendMessageToWindowGroup(iWinGroup2.Identifier(),TUid::Uid(123),params));
-	}
-
-void COomMessageSend::ClearUpL()
-	{
-	iWinGroup2.Close();
-	}
-
-//
-
-COomMessageFetch::COomMessageFetch(CTOom *aTest) : COomSetup(aTest)
-	{}
-
-COomMessageFetch::~COomMessageFetch()
-	{
-	}
-
-TOomTestName COomMessageFetch::TestName()
-	{
-	return(_L("MessageFetch"));
-	}
-
-void COomMessageFetch::ConstructL()
-	{
-	COomSetup::ConstructL();
-	}
-
-#define CLIENT_HANDLE 555
-#define UID_VALUE 123
-#define MESSAGE_LEN 0x20
-void COomMessageFetch::PreFail()
-	{
-	iWinGroup2=RWindowGroup(iWs);
-	iWinGroup2.Construct(CLIENT_HANDLE);
-	iWinGroup2.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
-	TBuf8<MESSAGE_LEN> params(_L8("SomeParams"));
-	TBool retVal = iWs.SendMessageToWindowGroup(iWinGroup2.Identifier(),TUid::Uid(UID_VALUE),params);
-	iTest->TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		iTest->INFO_PRINTF3(_L("iWs.SendMessageToWindowGroup() return value - Expected: %d, Actual: %d"), KErrNone, retVal);			
-	}
-
-/** Fetches a message
-*/
-TInt COomMessageFetch::Fail()
-	{
-	TWsEvent event;
-	TPtr8 ptr(NULL,0);
-	TUid uid;
-	event.SetType(EEventMessageReady);
-	event.SetHandle(CLIENT_HANDLE);
-	event.SetTimeNow();
-	SEventMessageReady& eventMessageReady=*(SEventMessageReady*)event.EventData();
-	eventMessageReady.iWindowGroupIdentifier=iWinGroup2.Identifier();
-	eventMessageReady.iMessageUid=TUid::Uid(UID_VALUE);
-	eventMessageReady.iMessageParametersSize=MESSAGE_LEN;
-	TInt ret=TheClient->iWs.FetchMessage(uid,ptr,event);
-	if (ret==KErrNone)
-		User::Free((TAny *)ptr.Ptr());
-	return(ret);
-	}
-
-void COomMessageFetch::ClearUpL()
-	{
-	iWinGroup2.Close();
-	}
-
-//
-
-COomRequestEvents::COomRequestEvents(CTOom *aTest) : COomSetup(aTest)
-	{}
-
-COomRequestEvents::~COomRequestEvents()
-	{
-	}
-
-TOomTestName COomRequestEvents::TestName()
-	{
-	return(_L("Request events"));
-	}
-
-void COomRequestEvents::ConstructL()
-	{
-	COomSetup::ConstructL();
-	}
-
-/** Enables window group change events and modifier change events
-*/
-TInt COomRequestEvents::Fail()
-	{
-	TInt err;
-	if ((err=iWinGroup.EnableOnEvents())==KErrNone)
-		if ((err=iWinGroup.EnableGroupChangeEvents())==KErrNone)
-			err=iWinGroup.EnableModifierChangedEvents(EModifierCapsLock,EEventControlAlways);
-	return(err);
-	}
-
-void COomRequestEvents::ClearUpL()
-	{
-	iWinGroup.DisableOnEvents();
-	iWinGroup.DisableGroupChangeEvents();
-	iWinGroup.DisableModifierChangedEvents();
-	}
-
-//
-
-COomCopyScreen::COomCopyScreen(CTOom *aTest) : COomSetup(aTest)
-	{}
-
-TOomTestName COomCopyScreen::TestName()
-	{
-	return(_L("Copy screen"));
-	}
-
-COomCopyScreen::~COomCopyScreen()
-	{
-	delete iScrDev;
-	delete iBitmap;
-	}
-
-void COomCopyScreen::ConstructL()
-	{
-	COomSetup::ConstructL();
-	iScrDev=new(ELeave) CWsScreenDevice(iWs);
-	User::LeaveIfError(iScrDev->Construct(iTest->ScreenNumber()));
-	iBitmap=new(ELeave) CFbsBitmap();
-	User::LeaveIfError(iBitmap->Create(TSize(100,100),EGray4));
-	}
-
-/** Copies screen to bitmap
-*/
-TInt COomCopyScreen::Fail()
-	{
-	TInt ret=iScrDev->CopyScreenToBitmap(iBitmap);
-	if (ret==KErrNone)
-		ret=iScrDev->CopyScreenToBitmap(iBitmap,TRect(10,10,50,50));
-	return(ret);
-	}
-
-void COomCopyScreen::ClearUpL()
-	{
-	}
-
-//
-
-COomSpriteBase::COomSpriteBase(CTOom *aTest) : COomSetup(aTest)
-	{}
-
-COomSpriteBase::~COomSpriteBase()
-	{
-	iWin.Close();
-	delete iBitmap;
-	delete iMask;
-	delete iBitmap2;
-	delete iMask2;
-	}
-
-void COomSpriteBase::ConstructL()
-	{
-	COomSetup::ConstructL();
-	iWin=RWindow(iWs);
-	User::LeaveIfError(iWin.Construct(iWinGroup,33));
-	User::LeaveIfError(iWin.SetSizeErr(TSize(100,100)));
-	iWin.Activate();
-	iBitmap=new(ELeave) CFbsBitmap();
-	User::LeaveIfError(iBitmap->Create(TSize(10,10),EGray4));
-	iBitmap2=new(ELeave) CFbsBitmap();
-	User::LeaveIfError(iBitmap2->Create(TSize(40,40),EGray4));
-	iMask=new(ELeave) CFbsBitmap();
-	User::LeaveIfError(iMask->Create(TSize(10,10),EGray4));
-	iMask2=new(ELeave) CFbsBitmap();
-	User::LeaveIfError(iMask2->Create(TSize(40,40),EGray4));
-	}
-
-//
-
-COomSprite::COomSprite(CTOom *aTest) : COomSpriteBase(aTest)
-	{}
-
-TOomTestName COomSprite::TestName()
-	{
-	return(_L("Sprites"));
-	}
-
-/** Creates a sprite.
-*/
-TInt COomSprite::Fail()
-	{
-	iSprite=RWsSprite(iWs);
-	TInt err=iSprite.Construct(iWin,TPoint(10,10),0);
-	if (err==KErrNone)
-		{
-		TSpriteMember sprite;
-		sprite.iBitmap=iBitmap;
-		sprite.iMaskBitmap=iMask;
-		sprite.iInvertMask=EFalse;
-		sprite.iDrawMode=CGraphicsContext::EDrawModePEN;
-		sprite.iOffset=TPoint(0,0);
-		sprite.iInterval=TTimeIntervalMicroSeconds32(100000);
-		if ((err=iSprite.AppendMember(sprite))==KErrNone)
-			if ((err=iSprite.Activate())==KErrNone)
-				{
-				sprite.iBitmap=iBitmap2;		// Bigger bitmap to force resize of bitmap
-				sprite.iMaskBitmap=iMask2;
-				if ((err=iSprite.AppendMember(sprite))==KErrNone)
-					err=iSprite.UpdateMember(1,sprite);
-				}
-		}
-	return(err);
-	}
-
-void COomSprite::ClearUpL()
-	{
-	iSprite.Close();
-	}
-
-//
-
-COomPointerCursor::COomPointerCursor(CTOom *aTest) : COomSpriteBase(aTest)
-	{}
-
-TOomTestName COomPointerCursor::TestName()
-	{
-	return(_L("Pointer cursor"));
-	}
-
-/** Creates a pointer cursor.
-*/
-TInt COomPointerCursor::Fail()
-	{
-	iPointerCursor=RWsPointerCursor(iWs);
-	TInt err=iPointerCursor.Construct(0);
-	if (err==KErrNone)
-		{
-		TSpriteMember sprite;
-		sprite.iBitmap=iBitmap;
-		sprite.iMaskBitmap=iMask;
-		sprite.iInvertMask=EFalse;
-		sprite.iDrawMode=CGraphicsContext::EDrawModePEN;
-		sprite.iOffset=TPoint(0,0);
-		sprite.iInterval=TTimeIntervalMicroSeconds32(100000);
-		if ((err=iPointerCursor.AppendMember(sprite))==KErrNone)
-			if ((err=iPointerCursor.Activate())==KErrNone)
-				{
-				sprite.iBitmap=iBitmap2;		// Bigger bitmap to force resize of bitmap
-				sprite.iMaskBitmap=iMask2;
-				if ((err=iPointerCursor.AppendMember(sprite))==KErrNone)
-					err=iPointerCursor.UpdateMember(1,sprite);
-				}
-		}
-	return(err);
-	}
-
-void COomPointerCursor::ClearUpL()
-	{
-	iPointerCursor.Close();
-	}
-
-//
-
-COomGc::COomGc(CTOom *aTest) : COomSetup(aTest)
-	{}
-
-COomGc::~COomGc()
-	{
-	delete iScrDev;
-	}
-
-TOomTestName COomGc::TestName()
-	{
-	return(_L("Graphic Context"));
-	}
-
-void COomGc::ConstructL()
-	{
-	COomSetup::ConstructL();
-	iScrDev=new(ELeave) CWsScreenDevice(iWs);
-	User::LeaveIfError(iScrDev->Construct(iTest->ScreenNumber()));
-	}
-
-/** Creates a graphical context for a previously created screen device.
-*/
-TInt COomGc::Fail()
-	{
-	TRAPD(err,iFailGc=new(ELeave) CWindowGc(iScrDev));
-	if (err!=KErrNone)
-		return(err);
-	return(iFailGc->Construct());
-	}
-
-void COomGc::ClearUpL()
-	{
-	delete iFailGc;
-	iFailGc=NULL;
-	}
-
-//
-
-COomPolygon::COomPolygon(CTOom *aTest) : COomSetup(aTest), iPnts(5)
-	{}
-
-COomPolygon::~COomPolygon()
-	{
-	delete iGc;
-	delete iScrDev;
-	iWin.Close();
-	}
-
-TOomTestName COomPolygon::TestName()
-	{
-	return(_L("Polygon"));
-	}
-
-void COomPolygon::ConstructL()
-	{
-	COomSetup::ConstructL();
-	iScrDev=new(ELeave) CWsScreenDevice(iWs);
-	User::LeaveIfError(iScrDev->Construct(iTest->ScreenNumber()));
-	User::LeaveIfError(iScrDev->CreateContext(iGc));
-	iWin=RBackedUpWindow(iWs);
-	User::LeaveIfError(iWin.Construct(iWinGroup,EGray16,33));
-	User::LeaveIfError(iWin.SetSizeErr(TSize(40,40)));
-	iWin.Activate();
-	TInt index;
-	for(index=0;index<20;index+=2)
-		iPnts.AppendL(TPoint(20+index,index));
-	for(index=0;index<20;index+=2)
-		iPnts.AppendL(TPoint(40-index,20+index));
-	for(index=0;index<20;index+=2)
-		iPnts.AppendL(TPoint(20-index,40-index));
-	for(index=0;index<20;index+=2)
-		iPnts.AppendL(TPoint(index,20-index));
-	}
-
-/** Draws a polygon.
-*/
-TInt COomPolygon::Fail()
-	{
-	iGc->Activate(iWin);
-	iGc->Clear();
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	iGc->SetBrushColor(TRgb::Gray4(2));
-	iGc->SetPenColor(TRgb::Gray4(0));
-	TInt err=iGc->DrawPolygon(&iPnts,CGraphicsContext::EAlternate);
-	if (err!=KErrNone)
-		return(err);
-	err=iGc->DrawPolygon(&iPnts,CGraphicsContext::EWinding);
-	if (err!=KErrNone)
-		return(err);
-	return(KErrNone);
-	}
-
-void COomPolygon::ClearUpL()
-	{
-	iGc->Deactivate();
-	}
-
-//
-
-COomScreenDevice::COomScreenDevice(CTOom *aTest) : COomSetup(aTest)
-	{}
-
-TOomTestName COomScreenDevice::TestName()
-	{
-	return(_L("Screen device"));
-	}
-
-/** Creates a screen device handle.
-*/
-TInt COomScreenDevice::Fail()
-	{
-	TRAPD(err,iScrDev=new(ELeave) CWsScreenDevice(iWs));
-	if (err!=KErrNone)
-		return(err);
-	return(iScrDev->Construct(iTest->ScreenNumber()));
-	}
-
-void COomScreenDevice::ClearUpL()
-	{
-	delete iScrDev;
-	iScrDev=NULL;
-	}
-
-//
-
-COomCustomTextCursor::COomCustomTextCursor(CTOom *aTest) : COomSetup(aTest)
-	{}
-
-COomCustomTextCursor::~COomCustomTextCursor()
-	{
-	delete iMemberArray;
-	delete iBitmap;
-	}
-
-TOomTestName COomCustomTextCursor::TestName()
-	{
-	return(_L("Custom Text Cursor"));
-	}
-
-void COomCustomTextCursor::ConstructL()
-	{
-	COomSetup::ConstructL();
-
-	iBitmap = new(ELeave) CFbsBitmap;
-	User::LeaveIfError(iBitmap->Load(TEST_BITMAP_NAME, EMbmWsautotestBmp1));
-
-	TSpriteMember member;
-	member.iMaskBitmap=NULL;
-	member.iInvertMask=EFalse;
-	member.iDrawMode=CGraphicsContext::EDrawModePEN;
-	member.iOffset=TPoint();
-	member.iInterval=TTimeIntervalMicroSeconds32(0);
-	member.iBitmap = iBitmap;
-
-	iMemberArray = new(ELeave) CArrayFixFlat<TSpriteMember>(1);
-	iMemberArray->AppendL(member);
-	}
-
-/** Adds a custom text cursor to the server's list of cursors.
-*/
-TInt COomCustomTextCursor::Fail()
-	{
-	TInt err = TheClient->iWs.SetCustomTextCursor(0x98765432, iMemberArray->Array(), 0, RWsSession::ECustomTextCursorAlignTop);
-	if (err == KErrAlreadyExists)
-		return KErrNone;
-	else
-		return err;
-	}
-
-void COomCustomTextCursor::ClearUpL()
-	{
-	}
-
-COomTranspWindow::COomTranspWindow(CTOom *aTest) : COomSetup(aTest)
-	{}
-
-COomTranspWindow::~COomTranspWindow()
-	{
-	delete iBackgroundWin;
-	delete iFirst;
-	delete iSecond;
-	
-	delete iFbsBitmap;
-	delete iWsBitmap;
-	delete iFbsBitmapDevice; 
-	delete iFbsBitmapGc;
-	delete iWsBitmapDevice; 
-	delete iWsBitmapGc;				
-	}
-
-TOomTestName COomTranspWindow::TestName()
-	{
-	return(_L("Transparent Window"));
-	}
-
-void COomTranspWindow::ConstructL()
-	{
-	COomSetup::ConstructL();
-	
-	iTransparencyEnabled = (TransparencySupportedL() == KErrNone);
-	if(!iTransparencyEnabled)
-		return;
-
-	iFbsBitmap = new (ELeave) CFbsBitmap;
-
-	// Do the creation 
-	const TSize KSizeForBitmap(10,10);
-	iFbsBitmap->Create(KSizeForBitmap,EGray256);
-	
-	// Fill the bitmap with a colour		
-	iFbsBitmapDevice=CFbsBitmapDevice::NewL(iFbsBitmap);
-		
-	iFbsBitmapDevice->CreateContext(iFbsBitmapGc);
-	
-	iFbsBitmapGc->SetPenStyle(CGraphicsContext::ENullPen);
-	iFbsBitmapGc->SetBrushStyle(CGraphicsContext::ESolidBrush);	
-	iFbsBitmapGc->SetBrushColor(128);
-	iFbsBitmapGc->DrawRect(TRect(KSizeForBitmap));
-	
-	// Create a CWsBitmap, and fill it with a colour	
-	iWsBitmap = new (ELeave) CWsBitmap(TheClient->iWs);
-	
-	// Do the creation 
-	iWsBitmap->Create(KSizeForBitmap,EGray256);	
-		
-	// Fill the bitmap with a colour		
-	iWsBitmapDevice=CFbsBitmapDevice::NewL(iWsBitmap);	
-			
-	iWsBitmapDevice->CreateContext(iWsBitmapGc);		
-	iWsBitmapGc->SetPenStyle(CGraphicsContext::ENullPen);
-	iWsBitmapGc->SetBrushStyle(CGraphicsContext::ESolidBrush);	
-	iWsBitmapGc->SetBrushColor(128);
-	iWsBitmapGc->DrawRect(TRect(KSizeForBitmap));				
-	}
-	
-
-/** Does nothing if transparency is not enabled. Creates a blank window with 
-* two transparent child-windows. Tests setting the transparency via a factor, CFbsBitmap
-* or a CWsBitmap, and changing from one to the other.
-* Changes child-windows' sizes and toggles their visibility.
-*/
-TInt COomTranspWindow::Fail()
-	{
-	if(!iTransparencyEnabled)
-		return KErrNone;
-	TSize scrSize(TheClient->iScreen->SizeInPixels());
-	TRAPD(res, iBackgroundWin = new (ELeave) CBlankWindow(TRgb(0,0,238)));
-	if(res != KErrNone)
-		{
-		return res;	
-		}
-
-	TDisplayMode mode=EColor256;
-	TRAP(res, iBackgroundWin->SetUpL(TPoint(50,50),scrSize-TSize(100,100),TheClient->iGroup,*TheClient->iGc,&mode));
-	if(res != KErrNone)
-		{
-		return res;
-		}
-
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-
-	iBackgroundWin->Win()->SetBackgroundColor(TRgb(51,204,51));
-	iBackgroundWin->Invalidate();
-
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-
-	TRect	thePos1(20, 20, 60, 60);
-	TRect	thePos2(100, 40, 160, 80);
-	TRAP(res, iFirst = CTransWindow::NewL(iBackgroundWin, TRgb(255,0,0,128),&mode));
-	if(res != KErrNone)
-		{
-		return res;
-		}
-
-	TRAP(res, iSecond = CTransWindow::NewL(iBackgroundWin, TRgb(255,0,0,128),&mode));
-	if(res != KErrNone)
-		{
-		return res;
-		}
-
-	TRAP(res, iFirst->SetExtL(thePos1.iTl,thePos1.Size()));
-	if(res != KErrNone)
-		{
-		return res;
-		}
-
-	TRAP(res, iSecond->SetExtL(thePos2.iTl,thePos2.Size()));
-	if(res != KErrNone)
-		{
-		return res;
-		}
-
-	res=SetTransparencyTesting();
-	if(res != KErrNone)
-		{
-		return res;
-		}
-
-	TheClient->Flush();
-	//TheClient->WaitForRedrawsToFinish();
-
-	iFirst->Activate();
-	iFirst->AssignGC(*TheClient->iGc);
-
-	iSecond->Activate();
-	iSecond->AssignGC(*TheClient->iGc);
-
-	iFirst->Win()->SetBackgroundColor(TRgb(0, 0, 255));
-	iSecond->Win()->SetBackgroundColor(TRgb(0, 0, 255));
-	iFirst->Invalidate();
-	iSecond->Invalidate();
-	
-	iFirst->AdjustSize(150,10, 0);
-	iSecond->AdjustSize(150,10, 0);
-
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-
-	iFirst->ToggleVisibility();
-	iSecond->ToggleVisibility();
-
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	
-	iFirst->AdjustSize(200,10, 0);
-	iSecond->AdjustSize(200,10, 0);
-
-	iFirst->ToggleVisibility();
-	iSecond->ToggleVisibility();
-
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-
-	return KErrNone;
-	}
-
-
-// This function tests setting the transparency via a factor, CFbsBitmap
-// or a CWsBitmap, and changing from one to the other.
-TInt COomTranspWindow::SetTransparencyTesting()
-	{
-	TInt res;	
-	TLogMessageText buf;
-		
-	// Need all nine transitions, from the 3 ways to the same 3 ways.
-	// The ways are Factor, CWsBitmap, CFbsBitmap
-	const TRgb KTransparencyFactor(128,128,128);
-	res=iFirst->Win()->SetTransparencyFactor(KTransparencyFactor);
-	if (res!=KErrNone)
-		{
-		buf=_L("test failure!! with SetTransparencyFactor -1");
-		TheClient->LogMessage(buf);
-		return res;
-		}
-			
-	res=iFirst->Win()->SetTransparencyBitmap(*iFbsBitmap);
-	if (res!=KErrNone)
-		{
-		buf=_L("test failure!! with SetTransparencyBitmap - fbs -2");
-		TheClient->LogMessage(buf);
-		return res;
-		}			
-		
-	res=iFirst->Win()->SetTransparencyWsBitmap(*iWsBitmap);
-	if (res!=KErrNone)
-		{
-		buf=_L("test failure!! with SetTransparencyBitmap - Ws -3");
-		TheClient->LogMessage(buf);
-		return res;
-		}
-				
-	res=iFirst->Win()->SetTransparencyFactor(KTransparencyFactor);
-	if (res!=KErrNone)
-		{
-		buf=_L("test failure!! with SetTransparencyBitmap - fbs -4");
-		TheClient->LogMessage(buf);
-		return res;
-		}	
-	res=iFirst->Win()->SetTransparencyWsBitmap(*iWsBitmap);
-	if (res!=KErrNone)
-		{
-		buf=_L("test failure!! with SetTransparencyBitmap - Ws -5");
-		TheClient->LogMessage(buf);
-		return res;
-		}
-	res=iFirst->Win()->SetTransparencyWsBitmap(*iWsBitmap);
-	if (res!=KErrNone)
-		{
-		buf=_L("test failure!! with SetTransparencyBitmap - Ws -6");
-		TheClient->LogMessage(buf);
-		return res;
-		}			
-		
-	res=iFirst->Win()->SetTransparencyBitmap(*iFbsBitmap);
-	if (res!=KErrNone)
-		{
-		buf=_L("test failure!! with SetTransparencyBitmap - fbs -7");
-		TheClient->LogMessage(buf);
-		return res;
-		}	
-		
-	res=iFirst->Win()->SetTransparencyBitmap(*iFbsBitmap);
-	if (res!=KErrNone)
-		{
-		buf=_L("test failure!! with SetTransparencyBitmap - fbs -8");
-		TheClient->LogMessage(buf);
-		return res;
-		}
-		
-	res=iFirst->Win()->SetTransparencyFactor(KTransparencyFactor);
-	if (res!=KErrNone)
-		{
-		buf=_L("test failure!! with SetTransparencyFactor -9");
-		TheClient->LogMessage(buf);
-		return res;
-		}				
-		
-	res=iFirst->Win()->SetTransparencyFactor(KTransparencyFactor);
-	if (res!=KErrNone)
-		{
-		buf=_L("test failure!! with SetTransparencyFactor -10");
-		TheClient->LogMessage(buf);
-		return res;
-		}
-					
-	return res;
-	}	
-
-void COomTranspWindow::ClearUpL()
-	{
-	delete iFirst;
-	iFirst = NULL;
-	delete iSecond;
-	iSecond = NULL;
-	delete iBackgroundWin;
-	iBackgroundWin = NULL;
-	}
-
-//
-
-CWindowWithOneLine* CWindowWithOneLine::NewL(CTWinBase& aParent, const TRect& aExtent)
-	{
-	CWindowWithOneLine* self = new(ELeave) CWindowWithOneLine;
-	CleanupStack::PushL(self);
-	self->ConstructL(aParent);
-	const TSize screenSize(TheClient->iScreen->SizeInPixels());	
-	self->SetExtL(aExtent.iTl, aExtent.Size());
-	self->AssignGC(*TheClient->iGc);
-	self->Activate();
-	self->DrawNow();
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-void CWindowWithOneLine::Draw()
-	{
-	iGc->DrawLine(TPoint(0,0), TPoint(Size().iWidth, Size().iHeight));
-	}
-
-//
-
-COomObscuredWindow::COomObscuredWindow(CTOom *aTest) : COomSetup(aTest)
-	{}
-
-TOomTestName COomObscuredWindow::TestName()
-	{
-	return(_L("Obscured window"));
-	}
-
-TInt COomObscuredWindow::Fail()
-	{
-	TRAPD(err, DoFailL());
-	return err;
-	}
-
-	
-void COomObscuredWindow::DoFailL()
-	{
-#ifdef __WINS__
-	RDebug::Print(_L("COomObscuredWindow::DoFailL - enter"));
-#endif
-	const TRect extent(20, 20, 100, 100);
-	CBlankWindow* backgroundWindow = new(ELeave) CBlankWindow(TRgb(12, 23, 34));
-	CleanupStack::PushL(backgroundWindow);
-	TDisplayMode mode = EColor16MAP;
-	backgroundWindow->SetUpL(extent.iTl, extent.Size(), TheClient->iGroup, *TheClient->iGc, &mode);
-	
-	CWindowWithOneLine* window = CWindowWithOneLine::NewL(*backgroundWindow, extent);
-	CleanupStack::PushL(window);
-#ifdef __WINS__
-	RDebug::Print(_L("COomObscuredWindow - WaitForRedrawsToFinish - 1"));
-#endif
-	TheClient->WaitForRedrawsToFinish();
-	
-	CBlankWindow* obscuringWindow = new(ELeave) CBlankWindow(TRgb(255, 0, 0));
-	CleanupStack::PushL(obscuringWindow);
-	obscuringWindow->SetUpL(extent.iTl, extent.Size(), backgroundWindow, *TheClient->iGc, &mode);
-
-	TheClient->Flush();
-#ifdef __WINS__
-    RDebug::Print(_L("COomObscuredWindow - WaitForRedrawsToFinish - 2"));
-#endif
-	TheClient->WaitForRedrawsToFinish();
-
-	window->Invalidate();
-
-	for(TInt i = 0; i < 50; i++)
-		{
-		RWindow anotherWin(iWs);
-		User::LeaveIfError(anotherWin.Construct(iWinGroup, 11));
-		anotherWin.Close();
-		
-		if(i % 4)
-			window->Invalidate();
-
-		TheClient->Flush();
-#ifdef __WINS__
-	    RDebug::Print(_L("COomObscuredWindow - WaitForRedrawsToFinish - 3 - %d"), i);
-#endif
-	    TheClient->WaitForRedrawsToFinish();
-		}
-
-	TheClient->Flush();
-#ifdef __WINS__
-    RDebug::Print(_L("COomObscuredWindow - WaitForRedrawsToFinish - 4"));
-#endif
-	TheClient->WaitForRedrawsToFinish();
-
-	CleanupStack::PopAndDestroy(obscuringWindow);
-	CleanupStack::PopAndDestroy(window);
-	CleanupStack::PopAndDestroy(backgroundWindow);
-#ifdef __WINS__
-    RDebug::Print(_L("COomObscuredWindow::DoFailL - exit"));
-#endif
-	}
-
-void COomObscuredWindow::ClearUpL()
-	{
-	}	
-
-//
-
-CTOom::CTOom(CTestStep* aStep) : CTWsGraphicsBase(aStep)
-	{
-	iState = 0;
-	}
-	
-const TDesC& CTOom::TestName() const
-	{
-	_LIT(KTestName,"CTOom");
-	return(KTestName());
-	}
-	
-void CTOom::DoOomTestL(COomFailBase *aOomTest)
-	{
-	//TLogMessageText buf;
-	TEST(aOomTest!=NULL);
-	if (aOomTest==NULL)
-		INFO_PRINTF1(_L("aOomTest - Expected: Not Null, Actual: NULL"));			
-
-	TRAPD(ret1,aOomTest->ConstructL());
-	TEST(ret1==KErrNone);
-	if (ret1!=KErrNone)
-		INFO_PRINTF3(_L("aOomTest->ConstructL() return value - Expected: %d, Actual: %d"), KErrNone, ret1);			
-
-	aOomTest->Flush();
-	__UHEAP_MARK;
-//	TInt oldCount=TheClient->iWs.HeapCount();
-	for(TInt mode=0;mode<3;mode++)
-		{
-		/*buf.Format(_L("OOMTest[%d] Mode=%d"),iState,mode),
-		TheClient->LogMessage(buf);*/
-		TInt successCount=0;
-		for(TInt count=1;;count++)
-			{
-			TInt ret;
-			aOomTest->PreFail();
-			if (mode==0)
-				TheClient->iWs.HeapSetFail(RHeap::EDeterministic,count);
-			else if (mode==1)
-				TheClient->iWs.HeapSetBurstFail(RHeap::EBurstFailNext, count, KMaxTUint16);
-			else if (mode==3)
-				{
-				__UHEAP_SETFAIL(RHeap::EDeterministic,count);	//Leavescan will complain about EFailNext, although it isn't a leaving function
-				}
-			ret=aOomTest->Fail();
-			if (mode==0)
-				TheClient->iWs.HeapSetFail(RHeap::ENone,0);
-			else if (mode==1)
-				TheClient->iWs.HeapSetBurstFail(RHeap::ENone, 0, 0);
-			else if (mode==2)
-				{
-				__UHEAP_RESET;
-				}
-			aOomTest->ClearUpL();  //In just 1 case this could leave...
-			aOomTest->Flush();
-			if (ret==KErrNone)
-				{
-				if (successCount==10)
-					break;
-				successCount++;
-				}
-			else
-				{
-				/*if (successCount>0)
-					{
-					buf.Format(_L("[%d,%d] Count=%d, MaxSuccess=%d"),iState,mode,count,successCount);
-					TheClient->LogMessage(buf);
-					}*/
-				successCount=0;
-				/*if (ret!=KErrNoMemory)
-					{
-					buf.Format(_L("[%d,%d] Fail, Count=%d, Error=%d"),iState,mode,count,ret);
-					TheClient->LogMessage(buf);
-					}*/
-				TEST(ret==KErrNoMemory);
-				if (ret!=KErrNoMemory)
-					INFO_PRINTF3(_L("aOomTest->Fail() return value - Expected: %d, Actual: %d"), KErrNoMemory, ret);			
-
-				}
-			}
-		/*buf.Format(_L("[%d,%d] LastCount=%d"),iState,mode,count),
-		TheClient->LogMessage(buf);*/
-		}
-//	TEST(oldCount>=TheClient->iWs.HeapCount());
-	__UHEAP_MARKEND;
-	delete aOomTest;
-	/*buf.Format(_L("OOMTest[%d] Finished"),iState);
-	TheClient->LogMessage(buf);*/
-	}
-
-void CTOom::ConstructL()
-	{
-	iShieldWin=RBlankWindow(TheClient->iWs);
-	User::LeaveIfError(iShieldWin.Construct(*(TheClient->iGroup->GroupWin()),1));
-//	iShieldWin.SetOrdinalPosition(0,-1);
-	iShieldWin.Activate();
-	}
-
-CTOom::~CTOom()
-	{
-	iShieldWin.Close();
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0124
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Out of memory tests
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Uses deterministic heap failure mode to test WSERV classes against out-of-memory errors.
-					Sets and unsets deterministic mode using both RWsSession.HeapSetFail() methods and
-					__UHEAP_SETFAIL/__UHEAP_RESET macros (doing this both client and WSERV threads are tested). 
-					On each step the test creates a failure object and repeatedly asks it to do some work (calling Fail() method).
-					A failure object is an object which encapsulates some allocation functionality inside it's Fail() method.
-					The test is performed for 23 different failure objects that do the following:
-						1. Creates a wserv session, connects and creates CWsScreenDevice object.
-						2. Creates a RWindowGroup object.
-						3. Creates a RWindow object.
-						4. Creates a RBackedUpWindow object.
-						5. Sets the size of previously created backed-up window.
-						6. Creates a RBlankWindow object.
-						7. Allocates a buffer for storing pointer movements for a previously created backed-up window.
-						8. Adds a priority key for a previously created window group.
-						9. Requests a capture keys for a previously created window group.
-						10. Requests the capture of key-up and key-down events for a previously created window group.
-						11. Sets hot key for the session.
-						12. Sets the window group's name.
-						13. Sends a message to another window group.
-						14. Fetches a message.
-						15. Enables window group change events and modifier change events.
-						16. Copies screen to bitmap.
-						17. Creates a sprite.
-						18. Creates a pointer cursor.
-						19. Creates a graphical context for a previously created screen device.
-						20. Draws a polygon.
-						21. Creates a screen device handle.
-						22. Adds a custom text cursor to the server's list of cursors.
-						23. Does nothing if transparency is not enabled. Creates a blank window with 
-							two transparent child-windows. Tests setting the transparency via a factor, CFbsBitmap
-							or a CWsBitmap, and changing from one to the other.
-							Changes child-windows' sizes and toggles their visibility.
-					
-
-@SYMTestExpectedResults The test checks that the creation failure objects doesn't fail and their's work either causes no errors or causes KErrNoMemory error.
-*/
-void CTOom::RunTestCaseL(TInt /*aCurTestCase*/) 
-	{
-	((CTOomStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0124"));
-	if (iState==0)
-		{
-		// commented by Anton Golovko, 01.03.2006 while converting to TEF
-		// the code below prevented the test to do anything.
-//		if (iTest->IsFullRomL()) 
-//			{
-//			TestComplete();
-//			return;
-//			}
-		iOldCount=TheClient->iWs.HeapCount();
-		}
-	else if (iState==sizeof(CreateOomFailTest)/sizeof(CreateOomFailTest[0]))
-		{
-		iTest->CloseAllPanicWindows();
-		TInt heapCount=TheClient->iWs.HeapCount();
-		if (heapCount>iOldCount)
-			{
-			TEST(iOldCount>=heapCount-184);		//For some uninvestigated reason 184 object get allocated on the server side, partly because of INFO_PRINTF1
-			if (iOldCount<heapCount-184)
-					INFO_PRINTF3(_L("iOldCount>=heapCount-174 - Expected: %d, Actual: %d"), heapCount-184, iOldCount);			
-
-			}
-		((CTOomStep*)iStep)->CloseTMSGraphicsStep();
-		TestComplete();
-		return;
-		}
-	DoOomTestL(CreateOomFailTest[iState++](this));
-	((CTOomStep*)iStep)->RecordTestResultL();
-	}
-	
-	
-	
-	
-__WS_CONSTRUCT_STEP__(Oom)
-	
--- a/windowing/windowserver/tauto/TOOM.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,425 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TOOM_H__
-#define __TOOM_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-
-typedef TBuf<0x40> TOomTestName;
-
-class CTOom;
-
-
-class COomFailBase : public CBase
-	{
-public:
-	COomFailBase(CTOom *aTest);
-	virtual void ConstructL();
-	virtual void PreFail();
-	virtual void ClearUpL();
-	virtual void Flush();
-	virtual TInt Fail()=0;
-	virtual TOomTestName TestName()=0;
-protected:
-	RWsSession iWs;
-	CWsScreenDevice* iDummyScreen;
-	CTOom *iTest;
-	};
-
-
-class COomConnect : public COomFailBase
-	{
-public:
-	COomConnect(CTOom *aTest);
-	TInt Fail();
-	void ClearUpL();
-	TOomTestName TestName();
-	};
-
-class COomSetup : public COomFailBase
-	{
-public:
-	COomSetup(CTOom *aTest);
-	~COomSetup();
-	void ConstructL();
-protected:
-	RWindowGroup iWinGroup;
-	};
-
-class COomWindowGroup : public COomSetup
-	{
-public:
-	COomWindowGroup(CTOom *aTest);
-	void ClearUpL();
-	TInt Fail();
-	TOomTestName TestName();
-private:
-	RWindowGroup iFailWinGroup;
-	};
-
-class COomWindow : public COomSetup
-	{
-public:
-	COomWindow(CTOom *aTest);
-	void ClearUpL();
-	TInt Fail();
-	TOomTestName TestName();
-private:
-	RWindow iFailWin;
-	};
-
-class COomBackedUpWindow : public COomSetup
-	{
-public:
-	COomBackedUpWindow(CTOom *aTest);
-	void ClearUpL();
-	TInt Fail();
-	TOomTestName TestName();
-private:
-	RBackedUpWindow iFailWin;
-	};
-
-class COomBlankWindow : public COomSetup
-	{
-public:
-	COomBlankWindow(CTOom *aTest);
-	void ClearUpL();
-	TInt Fail();
-	TOomTestName TestName();
-private:
-	RBlankWindow iFailWin;
-	};
-
-class COomGc : public COomSetup
-	{
-public:
-	COomGc(CTOom *aTest);
-	~COomGc();
-	void ConstructL();
-	void ClearUpL();
-	TInt Fail();
-	TOomTestName TestName();
-private:
-	CWsScreenDevice *iScrDev;
-	CWindowGc *iFailGc;
-	};
-
-class COomPolygon : public COomSetup
-	{
-public:
-	COomPolygon(CTOom *aTest);
-	~COomPolygon();
-	void ConstructL();
-	void ClearUpL();
-	TInt Fail();
-	TOomTestName TestName();
-private:
-	CWsScreenDevice *iScrDev;
-	RBackedUpWindow iWin;
-	CWindowGc *iGc;
-	CArrayFixSeg<TPoint> iPnts;
-	};
-
-class COomScreenDevice : public COomSetup
-	{
-public:
-	COomScreenDevice(CTOom *aTest);
-	void ClearUpL();
-	TInt Fail();
-	TOomTestName TestName();
-private:
-	CWsScreenDevice *iScrDev;
-	};
-
-class COomBackupResize : public COomSetup
-	{
-public:
-	COomBackupResize(CTOom *aTest);
-	~COomBackupResize();
-	void ConstructL();
-	void ClearUpL();
-	TInt Fail();
-	TOomTestName TestName();
-private:
-	RBackedUpWindow iFailWin;
-	};
-
-class COomPointerBuffer : public COomSetup
-	{
-public:
-	COomPointerBuffer(CTOom *aTest);
-	~COomPointerBuffer();
-	void ConstructL();
-	void ClearUpL();
-	TInt Fail();
-	TOomTestName TestName();
-private:
-	RBackedUpWindow iFailWin;
-	};
-
-class COomPriorityKey : public COomSetup
-	{
-public:
-	COomPriorityKey(CTOom *aTest);
-	~COomPriorityKey();
-	void ConstructL();
-	void ClearUpL();
-	TInt Fail();
-	TOomTestName TestName();
-	};
-
-class COomCaptureKey : public COomSetup
-	{
-public:
-	COomCaptureKey(CTOom *aTest);
-	~COomCaptureKey();
-	void ConstructL();
-	void ClearUpL();
-	TInt Fail();
-	TOomTestName TestName();
-private:
-	TInt32 iCapKey[20];
-	TInt iIndex;
-	};
-
-class COomCaptureKeyUpDown : public COomSetup
-	{
-public:
-	COomCaptureKeyUpDown(CTOom *aTest);
-	~COomCaptureKeyUpDown();
-	void ConstructL();
-	void ClearUpL();
-	TInt Fail();
-	TOomTestName TestName();
-private:
-	TInt32 iCapKey[20];
-	TInt iIndex;
-	};
-
-class COomHotKey : public COomSetup
-	{
-public:
-	COomHotKey(CTOom *aTest);
-	~COomHotKey();
-	void ConstructL();
-	void ClearUpL();
-	TInt Fail();
-	TOomTestName TestName();
-	};
-
-class COomGroupName : public COomSetup
-	{
-public:
-	COomGroupName(CTOom *aTest);
-	~COomGroupName();
-	void ConstructL();
-	void ClearUpL();
-	TInt Fail();
-	TOomTestName TestName();
-	};
-
-class COomMessageSend: public COomSetup
-	{
-public:
-	COomMessageSend(CTOom *aTest);
-	~COomMessageSend();
-	void ConstructL();
-	void PreFail();
-	void ClearUpL();
-	TInt Fail();
-	TOomTestName TestName();
-private:
-	RWindowGroup iWinGroup2;
-	};
-
-class COomMessageFetch: public COomSetup
-	{
-public:
-	COomMessageFetch(CTOom *aTest);
-	~COomMessageFetch();
-	void PreFail();
-	void ConstructL();
-	void ClearUpL();
-	TInt Fail();
-	TOomTestName TestName();
-private:
-	RWindowGroup iWinGroup2;
-	};
-
-class COomCopyScreen : public COomSetup
-	{
-public:
-	COomCopyScreen(CTOom *aTest);
-	~COomCopyScreen();
-	void ConstructL();
-	void ClearUpL();
-	TInt Fail();
-	TOomTestName TestName();
-private:
-	CWsScreenDevice *iScrDev;
-	CFbsBitmap *iBitmap;
-	};
-
-class COomRequestEvents : public COomSetup
-	{
-public:
-	COomRequestEvents(CTOom *aTest);
-	~COomRequestEvents();
-	void ConstructL();
-	void ClearUpL();
-	TInt Fail();
-	TOomTestName TestName();
-	};
-
-class COomSpriteBase : public COomSetup
-	{
-public:
-	COomSpriteBase(CTOom *aTest);
-	~COomSpriteBase();
-	void ConstructL();
-protected:
-	RWindow iWin;
-	CFbsBitmap *iBitmap;
-	CFbsBitmap *iMask;
-	CFbsBitmap *iBitmap2;
-	CFbsBitmap *iMask2;
-	};
-
-class COomSprite : public COomSpriteBase
-	{
-public:
-	COomSprite(CTOom *aTest);
-	void ClearUpL();
-	TInt Fail();
-	TOomTestName TestName();
-private:
-	RWsSprite iSprite;
-	};
-
-class COomPointerCursor : public COomSpriteBase
-	{
-public:
-	COomPointerCursor(CTOom *aTest);
-	void ClearUpL();
-	TInt Fail();
-	TOomTestName TestName();
-private:
-	RWsPointerCursor iPointerCursor;
-	};
-
-class COomCustomTextCursor : public COomSetup
-	{
-public:
-	COomCustomTextCursor(CTOom *aTest);
-	~COomCustomTextCursor();
-	void ConstructL();
-	void ClearUpL();
-	TInt Fail();
-	TOomTestName TestName();
-private:
-	CArrayFixFlat<TSpriteMember>* iMemberArray;
-	CFbsBitmap* iBitmap;
-	};
-
-class COomTranspWindow : public COomSetup
-	{
-public:
-	COomTranspWindow(CTOom *aTest);
-	~COomTranspWindow();
-	void ConstructL();
-	void ClearUpL();
-	TInt Fail();
-	TOomTestName TestName();
-	CTransWindow* CreateTransWinL(CTWinBase* aParent,TRgb aColor,TRect aPos, TDisplayMode* aDisplayMode);
-private:
-	TInt SetTransparencyTesting();
-
-	CBlankWindow* iBackgroundWin;
-	CTransWindow* iFirst;
-	CTransWindow* iSecond;
-	
-	CFbsBitmap* iFbsBitmap;
-	CWsBitmap* iWsBitmap;
-	CFbsBitmapDevice* iFbsBitmapDevice; 
-	CFbsBitGc* iFbsBitmapGc;
-	CFbsBitmapDevice* iWsBitmapDevice; 
-	CFbsBitGc* iWsBitmapGc;
-	TBool iTransparencyEnabled;
-	};
-
-
-class CWindowWithOneLine : public CTWin
-	{
-public:
-	static CWindowWithOneLine* NewL(CTWinBase& aParent, const TRect& aExtent);
-	void Draw();
-	};
-	
-class COomObscuredWindow : public COomSetup
-	{
-public:
-	COomObscuredWindow(CTOom *aTest);
-	void ClearUpL();
-	TInt Fail();
-	TOomTestName TestName();
-private:
-	void DoFailL();
-	};
-
-class CTOom : public CTWsGraphicsBase
-	{
-public:
-	CTOom(CTestStep* aStep);
-	~CTOom();
-	const TDesC& TestName() const;
-	void ConstructL();
-	void DoOomTestL(COomFailBase *aOomTest);
-	inline TInt ScreenNumber(){ return iTest->ScreenNumber();}
-
-protected:
-	virtual void RunTestCaseL(TInt aCurTestCase);
-
-private:
-	TInt iOldCount;
-	RBlankWindow iShieldWin;
-	TSize iWinSize;
-	TInt iState;
-	};
-
-class CTOomStep : public CTGraphicsStep
-	{
-public:
-	CTOomStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTOomStep,"TOom");
-
-
-#endif
--- a/windowing/windowserver/tauto/TOOMDRAW.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,244 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test out of memory redraws
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TOOMDRAW.H"
-
-void DrawTestScreen(CWindowGc *aGc, const TSize &aSize)
-	{
-	aGc->SetPenSize(TSize(10,10));
-	aGc->SetBrushStyle(CGraphicsContext::EVerticalHatchBrush);
-	aGc->DrawRect(TRect(aSize));
-	}
-
-CTestWin::CTestWin()
-	{
-	}
-
-void CTestWin::Draw()
-	{
-#if defined(FULLLOGGING)
-	_LIT(KLog,"Drawing Test Win:%d  %d,%d");
-	TLogMessageText buf;
-	buf.Format(KLog,Size().iWidth>320?1:0,Size().iWidth,Size().iHeight);
-	TheClient->LogMessage(buf);
-#endif
-	DrawTestScreen(iGc,Size());
-	}
-
-CBaseTestWin::CBaseTestWin() : CTBackedUpWin(EGray4)
-	{}
-
-void CBaseTestWin::Resized(const TSize &aNewSize)
-	{
-	TheGc->Activate(*DrawableWin());
-	DrawTestScreen(TheGc,aNewSize);
-	TheGc->Deactivate();
-	}
-
-CToomDraw::CToomDraw(CTestStep* aStep):
-	CTWsGraphicsBase(aStep)
-	{
-	}
-
-CToomDraw::~CToomDraw()
-	{
-	TheClient->iWs.HeapSetFail(RHeap::ENone,0);		//In case the test crashes and it hasn't been reset
-	DeleteWindows();
-	}
-
-void CToomDraw::DeleteWindows()
-	{
-	delete iTestWin;
-	iTestWin=NULL;
-	delete iBaseWin;
-	iBaseWin=NULL;
-	delete iBackWin;
-	iBackWin=NULL;
-	delete iBlankWin;
-	iBlankWin=NULL;
-	}
-
-void CToomDraw::ConstructL()
-	{
-	iScrSize=TheClient->iScreen->SizeInPixels();
-	iBlankWin=new(ELeave) CTBlankWindow;
-	iBlankWin->ConstructL(*TheClient->iGroup);
-	iBlankWin->SetColor(TRgb::Gray4(2));		//Grey
-	iBlankWin->Activate();
-	iBackWin=new(ELeave) CTestWin();
-	iBackWin->SetUpL(TPoint(0,iScrSize.iHeight/4), TSize(iScrSize.iWidth,iScrSize.iHeight/2), TheClient->iGroup, *TheClient->iGc);
-	iBaseWin=new(ELeave) CBaseTestWin();
-	iBaseWin->SetUpL(TPoint(iScrSize.iWidth*2/3,0), TSize(iScrSize.iWidth/3,iScrSize.iHeight), TheClient->iGroup, *TheClient->iGc);
-	}
-
-void CToomDraw::CreateTestWinL()
-	{
-	iTestWin=new(ELeave) CTestWin();
-	iTestWin->ConstructL(*TheClient->iGroup);
-	iTestWin->SetExtL(TPoint(0,0), TSize(iScrSize.iWidth/3,iScrSize.iHeight));
-	iTestWin->AssignGC(*TheClient->iGc);
-	iTestWin->BaseWin()->SetShadowHeight(2);
-	}
-
-void CToomDraw::TriggerOomDrawsL(TInt aCount)
-	{
-	if(iTestWin)
-		{
-		iTestWin->SetExtL(TPoint(),iScrSize);		
-		}
-	delete iTestWin;
-	iTestWin=NULL;
-	CreateTestWinL();
-	TheClient->iWs.HeapSetFail(RHeap::EDeterministic,aCount);
-	iTestWin->Activate();
-	TheClient->iWs.Finish();
-	}
-
-TBool CToomDraw::CheckWindowsL()
-	{
-	TLogMessageText buf;
-	TBool pass = DoCheckRect(iTestWin,iBaseWin);
-	if (pass)
-		{
-		TEST(ETrue);		//Adds one to test count
-	#if defined(FULLLOGGING)
-		_LIT(KLog,"OOM Draw Test Pass, State=%d");
-		buf.Format(KLog,iState);
-	#endif
-		iRetryCount=0;
-		}
-	else
-		{
-		if (iRetryCount==4)
-			{
-			if ((iTest->RedrawStoreTypeL()==EPartialRedraw_PreserveStoredCmds ||
-			iTest->RedrawStoreTypeL()==EPartialRedraw_FullRedrawSupport) && (iState==19 || iState==30) ||
-			((iState>=2 && iState<=6) && (iTest->RedrawStoreTypeL()==EPartialRedraw_None || iTest->RedrawStoreTypeL()==EPartialRedraw_FullRedrawSupport)))
-				{
-			#if defined(FULLLOGGING)
-				_LIT(KLog,"OOM Draw Test Known F a i l, State=%d");
-				buf.Format(KLog,iState);
-			#endif
-				pass=ETrue;
-				}
-			else
-				{
-				if (iFailAt==0)
-					iFailAt=iState;
-				++iFails; //mark this test as failed
-			#if defined(LOGGING)
-				_LIT(KLog,"OOM Draw Test FAIL, State=%d  <------- FAIL");
-				buf.Format(KLog,iState);
-			#endif
-				++iState; //and advance to next test
-				}
-			iRetryCount=0;
-			}
-		else
-			{
-		#if defined(FULLLOGGING)
-			_LIT(KLog,"OOM Draw Test F a i l, State=%d retrying");
-			buf.Format(KLog,iState);
-		#endif
-			if (++iRetryCount%2==0)
-				iBackWin->DrawNow();
-			}
-		}
-	if (buf.Length()>0)
-		TheClient->LogMessage(buf);
-	return pass;
-	}
-
-void CToomDraw::RunTestCaseL(TInt aCurTestCase)
-	{
-	TBool testFinished = false;
-	((CToomDrawStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(aCurTestCase)
-		{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0110
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test trying to draw when out of memory
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Set out of memory and try drawing
-
-@SYMTestExpectedResults Out of memory drawing is handle correctly
-*/
-	case 1:
-		((CToomDrawStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0110"));
-		while (!testFinished)
-			{
-		if (iDoCheck)
-			{
-			TheClient->iWs.HeapSetFail(RHeap::ENone,0);
-			TheClient->WaitForRedrawsToFinish();
-			if (CheckWindowsL())
-				{
-				++iState;
-				if (iState==EMaxOOMState)
-					DeleteWindows();
-				}
-			iDoCheck=EFalse;
-			TheClient->iWs.Finish();
-			}
-		else
-			{
-			if (iState==EMaxOOMState)
-				{
-				if (iFails>0)
-					{
-			#if defined(LOGING)
-					_LIT(KLog,"OOM Draw Test Failed, First Fail At %d, Number of Fails %d");
-					TLogMessageText buf;
-					buf.Format(KLog,iFailAt,iFails);
-					TheClient->LogMessage(buf);
-			#endif
-					TEST(iFails==0);
-					}
-				User::After(500000);	// Let the rest of the world catch up after OOM death
-				testFinished = true;
-				}
-			else if (iState < 3 && iTest->IsFullRomL())
-				testFinished = true;
-			else
-				TriggerOomDrawsL(iState);
-			iDoCheck=ETrue;
-			}
-			}
-		break;
-	case 2:
-		((CToomDrawStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-		((CToomDrawStep*)iStep)->CloseTMSGraphicsStep();
-		TestComplete();
-		break;
-		}
-	((CToomDrawStep*)iStep)->RecordTestResultL();
-	}
-
-__WS_CONSTRUCT_STEP__(oomDraw)
--- a/windowing/windowserver/tauto/TOOMDRAW.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TOOMDRAW_H__
-#define __TOOMDRAW_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-#define LOGGING yes		//Log only failures
-#if defined(LOGGING)
-	#define FULLLOGGING yes
-#endif
-
-class CTestWin : public CTWin
-	{
-public:
-	CTestWin();
-	void Draw();
-	};
-
-class CBaseTestWin : public CTBackedUpWin
-	{
-public:
-	CBaseTestWin();
-	void Resized(const TSize &aNewSize);
-	};
-
-class CToomDraw : public CTWsGraphicsBase
-	{
-private:
-	enum {EMaxOOMState=150};
-public:
-	CToomDraw(CTestStep* aStep);
-	~CToomDraw();
-	void ConstructL();
-	void CreateTestWinL();
-	void TriggerOomDrawsL(TInt aCount);
-	TBool CheckWindowsL();
-	void DeleteWindows();
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	TBool iDoCheck;
-	TSize iScrSize;
-	CTBlankWindow* iBlankWin;
-	CTestWin *iTestWin;
-	CBaseTestWin *iBaseWin;
-	CTestWin *iBackWin;
-	TInt iFails;
-	TInt iFailAt;
-	TInt iRetryCount;
-	TInt iState;
-	};
-
-class CToomDrawStep : public CTGraphicsStep
-	{
-public:
-	CToomDrawStep();
-protected:
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KToomDrawStep,"TOOMDRAW");
-
-
-#endif
--- a/windowing/windowserver/tauto/TORDINAL.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,579 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// ORDINAL.CPP
-// Test ordinal position and priority changes on windows
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TORDINAL.H"
-
-_LIT(KLogNextSibling,"NextSibling of iChild%d is not iChild%d");
-_LIT(KLogNoNextSibling,"iChild%d has a NextSibling when it shouldn't");
-_LIT(KLogPrevSibling,"PrevSibling of iChild%d is not iChild%d");
-_LIT(KLogNoPrevSibling,"iChild%d has a PrevSibling when it shouldn't");
-
-CTOrdinal::CTOrdinal(CTestStep* aStep):
-	CTWsGraphicsBase(aStep)
-	{
-	}
-
-COrdinalWindowBase::COrdinalWindowBase(CTClient *aClient, CTestBase* aTest, CTestStep* aTestStep) : iClient(aClient), iTest(aTest), iTestStep(aTestStep)
-	{
-	}
-
-COrdinalWindow::COrdinalWindow(CTClient *aClient, CTestBase* aTest, CTestStep* aTestStep) : COrdinalWindowBase(aClient, aTest, aTestStep), iClientWin(aClient->iWs)
-	{
-	__DECLARE_NAME(_S("COrdinalWindow"));
-	}
-
-COrdinalWindowGroup::COrdinalWindowGroup(CTClient *aClient, CTestBase* aTest, CTestStep* aTestStep) : COrdinalWindowBase(aClient, aTest, aTestStep), iGroupWin(aClient->iWs)
-	{
-	__DECLARE_NAME(_S("COrdinalWindowGroup"));
-	}
-
-COrdinalWindowBase::~COrdinalWindowBase()
-	{
-	if (iWin)
-		iWin->Close();
-	}
-
-void COrdinalWindowBase::Draw()
-	{}
-
-inline RWindowTreeNode* COrdinalWindowBase::WinTreeNode()
-	{
-	return(iWin);
-	}
-
-inline TUint32 COrdinalWindowBase::Handle()
-	{
-	return reinterpret_cast<TUint>(this);
-	}
-
-COrdinalWindowBase *COrdinalWindowGroup::NewL(CTClient *aClient, CTestBase* aTest, CTestStep* aTestStep)
-	{
-	COrdinalWindowGroup *oWin=new(ELeave) COrdinalWindowGroup(aClient, aTest, aTestStep);
-	TInt err=oWin->iGroupWin.Construct((TUint32)oWin);
-	if (err<0)
-		{
-		delete oWin;
-		User::Leave(err);
-		}
-	oWin->iWin= &oWin->iGroupWin;
-	return(oWin);
-	}
-
-COrdinalWindowBase *COrdinalWindow::NewL(CTClient* aClient, RWindowTreeNode* aParent, CTestBase* aTest, CTestStep* aTestStep)
-	{
-	COrdinalWindow *oWin=new(ELeave) COrdinalWindow(aClient, aTest, aTestStep);
-	TInt err=oWin->iClientWin.Construct(*aParent,(TUint32)oWin);
-	if (err!=KErrNone)
-		{
-		delete oWin;
-		User::Leave(err);
-		}
-	oWin->iClientWin.Activate();
-	oWin->iWin= &oWin->iClientWin;
-	return(oWin);
-	}
-
-TInt COrdinalWindowBase::OrdinalPosition()
-	{
-	return(iWin->OrdinalPosition());
-	}
-
-void COrdinalWindowBase::SetOrdinalPosition(TInt aPos)
-	{
-	iWin->SetOrdinalPosition(aPos);
-	}
-
-void COrdinalWindowBase::SetOrdinalPosition(TInt aPos,TInt aPri)
-	{
-	iWin->SetOrdinalPosition(aPos,aPri);
-	}
-
-CTOrdinal::~CTOrdinal()
-	{
-	delete iClient;
-	}
-
-void DZ(COrdinalWindowBase * &aX)
-	{
-	delete aX;
-	aX=NULL;
-	}
-
-void CTOrdinal::DestroyWindows()
-	{
-	DZ(iParent);
-	DZ(iParent2);
-	DZ(iParent3);
-	for(TInt child=0;child<ENumChildren;++child)
-		DZ(iChild[child]);
-	}
-
-void COrdinalWindowBase::TestOP(TInt aTestPos)
-	{
-	iTestStep->TEST(iWin->OrdinalPosition()==aTestPos);
-	}
-
-void COrdinalWindowBase::SetAndTestOP(TInt aPos,TInt aTestPos)
-	{
-	iWin->SetOrdinalPosition(aPos);
-	iTestStep->TEST(iWin->OrdinalPosition()==aTestPos);
-	}
-
-void COrdinalWindowBase::SetAndTestOP(TInt aPos)
-	{
-	SetAndTestOP(aPos, aPos);
-	}
-
-TInt COrdinalWindowBase::SetToLastAndGetOP()
-	{
-	iWin->SetOrdinalPosition(-1);
-	return(iWin->OrdinalPosition());
-	}
-
-TInt COrdinalWindowBase::SetToLastAndGetOPPri(TInt aPri)
-	{
-	iWin->SetOrdinalPosition(-1, aPri);
-	return(iWin->OrdinalPosition());
-	}
-
-void COrdinalWindowBase::SetAndTestOPPri(TInt aPos,TInt aPri,TInt aTestPos)
-	{
-	iWin->SetOrdinalPosition(aPos,aPri);
-	iTestStep->TEST(iWin->OrdinalPosition()==aTestPos);
-	iTestStep->TEST(iWin->OrdinalPriority()==aPri);
-	}
-
-void COrdinalWindowBase::SetAndTestOPPri(TInt aPos,TInt aPri)
-	{
-	SetAndTestOPPri(aPos,aPri,aPos);
-	}
-
-inline COrdinalWindowBase* COrdinalWindowBase::NextSibling() const
-	{
-	return reinterpret_cast<COrdinalWindow*>(iWin->NextSibling());
-	}
-
-inline COrdinalWindowBase* COrdinalWindowBase::PrevSibling() const
-	{
-	return reinterpret_cast<COrdinalWindow*>(iWin->PrevSibling());
-	}
-
-void CTOrdinal::TestWindowOrderNext(TInt aBefore,TInt aAfter)
-	{
-	TInt retVal=(iChild[aBefore]->NextSibling()==iChild[aAfter]);
-	TEST(retVal);
-	if (!retVal)
-		LOG_MESSAGE3(KLogNextSibling,aBefore,aAfter);
-	}
-
-void CTOrdinal::TestWindowOrderNext(TInt aLast)
-	{
-	TInt retVal=(iChild[aLast]->NextSibling()==0);
-	TEST(retVal);
-	if (!retVal)
-		LOG_MESSAGE2(KLogNoNextSibling,aLast);
-	}
-
-void CTOrdinal::TestWindowOrderPrev(TInt aAfter,TInt aBefore)
-	{
-	TInt retVal=(iChild[aAfter]->PrevSibling()==iChild[aBefore]);
-	TEST(retVal);
-	if (!retVal)
-		LOG_MESSAGE3(KLogPrevSibling,aAfter,aBefore);
-	}
-
-void CTOrdinal::TestWindowOrderPrev(TInt aFirst)
-	{
-	TInt retVal=(iChild[aFirst]->PrevSibling()==0);
-	TEST(retVal);
-	if (!retVal)
-		LOG_MESSAGE2(KLogNoPrevSibling,aFirst);
-	}
-	
-void CTOrdinal::OrdinalPos()
-	{
-	TInt last=iChild[0]->SetToLastAndGetOP();
-	iChild[0]->SetAndTestOP(0);
-	iChild[5]->TestOP(5);
-	iChild[1]->SetAndTestOP(3);
-	iChild[0]->SetAndTestOP(0);
-	iChild[0]->SetAndTestOP(-1,last);
-	iChild[0]->SetAndTestOP(-1000,last);
-	iChild[0]->SetAndTestOP(2);
-	iChild[0]->SetAndTestOP(-1000,last);
-	iChild[0]->SetAndTestOP(0);
-	for(TInt index=0;index<=5;index++)
-		iChild[4]->SetAndTestOP(index,index);
-	iChild[0]->SetAndTestOP(-1,last);
-	iChild[1]->SetAndTestOP(-1,last);
-	iChild[2]->SetAndTestOP(-1,last);
-	iChild[3]->SetAndTestOP(-1,last);
-	iChild[4]->SetAndTestOP(-1,last);
-	iChild[5]->SetAndTestOP(-1,last);
-	TInt child;
-	for (child=0;child<ENumChildren-1;++child)
-		TestWindowOrderNext(child,child+1);
-	TestWindowOrderNext(5);
-	}
-
-void CTOrdinal::OrdinalPriority()
-	{
-	TBool retVal;
-	TInt last12=iChild[2]->SetToLastAndGetOPPri(12);
-	iChild[2]->TestOP(last12);
-	TInt lastKMax=iChild[2]->SetToLastAndGetOPPri(KMaxTInt32);
-	iChild[2]->TestOP(lastKMax);
-	TInt last=iChild[2]->SetToLastAndGetOPPri(0);
-	iChild[2]->TestOP(last);
-	iChild[2]->SetAndTestOPPri(-1,12,last12);				// One and only pri 12 window
-	iChild[3]->SetAndTestOPPri(-1,KMaxTInt32,lastKMax);	// One and only pri KMaxTInt32 window
-	iChild[1]->SetAndTestOPPri(0,KMaxTInt32);
-	iChild[5]->SetAndTestOP(-1,last-3);
-	iChild[1]->TestOP(0);
-	iChild[0]->SetAndTestOPPri(0,50);
-	iChild[1]->SetAndTestOPPri(0,50);
-	iChild[2]->SetAndTestOPPri(0,50);
-	iChild[3]->SetAndTestOPPri(0,50);
-	iChild[1]->TestOP(2);
-	if (iGroupTest)
-		{
-		retVal=(reinterpret_cast<CBase*>(iChild[0]->NextSibling())==iClient->iGroup);
-		TEST(retVal);
-		if (!retVal)
-			{
-			_LIT(KLog,"iChild0 NextSibling is not the main group window");
-			LOG_MESSAGE(KLog);
-			}
-		retVal=(reinterpret_cast<CBase*>(iClient->iGroup->NextSibling())==iChild[4]);
-		TEST(retVal);
-		if (!retVal)
-			{
-			_LIT(KLog,"NextSibling of main group window is not iChild4");
-			LOG_MESSAGE(KLog);
-			}
-		}
-	else
-		TestWindowOrderNext(0,4);
-	TestWindowOrderNext(4,5);
-	TestWindowOrderNext(5);
-	iChild[2]->SetAndTestOPPri(5,-1,0);
-	iChild[3]->SetAndTestOPPri(5,-1,1);
-	TestWindowOrderNext(5,2);
-	iChild[0]->SetAndTestOPPri(100000,KMinTInt32,0);
-	iChild[1]->SetAndTestOPPri(200000,KMinTInt32,1);
-	iChild[2]->SetAndTestOPPri(300000,KMinTInt32,2);
-	iChild[5]->SetAndTestOPPri(0,0,0);
-	iChild[3]->TestOP(0);
-	iChild[0]->SetAndTestOPPri(0,-1);
-	iChild[1]->SetAndTestOPPri(0,-1);
-	iChild[2]->SetAndTestOPPri(0,-1);
-	iChild[3]->SetAndTestOPPri(0,1);
-	iChild[4]->SetAndTestOPPri(0,1);
-	iChild[5]->SetAndTestOPPri(0,1);
-	TestWindowOrderPrev(0,1);
-	TestWindowOrderPrev(1,2);
-	if (iGroupTest)
-		{
-		retVal=(reinterpret_cast<CBase*>(iChild[2]->PrevSibling())==iClient->iGroup);
-		TEST(retVal);
-		if (!retVal)
-			{
-			_LIT(KLog,"iChild2 PrevSibling is not the main group window");
-			LOG_MESSAGE(KLog);
-			}
-		retVal=(reinterpret_cast<CBase*>(iClient->iGroup->PrevSibling())==iChild[3]);
-		TEST(retVal);
-		if (!retVal)
-			{
-			_LIT(KLog,"PrevSibling of main group window is not iChild3");
-			LOG_MESSAGE(KLog);
-			}
-		}
-	else
-		TestWindowOrderPrev(2,3);
-	TestWindowOrderPrev(3,4);
-	TestWindowOrderPrev(4,5);
-	TestWindowOrderPrev(5);
-	}
-
-void CTOrdinal::ConstructL()
-	{
-	iClient=new(ELeave) COrdinalClient();
-	iClient->SetScreenNumber(iTest->iScreenNumber);
-	iClient->ConstructL();
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0446
-
-@SYMCR				CR1164
-
-@SYMTestCaseDesc	Test ClientHandle function returns right value
-
-@SYMTestPriority	High
-
-@SYMTestStatus		Implemented
-
-@SYMTestActions		Call this function on windows at various times
-
-@SYMTestExpectedResults The value set when window was created is returned
-*/
-void CTOrdinal::CreateWindowsL(TInt aMode)
-	{
-	RWindowTreeNode* parent=NULL;
-	RWindowTreeNode* base=iClient->iGroup->WinTreeNode();
-	TInt errors=0;
-
-	if (base->Child()!=0)
-		{
-		_LIT(KErrText,"Main Group Window has children at start of test");
-		LOG_MESSAGE(KErrText);
-		AutoPanic(EAutoPanicGroupWinHasChild);
-		}
-	if (base->ClientHandle()!=reinterpret_cast<TUint32&>(iClient->iGroup))
-		++errors;
-	if (base->Parent()!=0)
-		++errors;
-	TEST(errors==0);
-	if (errors>0)
-		{
-		_LIT(KErrText,"Handles of Main Group Window are not as expected");
-		LOG_MESSAGE2(KErrText,errors);
-		}
-	iGroupTest=EFalse;
-	switch(aMode)
-		{
-		case 3:
-			iParent=COrdinalWindow::NewL(iClient,base,iTest,iStep);
-			parent=iParent->WinTreeNode();
-			CheckHandlesOnNewWindow(iClient->iGroup,iParent);
-			break;
-		case 1:
-			parent=iClient->iGroup->WinTreeNode();
-			break;
-		case 2:
-			iParent=COrdinalWindow::NewL(iClient,base,iTest,iStep);
-			CheckHandlesOnNewWindow(iClient->iGroup,iParent);
-			iParent2=COrdinalWindow::NewL(iClient,iParent->WinTreeNode(),iTest,iStep);
-			CheckHandlesOnNewWindow(iParent,iParent2);
-			iParent3=COrdinalWindow::NewL(iClient,iParent2->WinTreeNode(),iTest,iStep);
-			parent=iParent3->WinTreeNode();
-			CheckHandlesOnNewWindow(iParent2,iParent3);
-			break;
-		case 0:
-			iGroupTest=ETrue;
-			for (TInt child=ENumChildren-1;child>=0;--child)
-				iChild[child]=COrdinalWindowGroup::NewL(iClient,iTest,iStep);
-			CheckHandles(0);
-			return;
-		}
-	for (TInt child=ENumChildren-1;child>=0;--child)
-		{
-		iChild[child]=COrdinalWindow::NewL(iClient,parent,iTest,iStep);
-		if (iChild[child]->Handle()!=parent->Child())
-			++errors;
-		}
-	TEST(errors==0);
-	if (errors>0)
-		{
-		_LIT(KErrText,"%d windows were not the first child");
-		LOG_MESSAGE2(KErrText,errors);
-		}
-	CheckHandles(parent->ClientHandle());
-	}
-
-void CTOrdinal::CheckHandlesOnNewWindow(CTWindowGroup* aParent,COrdinalWindowBase* aWin)
-	{
-	TInt errors=0;
-	if (aParent->WinTreeNode()->Child()!=aWin->Handle())
-		++errors;
-	if (aWin->WinTreeNode()->Parent()!=reinterpret_cast<TUint32&>(aParent))
-		++errors;
-	CheckHandlesOnNewWindow(errors,aWin);
-	}
-
-void CTOrdinal::CheckHandlesOnNewWindow(COrdinalWindowBase* aParent,COrdinalWindowBase* aWin)
-	{
-	TInt errors=0;
-	if (aParent->WinTreeNode()->Child()!=aWin->Handle())
-		++errors;
-	if (aWin->WinTreeNode()->Parent()!=aParent->Handle())
-		++errors;
-	CheckHandlesOnNewWindow(errors,aWin);
-	}
-	
-void CTOrdinal::CheckHandlesOnNewWindow(TInt aErrors,COrdinalWindowBase* aWin)
-	{
-	RWindowTreeNode* win=aWin->WinTreeNode();
-	if (win->ClientHandle()!=aWin->Handle())
-		++aErrors;
-	if (win->PrevSibling()!=0)
-		++aErrors;
-	if (win->NextSibling()!=0)
-		++aErrors;
-	if (win->Child()!=0)
-		++aErrors;
-	TEST(aErrors==0);
-	if (aErrors>0)
-		{
-		_LIT(KErrText,"%d errors in handles of newly created window");
-		LOG_MESSAGE2(KErrText,aErrors);
-		}
-	}
-
-void CTOrdinal::CheckHandles(TUint aParent)
-	{
-	TInt errors=0;
-	TInt child;
-	for (child=0;child<ENumChildren;++child)
-		{
-		if (iChild[child]->WinTreeNode()->ClientHandle()!=iChild[child]->Handle())
-			++errors;
-		}
-	TEST(errors==0);
-	if (errors>0)
-		{
-		_LIT(KErrText,"%d windows gave wrong client handle");
-		LOG_MESSAGE2(KErrText,errors);
-		errors=0;
-		}
-	for (child=0;child<ENumChildren;++child)
-		{
-		if (iChild[child]->WinTreeNode()->Parent()!=aParent)
-			++errors;
-		}
-	TEST(errors==0);
-	if (errors>0)
-		{
-		_LIT(KErrText,"%d children gave wrong parent handle");
-		LOG_MESSAGE2(KErrText,errors);
-		errors=0;
-		}
-	for (child=1;child<ENumChildren;++child)
-		{
-		if (iChild[child-1]->WinTreeNode()->NextSibling()!=iChild[child]->Handle())
-			++errors;
-		}
-	if (iChild[5]->WinTreeNode()->NextSibling()!=0 && !iGroupTest)
-		++errors;
-	TEST(errors==0);
-	if (errors>0)
-		{
-		_LIT(KErrText,"%d windows gave wrong next sibling handle");
-		LOG_MESSAGE2(KErrText,errors);
-		errors=0;
-		}
-	if (iChild[0]->WinTreeNode()->PrevSibling()!=0 && !iGroupTest)
-		++errors;
-	for (child=1;child<ENumChildren;++child)
-		{
-		if (iChild[child]->WinTreeNode()->PrevSibling()!=iChild[child-1]->Handle())
-			++errors;
-		}
-	TEST(errors==0);
-	if (errors>0)
-		{
-		_LIT(KErrText,"%d windows gave wrong prev sibling handle");
-		LOG_MESSAGE2(KErrText,errors);
-		}
-	}
-
-COrdinalClient::COrdinalClient()
-	{
-	}
-
-void COrdinalClient::ConstructL()
-	{
-	User::LeaveIfError(iWs.Connect());
-	// change to correct screen
-	//
-	iScreen = new (ELeave) CWsScreenDevice(iWs);
-	User::LeaveIfError(iScreen->Construct(iScreenNumber));
-		
-	TheClient->iGroup->WinTreeNode()->SetOrdinalPosition(0,-2000000000);
-	TheClient->iWs.Flush();
-	iGroup=new(ELeave) CTWindowGroup(this);
-	iGroup->ConstructL();
-	}
-
-COrdinalClient::~COrdinalClient()
-	{
-	TheClient->iGroup->WinTreeNode()->SetOrdinalPosition(0,0);
-	}
-
-void COrdinalClient::KeyL(const TKeyEvent &,const TTime &)
-	{
-	}
-
-void CTOrdinal::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(KTest1,"Ordinal 1");
-	((CTOrdinalStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(++iTest->iState)
-		{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0217
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test ordinal position and priority changes on windows
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Set different ordinal positions and priorities on a
-					number of windows and check they have been set
-					correctly
-
-@SYMTestExpectedResults The positions and priorities are set correctly
-*/
-		case 1:
-			((CTOrdinalStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0217"));
-			iTest->LogSubTest(KTest1);
-			{
-			for(TInt index=0;index<4;index++)
-				{
-				((CTOrdinalStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0446"));
-				CreateWindowsL(index);
-				((CTOrdinalStep*)iStep)->RecordTestResultL();
-				OrdinalPos();
-				OrdinalPriority();
-				DestroyWindows();
-				}
-			}
-			((CTOrdinalStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0217"));
-			if (!iStep->TestStepResult() == EPass)
-				TEST(EFalse);
-			break;
-		default:
-			((CTOrdinalStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTOrdinalStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-			break;
-		};
-	((CTOrdinalStep*)iStep)->RecordTestResultL();
-	}
-	
-__WS_CONSTRUCT_STEP__(Ordinal)
--- a/windowing/windowserver/tauto/TORDINAL.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +0,0 @@
-
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TORDINAL_H__
-#define __TORDINAL_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-class CTOrdinal;
-
-class COrdinalClient : public CTClient
-	{
-public:
-	COrdinalClient();
-	virtual void KeyL(const TKeyEvent &aKey,const TTime &aTime);
-	virtual void ConstructL();
-	~COrdinalClient();
-	};
-
-class COrdinalWindowBase : public CBase
-	{
-public:
-	COrdinalWindowBase(CTClient *aClient, CTestBase* aTest, CTestStep* aTestStep);
-	~COrdinalWindowBase();
-	TInt OrdinalPosition();
-	void SetOrdinalPosition(TInt aPos);
-	void SetOrdinalPosition(TInt aPos,TInt aPri);
-	virtual void Draw();
-	void TestOP(TInt aTestPos);
-	TInt SetToLastAndGetOP();
-	TInt SetToLastAndGetOPPri(TInt aPri);
-	void SetAndTestOP(TInt aPos);
-	void SetAndTestOP(TInt aPos,TInt aTestPos);
-	void SetAndTestOPPri(TInt aPos,TInt aPri,TInt aTestPos);
-	void SetAndTestOPPri(TInt aPos,TInt aPri);
-	inline COrdinalWindowBase* NextSibling() const;
-	inline COrdinalWindowBase* PrevSibling() const;
-	inline RWindowTreeNode* WinTreeNode();
-	inline TUint32 Handle();
-protected:
-	RWindowTreeNode* iWin;
-private:
-	CTClient* iClient;
-	CTestBase* iTest;
-	CTestStep* iTestStep;
-	};
-
-class COrdinalWindow : public COrdinalWindowBase
-	{
-public:
-	COrdinalWindow(CTClient *aClient, CTestBase* aTest, CTestStep* aTestStep);
-	static COrdinalWindowBase *NewL(CTClient *aClient, RWindowTreeNode *parent, CTestBase* aTest, CTestStep* aTestStep);
-private:
-	RWindow iClientWin;
-	};
-
-class COrdinalWindowGroup : public COrdinalWindowBase
-	{
-public:
-	COrdinalWindowGroup(CTClient *aClient, CTestBase* aTest, CTestStep* aTestStep);
-	static COrdinalWindowBase *NewL(CTClient *aClient, CTestBase* aTest, CTestStep* aTestStep);
-private:
-	RWindowGroup iGroupWin;
-	};
-
-class CTOrdinal : public CTWsGraphicsBase
-	{
-public:
-	CTOrdinal(CTestStep* aStep);
-	~CTOrdinal();
-	void DestroyWindows();
-	void OrdinalPos();
-	void OrdinalPriority();
-	void ConstructL();
-	void CreateWindowsL(TInt aMode);
-protected: //virtual function from CTGraphicsStep
-	void RunTestCaseL(TInt aCurTestCase);
-private:
-	void TestWindowOrderNext(TInt aBefore,TInt aAfter);
-	void TestWindowOrderNext(TInt aLast);
-	void TestWindowOrderPrev(TInt aAfter,TInt aBefore);
-	void TestWindowOrderPrev(TInt aFirst);
-	void CheckHandlesOnNewWindow(CTWindowGroup* aParent,COrdinalWindowBase* aWin);
-	void CheckHandlesOnNewWindow(COrdinalWindowBase* aParent,COrdinalWindowBase* aWin);
-	void CheckHandlesOnNewWindow(TInt aErrors,COrdinalWindowBase* aWin);
-	void CheckHandles(TUint aParent);
-private:
-	enum {ENumChildren=6};
-private:
-	COrdinalClient* iClient;
-	TSize iWinSize;
-	TBool iGroupTest;
-	COrdinalWindowBase* iParent;
-	COrdinalWindowBase* iParent2;
-	COrdinalWindowBase* iParent3;
-	COrdinalWindowBase* iChild[ENumChildren];
-	};
-
-class CTOrdinalStep : public CTGraphicsStep
-	{
-public:
-	CTOrdinalStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTOrdinalStep,"TOrdinal");
-
-
-#endif
--- a/windowing/windowserver/tauto/TPANIC.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2014 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test various cases of Wserv panicing client apps
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TPANIC.H"
-#include "../tlib/testbase.h"
-#include <w32debug.h>
-#define TEST_BITMAP _L("Z:\\WSTEST\\WSAUTOTEST.MBM")
-
-class RWsSessionHacker : public RWsSession
-	{
-public:
-	inline RWsBuffer *WsBuffer() const {return(iBuffer);};
-	inline TInt PanicItSendReceive(TInt aFunction,const TIpcArgs& aArgs) const {return SendReceive(aFunction,aArgs);};
-	inline TInt PanicItSend(TInt aFunction,const TIpcArgs& aArgs) const {return Send(aFunction,aArgs);};
-	inline TInt PanicItSendReceive(TInt aFunction) const {return SendReceive(aFunction);};
-	inline TInt PanicItSend(TInt aFunction) const {return Send(aFunction);};
-	};
-
-class RWsBufferHacker // copy of original data structure to access buffer data
-	{
-public:
-	RWsSession* iSession;
-	CWsGraphic::CManager* iManager;
-	TBool iAutoFlush;
-	TPtr8 iBuf;
-	RWsBuffer* iNext;
-	TInt iPreviousHandle;
-	TInt iBufSize;
-	TInt iMaxBufSize;
-	TInt iDirectAcessCount;
-	RArray<TInt> iBitmapArray;
-	TBool iInvalidBitmapArray;
-	};
-
-CTPanic::CTPanic(CTestStep* aStep):
-	CTWsGraphicsBase(aStep)
-	{
-	}
-	
-CTPanic::~CTPanic()
-	{
-	}
-
-LOCAL_C TInt DoDeletedParentTest(TInt aInt, TAny *aScreenNumber)
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	// point to correct screen
-	CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws);
-	User::LeaveIfError(screen->Construct((TInt)aScreenNumber));
-	
-	RWindowGroup group(ws);
-	User::LeaveIfError(group.Construct(888));
-	group.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
-	switch(aInt)
-		{
-		case 1:
-			RWindow win1(ws);
-			User::LeaveIfError(win1.Construct(group,1));
-			RWindow win2(ws);
-			User::LeaveIfError(win2.Construct(win1,2));
-			win1.Close();
-			win2.SetExtent(TPoint(1,2),TSize(3,4));
-			break;
-		}
-	ws.Flush();
-	return(EWsExitReasonBad);
-	}
-
-LOCAL_C void ReuseWindow(RWsSession& aWs,RWindowGroup& aGroup,RWindow aCopyWin,RWindow* aPtrWin)
-	{
-	aPtrWin->Close();
-	RWindow win(aWs);
-	User::LeaveIfError(win.Construct(aGroup,17));
-	aCopyWin.SetExtent(TPoint(1,2),TSize(3,4));	
-	}
-
-LOCAL_C void ReuseGroupWindow(RWsSession& aWs,RWindowGroup aCopyWin,RWindowGroup* aPtrWin)
-	{
-	aPtrWin->Close();
-	RWindowGroup group(aWs);
-	User::LeaveIfError(group.Construct(889));
-	group.EnableReceiptOfFocus(EFalse);	
-	aCopyWin.EnableReceiptOfFocus(EFalse);	
-	}
-
-LOCAL_C void ReuseSprite(RWsSession& aWs,RWindow& aWin,RWsSprite aCopySprite,RWsSprite* aPtrSprite)
-	{
-	aPtrSprite->Close();
-	RWsSprite sprite(aWs);
-	sprite.Construct(aWin,TPoint(0,0),0);
-	aCopySprite.SetPosition(TPoint(22,22));	
-	}
-
-LOCAL_C void ReusePointerCursor(RWsSession& aWs,RWsPointerCursor aCopyCursor,RWsPointerCursor* aPtrCursor)
-	{
-	aPtrCursor->Close();
-	RWsPointerCursor cursor(aWs);
-	cursor.Construct(0);
-	aCopyCursor.Activate();	
-	}
-
-LOCAL_C TInt DoHandleReUse(TInt aInt, TAny *aScreenNumber)
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	CWsScreenDevice *scrdev=new(ELeave) CWsScreenDevice(ws);
-	scrdev->Construct((TInt)aScreenNumber);
-	RWindowGroup group(ws);
-	User::LeaveIfError(group.Construct(888));
-	group.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
-	RWindow win(ws);
-	User::LeaveIfError(win.Construct(group,1));
-	switch(aInt)
-		{
-		case 2:			//WS_HANDLE_WINDOW
-			ReuseWindow(ws,group,win,&win);
-			break;
-		case 3:			//WS_HANDLE_GROUP_WINDOW
-			ReuseGroupWindow(ws,group,&group);
-			break;
-		case 4:			//WS_HANDLE_SPRITE
-			{
-			RWsSprite sprite(ws);
-			sprite.Construct(win,TPoint(0,0),0);
-			ReuseSprite(ws,win,sprite,&sprite);
-			}
-			break;
-		case 5:			//WS_HANDLE_POINTER_CURSOR
-			{
-			RWsPointerCursor cursor(ws);
-			cursor.Construct(0);
-			ReusePointerCursor(ws,cursor,&cursor);
-			}
-			break;
-		}
-	ws.Flush();
-	return(EWsExitReasonBad);
-	}
-
-LOCAL_C TInt DoScreenDevicePanicTest(TInt aInt, TAny *aScreenNumber)
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-
-	CWsScreenDevice *scrdev=new(ELeave) CWsScreenDevice(ws);
-	User::LeaveIfError(scrdev->Construct((TInt)aScreenNumber));
-	
-	RWindowGroup group(ws);
-	User::LeaveIfError(group.Construct(888));
-	group.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
-	RWindow win(ws);
-	User::LeaveIfError(win.Construct(group, 1));
-	win.Activate();
-	CFbsBitmap *bitmap=new(ELeave) CFbsBitmap;
- 	switch(aInt)
-		{
-		case 1:
-			scrdev->CopyScreenToBitmap(bitmap);
-			break;
-		case 2:
-			scrdev->CopyScreenToBitmap(bitmap,TRect(0,0,10,10));
-			break;
-		default:
-			return(EWsExitReasonFinished);
-		}
-	ws.Flush();
-	return(EWsExitReasonBad);
-	}
-
-LOCAL_C TInt DoOpcodeTests(TInt aInt, TAny *aScreenNumber)
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-
-	CWsScreenDevice *scrdev=new(ELeave) CWsScreenDevice(ws);
-	User::LeaveIfError(scrdev->Construct((TInt)aScreenNumber));
-	
-	RWindowGroup group(ws);
-	User::LeaveIfError(group.Construct(888));
-	group.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
-	RWindow win(ws);
-	User::LeaveIfError(win.Construct(group, 1));
-	win.Activate();
-	CWindowGc *gc;
-	scrdev->CreateContext(gc);
- 	switch(aInt)
-		{
-		case 1:
-			ws.TestWrite(ws.WsHandle(),9999,NULL,0);
-			break;
-		case 2:
-			gc->Activate(win);
-			win.BeginRedraw();
-			ws.TestWrite(gc->WsHandle(),9999,NULL,0);
-			/* This only panics if the command is processed immediately.  If it goes into the redraw
-			store then it will be unable to panic the client untill an additional buffer has been received,
-			hence the double flush.
-			*/
-			win.EndRedraw();
-			ws.Finish();
-			win.BeginRedraw();
-			win.EndRedraw();
-			break;
-		case 3:
-			ws.TestWrite(scrdev->WsHandle(),9999,NULL,0);
-			break;
-		case 4:
-			{
-			CWsBitmap *bitmap=new(ELeave) CWsBitmap(ws);
-			bitmap->Create(TSize(10,10),EGray4);
-			ws.TestWrite(bitmap->WsHandle(),9999,NULL,0);
-			}
-			break;
-		case 5:
-			ws.TestWrite(win.WsHandle(),9999,NULL,0);
-			break;
-		case 6:
-			ws.TestWrite(group.WsHandle(),9999,NULL,0);
-			break;
-		case 7:
-			{
-			RWsSprite sprite(ws);
-			sprite.Construct(win,TPoint(0,0),0);
-			ws.TestWrite(sprite.WsHandle(),9999,NULL,0);
-			}
-			break;
-		default:
-			return(EWsExitReasonFinished);
-		}
-	ws.Flush();
-	return(EWsExitReasonBad);
-	}
-
-TInt DoGraphicsPanicTest(RWsSession& aWs, RWindow& aRWin, RDrawableWindow* aDrawWin, CWindowGc* aGc, CFbsFont* aFont, TInt aTest, TInt aSubTest, TBool aInRedraw, TBool aNeedsValidating)
-	{
-	if (aInRedraw || aNeedsValidating)
-		{
-		aRWin.BeginRedraw();
-		if (!aInRedraw)
-			{ // TransWin without redraw active needs the begin/end to make the redraw store active
-			aRWin.EndRedraw(); // or else all graphics will simply be ignored and no panics will occur
-			}
-		}
-	aWs.Flush();
-	TRect rect01(0,0,1,1);
-	TPoint point00;
-	switch(aTest)
-		{
-	case 1:
-		aGc->UseFont(aFont);
-		switch(aSubTest)
-			{
-		case 0:
-			{
-			TWsGcCmdBoxText boxText(rect01,0,CGraphicsContext::ELeft,0,0x800000,1);
-			aWs.TestWrite(aGc->WsHandle(),EWsGcOpDrawBoxText,&boxText,sizeof(boxText));
-			}
-			break;
-		case 1:
-			{
-			TWsGcCmdDrawText dt(point00,600);
-			aWs.TestWrite(aGc->WsHandle(),EWsGcOpDrawText,&dt,sizeof(dt));
-			}
-			break;
-		case 2:
-			{
-			TWsGcCmdBoxTextOptimised1 dt(rect01,0,600);
-			aWs.TestWrite(aGc->WsHandle(),EWsGcOpDrawBoxTextOptimised1,&dt,sizeof(dt));
-			}
-			break;
-		case 3:
-			{
-			TWsGcCmdDrawTextVertical dt(point00,600,EFalse);
-			aWs.TestWrite(aGc->WsHandle(),EWsGcOpDrawTextVertical,&dt,sizeof(dt));
-			}
-			break;
-		case 4:
-			{
-			TWsGcCmdBoxTextVertical dt(rect01);
-			dt.length=600;
-			aWs.TestWrite(aGc->WsHandle(),EWsGcOpDrawBoxTextVertical,&dt,sizeof(dt));
-			}
-			break;
-		case 5:
-			return(EWsExitReasonFinished);
-			}
-		break;
-	case 2:
-		{
-		TInt opcode=0;
-		switch(aSubTest)
-			{
-		case 0:
-			opcode=EWsGcOpGdiBlt2;
-			break;
-		case 1:
-			opcode=EWsGcOpGdiWsBlt2;
-			break;
-		case 2:
-			return(EWsExitReasonFinished);
-			}
-		TWsGcCmdGdiBlt2 gdiBlit(point00,0xBADBAD);
-		aWs.TestWrite(aGc->WsHandle(),opcode,&gdiBlit,sizeof(gdiBlit));
-		if (aInRedraw)
-			{ // Adding two bad bitmaps to redraw store fbs store causes leave as NULL handles of failed bitmaps clash
-			gdiBlit.handle=0xBADBAD2;
-			aWs.TestWrite(aGc->WsHandle(),opcode,&gdiBlit,sizeof(gdiBlit));
-			}
-		}
-		break;
-	case 3:
-		{
-		const TInt KNumBadBmpModes=3;
-		const TInt KNumTestsPerOpcode=KNumBadBmpModes*2;
-		enum {KPanicIndexMasked,KPanicIndexDraw,KPanicIndexAlphaBlend,KPanicIndexMax};
-		TInt opcodeMode=aSubTest/KNumTestsPerOpcode;
-		TInt bmpMode=aSubTest%KNumTestsPerOpcode;
-		TInt bmp1=0xBADBAD;
-		TInt bmp2=0xBADBAD;
-		TInt goodBmp;
-		TInt opcodeBlt;
-		TInt opcodeDraw;
-		if (bmpMode<KNumBadBmpModes)
-			{	// These two use a CFbsBitmap
-			CFbsBitmap* goodBitmap=new(ELeave) CFbsBitmap;
-			goodBitmap->Create(TSize(10,10),EGray4);
-			goodBmp=goodBitmap->Handle();
-			opcodeBlt=EWsGcOpGdiBltMasked;
-			opcodeDraw=EWsGcOpDrawBitmapMasked;
-			}
-		else
-			{	// These two use a CWsBitmap
-			CWsBitmap* goodBitmap=new(ELeave) CWsBitmap(aWs);
-			goodBitmap->Create(TSize(10,10),EGray4);
-			goodBmp=goodBitmap->WsHandle();
-			opcodeBlt=EWsGcOpGdiWsBltMasked;
-			opcodeDraw=EWsGcOpWsDrawBitmapMasked;
-			}
-		switch(bmpMode%KNumBadBmpModes)
-			{
-		case 0:
-			bmp2=goodBmp;
-			break;
-		case 1:
-			bmp1=goodBmp;
-			break;
-		case 2:	// Leave them both bad
-			break;
-			}
-		switch(opcodeMode)
-			{
-		case KPanicIndexMasked:
-			{
-			TWsGcCmdBltMasked gdiBlitMasked(point00,bmp1,rect01,bmp2,EFalse);
-			aWs.TestWrite(aGc->WsHandle(),opcodeBlt,&gdiBlitMasked,sizeof(gdiBlitMasked));
-			}
-			break;
-		case KPanicIndexDraw:
-			{
-			TWsGcCmdDrawBitmapMasked maskedBitmap(rect01,bmp1,rect01,bmp2,EFalse);
-			aWs.TestWrite(aGc->WsHandle(),opcodeDraw,&maskedBitmap,sizeof(maskedBitmap));
-			}
-			break;
-		case KPanicIndexAlphaBlend:
-			{
-			TWsGcCmdAlphaBlendBitmaps alphaBlend(point00,bmp1,rect01,bmp2,point00);
-			aWs.TestWrite(aGc->WsHandle(),EWsGcOpGdiAlphaBlendBitmaps,&alphaBlend,sizeof(alphaBlend));
-			}
-			break;
-		case KPanicIndexMax:
-			return(EWsExitReasonFinished);
-			}
-		}
-		break;
-	case 4:
-		switch(aSubTest)
-			{
-		case 0:
-			{
-			TWsClCmdCreateBitmap createBitmap;
-			createBitmap.handle=0xB0D;
-			aWs.TestWrite(aWs.WsHandle(),EWsClOpCreateBitmap,&createBitmap,sizeof(createBitmap));
-			}
-			break;
-		case 1:
-			{
-			TInt badBrush=0xBADB3054;
-			aWs.TestWrite(aGc->WsHandle(),EWsGcOpUseBrushPattern,&badBrush,sizeof(badBrush));
-			}
-			break;
-		case 2:
-			{
-			TWsGcCmdDrawBitmap drawBitmap(point00,0xBADBAD);
-			aWs.TestWrite(aGc->WsHandle(),EWsGcOpDrawBitmap,&drawBitmap,sizeof(drawBitmap));
-			}
-			break;
-		case 3:
-			return(EWsExitReasonFinished);
-			}
-		break;
-	case 5:
-		// test bad opcodes
-		{
-		TInt opcode=0;
-		switch(aSubTest)
-			{
-		case 0:
-			opcode=9999;
-			break;
-		case 1:
-			return(EWsExitReasonFinished);
-			}
-		aWs.TestWrite(aGc->WsHandle(),opcode,NULL,0);
-		}
-		break;
-	case 6:
-		{// Test EWsGcOpDrawPolygon with invalid parameters
-		 // First two times has slightly more points specified than exist in the data
-		 // Third time time has a massive number of points in the header
-		const TInt KNumTestsPerPolyMode=3;
-		enum TPanicPolyMode {EPanicPolyModePolygon,EPanicPolyModePolyLine,EPanicPolyModeEnd};
-		TInt polyMode=aSubTest/KNumTestsPerPolyMode;
-		if (polyMode==EPanicPolyModeEnd)
-			return(EWsExitReasonFinished);
-		TInt subMode=aSubTest%KNumTestsPerPolyMode;
-		TInt bufPoints=0;
-		TInt headerPoints=1;
-		switch(subMode)
-			{
-		case 0:
-			break;
-		case 1:
-			bufPoints=2;
-			headerPoints=8;
-			break;
-		case 2:
-			bufPoints=2;
-			headerPoints=999999;
-			break;
-			}
-		TInt bufDataLen=bufPoints*sizeof(TPoint);
-		if (polyMode==EPanicPolyModePolyLine)
-			bufDataLen+=sizeof(TWsGcCmdDrawPolyLine);
-		else
-			bufDataLen+=sizeof(TWsGcCmdDrawPolygon);
-		TAny* bufData=User::AllocL(bufDataLen);
-		TPoint* pointPtr;
-		TInt opcode;
-		if (polyMode==EPanicPolyModePolyLine)
-			{
-			TWsGcCmdDrawPolyLine* drawPolyline=static_cast<TWsGcCmdDrawPolyLine*>(bufData);
-			drawPolyline->numPoints=headerPoints;
-			drawPolyline->more=EFalse;
-			drawPolyline->last=point00;
-			pointPtr=reinterpret_cast<TPoint*>(drawPolyline+1);
-			opcode=EWsGcOpDrawPolyLine;
-			}
-		else
-			{
-			TWsGcCmdDrawPolygon* drawPolygon=static_cast<TWsGcCmdDrawPolygon*>(bufData);
-			drawPolygon->numPoints=headerPoints;
-			drawPolygon->fillRule=CGraphicsContext::EAlternate;
-			pointPtr=reinterpret_cast<TPoint*>(drawPolygon+1);
-			opcode=EWsGcOpDrawPolygon;
-			}
-		const TPoint* endPtr=pointPtr+bufPoints;
-		TInt pointPos=0;
-		while(pointPtr<endPtr)
-			*pointPtr++=TPoint(pointPos,pointPos);
-		aWs.TestWrite(aGc->WsHandle(),opcode,bufData,bufDataLen);
-		aWs.Flush();	// Needs flush to make sure EndRedraw() doesn't make buffer bigger and catch out buf len check
-		}
-		break;
-	case 7:
-		{
-		// first sets the index to match the total count
-		// second sets the index negative
-		// fourth sends too much data
-		TWsGcCmdStartSegmentedDrawPolygon startPoly;
-		startPoly.totalNumPoints=8;
-		aWs.TestWrite(aGc->WsHandle(),EWsGcOpStartSegmentedDrawPolygon,&startPoly,sizeof(startPoly));
-		TInt bufDataLen=sizeof(TWsGcCmdSegmentedDrawPolygonData)+startPoly.totalNumPoints*sizeof(TPoint);
-		TAny* bufData=User::AllocL(bufDataLen);
-		TWsGcCmdSegmentedDrawPolygonData* polyData=static_cast<TWsGcCmdSegmentedDrawPolygonData*>(bufData);
-		polyData->numPoints=1;
-		polyData->index=0;
-		switch(aSubTest)
-			{
-		case 0:
-			polyData->index=startPoly.totalNumPoints;
-			break;
-		case 1:
-			polyData->index=-123;
-			break;
-		case 2:
-			polyData->numPoints=startPoly.totalNumPoints+1;
-			break;
-		case 3:
-			return(EWsExitReasonFinished);
-			}
-		aWs.TestWrite(aGc->WsHandle(),EWsGcOpSegmentedDrawPolygonData,polyData,bufDataLen);
-		TWsGcCmdDrawSegmentedPolygon drawit;
-		drawit.fillRule=CGraphicsContext::EAlternate;
-		aWs.TestWrite(aGc->WsHandle(),EWsGcOpDrawSegmentedPolygon,&drawit,sizeof(drawit));
-		}
-		break;
-	case 8:
-		{
-		if (aSubTest==1)
-			return(EWsExitReasonFinished);
-		// This is a test designed to specificially test polylines still work after the previous
-		// polyline/polygon tests. One potential defect is they leave the common redraw store gc
-		// in a bad state still holding part of the poly data and causing a EWservPanicBadPolyData
-		// panic.
-		// This test is designed to make sure the drawpolyline call works ok and we reach the bad
-		// opcode panic instead.
-		TWsGcCmdStartSegmentedDrawPolygon startPoly;
-		startPoly.totalNumPoints=2;
-		aWs.TestWrite(aGc->WsHandle(),EWsGcOpStartSegmentedDrawPolygon,&startPoly,sizeof(startPoly));
-		struct
-			{
-			TWsGcCmdSegmentedDrawPolygonData iPolyData;
-			TPoint iPoints[2];
-			} polyParams;
-		polyParams.iPoints[0].iX=1;
-		polyParams.iPoints[0].iY=1;
-		polyParams.iPoints[1].iX=2;
-		polyParams.iPoints[1].iY=2;
-			
-		polyParams.iPolyData.numPoints=2;
-		polyParams.iPolyData.index=0;
-		aWs.TestWrite(aGc->WsHandle(),EWsGcOpSegmentedDrawPolygonData,&polyParams.iPolyData,sizeof(polyParams));
-		TWsGcCmdDrawSegmentedPolygon drawit;
-		drawit.fillRule=CGraphicsContext::EAlternate;
-		aWs.TestWrite(aGc->WsHandle(),EWsGcOpDrawSegmentedPolygon,&drawit,sizeof(drawit));
-		aWs.TestWrite(aGc->WsHandle(),9999,NULL,0);
-		}
-		break;
-	case 9:
-		if (aSubTest==1)
-			return(EWsExitReasonFinished);
-		aGc->Activate(*aDrawWin);	// Double activate
-		break;
-	case 10:
-		if (aSubTest==1)
-			return(EWsExitReasonFinished);
-		aGc->DrawText(_L("No font"),point00);
-		break;
-	case 11:
-		if (aSubTest==1)
-			return(EWsExitReasonFinished);
-		aGc->SetBrushStyle(CGraphicsContext::EPatternedBrush);
-		aGc->DrawRect(rect01);
-		break;
-	case 12:
-		{
-		if (aSubTest==1)
-			return(EWsExitReasonFinished);
-		aGc->UseFont(aFont);
-		TPtrC bigAndbad(NULL,5000);	// Will go through remote descriptor fetching code
-		aGc->DrawText(bigAndbad,point00);
-		}
-		break;
-	case 13:
-		{
-		if (aSubTest==1)
-			return(EWsExitReasonFinished);
-		TInt badHandle=0xDEADBAD;
-		aWs.TestWrite(aGc->WsHandle(),EWsGcOpUseFont,&badHandle,sizeof(badHandle));
-		aGc->DrawText(_L("BOO!"),point00);
-		}
-		break;
-		}
-	if (aInRedraw)
-		aRWin.EndRedraw();
-	aWs.Finish();
-	return(EWsExitReasonBad);
-	}
-
-LOCAL_C TInt GraphicsPanicTest(TInt aInt, TAny* aPanicParams)
-	{
-	CTPanic::TPanicParams* panicParams=static_cast<CTPanic::TPanicParams*>(aPanicParams);
-	/*
-	 * Drawing to a transparent window goes via the redraw store. In this
-	 * situation parameters do not get checked during the original processing
-	 * of the incoming graphics commands. They are only caught later when 
-	 * playing back from the redraw store.
-	 */
-	const TBool useTransWin = panicParams->iRedrawMode==EPanicRedrawModeTransRedraw;
-	/*
-	 * We always do redraw drawing unless we are using a BackedUpWindow.
-	 * Redraws can affect the way graphics commands are pre-processed, 
-	 * as with transparent windows they can also cause commands to get
-	 * buffered in the redraw store and played back later.
-	 */
-	const TBool inRedraw =
-		panicParams->iRedrawMode==EPanicRedrawModeNormalRedraw ||
-		panicParams->iRedrawMode==EPanicRedrawModeTransRedraw ||
-		panicParams->iRedrawMode==EPanicRedrawModeInvisRedraw;
-	/*
-	 * Drawing to an invisible window skips some of the code where errors
-	 * are caught. Particularly text drawing commands that skip the actual
-	 * drawing, but still process the update of the justification, this
-	 * has the potential of missing parameter checks made during the actual
-	 * drawing, but being caught out when processing the justification update.
-	 */
-	const TBool invisWin = panicParams->iRedrawMode==EPanicRedrawModeInvisRedraw;
-	
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-
-	CWsScreenDevice* scrdev=new(ELeave) CWsScreenDevice(ws);
-	User::LeaveIfError(scrdev->Construct(panicParams->iScreen));
-	
-	RWindowGroup group(ws);
-	User::LeaveIfError(group.Construct(888));
-	group.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
-	RDrawableWindow* drawWin;
-	RWindow rwin(ws);
-	RBackedUpWindow bwin(ws);
-	TBool needsValidating=EFalse;
-	if (useTransWin || inRedraw || invisWin)
-		{
-		drawWin=&rwin;
-		needsValidating=ETrue;
-		User::LeaveIfError(rwin.Construct(group,1));
-		if (useTransWin)
-			{
-			rwin.SetTransparencyAlphaChannel();
-			}
-		}
-	else
-		{
-		// EPanicRedrawModeBackedUpWindow case
-		drawWin=&bwin;
-		User::LeaveIfError(bwin.Construct(group, EGray4, 1));
-		}
-	const TSize testWinSize(100,100);
-	User::LeaveIfError(drawWin->SetSizeErr(testWinSize));
-	if (invisWin)
-		drawWin->SetPosition(TPoint(-testWinSize.iWidth,-testWinSize.iHeight));
-	drawWin->Activate();
-	CWindowGc* gc;
-	scrdev->CreateContext(gc);
-	gc->Activate(*drawWin);
-	CFbsFont* font;
-	User::LeaveIfError(scrdev->GetNearestFontToDesignHeightInTwips((CFont*&)font,TFontSpec()));
-	TInt ret=DoGraphicsPanicTest(ws,rwin,drawWin,gc,font,aInt,panicParams->iSubTest,inRedraw,needsValidating);
-	if (ret!=EWsExitReasonFinished && invisWin)
-		{
-		/*
-		 * Some functions are totally skipped on invisible windows, parameter
-		 * errors will be harmlessly ignored in these case. To make the test
-		 * pass we re-do the tests with the window now visible. The purpose
-		 * of the invisible draw tests was not to check the client is always
-		 * panicked doing illegal draws to invisible windows, but to make sure
-		 * they had no harmful side effects.
-		 */
-		drawWin->SetPosition(TPoint(0,0));
-		gc->Reset();
-		ret=DoGraphicsPanicTest(ws,rwin,drawWin,gc,font,aInt,panicParams->iSubTest,inRedraw,needsValidating);
-		}
-	return(ret);
-	}
-LOCAL_C TInt DoMiscPanicTest(TInt aSubTest, TAny* )
-	{
-	const TInt KNumPanicFuncsPerMode=EWsClOpLastEnumValue;
-	const TInt KNumPanicFuncModes=6;
-	const TInt KNumPanicSendTests=KNumPanicFuncsPerMode*KNumPanicFuncModes;
-	const TInt KNumRandGarbageTests=500;
-	if (aSubTest==(KNumPanicSendTests+KNumRandGarbageTests))
-		return(EWsExitReasonFinished);
-	RWsSessionHacker wshacker;
-	User::LeaveIfError(wshacker.Connect());
-	if (aSubTest<KNumPanicSendTests)
-		{
-		TInt messageMode=aSubTest/KNumPanicFuncsPerMode;
-		TInt msgFunc=aSubTest%KNumPanicFuncsPerMode;
-		const TInt EPanicWservMessAsynchronousService=0x010000; //copy of EWservMessAsynchronousService
-		const TInt EPanicWservMessAnimDllAsyncCommand=0x100000; //copy of EWservMessAnimDllAsyncCommand
-		switch(messageMode%3)
-			{
-		case 0:
-			if(msgFunc == EWservMessFinish) //RWsSession::Finish() doesn't panic
-				User::Panic(KWSERV, 0); //simulate a "successful" wserv panic to skip the sub test
-			break;
-		case 1:
-			msgFunc|=EPanicWservMessAsynchronousService;
-			break;
-		case 2:
-			msgFunc|=EPanicWservMessAnimDllAsyncCommand;
-			break;
-			}
-		TInt sendItErr=KErrNone;
-		if (messageMode<3)
-			{
-			if (msgFunc&EPanicWservMessAsynchronousService)
-				{
-				wshacker.PanicItSend(msgFunc);
-				// Async request, probably won't panic, we just want to make sure nothing crashes 'orribly
-				// So do it again without the async bit and let normal handling cause the panic
-				msgFunc&=~EPanicWservMessAsynchronousService;
-				}
-			sendItErr=wshacker.PanicItSendReceive(msgFunc);
-			}
-		else
-			{
-			TPtrC8 badDesc(reinterpret_cast<const TUint8*>(0xDEAD),100);
-			TIpcArgs ipcArgs;
-			ipcArgs.Set(0,&badDesc);
-			if (msgFunc&EPanicWservMessAsynchronousService)
-				{
-				sendItErr=wshacker.PanicItSend(msgFunc,ipcArgs);
-				msgFunc&=~EPanicWservMessAsynchronousService;
-				}
-			sendItErr=wshacker.PanicItSendReceive(msgFunc,ipcArgs);
-			}
-		if (sendItErr==KErrNotSupported)
-			wshacker.PanicItSendReceive(EWservMessCommandBuffer); // Should always panic
-		}
-	else
-		{
-	// Fill Wserv buffer with random garbage
-		RWsBufferHacker* hacker=reinterpret_cast<RWsBufferHacker*>(wshacker.WsBuffer());
-		TInt64 seed=aSubTest;
-		TInt retries=0;
-		const TInt KMaxRandPanicRetrys=1000;
-		do
-			{
-			const TInt maxLen=hacker->iBuf.MaxLength()-1;
-			TInt writeLen=1+Math::Rand(seed)%maxLen;
-			while(writeLen--)
-				{
-				TUint8 randData=static_cast<TUint8>(Math::Rand(seed));
-				hacker->iBuf.Append(randData);
-				}
-			wshacker.Flush();
-			retries++;
-			} while(retries<KMaxRandPanicRetrys);
-		}
-	return(EWsExitReasonBad);
-	}
-
-LOCAL_C TInt DoCMPanicTest(TInt aInt, TAny *aScreenNumber)
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	// use correct screen
-	//
-	CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws);
-	User::LeaveIfError(screen->Construct((TInt)aScreenNumber));
-
-	switch(aInt)
-		{
-		case 1:
-			ws.ComputeMode((RWsSession::TComputeMode)543);
-			break;
-		}
-	ws.Flush();
-	return(EWsExitReasonBad);
-	}
-
-#if defined(_DEBUG) && defined(__WINS__)
-LOCAL_C TInt DoCKPanicTest(TInt aInt, TAny *aScreenNumber)
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	// use correct screen
-	//
-	CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws);
-	User::LeaveIfError(screen->Construct((TInt)aScreenNumber));
-
-	RWindowGroup group(ws);
-	group.Construct(888);
-	group.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
-	switch(aInt)
-		{
-		case 1:
-			group.CancelCaptureKey(345);
-			break;
-		}
-	ws.Flush();
-	return(EWsExitReasonBad);
-	}
-#endif
-
-LOCAL_C TInt DoEventPanicTest(TInt aInt, TAny *aScreenNumber)
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	// use correct screen
-	//
-	CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws);
-	User::LeaveIfError(screen->Construct((TInt)aScreenNumber));
-
-
-	switch(aInt)
-		{
-		case 1:
-			TRequestStatus stat;
-			ws.EventReady(&stat);
-			ws.EventReady(&stat);
-			User::After(15000000);		//15secs
-			break;
-		}
-	ws.Flush();
-	return(EWsExitReasonBad);
-	}
-
-LOCAL_C TInt DoTBufPtrTests(TInt aInt, TAny *aScreenNumber)
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	// use correct screen
-	//
-	CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws);
-	User::LeaveIfError(screen->Construct((TInt)aScreenNumber));
-	
-	switch(aInt)
-		{
-		case 1:
-			{
-			TWsClCmdLoadAnimDll dt;
-			dt.length=600;
-			ws.TestWrite(ws.WsHandle(),EWsClOpCreateAnimDll,&dt,sizeof(dt));
-			}
-			break;
-		case 2:
-			{
-			TInt len=600;
-			ws.TestWrite(ws.WsHandle(),EWsClOpLogMessage,&len,sizeof(len));
-			}
-			break;
-		case 3:
-			{
-			RWindowGroup group(ws);
-			group.Construct(888);
-			group.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
-			TWsWinCmdSetName dt;
-			dt.length=600;
-			dt.ptr=NULL;
-			ws.TestWrite(group.WsHandle(),EWsWinOpSetName,&dt,sizeof(dt));
-			}
-			break;
-		case 4:
-			{
-			RWindowGroup group(ws);
-			group.Construct(888);
-			group.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
-			TWsWinCmdSetName dt;
-			dt.length=600;
-			dt.ptr=(TDesC *)0x1234;
-			ws.TestWrite(group.WsHandle(),EWsWinOpSetName,&dt,sizeof(dt));
-			}
-			break;
-		}
-	ws.Flush();
-	return(EWsExitReasonBad);
-	}
-
-#if defined(_DEBUG) && defined(__WINS__)		
-LOCAL_C TInt DoMismatchedCancelCaptureTest(TInt aInt, TAny *aScreenNumber)
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	// use correct screen		
-	CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws);
-	User::LeaveIfError(screen->Construct((TInt)aScreenNumber));
-	RWindowGroup group(ws);
-	User::LeaveIfError(group.Construct(888));
-	group.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
-	RWindow win(ws);
-	User::LeaveIfError(win.Construct(group, 1));
-	win.Activate();
-	TInt capture;
-	
-	switch (aInt)
-		{
-		case CTPanic::ECancelCaptureKey:
-			// Create a capture that is not matched to CancelCaptureKey()
-			capture = group.CaptureLongKey(' ','a',0,0,2,ELongCaptureNormal);
-			ws.Flush();
-			group.CancelCaptureKey(capture);
-			break;
-		case CTPanic::ECancelCaptureKeyUpAndDowns:
-			// Create a capture that is not matched to CancelCaptureKeyUpAndDowns()
-			capture = group.CaptureKey('A',0,0);
-			ws.Flush();
-			group.CancelCaptureKeyUpAndDowns(capture);
-			break;
-		case CTPanic::ECancelCaptureLongKey:
-			// Create a capture that is not matched to CancelCaptureLongKey()
-			capture = group.CaptureKeyUpAndDowns(EStdKeySpace,0,0);
-			ws.Flush();
-			group.CancelCaptureLongKey(capture);
-			break;
-		}
-	
-	ws.Flush();
-	return(EWsExitReasonBad);
-	}
-#endif // _DEBUG
-
-class ROverrideProtectionInRSessionBase : public RWsSession
-	{
-public:
-	inline TInt SendReceive(TInt aFunction,TAny *aPtr) const {return(RSessionBase::SendReceive(aFunction,TIpcArgs(aPtr)));};
-	};
-
-LOCAL_C TInt DoMultiInitPanicTest(TInt , TAny *aScreenNumber)
-	{
-	ROverrideProtectionInRSessionBase ws;
-	User::LeaveIfError(ws.Connect());
-	
-	// use correct screen
-	//
-	CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws);
-	User::LeaveIfError(screen->Construct((TInt)aScreenNumber));
-	
-	RWindowGroup group(ws);
-	group.Construct(888);
-	group.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
-	ws.Flush();
-	ws.SendReceive(EWservMessInit,NULL);
-	
-	return(EWsExitReasonBad);
-	}
-	
-LOCAL_C TInt DoSpritePanicTestL(TInt aTest, TAny *aScreenNumber)
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	// use correct screen
-	//
-	CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws);
-	User::LeaveIfError(screen->Construct((TInt)aScreenNumber));
-	
-	RWindowGroup group(ws);
-	User::LeaveIfError(group.Construct(889));
-	group.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
-	RBlankWindow win(ws);
-	User::LeaveIfError(win.Construct(group,898));
-	RWsPointerCursor* cursor=(RWsPointerCursor*)&win;
-	switch (aTest)
-		{
-	case 1:
-		win.SetCustomPointerCursor(*cursor);
-		break;
-	case 2:
-		ws.SetSystemPointerCursor(*cursor,0);
-		break;
-	case 3:
-		{
-		RAnimDll animDll=RAnimDll(ws);
-		User::LeaveIfError(animDll.Load(KAnimDLLName));
-		RTestAnim anim=RTestAnim(animDll);
-		RWsSprite* sprite=(RWsSprite*)&win;
-		User::LeaveIfError(anim.Construct(*sprite,EAnimTypeSprite,TPtrC8()));
-		}
-		break;
-	case 4:
-		{
-		CFbsBitmap* bitmap=new(ELeave) CFbsBitmap;
-		CleanupStack::PushL(bitmap);
-		User::LeaveIfError(bitmap->Load(TEST_BITMAP_NAME,0));
-		win.SetExtent(TPoint(),TSize(150,250));
-		win.SetVisible(ETrue);
-		win.Activate();
-		RWsSprite sprite(ws);
-		User::LeaveIfError(sprite.Construct(win,TPoint(),0));
-		TSpriteMember member;
-		member.iMaskBitmap=NULL;
-		member.iInvertMask=EFalse;
-		member.iDrawMode=CGraphicsContext::EDrawModePEN;
-		member.iOffset=TPoint();
-		member.iInterval=TTimeIntervalMicroSeconds32(0);
-		member.iBitmap=bitmap;
-		User::LeaveIfError(sprite.AppendMember(member));
-		User::LeaveIfError(sprite.Activate());
-		User::After(1000000); //1 sec
-		User::LeaveIfError(bitmap->Resize(bitmap->SizeInPixels() + TSize(200,200)));
-		User::After(1000000); //1 sec
-		CleanupStack::Pop(bitmap);
-		break;
-		}
-		}
-	ws.Flush();
-	return(EWsExitReasonBad);
-	}
-
-#ifdef __WINS__
-LOCAL_C TInt DoDoubleConstructionTestL(TInt aTest, TAny *aScreenNumber)
-	{		
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	
-	// use correct screen
-	//
-	CWsScreenDevice* screen = new(ELeave) CWsScreenDevice(ws);
-	User::LeaveIfError(screen->Construct((TInt)aScreenNumber));
-	
-	RWindowGroup group(ws);
-	User::LeaveIfError(group.Construct(890, EFalse));
-	RBlankWindow bwin(ws);
-	User::LeaveIfError(bwin.Construct(group,900));
-	
-	switch (aTest)
-		{
-	case 1:
-		{
-		RWsSprite sprite = RWsSprite(ws);
-		User::LeaveIfError(sprite.Construct(bwin,TPoint(),0));
-		sprite.Construct(bwin,TPoint(),0); //should panic
-		sprite.Close();
-		}
-		break;
-	case 2:
-		{
-		RWsPointerCursor cursor(ws);
-		User::LeaveIfError(cursor.Construct(0));
-		cursor.Construct(0); //should panic
-		cursor.Close();
-		}
-		break;
-	case 3:
-		{
-		RSoundPlugIn click(ws);
-		User::LeaveIfError(click.Construct());
-		click.Construct(); //should panic
-		click.Close();
-		}
-		break;
-	case 4:
-		{
-		RWindowGroup windowgroup(ws);
-		User::LeaveIfError(windowgroup.Construct(901));
-		windowgroup.Construct(902); //should panic
-		windowgroup.Close();
-		}
-		break;
-	case 5:
-		{
-		RWindow win(ws);
-		User::LeaveIfError(win.Construct(group,902));
-		win.Construct(group,903); //should panic
-		win.Close(); 
-		}
-		break;
-	case 6:
-		{
-		RBlankWindow win(ws);
-		User::LeaveIfError(win.Construct(group,902));
-		win.Construct(group,903); //should panic
-		win.Close(); 
-		}
-		break;
-	case 7:
-		{
-		RBackedUpWindow win(ws);
-		User::LeaveIfError(win.Construct(group,EGray4,902));
-		win.Construct(group,EGray4,903); //should panic
-		win.Close(); 
-		}
-		break;
-	case 8:
-		{
-		RAnimDll animDll=RAnimDll(ws);
-		User::LeaveIfError(animDll.Load(KAnimDLLName));
-		animDll.Load(KAnimDLLName); //should panic
-		animDll.Close();
-		}
-		break;
-	case 9:
-		{
-		CWindowGc *gc = new(ELeave) CWindowGc(screen);
-		User::LeaveIfError(gc->Construct());
-		gc->Construct(); //should panic
-		delete gc;
-		}
-		break;
-	case 10:
-		{
-		CWsScreenDevice* screendevice = new (ELeave) CWsScreenDevice(ws);
-		User::LeaveIfError(screendevice->Construct());
-		screendevice->Construct(); //should panic
-		delete screendevice;
-		}
-		break;
-	default:
-		break;
-		}
-	ws.Flush();
-	return(EWsExitReasonBad);
-	}
-#endif
-
-/** Checks that activating a sprite without members will panic.
-*/
-LOCAL_C TInt DoTestSpriteActivatePanicL(TInt aTest, TAny *aScreenNumber)
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	CWsScreenDevice* screen = new(ELeave) CWsScreenDevice(ws);
-	User::LeaveIfError(screen->Construct((TInt)aScreenNumber));
-	RWindowGroup group(ws);
-	User::LeaveIfError(group.Construct(891, EFalse, screen));
-	RBlankWindow bwin(ws);
-	User::LeaveIfError(bwin.Construct(group,892));
-	
-	switch(aTest)
-		{
-	case 1:
-		{
-		RWsSprite sprite = RWsSprite(ws);
-		User::LeaveIfError(sprite.Construct(group,TPoint(),0));
-		sprite.Activate();	//should panic here
-		sprite.Close();
-		}
-		break;
-	case 2:
-		{
-		RWsSprite sprite = RWsSprite(ws);
-		User::LeaveIfError(sprite.Construct(bwin,TPoint(),0));
-		sprite.Activate();	//should panic here
-		sprite.Close();
-		}
-		break;
-		}
-	return(EWsExitReasonBad);
-	}
-
-LOCAL_C TInt DoMoveToGroupPanicTestL(TInt aTest, TAny *aScreenNumber)
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	// use correct screen
-	//
-	CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws);
-	User::LeaveIfError(screen->Construct((TInt)aScreenNumber));
-	
-	RWindowGroup group(ws);
-	User::LeaveIfError(group.Construct(887));
-	group.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
-	TInt id=group.Identifier();
-	switch (aTest)
-		{
-	case 1:
-		{
-		RWindowTreeNode* win=&group;
-		((RWindowBase*)win)->MoveToGroup(id);
-		}
-		break;
-	case 2:
-		{
-		RBlankWindow win1(ws);
-		User::LeaveIfError(win1.Construct(group,878));
-		RBlankWindow win2(ws);
-		User::LeaveIfError(win2.Construct(win1,788));
-		win2.MoveToGroup(id);
-		}
-		break;
-		}
-	ws.Flush();
-	return(EWsExitReasonBad);
-	}
-
-LOCAL_C TInt DoGetEventPanicTestL(TInt aTest, TAny *aScreenNumber)
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	switch(aTest)
-		{
-	case 1:
-		{
-		TPckgBuf<TWsEvent> event;
-		ws.TestWrite(ws.WsHandle(),EWsClOpGetEvent,&event,0);
-		}
-		break;
-	case 2:
-		{
-		CWsScreenDevice* screen=new(ELeave) CWsScreenDevice(ws);
-		User::LeaveIfError(screen->Construct((TInt)aScreenNumber));
-		RWindowGroup group(ws);
-		User::LeaveIfError(group.Construct(555));	// trigger a focus changed event
-		TRequestStatus stat;
-		ws.EventReady(&stat);
-		User::WaitForRequest(stat);
-		TPtrC8 badDesc(reinterpret_cast<const TUint8*>(0xDEAD),100);
-		ws.TestWrite(ws.WsHandle(),EWsClOpGetEvent,&badDesc,0);
-		}
-		break;
-		}
-	ws.Flush();
-	return(EWsExitReasonBad);
-	}
-
-LOCAL_C TInt DoWinHandlePanicTestL(TInt aTest, TAny *)
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	RWindowGroup group1(ws);
-	RWindowGroup group2(ws);
-	RWindow win1(ws);
-	RWindow win2(ws);
-	switch(aTest)
-		{
-	case 1:
-		User::LeaveIfError(group1.Construct(888));
-		User::LeaveIfError(group2.Construct(888));
-		break;
-	case 2:
-		User::LeaveIfError(group1.Construct(777));
-		User::LeaveIfError(win1.Construct(group1,888));
-		User::LeaveIfError(win2.Construct(group1,888));
-		break;
-	case 3:
-		User::LeaveIfError(group1.Construct(777));
-		User::LeaveIfError(win1.Construct(group1,777));
-		break;
-	case 4:
-		User::LeaveIfError(group1.Construct(777));
-		User::LeaveIfError(win1.Construct(group1,0));
-		break;
-		}
-	ws.Flush();
-	return(EWsExitReasonBad);
-	}
-
-#ifdef __WINS__
-LOCAL_C TInt DoDeleteScreenPanicTestL(TInt aTest, TAny *aScreenNumber)
-/**
- * Test examples of use of the 'screen device deleted' panic for group windows.
- * This is issued to panic the client, if they make API calls to RWindowGroup after having deleted
- * the CWsScreenDevice with which that window group is associated.
- */
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	// point to correct screen
-	CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws);
-	User::LeaveIfError(screen->Construct((TInt)aScreenNumber));
-	
-	RWindowGroup group(ws);
-	User::LeaveIfError(group.Construct(888));
-	group.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
-	switch(aTest)
-		{
-		// Test 1: deleting screen then modifying screen change events is illegal
-		case 1:
-			{
-			delete screen, screen=NULL;
-			group.EnableScreenChangeEvents();
-			break;
-			}
-		// Test 2: deleting screen then setting window group name is illegal
-		case 2:
-			{
-			delete screen, screen=NULL;
-			_LIT(KPanicTest, "PanicTest");
-			group.SetName(KPanicTest);
-			break;
-			}
-		}
-	ws.Flush();
-	return(EWsExitReasonBad);
-	}
-#endif
-
-LOCAL_C TInt DoUnInitPanicTest(TInt , TAny *)
-	{
-	// Creating a client session outside the test harness for panicking
-	//  before initialisation as the test harness initialises the one it creates.
-	TVersion version(0,0,0);
-	_LIT(KServerName, "!Windowserver");
-	
-	RUnInitalisedConnect myUnInit;
-
-	User::LeaveIfError(myUnInit.Connect(KServerName(), version));
-	myUnInit.Send(EWservMessCommandBuffer);
-	
-	return(EWsExitReasonBad);
-	}
-
-void CTPanic::TestScreenDevicePanicsL()
-	{
-	TEST(iTest->TestWsPanicL(&DoScreenDevicePanicTest,EWservPanicBitmap,1,(TAny*)iTest->iScreenNumber));
-	
-	TEST(iTest->TestWsPanicL(&DoScreenDevicePanicTest,EWservPanicBitmap,2,(TAny*)iTest->iScreenNumber));
-	}
-
-void CTPanic::TestMiscPanicsL()
-	{
-	TBool finished=EFalse;
-	TInt index=0;
-	while(!finished)
-		{
-		const TBool result = iTest->TestWsPanicL(&DoMiscPanicTest, EWservNoPanic, index, NULL, &finished);
-		if(!result)
-			{
-			INFO_PRINTF2(_L("TestMiscPanicsL %d failed"), index);
-			TEST(result);
-			}
-		index++;
-		}
-	}
-
-void CTPanic::LogHeapInfo()
-	{
-	_LIT(KInfoHeapSummary," WsHeap - Count=%d,Total=%d,Free=%d,Max free=%d");
-	TPckgBuf<TWsDebugHeapInfo> heapInfo;
-	TheClient->iWs.DebugInfo(EWsDebugInfoHeap,heapInfo);
-	TBuf<256> infoBuf;
-	infoBuf.Format(KInfoHeapSummary,heapInfo().iCount,heapInfo().iTotal,heapInfo().iAvailable,heapInfo().iLargestAvailable);
-	INFO_PRINTF1(infoBuf);
-	}
-
-void CTPanic::TestGraphicsPanicsL(TClientPanic aExitReason, TInt aIndex, CTPanic::TPanicParams* aPanicParams)
-	{
-	TBool finished=EFalse;
-	aPanicParams->iSubTest=0;
-
-	// uncomment to show which test is being run
-	INFO_PRINTF3(_L("GraphicsPanicTest %d, mode=%d"),aIndex,aPanicParams->iRedrawMode);
-    RDebug::Print(_L("GraphicsPanicTest %d, mode=%d"),aIndex,aPanicParams->iRedrawMode);
-	do
-		{
-		// uncomment for detailed view of which sub-test failed
-		LogHeapInfo();
-		INFO_PRINTF4(_L("GraphicsPanicTest %d/%d, mode=%d"),aIndex,aPanicParams->iSubTest,aPanicParams->iRedrawMode);
-		RDebug::Print(_L("GraphicsPanicTest %d/%d, mode=%d"),aIndex,aPanicParams->iSubTest,aPanicParams->iRedrawMode);
-		TEST(iTest->TestWsPanicL(&GraphicsPanicTest,aExitReason,aIndex,aPanicParams,&finished));
-		aPanicParams->iSubTest++;
-		} while(!finished);
-	iTest->CloseAllPanicWindows();
-	}
-
-void CTPanic::TestGraphicsPanicsL(TPanicRedrawMode aRedrawMode)
-	{
-	CTPanic::TPanicParams pp;
-	pp.iScreen=iTest->iScreenNumber;
-	pp.iRedrawMode=aRedrawMode;
-	static TClientPanic expectedPanics[]=
-		{
-		EWservPanicBufferPtr,
-		EWservPanicBitmap,
-		EWservPanicBitmap,
-		EWservPanicBitmap,
-		EWservPanicOpcode,
-		EWservPanicBadPolyData,
-		EWservPanicBadPolyData,
-		EWservPanicOpcode,
-		EWservPanicGcActive,
-		EWservPanicNoFont,
-		EWservPanicNoBrush,
-		EWservPanicDescriptor,
-		EWservPanicFont,
-		EWservNoPanic,	// Marks the end of the list
-		};
-	TInt panicIndex=0;
-	TClientPanic expectedPanic;
-	while((expectedPanic=expectedPanics[panicIndex++])!=EWservNoPanic)
-		{
-		TestGraphicsPanicsL(expectedPanic,panicIndex,&pp);
-		}
-	}
-
-void CTPanic::TestGraphicsPanicsL()
-	{
-	TestGraphicsPanicsL(EPanicRedrawModeBackedUpWindow);
-	TestGraphicsPanicsL(EPanicRedrawModeNormalRedraw);
-	if (TransparencySupportedL()==KErrNone)
-		{
-		TestGraphicsPanicsL(EPanicRedrawModeTransRedraw);
-		}
-	TestGraphicsPanicsL(EPanicRedrawModeInvisRedraw);
-	}
-
-void CTPanic::TestDeletedParentPanicsL()
-	{
-	TEST(iTest->TestWsPanicL(&DoDeletedParentTest,EWservPanicParentDeleted,1,(TAny*)iTest->iScreenNumber));
-	}
-
-void CTPanic::TestHandleReUseL()
-	{
-	for (TInt ii=2;ii<6;++ii)
-		{
-		TEST(iTest->TestWsPanicL(&DoHandleReUse,EWservPanicHandle,ii,(TAny*)iTest->iScreenNumber));
-		}
-	}
-
-void CTPanic::TestComputeModePanicsL()
-	{
-	TEST(iTest->TestWsPanicL(&DoCMPanicTest,EWservPanicSetComputeMode,1,(TAny*)iTest->iScreenNumber));
-	}
-
-void CTPanic::TestCaptureKeyPanicsL()
-	{
-// Run this test in debug on emulator only.
-// On a debug ROM the release version of the wserv.exe is included so the test can't be run as no panic happens. 
-#if defined(_DEBUG) && defined(__WINS__)
-	TEST(iTest->TestWsPanicL(&DoCKPanicTest,EWservPanicDestroy,1,(TAny*)iTest->iScreenNumber));
-#endif
-	}
-
-void CTPanic::TestEventPanicsL()
-	{
-	TEST(iTest->TestWsPanicL(&DoEventPanicTest,EWservPanicReadOutstanding,1,(TAny*)iTest->iScreenNumber));
-	}
-
-void CTPanic::TestTPtrPanicsL()
-	{
-	TEST(iTest->TestWsPanicL(&DoTBufPtrTests,EWservPanicBufferPtr,1,(TAny*)iTest->iScreenNumber));
-	}
-
-void CTPanic::TestOpcodePanicsL()
-	{
-	TInt param=1;
-	TBool finishTest = EFalse;
-	while(!finishTest)
-		{
-		TEST(iTest->TestWsPanicL(&DoOpcodeTests,EWservPanicOpcode,param,(TAny*)iTest->iScreenNumber,&finishTest));
-		param++;
-		}
-	}
-
-void CTPanic::TestMultiInitPanicL()
-	{
-	TEST(iTest->TestWsPanicL(&DoMultiInitPanicTest,EWservPanicReInitialise,0,(TAny*)iTest->iScreenNumber));
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0472
-
-@SYMDEF             DEF118618
-
-@SYMTestCaseDesc    Test defect fixes to system panics 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Check that various defect fixes to system panics are correct.
-					Also verify that reconstructing a closed object will succeed.
-
-@SYMTestExpectedResults Panics respond correctly
-*/
-void CTPanic::TestDoubleConstructionL()
-	{
-#ifdef __WINS__
-	for(TInt test=1;test<11;test++)
-		{
-		TEST(iTest->TestW32PanicL(&DoDoubleConstructionTestL,EW32PanicGraphicDoubleConstruction,test,NULL));
-		}
-	TestDoubleConstructionNoPanic();
-#endif
-	}
-	
-/** Verifies the following scenario	is valid:
-	1. Create some wserv client-side objects.
-	2. Call Close on them.
-	3. Reconstruct them and they shouldn't panic this time. */
-void CTPanic::TestDoubleConstructionNoPanic()
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	
-	RWindowGroup group(ws);
-	User::LeaveIfError(group.Construct(890, EFalse));
-	RBlankWindow bwin(ws);
-	User::LeaveIfError(bwin.Construct(group,900));
-	
-	//RWsSprite
-	RWsSprite sprite(ws);
-	TEST(KErrNone == sprite.Construct(bwin,TPoint(0,0),0));
-	sprite.Close();
-	TEST(KErrNone == sprite.Construct(bwin,TPoint(0,0),0));
-	sprite.Close();
-	
-	//RWsPointerCursor
-	RWsPointerCursor cursor(ws);
-	TEST(KErrNone == cursor.Construct(0));
-	cursor.Close();
-	TEST(KErrNone == cursor.Construct(0));
-	cursor.Close();
-	
-	//RSoundPlugIn
-	RSoundPlugIn click(ws);
-	TEST(KErrNone == click.Construct());
-	click.Close();
-	TEST(KErrNone == click.Construct());
-	click.Close();
-	
-	//RWindowGroup
-	RWindowGroup windowgroup(ws);
-	TEST(KErrNone ==windowgroup.Construct(901));
-	windowgroup.Close();
-	TEST(KErrNone ==windowgroup.Construct(901));
-	windowgroup.Close();
-	
-	//RWindow
-	RWindow win1(ws);
-	TEST(KErrNone == win1.Construct(group,902));
-	win1.Close(); 
-	TEST(KErrNone == win1.Construct(group,902));
-	win1.Close(); 
-	
-	//RBlankWindow
-	RBlankWindow win2(ws);
-	TEST(KErrNone == win2.Construct(group,902));
-	win2.Close(); 
-	TEST(KErrNone == win2.Construct(group,902));
-	win2.Close();
-	
-	//RBackedUpWindow
-	RBackedUpWindow win3(ws);
-	TEST(KErrNone == win3.Construct(group,EGray4,902));
-	win3.Close();
-	TEST(KErrNone == win3.Construct(group,EGray4,902));
-	win3.Close(); 
-	
-	//RAnimDll
-	RAnimDll animDll=RAnimDll(ws);
-	TEST(KErrNone == animDll.Load(KAnimDLLName));
-	animDll.Close();
-	TEST(KErrNone == animDll.Load(KAnimDLLName));
-	animDll.Close();
-	
-	group.Close();
-	bwin.Close();
-	ws.Close();
-	}
-
-void CTPanic::TestSpritePanicsL()
-	{
-	for(TInt test=1;test<4;test++)
-		{
-		TEST(iTest->TestWsPanicL(&DoSpritePanicTestL,EWservPanicSprite,test,(TAny*)iTest->iScreenNumber));
-		}
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0475
-
-@SYMDEF             DEF118616
-
-@SYMTestCaseDesc    Test defect fixes to system panics 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Check that various defect fixes to system panics are correct.
-
-@SYMTestExpectedResults Panics respond correctly
-*/
-void CTPanic::TestSpriteActivatePanicL()
-	{
-	for(TInt test=1;test<3;test++)
-		{
-		TEST(iTest->TestWsPanicL(&DoTestSpriteActivatePanicL,EWservPanicNoSpriteMember,test,NULL));
-		}
-	}
-
-void CTPanic::TestMoveToGroupPanicsL()
-	{
-	TEST(iTest->TestWsPanicL(&DoMoveToGroupPanicTestL,EWservPanicOpcode,1,(TAny*)iTest->iScreenNumber));
-	TEST(iTest->TestWsPanicL(&DoMoveToGroupPanicTestL,EWservPanicNotTopClient,2,(TAny*)iTest->iScreenNumber));
-	}
-
-void CTPanic::TestDeleteScreenPanicL()
-	{
-#ifdef __WINS__
-	TEST(iTest->TestWsPanicL(&DoDeleteScreenPanicTestL,EWservPanicGroupWinScreenDeviceDeleted,1,(TAny*)iTest->iScreenNumber));
-	TEST(iTest->TestWsPanicL(&DoDeleteScreenPanicTestL,EWservPanicGroupWinScreenDeviceDeleted,2,(TAny*)iTest->iScreenNumber));
-#endif
-	}
-
-void CTPanic::TestWinHandleErrors()
-	{
-#ifdef __WINS__
-	TEST(iTest->TestWsPanicL(&DoWinHandlePanicTestL,EWservPanicDuplicateHandle,1));
-	TEST(iTest->TestWsPanicL(&DoWinHandlePanicTestL,EWservPanicDuplicateHandle,2));
-	TEST(iTest->TestWsPanicL(&DoWinHandlePanicTestL,EWservPanicDuplicateHandle,3));
-#endif
-	TEST(iTest->TestWsPanicL(&DoWinHandlePanicTestL,EWservPanicNullHandle,4));
-	}
-
-void CTPanic::TestGetEventErrors()
-	{
-	TEST(iTest->TestWsPanicL(&DoGetEventPanicTestL,EWservPanicUnsignalledEventData,1,(TAny*)iTest->iScreenNumber));
-	TEST(iTest->TestWsPanicL(&DoGetEventPanicTestL,EWservPanicDescriptor,2,(TAny*)iTest->iScreenNumber));
-	}
-
-void CTPanic::TestUnInitPanicL()
-	{
-	TEST(iTest->TestWsPanicL(&DoUnInitPanicTest,EWservPanicUninitialisedClient,0,(TAny*)iTest->iScreenNumber));
-	}
-
-void CTPanic::ConstructL()
-	{
-	TheGc->Activate(*BaseWin->Win());
-	TheGc->Clear();
-	TheGc->SetBrushColor(TRgb::Gray16(12));
-	TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TheGc->SetPenStyle(CGraphicsContext::ENullPen);
-	TheGc->DrawRect(TRect(BaseWin->Win()->Size()));
-	TheGc->Deactivate();
-	TheGc->Activate(*TestWin->Win());
-	TheGc->Clear();
-	TheGc->SetBrushColor(TRgb::Gray16(4));
-	TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TheGc->SetPenStyle(CGraphicsContext::ENullPen);
-	TheGc->DrawRect(TRect(TestWin->Win()->Size()));
-	TheGc->Deactivate();
-//
-	_LIT(KReportFullRom,"Warning full ROM, EikSrv present, panic dialogs may interfere with tests");
-	_LIT(KReportGoodRom,"ROM OK, No EikSrv present");
-	if (iTest->IsFullRomL())
-		{
-		INFO_PRINTF1(KReportFullRom);
-		}
-	else
-		{
-		INFO_PRINTF1(KReportGoodRom);
-		}
-	}
-
-void CTPanic::TestAlphaBlendingPanicL()
-	{
-	INFO_PRINTF1(_L("Masked transparency support has been removed."));
-	}
-	
-void CTPanic::TestMismatchedCaptureCancelPanicL()
-	{		
-// Run this test in debug on emulator only.
-// On a debug ROM the release version of the wserv.exe is included so the test can't be run as no panic happens. 
-#if defined(_DEBUG) && defined(__WINS__)		
-	TEST(iTest->TestWsPanicL(DoMismatchedCancelCaptureTest,EWservPanicDestroy,ECancelCaptureKey,(TAny*)iTest->iScreenNumber));
-	TEST(iTest->TestWsPanicL(DoMismatchedCancelCaptureTest,EWservPanicDestroy,ECancelCaptureKeyUpAndDowns,(TAny*)iTest->iScreenNumber));
-	TEST(iTest->TestWsPanicL(DoMismatchedCancelCaptureTest,EWservPanicDestroy,ECancelCaptureLongKey,(TAny*)iTest->iScreenNumber));
-#endif
-	}
-
-void CTPanic::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	((CTPanicStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(++iTest->iState)
-		{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0259
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test various system panics 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Check that various system panics respond correctly 
-
-@SYMTestExpectedResults Panics respond correctly
-*/
-		case 1:
-			{
-			((CTPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0259"));
-			iTest->LogSubTest(_L("TestCaptureKeyPanicsL"));
-			TestCaptureKeyPanicsL();
-			}
-			break;
-		case 2:
-		    {
-			iTest->LogSubTest(_L("TestEventPanicsL"));
-			TestEventPanicsL();
-		    }
-		    break;
-		case 3:
-		    {
-			iTest->LogSubTest(_L("TestComputeModePanicsL"));
-			TestComputeModePanicsL();
-		    }
-		    break;
-		case 4:
-		    {
-#ifdef __WINS__
-//  Only running this under WINS as the tests are a bit excessive, firing off all sorts of illegal
-// opcode/flag combinations, as well as buffers of random data.
-// Currently on ARM builds they're failing with KErrOutOfMemory, probably running out of handles
-// somewhere in the OS.
-			iTest->LogSubTest(_L("TestMiscPanicsL"));
-			TestMiscPanicsL();
-#endif
-		    }
-		    break;
-		case 5:
-		    {
-			iTest->LogSubTest(_L("TestGraphicsPanicsL"));
-			TestGraphicsPanicsL();
-		    }
-		    break;
-		case 6:
-		    {
-			iTest->LogSubTest(_L("TestTPtrPanicsL"));
-			TestTPtrPanicsL();
-		    }
-		    break;
-		case 7:
-		    {
-			iTest->LogSubTest(_L("TestOpcodePanicsL"));
-			TestOpcodePanicsL();
-		    }
-		    break;
-		case 8:
-		    {
-			iTest->LogSubTest(_L("TestScreenDevicePanicsL"));
-			TestScreenDevicePanicsL();
-		    }
-		    break;
-		case 9:
-		    {
-			iTest->LogSubTest(_L("TestMultiInitPanicL"));
-			TestMultiInitPanicL();
-			}
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0260
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test various system panics 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Check that various system panics respond correctly 
-
-@SYMTestExpectedResults Panics respond correctly
-*/
-		case 10:
-			{
-			((CTPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0260"));
-			iTest->LogSubTest(_L("Panic 2"));
-			TestSpritePanicsL();
-			TestMoveToGroupPanicsL();
-			}
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0261
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test defect fixes to system panics 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Check that various defect fixes to system panics are correct 
-
-@SYMTestExpectedResults Panics respond correctly
-*/			
-		case 11:
-			{
-			((CTPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0261"));
-			_LIT(KPanicTest,"Defect Fixes (Pan.3)");
-			iTest->LogSubTest(KPanicTest);
-			TestDeletedParentPanicsL();
-			TestHandleReUseL();
-			TestDeleteScreenPanicL(); // DEF069809
-			}
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-097969-0001
-
-@SYMDEF             DEF097969
-
-@SYMTestCaseDesc    Test defect fixes to system panics 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Check that various defect fixes to system panics are correct 
-
-@SYMTestExpectedResults Panics respond correctly
-*/			
-		case 12:
-			{
-			((CTPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-097969-0001"));
-			_LIT(KPanicTest,"Server panic defect Fix (Pan.4)");
-			iTest->LogSubTest(KPanicTest);
-			TestUnInitPanicL();	// DEF097969
-			}
-			break;
-		
-		case 13:
-			{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0501
-*/
-			((CTPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0501"));
-			_LIT(KPanicTest,"AlphaBlending Bitmap panic defect Fix (Pan.5)");
-			iTest->LogSubTest(KPanicTest);
-			TestAlphaBlendingPanicL();	// DEF112916
-			}
-			break;
-		case 14:
-			{		
-            ((CTPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0472"));
-			_LIT(KPanicTest,"Double construction panic test");
-			iTest->LogSubTest(KPanicTest);
-			TestDoubleConstructionL();	// DEF118618
-			}
-			break;
-		case 15:
-			{
-			((CTPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0475"));
-			_LIT(KPanicTest, "RWsSprite Activate() without members panic test");
-			iTest->LogSubTest(KPanicTest);
-			TestSpriteActivatePanicL(); //DEF118616				
-			}
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0497
-
-@SYMDEF             DEF133776
-
-@SYMTestCaseDesc     Test that a debug only panic occurs when an attempt
- is made to cancel a key capture using the wrong cancel capture API.
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Check that calling the each RWindowGroup::CancelCapture***() API
- using the handle returned from a mismatched RWindowGroup::Capture***() call causes
- a debug only panic. Tests each of the three RWindowGroup::CancelCapture***() APIs.
-
-@SYMTestExpectedResults Panics respond correctly in debug only.
-*/			
-		case 16:
-			{
-			((CTPanicStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0497"));
-			_LIT(KPanicTest,"TestMismatchedCaptureCancelPanicL");
-			iTest->LogSubTest(KPanicTest);
-			TestMismatchedCaptureCancelPanicL();				
-			}
-			break;			
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-		case 17:
-			{
-			_LIT(KPanicTest, "Non-Redraw Drawing inside Redrawer Panic Test");
-			iTest->LogSubTest(KPanicTest);
-			TestNonRedrawRedrawerL();
-			}			
-#endif			
-		default:
-            		((CTPanicStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTPanicStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-			break;
-		}
-	((CTPanicStep*)iStep)->RecordTestResultL();
-	}
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-LOCAL_C TInt DoTestNonRedrawRedrawerL(TInt /* aInt */, TAny * /* aPtr */)
-	{
-	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
-	CleanupStack::PushL(scheduler);
-	CActiveScheduler::Install(scheduler);
-	
-	RWsSession session;
-	User::LeaveIfError(session.Connect());
-	
-	CWsScreenDevice *screenDevice = new (ELeave)CWsScreenDevice(session);
-	User::LeaveIfError(screenDevice->Construct ());
-	CWindowGc *gc;
-	User::LeaveIfError(screenDevice->CreateContext(gc));
-	
-	CNonRedrawWin *nonRedrawWin=CNonRedrawWin::NewL(session, gc);	
-	nonRedrawWin->Invalidate(); 
-	CActiveScheduler::Start();
-	User::After(2000000); // so the Redrawer has a chance to run 
-	CActiveScheduler::Stop();
-	delete gc;
-	delete screenDevice;
-	session.Close();
-	CleanupStack::PopAndDestroy(scheduler);
-	return(EWsExitReasonBad);
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0121808
-@SYMDEF             DEF121808: No more Non-Redraw drawing for NGA (test added during DEF134308) 
-@SYMTestCaseDesc    Test defect fixes to system panics 
-@SYMTestPriority    High
-@SYMTestStatus      Implemented
-@SYMTestActions     Check that WServ panics a client which uses Non-Redraw drawing in the Redrawer.
-@SYMTestExpectedResults Panics respond correctly
-*/
-void CTPanic::TestNonRedrawRedrawerL()
-	{
-	TEST(iTest->TestWsPanicL(&DoTestNonRedrawRedrawerL,EWservPanicWindowBeginRedrawNotCalled,NULL,NULL));
-	}
-
-CNonRedrawWin::CRedrawer::CRedrawer(CNonRedrawWin* aWd) :
-	CActive(CActive::EPriorityStandard), iWd(aWd){
-	CActiveScheduler::Add(this);
-	HandleRedrawEvent();	
-}
-
-CNonRedrawWin::CRedrawer::~CRedrawer(){
-	Cancel();
-}
-
-void CNonRedrawWin::CRedrawer::HandleRedrawEvent(){
-	iWd->GetSession().RedrawReady(&iStatus);
-	SetActive();
-}
-
-void CNonRedrawWin::CRedrawer::RunL(){
-	TWsRedrawEvent redrawEvent;
-	iWd->GetSession().GetRedraw(redrawEvent);	
-	iWd->Redraw();
-	HandleRedrawEvent();
-}
-
-void CNonRedrawWin::CRedrawer::DoCancel(){
-	iWd->GetSession().RedrawReadyCancel();
-}
-
-CNonRedrawWin* CNonRedrawWin::NewL(RWsSession &aSession, CWindowGc *aGc){
-	CNonRedrawWin* self=new(ELeave)CNonRedrawWin(aSession, aGc);
-	CleanupStack::PushL(self);
-	self->ConstrucL();
-	CleanupStack::Pop(self);
-	return self;
-}
-
-CNonRedrawWin::CNonRedrawWin(RWsSession &aSession, CWindowGc *aGc):
-	iSession(aSession), iGc(aGc){}
-
-CNonRedrawWin::~CNonRedrawWin(){
-	delete iRedrawer;
-	iWd.Close();
-	iWdGrp.Close();	
-}
-
-void CNonRedrawWin::Redraw(){
-	// This is a Non-Redraw Drawing Redrawer; BeginRedraw()/EndRedraw()
-	// have been intentionally omitted.
-	iGc->Activate(iWd);	
-	iGc->SetBrushColor(TRgb(255,0,0));
-	iGc->SetPenColor(KRgbBlue);
-	iGc->SetPenSize(TSize(10,20));
-	iGc->DrawRect(TRect(TPoint(10,10),TPoint(50,50)));	
-	iGc->Deactivate();
-	iSession.Finish();			
-}
-
-RWsSession &CNonRedrawWin::GetSession(){return iSession;}
-
-void CNonRedrawWin::Invalidate(){iWd.Invalidate();}
-
-void CNonRedrawWin::ConstrucL(){
-	iWdGrp=RWindowGroup(iSession);	
-	iWdGrp.Construct((TUint32)this,ETrue);
-	_LIT(KWndGrpName,"NonRedrawWndGrp");
-	iWdGrp.SetName(KWndGrpName);	
-	iWd=RWindow(iSession);	
-	iWd.Construct(iWdGrp, 0x101);	
-	User::LeaveIfError(iWd.SetExtentErr(TPoint(0,0),TSize(150,150)));
-	iWd.SetBackgroundColor(KRgbWhite);
-	iWd.SetOrdinalPosition(0);	
-	iWd.Activate();	
-	iRedrawer=new(ELeave) CRedrawer(this);
-}
-#endif
-
-TInt RUnInitalisedConnect::Connect(const TDesC &aName, const TVersion &aVersion)
-	{
-	return CreateSession(aName, aVersion, 255);
-	}
-
-TInt RUnInitalisedConnect::Send(const TInt aMsg)
-	{
-	return SendReceive(aMsg);
-	}
-
-__WS_CONSTRUCT_STEP__(Panic)
-#pragma warning( disable : 4505 )
--- a/windowing/windowserver/tauto/TPANIC.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +0,0 @@
-
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TPANIC_H__
-#define __TPANIC_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "AUTODLL.H"
-#include "TGraphicsHarness.h"
-
-enum TPanicRedrawMode
-	{
-	EPanicRedrawModeBackedUpWindow,	// Draw to a RBackedUpWindow; no BeginRedraw()/EndRedraw() needed
-	EPanicRedrawModeNormalRedraw,	// Draw in a redraw
-	EPanicRedrawModeTransRedraw,	// Draw to a window under a transparent window in a redraw
-	EPanicRedrawModeInvisRedraw,	// Draw to an invisible window in a redraw
-	};
-
-class CTPanic : public CTWsGraphicsBase
-	{
-public:
-	struct TPanicParams
-		{
-	public:
-		TInt iScreen;
-		TPanicRedrawMode iRedrawMode;
-		TInt iSubTest;
-		};
-	
-	enum TCancelCaptureType
-		{
-		ECancelCaptureKey,
-		ECancelCaptureKeyUpAndDowns,
-		ECancelCaptureLongKey
-		};
-public:
-	CTPanic(CTestStep* aStep);
-	~CTPanic();
-	void ConstructL();
-private:
-	void TestDeletedParentPanicsL();
-	void TestScreenDevicePanicsL();
-	void TestGraphicsPanicsL(TClientPanic aExitReason, TInt aIndex, CTPanic::TPanicParams* aPanicParams);
-	void TestGraphicsPanicsL();
-	void TestGraphicsPanicsL(TPanicRedrawMode aRedrawMode);
-	void TestMiscPanicsL();
-	void TestComputeModePanicsL();
-	void TestCaptureKeyPanicsL();
-	void TestEventPanicsL();
-	void TestTPtrPanicsL();
-	void TestOpcodePanicsL();
-	void TestMultiInitPanicL();
-	void TestSpritePanicsL();
-	void TestMoveToGroupPanicsL();
-	void TestHandleReUseL();
-	void TestDeleteScreenPanicL();
-	void TestWinHandleErrors();
-	void TestGetEventErrors();
-	void TestUnInitPanicL();
-	void TestAlphaBlendingPanicL();
-	void TestDoubleConstructionL();
-	void TestDoubleConstructionNoPanic();
-	void TestSpriteActivatePanicL();
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA	
-	void TestNonRedrawRedrawerL();
-#endif	
-	void TestMismatchedCaptureCancelPanicL();
-	void LogHeapInfo();
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	TSize iWinSize;
-	};
-
-class CTPanicStep : public CTGraphicsStep
-	{
-public:
-	CTPanicStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTPanicStep,"TPanic");
-
-class RUnInitalisedConnect : public RSessionBase
-	{
-	public:
-	TInt Connect(const TDesC &aName, const TVersion &aVersion);
-	TInt Send(const TInt aMsg);
-	};
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-class CNonRedrawWin : public CBase{
-	public:
-		~CNonRedrawWin();
-		static CNonRedrawWin* NewL(RWsSession &aSession, CWindowGc *aGc);
-		virtual void Redraw();
-		RWsSession &GetSession();
-		void Invalidate();
-					
-	protected:
-		CNonRedrawWin(RWsSession &aSession, CWindowGc *aGc);
-		void ConstrucL();
-
-		class CRedrawer : public CActive{
-			public:
-				CRedrawer(CNonRedrawWin* aWd);
-				~CRedrawer();		
-			private:
-				void HandleReDrawEvent();
-				void RunL();
-				void DoCancel();
-				void HandleRedrawEvent();
-				
-			private:
-				CNonRedrawWin* iWd;
-		};
-			
-	private:		
-		RWsSession &iSession;
-		RWindowGroup iWdGrp;
-		RWindow iWd;
-		CWindowGc *iGc;
-		
-		CRedrawer *iRedrawer;			
-		
-};
-#endif
-
-#endif
--- a/windowing/windowserver/tauto/TPNTCAP.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1014 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test pointer capture
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TPNTCAP.H"
-
-#define LOGGING on
-
-_LIT(ClickOnMe,"Click on me");
-
-//
-// CMcConnection
-
-CPcConnection::CPcConnection(CTPointerCapture *aTest) : iTest(aTest)
-	{
-	}
-
-CPcConnection::~CPcConnection()
-	{
-	}
-
-void CPcConnection::ConstructL()
-	{
-	CTClient::SetScreenNumber(iTest->TestBase()->ScreenNumber());
-	CTClient::ConstructL();
-	iGroup=new(ELeave) CTWindowGroup(this);
-	iGroup->ConstructL();
-	iGroup->GroupWin()->SetOrdinalPosition(0,1);
-	iGroup->GroupWin()->EnableReceiptOfFocus(EFalse);
-	iWs.Flush();
-	}
-
-//
-// CPcWindow, base class //
-//
-
-CPcWindowBase::CPcWindowBase(CTPointerCapture *aTest) : CTWin(), iTest(aTest)
-	{
-	}
-
-void CPcWindowBase::SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc)
-	{
-	ConstructExtLD(*parent,pos,size);
-	iWin.SetBackgroundColor(iBack);
-	Activate();
-	AssignGC(aGc);
-	}
-
-void CPcWindowBase::SetUpL(TPoint pos,TSize size,CTWinBase *parent)
-	{
-	SetUpL(pos,size,parent,*iTest->Client()->iGc);
-	}
-
-void CPcWindowBase::SubStateChanged()
-	{
-	iWin.Invalidate();
-	Client()->iWs.Flush();
-	}
-
-void CPcWindowBase::Draw(TDesC &aBuf)
-	{
-	iGc->Clear();
-	iGc->SetPenColor(iBack.Gray4()>1 ? TRgb(0,0,0) : TRgb(255,255,255));
-	iGc->DrawText(aBuf, TPoint(10,20));
-	}
-
-void CPcWindowBase::PointerL(const TPointerEvent &pointer,const TTime &)
-	{
-#if defined(LOGGING)
-	_LIT(KLog1,"Pointer Event Recieved  Type=%S  State=%d  SubState=%d");
-	_LIT(KDown,"Down");
-	_LIT(KUp,"Up");
-	iTest->LOG_MESSAGE4(KLog1,&(pointer.iType?KUp():KDown()),iTest->State(),iTest->SubState());
-#endif
-	if (pointer.iType==TPointerEvent::EButton1Down && !iTest->iFailed)
-		{
-		if (iTest->SubState()==ERootWindow)	// Root window click, must not be inside this window
-			{
-			if (TRect(Size()).Contains(pointer.iPosition))
-				{
-				iTest->TestFailed();
-				return;
-				}
-			}
-		TInt ret;
-		if ((ret=PointerDown())==EFailed)
-			iTest->TestFailed();
-		else
-			iTest->IncSubStateL(ret==ENeedsDDEvent);
-		}
-#if defined(LOGGING)
-	_LIT(KLog2,"End of processing Pointer Event");
-	iTest->LOG_MESSAGE(KLog2);
-#endif
-	}
-
-void CPcWindowBase::DragDropL(const TPointerEvent &pointer,const TTime &)
-	{
-#if defined(LOGGING)
-	_LIT(KLog,"CPcWindowBase::DragDropL  Type=%d  State=%d  SubState=%d");
-	iTest->LOG_MESSAGE4(KLog,pointer.iType,iTest->State(),iTest->SubState());
-#endif
-	switch(iTest->State())
-		{
-		case ENormalCaptureWithoutFocus:
-			if (iTest->SubState()==0)
-				break;
-		case ECaptureDisabled:
-		case ENormalCapture:
-		case ECaptureAllGroups:
-			iTest->TestFailed();
-			break;
-		}
-	if (pointer.iType==TPointerEvent::EButton1Down && !iTest->iFailed)
-		{
-		if (DragDrop()==EFailed)
-			iTest->TestFailed();
-		else
-			iTest->GotDDL();
-		}
-	}
-//
-
-CPcWindowMain::CPcWindowMain(CTPointerCapture *aTest) : CPcWindowBase(aTest)
-	{
-	iBack=TRgb::Gray256(236);
-	}
-
-TPointerCheckRet CPcWindowMain::PointerDown()
-	{
-#if defined(LOGGING)
-	_LIT(KLog1,"CPcWindowMain::PointerDown  State=%d  SubState=%d");
-	iTest->LOG_MESSAGE3(KLog1,iTest->State(),iTest->SubState());
-#endif
-	switch(iTest->State())
-		{
-		case ECaptureDisabled:
-			if (iTest->SubState()==EMainWindow)
-				return(EOkay);
-			break;
-		case ENormalCapture:
-			switch(iTest->SubState())
-				{
-				case EMainWindow:
-				case ERootWindow:
-					return(EOkay);
-				default:
-					break;
-				}
-			break;
-		case ECaptureAllGroups:
-			switch(iTest->SubState())
-				{
-				case EMainWindow:
-				case EOtherGroup:
-				case EOtherSession:
-				case ERootWindow:
-					return(EOkay);
-				default:
-					break;
-				}
-			break;
-		case EDragDropCapture:
-			switch(iTest->SubState())
-				{
-				case EMainWindow:
-					return(ENeedsDDEvent);
-				case ERootWindow:
-					return(EOkay);
-				default:
-					break;
-				}
-			break;
-		case EDragDropCaptureAllGroups:
-			switch(iTest->SubState())
-				{
-				case EMainWindow:
-				case EOtherGroup:
-				case EOtherSession:
-					return(ENeedsDDEvent);
-				case ERootWindow:
-					return(EOkay);
-				default:
-					break;
-				}
-			break;
-		case ENormalCaptureWithoutFocus:
-			switch(iTest->SubState())
-				{
-				case EMainWindow:
-					return(EOkay);
-				default:
-					break;
-				}
-			break;
-		default:
-			break;
-		}
-#if defined(LOGGING)
-	_LIT(KLog2,"CPcWindowMain::PointerDown  FAILED  State=%d  SubState=%d");
-	iTest->LOG_MESSAGE3(KLog2,iTest->State(),iTest->SubState());
-#endif
-	return(EFailed);
-	}
-
-TPointerCheckRet CPcWindowMain::DragDrop()
-	{
-#if defined(LOGGING)
-	_LIT(KLog1,"CPcWindowMain::DragDrop  State=%d  SubState=%d");
-	iTest->LOG_MESSAGE3(KLog1,iTest->State(),iTest->SubState());
-#endif
-	switch(iTest->State())
-		{
-		case EDragDropCapture:
-		case EDragDropCaptureAllGroups:
-			switch(iTest->SubState())
-				{
-				case EMainWindow:
-					return(EOkay);
-				default:
-					break;
-				}
-			break;
-		default:
-			break;
-		}
-#if defined(LOGGING)
-	_LIT(KLog2,"CPcWindowMain::DragDrop  FAILED  State=%d  SubState=%d");
-	iTest->LOG_MESSAGE3(KLog2,iTest->State(),iTest->SubState());
-#endif
-	return(EFailed);
-	}
-
-void CPcWindowMain::Draw()
-	{
-	TBuf<0x40> buf;
-	if (iTest->State()==ECaptureDisabled)
-		{
-		switch(iTest->SubState())
-			{
-			case EMainWindow:
-				buf.Copy(ClickOnMe);
-				break;
-			}
-		}
-	else
-		{
-		switch(iTest->SubState())
-			{
-			case EMainWindow:
-				buf.Copy(ClickOnMe);
-				break;
-			case EChildWindow:
-			case EOtherGroup:
-			case EOtherSession:
-				break;
-			case ERootWindow:
-				{
-				_LIT(ClickOnRoot,"Click on the root window");
-				if (iTest->State()<ENormalCaptureWithoutFocus)
-					buf.Copy(ClickOnRoot);
-				else
-					{
-					_LIT(AndEscape,", then press <Escape>");
-					buf.Copy(ClickOnRoot);
-					buf.Append(AndEscape);
-					}
-				}
-				break;
-			}
-		}
-	CPcWindowBase::Draw(buf);
-	}
-
-void CPcWindowMain::WinKeyL(const TKeyEvent &aKey,const TTime &)
-	{
-	switch(aKey.iCode)
-		{
-		case EKeyEscape:
-			iTest->AbortTests();
-			break;
-		case EKeyEnter:
-			if (iTest->SubState()==ERootWindow)
-				iTest->IncSubStateL(EFalse);
-			break;
-		}
-	}
-
-//
-
-CPcWindowChild::CPcWindowChild(CTPointerCapture *aTest) : CPcWindowBase(aTest)
-	{
-	iBack=TRgb::Gray256(85);
-	}
-
-TPointerCheckRet CPcWindowChild::PointerDown()
-	{
-#if defined(LOGGING)
-	_LIT(KLog1,"CPcWindowChild::PointerDown  State=%d  SubState=%d");
-	iTest->LOG_MESSAGE3(KLog1,iTest->State(),iTest->SubState());
-#endif
-	switch(iTest->State())
-		{
-		case ECaptureDisabled:
-			break;
-		default:
-			switch(iTest->SubState())
-				{
-				case EChildWindow:
-					return(EOkay);
-				default:
-					break;
-				}
-			break;
-		}
-#if defined(LOGGING)
-	_LIT(KLog2,"CPcWindowChild::PointerDown  FAILED  State=%d  SubState=%d");
-	iTest->LOG_MESSAGE3(KLog2,iTest->State(),iTest->SubState());
-#endif
-	return(EFailed);
-	}
-
-TPointerCheckRet CPcWindowChild::DragDrop()
-	{
-#if defined(LOGGING)
-	_LIT(KLog1,"CPcWindowChild::PointerDown  State=%d  SubState=%d");
-	iTest->LOG_MESSAGE3(KLog1,iTest->State(),iTest->SubState());
-#endif
-	switch(iTest->State())
-		{
-		case EDragDropCapture:
-		case EDragDropCaptureAllGroups:
-			switch(iTest->SubState())
-				{
-				case EChildWindow:
-					return(EOkay);
-				default:
-					break;
-				}
-			break;
-		default:
-			break;
-		}
-#if defined(LOGGING)
-	_LIT(KLog2,"CPcWindowChild::PointerDown  FAILED  State=%d  SubState=%d");
-	iTest->LOG_MESSAGE3(KLog2,iTest->State(),iTest->SubState());
-#endif
-	return(EFailed);
-	}
-
-void CPcWindowChild::Draw()
-	{
-	TBuf<0x40> buf;
-	if (iTest->State()!=ECaptureDisabled)
-		{
-		switch(iTest->SubState())
-			{
-			case EChildWindow:
-				buf.Copy(ClickOnMe);
-				break;
-			default:
-				break;
-			}
-		}
-	CPcWindowBase::Draw(buf);
-	}
-
-//
-
-CPcWindowNickFocusGroup::CPcWindowNickFocusGroup(CTPointerCapture *aTest, CTClient *aClient) : CTWindowGroup(aClient), iTest(aTest)
-	{
-	}
-
-void CPcWindowNickFocusGroup::KeyL(const TKeyEvent &aKey,const TTime &)
-	{
-	if (aKey.iCode==EKeyEscape)
-		iTest->IncSubStateL(EFalse);
-	}
-
-//
-
-CPcWindowAltGroup::CPcWindowAltGroup(CTPointerCapture *aTest) : CPcWindowBase(aTest)
-	{
-	iBack=TRgb::Gray256(236);
-	}
-
-TPointerCheckRet CPcWindowAltGroup::PointerDown()
-	{
-#if defined(LOGGING)
-	_LIT(KLog1,"CPcWindowAltGroup::PointerDown  State=%d  SubState=%d");
-	iTest->LOG_MESSAGE3(KLog1,iTest->State(),iTest->SubState());
-#endif
-	switch(iTest->State())
-		{
-		case ECaptureDisabled:
-			if (iTest->SubState()==EChildWindow)
-				return(EOkay);
-			break;
-		case ENormalCapture:
-		case EDragDropCapture:
-		case ENormalCaptureWithoutFocus:
-			switch(iTest->SubState())
-				{
-				case EOtherGroup:
-					return(EOkay);
-				default:
-					break;
-				}
-			break;
-		default:
-			break;
-		}
-#if defined(LOGGING)
-	_LIT(KLog2,"CPcWindowAltGroup::PointerDown  FAILED  State=%d  SubState=%d");
-	iTest->LOG_MESSAGE3(KLog2,iTest->State(),iTest->SubState());
-#endif
-	return(EFailed);
-	}
-
-TPointerCheckRet CPcWindowAltGroup::DragDrop()
-	{
-#if defined(LOGGING)
-	_LIT(KLog1,"CPcWindowAltGroup::DragDrop  State=%d  SubState=%d");
-	iTest->LOG_MESSAGE3(KLog1,iTest->State(),iTest->SubState());
-#endif
-	switch(iTest->State())
-		{
-		case EDragDropCapture:
-		case EDragDropCaptureAllGroups:
-			switch(iTest->SubState())
-				{
-				case EOtherGroup:
-					return(EOkay);
-				default:
-					break;
-				}
-			break;
-		default:
-			break;
-		}
-#if defined(LOGGING)
-	_LIT(KLog2,"CPcWindowAltGroup::DragDrop  FAILED  State=%d  SubState=%d");
-	iTest->LOG_MESSAGE3(KLog2,iTest->State(),iTest->SubState());
-#endif
-	return(EFailed);
-	}
-
-void CPcWindowAltGroup::Draw()
-	{
-	TBuf<0x40> buf;
-	if (iTest->State()==ECaptureDisabled)
-		{
-		switch(iTest->SubState())
-			{
-			case EMainWindow:
-				break;
-			case EChildWindow:
-				buf.Copy(ClickOnMe);
-				break;
-			}
-		}
-	else
-		{
-		switch(iTest->SubState())
-			{
-			case EOtherGroup:
-				buf.Copy(ClickOnMe);
-				break;
-			default:
-				break;
-			}
-		}
-	CPcWindowBase::Draw(buf);
-	}
-
-//
-
-CPcWindowAltConnection::CPcWindowAltConnection(CTPointerCapture *aTest) : CPcWindowBase(aTest)
-	{
-	iBack=TRgb::Gray256(236);
-	}
-
-TPointerCheckRet CPcWindowAltConnection::PointerDown()
-	{
-#if defined(LOGGING)
-	_LIT(KLog1,"CPcWindowAltConnection::PointerDown  State=%d  SubState=%d");
-	iTest->LOG_MESSAGE3(KLog1,iTest->State(),iTest->SubState());
-#endif
-	switch(iTest->State())
-		{
-		case ECaptureDisabled:
-			if (iTest->SubState()==EChildWindow)
-				return(EOkay);
-			break;
-		case ENormalCapture:
-		case EDragDropCapture:
-		case ENormalCaptureWithoutFocus:
-			switch(iTest->SubState())
-				{
-				case EOtherSession:
-					return(EOkay);
-				default:
-					break;
-				}
-			break;
-		default:
-			break;
-		}
-#if defined(LOGGING)
-	_LIT(KLog2,"CPcWindowAltConnection::PointerDown  FAILED  State=%d  SubState=%d");
-	iTest->LOG_MESSAGE3(KLog2,iTest->State(),iTest->SubState());
-#endif
-	return(EFailed);
-	}
-
-TPointerCheckRet CPcWindowAltConnection::DragDrop()
-	{
-#if defined(LOGGING)
-	_LIT(KLog1,"CPcWindowAltConnection::DragDrop  State=%d  SubState=%d");
-	iTest->LOG_MESSAGE3(KLog1,iTest->State(),iTest->SubState());
-#endif
-	switch(iTest->State())
-		{
-		case EDragDropCapture:
-		case EDragDropCaptureAllGroups:
-			switch(iTest->SubState())
-				{
-				case EOtherSession:
-					return(EOkay);
-				default:
-					break;
-				}
-			break;
-		default:
-			break;
-		}
-#if defined(LOGGING)
-	_LIT(KLog2,"CPcWindowAltConnection::DragDrop  FAILED  State=%d  SubState=%d");
-	iTest->LOG_MESSAGE3(KLog2,iTest->State(),iTest->SubState());
-#endif
-	return(EFailed);
-	}
-
-void CPcWindowAltConnection::Draw()
-	{
-	TBuf<0x40> buf;
-	if (iTest->State()!=ECaptureDisabled)
-		{
-		switch(iTest->SubState())
-			{
-			case EOtherSession:
-				buf.Copy(ClickOnMe);
-				break;
-			default:
-				break;
-			}
-		}
-	CPcWindowBase::Draw(buf);
-	}
-
-//
-
-CTPointerCapture::CTPointerCapture(CTestStep* aStep) : CTWsGraphicsBase(aStep)
-	{
-	iSubState=0;
-	iFailed=EFalse;
-	}
-
-CTPointerCapture::~CTPointerCapture()
-	{
-	delete iNickFocusBlankWin;
-	delete iNickFocusGroup;
-	delete iAltConnectionWin;
-	delete iAltConnection;
-	delete iChildWin;
-	delete iMainWin;
-	delete iMainGroup;
-	delete iAltGroupWin;
-	delete iAltGroup;
-	}
-
-void CTPointerCapture::TestFailed()
-	{
-	if (iFailed)
-		{
-		_LIT(KLog,"Test Failed  State=%d  SubState=%d");
-		LOG_MESSAGE3(KLog,iTest->iState,iSubState);
-		}
-	__ASSERT_DEBUG(iFailed==EFalse,AutoPanic(ETManPanicPcFailed));
-	TInt dRet=1;
-#if !defined(DISABLE_FAIL_DIALOG)
-	Client()->iGroup->GroupWin()->SetOrdinalPosition(0,10);	// Put error dialog on top of test windows
-	TRAPD(err,dRet=doTestFailedL());
-	Client()->iGroup->GroupWin()->SetOrdinalPosition(0,0);
-#endif
-	switch(dRet)
-		{
-		case 0:
-			break;
-		case 1:
-			iFailed=ETrue;
-			NextTest();
-			break;
-		}
-	}
-
-TInt CTPointerCapture::doTestFailedL()
-	{
-	CTDialog *dialog=new(ELeave) CTDialog();
-	dialog->SetTitle(_L("Pointer capture test failed"));
-	dialog->SetNumButtons(2);
-	dialog->SetButtonText(0,_L("Retest"));
-	dialog->SetButtonText(1,_L("Fail"));
-	dialog->ConstructLD(*Client()->iGroup,*Client()->iGc);
-	return dialog->Display();
-	}
-
-TInt CTPointerCapture::State() const
-	{
-	return(iTest->iState);
-	}
-
-TInt CTPointerCapture::SubState() const
-	{
-	return(iSubState);
-	}
-
-void CTPointerCapture::doIncSubStateL()
-	{
-	iSubState++;
-	TInt max=0;
-	switch(iTest->iState)
-		{
-		case ECaptureDisabled:
-			max=ESubStates1;
-			break;
-		case ENormalCapture:
-			max=ESubStates2;
-			break;
-		case ECaptureAllGroups:
-			max=ESubStates3;
-			break;
-		case EDragDropCapture:
-			max=ESubStates4;
-			break;
-		case EDragDropCaptureAllGroups:
-			max=ESubStates5;
-			break;
-		case ENormalCaptureWithoutFocus:
-			max=ESubStates6;
-			break;
-		}
-	//SubState 4 has been broken by something in the framework
-	if (iSubState==max || iSubState==4)
-		{
-	#if defined(LOGGING)
-		_LIT(KLog,"IncState  OldState=%d  SubState=%d");
-		LOG_MESSAGE3(KLog,iTest->iState,iSubState);
-	#endif
-		NextTest();
-		}
-	StateChanged();
-	TheClient->WaitForRedrawsToFinish();
-	if (iSubState>0)
-		SendEventsL();
-	}
-
-void CTPointerCapture::GotDDL()
-	{
-	if (iDDState==DDStateWaiting)
-		doIncSubStateL();
-	else
-		iDDState=DDStateGot;
-	}
-
-void CTPointerCapture::IncSubStateL(TBool aNeedsDD)
-	{
-	if (!aNeedsDD)
-		{
-		if (iDDState!=DDStateNull)
-			TestFailed();
-		else
-			doIncSubStateL();
-		}
-	else if (iDDState==DDStateGot)
-		doIncSubStateL();
-	else
-		iDDState=DDStateWaiting;
-	}
-
-void CTPointerCapture::StateChanged()
-	{
-	iDDState=DDStateNull;
-	iChildWin->SubStateChanged();
-	iMainWin->SubStateChanged();
-	iAltGroupWin->SubStateChanged();
-	iAltConnectionWin->SubStateChanged();
-	}
-
-void CTPointerCapture::AbortTests()
-	{
-	iTest->iState=99;
-	}
-
-void CTPointerCapture::NextTest()
-	{
-	TEST(!iFailed);
-	if (iFailed)
-		{
-		_LIT(KLog,"SubTest %d failed");
-		LOG_MESSAGE2(KLog,iTest->iState);
-		}
-	++iTest->iState;
-	iSubState=0;
-	iFailed=EFalse;
-	CaseComplete();
-	_LIT(KLog,"Done NextTest  NewSubTest %d");
-	LOG_MESSAGE2(KLog,iTest->iState);
-	}
-
-void CTPointerCapture::ConstructL()
-	{
-	TheClient->iWs.SetPointerCursorArea(iTest->iNormalPointerCursorArea);
-	iScreenSize=TSize(TheClient->iScreen->SizeInPixels());
-	TInt winWidth2=iScreenSize.iWidth/2-EWinBorderSize*2;
-	TInt winWidth4=iScreenSize.iWidth/4-EWinBorderSize*2;
-	TInt winHeight=iScreenSize.iHeight/2-EWinBorderSize*2;
-//
-	iMainGroup=new(ELeave) CTWindowGroup(Client());
-	iMainGroup->ConstructL();
-	iMainGroup->GroupWin()->SetOrdinalPosition(0,1);
-	iMainWin=new(ELeave) CPcWindowMain(this);
-	iMainWin->SetUpL(TPoint(EWinBorderSize,EWinBorderSize) ,TSize(winWidth2,winHeight) ,iMainGroup);
-	iMainGroup->SetCurrentWindow(iMainWin);
-	iChildWin=new(ELeave) CPcWindowChild(this);
-	iChildWin->SetUpL(TPoint(0,winHeight/2) ,TSize(winWidth2,winHeight/2) ,iMainWin);
-//
-	iAltGroup=new(ELeave) CTWindowGroup(Client());
-	iAltGroup->ConstructL();
-	iAltGroup->GroupWin()->SetOrdinalPosition(0,1);
-	iAltGroup->GroupWin()->EnableReceiptOfFocus(EFalse);
-	iAltGroupWin=new(ELeave) CPcWindowAltGroup(this);
-	iAltGroupWin->SetUpL(TPoint(iScreenSize.iWidth/2+EWinBorderSize,EWinBorderSize) ,TSize(winWidth4,winHeight) ,iAltGroup);
-//
-	iAltConnection=new(ELeave) CPcConnection(this);
-	iAltConnection->ConstructL();
-	iAltConnectionWin=new(ELeave) CPcWindowAltConnection(this);
-	iAltConnectionWin->SetUpL(TPoint(iScreenSize.iWidth/4*3+EWinBorderSize,EWinBorderSize) ,TSize(winWidth4,winHeight),iAltConnection->iGroup,*iAltConnection->iGc);
-	iTest->DelayIfFullRomL();
-	SetSelfDrive(ETrue);
-	}
-
-void CTPointerCapture::NickFocusL()
-	{
-	iNickFocusGroup=new(ELeave) CPcWindowNickFocusGroup(this,Client());
-	iNickFocusGroup->ConstructL();
-	iNickFocusGroup->GroupWin()->SetOrdinalPosition(0,2);
-	iNickFocusBlankWin=new(ELeave) CTBlankWindow();
-	iNickFocusBlankWin->ConstructL(*iNickFocusGroup);
-	iNickFocusBlankWin->SetSize(TSize(1,1));
-	iNickFocusBlankWin->Activate();
-	}
-
-void CTPointerCapture::SetCapture(TInt aCaptureFlags)
-	{
-#if defined(LOGGING)
-	_LIT(KLog,"Change Capture  State=%d  CaptureFlags=0x%x");
-	LOG_MESSAGE3(KLog,iTest->iState,aCaptureFlags);
-#endif
-	iMainWin->Win()->SetPointerCapture(aCaptureFlags);
-	}
-
-void CTPointerCapture::SendEventsL()
-	{
-#if defined(LOGGING)
-	_LIT(KLog,"SendEvent  State=%d  SubState=%d");
-	LOG_MESSAGE3(KLog,iTest->iState,iSubState);
-#endif
-	switch (iSubState)
-		{
-	case 0:
-		iTest->SimulatePointerDownUp(iScreenSize.iWidth/4,iScreenSize.iHeight/8+EWinBorderSize/2);
-		break;
-	case 1:
-		if (iTest->iState>ECaptureDisabled)
-			{
-			iTest->SimulatePointerDownUp(iScreenSize.iWidth/4,3*iScreenSize.iHeight/8-EWinBorderSize/2);
-			break;
-			}
-	case 2:
-		iTest->SimulatePointerDownUp(5*iScreenSize.iWidth/8,iScreenSize.iHeight/4);
-		break;
-	case 3:
-		iTest->SimulatePointerDownUp(7*iScreenSize.iWidth/8,iScreenSize.iHeight/4);
-		break;
-	case 4:
-		if (iTest->IsFullRomL())
-			iTest->SimulateKeyDownUp(EStdKeyEnter);
-		else
-			iTest->SimulatePointerDownUp(0,0);
-		if (iTest->iState==ENormalCaptureWithoutFocus)
-			{
-			iTest->SimulateKeyDownUp(EStdKeyEscape);
-			break;
-			}
-		break;
-	default:
-		TEST(EFalse);
-		}
-	TheClient->iWs.Flush();
-	}
-
-void CTPointerCapture::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(TestNoCapture,"No capture");
-	_LIT(TestNormalCapture,"Normal capture");
-	_LIT(TestAllGroups,"All groups");
-	_LIT(TestDragDrop,"Drag & Drop");
-	_LIT(TestDragDropAllGroups,"Drag & Drop All groups");
-	_LIT(TestWithoutFocus,"Without focus");
-	StateChanged();
-	
-	if (!TestBase()->ConfigurationSupportsPointerEventTesting())
-	    {
-	    INFO_PRINTF1(_L("Test skipped because config does not support pointer event testing"));
-	    TestComplete();
-	    return;
-	    }
-	
-	((CTPointerCaptureStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(iTest->iState)
-		{
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0290
-  
-  @SYMDEF             DEF081259
- 
-  @SYMTestCaseDesc Test pointer capture can be disabled
-    
-  @SYMTestPriority High
- 
-  @SYMTestStatus Implemented
- 
-  @SYMTestActions Disable the pointer capture to the screen and simulate
-  					capture with the pointer
-  
-  @SYMTestExpectedResults The pointer capture has been disabled
- 
-*/
-		case ECaptureDisabled:
-			((CTPointerCaptureStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0290"));
-			if (TheClient->iScreen->GetScreenNumber()>0)
-				{
-				_LIT(KLog,"Cannot run this test on the 2nd screen - all pointer events goto the 1st screen");
-				LOG_MESSAGE(KLog);
-				TestComplete();
-				}
-			iTest->LogSubTest(TestNoCapture);
-			SetCapture(RWindowBase::TCaptureDisabled);
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0291
-  
-  @SYMDEF             DEF081259
- 
-  @SYMTestCaseDesc Test pointer capture can be enabled
-    
-  @SYMTestPriority High
- 
-  @SYMTestStatus Implemented
- 
-  @SYMTestActions Enable the pointer capture to the screen and simulate
-  					capture with the pointer
-  
-  @SYMTestExpectedResults The pointer capture has been enabled and works
-  							correctly
- 
-*/
-		case ENormalCapture:
-			((CTPointerCaptureStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0291"));
-			iTest->LogSubTest(TestNormalCapture);
-			SetCapture(RWindowBase::TCaptureEnabled);
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0292
-  
-  @SYMDEF             DEF081259
- 
-  @SYMTestCaseDesc Test pointer capture can be enabled for 
-  					windows belonging to any group
-    
-  @SYMTestPriority High
- 
-  @SYMTestStatus Implemented
- 
-  @SYMTestActions Enable the pointer capture to all windows and simulate
-  					capture with the pointer
-  
-  @SYMTestExpectedResults The pointer capture has been enabled and works
-  							correctly
- 
-*/
-		case ECaptureAllGroups:
-			((CTPointerCaptureStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0292"));
-			iTest->LogSubTest(TestAllGroups);
-			SetCapture(RWindowBase::TCaptureEnabled|RWindowBase::TCaptureFlagAllGroups);
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0293
-  
-  @SYMDEF             DEF081259
- 
-  @SYMTestCaseDesc Test drag and drop pointer capture can be enabled for 
-  					windows belonging to any group
-    
-  @SYMTestPriority High
- 
-  @SYMTestStatus Implemented
- 
-  @SYMTestActions Enable drag and drop  pointer capture to all windows and simulate
-  					capture with the pointer
-  
-  @SYMTestExpectedResults The pointer capture has been enabled and works
-  							correctly
- 
-*/
-		case EDragDropCapture:
-			((CTPointerCaptureStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0293"));
-			iTest->LogSubTest(TestDragDrop);
-			SetCapture(RWindowBase::TCaptureDragDrop&~RWindowBase::TCaptureFlagAllGroups);
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0294
-  
-  @SYMDEF             DEF081259
- 
-  @SYMTestCaseDesc Test drag and drop pointer capture can be enabled
-    
-  @SYMTestPriority High
- 
-  @SYMTestStatus Implemented
- 
-  @SYMTestActions Enable drag and drop  pointer capture and simulate
-  					capture with the pointer
-  
-  @SYMTestExpectedResults The pointer capture has been enabled and works
-  							correctly
- 
-*/
-		case EDragDropCaptureAllGroups:
-			((CTPointerCaptureStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0294"));
-			iTest->LogSubTest(TestDragDropAllGroups);
-			SetCapture(RWindowBase::TCaptureDragDrop);
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0295
-  
-  @SYMDEF             DEF081259
- 
-  @SYMTestCaseDesc Test pointer capture can be enabled
-    
-  @SYMTestPriority High
- 
-  @SYMTestStatus Implemented
- 
-  @SYMTestActions Enable the pointer capture to the screen and simulate capture
-  					with the pointer when the screen does not have the focus
-  
-  @SYMTestExpectedResults The pointer capture has been enabled and works
-  							correctly
- 
-*/
-		case ENormalCaptureWithoutFocus:
-			((CTPointerCaptureStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0295"));
-			iTest->LogSubTest(TestWithoutFocus);
-			NickFocusL();
-			SetCapture(RWindowBase::TCaptureEnabled);
-			break;
-		default:
-			((CTPointerCaptureStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTPointerCaptureStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-			return;
-		}
-	((CTPointerCaptureStep*)iStep)->RecordTestResultL();
-	SendEventsL();
-	}
-
-__WS_CONSTRUCT_STEP__(PointerCapture)
--- a/windowing/windowserver/tauto/TPNTCAP.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,200 +0,0 @@
-
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TPNTCAP_H__
-#define __TPNTCAP_H__
-
-#include <e32std.h>
-#include <e32svr.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-enum TTestState
-	{
-	ECaptureDisabled=0,
-	ENormalCapture,
-	ECaptureAllGroups,
-	EDragDropCapture,
-	EDragDropCaptureAllGroups,
-	ENormalCaptureWithoutFocus,
-	};
-
-enum TTestSubState
-	{
-	EMainWindow,
-	EChildWindow,
-	EOtherGroup,
-	EOtherSession,
-	ERootWindow,
-	};
-
-enum TPointerCheckRet
-	{
-	EFailed,
-	EOkay,
-	ENeedsDDEvent,
-	};
-
-const TInt ESubStates1=2;
-const TInt ESubStates2=5;
-const TInt ESubStates3=5;
-const TInt ESubStates4=5;
-const TInt ESubStates5=5;
-const TInt ESubStates6=5;
-
-const TInt EWinBorderSize=10;
-
-class CPcWindowBase;
-class CTPointerCapture;
-
-class CPcConnection : public CTClient
-	{
-public:
-	CPcConnection(CTPointerCapture *aTest);
-	~CPcConnection();
-	virtual void ConstructL();
-protected:
-	CTPointerCapture *iTest;
-	};
-
-class CPcWindowBase : public CTWin
-	{
-public:
-	CPcWindowBase(CTPointerCapture *aTest);
-	void SetUpL(TPoint pos,TSize size,CTWinBase *parent);
-	void SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
-	void Draw(TDesC &aBuf);
-	void PointerL(const TPointerEvent &pointer,const TTime &);
-	void DragDropL(const TPointerEvent &pointer,const TTime &);
-	virtual TPointerCheckRet PointerDown()=0;
-	virtual TPointerCheckRet DragDrop()=0;
-	virtual void SubStateChanged();
-protected:
-	CTPointerCapture *iTest;
-	TRgb iBack;
-	};
-
-class CPcWindowChild : public CPcWindowBase
-	{
-public:
-	CPcWindowChild(CTPointerCapture *aTest);
-	void Draw();
-	TPointerCheckRet PointerDown();
-	TPointerCheckRet DragDrop();
-	};
-
-class CPcWindowMain : public CPcWindowBase
-	{
-public:
-	CPcWindowMain(CTPointerCapture *aTest);
-	void Draw();
-	TPointerCheckRet PointerDown();
-	TPointerCheckRet DragDrop();
-	void WinKeyL(const TKeyEvent &aKey,const TTime &aTime);
-	};
-
-class CPcWindowAltGroup : public CPcWindowBase
-	{
-public:
-	CPcWindowAltGroup(CTPointerCapture *aTest);
-	void Draw();
-	TPointerCheckRet PointerDown();
-	TPointerCheckRet DragDrop();
-	};
-
-class CPcWindowNickFocusGroup : public CTWindowGroup
-	{
-public:
-	CPcWindowNickFocusGroup(CTPointerCapture *aTest, CTClient *aClient);
-	void KeyL(const TKeyEvent &aKey,const TTime &aTime);
-private:
-	CTPointerCapture *iTest;
-	};
-
-class CPcWindowAltConnection : public CPcWindowBase
-	{
-public:
-	CPcWindowAltConnection(CTPointerCapture *aTest);
-	void Draw();
-	TPointerCheckRet PointerDown();
-	TPointerCheckRet DragDrop();
-	};
-
-class CTPointerCapture : public CTWsGraphicsBase
-	{
-private:
-	enum TDState {DDStateNull, DDStateGot, DDStateWaiting};
-public:
-	CTPointerCapture(CTestStep* aStep);
-	~CTPointerCapture();
-	void ConstructL();
-	void NextTest();
-	void AbortTests();
-	TInt State() const;
-	TInt SubState() const;
-	void doIncSubStateL();
-	void IncSubStateL(TBool aNeedsDD=EFalse);
-	void GotDDL();
-	void StateChanged();
-	void TestFailed();
-	void NickFocusL();
-	void SetCapture(TInt aCaptureFlags);
-	inline TestClient* Client() {return TheClient;}
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	TInt doTestFailedL();
-	void SendEventsL();
-private:
-	CPcConnection *iAltConnection;
-	CTWindowGroup *iMainGroup;
-	CTWindowGroup *iAltGroup;
-	CPcWindowChild *iChildWin;
-	CPcWindowMain *iMainWin;
-	CPcWindowAltGroup *iAltGroupWin;
-	CPcWindowAltConnection *iAltConnectionWin;
-	CPcWindowNickFocusGroup *iNickFocusGroup;
-	CTBlankWindow *iNickFocusBlankWin;
-	//TInt iState;
-	TInt iSubState;
-	TDState iDDState;
-	TSize iScreenSize;
-public:
-	TBool iFailed;
-	};
-
-class CTPointerCaptureStep : public CTGraphicsStep
-	{
-public:
-	CTPointerCaptureStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTPointerCaptureStep,"TPointerCapture");
-
-
-#endif
--- a/windowing/windowserver/tauto/TPNTKEY.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TPNTKEY_H__
-#define __TPNTKEY_H__
-
-#include <e32std.h>
-#include <hal.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-const TInt ENumPntKeyTests=6;
-const TUint EModifierMask=EModifierCtrl|EModifierShift|EModifierFunc;
-
-class CTPntKey;
-
-class CTPntKeyWindow : public CTWin
-	{
-private:
-	enum {KPointerMoveBufferSize=32};
-public:
-	CTPntKeyWindow(CTPntKey *aTest);
-	~CTPntKeyWindow();
-	void SetUpLD(TPoint pos,TSize size,CTWinBase *parent);
-	void PointerL(const TPointerEvent &pointer,const TTime &aTime);
-	void KeyUpL(const TKeyEvent &aKey,const TTime &);
-	void KeyDownL(const TKeyEvent &aKey,const TTime &);
-	void WinKeyL(const TKeyEvent &aKey,const TTime &);
-	void SwitchOn(const TTime &aTime);
-	void NextKey();
-	void Test(TInt aCheck);
-	void Error(TInt aWhere);
-	void DrawButton(const TRect &aRect, const TDesC &aText);
-	void Draw();
-	void SendEvent();
-	void SimulatePointerDownUp(const TRect& aRect);
-	inline TInt KeyCount() {return iKeyCount;}
-private:	
-	TInt iKeyCount;
-	TRect iKey1;
-	TRect iKey2;
-	TRect iKey3;
-	static TInt iTestScanCodes[ENumPntKeyTests];
-	static TUint iTestCodes[ENumPntKeyTests];
-	static TUint iTestModifiers[ENumPntKeyTests];
-	CTPntKey *iTest;
-	};
-	
-class CTPntKey : public CTWsGraphicsBase
-{
-private:
-	enum {KTimeOutAfter=60000000};	//60secs
-	
-public:
-	CTPntKey(CTestStep* aStep);
-	~CTPntKey();
-	void ConstructL();
-	static TInt TimeOut(TAny* aTest);
-	void TimeOut();
-	void Failed(TInt aWhere);
-	inline TBool NoDigitiser() const {return iNoDigitiser;}
-	
-protected:	//from CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-	
-private:
-	inline TestClient *Client() {return TheClient;}
-	
-private:
-	CTimeOut* iTimeOut;
-	CTPntKeyWindow *iWin;
-	TSize iWinSize;
-	TInt iState;
-	TBool iFailed;
-	TBool iOldPointerState;
-	TBool iNoDigitiser;
-	};
-
-class CTPntKeyStep : public CTGraphicsStep
-	{
-public:
-	CTPntKeyStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTPntKeyStep,"TPntKey");
-
-
-#endif
--- a/windowing/windowserver/tauto/TPROCPRI.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,194 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test process priority control
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-
-#include "TPROCPRI.H"
-
-TName OtherGroupName;
-
-TInt ProcPriTestOtherProcess(TAny *aScreenNumber)
-	{
-	CTrapCleanup* CleanUpStack=CTrapCleanup::New();
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	// use correct screen
-	//
-	CWsScreenDevice* screen = NULL;
-	TInt err;
-	TRAP(err, screen = new (ELeave) CWsScreenDevice(ws));
-	if (err!=KErrNone)
-		return err;
-	if ((err=screen->Construct((TInt)aScreenNumber))!=KErrNone)
-		{
-		delete screen;
-		return err;
-		}
-	
-	RWindowGroup group(ws);
-	group.Construct(888);
-	group.SetName(OTHER_PROC_GROUP_NAME);
-	RSemaphore sem1;
-	RSemaphore sem2;
-	sem1.OpenGlobal(PROC_PRI_SEMAPHORE_NAME1);
-	sem2.OpenGlobal(PROC_PRI_SEMAPHORE_NAME2);
-	sem1.Signal();	// Signal thread fully initialised
-	sem2.Wait();		// Wait for command to disable focus
-//
-	group.EnableReceiptOfFocus(EFalse);
-	ws.Flush();
-	sem1.Signal();	// Signal focus disabled
-	sem2.Wait();		// Wait for command to enable focus
-
-	group.EnableReceiptOfFocus(ETrue);
-	ws.Flush();
-	sem1.Signal();	// Signal focus enabled
-	sem2.Wait();		// Wait until signalled to exit
-//
-	group.EnableReceiptOfFocus(EFalse);	// To stop shell being tasked into foreground
-	delete screen;
-	ws.Close();
-	sem1.Close();
-	sem2.Close();
-	delete CleanUpStack;
-	return(KErrNone);
-	}
-
-CTProcPri::CTProcPri(CTestStep* aStep) : CTWsGraphicsBase(aStep)
-	{
-	}
-
-CTProcPri::~CTProcPri()
-	{
-	if (iFlags&ECreatedSem1)
-		iSem1.Close();
-	if (iFlags&ECreatedSem2)
-		iSem2.Close();
-	delete iProcess;
-	}
-
-void CTProcPri::TestPriChangeL()
-	{
-	#define BACK_PRI EPriorityForeground
-	#define FORE_PRI EPriorityForeground
-	RProcess proc;
-	TEST(proc.Priority()==BACK_PRI);
-	if (proc.Priority()!=BACK_PRI)
-		INFO_PRINTF3(_L("proc.Priority() return value - Expected: %d, Actual: %d"), BACK_PRI, proc.Priority());		
-
-	iSem2.Signal();
-	iSem1.Wait();
-
-	TEST(proc.Priority()==FORE_PRI);
-	if (proc.Priority()!=FORE_PRI)
-		INFO_PRINTF3(_L("proc.Priority() return value - Expected: %d, Actual: %d"), FORE_PRI, proc.Priority());		
-
-	iSem2.Signal();
-	iSem1.Wait();
-
-	TEST(proc.Priority()==BACK_PRI);
-	if (proc.Priority()!=BACK_PRI)
-		INFO_PRINTF3(_L("proc.Priority() return value - Expected: %d, Actual: %d"), BACK_PRI, proc.Priority());		
-
-	TInt ident;
-	User::LeaveIfError(ident=TheClient->iWs.FindWindowGroupIdentifier(0,OTHER_PROC_GROUP_NAME,0));
-	TInt retVal = TheClient->iWs.SetWindowGroupOrdinalPosition(ident,1);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("TheClient->iWs.SetWindowGroupOrdinalPosition(ident,1) return value - Expected: %d, Actual: %d"), KErrNone, retVal);		
-
-	TEST(proc.Priority()==FORE_PRI);
-	if (proc.Priority()!=FORE_PRI)
-		INFO_PRINTF3(_L("proc.Priority() return value - Expected: %d, Actual: %d"), FORE_PRI, proc.Priority());		
-
-	retVal = TheClient->iWs.SetWindowGroupOrdinalPosition(ident,0);
-	TEST(retVal==KErrNone);
-	if (retVal!=KErrNone)
-		INFO_PRINTF3(_L("TheClient->iWs.SetWindowGroupOrdinalPosition(ident,0) return value - Expected: %d, Actual: %d"), KErrNone, retVal);		
-
-	TEST(proc.Priority()==BACK_PRI);
-	if (proc.Priority()!=BACK_PRI)
-		INFO_PRINTF3(_L("proc.Priority() return value - Expected: %d, Actual: %d"), BACK_PRI, proc.Priority());		
-
-	TRequestStatus stat;
-	iProcess->Logon(stat);		//Must Logon before the last Signal so we can be sure that it is still alive to get round a base issue
-	iSem2.Signal();
-	User::WaitForRequest(stat);
-
-	TEST(proc.Priority()==FORE_PRI);
-		if (proc.Priority()!=FORE_PRI)
-		INFO_PRINTF3(_L("proc.Priority() return value - Expected: %d, Actual: %d"), FORE_PRI, proc.Priority());		
-
-	}
-
-void CTProcPri::ConstructL()
-	{
-	User::LeaveIfError(iSem1.CreateGlobal(PROC_PRI_SEMAPHORE_NAME1,0,KOwnerType));
-	iFlags|=ECreatedSem1;
-	User::LeaveIfError(iSem2.CreateGlobal(PROC_PRI_SEMAPHORE_NAME2,0,KOwnerType));
-	iFlags|=ECreatedSem2;
-	iProcess=CProcess::NewL(CProcess::eProcessPriortyTest,iTest->iScreenNumber);
-	iSem1.Wait();
-	}
-	
-void CTProcPri::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(KTest1,"Priority Change");
-	((CTProcPriStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-		
-	switch(++iTest->iState)
-		{
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0315
-  
-  @SYMDEF             DEF081259
- 
-  @SYMTestCaseDesc Test that the priority of a process or thread changes depending
-  					on how the the process or thread is being used
-    
-  @SYMTestPriority High
- 
-  @SYMTestStatus Implemented
- 
-  @SYMTestActions Create a process or thread and use it. Check the priority of the
-  					process or thread changes depending on how it is being used
-  
-  @SYMTestExpectedResults Prioirty of the process of thread changes depending on
-  							how it is being used
- 
-*/
-	case 1:
-		((CTProcPriStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0315"));
-		iTest->LogSubTest(KTest1);
-		TestPriChangeL();
-		break;
-	case 2:
-		((CTProcPriStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-		((CTProcPriStep*)iStep)->CloseTMSGraphicsStep();
-		TestComplete();
-		break;
-		}
-	((CTProcPriStep*)iStep)->RecordTestResultL();
-	}
-	
-__WS_CONSTRUCT_STEP__(ProcPri)
--- a/windowing/windowserver/tauto/TPROCPRI.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TPROCPRI_H__
-#define __TPROCPRI_H__
-
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-#include "../tlib/testbase.h"
-#include <e32std.h>
-#include <w32std.h>
-
-#define OTHER_PROC_GROUP_NAME _L("OtherProcGroupWindow")
-#define PROC_PRI_SEMAPHORE_NAME1 _L("abcerProcSem1")
-#define PROC_PRI_SEMAPHORE_NAME2 _L("OtherProcSem2")
-
-class CTProcPri : public CTWsGraphicsBase
-	{
-private:
-	enum
-		{
-		ECreatedSem1=0x0001,
-		ECreatedSem2=0x0002,
-		};
-public:
-	CTProcPri(CTestStep* aStep);
-	~CTProcPri();
-	void ConstructL();
-	void TestPriChangeL();
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	TSize iWinSize;
-	RSemaphore iSem1;
-	RSemaphore iSem2;
-	TUint iFlags;
-	CProcess* iProcess;
-	};
-
-
-class CTProcPriStep : public CTGraphicsStep
-	{
-public:
-	CTProcPriStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTProcPriStep,"TProcPri");
-
-
-#endif
--- a/windowing/windowserver/tauto/TPntKey.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,385 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Converted from TMan test code (TMPNTKEY.CPP) May 2001
-// Test Pointer move/drag buffer
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TPNTKEY.H"
-
-#define LOGGING on	//Uncomment this line to get more logging
-
-TInt CTPntKeyWindow::iTestScanCodes[ENumPntKeyTests]={'A','B',0,'C',EStdKeyEnter,'Y'};
-TUint CTPntKeyWindow::iTestCodes[ENumPntKeyTests]={'a','B',0,'c',EKeyEnter,'y'};
-TUint CTPntKeyWindow::iTestModifiers[ENumPntKeyTests]={0,EModifierShift,0,0,0,0};
-
-CTPntKeyWindow::CTPntKeyWindow(CTPntKey *aTest) : iTest(aTest)
-	{}
-
-CTPntKeyWindow::~CTPntKeyWindow()
-	{
-	}
-
-void CTPntKeyWindow::SetUpLD(TPoint pos,TSize size,CTWinBase *parent)
-	{
-	ConstructExtLD(*parent,pos,size);
-	iWin.SetPointerGrab(ETrue);
-	iKey1=TRect(size.iWidth*1/16,size.iHeight/2,size.iWidth*5/16,size.iHeight);
-	iKey2=TRect(size.iWidth*6/16,size.iHeight/2,size.iWidth*10/16,size.iHeight);
-	iKey3=TRect(size.iWidth*11/16,size.iHeight/2,size.iWidth*15/16,size.iHeight);
-	iWin.AddKeyRect(iKey1,'A',EFalse);
-	iWin.AddKeyRect(iKey2,'B',EFalse);
-	AssignGC(*Client()->iGc);
-	BaseWin()->EnableOnEvents();
-	Activate();
-	}
-
-void CTPntKeyWindow::Error(TInt aWhere)
-	{
-	iTest->Failed(aWhere);
-	}
-
-void CTPntKeyWindow::NextKey()
-	{
-	if (++iKeyCount!=ENumPntKeyTests)
-		{
-	#if defined(LOGGING)
-		_LIT(KLog,"Next Key  KeyCount=%d");
-		iTest->LOG_MESSAGE2(KLog,iKeyCount);
-	#endif
-		if (iKeyCount==2)
-			iWin.RemoveAllKeyRects();
-		else if (iKeyCount==3)
-			iWin.AddKeyRect(iKey3,'C',EFalse);
-		else if (iKeyCount==4)
-			{
-	#if !defined(__WINS__)
-			if (iTest->NoDigitiser())
-				{
-				return;
-				}
-	#endif
-			iWin.RemoveAllKeyRects();
-			iWin.AddKeyRect(TRect(Client()->iScreen->SizeInPixels()),'Z',EFalse);
-			}
-		else if (iKeyCount==5)
-			{
-			iWin.RemoveAllKeyRects();
-			Client()->iWs.Flush();
-			User::After(500000);	// Wait half a second
-			iWin.AddKeyRect(TRect(Client()->iScreen->SizeInPixels()),'Y',ETrue);
-			}
-		Invalidate();
-		}
-	SendEvent();
-	}
-
-void CTPntKeyWindow::SendEvent()
-	{
-	TheClient->WaitForRedrawsToFinish();
-#if defined(LOGGING)
-	_LIT(KLog,"SendEvent  KeyCount=%d");
-	iTest->LOG_MESSAGE2(KLog,iKeyCount);
-#endif
-	switch(iKeyCount)
-		{
-		case 0:
-			SimulatePointerDownUp(iKey1);
-			break;
-		case 1:
-			iTest->TestBase()->SimulateKey(TRawEvent::EKeyDown,EStdKeyLeftShift);
-			SimulatePointerDownUp(iKey2);
-			iTest->TestBase()->SimulateKey(TRawEvent::EKeyUp,EStdKeyLeftShift);
-			break;
-		case 2:
-		case 5:
-			{
-			TPoint pos=Position();
-			TSize size=Size();
-			iTest->TestBase()->SimulatePointerDownUp(pos.iX+size.iWidth/2,pos.iY+size.iHeight/4);
-			}
-			break;
-		case 3:
-			SimulatePointerDownUp(iKey3);
-			break;
-		case 4:
-			iTest->TestBase()->SimulateKeyDownUp(EStdKeyEnter);
-			break;
-		}
-	}
-
-void CTPntKeyWindow::SimulatePointerDownUp(const TRect& aRect)
-	{
-	iTest->TestBase()->SimulatePointerDownUp((aRect.iTl.iX+aRect.iBr.iX)/2,(aRect.iTl.iY+aRect.iBr.iY)/2);
-	}
-
-void CTPntKeyWindow::Test(TInt aCheck)
-	{
-	if (!aCheck)
-		Error(3);
-	}
-
-void CTPntKeyWindow::KeyUpL(const TKeyEvent &aKey,const TTime&)
-	{
-	if (aKey.iScanCode==iTestScanCodes[iKeyCount])
-		NextKey();
-	}
-
-void CTPntKeyWindow::KeyDownL(const TKeyEvent &aKey,const TTime &)
-	{
-#if defined(LOGGING)
-	_LIT(KLog,"KeyDownL  ScanCode=%d '%c' (%d)  KeyCount=%d");
-	iTest->LOG_MESSAGE5(KLog,aKey.iScanCode,aKey.iScanCode,iTestScanCodes[iKeyCount],iKeyCount);
-#endif
-	if (aKey.iScanCode!=EStdKeyLeftFunc && aKey.iScanCode!=EStdKeyRightFunc && 
-		 aKey.iScanCode!=EStdKeyLeftAlt && aKey.iScanCode!=EStdKeyRightAlt &&
-		 aKey.iScanCode!=EStdKeyLeftCtrl && aKey.iScanCode!=EStdKeyRightCtrl &&
-		 aKey.iScanCode!=EStdKeyLeftShift && aKey.iScanCode!=EStdKeyRightShift && 
-		 aKey.iScanCode!=EStdKeyOff &&
-		 aKey.iScanCode!=EStdKeyEscape)
-		Test(aKey.iScanCode==iTestScanCodes[iKeyCount]);
-	}
-
-void CTPntKeyWindow::WinKeyL(const TKeyEvent &aKey,const TTime &)
-	{
-	if (aKey.iCode!=EKeyEscape)
-		{
-#if defined(LOGGING)
-		_LIT(KLog1,"WinKeyL1  ScanCode=%d (%d)  Code=%d '%c' (%d)");
-		_LIT(KLog2,"WinKeyL2  ScanCode=%d  Modifiers=0x%x (0x%x) KeyCount=%d");
-		iTest->LOG_MESSAGE6(KLog1,aKey.iScanCode,iTestScanCodes[iKeyCount],aKey.iCode,aKey.iCode,iTestCodes[iKeyCount]);
-		iTest->LOG_MESSAGE5(KLog2,aKey.iScanCode,aKey.iModifiers&EModifierMask,iTestModifiers[iKeyCount]&EModifierMask,iKeyCount);
-#endif
-		Test(aKey.iScanCode==iTestScanCodes[iKeyCount]);
-		Test(aKey.iCode==iTestCodes[iKeyCount]);
-		Test((aKey.iModifiers&EModifierMask)==(iTestModifiers[iKeyCount]&EModifierMask));
-		}
-	}
-
-void CTPntKeyWindow::SwitchOn(const TTime &)
-	{
-#if defined(LOGGING)
-	_LIT(KLog,"SwitchOn  KeyCount=%d");
-	iTest->LOG_MESSAGE2(KLog,iKeyCount);
-#endif
-	if (iKeyCount==4)
-		NextKey();
- 	else if (iKeyCount!=5)
-		Error(2);
-	}
-
-void CTPntKeyWindow::PointerL(const TPointerEvent &aPointer,const TTime &)
-	{
-#if defined(LOGGING)
-	_LIT(KLog,"Pointer Event  Type=%d  Pos=(%d,%d)  PPos=(%d,%d)  KeyCount=%d");
-	iTest->LOG_MESSAGE7(KLog,aPointer.iType,aPointer.iPosition.iX,aPointer.iPosition.iY
-						,aPointer.iParentPosition.iX,aPointer.iParentPosition.iY,iKeyCount);
-#endif
-	if (aPointer.iType==TPointerEvent::EButton1Down)
-		{
-		if (iKeyCount!=2)
-			Error(1);
-		else
-			NextKey();
-		}
-	}
-
-void CTPntKeyWindow::DrawButton(const TRect &aRect, const TDesC &aText)
-	{
-	iGc->DrawRect(aRect);
-	iGc->DrawText(aText, TPoint((aRect.iBr.iX+aRect.iTl.iX)/2,(aRect.iBr.iY+aRect.iTl.iY)/2));
-	}
-
-void CTPntKeyWindow::Draw()
-	{
-	iGc->SetBrushColor(TRgb::Gray4(0));
-	iGc->SetPenColor(TRgb::Gray4(3));
-	iGc->Clear();
-	DrawButton(iKey1,_L("A"));
-	DrawButton(iKey2,_L("B"));
-	DrawButton(iKey3,_L("C"));
-	switch(iKeyCount)
-		{
-		case 0:
-			iGc->DrawText(_L("Click on 'A'"), TPoint(10,20));
-			break;
-		case 1:
-			iGc->DrawText(_L("Shift-Click on 'B'"), TPoint(10,20));
-			break;
-		case 2:
-			iGc->DrawText(_L("Click anywhere in this window"), TPoint(10,20));
-			break;
-		case 3:
-			iGc->DrawText(_L("Click on 'C'"), TPoint(10,20));
-			break;
-		case 4:
-#if defined(__WINS__)	// Can't emulate touching dig when switched off under WINS
-			iGc->DrawText(_L("Switch off and on (or press Enter)"), TPoint(10,20));
-#else
-			iGc->DrawText(_L("Switch off, then touch the screen to switch on"), TPoint(10,20));
-#endif
-			break;
-		case 5:
-#if defined(__WINS__)	// Can't emulate touching dig when switched off under WINS
-			iGc->DrawText(_L("Touch anywhere in the window"), TPoint(10,20));
-#else
-			iGc->DrawText(_L("Switch off and touch the screen to switch on again"), TPoint(10,20));
-#endif
-			break;
-		}
-	}
-
-CTPntKey::CTPntKey(CTestStep* aStep):
-	CTWsGraphicsBase(aStep)
-	{
-	}
-
-CTPntKey::~CTPntKey()
-	{
-	HAL::Set(HALData::EPenDisplayOn,iOldPointerState);
-	CTWin::Delete(iWin);
-	Client()->ResetFocus();
-	delete iTimeOut;
-	}
-
-TInt CTPntKey::TimeOut(TAny* aTest)		//static
-	{
-	static_cast<CTPntKey*>(aTest)->TimeOut();
-	return(KErrNone);
-	}
-
-void CTPntKey::TimeOut()
-	{
-	TLogMessageText buf;
-	_LIT(KPntKeyTimeOut,"TIMEOUT: Pointer Key, %d, %S");
-	buf.AppendFormat(KPntKeyTimeOut,iState,&TestBase()->iSubTitle);
-	TheClient->LogMessage(buf);
-	Failed(4);
-	}
-
-void CTPntKey::Failed(TInt aWhere)
-	{
-	_LIT(KLog,"Failed at %d");
-	LOG_MESSAGE2(KLog,aWhere);
-	if (!iFailed)
-		{
-		iFailed=ETrue;
-		Client()->iGroup->ClearCurrentWindow();
-		}
-	}
-
-void CTPntKey::ConstructL()
-	{
-	TInt mods=TheClient->iWs.GetModifierState();
-	if (mods&EModifierCapsLock)
-		iTest->SimulateKeyDownUp(EStdKeyCapsLock);
-	//Make sure all the keys we test are in the up state
-	iTest->SimulateKeyDownUp(EStdKeyLeftShift);
-	iTest->SimulateKeyDownUp(EStdKeyRightShift);
-	iTest->SimulateKeyDownUp(EStdKeyLeftFunc);
-	iTest->SimulateKeyDownUp(EStdKeyLeftCtrl);
-	iTest->SimulateKeyDownUp(EStdKeyRightCtrl);
-	mods=TheClient->iWs.GetModifierState();
-	_LIT(KLog,"Initial Modifiers state 0x%x (ideally should be zero)");
-	LOG_MESSAGE2(KLog,mods);
-	TheClient->iScreen->SetScreenMode(0);		//May sure we are in the right screen size mode
-	TheClient->iScreen->SetAppScreenMode(0);
-	TheClient->iWs.SetPointerCursorArea(TestBase()->iNormalPointerCursorArea);
-	CTPntKeyWindow *win=new(ELeave) CTPntKeyWindow(this);
-	win->SetUpLD(TPoint(20,20),Client()->iScreen->SizeInPixels()-TSize(40,40),Client()->iGroup);
-	iWin=win;
-	Client()->iGroup->SetCurrentWindow(iWin);
-	iNoDigitiser=EFalse;
-	TInt err=HAL::Get(HALData::EPenDisplayOn,iOldPointerState);
-	if (err==KErrNotSupported)
-		{
-		iNoDigitiser=ETrue;
-		}
-	else if (err==KErrNone)
-		{
-		err=HAL::Set(HALData::EPenDisplayOn,ETrue);
-		if (err==KErrNotSupported)
-			iNoDigitiser=(!iOldPointerState);
-		}
-	else
-		{
-		TEST(EFalse);
-		}
-	TheClient->WaitForRedrawsToFinish();	//Make sure all pending events have been delt with (redraw events are lowest priority)
-	iTimeOut=new(ELeave) CTimeOut();
-	iTimeOut->ConstructL();
-	iTimeOut->Start(KTimeOutAfter,TCallBack(CTPntKey::TimeOut,this));
-	}
-
-void CTPntKey::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(KTestName,"Key set 1");
-	TEST(!iFailed);
-	if (iFailed)
-		{
-		_LIT(KLog,"Test Failed  Substate=%d  KeyCount=%d");
-		LOG_MESSAGE3(KLog,iTest->iState,iWin->KeyCount());
-		}
-	((CTPntKeyStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(++iTest->iState)
-		{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0200
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test Pointer move/drag buffer
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Exercise the pointer move/drag buffer and check
-					that it functions correctly
-
-@SYMTestExpectedResults The buffer functions correctly
-*/
-		case 1:
-			((CTPntKeyStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0200"));
-			iTest->LogSubTest(KTestName);
-			if (TestBase()->ConfigurationSupportsPointerEventTesting())
-			    {
-			    iWin->SendEvent();
-			    TheClient->Flush();
-			    }
-			else
-			    {
-			    INFO_PRINTF1(_L("Test skipped because config does not support pointer event testing"));
-			    }
-			break;
-		case 2:
-			((CTPntKeyStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTPntKeyStep*)iStep)->CloseTMSGraphicsStep();
-			if (TestBase()->ConfigurationSupportsPointerEventTesting())
-			    {
-                iTimeOut->Cancel();
-			    }
-			TestComplete();
-			break;
-		}
-	((CTPntKeyStep*)iStep)->RecordTestResultL();
-	}
-	
-__WS_CONSTRUCT_STEP__(PntKey)
--- a/windowing/windowserver/tauto/TPointer.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1087 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test pointer event handling
-// Coverted from TMan test code (TMPOINTR.CPP) October 2000
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TPointer.H"
-
-
-//#define LOGGING
-
-#if defined(LOGGING)
-	LOCAL_D TLogMessageText LogMessageText;
-#endif
-
-
-CPointerWindow::CPointerWindow(CTPointer *aTest) : CTWin(), iTest(aTest)
-	{}
-
-void CPointerWindow::SetState(TInt aState)
-	{
-#if defined(LOGGING)
-	_LIT(KState,"CPointerWindow::SetState(%d) OldState=%d");
-	LogMessageText.Format(KState,aState,iState);
-	TheClient->LogMessage(LogMessageText);
-#endif
-	iState=aState;
-	iWin.Invalidate();
-	switch(aState)
-		{
-		case KStateWaitingForTest1:
-		case KStateWaitingForTest2:
-		case KStateWaitingForTest3:
-		case KStateWaitingForTest4:
-		case KStateWaitingForTest5:
-		case KStateWaitingForTest6:
-		case KStateWaitingForTest8:
-		case KStateWaitingForTest7:
-			iRepeatRect=TRect();
-			break;
-		case KStateTesting8:
-			iWin.Close();
-			Client()->iWs.Flush();
-			User::After(500000);
-			FinishedTests();
-			break;
-		}
-	TheClient->WaitForRedrawsToFinish();
-	SendEvent();
-	}
-
-void CPointerWindow::ResetTest(TInt aState)
-	{
-	TInt newState=KStateFinished;
-	switch(aState)
-		{
-		case KStateTesting1:
-			newState=KStateWaitingForTest1;
-			break;
-		case KStateTesting2:
-			newState=KStateWaitingForTest2;
-			break;
-		case KStateTesting3:
-			newState=KStateWaitingForTest3;
-			break;
-		case KStateTesting4:
-			newState=KStateWaitingForTest4;
-			break;
-		case KStateTesting5:
-			newState=KStateWaitingForTest5;
-			break;
-		case KStateTesting6:
-			newState=KStateWaitingForTest6;
-			break;
-		case KStateTesting8:
-			newState=KStateWaitingForTest8;
-			break;
-		case KStateTesting7:
-			newState=KStateWaitingForTest7;
-			break;
-		}
-	TheClient->iWs.PurgePointerEvents();
-	SetState(newState);
-	}
-
-void CPointerWindow::SetUpLD(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc)
-	{
-	ConstructExtLD(*parent,pos,size);
-	iTl=pos;
-	iSize=size;
-	Activate();
-	AssignGC(aGc);
-	SetState(KStateWaitingForTest1);
-	BaseWin()->EnableOnEvents();
-	}
-
-void CPointerWindow::Draw()
-	{
-	iGc->Clear();
-	iGc->DrawRect(Size());
-	iGc->DrawRect(iRepeatRect);
-	TBuf<0x80> buf;
-	TBuf<0x80> buf2;
-	switch(iState)
-		{
-		case KStateWaitingForTest1:
-			{
-			_LIT(Draw1,"Click anywhere in the window and hold the pointer steady");
-			buf.Format(Draw1);
-			}
-			break;
-		case KStateTesting1:
-			{
-			_LIT(Draw2,"Hold pointer inside the box");
-			buf.Format(Draw2);
-			}
-			break;
-		case KStateWaitingForTest2:
-			{
-			_LIT(Draw3,"Release the pointer then click in the window and hold the pointer steady");
-			buf.Format(Draw3);
-			}
-			break;
-		case KStateTesting2:
-			{
-			_LIT(Draw4,"Drag the pointer outside the box");
-			buf.Format(Draw4);
-			}
-			break;
-		case KStateWaitingForTest3:
-			{
-			_LIT(Draw5,"Release the pointer then click in the window and hold the pointer steady");
-			buf.Format(Draw5);
-			}
-			break;
-		case KStateTesting3:
-			{
-			_LIT(Draw6,"Release the pointer");
-			buf.Format(Draw6);
-			}
-			break;
-		case KStateWaitingForTest4:
-			{
-			_LIT(Draw7,"Click anywhere in the window and move the pointer slightly");
-			buf.Format(Draw7);
-			}
-			break;
-		case KStateTesting4:
-			{
-			_LIT(Draw8,"Release the pointer");
-			buf.Format(Draw8);
-			}
-			break;
-		case KStateWaitingForTest5:
-			{
-			_LIT(Draw9,"Click anywhere in the window and move the pointer slightly");
-			buf.Format(Draw9);
-			}
-			break;
-		case KStateTesting5:
-			{
-			_LIT(Draw10,"Release the pointer");
-			buf.Format(Draw10);
-			break;
-			}
-		case KStateWaitingForTest6:
-			{
-			_LIT(Draw11,"Click anywhere in the window");
-			buf.Format(Draw11);
-			}
-			break;
-		case KStateTesting6:
-			{
-			_LIT(Draw12,"Move the pointer");
-			buf.Format(Draw12);
-			}
-			break;
-		case KStateWaitingForTest8:
-			{
-			_LIT(Draw13,"Click anywhere in the window, and keep the pointer pressed");
-			buf.Format(Draw13);
-			}
-			break;
-		case KStateTesting8:
-			buf.Format(KNullDesC);
-			break;
-		case KStateWaitingForTest7:
-			{
-			_LIT(Draw14,"Switch off and touch the center of the screen");
-			buf.Format(Draw14);
-			}
-			break;
-		case KStateTesting7:
-			buf.Format(KNullDesC);
-			break;
-		}
-	switch(iState)
-		{
-		case KStateTesting1:
-			{
-			_LIT(Repeat2,"Repeat (%d/%d), interval=%d.%d");
-			buf2.Format(Repeat2,iRepeatCount,KRepeatCount,iInterval.Int()/1000000,(iInterval.Int()%1000000)/100000);
-			}
-			break;
-		case KStateTesting2:
-		case KStateTesting3:
-			{
-			_LIT(Repeat1,"Repeat (%d), interval=%d.%d");
-			buf2.Format(Repeat1,iRepeatCount,iInterval.Int()/1000000,(iInterval.Int()%1000000)/100000);
-			}
-			break;
-		}
-	iGc->DrawText(buf,TPoint(10,20));
-	iGc->DrawText(buf2,TPoint(10,40));
-	}
-
-void CPointerWindow::FinishedTests()
-	{
-	iState=KStateFinished;
-	}
-
-void CPointerWindow::StartNextRepeatTest()
-	{
-	iInterval=0;
-	iRepeatCount=0;
-	if (iState==KStateWaitingForTest4)
-		User::After(TTimeIntervalMicroSeconds32(1000000));
-	else if (iState==KStateWaitingForTest5)
-		User::After(TTimeIntervalMicroSeconds32(1000000));
-	QueueNextRepeat();
-	switch(iState)
-		{
-		case KStateWaitingForTest1:
-			SetState(KStateTesting1);
-			break;
-		case KStateWaitingForTest2:
-			SetState(KStateTesting2);
-			break;
-		case KStateWaitingForTest3:
-			SetState(KStateTesting3);
-			break;
-		case KStateWaitingForTest4:
-			SetState(KStateTesting4);
-			break;
-		case KStateWaitingForTest5:
-			SetState(KStateTesting5);
-			break;
-		case KStateWaitingForTest6:
-			SetState(KStateTesting6);
-			break;
-		case KStateWaitingForTest8:
-			SetState(KStateTesting8);
-			break;
-		case KStateWaitingForTest7:
-			SetState(KStateTesting7);
-			break;
-		}
-	}
-
-void CPointerWindow::QueueNextRepeat()
-	{
-	iInterval=iInterval.Int()+KRepeatIntervalIncrements;
-#if defined(LOGGING)
-	/*_LIT(KRequestRepeat,"Request Repeat, State=%d, Interval=%d");
-	TLogMessageText buf;
-	buf.Format(KRequestRepeat,iState,iInterval.Int());
-	TheClient->LogMessage(buf);*/
-#endif
-	iWin.RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32(iInterval),TRect(iRepeatRect));
-	iPrevTime.HomeTime();
-	iWin.Invalidate();
-	}
-
-void CPointerWindow::PointerL(const TPointerEvent &aPointer,const TTime &aTime)
-	{
-#if defined(LOGGING)
-	_LIT(KPointer,"CPointerWindow::PointerL(Type=%d, Pos=(%d,%d), ParPos=(%d,%d), Mod=0x%x) State=%d");
-	LogMessageText.Format(KPointer,aPointer.iType,aPointer.iPosition.iX,aPointer.iPosition.iY,aPointer.iParentPosition.iX,aPointer.iParentPosition.iY,aPointer.iModifiers,iState);
-	TheClient->LogMessage(LogMessageText);
-#endif
-	if (aPointer.iType==TPointerEvent::EButtonRepeat)
-		{
-		if (iState!=KStateTesting1 && iState!=KStateTesting2 && iState!=KStateTesting3 && iState!=KStateTesting4)
-			TestFailed();
-		else
-			{
-			TTimeIntervalMicroSeconds32 interval(I64LOW(aTime.MicroSecondsFrom(iPrevTime).Int64()));
-			TBool fail1=(interval.Int()<(iInterval.Int()-KRepeatMargin) || interval.Int()>(iInterval.Int()+KRepeatMargin));
-			if (fail1)
-				{
-				_LIT(KPointerRepeat1,"Pointer Repeat Interval, Exp=%d, Act=%d, F1=%d, F2=%d");
-				TLogMessageText buf;
-				TBool fail2=(interval.Int()<(iInterval.Int()-2*KRepeatMargin) || interval.Int()>(iInterval.Int()+3*KRepeatMargin));
-				buf.Format(KPointerRepeat1,iInterval.Int(),interval.Int(),fail1,fail2);
-				TheClient->LogMessage(buf);
-				}
-			if (interval.Int()<(iInterval.Int()-
-		#if defined(__MARM_ARM4__)
-												2*
-		#endif
-												  KRepeatMargin) || interval.Int()>(iInterval.Int()+
-		#if defined(__MARM_ARM4__)
-																								    3*
-		#endif
-																									  KRepeatMargin))
-				TestFailed();
-			else
-				{
-				if (!iRepeatRect.Contains(aPointer.iPosition) ||
-					aPointer.iParentPosition!=(aPointer.iPosition+iWin.InquireOffset(*Parent()->WinTreeNode())))
-					TestFailed();
-				else
-					{
-					iRepeatCount++;
-					if (iState==KStateTesting1 && iRepeatCount==KRepeatCount)
-						{
-						QueueNextRepeat();
-						Client()->iWs.Flush();
-						User::After(TTimeIntervalMicroSeconds32(iRepeatCount*KRepeatIntervalIncrements));
-						iWin.CancelPointerRepeatEventRequest();
-						SetState(KStateWaitingForTest2);
-						}
-					else
-						QueueNextRepeat();
-					}
-				}
-			}
-		}
-	else switch(iState)
-		{
-		case KStateWaitingForTest1:
-		case KStateWaitingForTest2:
-		case KStateWaitingForTest3:
-		case KStateWaitingForTest4:
-		case KStateWaitingForTest8:
-			if (aPointer.iType==TPointerEvent::EButton1Down)
-				{
-				iRepeatRect.iTl=aPointer.iPosition-TPoint(KRepeatRectXExtra,KRepeatRectYExtra);
-				iRepeatRect.iBr=aPointer.iPosition+TPoint(KRepeatRectXExtra,KRepeatRectYExtra);
-				StartNextRepeatTest();
-				}
-			break;
-		case KStateWaitingForTest5:
-			if (aPointer.iType==TPointerEvent::EButton1Down)
-				{
-				iRepeatRect.iTl=aPointer.iPosition;
-				iRepeatRect.iBr=aPointer.iPosition+TPoint(1,1);
-				StartNextRepeatTest();
-				}
-			break;
-		case KStateWaitingForTest6:
-			if (aPointer.iType==TPointerEvent::EButton1Down)
-				{
-				iRepeatRect.iTl=aPointer.iPosition+TPoint(KRepeatRectXExtra,KRepeatRectYExtra);
-				iRepeatRect.iBr=aPointer.iPosition+TPoint(2*KRepeatRectXExtra,2*KRepeatRectYExtra);
-				StartNextRepeatTest();
-				}
-			break;
-		case KStateTesting1:
-			{
-			TBool isDrag=(aPointer.iType==TPointerEvent::EDrag);
-			TestFailed(isDrag);
-			if (isDrag)
-				{
-				iTest->SimulatePointer(TRawEvent::EButton1Down,aPointer.iPosition.iX,aPointer.iPosition.iY);
-				iTest->SimulatePointer(TRawEvent::EButton1Up,aPointer.iPosition.iX,aPointer.iPosition.iY);
-				}
-			}
-			break;
-		case KStateTesting2:
-			if (aPointer.iType==TPointerEvent::EDrag)
-				SetState(KStateWaitingForTest3);
-			else
-				TestFailed();
-			break;
-		case KStateTesting3:
-			if (aPointer.iType==TPointerEvent::EButton1Up)
-				SetState(KStateWaitingForTest4);
-			else
-				TestFailed();
-			break;
-		case KStateTesting4:
-			if (aPointer.iType==TPointerEvent::EButton1Up)
-				SetState(KStateWaitingForTest5);
-			else
-				TestFailed();
-			break;
-		case KStateTesting5:
-			if (aPointer.iType==TPointerEvent::EButton1Up)
-				SetState(KStateWaitingForTest6);
-			else if (aPointer.iType!=TPointerEvent::EDrag)
-				TestFailed();
-			break;
-		case KStateTesting6:
-			if (aPointer.iType==TPointerEvent::EDrag)
-				{
-		//#if !defined(__WINS__)	// Can't emulate touching dig when switched off under WINS
-		//		if (iTest->Digitiser())
-					SetState(KStateWaitingForTest7);
-		/*		else
-		#endif
-					SetState(KStateWaitingForTest8);*/
-				}
-			else
-				TestFailed();
-			break;
-		case KStateWaitingForTest7:
-			if (aPointer.iType==TPointerEvent::EButton1Down || aPointer.iType==TPointerEvent::ESwitchOn)
-				TestFailed();
-			break;
-		case KStateTesting7:
-			if (aPointer.iType!=TPointerEvent::ESwitchOn)
-				TestFailed();
-			else
-				SetState(KStateWaitingForTest8);
-			break;
-		case KStateTesting8:
-			break;
-		}
-	}
-
-void CPointerWindow::TestFailed(TBool aRetest/*=EFalse*/)
-	{
-	if (iState!=KStateFailed)
-		{
-		TInt oldState=iState;
-		iState=KStateFailed;
-		if (iTest->TestFailed(oldState,aRetest) || aRetest)
-			ResetTest(oldState);
-		}
-	}
-
-void CPointerWindow::WinKeyL(const TKeyEvent &aKey,const TTime &)
-	{
-#if defined(LOGGING)
-	_LIT(KKey,"CPointerWindow::WinKeyL(Code=%d, ScanCode=%d) State=%d");
-	LogMessageText.Format(KKey,aKey.iCode,aKey.iScanCode,iState);
-	TheClient->LogMessage(LogMessageText);
-#endif
-	if (aKey.iCode==EKeyEscape)
-		FinishedTests();	// Simply skip this test if the Escape key is pressed
-	}
-
-void CPointerWindow::SwitchOn(const TTime &)
-	{
-#if defined(LOGGING)
-	_LIT(KOn,"CPointerWindow::SwitchOn() State=%d");
-	LogMessageText.Format(KOn,iState);
-	TheClient->LogMessage(LogMessageText);
-#endif
-	if (iState==KStateWaitingForTest7)
-		SetState(KStateTesting7);
-	else
-		TestFailed();
-	}
-
-void CPointerWindow::SendEvent()
-	{	
-#if defined(LOGGING)
-	_LIT(KSend,"CPointerWindow::SendEvent() State=%d");
-	LogMessageText.Format(KSend,iState);
-	TheClient->LogMessage(LogMessageText);
-#endif
-	switch (iState)
-		{
-	case KStateWaitingForTest1:
-		iTest->SimulatePointer(TRawEvent::EButton1Down,iTl.iX+iSize.iWidth/4,iTl.iY+iSize.iHeight/4);
-		break;
-	//case KStateTesting1:			//Do Nothing
-	//	break;
-	case KStateWaitingForTest2:
-		iTest->SimulatePointer(TRawEvent::EButton1Up,iTl.iX+iSize.iWidth/4,iTl.iY+iSize.iHeight/4);
-		iTest->SimulatePointer(TRawEvent::EButton1Down,iTl.iX+iSize.iWidth/2,iTl.iY+iSize.iHeight/4);
-		break;
-	case KStateTesting2:
-		iTest->SimulatePointer(TRawEvent::EPointerMove,iTl.iX+5*iSize.iWidth/8,iTl.iY+iSize.iHeight/4+2);
-		iTest->SimulatePointer(TRawEvent::EPointerMove,iTl.iX+3*iSize.iWidth/4,iTl.iY+iSize.iHeight/4+4);
-		break;
-	case KStateWaitingForTest3:
-		iTest->SimulatePointer(TRawEvent::EButton1Up,iTl.iX+3*iSize.iWidth/4,iTl.iY+iSize.iHeight/4+4);
-		iTest->SimulatePointer(TRawEvent::EButton1Down,iTl.iX+iSize.iWidth/4,iTl.iY+iSize.iHeight/2);
-		break;
-	case KStateTesting3:
-		iTest->SimulatePointer(TRawEvent::EButton1Up,iTl.iX+iSize.iWidth/4,iTl.iY+iSize.iHeight/2);
-		break;
-	case KStateWaitingForTest4:
-		iTest->SimulatePointer(TRawEvent::EButton1Down,iTl.iX+iSize.iWidth/2,iTl.iY+iSize.iHeight/2);
-		iTest->SimulatePointer(TRawEvent::EPointerMove,iTl.iX+iSize.iWidth/2+3,iTl.iY+iSize.iHeight/2+1);
-		iTest->SimulatePointer(TRawEvent::EPointerMove,iTl.iX+iSize.iWidth/2+6,iTl.iY+iSize.iHeight/2+2);
-		iTest->SimulatePointer(TRawEvent::EPointerMove,iTl.iX+iSize.iWidth/2+9,iTl.iY+iSize.iHeight/2+3);
-		iTest->SimulatePointer(TRawEvent::EPointerMove,iTl.iX+iSize.iWidth/2+12,iTl.iY+iSize.iHeight/2+4);
-		break;
-	case KStateTesting4:
-		iTest->SimulatePointer(TRawEvent::EButton1Up,iTl.iX+iSize.iWidth/2+12,iTl.iY+iSize.iHeight/2+4);
-		break;
-	case KStateWaitingForTest5:
-		iTest->SimulatePointer(TRawEvent::EButton1Down,iTl.iX+iSize.iWidth/2,iTl.iY+3*iSize.iHeight/4);
-		iTest->SimulatePointer(TRawEvent::EPointerMove,iTl.iX+iSize.iWidth/2+3,iTl.iY+3*iSize.iHeight/4+1);
-		iTest->SimulatePointer(TRawEvent::EPointerMove,iTl.iX+iSize.iWidth/2+6,iTl.iY+3*iSize.iHeight/4+2);
-		iTest->SimulatePointer(TRawEvent::EPointerMove,iTl.iX+iSize.iWidth/2+9,iTl.iY+3*iSize.iHeight/4+3);
-		iTest->SimulatePointer(TRawEvent::EPointerMove,iTl.iX+iSize.iWidth/2+12,iTl.iY+3*iSize.iHeight/4+4);
-		break;
-	case KStateTesting5:
-		iTest->SimulatePointer(TRawEvent::EButton1Up,iTl.iX+iSize.iWidth/2+12,iTl.iY+3*iSize.iHeight/4+4);
-		break;
-	case KStateWaitingForTest6:
-		iTest->SimulatePointer(TRawEvent::EButton1Down,iTl.iX+3*iSize.iWidth/4,iTl.iY+3*iSize.iHeight/4);
-		break;
-	case KStateTesting6:
-		iTest->SimulatePointer(TRawEvent::EPointerMove,iTl.iX+3*iSize.iWidth/4+4,iTl.iY+3*iSize.iHeight/4+2);
-		iTest->SimulatePointer(TRawEvent::EPointerMove,iTl.iX+3*iSize.iWidth/4+8,iTl.iY+3*iSize.iHeight/4+4);
-		iTest->SimulatePointer(TRawEvent::EPointerMove,iTl.iX+3*iSize.iWidth/4+12,iTl.iY+3*iSize.iHeight/4+6);
-		iTest->SimulatePointer(TRawEvent::EPointerMove,iTl.iX+3*iSize.iWidth/4+16,iTl.iY+3*iSize.iHeight/4+8);
-		break;
-	case KStateWaitingForTest8:
-		iTest->SimulatePointer(TRawEvent::EButton1Down,iTl.iX+iSize.iWidth/2,iTl.iY+3*iSize.iHeight/4);
-		break;
-	case KStateTesting8:
-		break;
-	case KStateWaitingForTest7:
-		iTest->SimulatePointer(TRawEvent::EButton1Up,iTl.iX+3*iSize.iWidth/4+16,iTl.iY+3*iSize.iHeight/4+8);
-		iTest->SimulateEvent(TRawEvent::ESwitchOn);
-		iTest->SimulatePointer(TRawEvent::EPointerSwitchOn,iTl.iX+iSize.iWidth/2-1,iTl.iY+iSize.iHeight/2-1);
-		break;
-	//case KStateTesting7:		//Do Nothing
-	//	break;
-	/*case KStateFailed:
-		break;
-	case KStateFinished:
-		break;*/
-		}
-	}
-
-//
-// CGrabWindow //
-//
-
-CGrabWindow::CGrabWindow(CTPointer *aTest) : iTest(aTest)
-	{
-	}
-
-void CGrabWindow::SetUpLD(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc)
-	{
-	ConstructExtLD(*parent,pos,size);
-	iTl=pos;
-	iSize=size;
-	Activate();
-	AssignGC(aGc);
-	SetState(KGrabStateWaitingForDown);
-	}
-
-void CGrabWindow::Draw()
-	{
-	iGc->Clear();
-	iGc->DrawRect(Size());
-	TBuf<0x80> buf;
-	switch(iState)
-		{
-		case KGrabStateWaitingForDown:
-		case KGrabStateWaitingForDown2:
-		case KGrabStateWaitingForDown5:
-			{
-			_LIT(Draw1,"Press the pointer inside the window");
-			buf.Copy(Draw1);
-			}
-			break;
-		case KGrabStateWaitingForDown3:
-		case KGrabStateWaitingForUp3a:
-			{
-			_LIT(Draw2,"Press and release the pointer inside the window");
-			buf.Copy(Draw2);
-			}
-			break;
-		case KGrabStateWaitingForDragOut:
-			{
-			_LIT(Draw3,"Drag the pointer outside into the outside window");
-			buf.Copy(Draw3);
-			}
-			break;
-		case KGrabStateWaitingForUp:
-		case KGrabStateWaitingForUp2b:
-		case KGrabStateWaitingForUp5:
-			{
-			_LIT(Draw4,"Release the pointer");
-			buf.Copy(Draw4);
-			}
-			break;
-		case KGrabStateWaitingForDown4:
-			{
-			_LIT(Draw5,"Press then release the pointer");
-			buf.Copy(Draw5);
-			}
-			break;
-		default:;
-		}
-	iGc->DrawText(buf,TPoint(10,20));
-	}
-
-void CGrabWindow::PointerL(const TPointerEvent &aPointer,const TTime&)
-	{
-#if defined(LOGGING)
-	_LIT(KPointer,"CGrabWindow::PointerL(Type=%d, Pos=(%d,%d), ParPos=(%d,%d), Mod=0x%x) State=%d");
-	LogMessageText.Format(KPointer,aPointer.iType,aPointer.iPosition.iX,aPointer.iPosition.iY,aPointer.iParentPosition.iX,aPointer.iParentPosition.iY,aPointer.iModifiers,iState);
-	TheClient->LogMessage(LogMessageText);
-#endif
-	switch(iState)
-		{
-		case KGrabStateWaitingForDown:
-			if (aPointer.iType==TPointerEvent::EButton1Down)
-				SetState(KGrabStateWaitingForDragOut);
-			break;
-		case KGrabStateWaitingForDragOut:
-			if (aPointer.iType!=TPointerEvent::EDrag)
-				TestFailed();
-			else
-				{
-				if (!TRect(Size()).Contains(aPointer.iPosition))
-					SetState(KGrabStateWaitingForUp);
-				}
-			break;
-		case KGrabStateWaitingForUp:
-			if (aPointer.iType==TPointerEvent::EDrag)
-				break;
-			if (aPointer.iType==TPointerEvent::EButton1Up)
-				SetState(KGrabStateWaitingForDown2);
-			else
-				TestFailed();
-			break;
-		case KGrabStateWaitingForDown2:
-			if (aPointer.iType!=TPointerEvent::EButton1Down)
-				TestFailed();
-			else
-				{
-				iTest->GrabWin2()->BaseWin()->ClaimPointerGrab();
-				iTest->GrabWin2()->BaseWin()->ClaimPointerGrab();	// Call twice to check it's harmless
-				SetState(KGrabStateWaitingForUp2a);
-				}
-			break;
-		case KGrabStateWaitingForUp2a:
-			SetState(KGrabStateWaitingForDrag2);
-			break;
-		case KGrabStateWaitingForDrag2:
-			break;
-		case KGrabStateWaitingForUp2b:
-			TestFailed();
-			break;
-		case KGrabStateWaitingForDown3:
-			if (aPointer.iType!=TPointerEvent::EButton1Down)
-				TestFailed();
-			else
-				SetState(KGrabStateWaitingForUp3a);
-			break;
-		case KGrabStateWaitingForUp3a:
-			if (aPointer.iType==TPointerEvent::EButton1Up)
-				{
-				iTest->GrabWin2()->BaseWin()->ClaimPointerGrab();
-				SetState(KGrabStateWaitingForUp3b);
-				}
-			break;
-		case KGrabStateWaitingForUp3b:
-			TestFailed();
-			break;
-		case KGrabStateWaitingForDown5:
-			if (aPointer.iType!=TPointerEvent::EButton1Down)
-				TestFailed();
-			else
-				{
-				iTest->GrabWin2()->BaseWin()->ClaimPointerGrab(EFalse);
-				SetState(KGrabStateWaitingForDrag5);
-				}
-			break;
-		case KGrabStateWaitingForDrag5:
-			if (aPointer.iType==TPointerEvent::EButton1Up)
-				TestFailed();
-			break;
-		case KGrabStateWaitingForUp5:
-			TestFailed();
-			break;
-		case KGrabStateWaitingForDown4:
-			iWin.Close();	// Close the window with the grab captured in it
-			SetState(KGrabStateWaitingForUp4);
-			break;
-		case KGrabStateFinished:
-			break;
-		}
-	}
-
-void CGrabWindow::ResetTest()
-	{
-	TheClient->iWs.PurgePointerEvents();
-	SetState(KGrabStateWaitingForDown);
-	}
-
-void CGrabWindow::Pointer2(const TPointerEvent &aPointer)
-	{
-	switch(iState)
-		{
-		case KGrabStateWaitingForDrag2:
-			{
-			if (aPointer.iType==TPointerEvent::EDrag)
-				{
-				SetState(KGrabStateWaitingForUp2b);
-				}
-			else
-				{
-				if (iTest->TestFailed(iState))
-					ResetTest();
-				}
-			break;
-			}
-		case KGrabStateWaitingForUp2b:
-			if (aPointer.iType==TPointerEvent::EDrag)	// Harmless
-				break;
-			if (aPointer.iType==TPointerEvent::EButton1Up)
-				SetState(KGrabStateWaitingForDown3);
-			else
-				TestFailed();
-			break;
-		case KGrabStateWaitingForUp3b:
-			if (aPointer.iType==TPointerEvent::EButton1Up)
-				SetState(KGrabStateWaitingForDown5);
-			else
-				TestFailed();
-			break;
-		case KGrabStateWaitingForUp4:
-			FinishedTests();
-			break;
-		case KGrabStateWaitingForDrag5:
-			{
-			if (aPointer.iType==TPointerEvent::EDrag)
-				SetState(KGrabStateWaitingForUp5);
-			else if (iTest->TestFailed(iState))
-				ResetTest();
-			break;
-			}
-		case KGrabStateWaitingForUp5:
-			if (aPointer.iType==TPointerEvent::EDrag)	// Harmless
-				break;
-			if (aPointer.iType==TPointerEvent::EButton1Up)
-				SetState(KGrabStateWaitingForDown4);
-			else
-				TestFailed();
-			break;
-		default:;
-		}
-	}
-
-void CGrabWindow::SetState(TInt aState)
-	{
-	iState=aState;
-	if (aState!=KGrabStateWaitingForUp4)
-		iWin.Invalidate();
-	TheClient->WaitForRedrawsToFinish();	
-	SendEvent();
-	}
-
-void CGrabWindow::TestFailed()
-	{
-#if defined(LOGGING)
-	_LIT(KFail,"CGrabWindow::TestFailed() State=%d");
-	LogMessageText.Format(KFail,iState);
-	TheClient->LogMessage(LogMessageText);
-#endif
-	if (iState!=KStateFailed)
-		{
-		TInt oldState=iState;
-		iState=KStateFailed;
-		if (iTest->TestFailed(oldState))
-			ResetTest();
-		}
-	}
-
-void CGrabWindow::FinishedTests()
-	{
-	iState=KGrabStateFinished;
-	}
-
-void CGrabWindow::WinKeyL(const TKeyEvent &aKey,const TTime &)
-	{
-#if defined(LOGGING)
-	_LIT(KKey,"CGrabWindow::WinKeyL(Code=%d, ScanCode=%d) State=%d");
-	LogMessageText.Format(KKey,aKey.iCode,aKey.iScanCode,iState);
-	TheClient->LogMessage(LogMessageText);
-#endif
-	if (aKey.iCode==EKeyEscape)
-		FinishedTests();	// Simply skip this test if the Escape key is pressed
-	}
-
-void CGrabWindow::SendEvent()
-	{
-	switch (iState)
-		{
-	case KGrabStateWaitingForDown:
-		iTest->SimulatePointer(TRawEvent::EButton1Down,iTl.iX+iSize.iWidth/3,iTl.iY+iSize.iHeight/3);
-		break;
-	case KGrabStateWaitingForDragOut:
-		iTest->SimulatePointer(TRawEvent::EPointerMove,iTl.iX+iSize.iWidth/6,iTl.iY+iSize.iHeight/6);
-		iTest->SimulatePointer(TRawEvent::EPointerMove,iTl.iX+1,iTl.iY+1);
-		iTest->SimulatePointer(TRawEvent::EPointerMove,iTl.iX-10,iTl.iY-10);
-		break;
-	case KGrabStateWaitingForUp:
-		iTest->SimulatePointer(TRawEvent::EPointerMove,iTl.iX-8,iTl.iY-8);
-		iTest->SimulatePointer(TRawEvent::EButton1Up,iTl.iX-5,iTl.iY-5);
-		break;
-	case KGrabStateWaitingForDown2:
-		iTest->SimulatePointer(TRawEvent::EButton1Down,iTl.iX+2*iSize.iWidth/3,iTl.iY+iSize.iHeight/3);
-		break;
-	/*case KGrabStateWaitingForUp2a:		//Don't need to do anything for these cases
-		break;
-	case KGrabStateWaitingForDrag2:
-		break;*/
-	case KGrabStateWaitingForUp2b:
-		iTest->SimulatePointer(TRawEvent::EPointerMove,iTl.iX+2*iSize.iWidth/3-3,iTl.iY+iSize.iHeight/3+3);
-		iTest->SimulatePointer(TRawEvent::EButton1Up,iTl.iX+2*iSize.iWidth/3,iTl.iY+iSize.iHeight/3);
-		break;
-	case KGrabStateWaitingForDown3:
-		iTest->SimulatePointer(TRawEvent::EButton1Down,iTl.iX+2*iSize.iWidth/3,2*iTl.iY+iSize.iHeight/3);
-		break;
-	case KGrabStateWaitingForUp3a:
-		iTest->SimulatePointer(TRawEvent::EButton1Up,iTl.iX+2*iSize.iWidth/3,2*iTl.iY+iSize.iHeight/3);
-		break;
-	case KGrabStateWaitingForUp3b:
-		break;
-	case KGrabStateWaitingForDown4:
-		iTest->SimulatePointer(TRawEvent::EButton1Down,iTl.iX+2*iSize.iWidth/5,iTl.iY+iSize.iHeight/3);
-		break;
-	case KGrabStateWaitingForUp4:
-		iTest->SimulatePointer(TRawEvent::EButton1Up,iTl.iX+2*iSize.iWidth/5,iTl.iY+iSize.iHeight/3);
-		break;
-	case KGrabStateWaitingForDown5:
-		iTest->SimulatePointer(TRawEvent::EButton1Down,iTl.iX+iSize.iWidth/3,2*iTl.iY+iSize.iHeight/3);
-		break;
-	case KGrabStateWaitingForUp5:
-		iTest->SimulatePointer(TRawEvent::EButton1Up,iTl.iX+iSize.iWidth/3,2*iTl.iY+iSize.iHeight/3);
-		break;
-	//case KGrabStateWaitingForDrag5:		//Don't need to do anything for these cases
-	//	break;
-	/*case KStateFailed:
-		break;
-	case KGrabStateFinished:
-		break;*/
-	default:;
-		}
-	TheClient->iWs.Flush();
-	}
-
-
-//
-// CGrabWindow2, used as part of grab tests //
-//
-
-CGrabWindow2::CGrabWindow2(CGrabWindow *aWindow) : iGrabWindow(aWindow)
-	{
-	}
-
-void CGrabWindow2::Draw()
-	{
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	iGc->SetBrushColor(TRgb::Gray4(2));
-	iGc->DrawRect(Size());
-	}
-
-void CGrabWindow2::PointerL(const TPointerEvent &aPointer,const TTime&)
-	{
-#if defined(LOGGING)
-	_LIT(KPointer,"CGrabWindow2::PointerL(Type=%d, Pos=(%d,%d), ParPos=(%d,%d), Mod=0x%x)");
-	LogMessageText.Format(KPointer,aPointer.iType,aPointer.iPosition.iX,aPointer.iPosition.iY,aPointer.iParentPosition.iX,aPointer.iParentPosition.iY,aPointer.iModifiers);
-	TheClient->LogMessage(LogMessageText);
-#endif
-	iGrabWindow->Pointer2(aPointer);
-	}
-
-//
-// CTPointTest //
-//
-
-CTPointer::CTPointer(CTestStep* aStep) : CTWsGraphicsBase(aStep)
-	{
-	iState = 0;
-	}
-
-
-CTPointer::~CTPointer()
-	{
-	HAL::Set(HALData::EPenDisplayOn,iOldPointerState);
-	delete iRepeatWin;
-	delete iGrabWin;
-	delete iGrabWin2;
-	Client()->ResetFocus();
-	delete iTimeOut;
-	}
-
-void CTPointer::ConstructL()
-	{
-	iTimeOut=new(ELeave) CTimeOut();
-	iTimeOut->ConstructL();
-	iTimeOut->Start(KTimeOutAfter,TCallBack(CTPointer::TimeOut,this));
-	
-	TheClient->iWs.SetPointerCursorArea(iTest->iNormalPointerCursorArea);
-	iRepeatWin=new(ELeave) CPointerWindow(this);
-	TSize screenSize(Client()->iScreen->SizeInPixels());
-	if (TestBase()->ConfigurationSupportsPointerEventTesting())
-	    {
-	    iRepeatWin->SetUpLD(TPoint(screenSize.iWidth/8,screenSize.iHeight/8),TSize(screenSize.iWidth*3/4,screenSize.iHeight*3/4),Client()->iGroup,*Client()->iGc);
-	    }
-	Client()->iGroup->SetCurrentWindow(iRepeatWin);
-	iNoDigitiser=EFalse;
-	TInt err=HAL::Get(HALData::EPenDisplayOn,iOldPointerState);
-	if (err==KErrNotSupported)
-		iNoDigitiser=ETrue;
-	else if (err==KErrNone)
-		err=HAL::Set(HALData::EPenDisplayOn,ETrue);
-	if (err==KErrNotSupported)
-		iNoDigitiser=(!iOldPointerState);
-	else
-		{
-		TEST(err==KErrNone);
-		if (err!=KErrNone)
-		INFO_PRINTF3(_L("HAL::Set(HALData::EPenDisplayOn,ETrue) return value - Expected: %d, Actual: %d"), KErrNone, err);			
-		}
-	
-	}
-
-TInt CTPointer::TimeOut(TAny* aTest)		//static
-	{
-	static_cast<CTPointer*>(aTest)->TimeOut();
-	return(KErrNone);
-	}
-
-void CTPointer::TimeOut()
-	{
-	TLogMessageText buf;
-	_LIT(KPointerTimeOut,"TIMEOUT: Pointer Test, %d, %S");
-	buf.AppendFormat(KPointerTimeOut,iState,&(iTest->iSubTitle));
-	TheClient->LogMessage(buf);
-	++iTimeOutCount;
-	if (!TestFailed(-1) && iState<2)
-		{
-		iTimeOut->Start(KTimeOutAfter,TCallBack(CTPointer::TimeOut,this));
-		}
-	}
-
-TBool CTPointer::TestFailed(TInt aCase,TBool aRetry/*=EFalse*/)
-	{
-	_LIT(KPointerTest,": Pointer Test, %d, %S, Case %d");
-	_LIT(KRetry,"Retry");
-	_LIT(KFail,"FAIL");
-	TLogMessageText buf;
-	TInt ret=0;
-	if (aRetry)
-		buf.Append(KRetry);
-	else
-		{
-		ret=1;
-		buf.Append(KFail);
-		}
-	buf.AppendFormat(KPointerTest,iState,&(iTest->iSubTitle),aCase);
-	TheClient->LogMessage(buf);
-#if !defined(DISABLE_FAIL_DIALOG)
-	if (!aRetry)
-		{
-		__DEBUGGER();
-		TRAPD(err,ret=doTestFailedL());
-		}
-#endif
-	switch(ret)
-		{
-		case 0:
-			return(ETrue);	// Re-try test
-		case 1:
-			break;
-		}
-	return(EFalse);
-	}
-
-TInt CTPointer::doTestFailedL()
-	{
-	//_LIT(Failed,"Pointer repeat test failed");
-	_LIT(Retest,"Retest");
-	_LIT(Fail,"Fail");
-	CTDialog *dialog=new(ELeave) CTDialog();
-	dialog->SetNumButtons(2);
-	dialog->SetButtonText(0,Retest);
-	dialog->SetButtonText(1,Fail);
-	dialog->ConstructLD(*Client()->iGroup,*Client()->iGc);
-	dialog->SetTitle(_L("Pointer repeat test failed"));
-	dialog->SetFlags(CTDialog::EDialogWaitForButtonUp);
-	return dialog->Display();
-	}
-
-CGrabWindow2 *CTPointer::GrabWin2() const
-	{
-	return(iGrabWin2);
-	}
-
-void CTPointer::StartGrabTestL()
-	{
-	iGrabWin=new(ELeave) CGrabWindow(this);
-	iGrabWin2=new(ELeave) CGrabWindow2(iGrabWin);
-//
-	TSize screenSize(Client()->iScreen->SizeInPixels());
-	iGrabWin2->SetUpL(TPoint(screenSize.iWidth/8,screenSize.iHeight/8),TSize(screenSize.iWidth*3/4,screenSize.iHeight*3/4),Client()->iGroup,*Client()->iGc);
-	Client()->iGroup->SetCurrentWindow(iGrabWin2);
-//
-	iGrabWin->SetUpLD(TPoint(screenSize.iWidth/4,screenSize.iHeight/4),TSize(screenSize.iWidth/2,screenSize.iHeight/2),Client()->iGroup,*Client()->iGc);
-	Client()->iGroup->SetCurrentWindow(iGrabWin);
-//
-	}
-
-
-void CTPointer::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(Repeat,"Repeat tests");
-	_LIT(Grab,"Grab tests");
-
-	iTest->iState=iState;
-	
-	if (!TestBase()->ConfigurationSupportsPointerEventTesting())
-	    {
-	    INFO_PRINTF1(_L("Test skipped because config does not support pointer event testing"));
-	    TestComplete();
-	    return;
-	    }
-	
-	((CTPointerStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(iState)
-		{
-		case 0:
-			((CTPointerStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			iTest->LogSubTest(Repeat);
-			iState++;
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0310
-  
-  @SYMDEF             DEF081259
- 
-  @SYMTestCaseDesc Test pointer event handling
-    
-  @SYMTestPriority High
- 
-  @SYMTestStatus Implemented
- 
-  @SYMTestActions Simulate pointer events and check the events are then handled correctly
-  
-  @SYMTestExpectedResults Pointer events are handled correctly
- 
-*/
-		case 1:
-			((CTPointerStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0310"));
-			iTest->LogSubTest(Grab);
-			
-			StartGrabTestL();
-			iState++;
-			break;
-		default:
-			((CTPointerStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTPointerStep*)iStep)->CloseTMSGraphicsStep();
-			iTimeOut->Cancel();
-			if (iTimeOutCount>0) TEST(EFalse);
-			if (iTest->IsFullRomL()) User::After(5000000);
-			TestComplete();
-		}
-	((CTPointerStep*)iStep)->RecordTestResultL();
-	}
-
-
-__WS_CONSTRUCT_STEP__(Pointer)
--- a/windowing/windowserver/tauto/TPointer.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,167 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TPOINTER_H__
-#define __TPOINTER_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include <hal.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-class CTPointer;
-class CGrabWindow;
-
-class CPointerWindow : public CTWin
-	{
-	enum {KRepeatMargin=200000};	// 0.2 Seconds
-	enum {KRepeatCount=4};
-	enum {KRepeatIntervalIncrements=100000};
-	enum {KRepeatRectXExtra=50};
-	enum {KRepeatRectYExtra=50};
-	enum {KStateWaitingForTest1,KStateFailed,KStateTesting1,
-			KStateWaitingForTest2,KStateTesting2,
-			KStateWaitingForTest3,KStateTesting3,
-			KStateWaitingForTest4,KStateTesting4,
-			KStateWaitingForTest5,KStateTesting5,
-			KStateWaitingForTest6,KStateTesting6,
-			KStateWaitingForTest8,KStateTesting8,
-			KStateWaitingForTest7,KStateTesting7,
-			KStateFinished};
-public:
-	CPointerWindow(CTPointer *aTest);
-	void SetUpLD(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
-	void Draw();
-	void StartNextRepeatTest();
-	void QueueNextRepeat();
-	void PointerL(const TPointerEvent &aPointer,const TTime&);
-	void WinKeyL(const TKeyEvent &aKey,const TTime &aTime);
-private:
-	void SwitchOn(const TTime &);
-	void ResetTest(TInt aState);
-	void SetState(TInt aState);
-	void FinishedTests();
-	void TestFailed(TBool aRetest=EFalse);
-	void SendEvent();
-private:
-	CTPointer *iTest;
-	TInt iRepeatCount;
-	TInt iState;
-	TTimeIntervalMicroSeconds32 iInterval;
-	TTime iPrevTime;
-	TRect iRepeatRect;
-	TPoint iTl;
-	TSize iSize;
-	};
-
-class CGrabWindow2 : public CTWin
-	{
-public:
-	CGrabWindow2(CGrabWindow *aWindow);
-	void SetUpLD(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
-private:
-	void Draw();
-	void PointerL(const TPointerEvent &aPointer,const TTime&);
-private:
-	CGrabWindow *iGrabWindow;
-	};
-
-class CGrabWindow : public CTWin
-	{
-	enum {KGrabStateWaitingForDown,KGrabStateWaitingForDragOut,KGrabStateWaitingForUp,KGrabStateFinished,
-		KGrabStateWaitingForDown2,KGrabStateWaitingForUp2a,KGrabStateWaitingForDrag2,KGrabStateWaitingForUp2b,
-		KGrabStateWaitingForDown3,KGrabStateWaitingForUp3a,KGrabStateWaitingForUp3b,
-		KGrabStateWaitingForDown4,KGrabStateWaitingForUp4,
-		KGrabStateWaitingForDown5,KGrabStateWaitingForUp5,KGrabStateWaitingForDrag5,
-		KStateFailed};
-public:
-	CGrabWindow(CTPointer *aTest);
-	void Pointer2(const TPointerEvent &aPointer);
-	void SetUpLD(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
-	void WinKeyL(const TKeyEvent &aKey,const TTime &aTime);
-private:
-	void Draw();
-	void SetState(TInt aState);
-	void ResetTest();
-	void PointerL(const TPointerEvent &aPointer,const TTime&);
-	void TestFailed();
-	void FinishedTests();
-	void SendEvent();
-private:
-	TInt iState;
-	CTPointer *iTest;
-	TPoint iTl;
-	TSize iSize;
-	};
-
-
-class CTPointer : public CTWsGraphicsBase
-	{
-public:
-	enum {KTimeOutAfter=20000000};	//20secs
-public:
-	CTPointer(CTestStep* aStep);
-	~CTPointer();
-	void ConstructL();
-
-	TBool TestFailed(TInt aCase,TBool aRetry=EFalse);
-	void StartGrabTestL();
-	static TInt TimeOut(TAny* aTest);
-	void TimeOut();
-	CGrabWindow2 *GrabWin2() const;
-	inline TBool Digitiser() const {return !iNoDigitiser;}
-	inline void SimulatePointer(TRawEvent::TType aType, TInt aX, TInt aY){iTest->SimulatePointer(aType, aX, aY);}
-	inline void SimulateEvent(TRawEvent::TType aType){iTest->SimulateEvent(aType);}
-protected:
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	TInt doTestFailedL();
-	inline TestClient* Client() {return TheClient;}
-	TInt iState;
-
-private:
-	CTimeOut* iTimeOut;
-	TInt iTimeOutCount;
-	CPointerWindow *iRepeatWin;
-	CGrabWindow *iGrabWin;
-	CGrabWindow2 *iGrabWin2;
-	TSize iWinSize;
-	//TInt iState;
-	TBool iOldPointerState;
-	TBool iNoDigitiser;
-	};
-
-
-class CTPointerStep : public CTGraphicsStep
-	{
-public:
-	CTPointerStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTPointerStep,"TPointer");
-
-
-#endif
--- a/windowing/windowserver/tauto/TRECTLIST.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Generate a list of rectangles to be used as parameters for graphics tests
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-
-#include "TRECTLIST.H"
-
-CTRectList::CTRectList(CTestStep* aStep) : CTWsGraphicsBase(aStep)
-	{
-	}
-
-CTRectList::~CTRectList()
-	{
-	}
-
-void CTRectList::ConstructL()
-	{
-	TheGc->Activate(*BaseWin->Win());
-	TheGc->SetBrushColor(TRgb::Gray16(14));
-	TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TheGc->SetPenStyle(CGraphicsContext::ENullPen);
-	TheGc->DrawRect(TRect(BaseWin->Win()->Size()));
-	TInt scale=16;
-	TSize size(TestWin->Size());
-	TSize scaleSize(size.iWidth/scale,size.iHeight/scale);
-	iOffset1=TPoint((size.iWidth-scaleSize.iWidth)/2,(size.iWidth-scaleSize.iHeight)/2);
-	TheGc->DrawRect(TRect(iOffset1,scaleSize));
-	TheGc->Deactivate();
-//
-	TheGc->Activate(*TestWin->Win());
-	TheGc->SetBrushColor(TRgb::Gray16(15));
-	TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TheGc->SetPenStyle(CGraphicsContext::ENullPen);
-	TheGc->DrawRect(TRect(TestWin->Win()->Size()));
-	{
-	TInt scale=1;
-	TSize size(TestWin->Size());
-	TSize scaleSize(size.iWidth/scale,size.iHeight/scale);
-	iOffset2=TPoint((size.iWidth-scaleSize.iWidth)/2,(size.iWidth-scaleSize.iHeight)/2);
-	TheGc->DrawRect(TRect(iOffset2,scaleSize));
-	TheGc->Deactivate();
-	}
-	}
-	
-void CTRectList::RunTestCaseL(TInt /*aCurTestCase*/)
-	{	
-	((CTRectListStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(++iTest->iState)
-		{
-	/**
-@SYMTestCaseID		GRAPHICS-WSERV-0028
-
-@@SYMDEF            DEF081259
-
-@SYMTestCaseDesc    Draw rectangles from a list in two different positions
-					on the screen
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Draw a list of rectangles to the screen 
-
-@SYMTestExpectedResults Rectangles are drawn without error
-*/
-	case 1:
-		((CTRectListStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0028"));
-		iTest->LogSubTest(_L("RectListCheck"));	
-			{
-			TheGc->Activate(*BaseWin->Win());
-			TheGc->SetPenColor(TRgb::Gray16(7));
-			TInt scale=16;
-			for(TInt index=0;index<iTest->iTestRects.Count3();index++)
-				{
-				TRect rect=iTest->iTestRects[index];
-				rect.iTl.iX/=scale;
-				rect.iTl.iY/=scale;
-				rect.iBr.iX/=scale;
-				rect.iBr.iY/=scale;
-				rect.Move(iOffset1);
-				TheGc->DrawRect(rect);
-				}
-			TheGc->Deactivate();
-			}
-			{
-			TheGc->Activate(*TestWin->Win());
-			TheGc->SetPenColor(TRgb::Gray16(7));
-			TInt scale=1;
-			for(TInt index=0;index<iTest->iTestRects.Count3();index++)
-				{
-				TRect rect=iTest->iTestRects[index];
-				rect.iTl.iX/=scale;
-				rect.iTl.iY/=scale;
-				rect.iBr.iX/=scale;
-				rect.iBr.iY/=scale;
-				rect.Move(iOffset2);
-				TheGc->DrawRect(rect);
-				}
-			TheClient->iWs.Flush();
-			TheGc->Deactivate();
-			}
-			TEST(ETrue);
-			break;
-	case 2:
-		((CTRectListStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-		iTest->LogSubTest(_L("Panic"));
-		break;
-	case 3:
-		((CTRectListStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-		((CTRectListStep*)iStep)->CloseTMSGraphicsStep();
-		TestComplete();
-		break;
-		}
-	((CTRectListStep*)iStep)->RecordTestResultL();
-	}
-
-__WS_CONSTRUCT_STEP__(RectList)
--- a/windowing/windowserver/tauto/TRECTLIST.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Generate a list of rectangles to be used as parameters for graphics tests
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TRECTLIST_H__
-#define __TRECTLIST_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-class CTRectList : public CTWsGraphicsBase
-	{
-public:
-	CTRectList(CTestStep* aStep);
-	~CTRectList();
-	void ConstructL();
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	TPoint iOffset1;
-	TPoint iOffset2;
-	TSize iWinSize;
-	};
-	
-class CTRectListStep : public CTGraphicsStep
-	{
-public:
-	CTRectListStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTRectListStep,"TRectList");
-
-
-#endif
--- a/windowing/windowserver/tauto/TREDRAW.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1586 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Window redraw/validate/invalidate tests
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TREDRAW.H"
-
-LOCAL_D TSize FullScreenModeSize;
-
-const TRgb KRed = TRgb(255,0,0);
-const TRgb KBlack = TRgb(0,0,0);
-const TRgb KWhite = TRgb(255,255,255);
-const TRgb KTransBisque = TRgb(255,228,196,128);
-const TRgb KTransLightSalmon = TRgb(255,160,122,128);
-const TRgb KLightSteelBlue = TRgb(176,196,222);
-const TRgb KCadetBlue = TRgb(95,158,160);
-
-TInt CTRedrawOrderWindow::iRedrawNumber=0;
-
-#define InvalidRegionLogging
-#if defined(InvalidRegionLogging)
-#define BLOG_MESSAGE(p) (const_cast<CTRedrawTest*>(&iGraphicsTest))->LogMessage(((TText8*)__FILE__), __LINE__,(p))
-#endif
-
-//
-//  //
-//
-
-CTCheckDefectWin* CTCheckDefectWin::NewL(TPoint aPos,TSize aWinSize)
-	{
-	CTCheckDefectWin* win=new(ELeave) CTCheckDefectWin;
-	win->ConstructExtLD(*TheClient->iGroup,aPos,aWinSize);
-	win->BaseWin()->SetRequiredDisplayMode(EColor256);
-	win->AssignGC(*TheClient->iGc);
-	win->BaseWin()->SetShadowDisabled(ETrue);
-	win->BaseWin()->SetShadowHeight(0);
-	TheClient->Flush();
-	return win;
-	}
-
-CRedrawWindow::CRedrawWindow(CTRedrawTest *aTest) : CTWin(), iTest(aTest)
-	{
-	}
-
-CRedrawWindow::~CRedrawWindow()
-	{
-	iInvalid.Close();
-	}
-
-void CRedrawWindow::Draw()
-	{
-	ReceivedDrawRequest();
-	DrawPattern(iTest->WinContent());
-	}
-
-void CRedrawWindow::ReceivedDrawRequest()
-	{
-	iDrawRequests++;
-	}
-
-TInt CRedrawWindow::DrawRequests() const
-	{
-	return iDrawRequests;
-	}
-
-void CRedrawWindow::DrawPattern(TInt aPattern)
-	{
-	iGc->Clear();
-	TPoint drawBase(-10,-20);
-	TSize drawSize(iSize.iWidth-2*drawBase.iX,iSize.iHeight-2*drawBase.iY);
-	TPoint offset=drawBase+iOffset;
-	switch(aPattern)
-		{
-		case EDrawGraphPaperlHatched:
-			{
-			iGc->DrawRect(TRect(drawBase,drawBase+drawSize));
-			iGc->SetPenColor(TRgb(85,85,85));
-			iGc->SetDrawMode(CGraphicsContext::EDrawModeXOR);
-			TInt xpos;
-			for(xpos=0;xpos<drawSize.iWidth;xpos+=15)
-				iGc->DrawLine(TPoint(xpos,0)+offset,TPoint(xpos,drawSize.iHeight)+offset);
-			TInt ypos;
-			for(ypos=0;ypos<drawSize.iHeight;ypos+=15)
-				iGc->DrawLine(TPoint(0,ypos)+offset,TPoint(drawSize.iWidth,ypos)+offset);
-			break;
-			}
-		case EDrawSlantingHatched:
-			{
-			iGc->SetPenColor(TRgb(255,255,255));
-			iGc->SetDrawMode(CGraphicsContext::EDrawModeXOR);
-			for(TInt xpos=0;xpos<drawSize.iWidth;xpos+=16)
-				{
-				iGc->DrawLine(TPoint(xpos,0)+offset,TPoint(drawSize.iWidth,xpos*drawSize.iHeight/drawSize.iWidth)+offset);
-				iGc->DrawLine(TPoint(xpos,0)+offset,TPoint(0,drawSize.iHeight-xpos*drawSize.iHeight/drawSize.iWidth)+offset);
-				iGc->DrawLine(TPoint(xpos,drawSize.iHeight)+offset,TPoint(drawSize.iWidth,drawSize.iHeight-xpos*drawSize.iHeight/drawSize.iWidth)+offset);
-				iGc->DrawLine(TPoint(xpos,drawSize.iHeight)+offset,TPoint(0,xpos*drawSize.iHeight/drawSize.iWidth)+offset);
-				}
-			}
-			break;
-		case EDrawCenteredRectangle:
-			{
-			TRect rect(5,iSize.iHeight/4,iSize.iWidth-5,iSize.iHeight/2);
-			iGc->SetDrawMode(CGraphicsContext::EDrawModeXOR);
-			iGc->SetPenColor(TRgb(255,255,255));
-			iGc->DrawRect(rect);
-			}
-			break;
-		default:
-			// Other pattern values requested are ignored
-			break;
-		}
-	}
-
-void CRedrawWindow::Reset()
-	{
-	iOffset=TPoint(0,0);
-	iWin.Invalidate();
-	iInvalid.Clear();
-	}
-
-/**
- * Calculate the window region minus the region covered by the child
- * window; this is the "visible region"
- */
-void CRedrawWindow::VisibleRegion(RRegion &aRegion)
-	{
-	aRegion.Clear();
-	aRegion.AddRect(TRect(Size()));
-	TRect child;
-	child.iTl=Child()->BaseWin()->InquireOffset(iWin);
-	child.iBr=child.iTl+Child()->Size();
-	aRegion.SubRect(child);
-	}
-
-
-void CRedrawWindow::ValidateAndClear()
-	{
-	Win()->Invalidate();
-	Win()->BeginRedraw();
-	iGc->Activate(*Win());
-	iGc->Clear();
-	iGc->Deactivate();
-	Win()->EndRedraw();
-	}
-
-void CRedrawWindow::ActivateAndDraw(TInt aPattern, TRegion *aRegion)
-	{
-	iGc->Activate(*Win());
-	if (aRegion)
-		iGc->SetClippingRegion(*aRegion);
-	DrawPattern(aPattern);
-	iGc->Deactivate();
-	}
-
-CReferenceComparisonRedrawWindow::CReferenceComparisonRedrawWindow(CTRedrawTest *aTest) : CRedrawWindow(aTest)
-	{}
-
-/**
- * Prepare the invalid region.
- * 
- * Update the invalid region with a rectangle where such a rectangle is minus
- * any area covered by a child window.
- * 
- * @param aRect Rectangle to be added to the invalid region
- */
-void CReferenceComparisonRedrawWindow::PrepareInvalidation(const TRect &aRect)
-	{
-	RRegion clipped_visible;
-	VisibleRegion(clipped_visible);
-	clipped_visible.ClipRect(aRect);
-	iInvalid.Union(clipped_visible);
-	clipped_visible.Close();
-	iInvalid.Tidy();
-	}
-
-/**
- * Mop up all pending invalid regions and simulate a Draw().
- * 
- * Normally, we would rely on WServ to call this window's Draw() method
- * to obtain drawing operations to cover the currently invalid regions
- * of the window.
- * 
- * This method does that task by marking all invalid regions as clean and
- * then performs the drawing required in the invalid portions of the screen.
- * 
- * The purpose of this is to then allow a comparison to be made against a
- * different window which does rely on the WServ framework calling back
- * to do a Draw().
- * 
- * @post the window has no outstanding invalid regions
- */
-void CReferenceComparisonRedrawWindow::PerformInvalidation()
-	{
-	for(TInt index=0;index<iInvalid.Count();index++)
-		{
-		iWin.Invalidate(iInvalid[index]);
-		iWin.BeginRedraw(iInvalid[index]);
-		iWin.EndRedraw();
-		}
-	iWin.BeginRedraw(iInvalid.BoundingRect());
-	iGc->Activate(iWin);
-	iGc->SetClippingRegion(iInvalid);
-	DrawPattern(iTest->WinContent());
-	iGc->Deactivate();
-	iWin.EndRedraw();
-	}
-
-CRedrawWindow2::CRedrawWindow2(CTRedrawTest *aTest) : CRedrawWindow(aTest)
-	{
-	}
-
-void CRedrawWindow2::Draw()
-	{
-	ReceivedDrawRequest();
-	if (iClipped)
-		iGc->SetClippingRegion(iInvalid);
-	DrawPattern(iTest->WinContent());
-	if (iClipped)
-		iGc->CancelClippingRegion();
-	}
-
-/**
- * Prepare the invalid region.
- * @param aRect rectangle to be added to the invalid region
- */
-void CRedrawWindow2::PrepareInvalidation(const TRect &aRect)
-	{
-	iInvalid.Clear();
-	iInvalid.AddRect(aRect);
-	}
-
-/**
- * Perform invalidation by setting the window's invalid region.
- * 
- * The purpose of this method is to stimulate a call from WServ to the
- * Draw() method of this class.
- */
-void CRedrawWindow2::PerformInvalidation()
-	{
-	iWin.Invalidate(iInvalid.BoundingRect());
-	}
-
-void CRedrawWindow2::Reset()
-	{
-	CRedrawWindow::Reset();
-	iClipped=EFalse;
-	}
-
-CRedrawWindow3::CRedrawWindow3(CTRedrawTest *aTest) : CRedrawWindow(aTest)
-	{
-	}
-
-void CRedrawWindow3::Draw()
-	{
-	ReceivedDrawRequest();
-	iGc->Clear();
-	iGc->SetPenStyle(CGraphicsContext::ENullPen);
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	iGc->SetBrushColor(TRgb(0,255,255));
-	iGc->DrawRect(TRect(TPoint(0,0),TSize(50,50)));
-	}
-
-void CRedrawWindow3::PrepareInvalidation(const TRect &aRect)
-	{
-	iInvalid.Clear();
-	iInvalid.AddRect(aRect);
-	}
-
-void CRedrawWindow3::PerformInvalidation()
-	{
-	iWin.Invalidate(iInvalid.BoundingRect());
-	}
-
-void CRedrawWindow3::SetUp1L(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc)
-	{
-	ConstructL(*parent);
-	SetExtL(pos,size);
-	AssignGC(aGc);
-	}
-
-void CRedrawWindow3::Redraw(const TRect &aRect)
-	{
-	if(!isActive)
-		{//make an empty redraw
-		iWin.BeginRedraw(aRect);
-		iWin.EndRedraw();
-		}
-	else
-		{
-		CTWin::Redraw(aRect);
-		}	
-	}
-
-void CRedrawWindow3::Activate()
-	{
-	isActive = ETrue;
-	Win()->Activate();
-	}
-
-//
-
-CTRedrawOrderWindow::CTRedrawOrderWindow(TInt aOrder, CTRedrawTest *aTest) : iTest(aTest), iOrder(aOrder)
-	{}
-
-CTRedrawOrderWindow* CTRedrawOrderWindow::NewLC(TInt aOrder,CTWinBase* aParent,const TPoint& aPos,const TSize& aSize,CTRedrawTest* aTest)
-	{
-	CTRedrawOrderWindow* self=new(ELeave) CTRedrawOrderWindow(aOrder,aTest);
-	CleanupStack::PushL(self);
-	self->SetUpL(aPos,aSize,aParent,*TheGc);
-	return self;
-	}
-
-void CTRedrawOrderWindow::Draw()
-	{
-	iGc->SetBrushColor(TRgb::Gray16(iOrder*2));
-	iGc->Clear();
-	}
-
-void CTRedrawOrderWindow::ResetRedrawNumber()
-	{
-	iRedrawNumber=0;
-	}
-
-void CTRedrawOrderWindow::Redraw(const TRect &aRect)
-	{
-	if (++iRedrawNumber!=iOrder)
-		iTest->Failed(iOrder);
-	CTWin::Redraw(aRect);
-	}
-
-//
-
-TInt DestructCallback(TAny *aParam)
-	{
-	((CTRedrawTest *)aParam)->doDestruct();
-	return(0);
-	}
-
-CTRedrawTest::CTRedrawTest(CTestStep* aStep):
-	CTWsGraphicsBase(aStep)//, iInvalidRegionChecker(*this)
-	{}
-
-void CTRedrawTest::doDestruct()
-	{
-	BaseWin->SetVisible(ETrue);
-	TestWin->SetVisible(ETrue);
-	delete iBaseRedrawWin;
-	delete iTestRedrawWin;
-	delete iBaseChildWin;
-	delete iTestChildWin;
-	}
-
-CTRedrawTest::~CTRedrawTest()
-	{
-	TCallBack callBack(DestructCallback,this);
-	TheClient->SetRedrawCancelFunction(callBack);
-	delete iInvalidRegionChecker;	
-	}
-
-void CTRedrawTest::ConstructL()
-	{
-#if defined(InvalidRegionLogging)
-	LOG_MESSAGE(_L("  CTRedrawTest::ConstructL()"));
-	LOG_MESSAGE4(_L("  Ex Wins 0x%08x, 0x%08x, 0x%08x"), BaseWin, TestWin, &(TheClient->StdLogWindow()));
-#endif
-	
-	iInvalidRegionChecker = new(ELeave)CInvalidRegionChecker(*this);
-	User::LeaveIfError(iInvalidRegionChecker->AddExcludedWindow(BaseWin));
-	User::LeaveIfError(iInvalidRegionChecker->AddExcludedWindow(TestWin));
-	User::LeaveIfError(iInvalidRegionChecker->AddExcludedWindow(&(TheClient->StdLogWindow())));
-	WaitForRedrawsToFinish(ECheckRedrawActiveObjectAndInvalidRegions);	
-	
-	iWinContent=0;
-	BaseWin->SetVisible(EFalse);
-	TestWin->SetVisible(EFalse);
-	FullScreenModeSize=TheClient->iGroup->Size();
-	TInt winWidth=(FullScreenModeSize.iWidth/3)-10;
-	TInt winHeight=FullScreenModeSize.iHeight-10;
-	iBaseRedrawWin=new(ELeave) CReferenceComparisonRedrawWindow(this);
-	iBaseRedrawWin->SetUpL(TPoint(FullScreenModeSize.iWidth/3+5,5),TSize(winWidth,winHeight),TheClient->iGroup,*TheClient->iGc);
-	iTestRedrawWin=new(ELeave) CRedrawWindow2(this);
-	iTestRedrawWin->SetUpL(TPoint(FullScreenModeSize.iWidth/3*2+5,5),TSize(winWidth,winHeight),TheClient->iGroup,*TheClient->iGc);
-	iBaseChildWin=new(ELeave) CBlankWindow();
-	iBaseChildWin->SetUpL(TPoint(winWidth>>2,winHeight>>2),TSize(winWidth>>1,winHeight>>1),iBaseRedrawWin,*TheClient->iGc);
-	iTestChildWin=new(ELeave) CBlankWindow();
-	iTestChildWin->SetUpL(TPoint(winWidth>>2,winHeight>>2),TSize(winWidth>>1,winHeight>>1),iTestRedrawWin,*TheClient->iGc);
-
-#if defined(InvalidRegionLogging)
-	LOG_MESSAGE5(_L("  In Wins %08x, %08x, %08x, %08x"), iBaseRedrawWin, iBaseChildWin, iTestRedrawWin, iTestChildWin);
-#endif
-
-	WaitForRedrawsToFinish(ECheckRedrawActiveObjectAndInvalidRegions);
-
-#if defined(InvalidRegionLogging)
-	LOG_MESSAGE(_L("  Done"));
-#endif
-	}
-
-void CTRedrawTest::CheckRedrawWindows()
-	{
-	_LIT(KTest,"Redraw Test, SubTest %d ");
-	TBuf<64> buf;
-	buf.Format(KTest,iTest->iState);
-	CheckRect(iBaseRedrawWin,iTestRedrawWin,TRect(iBaseRedrawWin->Size()),buf);
-	}
-
-void CTRedrawTest::InvalidateTestWins(const TRect &aRect)
-	{
-	iBaseRedrawWin->PrepareInvalidation(aRect);
-	iTestRedrawWin->PrepareInvalidation(aRect);
-	iBaseRedrawWin->PerformInvalidation();
-	iTestRedrawWin->PerformInvalidation();
-	}
-
-inline TInt CTRedrawTest::WinContent()
-	{
-	return iWinContent;
-	}
-
-void CTRedrawTest::SetBackground(const TRgb &aRgb)
-	{
-	iBaseRedrawWin->iWin.SetBackgroundColor(aRgb);
-	iTestRedrawWin->iWin.SetBackgroundColor(aRgb);
-	}
-
-void CTRedrawTest::DumpRegion(const TRegion &aRegion)
-	{
-	_LIT(KLog,"RegionRect %d: (%d,%d,%d,%d)");
-	for (TInt ii=0;ii<aRegion.Count();++ii)
-		{
-		const TRect& rect=aRegion[ii];
-		LOG_MESSAGE6(KLog,ii,rect.iTl.iX,rect.iTl.iY,rect.iBr.iX,rect.iBr.iY);
-		}
-	}
-
-/**
- * Compare Regions to see if the region we think we have dirtied can be
- * completely covered by the WServ invalid region.
- * 
- * @param aDirtyRegion 			Region we have made dirty
- * @param aWservInvalidRegion	Region WServ thinks is dirty
- */
-void CTRedrawTest::CompareRegionsL(const TRegion &aDirtyRegion,const TRegion &aWservInvalidRegion)
-	{
-	_LIT(KDirty,"Dirty Region, %d Rects");
-	_LIT(KInvalid,"Invalid Region, %d Rects");
-	_LIT(KDiff,"Diff Region, %d Rects");
-	RRegion tmp;
-	TBool loggedRegions=EFalse;
-	tmp.Copy(aDirtyRegion);
-	tmp.SubRegion(aWservInvalidRegion);
-	if (tmp.CheckError())
-		User::Leave(KErrNoMemory);
-	TBool isEmpty=tmp.IsEmpty();
-	TEST(isEmpty);
-	if (!isEmpty)
-		{
-		_LIT(KLog,"DirtyRegion contains area not in WservInvalidRegion");
-		LOG_MESSAGE(KLog);
-		loggedRegions=ETrue;
-		LOG_MESSAGE2(KDirty,aDirtyRegion.Count());
-		DumpRegion(aDirtyRegion);
-		LOG_MESSAGE2(KInvalid,aWservInvalidRegion.Count());
-		DumpRegion(aWservInvalidRegion);
-		LOG_MESSAGE2(KDiff,tmp.Count());
-		DumpRegion(tmp);
-		}
-	tmp.Copy(aWservInvalidRegion);
-	tmp.SubRegion(aDirtyRegion);
-	if (tmp.CheckError())
-		User::Leave(KErrNoMemory);
-	isEmpty=tmp.IsEmpty();
-	//TEST(isEmpty);		//This test currently fails and a defect will be raises about it
-	if (!isEmpty)
-		{
-		_LIT(KLog,"WservInvalidRegion contains area not in DirtyRegion");
-		LOG_MESSAGE(KLog);
-		if (!loggedRegions)
-			{
-			LOG_MESSAGE2(KDirty,aDirtyRegion.Count());
-			DumpRegion(aDirtyRegion);
-			LOG_MESSAGE2(KInvalid,aWservInvalidRegion.Count());
-			DumpRegion(aWservInvalidRegion);
-			}
-		LOG_MESSAGE2(KDiff,tmp.Count());
-		DumpRegion(tmp);
-		}
-	tmp.Close();
-	}
-
-void CTRedrawTest::MoveInvalidAreaL()
-	{
-	TPoint old=iTestRedrawWin->iWin.Position();
-	TSize screenSize=TheClient->iGroup->Size();
-	iBaseRedrawWin->iWin.Invalidate();
-	iTestRedrawWin->iWin.Invalidate();
-	iTestRedrawWin->iWin.SetPosition(TPoint(10,10));
-	iTestRedrawWin->iWin.SetPosition(TPoint(0,0));
-	iTestRedrawWin->iWin.SetPosition(TPoint(-10,-10));
-	iTestRedrawWin->iWin.SetPosition(TPoint(screenSize.iWidth-10,screenSize.iHeight-10));
-	iTestRedrawWin->iWin.SetPosition(TPoint(screenSize.iWidth,screenSize.iHeight));
-	iTestRedrawWin->iWin.SetPosition(TPoint(screenSize.iWidth+10,screenSize.iHeight+10));
-	iTestRedrawWin->iWin.SetPosition(old);
-	RRegion baseInvalidRegion;
-	RRegion testInvalidRegion;
-	iBaseRedrawWin->iWin.GetInvalidRegion(baseInvalidRegion);
-	iTestRedrawWin->iWin.GetInvalidRegion(testInvalidRegion);
-	CompareRegionsL(baseInvalidRegion,testInvalidRegion);
-	baseInvalidRegion.Close();
-	testInvalidRegion.Close();
-	}
-
-void CTRedrawTest::GetInvalidRegionTestsL()
-	{
-	TSize stdWinSize(iTest->StdTestWindowSize());
-	CArrayFixFlat<TRect>* rectList=new(ELeave) CArrayFixFlat<TRect>(3);
-	rectList->AppendL(TRect(1,1,5,2));
-	rectList->AppendL(TRect(stdWinSize.iWidth>>1,stdWinSize.iHeight>>1,stdWinSize.iWidth,stdWinSize.iHeight));
-	rectList->AppendL(TRect(2,0,4,5));
-	TestGetInvalidRegionL(rectList);
-	rectList->Reset();
-	rectList->AppendL(TRect(-1000,-1,10000,5));
-	rectList->AppendL(TRect(0,0,stdWinSize.iWidth>>1,stdWinSize.iHeight>>1));
-	rectList->AppendL(TRect(2,100,2*stdWinSize.iWidth,105));
-	TestGetInvalidRegionL(rectList);
-	delete rectList;
-	}
-
-void CTRedrawTest::TestGetInvalidRegionL(const CArrayFixFlat<TRect> *aRectList)
-	{
-	RRegion invalidRegion;
-	RRegion region;
-	iTestRedrawWin->iWin.BeginRedraw();
-	iTestRedrawWin->iWin.EndRedraw();
-	for (TInt index=0;index<aRectList->Count();index++)
-		{
-		iTestRedrawWin->iWin.Invalidate((*aRectList)[index]);
-		region.AddRect((*aRectList)[index]);
-		}
-	//Currently WSERV includes areas under a child or other window in the invalid region
-	//This is arguable the incorrect thing to do
-	/*TRect subRect;
-	subRect.iTl=iTestChildWin->BaseWin()->InquireOffset(iTestRedrawWin->iWin);
-	subRect.SetSize(iTestChildWin->Size());
-	region.SubRect(subRect);*/
-	region.ClipRect(TRect(iTestRedrawWin->Size()));
-	iTestRedrawWin->iWin.GetInvalidRegion(invalidRegion);
-	CompareRegionsL(region,invalidRegion);
-	region.Close();
-	invalidRegion.Close();
-	}
-
-void CTRedrawTest::Failed(TInt aOrder)
-	{
-	_LIT(KLog,"Redraw Order Error, Window Drawn at Position %d should be drawn at Position %d");
-	LOG_MESSAGE3(KLog,CTRedrawOrderWindow::RedrawNumber(),aOrder);
-	if (iRedrawNo==0)
-		iRedrawNo=CTRedrawOrderWindow::RedrawNumber();
-	}
-
-void CTRedrawTest::CheckOrderL()
-	{
-	_LIT(KLog,"Fail in redraw order test, first position of error is %d");
-	iRedrawNo=0;
-	CTRedrawOrderWindow* order1;
-	CTRedrawOrderWindow* order2;
-	CTRedrawOrderWindow* order3;
-	CTRedrawOrderWindow* order4;
-	CTRedrawOrderWindow* order5;
-	CTRedrawOrderWindow* order6;
-	CTRedrawOrderWindow* order7;
-	order6=CTRedrawOrderWindow::NewLC(6,TheClient->iGroup,TPoint(100,10),TSize(40,40),this);
-	order7=CTRedrawOrderWindow::NewLC(7,order6,TPoint(0,0),TSize(20,20),this);
-	order1=CTRedrawOrderWindow::NewLC(1,TheClient->iGroup,TPoint(10,10),TSize(60,40),this);
-	order4=CTRedrawOrderWindow::NewLC(4,order1,TPoint(20,0),TSize(20,40),this);
-	order5=CTRedrawOrderWindow::NewLC(5,order4,TPoint(0,0),TSize(20,20),this);
-	order2=CTRedrawOrderWindow::NewLC(2,order1,TPoint(0,0),TSize(20,40),this);
-	order3=CTRedrawOrderWindow::NewLC(3,order2,TPoint(0,0),TSize(20,20),this);
-	TheClient->iWs.Finish();  // Fix for DEF133199 - Intermittant failure with windows out of order 
-	WaitForRedrawsToFinish(ECheckRedrawActiveObjectAndInvalidRegions);	// Check order is correct after initial creation
-	TEST(order1!=NULL && order2!=NULL && order3!=NULL && order4!=NULL && order5!=NULL && order6!=NULL && order7!=NULL);	// redundant check to shut up the compiler
-	TEST(iRedrawNo==0);
-	if (iRedrawNo>0)
-		LOG_MESSAGE2(KLog,iRedrawNo);
-
-	CTRedrawOrderWindow::ResetRedrawNumber();
-	iRedrawNo=0;
-	CTUser::Splat(TheClient,TRect(0,0,200,60),TRgb(0,0,0));
-	TheClient->iWs.Flush();
-	WaitForRedrawsToFinish(ECheckRedrawActiveObjectAndInvalidRegions);	// Check it's still correct on subsequent redraws
-	TEST(iRedrawNo==0);
-	if (iRedrawNo>0)
-		LOG_MESSAGE2(KLog,iRedrawNo);
-	CTRedrawOrderWindow::ResetRedrawNumber();
-	CleanupStack::PopAndDestroy(7,order6);
-	}
-
-// For reproducing INC049554
-void CTRedrawTest::CheckDefectINC049554L()
-	{
-	if(TransparencySupportedL() == KErrNotSupported) //the defect only happens when transparency enabled
-		return;
-	TSize screenSize=TheClient->iScreen->SizeInPixels();
-	TPoint winPos(screenSize.iWidth/3,0);
-	TSize winSize(screenSize.iWidth/3,screenSize.iHeight);
-	CTCheckDefectWin* lowerWin=CTCheckDefectWin::NewL(winPos,winSize);
-	CleanupStack::PushL(lowerWin);
-	lowerWin->Activate();
-	TheClient->Flush();
-	WaitForRedrawsToFinish(ECheckRedrawActiveObjectAndInvalidRegions);
-
-	winPos.iX+=screenSize.iWidth/12;
-
-	CTCheckDefectWin* upperWin=CTCheckDefectWin::NewL(winPos,winSize);
-	CleanupStack::PushL(upperWin);
-	upperWin->Activate();
-	TheClient->Flush();
-	WaitForRedrawsToFinish(ECheckRedrawActiveObjectAndInvalidRegions);
-
-	// Invalidate the lower win and while drawing its content, move top window
-	lowerWin->Invalidate();
-	lowerWin->Win()->BeginRedraw();
-	TheClient->iGc->Activate(*lowerWin->DrawableWin());
-	TheClient->iGc->SetPenStyle(CGraphicsContext::ENullPen);
-	TheClient->iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TheClient->iGc->SetBrushColor(TRgb(0,255,0));
-	TheClient->iGc->DrawRect(TRect(TPoint(0,0),TSize(50,50)));
-
-	winPos.iX+=screenSize.iWidth/12;
-	upperWin->SetExt(winPos,winSize);
-
-	TheClient->iGc->SetBrushColor(TRgb(255,0,0));
-	TheClient->iGc->DrawRect(TRect(TPoint(0,0),TSize(50,50)));
-	TheClient->iGc->Deactivate();
-	lowerWin->Win()->EndRedraw();
-
-	TheClient->Flush();
-	WaitForRedrawsToFinish(ECheckRedrawActiveObjectAndInvalidRegions);
-
-	CleanupStack::PopAndDestroy(upperWin);
-
-	// Create 2 transaprent windows, slightly over lapping the background window
-	winPos.iX=screenSize.iWidth/3;
-	TPoint winPosTop(winPos.iX-screenSize.iWidth/6,0);
-	TSize winSizeTop(screenSize.iWidth/3+screenSize.iWidth/6,screenSize.iHeight/2);
-
-	CTCheckDefectWin* leftWin=CTCheckDefectWin::NewL(winPosTop,winSizeTop);
-	CleanupStack::PushL(leftWin);
-	leftWin->Win()->SetTransparencyAlphaChannel();
-	leftWin->Win()->SetBackgroundColor(TRgb(0,0,0, 128));
-	leftWin->Activate();
-	TheClient->iWs.Finish();
-	WaitForRedrawsToFinish(ECheckRedrawActiveObjectAndInvalidRegions);
-
-	CTCheckDefectWin* rightWin=CTCheckDefectWin::NewL(winPos,winSizeTop);
-	CleanupStack::PushL(rightWin);
-	rightWin->Win()->SetTransparencyAlphaChannel();
-	rightWin->Win()->SetBackgroundColor(TRgb(0,0,0, 128));
-	rightWin->Activate();
-	TheClient->iWs.Finish();
-	WaitForRedrawsToFinish(ECheckRedrawActiveObjectAndInvalidRegions);
-
-	lowerWin->Invalidate();
-	lowerWin->Win()->BeginRedraw();
-	TheClient->iGc->Activate(*lowerWin->DrawableWin());
-	TheClient->iGc->SetPenStyle(CGraphicsContext::ENullPen);
-	TheClient->iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TheClient->iGc->SetBrushColor(TRgb(0,255,0));
-	TheClient->iGc->DrawRect(TRect(TPoint(0,0),TSize(50,50)));
-
-	TheClient->iGc->SetBrushColor(TRgb(255,0,0));
-	TheClient->iGc->DrawRect(TRect(TPoint(0,0),TSize(50,50)));
-	TheClient->iGc->Deactivate();
-	lowerWin->Win()->EndRedraw();
-
-	TheClient->iWs.Finish();
-	WaitForRedrawsToFinish(ECheckRedrawActiveObjectAndInvalidRegions);
-
-	CleanupStack::PopAndDestroy(3,lowerWin);
-	}
-
-
-TInt myKK=1;
-_LIT(KSnap,"c:\\TestRect%2i.mbm");
-_LIT(KSnapE,"c:\\TestRect%2iErr.mbm");
-void CTRedrawTest::TestRect()
-	{
-	
-	TBuf<50> snapshotFileName;
-	snapshotFileName.Zero();
-	CFbsBitmap *snapshot=new(ELeave) CFbsBitmap();
-	CleanupStack::PushL(snapshot);
-	User::LeaveIfError(snapshot->Create(TheClient->iScreen->SizeInPixels(),TheClient->iScreen->DisplayMode()));		
-
-	User::LeaveIfError(TheClient->iScreen->CopyScreenToBitmap(snapshot));
-	
-	TRect rect1=TRect(TPoint(),TSize(FullScreenModeSize.iWidth/2,FullScreenModeSize.iHeight));
-	TRect rect2=TRect(TPoint(FullScreenModeSize.iWidth/2,0),TSize(FullScreenModeSize.iWidth/2,FullScreenModeSize.iHeight));
-	TBool retVal = TheClient->iScreen->RectCompare(rect1,rect2);
-
-	RDebug::Printf("Picture %i !!!: Rect1: (%i,%i)->(%i,%i)  -  Rect2: (%i,%i)->(%i,%i)",myKK,
-			rect1.iTl.iX,rect1.iTl.iY,rect1.iBr.iX,rect1.iBr.iY,
-			rect2.iTl.iX,rect2.iTl.iY,rect2.iBr.iX,rect2.iBr.iY);	
-	
-	
-	if (retVal)
-		{
-		snapshotFileName.Format(KSnap,myKK);
-		}
-	else
-		{
-		snapshotFileName.Format(KSnapE,myKK);	
-		}
-	snapshot->Save(snapshotFileName);
-	CleanupStack::PopAndDestroy(snapshot);
-	myKK++;	
-		
-	
-
-	TEST(retVal);
-	if(!retVal)
-		INFO_PRINTF3(_L("TheClient->iScreen->RectCompare() return value  - Expected: %d, Actual: %d"), ETrue, retVal);
-	}
-
-void CTRedrawTest::ConstructAndSetBlankWinLC(RBlankWindow& aWindow, TSize aSize, TPoint aPoint/*=TPoint()*/,
-						   					TRgb aBackgroundColor/*=TRgb(0,0,0)*/)
-	{
-	User::LeaveIfError(aWindow.Construct(*TheClient->iGroup->GroupWin(), ENullWsHandle));
-	CleanupClosePushL(aWindow);
-	aWindow.SetExtent(aPoint, aSize);
-	aWindow.SetColor(aBackgroundColor);
-	aWindow.Activate();
-	}
-
-void CTRedrawTest::ConstructWindowLC(RWindow& aWindow, TSize aSize, TPoint aPoint/*=TPoint()*/,
-						   			 TRgb aBackgroundColor/*=TRgb(255,255,255)*/, TBool aTransparencyByAlpha/*=EFalse*/,
-						   			 TDisplayMode aDisplayMode/*=EColor64K*/)
-	{
-	User::LeaveIfError(aWindow.Construct(*TheClient->iGroup->GroupWin(), ENullWsHandle));
-	CleanupClosePushL(aWindow);
-	aWindow.SetExtent(aPoint,aSize);
-	aWindow.SetBackgroundColor(aBackgroundColor);
-	aWindow.SetRequiredDisplayMode(aDisplayMode);
-	if (aTransparencyByAlpha)
-		{
-		aWindow.SetTransparencyAlphaChannel();
-		}
-	aWindow.Activate();
-	}
-
-void CTRedrawTest::ActivateAndSetGc(CWindowGc& aGc, RWindow& aWindow, CGraphicsContext::TBrushStyle aBrushStyle/*=CGraphicsContext::ESolidBrush*/, TRgb aBrushColor/*=TRgb(0,0,0)*/,
-					  				CGraphicsContext::TPenStyle aPenStyle/*=CGraphicsContext::ENullPen*/, TRgb aPenColor/*=TRgb(0,0,0)*/)
-	{
-	aGc.Activate(aWindow);
-	aGc.Reset();
-	aGc.SetBrushStyle(aBrushStyle);
-	aGc.SetBrushColor(aBrushColor);
-	aGc.SetPenStyle(aPenStyle);
-	aGc.SetPenColor(aPenColor);
-	}
-
-void CTRedrawTest::DrawWin(CWindowGc& aGc, RWindow& aWin, TSize aWinSize, TRgb aRectColor1, TRgb aRectColor2, TInt aNewOrdinalPos/*=0*/, RWindow* aWinToMove/*=NULL*/, TBool aDrawAllPixels/*=EFalse*/)
-	{
-	const TUint startX = 10;
-	const TUint endX = aWinSize.iWidth - startX;
-	const TUint startY = 10;
-	const TUint sHeight = (aWinSize.iHeight >> 1) - startY;
-	ActivateAndSetGc(aGc,aWin);
-	aWin.BeginRedraw();
-	if(aDrawAllPixels)
-		{
-		aGc.SetBrushColor(KWhite);
-		aGc.DrawRect(TRect(aWinSize));
-		}
-	aGc.SetBrushColor(aRectColor1);
-	aGc.DrawRect(TRect(startX, startY, endX, sHeight));
-	if (aWinToMove)
-		{
-		aWinToMove->SetOrdinalPosition(aNewOrdinalPos);
-		TheClient->iWs.Finish();
-		}
-	aGc.SetBrushColor(aRectColor2);
-	aGc.DrawRect(TRect(startX, sHeight + startY, endX, aWinSize.iHeight - startY));
-	aWin.EndRedraw();
-	aGc.Deactivate();
-	}
-
-void CTRedrawTest::CheckOrdinalPositionDefectL()
-	{
-	if(TransparencySupportedL() == KErrNotSupported) //the defect only happens when transparency enabled
-		{
-		return;
-		}
-
-	const TRgb KTransWinColor = TRgb(0,0,255,128);
-	const TUint hWidth  = FullScreenModeSize.iWidth >> 1;
-	const TSize windowSize = TSize(hWidth,FullScreenModeSize.iHeight);
-	const TPoint rightWinStartPt = TPoint(hWidth,0);
-
-	// A Blank Window to clear the screen.
-	// It is required to clear all the pixels on the screen.
-	RBlankWindow clrWin(TheClient->iWs);
-	ConstructAndSetBlankWinLC(clrWin, FullScreenModeSize);
-
-	// Transparent window
-	RWindow winLeftT(TheClient->iWs);
- 	ConstructWindowLC(winLeftT, windowSize, TPoint(), KTransWinColor,ETrue);
-
-	CWindowGc& gc = *(TheClient->iGc);
-	// Draw the Transparent Window (winLeftT) on the Left side
- 	DrawWin(gc, winLeftT, windowSize, KTransBisque, KTransLightSalmon);
-	
-	// Invisible window
-	RWindow winRightI(TheClient->iWs);
-	User::LeaveIfError(winRightI.Construct(*TheClient->iGroup->GroupWin(), ENullWsHandle));
-	CleanupClosePushL(winRightI);
-	winRightI.SetExtent(rightWinStartPt, windowSize);
-	winRightI.SetVisible(EFalse);
-	winRightI.Activate();
-
-	// Transparent window
-	RWindow winRightT(TheClient->iWs);
- 	ConstructWindowLC(winRightT, windowSize, rightWinStartPt, KTransWinColor,ETrue);
-
-	// Draw the Transparent Window (winRightT) on the Right side and change the
-	// Ordinal Position for Invisible Window (winRightI) to move it front
-	// to the Transparent Window.
-	// Invisible window is behind the Transparent Window
- 
- 	DrawWin(gc, winRightT, windowSize, KTransBisque, KTransLightSalmon, 0, &winRightI); // Move winRightI to Front of winRightT
-	TestRect();
-
-	CleanupStack::PopAndDestroy(4, &clrWin);
-	}
-
-// For reproducing PDEF099892
-void CTRedrawTest::CheckDefectPDEF099892L()
-	{
-	if(TransparencySupportedL() == KErrNotSupported) //the defect only happens when transparency enabled
-		{
-		return;
-		}
-
-	const TRgb KTransWinColor = TRgb(0,0,255,128);
-	const TUint hWidth  = FullScreenModeSize.iWidth >> 1;
-	const TUint hHeight = FullScreenModeSize.iHeight >> 1;
-	const TSize windowSize = TSize(hWidth,FullScreenModeSize.iHeight);
-	const TSize transWinSize = TSize(hWidth,hHeight + 10);
-	const TPoint rightWinStartPt = TPoint(hWidth,0);
-
-	// A Blank Window to clear the screen.
-	// It is required to clear all the pixels on the screen.
-	RBlankWindow clrWin(TheClient->iWs);
-	ConstructAndSetBlankWinLC(clrWin, FullScreenModeSize);
-
-	// Create an Opaque and a Transparent Window and Draw them on the
-	// Left Side of the Screen. Opaque Window is Behind the Transparent Window.
-	
-	// Opaque Window
-	RWindow winLeftOpq(TheClient->iWs);
-	ConstructWindowLC(winLeftOpq, windowSize, TPoint(), KRed);
-
-	// Transparent window
-	RWindow winLeftT(TheClient->iWs);
-	ConstructWindowLC(winLeftT, transWinSize, TPoint(), KTransWinColor, ETrue);
-
-	CWindowGc& gc = *(TheClient->iGc);
-	// Draw the transparent Window (winLeftT) on the Left side
- 	DrawWin(gc, winLeftT, transWinSize, KTransBisque, KTransLightSalmon);
-
-	// Draw the Opaque Window (winLeftOpq) on the Left side
-	DrawWin(gc, winLeftOpq, windowSize, KLightSteelBlue, KCadetBlue, 0, NULL, ETrue);
-
-	// Create an Invisible, an Opaque and a Transparent Window and Draw them on the
-	// Right Side of the Screen. Invisible Window is Behind the Opaque Window and
-	// Opaque Window is Behind the Transparent Window.
-	// While drawing the Transparent Window, move the Invisible Window to the Front of Opaque Window.
-	// And while Drawing the Opaque Window move the Invisible Window again Behind the Opaque Window.
-
-	// Invisible window
-	RWindow winRightI(TheClient->iWs);
-	User::LeaveIfError(winRightI.Construct(*TheClient->iGroup->GroupWin(), ENullWsHandle));
-	CleanupClosePushL(winRightI);
-	winRightI.SetExtent(rightWinStartPt, windowSize);
-	winRightI.SetVisible(EFalse);
-	winRightI.Activate();
-
-	// Opaque Window
-	RWindow winRightOpq(TheClient->iWs);
-	ConstructWindowLC(winRightOpq, windowSize, rightWinStartPt, KRed);
-
-	// Transparent window
-	RWindow winRightT(TheClient->iWs);
-	ConstructWindowLC(winRightT, transWinSize, rightWinStartPt, KTransWinColor, ETrue);
-
-	// Draw the transparent Window (winRightT) on the Right side
- 	DrawWin(gc, winRightT, transWinSize, KTransBisque, KTransLightSalmon, 1, &winRightI );
-
-	// Draw the Opaque Window (winRightOpq) on the Right side
-	DrawWin(gc, winRightOpq, windowSize, KLightSteelBlue, KCadetBlue, 2, &winRightI, ETrue);
-	
-	// Compare the Left and Right side Rectangles
-	TestRect();
-
-	CleanupStack::PopAndDestroy(6, &clrWin);
-	}
-
-void CTRedrawTest::CheckMMSDefectL(TBool aMoveBlankWindow)
-	{
-	if(TransparencySupportedL() == KErrNotSupported) //the defect only happens when transparency enabled
-		{
-		return;
-		}
-
-	const TRgb KTransWinColor = TRgb(0,0,255,128);
-	const TUint hWidth  = FullScreenModeSize.iWidth >> 1;
-	const TUint hHeight = FullScreenModeSize.iHeight >> 1;
-	const TSize windowSize = TSize(hWidth,FullScreenModeSize.iHeight);
-	const TSize transWinSize = TSize(hWidth - 20,hHeight + 10);
-	const TPoint rightWinStartPt = TPoint(hWidth,0);
-
-	// A Blank Window to clear the screen.
-	// It is required to clear all the pixels on the screen.
-	RBlankWindow clrWin(TheClient->iWs);
-	ConstructAndSetBlankWinLC(clrWin, FullScreenModeSize);
-
-	// Create an Opaque and a Transparent Window and Draw them on the
-	// Left Side of the Screen. Opaque Window is Behind the Transparent Window.
-
-	// Opaque Window
-	RWindow winLeftOpq(TheClient->iWs);
-	ConstructWindowLC(winLeftOpq, windowSize, TPoint(), KRed);
-	CWindowGc& gc = *(TheClient->iGc);
-	// Draw the Opaque Window (winLeftOpq) on the Left side
-	DrawWin(gc, winLeftOpq, windowSize, KLightSteelBlue, KCadetBlue, 0, NULL, ETrue);
-
-	// Another Window - A Blank Window
-	RBlankWindow winLeftBlank(TheClient->iWs);
-	ConstructAndSetBlankWinLC(winLeftBlank, TSize(100,100), TPoint(20,20), TRgb(128,128,128));
-
-	// Transparent window
-	RWindow winLeftT(TheClient->iWs);
-	ConstructWindowLC(winLeftT, transWinSize, TPoint(10, 10), KTransWinColor, ETrue);
-	// Draw the Transparent Window (winLeftT) on the Left side
- 	DrawWin(gc, winLeftT, transWinSize, KTransBisque, KTransLightSalmon);
-
-	// Invisible window
-	RWindow winRightI(TheClient->iWs);
-	User::LeaveIfError(winRightI.Construct(*TheClient->iGroup->GroupWin(), ENullWsHandle));
-	CleanupClosePushL(winRightI);
-	winRightI.SetExtent(rightWinStartPt, windowSize);
-	winRightI.SetVisible(EFalse);
-	winRightI.Activate();
-
-	// Opaque Window
-	RWindow winRightOpq(TheClient->iWs);
-	ConstructWindowLC(winRightOpq, windowSize, rightWinStartPt, KRed);
-
-	// Draw the Opaque Window (winRightOpq) on the Right side
-	DrawWin(gc, winRightOpq, windowSize, KLightSteelBlue, KCadetBlue, 0, NULL, ETrue);
-
-	// Another Window - A Blank Window
-	RBlankWindow winRightBlank(TheClient->iWs);
-	ConstructAndSetBlankWinLC(winRightBlank, TSize(100,100), rightWinStartPt + TPoint(20,20), TRgb(128,128,128));
-
-	// Transparent window
-	RWindow winRightT(TheClient->iWs);
-	ConstructWindowLC(winRightT, transWinSize, rightWinStartPt + TPoint(10,10), KTransWinColor, ETrue);
-
-	if (aMoveBlankWindow)
-		{
-		winRightBlank.SetOrdinalPosition(0); // Move the Blank Window to the front of the Transparent Window
-		TheClient->iWs.Finish();
-		}
-	// Draw the transparent Window (winRightT) on the Right side
- 	DrawWin(gc, winRightT, transWinSize, KTransBisque, KTransLightSalmon, 2, &winRightI);
-	if (aMoveBlankWindow)
-		{
-		winRightBlank.SetOrdinalPosition(1); // Move the Blank Window back to behind the Transparent Window
-		TheClient->iWs.Finish();
-		}
-	TestRect();
-
- 	DrawWin(gc, winRightT, transWinSize, KTransBisque, KTransLightSalmon, 0, &winRightI);
-	TestRect(); // if aMoveBlankWindow is ETrue then this will test the Defect PDEF099892
-
-	// Rest of the lines are just to check other possibilities.
-	// But,currently, they are not affecting the result.
-	// i.e. the DrawWin() functions called after this line will draw the same thing
-	// as it was drawn for the DrawWin() called just before this line.
- 	DrawWin(gc, winRightT, transWinSize, KTransBisque, KTransLightSalmon, 1, &winRightI);
-	TestRect();
-
-	DrawWin(gc, winRightT, transWinSize, KTransBisque, KTransLightSalmon, 0, &winRightI);
-	TestRect();
-
-	DrawWin(gc, winRightT, transWinSize, KTransBisque, KTransLightSalmon, 2, &winRightI);
-	TestRect();
-
-	DrawWin(gc, winRightT, transWinSize, KTransBisque, KTransLightSalmon, 1, &winRightI);
-	TestRect();
-
-	DrawWin(gc, winRightT, transWinSize, KTransBisque, KTransLightSalmon, 3, &winRightI);
-	TestRect();
-
-	CleanupStack::PopAndDestroy(8, &clrWin);
-	}
-
-/**
-
-The test window is receiving a draw request before it activates, 
-doing an empty redraw, then activating itself, and drawing itself properly in 
-response to the next redraw request.  
-
-Without the fix the next redraw request will not be received and it will be drawn blank. 
-*/
-void CTRedrawTest::CheckDefectPDEF117784L()
-	{
-	TSize winSize = BaseWin->Size();
-
-	TInt winWidth=(FullScreenModeSize.iWidth/3)-10;
-	TInt winHeight=FullScreenModeSize.iHeight-10;
-	
-	CRedrawWindow3* baseRedrawWin = new(ELeave) CRedrawWindow3(this);
-	CleanupStack::PushL(baseRedrawWin);
-	TPoint ptBase = TPoint(FullScreenModeSize.iWidth/3*2+5,5);
-	baseRedrawWin->SetUp1L(ptBase,TSize(winWidth,winHeight),TheClient->iGroup,*TheClient->iGc);
-	baseRedrawWin->SetVisible(ETrue);
-	baseRedrawWin->Activate();
-
-	CRedrawWindow3* testRedrawWin = new(ELeave) CRedrawWindow3(this);
-	CleanupStack::PushL(testRedrawWin);
-	TPoint ptTest = TPoint(FullScreenModeSize.iWidth/3+5,5);
-	testRedrawWin->SetUp1L(ptTest,TSize(winWidth,winHeight),TheClient->iGroup,*TheClient->iGc);
-	testRedrawWin->SetVisible(ETrue);
-	testRedrawWin->Activate();
-	
-	TheClient->iWs.Finish();
-	User::LeaveIfError(iInvalidRegionChecker->AddExcludedWindow(testRedrawWin));
-	TBool retVal = WaitForRedrawsToFinish(ECheckRedrawActiveObjectAndInvalidRegions);
-	TEST(retVal == KErrNone);
-	if(retVal != KErrNone)
-	    {
-	    ERR_PRINTF2(_L("CTRedrawTest::WaitForRedrawsToFinish failed with error: %d"), retVal);
-	    }
-	iInvalidRegionChecker->RemoveExcludedWindow(testRedrawWin);
-
-	TheClient->iWs.Finish();
-	retVal = WaitForRedrawsToFinish(ECheckRedrawActiveObjectAndInvalidRegions);
-	TEST(retVal == KErrNone);
-	if(retVal != KErrNone)
-	    {
-        ERR_PRINTF2(_L("CTRedrawTest::WaitForRedrawsToFinish failed with error: %d"), retVal);
-	    }
-	
-	retVal = TheClient->iScreen->RectCompare(TRect(TPoint(ptBase),TSize(winWidth,winHeight)),TRect(TPoint(ptTest),TSize(winWidth,winHeight)));
-	TEST(retVal);
-	if(!retVal)
-		{
-		ERR_PRINTF1(_L("New activated window has lost redraw request"));
-		}
-
-	CleanupStack::PopAndDestroy(2, baseRedrawWin);
-	}
-
-CInvalidRegionChecker::CInvalidRegionChecker(const CTRedrawTest& aGraphicsTest)
-	: iGraphicsTest(aGraphicsTest) 
-	{}
-
-CInvalidRegionChecker::~CInvalidRegionChecker()
-	{
-	iExcludedWindowArray.Close();
-	}
-
-TInt CInvalidRegionChecker::AddExcludedWindow(const CTWinBase* aExcludedWindow)
-	{
-	TInt error = KErrNone;
-	const CTWinBase** emptySlot = NULL;
-	for(TInt win=iExcludedWindowArray.Count()-1; win>=0; win--)
-		{
-		if(iExcludedWindowArray[win]==aExcludedWindow)
-			{
-			// window is already excluded, we don't want to add it twice
-			return error;
-			}
-		if(!emptySlot && iExcludedWindowArray[win]==NULL)
-			{
-			emptySlot = &iExcludedWindowArray[win];
-			}
-		}
-	
-	if(emptySlot)
-		{
-		// re-use the emptyslot		
-		*emptySlot=aExcludedWindow; // re-use the element
-		}
-	else
-		{
-		// no empty elements re-used, so add a new one
-		error = iExcludedWindowArray.Append(aExcludedWindow);
-		}
-	return error;
-	};
-
-void CInvalidRegionChecker::RemoveExcludedWindow(const CTWinBase* aExcludedWindow)
-	{
-	if(iExcludedWindowArray.Count())
-		{
-		for(TInt win=iExcludedWindowArray.Count()-1; win>=0; win--)
-			{
-			if(iExcludedWindowArray[win]==aExcludedWindow)
-				{
-				iExcludedWindowArray[win]=NULL; // Not worth deleting the array element, just mark it as NULL 
-				return;
-				}
-			}
-		}
-	};
-
-TBool CInvalidRegionChecker::ExcludedWindow(const CTWinBase* aWin) const
-	{
-	for(TInt win=iExcludedWindowArray.Count()-1; win>=0; win--)
-		{
-		if(aWin == iExcludedWindowArray[win])
-			{
-#if defined(InvalidRegionLogging)
-				{
-				_LIT(KText, "  Excluded Window %08x");
-				TLogMessageText buf;		
-				buf.Format(KText, aWin);
-				BLOG_MESSAGE(buf);
-				}
-#endif					
-			return ETrue;
-			}
-		}
-	return EFalse;
-	}
-
-void CInvalidRegionChecker::ProcessWindow(const CTWinBase* aTWinBase)
-	{
-#if defined(InvalidRegionLogging)
-			{
-			_LIT(KText, "  ProcessWindow %08x %d - Child(%08x), Next(%08x), Prev(%08x)");
-			TLogMessageText buf;		
-			buf.Format(KText, aTWinBase, iInvalidRegionCount, aTWinBase->Child(), aTWinBase->NextSibling(), aTWinBase->PrevSibling());
-			BLOG_MESSAGE(buf);
-			}
-#endif
-
-	if(aTWinBase && !ExcludedWindow(aTWinBase))
-		{
-		RRegion invalidRegion;
-		static_cast<const CTWin *>(aTWinBase)->Win()->GetInvalidRegion(invalidRegion);
-		iInvalidRegionCount += invalidRegion.Count();
-
-#if defined(InvalidRegionLogging)
-		if(invalidRegion.Count())
-			{
-			_LIT(KText, "  IR Found for %08x %d");
-			TLogMessageText buf;
-			buf.Format(KText, aTWinBase, invalidRegion.Count());
-			BLOG_MESSAGE(buf);
-			}
-#endif
-		
-		invalidRegion.Close();
-		
-		if(0==iInvalidRegionCount)
-			{
-			ProcessChildWindow(aTWinBase->Child());
-			}
-		}
-	}
-
-void CInvalidRegionChecker::ProcessChildWindow(const CTWinBase* aTWinBase)
-	{
-	if(aTWinBase)
-		{
-		// get the first sibling window
-		const CTWinBase *sibling=aTWinBase;
-		const CTWinBase *prevSibling=sibling->PrevSibling();
-		while(prevSibling)
-			{
-			sibling=prevSibling;			
-			prevSibling=sibling->PrevSibling();
-			}
-		// process all siblings inc. self	
-		while(sibling && (0==iInvalidRegionCount))
-			{	
-			ProcessWindow(sibling);
-			sibling=sibling->NextSibling();
-			}
-		}
-	}	
-
-
-void CInvalidRegionChecker::ProcessWindowGroup(const CTWinBase* aTWinBase)
-	{
-	if(aTWinBase && !ExcludedWindow(aTWinBase))
-		{
-		ProcessChildWindow(aTWinBase->Child());
-		}
-	}
-
-TInt CInvalidRegionChecker::CheckInvalidRegions(const CTWindowGroup* aGroup)
-	{
-	iInvalidRegionCount=0;	
-	ProcessWindowGroup(aGroup);	
-#if defined(InvalidRegionLogging)
-		{
-		_LIT(KText, "  CheckInvalidRegions %d");
-		TLogMessageText buf;
-		buf.Format(KText, iInvalidRegionCount);
-		BLOG_MESSAGE(buf);
-		}
-#endif	
-	return iInvalidRegionCount;
-	}
-
-TInt CTRedrawTest::WaitForRedrawsToFinish(TRedrawCheckType aRedrawCheckType)
-	{
-	TInt error=KErrNone;
-#define EnableCheckInvalidRegions
-#if defined(EnableCheckInvalidRegions)	
-	if(aRedrawCheckType == ECheckRedrawActiveObjectAndInvalidRegions)
-		{
-		TInt regions = 0;
-		TInt count = 0;
-		//We do not want to cycle round forever or too long, a limit of 10 has
-		//been added but this is arbitrary.  If CTClient::WaitForRedrawsToFinish
-		//fails too many times then possibly something else us wrong.
-		do
-			{
-			count++;
-			error = TheClient->WaitForRedrawsToFinish();
-			if(error != KErrNone)
-			    {
-			    RDebug::Printf("CTRedrawTest::WaitForRedrawsToFinish, error %d", error);
-			    }
-			regions = iInvalidRegionChecker->CheckInvalidRegions(TheClient->iGroup);
-			if(regions)
-				{
-				// Give the server a chance to do the redraws because 
-				// the Animation Scheduler is an idle priority AO
-				const TUint KOneSecond = 1000000; // us
-				User::After(KOneSecond>>2); // 0.25s
-				}
-			} while (0 < regions && 10 < count); 
-		}
-	else // ECheckRedrawActiveObjectOnly
-#endif // CheckInvalidRegions
-		{
-		error = TheClient->WaitForRedrawsToFinish();
-		}
-	return error;
-	}
-
-void CTRedrawTest::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(Redraw0,"Redraw1");
-	_LIT(Redraw1,"Redraw2");
-	_LIT(Redraw2,"GetInvalid");
-	_LIT(Redraw3,"MoveInvalid");
-	_LIT(Redraw4,"CheckOrder");
-	_LIT(Redraw5,"Defect 49554");
-	_LIT(Redraw6,"Check Ordinal Position");
-	_LIT(Redraw7,"Defect 99892");
-	_LIT(Redraw8,"Check MMS Defect 1");
-	_LIT(Redraw9,"Check MMS Defect 2");
-	_LIT(Redraw10,"Redraw inactive window");
-	((CTRedrawTestStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-
-	TInt testWindowDraws = -1;		// to prevent RVCT 546-D warning
-	_LIT(KLog,"RunTestCase %d");
-	if (++iTest->iState<6)
-		LOG_MESSAGE2(KLog,iTest->iState);
-	switch(iTest->iState)
-		{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0265
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test invalidation a test window and check it
-					redraws correctly
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Invalidate a test window causing it to redraw 
-
-@SYMTestExpectedResults The test window redraws correctly
-*/
-	case 1:
-		((CTRedrawTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0265"));
-		iTest->LogSubTest(Redraw0);
-		SetBackground(TRgb::Gray256(128));
-		iDrawRequestsFromTestWindow=iTestRedrawWin->DrawRequests();
-		InvalidateTestWins(TRect(10,10,50,50));
-		break;
-	case 2:
-		((CTRedrawTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0265"));
-		TheClient->iWs.Finish();
-		WaitForRedrawsToFinish(ECheckRedrawActiveObjectAndInvalidRegions);
-		testWindowDraws=iTestRedrawWin->DrawRequests();
-		if (iDrawRequestsFromTestWindow+1!=testWindowDraws)
-			{
-			LOG_MESSAGE3(_L("wrong number of test window draw requests %d %d"),
-					iDrawRequestsFromTestWindow,
-					testWindowDraws);
-			TEST(EFalse);
-			}
-		CheckRedrawWindows();
-		++iWinContent;
-		iTestRedrawWin->Reset();
-		iBaseRedrawWin->Reset();
-		TheClient->Flush();
-		WaitForRedrawsToFinish(ECheckRedrawActiveObjectAndInvalidRegions);
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0266
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test invalidation a test window and check it
-					redraws correctly
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Invalidate a test window causing it to redraw 
-
-@SYMTestExpectedResults The test window redraws correctly
-*/
-	case 3:
-		((CTRedrawTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0266"));
-		iTest->LogSubTest(Redraw1);
-		InvalidateTestWins(TRect(1,1,150,20));
-		TheClient->iWs.Finish();
-		WaitForRedrawsToFinish(ECheckRedrawActiveObjectAndInvalidRegions);
-		break;
-	case 4:
-		((CTRedrawTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0266"));
-		CheckRedrawWindows();
-		++iWinContent;
-		iTestRedrawWin->Reset();
-		iBaseRedrawWin->Reset();
-		TheClient->iWs.Flush();
-		break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0267
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test invalidation a region of a test window and check it
-					redraws correctly
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Invalidate a region of a test window causing it to redraw 
-
-@SYMTestExpectedResults The test window redraws correctly
-*/
-		case 5:
-			((CTRedrawTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0267"));
-			iTest->LogSubTest(Redraw2);
-			GetInvalidRegionTestsL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0268
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test moving an invalid  region of a test window and check it
-					redraws correctly
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Move an invalid region of a test window causing it to redraw 
-
-@SYMTestExpectedResults The test window redraws correctly
-*/
-		case 6:
-			((CTRedrawTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0268"));
-			iTest->LogSubTest(Redraw3);
-			MoveInvalidAreaL();
-			break;
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0270
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test the order redraws occur in a test window 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Set up a number of redraws for a test window and
-					invalidate it
-
-@SYMTestExpectedResults The order the test window redraws occur is correct
-*/
-
-		case 7:
-			((CTRedrawTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0270"));
-			iTest->LogSubTest(Redraw4);
-			CheckOrderL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0271
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test defect INC049554L does not occur
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Check that defect INC049554L does not occur when a test 
-					window is redrawn
-
-@SYMTestExpectedResults Defect INC049554L does not occur
-*/
-		case 8:
-			((CTRedrawTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0271"));
-			iTest->LogSubTest(Redraw5);
-			CheckDefectINC049554L();
-			break;
-/** 
- @SYMTestCaseID GRAPHICS-WSERV-0359
-
-  @SYMDEF  			PDEF099892
-
-  @SYMTestCaseDesc Ensure that changing the Ordinal postion of an Invisible Window
-  				   does not affect the Transparent Window  or Opaque Window redrawing.
-
-  @SYMTestPriority Medium
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Create an Invisible Window
-                  Create a Transparent Window
-                  Inside the Begin and End Redraw for the Transparent Window,
-                  change the Ordinal Position for Invisible Window to move it
-                  front to the Transparent Window.
-
-  @SYMTestExpectedResults Changing the Ordinal postion for Invisible Window should not
-						  affect the Transparent Window redrawing.
-*/
-		case 9:
-			((CTRedrawTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0359"));
-			iTest->LogSubTest(Redraw6);
-			CheckOrdinalPositionDefectL();
-			break;
-/** 
- @SYMTestCaseID GRAPHICS-WSERV-0360
-
-  @SYMDEF  			PDEF099892
-
-  @SYMTestCaseDesc Ensure that changing the Ordinal postion of an Invisible window
-  				   does not affect the Transparent Window  or Opaque Window redrawing.
-
-  @SYMTestPriority Medium
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Create an Invisible Window
-  				  Create an Opaque Window
-                  Create a Transparent Window
-                  Invisible Window is Behind the Opaque Window
-				  and Opaque Window is Behind the Transparent Window.
-                  While drawing the Transparent Window, move the Invisible Window
-                  to the Front of Opaque Window. And while Drawing the Opaque Window
-                  move the Invisible Window again Behind the Opaque Window.
-
-  @SYMTestExpectedResults Changing the Ordinal postion for Invisible window should not
-						  affect the Transparent Window  or Opaque Window redrawing.
-*/
-		case 10:
-			((CTRedrawTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0360"));
-			iTest->LogSubTest(Redraw7);
-			CheckDefectPDEF099892L();
-			break;
-/** 
- @SYMTestCaseID GRAPHICS-WSERV-0361
-
-  @SYMDEF  			DEF101548
-
-  @SYMTestCaseDesc Ensure that changing the Ordinal postion of an Invisible window
-  				   does not affect the Transparent Window redrawing.
-
-  @SYMTestPriority Low
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Create an Invisible Window
-  				  Create an Opaque Window
-  				  Create a Blank Window
-  				  Create a Transparent Window
-  				  Invisible Window is Behind the Opaque Window
-  				  Opaque Window is Behind the Blank Window
-  				  and Blank Window is Behind the Transparent Window.
-  				  While drawing the Transparent Window, move the Invisible Window
-  				  to the Front/Back to one or all the Other Windows.
-  				  Also move the Blank Window Front/Back to the Transparent Window for other scenario.
-
-  @SYMTestExpectedResults Changing the Ordinal postion for Invisible window should not
-						  affect the Transparent Window redrawing.
-*/
-	case 11:
-		((CTRedrawTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0361"));
-		iTest->LogSubTest(Redraw8);
-		CheckMMSDefectL(EFalse);
-	case 12:
-		((CTRedrawTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0361"));
-		iTest->LogSubTest(Redraw9);
-		CheckMMSDefectL(ETrue);// In this case we will move Blank Window Front/Back to the Transparent Window to Test Defect PDEF099892
-		break;
-	case 13:
-		iTest->LogSubTest(Redraw10);
-/**
-  @SYMTestCaseID GRAPHICS-WSERV-0362
-
-  @SYMDEF	PDEF117784
-	
-  @SYMTestCaseDesc Ensure that drawing request for non active window will not 
-	impact following redrawings
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-  
-  
-  @SYMTestActions 	Create test window as in active
-  					Create base window in active mode.
-  				    
-					The test window is receiving a draw request before it activates, 
-					doing an empty redraw, 
-					Activate test window
-					Draw test window properly in response to the next redraw request.  
-
-  @SYMTestExpectedResults The next redraw request will be received and it will be drawn correctly. 
-*/	
-			((CTRedrawTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0362"));
-			CheckDefectPDEF117784L();
-			break;
-		case 14:
-			((CTRedrawTestStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTRedrawTestStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-			break;
-		default:
-			TEST(EFalse);
-		}
-	((CTRedrawTestStep*)iStep)->RecordTestResultL();
-	}
-
-__WS_CONSTRUCT_STEP__(RedrawTest)
--- a/windowing/windowserver/tauto/TREDRAW.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,239 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TREDRAW_H__
-#define __TREDRAW_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TScreenModeScaling.h"
-#include "TGraphicsHarness.h"
-
-class CTRedrawTest;
-
-/**
- * Abstract base class to draw a pattern into a window.
- * 
- * This provides a default Draw() implementation which
- * DOES NOT set the clipping region before drawing.
- */
-class CRedrawWindow : public CTWin
-	{
-	friend class CTRedrawTest;
-public:
-	enum TDrawPattern
-		{
-		EDrawGraphPaperlHatched = 0,
-		EDrawSlantingHatched,
-		EDrawCenteredRectangle
-		};
-public:
-	CRedrawWindow(CTRedrawTest* aTest);
-	~CRedrawWindow();
-public:
-	/*
-	 * Draw the window, counting the number of calls.
-	 * @post DrawRequests() returns a value increased by 1.
-	 */
-	virtual void Reset();
-	virtual void PrepareInvalidation(const TRect& aRect) = 0;
-	virtual void PerformInvalidation() = 0;
-	//Virtual function from CTBaseWin
-	void Draw();
-public:
-	void ActivateAndDraw(TInt aPattern);
-	void DrawPattern(TInt aPattern);
-	void VisibleRegion(RRegion& aRegion);
-	void ValidateAndClear();
-	void ActivateAndDraw(TInt aPattern,TRegion* aRegion);
-	TInt DrawRequests() const;
-protected:
-	void ReceivedDrawRequest();
-	TPoint iOffset;
-	RRegion iInvalid;
-	CTRedrawTest *iTest;
-private:
-	TInt iDrawRequests;
-	};
-
-/**
- * Concrete class to draw a pattern into a window.
- * 
- */
-class CReferenceComparisonRedrawWindow : public CRedrawWindow
-	{
-public:
-	CReferenceComparisonRedrawWindow(CTRedrawTest* aTest);
-public:
-	// from CRedrawWindow
-	void PrepareInvalidation(const TRect& aRect);
-	void PerformInvalidation();
-	};
-
-class CRedrawWindow2 : public CRedrawWindow
-	{
-public:
-	CRedrawWindow2(CTRedrawTest* aTest);
-public:
-	//Virtual function from CTBaseWin overridden in CRedrawWindow
-	void Draw();
-	//Virtual function from CRedrawWindow
-	void Reset();
-	// from CRedrawWindow
-	void PrepareInvalidation(const TRect& aRect);
-	void PerformInvalidation();
-private:
-	TBool iClipped;
-	};
-
-class CRedrawWindow3 : public CRedrawWindow
-	{
-public:
-	CRedrawWindow3(CTRedrawTest* aTest);
-public:
-	//Virtual function from CTBaseWin overridden in CRedrawWindow
-	void Draw();
-	// from CRedrawWindow
-	void PrepareInvalidation(const TRect& aRect);
-	void PerformInvalidation();
-public:
-	void SetUp1L(TPoint pos,TSize size,CTWinBase* parent,CWindowGc& aGc);
-	void Activate();
-	void Redraw(const TRect& aRect);
-protected:
-	TBool isActive;
-	};
-
-class CTRedrawOrderWindow : public CTWin
-	{
-public:
-	CTRedrawOrderWindow(TInt aOrder, CTRedrawTest *aTest);
-	static CTRedrawOrderWindow* NewLC(TInt aOrder,CTWinBase* aParent,const TPoint& aPos,const TSize& aSize,CTRedrawTest* aTest);
-	inline static TInt RedrawNumber() {return iRedrawNumber;}
-	static void ResetRedrawNumber();
-	void Redraw(const TRect& aRect);
-	void Draw();
-private:
-	CTRedrawTest* iTest;
-	TInt iOrder;
-	static TInt iRedrawNumber;
-	};
-
-class CTCheckDefectWin : public CBasicWin
-	{
-public:
-	static CTCheckDefectWin *NewL(TPoint aPos,TSize aWinSize);
-private:
-	CTCheckDefectWin(){}
-	};
-
-class CInvalidRegionChecker : public CBase
-	{
-public:
-	CInvalidRegionChecker(const CTRedrawTest& aGraphicsTest);
-	~CInvalidRegionChecker();
-	
-	TInt CheckInvalidRegions(const CTWindowGroup* aGroup);	
-	TBool ExcludedWindow(const CTWinBase* aTWinBase) const;	
-	TInt AddExcludedWindow(const CTWinBase* aExcludedWindow);
-	void RemoveExcludedWindow(const CTWinBase* aExcludedWindow);
-private:
-	void ProcessWindowGroup(const CTWinBase* aTWinBase);
-	void ProcessChildWindow(const CTWinBase* aTWinBase);
-	void ProcessWindow(const CTWinBase* aTWinBase);
-private:
-	TInt iInvalidRegionCount;
-	RPointerArray<const CTWinBase> iExcludedWindowArray;
-	const CTRedrawTest& iGraphicsTest;
-	};
-
-class CTRedrawTest : public CTWsGraphicsBase
-	{
-public:
-	CTRedrawTest(CTestStep* aStep);
-	~CTRedrawTest();
-	void doDestruct();
-	void ConstructL();
-	void CheckRedrawWindows();
-	void ProcessBaseInvalidate();
-	void SetBackground(const TRgb& aRgb);
-	void DumpRegion(const TRegion& aRegion);
-	inline TInt WinContent();
-	void InvalidateTestWins(const TRect& aRect);
-	void MoveInvalidAreaL();
-	void TestGetInvalidRegionL(const CArrayFixFlat<TRect>* aRectList);
-	void GetInvalidRegionTestsL();
-	void CompareRegionsL(const TRegion& aRegion1,const TRegion& aRegion2);
-	void Failed(TInt aOrder);
-	void CheckOrderL();
-	void TestRect();
-	void CheckDefectINC049554L();
-	void CheckDefectPDEF099892L();
-	void CheckOrdinalPositionDefectL();
-	void CheckDefectPDEF117784L();
-	void CheckMMSDefectL(TBool aMoveBlankWindow);
-	void ConstructAndSetBlankWinLC(RBlankWindow& aWindow, TSize aSize, TPoint aPoint=TPoint(),
-						   TRgb aBackgroundColor=TRgb(0,0,0));
-	void ConstructWindowLC(RWindow& aWindow, TSize aSize, TPoint aPoint=TPoint(),
-						   TRgb aBackgroundColor=TRgb(255,255,255), TBool aTransparencyByAlpha=EFalse,
-						   TDisplayMode aDisplayMode=EColor64K);
-	void ActivateAndSetGc(CWindowGc& aGc, RWindow& aWindow, CGraphicsContext::TBrushStyle aBrushStyle=CGraphicsContext::ESolidBrush, TRgb aBrushColor=TRgb(0,0,0),
-						  		CGraphicsContext::TPenStyle aPenStyle=CGraphicsContext::ENullPen, TRgb aPenColor=TRgb(0,0,0));
-	void DrawWin(CWindowGc& aGc, RWindow& aWin, TSize winSize, TRgb aRectColor1, TRgb aRectColor2, TInt aNewOrdinalPos=0, RWindow* aWinToMove=NULL, TBool aDrawAllPixels=EFalse);
-	enum TRedrawCheckType
-		{
-		ECheckRedrawActiveObjectOnly,
-		ECheckRedrawActiveObjectAndInvalidRegions	
-		};
-	TInt WaitForRedrawsToFinish(TRedrawCheckType aRedrawCheckType);
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	void ValidateAndClear(TestWindow *aWin);
-private:
-	TSize iWinSize;
-	TBool iDoCheck;
-	TInt iRedrawNo;
-	CReferenceComparisonRedrawWindow *iBaseRedrawWin;
-	CRedrawWindow2 *iTestRedrawWin;
-	CBlankWindow *iBaseChildWin;
-	CBlankWindow *iTestChildWin;
-	TInt iDrawRequestsFromTestWindow;
-	TInt iWinContent;
-	CInvalidRegionChecker *iInvalidRegionChecker;
-	};
-
-class CTRedrawTestStep : public CTGraphicsStep
-	{
-public:
-	CTRedrawTestStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTRedrawTestStep,"TRedrawTest");
-
-
-#endif
--- a/windowing/windowserver/tauto/TREDRSTR.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3947 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test redraw storing
-// Tests Storing the Redraw command mechanism in the window server.
-// The first time a window is redrawn its commands are stored. When
-// the window needs to be redrawn, the stored commands will be used
-// rather than issue a redraw request to the client.
-// The principle behind this test is to do lots of different types of drawing to a window,
-// invalidate the window and test that no redrawing occurred, instead the stored commands
-// should be used to generate the content of the window.
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TREDRSTR.H"
-#include "colorblender.h"
-
-//#define LOGGING on
-
-_LIT(KColorUnmatchedFormat, "Check failed, expected color value: 0x%08x, got: 0x%08x");
-#define TEST_COLOR_MATCH(aExpected, aActual) \
-	TEST(aExpected == aActual); \
-	if(aExpected != aActual) \
-		LOG_MESSAGE3(KColorUnmatchedFormat, aExpected.Value(), aActual.Value())
-
-/*CPartialRedrawWin*/
-void CPartialRedrawWin::Init()
-	{
-	iClientDrawn = EFalse;
-	iClientCanDraw = ETrue;
-	Win()->SetRequiredDisplayMode(EColor16MA);
-	Win()->SetTransparencyAlphaChannel();
-	Win()->SetBackgroundColor(TRgb(127,127,127,0));
-	}
-	
-void CPartialRedrawWin::Draw()
-	{
-	DoDraw(*iGc);
-	}
-	
-void CPartialRedrawWin::DrawToBmp(CGraphicsContext& aGc)
-	{
-	DoDraw(aGc);
-	}	
-	
-void CPartialRedrawWin::DoDraw(CGraphicsContext& aGc)
-	{
-	if(!iClientCanDraw) return;
-	iClientDrawn = ETrue;
-	CPartialRedrawWin::DrawRects(aGc, iSize, TPoint(0,0), ETrue, EPartialRedraw_Unknown);
-	}
-
-/*static*/
-void CPartialRedrawWin::DrawRects(CGraphicsContext& aGc, TSize aSize, TPoint aPosition, 
-	TBool aIsFullRedraw, TPartialRedrawType aPartialRedrawType)
-	{
-	aGc.SetPenStyle(CGraphicsContext::ESolidPen);
-	aGc.SetPenColor(TRgb::Gray256(0));
-	aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
-	if(aIsFullRedraw)
-		{
-		aGc.SetBrushColor(TRgb(200,200,200,127));
-		aGc.DrawRect(TRect(aPosition, aSize));
-		}
-	else if (aPartialRedrawType!=EPartialRedraw_PreserveStoredCmds)
-		{
-		aGc.SetBrushColor(TRgb(200,200,200,127));	// same color as original background.
-		aGc.SetPenStyle(CGraphicsContext::ENullPen);
-		aGc.DrawRect(TRect(TPoint(10,10) + aPosition, aSize - TSize(20,20)));
-		aGc.SetPenStyle(CGraphicsContext::ESolidPen);
-		aGc.SetPenColor(TRgb::Gray256(0));
-		}
-	TSize r1 = TSize(aSize.iWidth/3, aSize.iHeight/5);
-	TSize r2 = TSize(aSize.iWidth/9, 2*aSize.iHeight/3);
-	aGc.SetBrushColor(TRgb(255, 0, 0, 127));
-	aGc.DrawEllipse(TRect(TPoint(aSize.iWidth/3, aSize.iHeight/5)+aPosition, r1));
-	aGc.SetBrushColor(TRgb(0, 255, 0, 127));
-	aGc.DrawEllipse(TRect(TPoint(aSize.iWidth/3, 3*aSize.iHeight/5)+aPosition, r1));
-	aGc.SetBrushColor(TRgb(0, 0, 255, 127));
-	aGc.DrawEllipse(TRect(TPoint(4*aSize.iWidth/9, aSize.iHeight/6)+aPosition, r2));
-	}
-	
-void CPartialRedrawWin::DrawPartial(TPartialRedrawType aPartialRedrawType)
-	{
-	TRect rect = TRect(TPoint(10,10), iSize - TSize(20,20));
-	Invalidate(rect);
-	Win()->BeginRedraw(rect);
-	iGc->Activate(*Win());
-	CPartialRedrawWin::DrawRects(*iGc, iSize, TPoint(0,0), EFalse, aPartialRedrawType);
-	iGc->Deactivate();
-	Win()->EndRedraw();
-	}
-void CPartialRedrawWin::RedrawSubRectWithBitmapL(TRgb aBitmapColour)
-	{
-	TInt bitmapWidth = Win()->Size().iWidth - 20;
-	TInt bitmapHeight = Win()->Size().iHeight - 20;
-	TSize bitmapSize(bitmapWidth, bitmapHeight);
-
-	CFbsBitmap* fbsBitmap = new(ELeave) CFbsBitmap();
-	CleanupStack::PushL(fbsBitmap);
-	User::LeaveIfError(fbsBitmap->Create(bitmapSize, EColor16MU));
-
-	// ensure colour is opaque
-	aBitmapColour.SetAlpha(255);
-
-	// draw on the bitmap
-	TBitmapUtil bmpUtil(fbsBitmap);
-	bmpUtil.Begin(TPoint(0, 0));
-	TInt row, col;
-	for(row = 0; row < bitmapWidth; ++row)
-		{
-		bmpUtil.SetPos(TPoint(row, 0));
-		for(col = 0; col < bitmapHeight; ++col)
-			{ // diagonal stripes
-			if ( ((col + row) % 8) < 4 )
-				{ // colour
-				bmpUtil.SetPixel(aBitmapColour.Color16M());
-				}
-			else
-				{ // semi-transparent white
-				TRgb white(255, 255, 255, 128);
-				bmpUtil.SetPixel(white.Color16M());
-				}
-			bmpUtil.IncYPos();
-			}
-		}
-	bmpUtil.End();
-
-	// send bitmap to screen
-	TRect rect = TRect(TPoint(10,10), bitmapSize);
-	Invalidate(rect);
-	Win()->BeginRedraw(rect);
-	iGc->Activate(*Win());
-	iGc->DrawBitmap(rect, fbsBitmap);
-	iGc->Deactivate();
-	Win()->EndRedraw();
-	CleanupStack::PopAndDestroy(fbsBitmap);
-	}
-
-/* CResetRedrawStoreWin */
-
-const TInt KResetRedrawMaxAnimState=4;
-
-void CResetRedrawStoreWin::PreSetSize(const TSize &aSize)
-// Sets the size variable so draw code using it will use the new size
-// before the window has actually been resized
-	{
-	iSize=aSize;
-	}
-
-void CResetRedrawStoreWin::Draw()
-	{
-	DoDraw(*iGc);
-	}
-	
-void CResetRedrawStoreWin::DoDraw(CGraphicsContext& aGc) const
-	{
-	aGc.SetPenStyle(CGraphicsContext::ESolidPen);
-	aGc.SetPenColor(KRgbBlack);
-	aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
-	aGc.SetBrushColor(TRgb(200,200,200,127));
-	aGc.DrawRect(TRect(iSize));
-	TSize r1(iSize.iWidth/3, iSize.iHeight/5);
-	TSize r2(iSize.iWidth/9, 2*iSize.iHeight/3);
-	aGc.SetBrushColor(TRgb(255, 0, 0, 127));
-	aGc.DrawEllipse(TRect(TPoint(iSize.iWidth/3, iSize.iHeight/5), r1));
-	aGc.SetBrushColor(TRgb(0, 255, 0, 127));
-	aGc.DrawEllipse(TRect(TPoint(iSize.iWidth/3, 3*iSize.iHeight/5), r1));
-	aGc.SetBrushColor(TRgb(0, 0, 255, 127));
-	aGc.DrawEllipse(TRect(TPoint(4*iSize.iWidth/9, iSize.iHeight/6), r2));
-	DoDrawAnim(aGc);
-	}
-
-TRect CResetRedrawStoreWin::AnimRect() const
-	{
-	if (iUpdateInRedraw)
-		{
-		TInt row=iAnimState/iSize.iWidth;
-		TInt col=iAnimState-row*iSize.iWidth;
-		return(TRect(col,row,col+4,row+4));
-		}
-	return(TRect(iSize.iWidth/6,iSize.iHeight/4,iSize.iWidth*5/6,iSize.iHeight*3/4));
-	}
-
-void CResetRedrawStoreWin::DoDrawAnim(CGraphicsContext& aGc) const
-	{
-	if (iAnimState>0)
-		{
-		aGc.SetBrushColor(KRgbBlue);
-		aGc.SetPenStyle(CGraphicsContext::ENullPen);
-		aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
-		TInt animColState=iAnimState%KResetRedrawMaxAnimState;
-		TRgb animCol(255*animColState/KResetRedrawMaxAnimState,0,255*(KResetRedrawMaxAnimState-animColState)/KResetRedrawMaxAnimState);
-		aGc.SetBrushColor(animCol);
-		aGc.DrawRect(AnimRect());
-		}
-	}
-
-CResetRedrawStoreWin::~CResetRedrawStoreWin()
-	{
-	delete iExtraGc;
-	}
-
-void CResetRedrawStoreWin::SetUpdateInRedraw(TBool aUpdateInRedraw)
-	{
-	iUpdateInRedraw=aUpdateInRedraw;
-	}
-
-void CResetRedrawStoreWin::SetKeepGcActive(TBool aState)
-	{
-	if (iKeepGcActive!=aState)
-		{
-		iKeepGcActive=aState;
-		if (iKeepGcActive)
-			{
-			iExtraGc=new(ELeave) CWindowGc(TheClient->iScreen);
-			iExtraGc->Construct();
-			iExtraGc->Activate(*Win());
-			}
-		else
-			{
-			iExtraGc->Deactivate();
-			delete iExtraGc;
-			iExtraGc=NULL;
-			}
-		}
-	}
-
-TBool CResetRedrawStoreWin::Failed() const
-	{
-	return iFailed;
-	}
-	
-void CResetRedrawStoreWin::UpdateAnim(TInt aSteps)
-	{
-	TRect oldAnimRect(AnimRect());
-	iAnimState+=aSteps;
-	if (iUpdateInRedraw)
-		{
-		if (iAnimState>=(iSize.iWidth*iSize.iHeight))
-			{
-			iFailed=ETrue;
-			}
-		}
-	else if (iAnimState>KResetRedrawMaxAnimState)
-		{
-		iAnimState-=KResetRedrawMaxAnimState;
-		}
-	CWindowGc *gc=Gc();
-	if (iUpdateInRedraw)
-		{
-		Win()->Invalidate(oldAnimRect);
-		Win()->BeginRedraw(oldAnimRect);
-		if (iKeepGcActive)
-			{
-			DoDraw(*iExtraGc);
-			}
-		else
-			{
-			gc->Activate(*Win());
-			DoDraw(*gc);
-			gc->Deactivate();
-			}
-		Win()->EndRedraw();
-		TRect animRect=AnimRect();
-		Win()->Invalidate(animRect);
-		Win()->BeginRedraw(animRect);
-		}
-	if (iKeepGcActive)
-		DoDrawAnim(*iExtraGc);
-	else
-		{
-		gc->Activate(*Win());
-		DoDrawAnim(*gc);
-		gc->Deactivate();
-		}
-	if (iUpdateInRedraw)
-		Win()->EndRedraw();
-	}
-
-void CTRedrawStoring::GetTestWinSizeAndPos(TInt aWinIndex, TPoint& aPos, TSize& aSize) const
-	{
-	switch(aWinIndex)
-		{
-		case 0:
-			// Centered window half the width of the parent window
-			aSize.iWidth=iWinSize.iWidth/2;
-			aSize.iHeight=iWinSize.iHeight/2;
-			aPos.iX=iWinSize.iWidth/4;
-			aPos.iY=iWinSize.iHeight/4;
-			break;
-		case 1:
-			// 1/3rd parent window size window positioned 1/3rd spare size in from the bottom right
-			aSize.iWidth=iWinSize.iWidth/3;
-			aSize.iHeight=iWinSize.iHeight/3;
-			aPos.iX=(iWinSize.iWidth-aSize.iWidth)*2/3;
-			aPos.iY=(iWinSize.iHeight-aSize.iHeight)*2/3;
-			break;
-		}
-	}
-
-/*CRedrawStoreWin*/
-
-void CRedrawStoreWin::Draw()
-	{
-	if (iTest->iQueueTest)
-		iDrawOrder=iTest->iDrawOrder++;
-	iTest->DoDrawingL(iGc);
-	}
-
-
-/*CNoDrawWin*/
-
-void CNoDrawWin::Draw()
-	{
-	//Deliberately  have no drawing
-	}
-
-/*CBitmapMaskedWin*/
-CBitmapMaskedWin* CBitmapMaskedWin::NewL(CFbsBitmap* aFbsBitmap,CFbsBitmap* aFbsMaskBitmap,
-										CWsBitmap* aWsBitmap,CWsBitmap* aWsMaskBitmap,
-										TRgb aBackground,TRect aRect,TBool aInvertMask,TBool aWsFbs)
-	{
-	CBitmapMaskedWin* self=new(ELeave) CBitmapMaskedWin(aFbsBitmap,aFbsMaskBitmap,aWsBitmap,
-														aWsMaskBitmap,aRect,aInvertMask,aWsFbs);
-	CleanupStack::PushL(self);
-	self->ConstructL(*TheClient->iGroup);
-	self->AssignGC(*TheClient->iGc);
-	self->BaseWin()->SetRequiredDisplayMode(EColor16MU);
-	self->Win()->SetBackgroundColor(aBackground);
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-CBitmapMaskedWin::~CBitmapMaskedWin()
-	{
-	delete iFbsBitmap;
-	delete iFbsMaskBitmap;
-	delete iWsBitmap;
-	if (!iWsFbs)
-		{
-		delete iWsMaskBitmap;	
-		}
-	}
-
-void CBitmapMaskedWin::SetDestRectSize(const TSize aSize)
-	{
-	iRect.SetSize(aSize);
-	}
-
-void CBitmapMaskedWin::Draw()
-	{
-	if (iWsFbs)
-		{
-		TheClient->iGc->DrawBitmapMasked(iRect,iWsBitmap,TRect(iWsBitmap->SizeInPixels()),iWsMaskBitmap,iInvertMask);
-		}
-	else
-		{
-		TheClient->iGc->DrawBitmapMasked(iRect,iFbsBitmap,TRect(iFbsBitmap->SizeInPixels()),iFbsMaskBitmap,iInvertMask);
-		}
-	}
-
-
-/* TESTCASE:	DEF095130
- * TITLE:		Redraw store for Alpha Channel Transparency.
- * IMPORTANCE:	1
- *
- * ACTION: a. Creates a window disable the redrawstore. Set the Alpha channel
- * Transparency.
- *
- * RESULT: Redraw store should be enabled and should redraw correctly.
- */
-void CTRedrawStoring::DoRedrawStoreAlphaChannelTransTest()
-	{
-	// Create testwin and disable the redraw store
-	// Set alpha transparency and check if redraw store is enabled
-	RWindow win(TheClient->iWs);
-	CleanupClosePushL(win);
-	User::LeaveIfError(win.Construct(*TheClient->iGroup->GroupWin(), ENullWsHandle));
-	win.SetExtent(iWinPos, iWinSize);
-	win.SetRequiredDisplayMode(EColor256);
-	win.EnableRedrawStore(EFalse);
-	win.SetTransparencyAlphaChannel();
-	TEST(win.IsRedrawStoreEnabled());
-	CleanupStack::PopAndDestroy(&win);
-
-	// Create a window and disable the redraw store
-	// Set alpha transparency and check if redraw store is enabled
-	// and check if redraw storing is done correctly
-	RWindow wint(TheClient->iWs);
-	CleanupClosePushL(wint);
-	User::LeaveIfError(wint.Construct(*TheClient->iGroup->GroupWin(), ENullWsHandle));
-	wint.SetExtent(iWinPos, iWinSize);
-	wint.SetRequiredDisplayMode(iTestDisplayMode);
-	wint.SetBackgroundColor(TRgb(255,255,255));
-	wint.SetShadowDisabled(ETrue);
-	wint.EnableRedrawStore(EFalse);
-	wint.SetTransparencyAlphaChannel();
-	wint.Activate();
-	wint.BeginRedraw();
-	TheClient->iGc->Activate(wint);
-	DoDrawingL(23,TheClient->iGc,ETrue);
-	TheClient->iGc->Deactivate();
-	wint.EndRedraw();
-
-	DoDrawingL(23,iCheckGc,EFalse);
-	iCheckWin->BackedUpWin()->UpdateScreen();
-	
-	iBlankWin.SetOrdinalPosition(0);
-	iBlankWin.SetVisible(ETrue);
-	iBlankWin.SetVisible(EFalse);
-
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	TInt gap = 5;
-	const TSize scrSize(TheClient->iScreen->SizeInPixels());
-	TEST(TheClient->iScreen->RectCompare(TRect(TPoint(scrSize.iWidth-2*iWinSize.iWidth-gap,0),iWinSize),TRect(TPoint(scrSize.iWidth-iWinSize.iWidth,0),iWinSize)));
-	CleanupStack::PopAndDestroy(&wint);
-	}
-
-/* TESTCASE:	PDEF091091
- * TITLE:		Redraw in between begin and end redraw.
- * IMPORTANCE:	1
- *
- * ACTION: Draws some content to test window in its redraw. Then starts drawing 
- * to test window by using BeginRedraw and EndRedraw methods. A blank window in 
- * front of test wndow is made visible and invisible in between BeginRedraw and
- * EndRedraw.
- * 
- *
- * RESULT: When the window is made visible again redraw should ot happen.
- */
-void CTRedrawStoring::DoBeginEndRedraw()
-	{
-	// Check whether redrawstoring is working
-	RedrawWindows();
-	iBlankWin.SetVisible(ETrue);
-	iBlankWin.SetVisible(EFalse);
-	iClientDidDraw = EFalse;
-	CheckWindowsMatch();
-	TEST(!iClientDidDraw);
-	if(iClientDidDraw != 0)
-		INFO_PRINTF3(_L("iClientDidDraw Expected value %d Actual value %d"), 0, iClientDidDraw);
-		
-	// Change the size and make the blank window visible
-	// Then start drawing by BeginRedraw and Activating its gc
-	// Now make the blank window visible
-	iTestWin->Win()->Invalidate();
-	iBlankWin.SetSize(TSize(40,40));
-	iBlankWin.SetVisible(ETrue);
-	
-	CWindowGc* gc = iTestWin->Gc();
-	RWindow* win = iTestWin->Win();
-	win->BeginRedraw();
-	gc->Activate(*win);
-	gc->SetPenStyle(CGraphicsContext::ESolidPen);
-	gc->SetPenColor(TRgb(0,0,0));
-	gc->SetPenSize(TSize(1,1));
-	gc->DrawLine(TPoint(iWinSize.iWidth,0), TPoint(0, iWinSize.iHeight));
-	iBlankWin.SetVisible(EFalse);
-	gc->DrawLine(TPoint(0,0), TPoint(iWinSize.iWidth, iWinSize.iHeight));
-	iBlankWin.SetVisible(ETrue);
-	gc->DrawLine(TPoint(iWinSize.iWidth/2,0), TPoint(iWinSize.iWidth/2, iWinSize.iHeight));
-	gc->DrawLine(TPoint(0,iWinSize.iHeight/2), TPoint(iWinSize.iWidth, iWinSize.iHeight/2));
-	
-	iCheckGc->Clear();
-	iCheckGc->SetPenStyle(CGraphicsContext::ESolidPen);
-	iCheckGc->SetPenColor(TRgb(0,0,0));
-	iCheckGc->SetPenSize(TSize(1,1));
-	iCheckGc->DrawLine(TPoint(iWinSize.iWidth/2,0), TPoint(iWinSize.iWidth/2, iWinSize.iHeight));
-	iCheckGc->DrawLine(TPoint(0,iWinSize.iHeight/2), TPoint(iWinSize.iWidth, iWinSize.iHeight/2));
-	iCheckGc->DrawLine(TPoint(0,0), TPoint(iWinSize.iWidth, iWinSize.iHeight));
-	iCheckGc->DrawLine(TPoint(iWinSize.iWidth,0), TPoint(0, iWinSize.iHeight));
-	iCheckWin->BackedUpWin()->UpdateScreen();
-	
-	iBlankWin.SetVisible(EFalse);
-	
-	// This is to check if any redraw happened in between Begin and EndRedraw
-	/* Andy commented this out.  I'm not entirely sure what it's doing.  We just redrew a window
-	while part of it was hidden, and then revealed the hidden part before calling EndRedraw, and
-	this is testing that the new draw commands for the region revealed are not processed, or are not
-	processed correctly. In the new window server they are processed and the region checked matches
-	the test bitmap. */
-//	TInt gap = 5;
-//	const TSize scrSize(TheClient->iScreen->SizeInPixels());
-//	TBool failed=DoCheckRect(TPoint(scrSize.iWidth-2*iWinSize.iWidth-gap,0),TPoint(scrSize.iWidth-iWinSize.iWidth,0),TSize(40,40));
-	gc->Deactivate();
-	win->EndRedraw();
-/*	if (failed)
-		{
-		TEST(EFalse);
-		return;
-		} */
-
-	// This is to check redraw is done after EndRedraw has called.
-	iBlankWin.SetVisible(ETrue);
-	iBlankWin.SetVisible(EFalse);
-	CheckRect(iTestWin,iCheckWin,TRect(TSize(40,40)),_L("CTRedrawStoring::DoBeginEndRedraw"));
-	// Finally bring every thing to normal
-	RedrawWindows();
-	CheckWindowsMatch();
-	iBlankWin.SetSize(iWinSize);
-	}
-/**
-@SYMTestCaseID			GRAPHICS-WSERV-00XX-0006
-
-@SYMDEF             	INC087721
-
-@SYMTestCaseDesc    	Invisible Redraw Storing Test
-						Tests the non-redraw storing commands are stored/executed properly,
-						in presence of partial redraw commands.
-						When a semi-transparent window ST0 sits on top of an opaque window OW1,
-						you want the screen to be drawn as OW1, then alpha-blend ST0 once.
-						When ST0 is set to invisible, you want the screen to be drawn as OW1,
-						i.e. window server to not issue redraw requests for ST0.
-						When an opaque window OW2 sites on top of an opaque window OW1,
-						you want the screen to be drawn as OW1, then over-print OW2 once.
-						When OW2 is set invisible, you want the screen to be drawn as OW1,
-						i.e. window server to not issue redraw requests for OW2.
-						The reference document specifies that invisible windows do not receive
-						any window server events, i.e. no redraw requests.			
-
-@SYMTestPriority    	High
-
-@SYMTestStatus      	Implemented
-
-@SYMTestActions			Makes invisible a window with an invalid area
-
-@SYMTestExpectedResults	When the window is made visible again it should display correctly
- */
-void CTRedrawStoring::DoInvisibleRedrawStoreTestL( TBool aUseTransparency )
-	{
-	/*
-	 * Obtain the color of a particular reference pixel which will be used for
-	 * comparison later on when the blue test window is added covering it.
-	 */
-	const TPoint referencePixel(iWinPos+TPoint(50,50));
-	TRgb backgroundReferenceColor;
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	TheClient->iWs.Finish();
-	TheClient->iScreen->GetPixel(backgroundReferenceColor, referencePixel);
-	/*
-	 * Add a blue test window: transparent or opaque given parameter aUseTransparency
-	 */
-	CInvisibleRedrawWin* testWin=new(ELeave) CInvisibleRedrawWin;
-	CleanupStack::PushL(testWin);
-	testWin->ConstructL(*TheClient->iGroup);
-	testWin->AssignGC(*TheClient->iGc);
-	testWin->SetExt(iWinPos+TPoint(25,25),TSize(300,200));
-	testWin->Win()->SetRequiredDisplayMode(iTestDisplayMode);
-	testWin->Win()->SetShadowDisabled(ETrue);
-	if (aUseTransparency)
-		{
-		const TInt err = testWin->MakeTransparent();
-		if (err)
-			{
-			TEST(EFalse);
-			_LIT(KLog,"Failed to make the window transparent!");
-			LOG_MESSAGE(KLog);
-			}
-		}
-	/*
-	 * Make the blue testWin window appear on top of the window at iWinPos
-	 */
-	testWin->Win()->Activate();
-	testWin->Win()->Invalidate();
-	TheClient->iWs.Finish();
-	TheClient->WaitForRedrawsToFinish();
-	/*
-	 * By making the blue window invisible and then visible we can check to see if
-	 * the window gets re-drawn correctly.  Redraws should not come in during the
-	 * invisible phase, because "invisible windows do not receive any window server events"
-	 * but should come in during the visible phase.  The background should have been
-	 * drawn first and then the blue window alpha blended exactly once.
-	 */
-	testWin->MakeVisible(EFalse);
-	testWin->Win()->Invalidate();
-	testWin->MakeVisible(ETrue);
-	testWin->Win()->Invalidate();
-	/*
-	 * Now check the screen has the desired color at the reference pixel.
-	 */
-	TRgb actualColor;
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	TheClient->iWs.Finish();
-	TheClient->iScreen->GetPixel(actualColor, referencePixel);
-	if (aUseTransparency)
-		{
-		CColorBlender* blender = CColorBlender::NewLC(iTestDisplayMode);
-		blender->SetInitialColor(backgroundReferenceColor);
-		blender->Blend(TRgb(0, 0, 255, 127)); //the blue background of the window
-		const TRgb expectedColor(blender->Color());
-		TEST_COLOR_MATCH(expectedColor, actualColor);
-		CleanupStack::PopAndDestroy(blender);
-		}
-	else
-		{
-		TEST_COLOR_MATCH(KRgbBlue, actualColor);
-		}
-	CleanupStack::PopAndDestroy(testWin);
-	}
-
-/*CInvisibleRedrawWin*/
-CInvisibleRedrawWin::CInvisibleRedrawWin()
-	: iVisible( ETrue )
-	{}
-
-TInt CInvisibleRedrawWin::MakeTransparent()
-	{
-	const TInt err = Win()->SetTransparencyAlphaChannel();
-	if(!err)
-		{
-		Win()->SetBackgroundColor(TRgb(0, 0, 0, 0));
-		iTransparent = ETrue;
-		}
-	return err;
-	}
-
-void CInvisibleRedrawWin::MakeVisible( TBool aVisible )
-	{
-		iVisible = aVisible;
-		SetVisible( aVisible );
-	}
-
-void CInvisibleRedrawWin::Redraw()
-	{
-	iWin.BeginRedraw();
-	DrawIfVisible();
-	iWin.EndRedraw();
-	}
-
-void CInvisibleRedrawWin::Redraw( const TRect &aRect )
-	{
-	iWin.BeginRedraw( aRect );
-	DrawIfVisible();
-	iWin.EndRedraw();
-	}
-
-void CInvisibleRedrawWin::DrawIfVisible()
-	{
-	if (iVisible)
-		{
-		iGc->Activate( iWin );
-		iGc->SetBrushStyle( CGraphicsContext::ESolidBrush );
-		if(iTransparent)
-			iGc->SetBrushColor( TRgb(0, 0, 255, 127) );
-		else
-			iGc->SetBrushColor( KRgbBlue );
-		iGc->Clear();
-		iGc->Deactivate();
-		}
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS-WSERV-0498
-
-@SYMDEF             	INC135845
-
-@SYMTestCaseDesc    	UseBrushPattern test
-
-@SYMTestPriority    	High
-
-@SYMTestStatus      	Implemented
-
-@SYMTestActions			Create a bitmap and use as brush. bitmap deleted immediately to
-                        prove that wserv retains the handle
-
-@SYMTestExpectedResults	No Panic BITGDI 13 
- */
-
-void CTRedrawStoring::DoBrushDrawTestL()
-	{
-	CBrushDrawWin* testWin=new(ELeave) CBrushDrawWin;
-	CleanupStack::PushL(testWin);
-	testWin->ConstructL(*TheClient->iGroup);
-	testWin->AssignGC(*TheClient->iGc);
-	testWin->SetExt(iWinPos+TPoint(25,25),TSize(300,200));
-	testWin->Win()->SetRequiredDisplayMode(iTestDisplayMode);
-	testWin->Win()->SetShadowDisabled(ETrue);
-	testWin->Activate();
-	testWin->SetVisible(ETrue);
-
-	testWin->DrawNow();
-	
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-
-	CleanupStack::PopAndDestroy(testWin);
-	}
-
-/*CBrushDrawWin*/
-CBrushDrawWin::CBrushDrawWin()
-	{}
-
-void CBrushDrawWin::Draw()
-	{
-	Redraw();
-	}
-
-void CBrushDrawWin::Redraw()
-	{
-	CFbsBitmap *bitmap=new(ELeave) CFbsBitmap();
-	User::LeaveIfError(bitmap->Load(TEST_BITMAP_NAME,0));
-	TSize bitSize(bitmap->SizeInPixels());
-	iGc->UseBrushPattern(bitmap);
-	iGc->SetBrushStyle(CGraphicsContext::EPatternedBrush);
-	iGc->DrawRect(TRect(TPoint(0, 0), bitSize));
-	iGc->DiscardBrushPattern();
-	delete bitmap;
-	}
-
-/*CTRedrawStoring*/
-CTRedrawStoring::CTRedrawStoring(CTestStep* aStep) : CTWsGraphicsBase(aStep)
-	{
-	}
-
-CTRedrawStoring::~CTRedrawStoring()
-	{
-	delete iCheckWin;
-	delete iCheckGc;
-	delete iCheckDevice;
-	delete iCheckBitmap;
-	delete iTestWin;
-	for(TInt bmp = 0; bmp < 3; ++bmp)
-		delete iAlphaBitmap[bmp];
-	iBlankWin.Close();
-	iRegion.Close();
-	iWinTestGc.Close();
-	delete iNoDrawWin;
-	delete iTestWinCopy;
-	delete iCheckWinCopy;
-	}
-
-void CTRedrawStoring::ConstructL()
-	{
-	iState = 0;
-	const TInt gap=5;
-	iTestDisplayMode = TheClient->iScreen->DisplayMode();
-	const TSize scrSize(TheClient->iScreen->SizeInPixels());
-	iWinSize=TheClient->iScreen->SizeInPixels();
-	iWinSize.iWidth=(scrSize.iWidth-gap)/3;
-	CTBackedUpWin* checkWin=new(ELeave) CTBackedUpWin(iTestDisplayMode);
-	checkWin->ConstructExtLD(*TheClient->iGroup,TPoint(scrSize.iWidth-iWinSize.iWidth,0),iWinSize);
-	iCheckWin=checkWin;
-	iCheckWin->Activate();
-	RBackedUpWindow& win=*iCheckWin->BackedUpWin();
-	win.MaintainBackup();
-	iCheckBitmap=new(ELeave) CFbsBitmap();
-	iCheckBitmap->Duplicate(win.BitmapHandle());
-	iCheckDevice=CFbsBitmapDevice::NewL(iCheckBitmap);
-	User::LeaveIfError(iCheckDevice->CreateContext(iCheckGc));
-	iCheckGc->SetUserDisplayMode(iTestDisplayMode);
-	CRedrawStoreWin* testWin=new(ELeave) CRedrawStoreWin(this);
-	iWinPos.SetXY(scrSize.iWidth-2*iWinSize.iWidth-gap,0);
-	testWin->ConstructExtLD(*TheClient->iGroup,iWinPos,iWinSize);
-	iTestWin=testWin;
-	iTestWin->AssignGC(*TheClient->iGc);
-	RWindowBase& baseWin=*iTestWin->BaseWin();
-	User::LeaveIfError(baseWin.SetRequiredDisplayMode(iTestDisplayMode));
-	baseWin.SetShadowHeight(0);
-	iTestWin->Activate();
-
-	CNoDrawWin* noDrawWin=new(ELeave) CNoDrawWin();
-	iWinPos.SetXY(scrSize.iWidth-2*iWinSize.iWidth-gap,0);
-	noDrawWin->ConstructExtLD(*TheClient->iGroup,iWinPos,iWinSize);
-	iNoDrawWin=noDrawWin;
-	iNoDrawWin->AssignGC(*TheClient->iGc);
-	RWindowBase& bWin=*iNoDrawWin->BaseWin();
-	User::LeaveIfError(bWin.SetRequiredDisplayMode(EColor256));
-	bWin.SetShadowHeight(0);
-	
-	iBlankWin=RBlankWindow(TheClient->iWs);
-	User::LeaveIfError(iBlankWin.Construct(*TheClient->iGroup->WinTreeNode(),ENullWsHandle));
-	iBlankWin.SetVisible(EFalse);
-	User::LeaveIfError(iBlankWin.SetRequiredDisplayMode(EColor256));
-	iBlankWin.SetColor(TRgb(48,240,32));
-	iBlankWin.Activate();
-	iWinTestGc=RWindow(TheClient->iWs);
-	User::LeaveIfError(iWinTestGc.Construct(*TheClient->iGroup->WinTreeNode(),ENullWsHandle));
-	iWinTestGc.SetVisible(EFalse);
-	User::LeaveIfError(iWinTestGc.SetRequiredDisplayMode(EColor256));
-
-	iDrawMode=EClientRedrawsNormal;
-	iDoScrollTest=EFalse;
-	iDrawOrder=0;
-	//PeterI Alpha is supported but opacity is not
-//	iAlphaSupported=OpacityAndAlphaSupportedL();
-	iAlphaSupported =TransparencySupportedL();
-	iXPlus = ETrue;
-	iYPlus = EFalse;
-	
-	// Used for fading test
-	iTestWinCopy = new (ELeave) CFbsBitmap();
-	iTestWinCopy->Create(iTestWin->Size(),TheClient->iScreen->DisplayMode());
-	iCheckWinCopy = new (ELeave) CFbsBitmap();
-	iCheckWinCopy->Create(iCheckWin->Size(),TheClient->iScreen->DisplayMode());
-	}
-
-void CTRedrawStoring::CheckWindowsMatch()
-	{
-	TheClient->Flush();
-	if (iDrawMode==EClientRedrawsNormal || iDrawMode==EClientRedrawsScrolled)
-		TheClient->WaitForRedrawsToFinish();
-	TheClient->iWs.Finish();
-	if(!iWindowsFaded)
-		{
-		_LIT(KLog,"RedrawStoring SubTest %d");
-		TBuf<32> buf;
-		buf.AppendFormat(KLog,iTest->iState);
-		CheckRect(iTestWin,iCheckWin,TRect(iWinSize),buf);
-		}
-	else
-		{
-		TInt res = LossyCompareWindow(*TheClient->iScreen, *iTestWinCopy, *iCheckWinCopy, TRect(iCheckWin->Position(), iCheckWin->Size()));
-		TEST(res);
-		}
-	}
-
-void CTRedrawStoring::CheckWindowsNotMatch()
-	{
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	TheClient->iWs.Finish();
-	CheckRectNoMatch(iTestWin,iCheckWin,TRect(iWinSize),_L("CTRedrawStoring::CheckWindowsNotMatch()"));
-	}
-
-void CTRedrawStoring::HideRevealTest()
-	{
-	iBlankWin.SetVisible(ETrue);
-	iBlankWin.SetVisible(EFalse);
-	CheckWindowsMatch();
-	}
-
-void CTRedrawStoring::MultipleHideReveal(TInt aX,TInt aY)
-	{
-	TInt xInc=(iWinSize.iWidth+aX-1)/aX;
-	TInt yInc=(iWinSize.iHeight+aY-1)/aY;
-	TInt xEnd=iWinPos.iX+iWinSize.iWidth;
-	TInt yEnd=iWinPos.iY+iWinSize.iHeight;
-	TInt xx,yy;
-	for(xx=iWinPos.iX;xx<xEnd;xx+=xInc)
-		{
-		for(yy=iWinPos.iY;yy<yEnd;yy+=yInc)
-			{
-			iBlankWin.SetExtent(TPoint(xx,yy),TSize(xInc,yInc));
-			HideRevealTest();
-			}
-		}
-	}
-
-void CTRedrawStoring::RedrawWindows()
-	{
-	iDrawMode=EClientRedrawsNormal;
-	iTestWin->Invalidate();
-	CheckWindowsMatch();
-	iDrawMode=EServerRedraw;
-	}
-
-void CTRedrawStoring::DoDrawingL(CWindowGc* aWinGc)
-	{
-	iClientDidDraw = ETrue;
-	switch (iDrawMode)
-		{
-	case EServerRedraw:
-		TEST(EFalse);
-		break;
-	case EClientRedrawsNormal:
-		if (iState>0)
-			{
-			DoDrawingL(0,aWinGc,ETrue);
-			DoDrawingL(0,iCheckGc,EFalse);
-			aWinGc->Deactivate();
-			aWinGc->Activate(*iTestWin->DrawableWin());
-			}
-		DoDrawingL(iState,aWinGc,ETrue);
-		DoDrawingL(iState,iCheckGc,EFalse);
-		iCheckWin->BackedUpWin()->UpdateScreen();
-		break;
-	case EClientRedrawsScrolled:
-		{
-		DoDrawingL(0,aWinGc,ETrue);
-		TRegionFix<8> region;
-		region.AddRect(TRect(iWinSize));
-		region.SubRect(iScrollTarget);
-		aWinGc->SetClippingRegion(region);
-		DoDrawingL(iState,aWinGc,ETrue);
-		aWinGc->CancelClippingRegion();
-		aWinGc->SetClippingRect(iScrollTarget);
-		aWinGc->SetOrigin(iScrollTarget.iTl-iScrollSource);
-		DoDrawingL(iState,aWinGc,ETrue);
-		aWinGc->CancelClippingRect();
-		break;
-		}
-		}
-	TheClient->Flush();
-	}
-
-#define KLastDrawingCase 24		//This should always be the same as the value of last case number in the switch statement of the next function
-void CTRedrawStoring::DoDrawingL(TInt aDraw,CBitmapContext* aGc,TBool aWinGc)
-	{	
-	switch (aDraw)
-		{
-	case 0:
-	case 1:
-		aGc->SetBrushColor(TRgb(255,(aDraw==0?255:0),255));
-		aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-		aGc->SetPenStyle(CGraphicsContext::ENullPen);
-		aGc->DrawRect(iWinSize);
-		iDoScrollTest=EFalse;
-		break;
-	case 2:
-		aGc->SetPenStyle(CGraphicsContext::ESolidPen);
-		aGc->SetPenSize(TSize(1,1));
-		aGc->SetPenColor(TRgb(0,0,0));
-		aGc->DrawLine(TPoint(0,10),TPoint(iWinSize.iWidth,10));
-		aGc->SetPenColor(TRgb(128,0,0));
-		aGc->DrawLine(TPoint(0,iWinSize.iHeight-10),TPoint(iWinSize.iWidth,iWinSize.iHeight-10));
-		aGc->SetPenColor(TRgb(0,128,0));
-		aGc->DrawLine(TPoint(10,0),TPoint(10,iWinSize.iHeight));
-		aGc->SetPenColor(TRgb(0,0,128));
-		aGc->DrawLine(TPoint(iWinSize.iWidth-10,0),TPoint(iWinSize.iWidth-10,iWinSize.iHeight));
-		iDoScrollTest=EFalse;
-		break;
-	case 3:
-		//Do various drawing using: MoveTo, MoveBy, Plot, DrawLineTo, DrawLineBy
-		aGc->SetPenStyle(CGraphicsContext::ESolidPen);
-		aGc->SetPenColor(TRgb(0,0,0));
-		aGc->MoveTo(TPoint(iWinSize.iWidth, iWinSize.iHeight));
-		aGc->DrawLineTo(TPoint(0, 0));
-		aGc->MoveBy(TPoint(iWinSize.iWidth, 0));
-		aGc->DrawLineTo(TPoint(0, iWinSize.iHeight));
-		aGc->MoveTo(TPoint(0, iWinSize.iHeight/2));
-		aGc->DrawLineBy(TPoint(iWinSize.iWidth, 0));
-		aGc->SetPenSize(TSize(5,5));
-		aGc->Plot(TPoint(iWinSize.iWidth/2, 20));
-		aGc->Plot(TPoint(iWinSize.iWidth/2, iWinSize.iHeight/2));
-		aGc->Plot(TPoint(iWinSize.iWidth/2, iWinSize.iHeight-20));
-		aGc->SetPenSize(TSize(1,1));
-		iDoScrollTest=EFalse;
-		break;
-	case 4:
-		//Do various drawing with lines of different widths
-		{
-		TInt inc=iWinSize.iHeight/8;
-		TInt penSize=2;
-		TInt yy;
-		aGc->SetPenStyle(CGraphicsContext::ESolidPen);
-		aGc->SetPenColor(TRgb(0,0,0));
-		for (yy=0;yy<iWinSize.iHeight;yy+=inc)
-			{
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-			if (yy%3==0)
-				aGc->SetPenSize(TSize(penSize,penSize));
-			else if (yy%3==1)
-				aGc->SetPenSize(TSize(penSize,7*penSize/5));
-			else
-				aGc->SetPenSize(TSize(7*penSize/5,penSize));
-#else
-			aGc->SetPenSize(TSize(penSize,penSize));
-#endif
-			aGc->DrawLine(TPoint(2,yy),TPoint(iWinSize.iWidth-3,yy));
-			penSize+=2;
-			}
-		aGc->SetPenSize(TSize(1,1));
-		}
-		iDoScrollTest=ETrue;
-		break;
-	case 5:
-		//Some drawing using fading on the gc
-		aGc->SetPenStyle(CGraphicsContext::ESolidPen);
-		aGc->SetPenColor(TRgb(0,0,255));
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-		aGc->SetFaded(ETrue);
-#endif
-		aGc->SetPenSize(TSize(10,10));
-		aGc->DrawLine(TPoint(0,iWinSize.iHeight/2-5),TPoint(iWinSize.iWidth,iWinSize.iHeight/2-5));
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-		aGc->SetFaded(EFalse);
-#endif
-		aGc->DrawLine(TPoint(0,iWinSize.iHeight/2+5),TPoint(iWinSize.iWidth, iWinSize.iHeight/2+5));
-		aGc->SetPenStyle(CGraphicsContext::ESolidPen);
-		aGc->SetPenColor(TRgb(0,0,255));
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-		aGc->SetFaded(ETrue);
-		aGc->SetFadingParameters(0,127);		
-#endif
-		aGc->SetPenSize(TSize(10,10));
-		aGc->DrawLine(TPoint(iWinSize.iWidth/2-5,0),TPoint(iWinSize.iWidth/2-5,iWinSize.iHeight));
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-		aGc->SetFaded(EFalse);
-		// default params
-		aGc->SetFadingParameters(128,255);
-#endif
-		aGc->DrawLine(TPoint(iWinSize.iWidth/2+5,0),TPoint(iWinSize.iWidth/2+5,iWinSize.iHeight));
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-		aGc->SetFaded(EFalse);
-#endif
-		iDoScrollTest=ETrue;
-		break;
-	case 6:
-		// Fading on window
-		aGc->SetPenStyle(CGraphicsContext::ESolidPen);
-		aGc->SetPenColor(TRgb(0,255,0));
-		aGc->SetPenSize(TSize(10,10));
-		aGc->DrawLine(TPoint(0,iWinSize.iHeight/2),TPoint(iWinSize.iWidth,iWinSize.iHeight/2));
-		aGc->DrawLine(TPoint(iWinSize.iWidth/2,0),TPoint(iWinSize.iWidth/2,iWinSize.iHeight));
-		iDoScrollTest=EFalse;
-		break;
-	case 7:
-		//Some drawing with text - create and destroy the font as soon as used
-		{
-		CFbsFont *font;
-		TFontSpec fspec(_L("Swiss"),190);
-		User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInTwips((CFont *&)font,fspec));
-		aGc->SetPenColor(TRgb(0,0,0));
-		aGc->UseFont(font);
-		aGc->DrawText(_L("Hello"), TPoint(20,20));
-		aGc->DiscardFont();
-		TheClient->iScreen->ReleaseFont(font);
-
-		CFbsFont *font2;
-		TInt fontSize = 100;
-		TInt inc = 10;
-		for (TInt i=0; i<20; i++)
-			{
-			TFontSpec fspec2(_L("Ariel"), fontSize);
-			User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInTwips((CFont *&)font2,fspec2));
-			aGc->SetPenColor(TRgb(0,0,0));
-			aGc->UseFont(font2);
-			aGc->DrawText(_L("Hello"), TPoint(20,100));
-			aGc->DiscardFont();
-			TheClient->iScreen->ReleaseFont(font2);
-			fontSize+=inc;
-			}
-		iDoScrollTest=ETrue;
-		}
-		break;
-	case 8:
-		//Some drawing with bitmaps - create and destroy the bitmap as soon as used
-		{
-		CFbsBitmap* testBitmap;	
-		testBitmap=new(ELeave) CFbsBitmap();
-		User::LeaveIfError(testBitmap->Load(TEST_BITMAP_NAME,0));
-		aGc->DrawBitmap(TRect(TPoint(10,10), TPoint(150,150)), testBitmap);
-		delete testBitmap;
-		iDoScrollTest=ETrue;
-		}
-		break;
-	case 9:
-		//Some drawing with clipping regions and rects
-		
-		//clipping rect
-	
-		aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-		aGc->SetPenStyle(CGraphicsContext::ENullPen);
-		aGc->SetClippingRect(TRect(TPoint(50,0), TSize(iWinSize.iWidth/2,100)));
-		aGc->SetBrushColor(TRgb(255,255,0));
-		aGc->DrawRect(TRect(TPoint(0,0), TPoint(100,100)));
-		aGc->SetBrushColor(TRgb(0,128,128));
-		aGc->DrawRect(TRect(TPoint(iWinSize.iWidth/2,0), TSize(iWinSize.iWidth/2,100)));
-		aGc->CancelClippingRect();
-
-		
-		//regions
-		
-		iRegion.AddRect(TRect(TPoint(0,30), TSize(3*iWinSize.iWidth/4,150)));
-		iRegion.AddRect(TRect(TPoint(iWinSize.iWidth/2-20, 0), TSize(70,70)));
-
-		aGc->SetClippingRegion(iRegion);
-
-		aGc->SetBrushColor(TRgb(0,200,0));
-		aGc->DrawRect(TRect(TPoint(5,5), TPoint(iWinSize.iWidth-50,200)));
-		aGc->SetBrushColor(TRgb(200,0,0));
-	 	aGc->DrawRect(TRect(TPoint(50,50), TPoint(iWinSize.iWidth/2,150)));
-		aGc->SetBrushColor(TRgb(0,0,200));
-		aGc->DrawRect(TRect(TPoint(20,10), TPoint(100,100)));
-
-		aGc->CancelClippingRegion();
-
-		iDoScrollTest=EFalse;
-		break;
-	case 10:
-		//Some drawing with deactivating and reactivating the gc on the window (if it is indeed it is window gc)
-
-		aGc->SetBrushColor(TRgb(0,0,255));
-		aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-		aGc->SetPenStyle(CGraphicsContext::ENullPen);
-		aGc->DrawRect(TRect(TPoint(20,20), TSize(50,50)));
-
-		if (aWinGc)
-			{
-			static_cast<CWindowGc*>(aGc)->Deactivate();
-
-			// Associate gc with another window and change attributes
-			static_cast<CWindowGc*>(aGc)->Activate(iWinTestGc);	
-			aGc->SetPenStyle(CGraphicsContext::ESolidPen);
-			aGc->SetPenColor(TRgb(0,0,255));
-			static_cast<CWindowGc*>(aGc)->Deactivate();
-			static_cast<CWindowGc*>(aGc)->Activate(*iTestWin->DrawableWin());
-			}
-
-		aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-		aGc->SetPenStyle(CGraphicsContext::ENullPen);
-		aGc->SetBrushColor(TRgb(200,0,0));
-		aGc->DrawRect(TRect(TPoint(70,70), TSize(50,50)));
-		iDoScrollTest=EFalse;
-		break;
-	case 11:
-		// Some drawing with polygons
-		{
-		aGc->SetBrushColor(TRgb(0,221,0));	
-		aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-		aGc->SetPenStyle(CGraphicsContext::ENullPen);
-
-		TPoint point1(iWinSize.iWidth/3,iWinSize.iHeight/4*3);
-		TPoint point2(iWinSize.iWidth/2,iWinSize.iHeight/5*4);
-		TPoint point3(iWinSize.iWidth/3,iWinSize.iHeight-20);
-		TPoint point4(iWinSize.iWidth/4,iWinSize.iHeight-20);
-		TPoint point5(iWinSize.iWidth/6,iWinSize.iHeight-60);
-
-		CArrayFix<TPoint>* points;
-		points = new CArrayFixFlat<TPoint>(5);
-		points->AppendL(point1);
-		points->AppendL(point2);
-		points->AppendL(point3);
-		points->AppendL(point4);
-		points->AppendL(point5);
-		aGc->DrawPolygon(points);
-		delete points;
-
-		TPoint points2[5];
-		points2[0].SetXY(iWinSize.iWidth/2,50);
-		points2[1].SetXY(iWinSize.iWidth-50,iWinSize.iHeight/2);
-		points2[2].SetXY(iWinSize.iWidth-70,iWinSize.iHeight/2+30);
-		points2[3].SetXY(iWinSize.iWidth/3,iWinSize.iHeight/3);
-		points2[4].SetXY(iWinSize.iWidth/4,iWinSize.iHeight/4);
-		aGc->SetBrushColor(TRgb(221,0,0));
-		aGc->DrawPolygon(points2,5);
-		iDoScrollTest=ETrue;
-		}
-		break;
-	case 12:
-		{
-		// Another Fading on Window Test
-		aGc->SetPenStyle(CGraphicsContext::ENullPen);
-		aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-		aGc->SetBrushColor(TRgb(51,204,204));
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-		if (!iWindowsFaded || aWinGc)
-			{
-			aGc->SetFaded(ETrue);
-			}
-#endif
-		aGc->DrawRect(TRect(iWinSize.iWidth/4-1,iWinSize.iHeight/4-1,3*iWinSize.iWidth/4+1,3*iWinSize.iHeight/4+1));
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-		aGc->SetFaded(EFalse);
-#endif
-		aGc->SetBrushStyle(CGraphicsContext::ENullBrush);
-		aGc->SetPenStyle(CGraphicsContext::ESolidPen);
-		aGc->SetPenColor(TRgb(34,204,34));
-		aGc->SetPenSize(TSize(8,8));
-		aGc->DrawLine(TPoint(2,iWinSize.iHeight/2+5),TPoint(iWinSize.iWidth-2,iWinSize.iHeight/2-5));
-		aGc->DrawLine(TPoint(iWinSize.iWidth/2+5,2),TPoint(iWinSize.iWidth/2-5,iWinSize.iHeight-2));
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-		if (!iWindowsFaded || aWinGc)
-			{
-			aGc->SetFaded(ETrue);
-			}
-#endif
-		aGc->SetPenColor(TRgb(51,221,51));
-		aGc->SetPenSize(TSize(3,3));
-		aGc->SetBrushColor(TRgb(238,34,238));
-		aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-		aGc->DrawRect(TRect(3*iWinSize.iWidth/8-1,3*iWinSize.iHeight/8-1,5*iWinSize.iWidth/8+1,5*iWinSize.iHeight/8+1));
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-		aGc->SetFaded(EFalse);
-#endif
-		aGc->SetBrushStyle(CGraphicsContext::ENullBrush);
-		aGc->SetPenColor(TRgb(238,34,238));
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-		aGc->SetPenSize(TSize(8,9));
-#else
-		aGc->SetPenSize(TSize(8,8));
-#endif
-		aGc->DrawRect(TRect(iWinSize.iWidth/8-1,iWinSize.iHeight/8-1,7*iWinSize.iWidth/8+1,7*iWinSize.iHeight/8+1));
-		iDoScrollTest=ETrue;
-		}
-		break;	
-	case 15:
-		//Some masked drawing with FBS bitmaps - create and destroy the bitmaps as soon as used
-		{
-		CFbsBitmap* testBitmap;	
-		CFbsBitmap* maskBitmap;
-		testBitmap=new(ELeave) CFbsBitmap();
-		CleanupStack::PushL(testBitmap);
-		maskBitmap=new(ELeave) CFbsBitmap();
-		CleanupStack::PushL(maskBitmap);
-		User::LeaveIfError(testBitmap->Load(TEST_BITMAP_NAME,2));
-		User::LeaveIfError(maskBitmap->Load(TEST_BITMAP_NAME,4));
-		aGc->BitBltMasked(TPoint(10,10), testBitmap, TRect(TPoint(0, 0), testBitmap->SizeInPixels()), maskBitmap, EFalse);
-		CleanupStack::PopAndDestroy(2, testBitmap);
-		iDoScrollTest=ETrue;
-		}
-		break;
-	case 16:
-		//As above, except using Ws bitmaps
-		{
-		CWsBitmap* testBitmap;	
-		CWsBitmap* maskBitmap;
-		testBitmap=new(ELeave) CWsBitmap(TheClient->iWs);
-		CleanupStack::PushL(testBitmap);
-		maskBitmap=new(ELeave) CWsBitmap(TheClient->iWs);
-		CleanupStack::PushL(maskBitmap);
-		User::LeaveIfError(testBitmap->Load(TEST_BITMAP_NAME,3));
-		User::LeaveIfError(maskBitmap->Load(TEST_BITMAP_NAME,4));
-		// If we don't cast to the window gc we don't see the WS version of the BitBltMasked function:
-		if(aWinGc)
-			((CWindowGc*)aGc)->BitBltMasked(TPoint(20,20), testBitmap, TRect(TPoint(0, 0), testBitmap->SizeInPixels()), maskBitmap, EFalse);
-		else
-			aGc->BitBltMasked(TPoint(20,20), testBitmap, TRect(TPoint(0, 0), testBitmap->SizeInPixels()), maskBitmap, EFalse);
-		CleanupStack::PopAndDestroy(2, testBitmap);
-		iDoScrollTest=ETrue;
-		}
-		break;
-	case 19:
-		//Some drawing with WS bitmaps
-		{
-		if(!iAlphaBitmap[0])
-			{
-			for(TInt bmp = 0; bmp < 3; ++bmp)
-				{
-				iAlphaBitmap[bmp] = new(ELeave) CWsBitmap(TheClient->iWs);
-				User::LeaveIfError(iAlphaBitmap[bmp]->Load(TEST_BITMAP_NAME,2 + bmp));
-				}
-			}
-		if(aWinGc)
-			((CWindowGc*)aGc)->BitBlt(TPoint(20,20), iAlphaBitmap[0]);
-		else
-			aGc->BitBlt(TPoint(20,20), iAlphaBitmap[0]);
-		iDoScrollTest=ETrue;
-		}
-		break;
-	case 20:
-		//Some drawing with alpha blended bitmaps
-		if (iAlphaSupported)
-			{
-			aGc->SetFaded(EFalse);
-			TPoint start(0,0);
-			TSize size = iAlphaBitmap[0]->SizeInPixels();
-			TPoint alphastart((start.iX + size.iWidth / 4), (start.iY + size.iHeight / 4));
-		
-			aGc->BitBlt(start, iAlphaBitmap[0], TRect(start, size));
-			aGc->AlphaBlendBitmaps(start, iAlphaBitmap[1], TRect(start, size), iAlphaBitmap[2], alphastart);
-			iDoScrollTest=ETrue;
-			}
-		break;
-	case 21:
-		// As in previous case, except using FBS bitmaps.
-		if (iAlphaSupported)
-			{
-			aGc->SetFaded(EFalse);
-			CFbsBitmap* baseBitmap;
-			CFbsBitmap* testBitmap;
-			CFbsBitmap* alphaBitmap;
-			baseBitmap=new(ELeave) CFbsBitmap();
-			CleanupStack::PushL(baseBitmap);
-			testBitmap=new(ELeave) CFbsBitmap();
-			CleanupStack::PushL(testBitmap);
-			alphaBitmap=new(ELeave) CFbsBitmap();
-			CleanupStack::PushL(alphaBitmap);
-			User::LeaveIfError(baseBitmap->Load(TEST_BITMAP_NAME,2));
-			User::LeaveIfError(testBitmap->Load(TEST_BITMAP_NAME,3));
-			User::LeaveIfError(alphaBitmap->Load(TEST_BITMAP_NAME,4));
-			TPoint start(0,0);
-			TSize size = baseBitmap->SizeInPixels();
-			TPoint alphastart((start.iX + size.iWidth / 4), (start.iY + size.iHeight / 4));
-		
-			aGc->BitBlt(start, baseBitmap, TRect(start, size));
-			aGc->AlphaBlendBitmaps(start, testBitmap, TRect(start, size), alphaBitmap, alphastart);
-			
-			CleanupStack::PopAndDestroy(3, baseBitmap);
-			iDoScrollTest=ETrue;
-			}
-		break;
-	case 22:
-		// Some default drawing for Begin EndRedraw test
-		aGc->SetPenStyle(CGraphicsContext::ESolidPen);
-		aGc->SetPenSize(TSize(2,2));
-		aGc->SetPenColor(TRgb(128,0,0));
-		aGc->DrawLine(TPoint(10,10),TPoint(20,10));
-		aGc->DrawLine(TPoint(20,10),TPoint(20,20));
-		aGc->DrawLine(TPoint(20,20),TPoint(10,20));
-		aGc->DrawLine(TPoint(10,20),TPoint(10,10));
-		
-		aGc->SetPenSize(TSize(4,4));
-		aGc->SetPenColor(TRgb(0,0,128));
-		aGc->DrawLine(TPoint(50,50),TPoint(150,50));
-		aGc->DrawLine(TPoint(150,50),TPoint(150,150));
-		aGc->DrawLine(TPoint(150,150),TPoint(50,150));
-		aGc->DrawLine(TPoint(50,150),TPoint(50,50));
-		iDoScrollTest=EFalse;
-		break;
-	case 23:
-		aGc->SetBrushColor(TRgb(244,196,48));
-		aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-		aGc->SetPenStyle(CGraphicsContext::ENullPen);
-		aGc->DrawRect(TRect(0,0,iWinSize.iWidth,iWinSize.iHeight/3));
-		aGc->SetBrushColor(TRgb(255,255,255));
-		aGc->DrawRect(TRect(0,iWinSize.iHeight/3,iWinSize.iWidth,iWinSize.iHeight*2/3));
-		aGc->SetBrushColor(TRgb(3,192,60));
-		aGc->DrawRect(TRect(0,iWinSize.iHeight*2/3,iWinSize.iWidth,iWinSize.iHeight));
-		iDoScrollTest=EFalse;
-		break;
-	case 24:
-		iClientDidDraw=ETrue;
-		//Draw some rects to screen
-		aGc->Reset();
-		aGc->Clear();
-		aGc->SetPenStyle(CGraphicsContext::ESolidPen);
-		aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-		aGc->SetBrushColor(TRgb(98,72,172));	
-		aGc->DrawRect(TRect(20,iYPoz,250,280+iYPoz));
-		aGc->SetBrushColor(TRgb(255,0,0));	
-		aGc->DrawRect(TRect(0,iYPoz,200,200+iYPoz));
-		aGc->SetBrushColor(TRgb(0,255,255));	
-		aGc->DrawRect(TRect(10,15+iYPoz,250,115+iYPoz));
-		aGc->SetBrushColor(TRgb(0,255,0));	
-		aGc->DrawRect(TRect(0,50+iYPoz,100,250+iYPoz));
-		aGc->SetBrushColor(TRgb(255,255,0));	
-		aGc->DrawRect(TRect(50,50+iYPoz,150,150+iYPoz));
-		aGc->SetBrushColor(TRgb(5,25,20));	
-		aGc->DrawRect(TRect(120,170+iYPoz,220,250+iYPoz));	
-		break;			
- 		}
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0085
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Do Draw Test
-					REQUIREMENT:	REQ2123
-					GT0164/Delta/ 1450, 1460, 1470, 1490, 1500, 1510, 1520, 1530
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Lots of different type of drawing is done to the test window.
-					(Including: normal drawing, fonts, bitmaps, fading on the GC,
-					clipping regions and rects).
-					A blank window is made visible then invisible above the test window
-					The blank window's size and position is also changed many times.
-
-@SYMTestExpectedResults  After the initial drawing of the test window, all the draw commands
-						should be stored by the window server.  When the blank window is made
-						visible/invisible above the test window a redraw message will be sent
-						to the test window. The window will be redrawn using the draw commands
-						stored in the server. Once all the redrawing is complete, the test window
-						will be compared with a bitmap that has had the same draw commands applied
-						to it.
-						The test will fail if the bitmaps don't match or if the test window was
-						redrawn not using the stored server side draw commands.
- */
-
-void CTRedrawStoring::DoDrawTest()
-	{
-	RedrawWindows();
-	HideRevealTest();
-	iTestWin->SetVisible(EFalse);
-	iTestWin->SetVisible(ETrue);
-	CheckWindowsMatch();
-	MultipleHideReveal(2,3);
-	MultipleHideReveal(5,4);
-	iBlankWin.SetExtent(iWinPos,iWinSize);
-	HideRevealTest();
-	CheckWindowsMatch();
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0086
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Fade Window Test
-					REQUIREMENT:	REQ2123
-					GT0164/Delta/ 1480
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     The test window is faded and the GC associated with the bitmap used
-					to check the test window is faded. The Draw Test in TestCase 1 is then
-					applied.
-
-@SYMTestExpectedResults  The test window and the check bitmap should both be faded and contain
-					the same drawing. The test will fail if the bitmaps don't match or if the
-					test window was redrawn not using the stored server side draw commands.
-
- */
-void CTRedrawStoring::FadeWindowTest()
-	{
-	iWindowsFaded = ETrue;
-	iTestWin->Win()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
-	iCheckGc->SetFaded(ETrue);
-	DoDrawTest();
-	iDrawMode=EClientRedrawsNormal;
-	iTestWin->Win()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
-	iCheckGc->SetFaded(EFalse);
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	iWindowsFaded = EFalse;
-	}
-	
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0087
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Fade Window Test 2
-					REQUIREMENT:	REQ2123
-					GT0164/Delta/ 1480
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     The test window is faded and the check window that uses the check bitmap
-					is faded. A blank window is made visbible/invisible above the test window.
-					Fading is switched off on both windows, they are redrawn and then compared.
-
-@SYMTestExpectedResults  The test window and the check bitmap should both be faded. After showing 
-					the blank window the test window will contain a couple of rectangles faded due to 
-					Gc fade apart from the overall window fade (will look similar to double fading), whereas
-					check window will have simply the overall window fade. Once both windows have been
-					redrawn with the fading switched off, they should not look the same for the same
-					reason explained above.
-
- */
-void CTRedrawStoring::FadeWindowTest2L()
-	{
-	DoDrawTest();
-	iWindowsFaded=ETrue;
-	iTestWin->BaseWin()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
-	iCheckWin->BaseWin()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);	
-	CheckWindowsMatch();
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-	//perform RedrawWindows() with CheckWindowsNotMatch()
-	iDrawMode=EClientRedrawsNormal;
-	iTestWin->Invalidate();
-	CheckWindowsNotMatch();	
-	iDrawMode=EServerRedraw;
-	
-	//perform HideRevealTest() with CheckWindowsNotMatch()
-	iBlankWin.SetVisible(ETrue);
-	iBlankWin.SetVisible(EFalse);
-	CheckWindowsNotMatch();	
-#endif
-
-	iWindowsFaded=EFalse;
-	iTestWin->BaseWin()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
-	iCheckWin->BaseWin()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
-	iDrawMode=EClientRedrawsNormal;
-	DoDrawingL(0,iCheckGc,EFalse);
-	DoDrawingL(iState,iCheckGc,EFalse);
-	iCheckWin->BackedUpWin()->UpdateScreen();
-	iDrawMode=EServerRedraw;
-	CheckWindowsMatch();
-	HideRevealTest();
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0088
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Scroll Test
-					REQUIREMENT:	REQ2123
-					GT0164/Delta/ 1540
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Different areas of the test window are scrolled, the check bitmap
-					window is also adjusted to reflect this scrolling. The blank window is
-					then made visible/invisible above the test window
-
-@SYMTestExpectedResults  The test will fail if the bitmaps don't match or if the test window was
-					redrawn not using the stored server side draw commands.
-
- */
-void CTRedrawStoring::ScrollTest()
-	{
-	CheckWindowsMatch();
-	TInt x=iWinSize.iWidth/3;
-	TInt w=iWinSize.iWidth/4;
-	SetScrolling(TPoint(10,20),TRect(x,100,x+w,160));
-	DoScrollTest();
-	x=iWinSize.iWidth/2;
-	w=iWinSize.iWidth/3;
-	SetScrolling(TPoint(48,100),TRect(x,10,x+w,80));
-	DoScrollTest();
-	x=iWinSize.iWidth/10;
-	w=iWinSize.iWidth/5;
-	SetScrolling(TPoint(iWinSize.iWidth/2,20),TRect(x,100,x+w,150)); 
-	DoScrollTest();
-	}
-
-void CTRedrawStoring::DoScrollTest()
-	{
-	TheClient->Flush();
-	iDrawMode=EClientRedrawsScrolled;
-	CheckWindowsMatch();
-	iDrawMode=EServerRedraw;		
- 	HideRevealTest();
-	RedrawWindows();
-	CheckWindowsMatch();
-	}
-
-void CTRedrawStoring::SetScrolling(TPoint aScrollSource, TRect aScrollTarget)
-	{
-	iScrollSource=aScrollSource;
-	iScrollTarget=aScrollTarget;
-	iTestWin->DrawableWin()->Scroll(iScrollTarget.iTl-iScrollSource,TRect(iScrollSource,iScrollTarget.Size()));	
-	iCheckWin->DrawableWin()->Scroll(iScrollTarget.iTl-iScrollSource,TRect(iScrollSource,iScrollTarget.Size()));	
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0090
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Do Nothing in Redraw Test
-					REQUIREMENT:	REQ2123
-					GT0164/Delta/ 1570
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     A window is created that contains no drawing code. A blank window is
-					made visible/invisible above this window.
-
-@SYMTestExpectedResults  No buffer will be created server side because there are no draw commands
-					to store. The server should be able to cope with an empty buffer when the
-					redraw is issued, caused by the blank win.
-
- */
-void CTRedrawStoring::DoNothingInRedrawTest()
-	{
-	// iNoDrawWin contains no drawing code, therefore no server side 
-	// redraw store buffer will be created in a redraw.
-	// When a redraw occurs because the blank win is made visible/invisible,
-	// the server will try and access the non existant buffer, all being well
-	// nothing should happen because the server can cope with an empty redraw 
-	// buffer.
-
-	iTestWin->SetVisible(EFalse);
-	iNoDrawWin->Activate();
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	iDrawMode=EServerRedraw;
-	iBlankWin.SetOrdinalPosition(0);
-	iBlankWin.SetVisible(ETrue);
-	iBlankWin.SetVisible(EFalse);
-	TheClient->Flush();
-
-	//return to normal testing state
-	iNoDrawWin->SetVisible(EFalse);
-	iTestWin->SetVisible(ETrue);
-	RedrawWindows();
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0091
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Disable Redraw Store Test
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     A windows redraw store is disabled and enabled, and the window is exposed.
-
-@SYMTestExpectedResults  When the redraw store is disabled, a client redraw should occur when the window
-					is exposed. When it is enabled, no client redraw should occur. However, the
-					first time it is exposed after enabling the store it will need a client redraw
-					in order to fill the store.
-
- */
-void CTRedrawStoring::DoDisableRedrawStoreTest()
-	{
-	_LIT(KLog1,"Redraw storing not enabled when expected to be");
-	_LIT(KLog2,"No client redraw was done when it was expected");
-	RedrawWindows();
-	CheckWindowsMatch();
-	
-	iDrawMode=EServerRedraw;
-	HideRevealTest();
-	
-	iClientDidDraw=EFalse;
-	TBool isEnabled=iTestWin->Win()->IsRedrawStoreEnabled();
-	TEST(isEnabled);
-	if (!isEnabled)
-		LOG_MESSAGE(KLog1);
-
-	/*iTestWin->Win()->EnableRedrawStore(EFalse);
-	isEnabled=iTestWin->Win()->IsRedrawStoreEnabled();
-	TEST(!isEnabled);
-	if (isEnabled)
-		{
-		_LIT(KLog,"Redraw storing enabled when expected not to be");
-		LOG_MESSAGE(KLog);
-		}
-
-	iDrawMode=EClientRedrawsNormal;
-	HideRevealTest();
-	TEST(iClientDidDraw);
-	if (!iClientDidDraw)
-		{
-		LOG_MESSAGE(KLog2);
-		TheClient->WaitForRedrawsToFinish();
-		if (iClientDidDraw)
-			{
-			_LIT(KLog,"After Waiting Redraws had taken place");
-			LOG_MESSAGE(KLog);
-			}
-		}*/
-	
-	iTestWin->Win()->EnableRedrawStore(ETrue);
-	isEnabled=iTestWin->Win()->IsRedrawStoreEnabled();
-	TEST(isEnabled);
-	if (!isEnabled)
-		LOG_MESSAGE(KLog1);
-
-	HideRevealTest();
-	iDrawMode=EServerRedraw;
-	HideRevealTest();
-
-	iClientDidDraw=EFalse;
-	TheClient->iWs.ClearAllRedrawStores();
-	iDrawMode=EClientRedrawsNormal;
-	HideRevealTest();
-	TEST(iClientDidDraw);
-	if (!iClientDidDraw)
-		{
-		LOG_MESSAGE(KLog2);
-		TheClient->WaitForRedrawsToFinish();
-		if (iClientDidDraw)
-			{
-			_LIT(KLog,"After Waiting Redraws had taken place");
-			LOG_MESSAGE(KLog);
-			}
-		}
-
-	HideRevealTest();
-	iDrawMode=EServerRedraw;
-	HideRevealTest();
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0092
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Resize Redraws
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     A window is resized.
-
-@SYMTestExpectedResults  When the window decreases in size, the server should be able to
-					redraw it from the store. When it increases in size, a client redraw
-					should occur.
-
- */
-void CTRedrawStoring::DoResizeTest()
-	{
-	RedrawWindows();
-	
-	TSize oldsize = iTestWin->Win()->Size();
-
-	iDrawMode=EServerRedraw;
-	iTestWin->Win()->SetSize(TSize(8, 8));
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	
-	iClientDidDraw=EFalse;	
-	iDrawMode=EClientRedrawsNormal;
-	iTestWin->Win()->SetSize(oldsize);
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	TEST(iClientDidDraw);
-	if (!iClientDidDraw)
-		INFO_PRINTF3(_L("iClientDidDraw - Expected: %d, Actual: %d"), ETrue, iClientDidDraw);
-
-	}
-
-/* TESTCASE:	9
- * TITLE:		Font Cache Overflow
- * IMPORTANCE:	1
- * REQUIREMENT:	DEF065463
- * 
- *
- * API:	
- * #
- *
- * ACTION:
- * The Font Cache is overflowed
- *
- * RESULT:
- * If the font cache overflows or under out of memory conditions,
- * there should be no leaves, panics or incorrect behaviour of the
- * local array of font handles.
- */
- 
- void CTRedrawStoring::DoFontCacheOverflowTestL()
- 	{
-	RWindow window(TheClient->iWs);
- 	User::LeaveIfError(window.Construct(*TheClient->iGroup->WinTreeNode(), ENullWsHandle));
-  	CleanupClosePushL(window);
-  	window.Activate();
-  	// Display mode is set after window.Activate() purposely to check that drawing 
-  	// is done in the right mode, in order to test fix for DEF083327
-  	User::LeaveIfError(window.SetRequiredDisplayMode(EColor256));
-  			
-	// run test using a single gc
-	FontCacheOverflowDrawingTestL(EFalse, window);
-	// reset for next test
-	window.Invalidate();
-	iXPlus = ETrue;
-	iYPlus = EFalse;
-	// run test using multiple gcs
-	FontCacheOverflowDrawingTestL(ETrue, window);
-	
-	CleanupStack::PopAndDestroy(&window);
- 	}
- 	
-/* TESTCASE:	22
-* TITLE:		Scroll Window
-* IMPORTANCE:	
-* REQUIREMENT:	
-* 
-*
-* API:	
-* #
-*
-* ACTION:
-* A window is scrolled then a blank window is popped up, made visible and then 
-* invisible in order to test that partial redraw storing is drawing window 
-* contents properly after hiding the blank window.
-* 
-* Before the fix, the contents used to disappear as partial redraw storing was 
-* not storing the commands to draw areas outside the defined clipping rect, in 
-* this case the area covered by the popped window. Now, the fix makes sure that 
-* full redraw to the window is applied when there are atored commands but the 
-* changes are performed only in the covered area.
-*
-* RESULT:
-* When the blank window is hidden, the covered area will be redrawn and will
-* contain the original contents before poping the blank window. 
-*
-*/
-void CTRedrawStoring::ScrollWinTest()
-	{
-	iDrawMode=EClientRedrawsNormal;
-
-	// Drawing the contents first before scrolling
-	iTestWin->DrawNow();
-
-	// Scrolling the test window and updating its y position
-	iTestWin->DrawableWin()->Scroll(TPoint(0, 25));	
-	iYPoz += 25;
-
-	// Invalidating and redrawing the area that should be updated
-	TRect invalidRect(0,25, iWinSize.iWidth, 25*2);
-	iTestWin->Invalidate(invalidRect);
-	iTestWin->Redraw(invalidRect);			// Redraw is used instead of DrawNow becuase the later calls Invalidate on the whole window
-		
-	// Displaying and then hiding the popup blank window
-	iBlankWin.SetExtent(TPoint(iWinSize.iWidth+40,30), TSize(120, 100));
-	iBlankWin.SetVisible(ETrue);
-	iBlankWin.SetVisible(EFalse);
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-
-	// Resetting iBlankWin to its original size and position for future use 
-	// by other test cases
-	iBlankWin.SetExtent(iWinPos, iWinSize);	
-	CheckWindowsMatch();
-	iYPoz=0;
-	}
-
-
-TPoint CTRedrawStoring::ComputeTextPosition(TPoint aPoint)
- 	{
- 	// Bounces text around the screen
- 	const TInt KSpacing = 30;
- 	
- 	if(iXPlus)
- 		{
- 		aPoint.iX += KSpacing;
- 		}
- 	else
- 		{
- 		aPoint.iX -= KSpacing;
- 		}
- 	if(aPoint.iX > iWinSize.iWidth)
- 		{
- 		aPoint.iX = iWinSize.iWidth - (aPoint.iX - iWinSize.iWidth);
- 		iXPlus = EFalse;
- 		}
- 	else if(aPoint.iX < 0)
- 		{
- 		aPoint.iX = -1*aPoint.iX;
- 		iXPlus = ETrue;
- 		}
- 		
- 	if(iYPlus)
- 		{
- 		aPoint.iY += KSpacing;
- 		}
- 	else
- 		{
- 		aPoint.iY -= KSpacing;
- 		}
- 	if(aPoint.iY > iWinSize.iHeight)
- 		{
- 		aPoint.iY = iWinSize.iHeight - (aPoint.iY - iWinSize.iHeight);
- 		iYPlus = EFalse;
- 		}
- 	else if(aPoint.iY < 0)
- 		{
- 		aPoint.iY = -1*aPoint.iY;
- 		iYPlus = ETrue;
- 		}
- 	return aPoint;
- 	}
- 	
-void CTRedrawStoring::FontCacheOverflowDrawingTestL(TBool aDiffGc, RWindow& aWindow)
-	{
-	const TInt KNumFonts = 250;
-	const TInt KNumFontTypes = TheClient->iScreen->NumTypefaces();
- 	const TInt KMaxFontSize = 21; // font sizes to be tested in range 1 to 21
- 	const TInt KNumTestStyles = 4; 
- 	const TInt KNumSizes = KNumFonts/(KNumFontTypes * KNumTestStyles) + 1; // chooses a number of font sizes to overflow cache, rounded up
- 	TInt textStyle = 0; //determines whether text is not changed (0), bold (1), bold and italic (2) or italic (3)
-	TInt fontType = 0; //increment for different font types
-	TInt currentSize = 1; // start with a font size of 1
-	TInt fontSizeIncrement = KMaxFontSize - currentSize; //defaults to 20
-	if(KNumSizes>2)
-		{
-		fontSizeIncrement = KMaxFontSize/(KNumSizes-1);
-		}
-	TInt numGcs = 1; 
- 	if(aDiffGc)
- 		{
- 		numGcs = KNumFonts;
- 		}
-	_LIT(KTestText,"b8-/+.,*:");
-	const TSize KScrSize(TheClient->iScreen->SizeInPixels());
-	TSize fontCacheWinSize(KScrSize.iWidth/2,KScrSize.iHeight);
-	iTestWinPoint.SetXY(fontCacheWinSize.iWidth/2, fontCacheWinSize.iHeight/2); //draw initially near the middle of the screen
-
-	CWindowGc* winGc = NULL;
-	RArray<CWindowGc*> winGcList;
-	CleanupClosePushL(winGcList);
-	
-	aWindow.BeginRedraw();
-
-	// fill an array with fonts of different styles (see textStyle comment), types, and sizes
-	RArray<CFont*> fontArray;
-	CleanupClosePushL(fontArray);
-	for(TInt ii = 0; ii < KNumFonts; ii++)
-		{
-		if(ii && !(ii % (KNumTestStyles * KNumSizes)))
-			{
-			fontType++;
-			textStyle = 0;
-			currentSize = 1;
-			}
-		else if(ii && !(ii % KNumTestStyles))
-			{
-			currentSize += fontSizeIncrement;
-			textStyle = 0;
-			}
-		TTypefaceSupport support;
-		TheClient->iScreen->TypefaceSupport(support, fontType);
-		TFontSpec fspec(support.iTypeface.iName.Des(), currentSize);
-		switch(textStyle++)
-			{
-		case 0:
-			fspec.iFontStyle.SetPosture(EPostureUpright);
-			break;
-		case 1:
-			fspec.iFontStyle.SetStrokeWeight(EStrokeWeightBold);
-			break;
-		case 2:
-			fspec.iFontStyle.SetPosture(EPostureItalic);
-			break;
-		case 3:
-			fspec.iFontStyle.SetStrokeWeight(EStrokeWeightNormal);
-			break;
-			}
-		CFont* font = NULL;
-		User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInPixels(font, fspec));
-		User::LeaveIfError(fontArray.Append(font));
-		font = NULL;
-	
-		// Draw to left half of screen using either one gc for all fonts, or using a font per gc, dependent on value of aDiffGc	
-		if(ii<numGcs)
-			{
-			winGc = new(ELeave) CWindowGc(TheClient->iScreen);
-			CleanupStack::PushL(winGc); 
-			User::LeaveIfError(winGc->Construct());
-			winGc->Activate(aWindow);
-			User::LeaveIfError(winGcList.Append(winGc));
-			}
-		winGc->UseFont(fontArray[ii]);
-		winGc->SetPenColor(TRgb::Color256(ii));
-		winGc->DrawText(KTestText, iTestWinPoint = ComputeTextPosition(iTestWinPoint));
-		}
-	
-	aWindow.EndRedraw();
-	TheClient->Flush();
-	
-	// Copy the drawing to a bitmap and redraw to the right half of the screen
-	CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
-	CleanupStack::PushL(bitmap);
-	bitmap->Create(TSize(fontCacheWinSize.iWidth, fontCacheWinSize.iHeight), EColor256);
-	User::LeaveIfError(TheClient->iScreen->CopyScreenToBitmap(bitmap, TRect(fontCacheWinSize)));
-	TPoint copiedBitmapOrigin(fontCacheWinSize.iWidth, 0);
-	TRect bitmapArea(copiedBitmapOrigin, bitmap->SizeInPixels());
-	aWindow.Invalidate(bitmapArea);
-	aWindow.BeginRedraw(bitmapArea);
-	winGc->BitBlt(copiedBitmapOrigin, bitmap);
-	aWindow.EndRedraw();
-	CleanupStack::PopAndDestroy(bitmap);
-		
-	// Trigger a redraw (left half of screen)
-	RBlankWindow blankWindow(TheClient->iWs);
-	CleanupClosePushL(blankWindow);
- 	User::LeaveIfError(blankWindow.Construct(*TheClient->iGroup->WinTreeNode(), ENullWsHandle));
-	blankWindow.SetSize(TSize(fontCacheWinSize.iWidth, fontCacheWinSize.iHeight));
- 	blankWindow.Activate();
- 	TheClient->Flush();
- 	blankWindow.SetVisible(EFalse);
- 	TheClient->Flush();
- 	CleanupStack::PopAndDestroy(&blankWindow);
- 	TheClient->WaitForRedrawsToFinish();
- 	// Compare what is redrawn with copy of original drawing
-	TEST(TheClient->iScreen->RectCompare(TRect(fontCacheWinSize),TRect(copiedBitmapOrigin,fontCacheWinSize))); 		
- 	// Clean up all memory 		
-	for(TInt kk = 0; kk < KNumFonts; kk++)
-		{
-		if(kk < numGcs)
-			{
-			winGcList[kk]->Deactivate();
-			}
-		TheClient->iScreen->ReleaseFont(fontArray[kk]);
-		}
-	CleanupStack::PopAndDestroy(2+numGcs, &winGcList); 
-	}
-
-// As a full fledged test code is written for this implementation.
-// so this test code checks whether this defect is fixed.
-void CTRedrawStoring::DoTestDrawBitmapMaskedL(TInt aWsBitmap/*=EFalse*/)
-	{
-	// Create a source bitmap with display mode EColor16MU and Fill RGB lines successively
-	TInt bitmapWidth=iWinSize.iWidth-40;
-	TInt bitmapHeight=80;
-	TSize bitmapSize(bitmapWidth,bitmapHeight);
-	CFbsBitmap* fbsBitmap=NULL;
-	CWsBitmap* wsBitmap=NULL;
-	if (aWsBitmap)
-		{
-		wsBitmap=new(ELeave) CWsBitmap(TheClient->iWs);
-		CleanupStack::PushL(wsBitmap);
-		User::LeaveIfError(wsBitmap->Create(bitmapSize,EColor16MU));
-		}
-	else
-		{
-		fbsBitmap=new(ELeave) CFbsBitmap();
-		CleanupStack::PushL(fbsBitmap);
-		User::LeaveIfError(fbsBitmap->Create(bitmapSize,EColor16MU));
-		}
-
-	TBitmapUtil bmpUtil(aWsBitmap ? wsBitmap : fbsBitmap);
-	bmpUtil.Begin(TPoint(0,0));
-	TInt row,col;
-	for(row=0;row<bitmapWidth;++row)
-		{
-		bmpUtil.SetPos(TPoint(row,0));
-		for(col=0;col<bitmapHeight;++col)
-			{
-			if (row%3==0)
-				{
-				TRgb rgb(255,0,0);
-				bmpUtil.SetPixel(rgb.Color16M());
-				}
-			else if (row%3==1)
-				{
-				TRgb rgb(0,255,0);
-				bmpUtil.SetPixel(rgb.Color16M());
-				}
-			else
-				{
-				TRgb rgb(0,0,255);
-				bmpUtil.SetPixel(rgb.Color16M());
-				}
-			bmpUtil.IncYPos();
-			}
-		}
-	bmpUtil.End();
-	
-	// Create mask bitmap with display mode EGray256 and Fill white and black lines successively
-	CFbsBitmap* fbsBitmapMask=NULL;
-	CWsBitmap* wsBitmapMask=NULL;
-	if (aWsBitmap)
-		{
-		wsBitmapMask=new(ELeave) CWsBitmap(TheClient->iWs);
-		CleanupStack::PushL(wsBitmapMask);
-		User::LeaveIfError(wsBitmapMask->Create(bitmapSize,EGray256));
-		}
-	else
-		{
-		fbsBitmapMask=new(ELeave) CFbsBitmap();
-		CleanupStack::PushL(fbsBitmapMask);
-		User::LeaveIfError(fbsBitmapMask->Create(bitmapSize,EGray256));
-		}
-
-	TBitmapUtil bmpUtilMask(aWsBitmap ? wsBitmapMask : fbsBitmapMask);
-	bmpUtilMask.Begin(TPoint(0,0));
-	for(row=0;row<bitmapWidth;++row)
-		{
-		bmpUtilMask.SetPos(TPoint(row,0));
-		for(col=0;col<bitmapHeight;++col)
-			{
-			if (row%2==0)
-				{
-				bmpUtilMask.SetPixel(0xff000000);
-				}
-			else
-				{
-				bmpUtilMask.SetPixel(0xffffffff);
-				}
-			bmpUtilMask.IncYPos();
-			}
-		}
-	bmpUtilMask.End();
-	CleanupStack::Pop(2); // wsBitmap or fbsBitmap and fbsBitmapMask or wsBitmapMask
-
-	// Create window and draw the content of it by using DrawBitmapMasked
-	// Background to be red
-	TSize screenSize=TheClient->iScreen->SizeInPixels();
-	iWinRect.SetRect(screenSize.iWidth/3,0,2*screenSize.iWidth/3,screenSize.iHeight);
-	iBitmapMaskedWin=CBitmapMaskedWin::NewL(fbsBitmap,fbsBitmapMask,wsBitmap,wsBitmapMask,KRgbRed,bitmapSize,EFalse,aWsBitmap);
-	CleanupStack::PushL(iBitmapMaskedWin);
-	iBitmapMaskedWin->SetExt(TPoint(screenSize.iWidth/3,0),iWinRect.Size());
-	iBitmapMaskedWin->Activate();
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	
-	// Create a bitmap window which in its draw function it just bitblts its content
-	// First fill that bitmap with red color
-	iTestWinPoint.SetXY(2*screenSize.iWidth/3,0);
-	iTestBitmap=CBitmap::NewL(iWinRect.Size(),EColor16MU);
-	CleanupStack::PushL(iTestBitmap);
-	iTestBitmap->Gc().SetBrushColor(TRgb(255,0,0));
-	iTestBitmap->Gc().SetBrushStyle(CGraphicsContext::ESolidBrush);
-	iTestBitmap->Gc().SetPenStyle(CGraphicsContext::ENullPen);
-	iTestBitmap->Gc().DrawRect(iWinRect.Size());
-	iTestBitmap->Gc().Reset();
-	iTestBitmapWin=new(ELeave) CBitMapWin(iTestBitmap);
-	CleanupStack::PushL(iTestBitmapWin);
-	iTestBitmapWin->ConstructExtLD(*TheClient->iGroup,iTestWinPoint,iWinRect.Size());
-	iTestBitmapWin->BaseWin()->SetRequiredDisplayMode(EColor16MU);
-	iTestBitmapWin->BaseWin()->SetShadowDisabled(ETrue);
-	iTestBitmapWin->BaseWin()->SetShadowHeight(0);
-	iTestBitmapWin->AssignGC(*TheClient->iGc);
-	iTestBitmapWin->Activate();
-	
-	// This if for testing with Invertmask as EFalse
-	TSize tempSize=bitmapSize;
-	DrawBitmapAndCheckL(tempSize,EColor16MU,(aWsBitmap ? wsBitmap : fbsBitmap),(aWsBitmap ? wsBitmapMask : fbsBitmapMask),EFalse);
-
-	tempSize.SetSize(bitmapSize.iWidth*11/10,bitmapSize.iHeight*11/10);
-	iBitmapMaskedWin->SetDestRectSize(tempSize);
-	iBitmapMaskedWin->DrawNow();
-	TheClient->WaitForRedrawsToFinish();
-	DrawBitmapAndCheckL(tempSize,EColor16MU,(aWsBitmap ? wsBitmap : fbsBitmap),(aWsBitmap ? wsBitmapMask : fbsBitmapMask),EFalse);
-
-	tempSize.SetSize(bitmapSize.iWidth*2/3,bitmapSize.iHeight*2/3);
-	iBitmapMaskedWin->SetDestRectSize(tempSize);
-	iBitmapMaskedWin->DrawNow();
-	TheClient->WaitForRedrawsToFinish();
-	DrawBitmapAndCheckL(tempSize,EColor16MU,(aWsBitmap ? wsBitmap : fbsBitmap),(aWsBitmap ? wsBitmapMask : fbsBitmapMask),EFalse);
-
-	// This if for testing with Invertmask as ETrue
-	tempSize=bitmapSize;
-	iBitmapMaskedWin->SetInvertMask(ETrue);
-	iBitmapMaskedWin->SetDestRectSize(tempSize);
-	iBitmapMaskedWin->DrawNow();
-	TheClient->WaitForRedrawsToFinish();
-	DrawBitmapAndCheckL(tempSize,EColor16MU,(aWsBitmap ? wsBitmap : fbsBitmap),(aWsBitmap ? wsBitmapMask : fbsBitmapMask),ETrue);
-
-	tempSize.SetSize(bitmapSize.iWidth*11/10,bitmapSize.iHeight*11/10);
-	iBitmapMaskedWin->SetDestRectSize(tempSize);
-	iBitmapMaskedWin->DrawNow();
-	TheClient->WaitForRedrawsToFinish();
-	DrawBitmapAndCheckL(tempSize,EColor16MU,(aWsBitmap ? wsBitmap : fbsBitmap),(aWsBitmap ? wsBitmapMask : fbsBitmapMask),ETrue);
-
-	tempSize.SetSize(bitmapSize.iWidth*2/3,bitmapSize.iHeight*2/3);
-	iBitmapMaskedWin->SetDestRectSize(tempSize);
-	iBitmapMaskedWin->DrawNow();
-	TheClient->WaitForRedrawsToFinish();
-	DrawBitmapAndCheckL(tempSize,EColor16MU,(aWsBitmap ? wsBitmap : fbsBitmap),(aWsBitmap ? wsBitmapMask : fbsBitmapMask),ETrue);
-
-	// With bitmap's display mode as EColor256 and invertmask EFalse
-	if (aWsBitmap)
-		{
-		wsBitmap->SetDisplayMode(EColor256);
-		}
-	else
-		{
-		fbsBitmap->SetDisplayMode(EColor256);	
-		}
-	iBitmapMaskedWin->BaseWin()->SetRequiredDisplayMode(EColor256);
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-
-	// Delete the tempbitmap and tempbitmapwin and recreate once again.
-	CleanupStack::PopAndDestroy(2); // iTestBitmap, iTestBitmapWin
-	iTestBitmap=NULL;
-	iTestBitmapWin=NULL;
-	iTestBitmap=CBitmap::NewL(iWinRect.Size(),EColor256);
-	CleanupStack::PushL(iTestBitmap);
-	iTestBitmap->Gc().SetBrushColor(TRgb(255,0,0));
-	iTestBitmap->Gc().SetBrushStyle(CGraphicsContext::ESolidBrush);
-	iTestBitmap->Gc().SetPenStyle(CGraphicsContext::ENullPen);
-	iTestBitmap->Gc().DrawRect(iWinRect.Size());
-	iTestBitmap->Gc().Reset();
-	iTestBitmapWin=new(ELeave) CBitMapWin(iTestBitmap);
-	CleanupStack::PushL(iTestBitmapWin);
-	iTestBitmapWin->ConstructExtLD(*TheClient->iGroup,iTestWinPoint,iWinRect.Size());
-	iTestBitmapWin->BaseWin()->SetRequiredDisplayMode(EColor256);
-	iTestBitmapWin->BaseWin()->SetShadowDisabled(ETrue);
-	iTestBitmapWin->BaseWin()->SetShadowHeight(0);
-	iTestBitmapWin->AssignGC(*TheClient->iGc);
-	iTestBitmapWin->Activate();
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-
-	tempSize=bitmapSize;
-	iBitmapMaskedWin->SetInvertMask(EFalse);
-	iBitmapMaskedWin->SetDestRectSize(tempSize);
-	iBitmapMaskedWin->DrawNow();
-	TheClient->WaitForRedrawsToFinish();
-	DrawBitmapAndCheckL(tempSize,EColor256,(aWsBitmap ? wsBitmap : fbsBitmap),(aWsBitmap ? wsBitmapMask : fbsBitmapMask),EFalse);
-
-	tempSize.SetSize(bitmapSize.iWidth*11/10,bitmapSize.iHeight*11/10);
-	iBitmapMaskedWin->SetDestRectSize(tempSize);
-	iBitmapMaskedWin->DrawNow();
-	TheClient->WaitForRedrawsToFinish();
-	DrawBitmapAndCheckL(tempSize,EColor256,(aWsBitmap ? wsBitmap : fbsBitmap),(aWsBitmap ? wsBitmapMask : fbsBitmapMask),EFalse);
-
-	tempSize.SetSize(bitmapSize.iWidth*2/3,bitmapSize.iHeight*2/3);
-	iBitmapMaskedWin->SetDestRectSize(tempSize);
-	iBitmapMaskedWin->DrawNow();
-	TheClient->WaitForRedrawsToFinish();
-	DrawBitmapAndCheckL(tempSize,EColor256,(aWsBitmap ? wsBitmap : fbsBitmap),(aWsBitmap ? wsBitmapMask : fbsBitmapMask),EFalse);
-
-	// With bitmap's display mode as EColor256 and invertmask ETrue
-	tempSize=bitmapSize;
-	iBitmapMaskedWin->SetInvertMask(ETrue);
-	iBitmapMaskedWin->SetDestRectSize(tempSize);
-	iBitmapMaskedWin->DrawNow();
-	TheClient->WaitForRedrawsToFinish();
-	DrawBitmapAndCheckL(tempSize,EColor256,(aWsBitmap ? wsBitmap : fbsBitmap),(aWsBitmap ? wsBitmapMask : fbsBitmapMask),ETrue);
-
-	tempSize.SetSize(bitmapSize.iWidth*11/10,bitmapSize.iHeight*11/10);
-	iBitmapMaskedWin->SetDestRectSize(tempSize);
-	iBitmapMaskedWin->DrawNow();
-	TheClient->WaitForRedrawsToFinish();
-	DrawBitmapAndCheckL(tempSize,EColor256,(aWsBitmap ? wsBitmap : fbsBitmap),(aWsBitmap ? wsBitmapMask : fbsBitmapMask),ETrue);
-
-	tempSize.SetSize(bitmapSize.iWidth*2/3,bitmapSize.iHeight*2/3);
-	iBitmapMaskedWin->SetDestRectSize(tempSize);
-	iBitmapMaskedWin->DrawNow();
-	TheClient->WaitForRedrawsToFinish();
-	DrawBitmapAndCheckL(tempSize,EColor256,(aWsBitmap ? wsBitmap : fbsBitmap),(aWsBitmap ? wsBitmapMask : fbsBitmapMask),ETrue);
-
-	//To test if DrawBitmapMask uses stored commands when called to redraw the bitmap.
-	if (aWsBitmap)
-		{
-		delete wsBitmapMask; //deleting the bitmap
-		wsBitmapMask=NULL;
-		DrawBitmapAndCheckL(tempSize,EColor256,(aWsBitmap ? wsBitmap : fbsBitmap),(aWsBitmap ? wsBitmapMask : fbsBitmapMask),ETrue);
-		}
-	CleanupStack::PopAndDestroy(3,iBitmapMaskedWin); // iBitmapMaskedWin,iTestBitmap,iTestBitmapWin
-	}
-
-void CTRedrawStoring::DrawBitmapAndCheckL(const TSize aSize,TDisplayMode aDisplayMode,CFbsBitmap* aSrceBitmap,CFbsBitmap* aMaskBitmap,TBool aInvertMask)
-	{
-	TBool retVal;
-	if (aMaskBitmap)
-		{
-		TRect srceRect(aSrceBitmap->SizeInPixels());
-		TRect destRect(aSize);
-		CBitmap* srcTempBitmap=CBitmap::NewL(aSize,aDisplayMode);
-		CleanupStack::PushL(srcTempBitmap);
-		srcTempBitmap->Gc().DrawBitmap(destRect,aSrceBitmap,srceRect);
-		CBitmap* maskTempBitmap=CBitmap::NewL(aSize,EGray256);
-		CleanupStack::PushL(maskTempBitmap);
-		maskTempBitmap->Gc().DrawBitmap(destRect,aMaskBitmap,srceRect);
-		iTestBitmap->Gc().SetPenStyle(CGraphicsContext::ENullPen);
-		iTestBitmap->Gc().SetBrushColor(TRgb(255,0,0));
-		iTestBitmap->Gc().SetBrushStyle(CGraphicsContext::ESolidBrush);
-		iTestBitmap->Gc().DrawRect(iWinRect.Size());
-		iTestBitmap->Gc().BitBltMasked(TPoint(),&srcTempBitmap->Bitmap(),destRect,&maskTempBitmap->Bitmap(),aInvertMask);
-		iTestBitmap->Gc().Reset();
-		iTestBitmapWin->DrawNow();
-		TheClient->iWs.Finish();
-		TheClient->WaitForRedrawsToFinish();
-		retVal = TheClient->iScreen->RectCompare(TRect(iWinRect.iTl,aSize),TRect(iTestWinPoint,aSize));
-		TEST(retVal);
-		if (!retVal)
-			INFO_PRINTF3(_L("TheClient->iScreen->RectCompare() return value  - Expected: %d, Actual: %d"), ETrue, retVal);
-		CleanupStack::PopAndDestroy(2,srcTempBitmap);
-		}
-	else 
-	//To test if DrawBitmapMask uses stored commands, when called to redraw the bitmap.
-	//After the bitmap "wsBitmapMask" is being deleted, the window "iBitmapMaskWin" is first made invisible 
-	//and then visible on the screen. This operation invokes draw function which redraws the bitmap by using the stored commands.
-		{
-		iBitmapMaskedWin->SetVisible(EFalse);
-		iBitmapMaskedWin->SetVisible(ETrue);
-		retVal = TheClient->iScreen->RectCompare(TRect(iWinRect.iTl,aSize),TRect(iTestWinPoint,aSize));
-		TEST(retVal);
-		if (!retVal)
-			INFO_PRINTF3(_L("TheClient->iScreen->RectCompare() return value  - Expected: %d, Actual: %d"), ETrue, retVal);
-		}
-	}
-
-
-/**
-	@SYMTestCaseID GRAPHICS-CODEBASE-WSERV-0052-0001
-	@SYMPREQ PGM027
-  
-	@SYMTestCaseDesc Tests CWsBitmap::BitBltMasked and CFbsBitmap::BitBltMasked API's with \n
-	By passing Null and unexpected values.
-   
-	@SYMTestPriority 1 
-  
-	@SYMTestStatus Implemented
-   
-	@SYMTestActions Call BitBltMasked with different ways
-	Source Bitpmap as NULL and MaskBitmap
-	Source Bitmap and MaskBitmap as NULL (For both CFbsBitmap, CWsBitmap)
-		
-	@SYMTestExpectedResults Should not panic even if the passed bitmaps are NULL.
-
- */		
-void CTRedrawStoring::DoBitBltAndMaskedNegTestsL()
-	{
-	CWsBitmap* testBitmap=NULL;	
-	CWsBitmap* maskBitmap=NULL;
-	// Passing null Masked bitmap
-	(TheClient->iGc)->BitBltMasked(TPoint(20,20), testBitmap, TRect(TPoint(0, 0), TSize(20,20)), maskBitmap, EFalse);
-	testBitmap=new(ELeave) CWsBitmap(TheClient->iWs);
-	CleanupStack::PushL(testBitmap);
-	User::LeaveIfError(testBitmap->Load(TEST_BITMAP_NAME,3));
-	(TheClient->iGc)->BitBltMasked(TPoint(20,20), testBitmap, TRect(TPoint(0, 0), TSize(20,20)), maskBitmap, EFalse);
-	CleanupStack::PopAndDestroy(testBitmap);
-	testBitmap=NULL;
-	maskBitmap=new(ELeave) CWsBitmap(TheClient->iWs);
-	CleanupStack::PushL(maskBitmap);
-	User::LeaveIfError(maskBitmap->Load(TEST_BITMAP_NAME,4));
-	// Passing null source bitmap
-	(TheClient->iGc)->BitBltMasked(TPoint(20,20), testBitmap, TRect(TPoint(0, 0), TSize(20,20)), maskBitmap, EFalse);
-	CleanupStack::PopAndDestroy(maskBitmap);
-	CFbsBitmap* samBitmap=NULL;	
-	CFbsBitmap* mskBitmap=NULL;
-	// Passing null Masked bitmap
-	(TheClient->iGc)->BitBltMasked(TPoint(20,20), samBitmap, TRect(TPoint(0, 0), TSize(20,20)), mskBitmap, EFalse);
-	samBitmap=new(ELeave) CWsBitmap(TheClient->iWs);
-	CleanupStack::PushL(samBitmap);
-	User::LeaveIfError(samBitmap->Load(TEST_BITMAP_NAME,3));
-	(TheClient->iGc)->BitBltMasked(TPoint(20,20), samBitmap, TRect(TPoint(0, 0), TSize(20,20)), mskBitmap, EFalse);
-	CleanupStack::PopAndDestroy(samBitmap);
-	samBitmap=NULL;
-	mskBitmap=new(ELeave) CWsBitmap(TheClient->iWs);
-	CleanupStack::PushL(mskBitmap);
-	User::LeaveIfError(mskBitmap->Load(TEST_BITMAP_NAME,4));
-	// Passing null source bitmap
-	(TheClient->iGc)->BitBltMasked(TPoint(20,20), testBitmap, TRect(TPoint(0, 0), TSize(20,20)), mskBitmap, EFalse);
-	CleanupStack::PopAndDestroy(mskBitmap);
-	CWsBitmap* cwBitmap=NULL;	
-	TPoint pos(0,0);
-	// Passing null CWsBitmap
-	TheClient->iGc->BitBlt(pos,cwBitmap);
-	TheClient->iGc->BitBlt(pos,cwBitmap,TRect(0,0,10,10));
-	// Passing null CFbsBitmap
-	CFbsBitmap* fbsBitmap=NULL;	
-	TheClient->iGc->BitBlt(pos,fbsBitmap);
-	TheClient->iGc->BitBlt(pos,fbsBitmap,TRect(0,0,10,10));
-	}
-
-/* TESTCASE:	INC095798
- * TITLE:		Partial Draw Now Test
- * IMPORTANCE:	1
- *
- * ACTION: Changes the color of a rectangle inside a window to simulate CCoeControl::DrawNow()
- * for an embedded control that does not own a window.
- *
- * RESULT: The rectangle should change color immediately, without waiting for a redraw event
- * from the Window Server, and this should work with or without partial redraw storing and
- * with or without transparency.
- */
-void CTRedrawStoring::DoPartialDrawNowTestL( TBool aUseTransparency )
-	{
-	/*
-	 * Obtain the color of a particular reference pixel which will be used for
-	 * comparison later on when the test window is added covering it.
-	 */
-	const TPoint referencePixel(iWinPos+TPoint(50,50));
-	TRgb backgroundReferenceColor;
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	TheClient->iWs.Finish();
-	TheClient->iScreen->GetPixel(backgroundReferenceColor, referencePixel);
-	/*
-	 * Add a test window which emulates a CONE control with a lodger.
-	 * The window is transparent according to parameter aUseTransparency
-	 */
-	CPartialDrawNowWin* testWin=new(ELeave) CPartialDrawNowWin;
-	CleanupStack::PushL(testWin);
-	testWin->ConstructL(*TheClient->iGroup);
-	testWin->AssignGC(*TheClient->iGc);
-	testWin->SetExt(iWinPos+TPoint(25,25),TSize(300,200));
-	testWin->Win()->SetRequiredDisplayMode(iTestDisplayMode);
-	testWin->Win()->SetShadowDisabled(ETrue);
-	if (aUseTransparency)
-		TEST(testWin->MakeTransparent() == KErrNone);
-	testWin->Win()->Activate();
-	testWin->Redraw();
-	testWin->SetLodger(TRect(20,20,30,30));
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	TheClient->iWs.Finish();
-	TRgb actualColor;
-	TheClient->iScreen->GetPixel(actualColor,iWinPos+TPoint(50,50));
-	if (aUseTransparency)
-		{
-		CColorBlender* blender = CColorBlender::NewLC(iTestDisplayMode);
-		blender->SetInitialColor(backgroundReferenceColor);
-		blender->Blend(TRgb(0, 0, 255, 127)); //the blue background of the window
-		blender->Blend(TRgb(0, 255, 0, 127)); //the green color of the lodger
-		const TRgb expectedColor = blender->Color();
-		TEST_COLOR_MATCH(expectedColor, actualColor);
-		CleanupStack::PopAndDestroy(blender);
-		}
-	else
-		{
-		TEST_COLOR_MATCH(KRgbGreen, actualColor);
-		}
-	CleanupStack::PopAndDestroy(testWin);
-	}
-
-/*CPartialDrawNowWin*/
-CPartialDrawNowWin::CPartialDrawNowWin()
-	: iLodger( 0, 0, 0, 0 )
-	{}
-
-TInt CPartialDrawNowWin::MakeTransparent()
-	{
-	const TInt err = iWin.SetTransparencyAlphaChannel();
-	if(!err)
-		{
-		iWin.SetBackgroundColor(TRgb(0, 0, 0, 0));
-		iTransparent = ETrue;
-		}
-	return err;
-	}
-
-void CPartialDrawNowWin::SetLodger( const TRect &aLodger )
-	{
-	iLodger = aLodger;
-	iWin.Invalidate( aLodger );
-	Redraw( aLodger );
-	}
-
-void CPartialDrawNowWin::Redraw()
-	{
-	iWin.BeginRedraw();
-	DrawWindowAndLodger();
-	iWin.EndRedraw();
-	}
-
-void CPartialDrawNowWin::Redraw( const TRect &aRect )
-	{
-	iWin.BeginRedraw( aRect );
-	DrawWindowAndLodger();
-	iWin.EndRedraw();
-	}
-
-void CPartialDrawNowWin::DrawWindowAndLodger()
-	{
-	iGc->Activate( iWin );
-	iGc->SetPenStyle( CGraphicsContext::ENullPen );
-	iGc->SetBrushStyle( CGraphicsContext::ESolidBrush );
-	iGc->SetBrushColor( iTransparent ? TRgb(0, 0, 255, 127) : KRgbBlue );
-	iGc->Clear();
-	if (!iLodger.IsEmpty())
-		{
-		iGc->SetBrushColor( iTransparent ? TRgb(0, 255, 0, 127) : KRgbGreen );
-		iGc->DrawRect( iLodger );
-		}
-	iGc->Deactivate();
-	}
-
-
-
-/* TESTCASE:	PDEF101789
-   TITLE:		Expose Window Test for PDEF101789: WServ does not perform well in 9.2 release.
-  
-   ACTION: 		Draws a base window followed by a top window that completly covers the base window.
-   				The base window has an area invalidated and the top window is then moved out of the 
-  				way to expose the bottom window. The invalid are is then drawn to within a begin/end redraw
-  
-   RESULT: 		The invalid area on the base window should be redrawn correctly betweeen the begin/end 
-  				redraw pair after the base window has been exposed. The invalid area is drawn in a different
-  				colour to the base window.
- */
-void CTRedrawStoring::DoExposeTestL(TInt aIteration)
-	{
-	_LIT(KErrorMessage,"Expected colour value does not match actual value : Windows not drawn correctly");
-	
-	TPartialRedrawType type = iTest->RedrawStoreTypeL();
-	if(type==EPartialRedraw_FullRedrawSupport)
-		{
-		//draw a green coloured base window
-		CPartialRedrawBottomWin* bottomWin = new (ELeave) CPartialRedrawBottomWin();
-		CleanupStack::PushL(bottomWin);
-		bottomWin->ConstructL(*TheClient->iGroup);
-		bottomWin->Init();
-		bottomWin->AssignGC(*TheClient->iGc);
-		bottomWin->BaseWin()->SetShadowDisabled(ETrue);
-		bottomWin->BaseWin()->SetShadowHeight(0);
-		bottomWin->SetExt(iWinPos+TPoint(10,10), iTest->StdTestWindowSize());
-		bottomWin->Win()->Activate();
-		bottomWin->DrawPartial(TRect(TPoint(0,0), iTest->StdTestWindowSize()));
-		TheClient->Flush();
-		
-		//draw a red coloured top window that completely covers the base window
-		CPartialRedrawTopWin* topWin = new (ELeave) CPartialRedrawTopWin();
-		CleanupStack::PushL(topWin);
-		topWin->ConstructL(*TheClient->iGroup);
-		topWin->Init();
-		topWin->AssignGC(*TheClient->iGc);
-		topWin->BaseWin()->SetShadowDisabled(ETrue);
-		topWin->BaseWin()->SetShadowHeight(0);
-		topWin->SetExt(iWinPos+TPoint(10,10),iTest->StdTestWindowSize());
-		topWin->Win()->Activate();
-		topWin->DrawPartial(TRect(TPoint(0,0), iTest->StdTestWindowSize()));
-		TheClient->Flush();
-
-		//Invalidate the an area on the bottom window. 
-		TRect rect(TPoint(10,10), TSize(iTest->StdTestWindowSize().iWidth/4, iTest->StdTestWindowSize().iHeight/4));
-		bottomWin->Win()->Invalidate(rect);
-
-		//Now expose the bottom window by moving the top window out of the way 
-		//using one of the methods below
-		switch(aIteration)
-			{
-			case 0:
-				topWin->Win()->SetOrdinalPosition(-10);	
-				break;
-			case 1:
-				topWin->SetPos(iWinPos + TPoint(150,150));
-				break;
-			case 2:
-				topWin->SetVisible(EFalse);
-				break;	
-			}
-
-		//now do a begin/end redraw to draw a blue rect to the invalid area on the bottom window 
-		bottomWin->Win()->BeginRedraw(rect);
-		bottomWin->Gc()->Activate(*bottomWin->Win());
-		bottomWin->Gc()->SetBrushStyle(CGraphicsContext::ESolidBrush);
-		bottomWin->Gc()->SetBrushColor(TRgb(0,0,255,255));
-		bottomWin->Gc()->SetPenStyle(CGraphicsContext::ESolidPen);
-		bottomWin->Gc()->SetPenColor(0);	
-		bottomWin->Gc()->DrawRect(rect);
-		bottomWin->Gc()->Deactivate();
-		bottomWin->Win()->EndRedraw();
-		TheClient->Flush();
-
-		//get the color of a pixel within the invalid area that should be coloured 
-		//blue if the window is redrawn correctly. In the defect this blue area is NOT drawn
-		TPoint point =iWinPos + TPoint(30,30); 
-		TRgb colour;
-		TheClient->iScreen->GetPixel(colour,point);
-		TRgb expectedColour=TRgb(0,0,255,255);
-		TEST(colour == expectedColour);
-		if (colour!=expectedColour)
-			INFO_PRINTF1(KErrorMessage);
-	
-		CleanupStack::PopAndDestroy(2, bottomWin);
-		}
-	}
-/*CPartialRedrawTopWin*/
-void CPartialRedrawTopWin::Init()
-	{
-	Win()->SetRequiredDisplayMode(EColor16MA);
-	Win()->SetTransparencyAlphaChannel();
-	Win()->SetBackgroundColor(TRgb(255,255,255,255));
-	}
-
-void CPartialRedrawTopWin::Draw()
-	{
-	DoDraw();
-	}
-
-void CPartialRedrawTopWin::DoDraw()
-	{
-	DrawFullWindowRect();
-	}
-
-void CPartialRedrawTopWin::DrawFullWindowRect()
-	{
-	TRect rect = TRect(TPoint(0,0),iSize);
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	iGc->SetBrushColor(TRgb(255,0,0,255));
-	iGc->DrawRect(rect);
-	}
-
-void CPartialRedrawTopWin::DrawPartial(TRect aRect)
-	{
-	Invalidate(aRect);
-	Win()->BeginRedraw(aRect);
-	iGc->Activate(*Win());
-	DrawFullWindowRect();
-	iGc->Deactivate();
-	Win()->EndRedraw();
-	}
-	
-/*CPartialRedrawBottomWin*/	
-void CPartialRedrawBottomWin::Init()
-	{
-	Win()->SetRequiredDisplayMode(EColor16MA);
-	Win()->SetTransparencyAlphaChannel();
-	Win()->SetBackgroundColor(TRgb(255,255,255,255));
-	}
-
-void CPartialRedrawBottomWin::Draw()
-	{
-	DoDraw();
-	}
-
-void CPartialRedrawBottomWin::DoDraw()
-	{
-	DrawFullWindowRect();
-	}
-
-void CPartialRedrawBottomWin::DrawFullWindowRect()
-	{
-	TRect rect = TRect(TPoint(0,0),iSize);
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	iGc->SetBrushColor(TRgb(0,255,0,255));
-	iGc->DrawRect(rect);
-	}
-
-void CPartialRedrawBottomWin::DrawPartial(TRect aRect)
-	{
-	Invalidate(aRect);
-	Win()->BeginRedraw(aRect);
-	iGc->Activate(*Win());
-	DrawFullWindowRect();
-	iGc->Deactivate();
-	Win()->EndRedraw();
-	}
-
-//CPartialRedrawTiledWin
-
-void CPartialRedrawTiledWin::Init(TRgb aColour,TBool aTransparent)
-	{
-	iColour=aColour;
-	Win()->SetRequiredDisplayMode(EColor16MA);
-	if(aTransparent)
-		{
-		Win()->SetTransparencyAlphaChannel();
-		}
-	Win()->SetBackgroundColor(iColour);
-	}
-
-void CPartialRedrawTiledWin::Draw()
-	{
-	DoDraw();
-	}
-
-void CPartialRedrawTiledWin::DoDraw()
-	{
-	DrawFullWindowRect();
-	}
-
-void CPartialRedrawTiledWin::DrawFullWindowRect()
-	{
-	TRect rect = TRect(TPoint(0,0),iSize);
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	iGc->SetBrushColor(iColour);
-	iGc->DrawRect(rect);
-	}
-
-void CPartialRedrawTiledWin::DrawPartial(TRect aRect)
-	{
-	Invalidate(aRect);
-	Win()->BeginRedraw(aRect);
-	iGc->Activate(*Win());
-	DrawFullWindowRect();
-	iGc->Deactivate();
-	Win()->EndRedraw();
-	}
-	
-/* TESTCASE:	DEF101889	
-   TITLE:	 	Expose Window Test for DEF101889 Windows tiled by opaque children do not redraw correctly 
-   				under certain use cases
- 
-   ACTION: 		Draws a base window then a further window over it that is tiled by opaque children. 
-   				This window is then, either completely or partially, covered by a transparent window. 
-   				The tiled window is then set invisible. Drawing is then performed to the base window.
-  
-   RESULT: 		The windows should be correctly drawn. More specifically the transparent top window should draw
-   				the correct window underneath it. i.e. after the setinvisible command the base window should be 
-   				drawn 
- */
-void CTRedrawStoring::DoExposeTest2L(TInt aIteration)
-	{
-	//This test reproduces problems found during the fixing of DEF096874: WServ does not perform well in 9.2 release.
-	//The issues (described later) only exhbit themselves when there are no shadows present in the system.
-	//Unfortunatly there is no direct way of disabling shadows from the test code so under normal running the 
-	//following tests will never hit the defect and always pass.
-	//To disable shadows the WSERV source code has to be manually altered by editing the CWsClientWindow::CommandL
-	//method in clwin.cpp. In the EWsWinOpSetShadowHeight case alter the SetHeightDiff(*pData.Int); function call
-	//to read SetHeightDiff(0);
-	//The use cases are related to DEF096874 in that the problem occurs when we have 2 windows overlaying each other 
-	//where the top window is completely tiled by child windows. DEF096874 occurs when the window that is tiled is made 
-	//invisible, with the result that the windows are not redrawn correctly. 
-	//The use cases reproduced by this test are when the two windows are either fully or partially obscured by a 
-	//further transparent window laid over the both of them. When the tiled window is made invisible then 
-	//the windows are not updated properly resulting in either transparency problems or the windows not being drawn 
-	//correctly. 
-	//There are further use cases not addressed here i.e. tiled windows becoming visible underneath a transparent window
-	//that relate to the same fundamental problem but are correctlly addressed by the defect fix.
-
-	TPartialRedrawType type=iTest->RedrawStoreTypeL();
-	if(type!=EPartialRedraw_FullRedrawSupport)
-		return;
-
-	_LIT(KErrorMessage,"Pixel expected to have colour 0x%x has color 0x%x");
-	const TSize winSize=iTest->StdTestWindowSize();
-	const TInt offset=winSize.iWidth/2;
-
-	//draw a green coloured base window
-	CPartialRedrawBottomWin* underWin = new(ELeave) CPartialRedrawBottomWin();
-	CleanupStack::PushL(underWin);
-	underWin->ConstructL(*TheClient->iGroup);
-	underWin->Init();
-	underWin->AssignGC(*TheClient->iGc);
-	underWin->BaseWin()->SetShadowDisabled(ETrue);
-	underWin->SetExt(iWinPos+TPoint(10,10),winSize);
-	underWin->Win()->Activate();
-	underWin->DrawPartial(TRect(winSize));
-	if (TDisplayModeUtils::NumDisplayModeColors(underWin->BaseWin()->DisplayMode())<=4096)
-		{
-		CleanupStack::PopAndDestroy(underWin);
-		_LIT(KLog,"Cannot run test without more than 4K colors");
-		LOG_MESSAGE(KLog);
-		return;
-		}
-
-	//draw a red coloured top window that completly covers the base window
-	CPartialRedrawTopWin* overWin = new (ELeave) CPartialRedrawTopWin();
-	CleanupStack::PushL(overWin);
-	overWin->ConstructL(*TheClient->iGroup);
-	overWin->Init();
-	overWin->AssignGC(*TheClient->iGc);
-	overWin->BaseWin()->SetShadowDisabled(ETrue);
-	overWin->SetExt(iWinPos+TPoint(10,10),winSize);
-	overWin->Win()->Activate();
-	overWin->DrawPartial(TRect(winSize));
-
-	//create the two tiles to attach to the top window
-	CPartialRedrawTiledWin* tile =  new (ELeave) CPartialRedrawTiledWin();
-	CleanupStack::PushL(tile);
-	tile->ConstructL(*overWin);
-	tile->Init(TRgb(255,255,0,255),EFalse);
-	tile->AssignGC(*TheClient->iGc);
-	tile->BaseWin()->SetShadowDisabled(ETrue);
-	tile->SetSize(winSize);
-	tile->Win()->Activate();
-	tile->DrawPartial(TRect(winSize));
-
-	//create a transparent window overlaying the whole arrangement
-	CPartialRedrawTiledWin* transparentWin =  new (ELeave) CPartialRedrawTiledWin();
-	CleanupStack::PushL(transparentWin);
-	transparentWin->ConstructL(*TheClient->iGroup);
-	transparentWin->Init(TRgb(255,255,255,0),ETrue);
-	transparentWin->AssignGC(*TheClient->iGc);
-	transparentWin->BaseWin()->SetShadowDisabled(ETrue);
-	//for the first iteration have the transparent window fully covering the other windows
-	//for the second iteration have the tansparent window partially covering the other windows.
-	transparentWin->SetExt(iWinPos+TPoint(10+(aIteration==0?0:offset),10),winSize);
-	transparentWin->Win()->Activate();
-	transparentWin->DrawPartial(TRect(winSize));
-
-	//Now expose the bottom window (underWin) by setting the top window (overWin) invisible 
-	//the opaque child window (tile) should also go invisible 
-	overWin->SetVisible(EFalse);
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	//get the color of a pixel within the window. If everything has been drawn correctly the 
-	//pixel should be green ( the colour of the base window, underWin)
-	TPoint point =iWinPos + TPoint(30,30); 
-	TRgb colour;
-	TheClient->iScreen->GetPixel(colour,point);
-	TRgb expectedColour=TRgb(0,255,0,255);
-	TEST(colour == expectedColour);	
-	if (colour!=expectedColour)
-		LOG_MESSAGE3(KErrorMessage,expectedColour.Value(),colour.Value());
-	//for partially covered windows the above code tests the uncovered region so an additional test
-	//is needed on a pixel in the covered region.
-	if (aIteration!=0)
-		{
-		point+=TPoint(offset,0);
-		TheClient->iScreen->GetPixel(colour,point);
-		TEST(colour==expectedColour);
-		if (colour!=expectedColour)
-			LOG_MESSAGE3(KErrorMessage,expectedColour.Value(),colour.Value());
-		}
-	CleanupStack::PopAndDestroy(4, underWin); //tile,topWin,transparentWin
-	}
-
-/* Test automatically purging the redraw store */
-
-CResetRedrawStoreWin* CTRedrawStoring::CreatePartialRedrawWinLC(const TPoint &aPos, const TSize &aSize, CTWin *aParent)
-	{
-	CResetRedrawStoreWin* testWin = new (ELeave) CResetRedrawStoreWin();
-	CleanupStack::PushL(testWin);
-	if (aParent)
-		testWin->ConstructL(*aParent);
-	else
-		testWin->ConstructL(*TheClient->iGroup);
-	testWin->Init();
-	testWin->AssignGC(*TheClient->iGc);
-	testWin->BaseWin()->SetShadowDisabled(ETrue);
-	testWin->BaseWin()->SetShadowHeight(0);
-	testWin->Win()->SetVisible(EFalse);
-	testWin->Win()->Activate();
-	testWin->SetExt(aPos,aSize);
-	testWin->SetVisible(ETrue);
-	return(testWin);
-	}
-
-CNoDrawWin* CTRedrawStoring::CreateNoDrawWinLC(const TPoint &aPos, const TSize &aSize)
-	{
-	CNoDrawWin* noDrawWin=new (ELeave) CNoDrawWin();
-	CleanupStack::PushL(noDrawWin);
-	noDrawWin->ConstructExtLD(*TheClient->iGroup, aPos, aSize);
-	noDrawWin->AssignGC(*TheClient->iGc);
-	noDrawWin->Win()->SetRequiredDisplayMode(iTestDisplayMode);
-	noDrawWin->Win()->SetTransparencyAlphaChannel();
-	noDrawWin->Win()->SetBackgroundColor(TRgb(127,127,127,127));
-	noDrawWin->BaseWin()->SetShadowDisabled(ETrue);
-	noDrawWin->BaseWin()->SetShadowHeight(0);
-	noDrawWin->Win()->SetVisible(ETrue);
-	noDrawWin->Activate();
-	noDrawWin->Win()->BeginRedraw();
-	noDrawWin->Gc()->Activate(*noDrawWin->Win());
-	CPartialRedrawWin::DrawRects(*noDrawWin->Gc(), aSize, 
-	  TPoint(0,0), ETrue, EPartialRedraw_Unknown);
-	noDrawWin->Gc()->Deactivate();
-	noDrawWin->Win()->EndRedraw();
-	return(noDrawWin);
-	}
-	
-void CTRedrawStoring::AutoResetRedrawStoreTestsL()
-	{
-	//PeterI This tests redraw store resetting by monitoring the wserv heap.
-	//It currently fails as it performs too many iterations of the test i.e. it doesn't reset as frequently
-	//as the orignal werv. Needs investigation to determine what the expected number of resets should be for 
-	//the Mk3 wserv.
-	/*
-	if (iPartialRedrawType==EPartialRedraw_FullRedrawSupport)
-		{
-		const TInt startWsHeapCount=TheClient->iWs.HeapCount();
-		const TInt KNumFlagsToTest=4;
-		const TInt KNumFlagStatesToTest=1<<KNumFlagsToTest;
-		for(TUint flags=0;flags<KNumFlagStatesToTest;flags++)
-			{
-		#if defined(LOGGING)
-			_LIT(KLog,"AutoResetRedrawStoreTestsL, running test with flags 0x%x");
-			LOG_MESSAGE2(KLog,flags);
-		#endif
-			DoAutoResetRedrawStoreTestL(flags&0x01,flags&0x02,flags&0x04,flags&0x08);
-			}
-		// Granularity of buffers can leave odd extra cells, hard to specify an exact amount
-		// This may need tweaking again future, should hand verify any gains are not cumulative
-		// by running this test multiple times and making sure the total does not keep
-		// rising everytime around.
-		const TInt KHeapTotalSafetyMargin=16;
-		const TInt endHeapCount=TheClient->iWs.HeapCount();
-		TEST((startWsHeapCount+KHeapTotalSafetyMargin)>=endHeapCount);
-		}
-	*/
-	}
-	
-void CTRedrawStoring::DoAutoResetRedrawStoreTestL(TBool aTwoWins, TBool aAnimateBothWins, TBool aKeepGcActive, TBool aUpdateInRedraw)
-	{
-	TRect testRect1(iTestWin->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),iWinSize);
-	TRect testRect2(iCheckWin->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),iWinSize);
-//
-	TSize testWinSize1(iWinSize.iWidth/3,iWinSize.iHeight/3);
-	TSize testWinSize2(iWinSize.iWidth/2,iWinSize.iHeight/2);
-	TPoint topLeft=iWinPos+TPoint(100,100);
-	TInt tooBig=topLeft.iX+testWinSize1.iWidth-testRect1.iBr.iX;
-	if (tooBig>0)
-		topLeft.iX-=tooBig;
-	
-	CResetRedrawStoreWin* testWin1=CreatePartialRedrawWinLC(topLeft,testWinSize1);
-	CResetRedrawStoreWin* testWin2=CreatePartialRedrawWinLC(topLeft-TPoint(50,50),testWinSize2);
-	testWin1->SetUpdateInRedraw(aUpdateInRedraw);
-	testWin2->SetUpdateInRedraw(aUpdateInRedraw);
-//
-	topLeft+=iCheckWin->Position()-iWinPos;
-	CResetRedrawStoreWin* tW1=CreatePartialRedrawWinLC(topLeft,testWinSize1);
-	CResetRedrawStoreWin* tW2=CreatePartialRedrawWinLC(topLeft-TPoint(50,50),testWinSize2);
-	tW1->SetUpdateInRedraw(aUpdateInRedraw);
-	tW2->SetUpdateInRedraw(aUpdateInRedraw);
-//
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-//	
-	const TInt KNumTestResets1=5;
-	const TInt KNumTestResets2=15;
-	const TInt KMaxIterationsPerReset=20;
-	const TInt numTestResets=aTwoWins?KNumTestResets2:KNumTestResets1;
-	const TInt maxTotalIterations=numTestResets*KMaxIterationsPerReset;
-	TInt resets=0;
-//
-	const TInt startWsHeapCount=TheClient->iWs.HeapCount();
-	TInt baseWsHeapCount=startWsHeapCount;
-	TInt prevWsHeapCount=0;
-	TInt totalIterations=0;
-	testWin1->SetKeepGcActive(aKeepGcActive);
-	if (aAnimateBothWins)
-		testWin2->SetKeepGcActive(aKeepGcActive);
-	do
-		{
-		testWin1->UpdateAnim(1);
-		testWin1->UpdateAnim(1);
-		testWin1->UpdateAnim(1);
-		if (aAnimateBothWins)
-			testWin2->UpdateAnim(3);
-		if (aTwoWins)
-			{
-			tW1->UpdateAnim(1);
-			tW1->UpdateAnim(2);
-			if (aAnimateBothWins)
-				{
-				tW2->UpdateAnim(1);
-				tW2->UpdateAnim(1);
-				tW2->UpdateAnim(1);
-				}
-			}
-		TBool failed=testWin1->Failed();
-		TEST(!failed);
-		if (failed)
-			{
-			_LIT(KLog,"Window had fail flag set");
-			LOG_MESSAGE(KLog);
-			}
-//
-		TheClient->Flush();
-		TheClient->WaitForRedrawsToFinish();
-		if (aTwoWins && !aUpdateInRedraw)
-			{
-			TBool match=TheClient->iScreen->RectCompare(testRect1,testRect2);
-			TEST(match);
-			if (!match)
-				{
-				_LIT(KLog,"Rectangle Area doesn't match, resets=%d (TwoWins=%d,AnimateBoth=%d,KeepActive=%d,InRedraw=%d)");
-				LOG_MESSAGE6(KLog,resets,aTwoWins,aAnimateBothWins,aKeepGcActive,aUpdateInRedraw);
-				}
-			}
-		const TInt wsHeapCount=TheClient->iWs.HeapCount();
-		TInt lowGap=wsHeapCount-baseWsHeapCount;
-		TInt highGap=prevWsHeapCount-wsHeapCount;
-		if (prevWsHeapCount>0 && ((aAnimateBothWins || aTwoWins)?highGap>0:lowGap<highGap))
-			{
-			baseWsHeapCount=wsHeapCount;
-			resets++;
-			}
-		totalIterations++;
-		if (totalIterations>=maxTotalIterations)
-			{
-			TEST(EFalse);
-			_LIT(KLog,"Too many iterations, number %d, max expect %d");
-			LOG_MESSAGE3(KLog,totalIterations,maxTotalIterations);
-			break;
-			}
-		prevWsHeapCount=wsHeapCount;
-		} while(resets<numTestResets);
-	if (!aTwoWins && !aAnimateBothWins)
-		{	// With two wins resetting of the redraw store will be out of sync, so heap won't be reset
-		if (aTwoWins || aAnimateBothWins || aKeepGcActive || !aUpdateInRedraw)
-			{	// First time around with aUpdateInRedraw causes extra redraw store buffer allocation
-			const TInt endHeapCount=TheClient->iWs.HeapCount();
-			const TInt KHeapSafetyMargin=4;	// Granularity of buffers can leave odd extra cells, hard to specify an exact amount
-			TBool heapUsageError=(startWsHeapCount+KHeapSafetyMargin>=endHeapCount);
-			TEST(heapUsageError);
-			if (!heapUsageError)
-				{
-				_LIT(KLog,"Memory Allocation Error, Before=%d, After=%d (Allowable Margin=%d)");
-				LOG_MESSAGE4(KLog,startWsHeapCount,endHeapCount,KHeapSafetyMargin);
-				}
-			}
-		}
-//
-	CleanupStack::PopAndDestroy(4, testWin1);
-	}
-
-void CTRedrawStoring::RedrawStoreWithSetExtentL()
-/* Test how the redraw store deals with windows changing their extent
-*/
-	{
-	TSize testSize(4*iWinSize.iWidth/7, iWinSize.iHeight);
-	TRect testRect1(iTestWin->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),testSize);
-	TRect testRect2(iCheckWin->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),testSize);
-	TSize testWinSize1a;
-	TSize testWinSize2;
-	TPoint winOffset1;
-	TPoint winOffset2;
-	GetTestWinSizeAndPos(1,winOffset1,testWinSize1a);
-	GetTestWinSizeAndPos(0,winOffset2,testWinSize2);
-	TPoint winPos1(iWinPos + winOffset1);
-	enum TSetExtentTestMode {ESetExtentTestModeExpandXY,ESetExtentTestModeExpandY,ESetExtentTestModeShrinkXY,ESetExtentTestModeShrinkY,ESetExtentTestModeShrinkXExpandY,ESetExtentTestModeCount};
-	for(TInt extMode=ESetExtentTestModeExpandXY;extMode<ESetExtentTestModeCount;extMode++)
-		{
-		enum TSetExtentInvalidateTestMode {ESetExtentInvalidateTestModeBefore,ESetExtentInvalidateTestModeAfter,ESetExtentInvalidateTestModeBeforeWithRedraw,ESetExtentInvalidateTestModeCount};
-		for(TInt invalidateMode=ESetExtentInvalidateTestModeBefore;invalidateMode<ESetExtentInvalidateTestModeCount;invalidateMode++)
-			{
-			TSize testWinSize1b(testWinSize1a);
-			switch(extMode)
-				{
-				case ESetExtentTestModeExpandXY:
-					testWinSize1b.iWidth=iWinSize.iWidth/4;
-					testWinSize1b.iHeight=iWinSize.iHeight/4;
-					break;
-				case ESetExtentTestModeExpandY:
-					testWinSize1b.iHeight=iWinSize.iHeight/4;
-					break;
-				case ESetExtentTestModeShrinkXY:
-					testWinSize1b.iWidth=iWinSize.iWidth/2;
-					testWinSize1b.iHeight=iWinSize.iHeight/2;
-					break;
-				case ESetExtentTestModeShrinkY:
-					testWinSize1b.iHeight=iWinSize.iHeight/2;
-					break;
-				case ESetExtentTestModeShrinkXExpandY:
-					testWinSize1b.iWidth=iWinSize.iWidth/2;
-					testWinSize1b.iHeight=iWinSize.iHeight/4;
-					break;
-				}
-
-			CResetRedrawStoreWin* testWin1=CreatePartialRedrawWinLC(winPos1, testWinSize1b);
-			CResetRedrawStoreWin* testWin2=CreatePartialRedrawWinLC(iWinPos + winOffset2, testWinSize2);
-			CResetRedrawStoreWin* tW1=CreatePartialRedrawWinLC(iCheckWin->Position() + winOffset1, testWinSize1a);
-			CResetRedrawStoreWin* tW2=CreatePartialRedrawWinLC(iCheckWin->Position() + winOffset2, testWinSize2);
-			TheClient->Flush();
-			TheClient->WaitForRedrawsToFinish();
-//
-			if (invalidateMode==ESetExtentInvalidateTestModeBeforeWithRedraw)
-				{
-				testWin1->PreSetSize(testWinSize1a);
-				testWin1->DrawNow();
-				}
-			if (invalidateMode==ESetExtentInvalidateTestModeBefore)
-				testWin1->Invalidate();
-			testWin1->SetExt(winPos1,testWinSize1a);
-			if (invalidateMode==ESetExtentInvalidateTestModeAfter)
-				testWin1->Invalidate();
-			TheClient->Flush();
-			TBool redrawWaiting=TheClient->WaitUntilRedrawPending();
-			TheClient->WaitForRedrawsToFinish();
-			TInt testRet=TheClient->iScreen->RectCompare(testRect1,testRect2);
-			if (!testRet)
-				{
-				TEST(EFalse);
-				_LIT(KRedrawStoreSetExtentFail,"Fade Regions fail: extMode=%d, invalidateMode=%d");
-				LOG_MESSAGE3(KRedrawStoreSetExtentFail,extMode,invalidateMode);
-				}
-//
-			CleanupStack::PopAndDestroy(4, testWin1);
-			}
-		}
-	}
-
-void CTRedrawStoring::PartialRedrawWithEmptyRedrawStoreL()
-	{
-	for(TInt numWins=1;numWins<4;numWins++)
-		{
-		const TInt KNumTestFlags=3;
-		for(TUint flags=0;flags<(1<<KNumTestFlags);flags++)
-			DoPartialRedrawWithEmptyRedrawStoreL(numWins,flags&0x1,flags&0x2,flags&0x4);
-		}
-	}
-	
-void CTRedrawStoring::DoPartialRedrawWithEmptyRedrawStoreL(TInt aNumWins, TBool aDoWinOnTop, TBool aRedrawWindow, TBool aChildWindows)
-/* This code has been written to verify how the partial redraw store deals with the
-case where it gets a partial redraw at a time when the redraw store is empty and awaiting
-a replacement set of commands using low priority redraws.
-*/
-	{
-	if (aChildWindows && aNumWins<2)
-		return;	// No point in this one, same as without flag set
-	TSize testWinSize1(iWinSize.iWidth/3, iWinSize.iHeight/3);
-	TSize testWinSize2(iWinSize.iWidth/2, iWinSize.iHeight/2);
-	TSize testWinSize3(iWinSize.iWidth*2/3, iWinSize.iHeight/4);
-	TPoint winOffset1(iWinSize.iWidth/2,iWinSize.iHeight/2);
-	TPoint nullPos;
-	if (aChildWindows)
-		{
-		testWinSize1.iWidth*=2;
-		testWinSize1.iHeight*=2;
-		winOffset1.iX=Min(50,iWinSize.iWidth-testWinSize1.iWidth);
-		winOffset1.iY=50;
-		}
-	CResetRedrawStoreWin* testWin1=CreatePartialRedrawWinLC(iWinPos + winOffset1, testWinSize1);
-	CResetRedrawStoreWin* tW1=CreatePartialRedrawWinLC(iCheckWin->Position() + winOffset1, testWinSize1);
-	CResetRedrawStoreWin* testWin2=NULL;
-	CResetRedrawStoreWin* testWin3=NULL;
-	if (aChildWindows)
-		{
-		TPoint winOffset2(TPoint(testWinSize1.iWidth/4,testWinSize1.iHeight/3));
-		testWin2=CreatePartialRedrawWinLC(winOffset2, testWinSize2, aChildWindows?testWin1:NULL);
-		CreatePartialRedrawWinLC(winOffset2, testWinSize2, aChildWindows?tW1:NULL);
-		if (aNumWins>2)
-			{
-			TPoint winOffset3(TPoint(testWinSize1.iWidth/2,testWinSize1.iHeight*2/3));
-			testWin3=CreatePartialRedrawWinLC(winOffset3, testWinSize3, aChildWindows?testWin1:NULL);
-			CreatePartialRedrawWinLC(winOffset3, testWinSize3, aChildWindows?tW1:NULL);
-			}
-		}
-	else
-		{
-		if (aNumWins>1)
-			{
-			TPoint winOffset2(TPoint(50,50));
-			testWin2=CreatePartialRedrawWinLC(iWinPos + winOffset2, testWinSize2, aChildWindows?testWin1:NULL);
-			CreatePartialRedrawWinLC(iCheckWin->Position() + winOffset2, testWinSize2, aChildWindows?tW1:NULL);
-			if (aNumWins>2)
-				{
-				TPoint winOffset3(TPoint(iWinSize.iWidth/6,iWinSize.iHeight/3));
-				testWin3=CreatePartialRedrawWinLC(iWinPos + winOffset3, testWinSize3, aChildWindows?testWin1:NULL);
-				CreatePartialRedrawWinLC(iCheckWin->Position() + winOffset3, testWinSize3, aChildWindows?tW1:NULL);
-				}
-			}
-		}
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	iDrawMode=EClientRedrawsNormal;
-//
-	TSize testSize(4*iWinSize.iWidth/7, iWinSize.iHeight);
-	TRect testRect1(iTestWin->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),testSize);
-	TRect testRect2(iCheckWin->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),testSize);
-	TRect partialRedrawRect1(0,testWinSize1.iHeight/4,testWinSize1.iWidth,testWinSize1.iHeight*3/4);
-	TRect partialRedrawRect2(0,testWinSize2.iHeight/4,testWinSize1.iWidth,testWinSize2.iHeight*3/4);
-	TRect partialRedrawRect3(testWinSize3.iWidth/4,0,testWinSize3.iWidth*3/4,testWinSize3.iHeight);
-	iBlankWin.SetExtent(iWinPos+winOffset1+partialRedrawRect1.iTl, partialRedrawRect1.Size());
-	const TInt KDoWindow1=0x01;
-	const TInt KDoWindow2=0x02;
-	const TInt KDoWindow3=0x04;
-	TInt numWinModes=1<<aNumWins;
-	for(TInt invalidateWindowFlags=0;invalidateWindowFlags<numWinModes;invalidateWindowFlags++)
-		{
-		TheClient->iWs.ClearAllRedrawStores();
-		if (invalidateWindowFlags&KDoWindow1)
-			testWin1->Invalidate(partialRedrawRect1);
-		if (invalidateWindowFlags&KDoWindow2)
-			testWin2->Invalidate(partialRedrawRect2);
-		if (invalidateWindowFlags&KDoWindow3)
-			testWin3->Invalidate(partialRedrawRect3);
-		if (aRedrawWindow)
-			{
-			if (invalidateWindowFlags&KDoWindow1)
-				testWin1->Redraw(partialRedrawRect1);
-			if (invalidateWindowFlags&KDoWindow2)
-				testWin1->Redraw(partialRedrawRect2);
-			if (invalidateWindowFlags&KDoWindow3)
-				testWin1->Redraw(partialRedrawRect3);
-			}
-		if (aDoWinOnTop)
-			{
-			iBlankWin.SetOrdinalPosition(0);
-			iBlankWin.SetVisible(ETrue);
-			iBlankWin.SetVisible(EFalse);
-			}
-		TheClient->Flush();
-		TheClient->WaitForRedrawsToFinish();
-	//
-		TBool match=TheClient->iScreen->RectCompare(testRect1,testRect2);
-		TEST(match);
-		if (!match)
-			{
-			_LIT(KLog,"Rectangle area doesn't match, windows=%d, flags=%d,%d,%d");
-			LOG_MESSAGE5(KLog,aNumWins,aDoWinOnTop,aRedrawWindow,aChildWindows);
-			}
-		}
-	// Resetting iBlankWin to its original size and position for future use 
-	// by other test cases
-	iBlankWin.SetExtent(iWinPos,iWinSize);
-	// window handles which are pushed onto cleanup stack, shall be deleted here
-	CleanupStack::PopAndDestroy(aNumWins*2,testWin1);
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-103713-0001
-
-@SYMDEF             PDEF106998
-
-@SYMTestCaseDesc    Empty Draw Test
-
-@SYMTestPriority    
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Draws an empty base window followed by an empty top window. 
-					 The top window is drawn in one of two cases: 
-				     completely covering the bottom window or 
-				     only covering the area that will be drawn to
-  
-  					A red rectangle is drawn to the bottom window and the top window is made invisible.
- 
-@SYMTestExpectedResults  The tested pixel colour should be red. Test will fail if the red rectangle 
-							is not drawn or if an infinite loop is detected.
-
-*/
-void CTRedrawStoring::DoEmptyDrawTestL(TInt aTestMode)
- 	{
- 	_LIT(KErrorMessage,"Infinite Loop");
-
-	TPartialRedrawType type = iTest->RedrawStoreTypeL();
- 	if(type==EPartialRedraw_FullRedrawSupport)
-		{
-		TBool testStatus = EFalse;
-			
-	 	//draw an empty, green base window
-	 	CPartialRedrawEmptyWin* bottomWin = new (ELeave) CPartialRedrawEmptyWin();
-	 	CleanupStack::PushL(bottomWin);
-	 	bottomWin->ConstructL(*TheClient->iGroup);
-	 	bottomWin->Init(KRgbGreen);
-	 	bottomWin->AssignGC(*TheClient->iGc);
-	 	bottomWin->BaseWin()->SetShadowDisabled(ETrue);
-	 	bottomWin->BaseWin()->SetShadowHeight(0);
-	 	bottomWin->SetExt(iWinPos+TPoint(10,10), iWinSize);
-	 	bottomWin->Win()->Activate();
-	 	bottomWin->DrawPartial(TRect(TPoint(0,0), iWinSize));
-	 	TheClient->Flush();
-
-	 	//draw an empty, blue top window
-	 	CPartialRedrawEmptyWin* topWin = new (ELeave) CPartialRedrawEmptyWin();
-	 	CleanupStack::PushL(topWin);
-	 	topWin->ConstructL(*TheClient->iGroup);
-	 	topWin->Init(KRgbBlue);
-	 	topWin->AssignGC(*TheClient->iGc);
-	 	topWin->BaseWin()->SetShadowDisabled(ETrue);
-	 	topWin->BaseWin()->SetShadowHeight(0);
-
-	 	switch(aTestMode)
-	 		{
-	 		case 0:
-	 		// top window is completely covering the base window
-		 	topWin->SetExt(iWinPos+TPoint(10,10), iWinSize);
-	 			break;
-	 		case 1:
-	 		// top window only covers the upper left hand corner, 
-	 		//  over where the red rectangle will be drawn
-		 	topWin->SetExt(iWinPos+TPoint(-5,-5), iWinSize);
-				break;
-	 		}
-
-	 	topWin->Win()->Activate();		
-	 	topWin->DrawPartial(TRect(TPoint(0,0), iWinSize));
-		TheClient->Flush();
-
-	 	//Invalidate the an area on the top window. 
-	 	TRect smallrect(TPoint(10,10), TSize(iWinSize.iWidth/4, iWinSize.iHeight/4));
-	 	topWin->Win()->Invalidate(smallrect);
-	 	
-	 	//draw a small red rectangle on the bottom window
-		bottomWin->Win()->BeginRedraw(smallrect);
-	 	bottomWin->Gc()->Activate(*bottomWin->Win());
-	 	bottomWin->Gc()->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	 	bottomWin->Gc()->SetBrushColor(KRgbRed);
-	 	bottomWin->Gc()->SetPenStyle(CGraphicsContext::ESolidPen);
-	 	bottomWin->Gc()->SetPenColor(0);	
-	 	bottomWin->Gc()->DrawRect(smallrect);
-	 	bottomWin->Gc()->Deactivate();
-	 	bottomWin->Win()->EndRedraw();
-		TheClient->Flush();
-		TheClient->WaitForRedrawsToFinish();
-
-		// hide the top window, so that the bottom window will be redrawn
-		topWin->SetVisible(EFalse);
-		TheClient->Flush();
-		TheClient->WaitForRedrawsToFinish();
-
-		// check to see if an 'infinite' loop occured
-		if ((topWin->ReturnCount() > KEmptyLoopThreshold) || (bottomWin->ReturnCount() > KEmptyLoopThreshold))
-			INFO_PRINTF1(KErrorMessage);
-
-	 	//get the color of a pixel within the invalid area that should be coloured 
-	 	//red if the window is redrawn correctly.
-	 	TPoint point =iWinPos + TPoint(30,30); 
-	 	TRgb colour;
-	 	TheClient->iScreen->GetPixel(colour,point);
-	 	TRgb expectedColour = KRgbRed;
-
-	 	if ((colour == expectedColour) && (topWin->ReturnCount() < KEmptyLoopThreshold) && (bottomWin->ReturnCount() < KEmptyLoopThreshold))
-	 		testStatus = ETrue;
-	 	
-	 	TEST(testStatus);
-	 	
-		CleanupStack::PopAndDestroy(2, bottomWin);
-		}
- 	}
-
-void CTRedrawStoring::DoPolygonRedrawTestSetL()
-	{
-	_LIT(KRedrawStoringPolygon0,"Test polygon redraw in opaque window");
-	_LIT(KRedrawStoringPolygon1,"Test polygon low priority redraw in opaque window");
-	_LIT(KRedrawStoringPolygon2,"Test polygon redraw in transparent window");
-	_LIT(KRedrawStoringPolygon3,"Test polygon low priority redraw in transparent window");
-	INFO_PRINTF1(KRedrawStoringPolygon0);
-	DoPolygonRedrawTestL(0,0);			// Polygon redraw in opaque window
-	INFO_PRINTF1(KRedrawStoringPolygon1);
-	DoPolygonRedrawTestL(0,1);			// Polygon low priority redraw in opaque window
-	INFO_PRINTF1(KRedrawStoringPolygon2);
-	DoPolygonRedrawTestL(1,0);			// Polygon redraw in transparent window
-	INFO_PRINTF1(KRedrawStoringPolygon3);
-	DoPolygonRedrawTestL(1,1);			// Polygon low priority redraw in transparent window
-	}
- 	
-void CTRedrawStoring::DoPolygonRedrawTestL(TInt aWindowMode, TInt aTestMode)
- 	{
-	//Used to place windows.
-	TInt gap = 5;
-	const TSize scrSize(TheClient->iScreen->SizeInPixels());
-	TheClient->iWs.SetBufferSizeL(640);
-
-	CPartialRedrawPolygonWin* polyTestWin = NULL;
-	if (aTestMode == 0)	//If polygon redraw test.
-		{
-		//Draw a green test window with a polygon in it.
-		polyTestWin = new (ELeave) CPartialRedrawPolygonWin();
-	 	CleanupStack::PushL(polyTestWin);
-	 	polyTestWin->ConstructL(*TheClient->iGroup);
-	 	polyTestWin->Init(aWindowMode, KRgbGreen);	//aWindowMode 0=opaque 1=transparent
-	 	polyTestWin->AssignGC(*TheClient->iGc);
-	 	polyTestWin->BaseWin()->SetShadowDisabled(ETrue);
-	 	polyTestWin->BaseWin()->SetShadowHeight(0);
-	 	polyTestWin->SetExt(TPoint(scrSize.iWidth-iWinSize.iWidth,0), iWinSize);
-	 	polyTestWin->Win()->Activate();
-	 	polyTestWin->DrawPartial();
-	 	TheClient->Flush();
-		}
-
-	//Draw a green base window with a polygon in it.
- 	CPartialRedrawPolygonWin* bottomWin = new (ELeave) CPartialRedrawPolygonWin();
- 	CleanupStack::PushL(bottomWin);
- 	bottomWin->ConstructL(*TheClient->iGroup);
- 	bottomWin->Init(aWindowMode, KRgbGreen);	//aWindowMode 0=opaque 1=transparent
- 	bottomWin->AssignGC(*TheClient->iGc);
- 	bottomWin->BaseWin()->SetShadowDisabled(ETrue);
- 	bottomWin->BaseWin()->SetShadowHeight(0);
- 	bottomWin->SetExt(TPoint(scrSize.iWidth-(2*iWinSize.iWidth)-gap,0), iWinSize);
- 	bottomWin->Win()->Activate();
- 	bottomWin->DrawPartial();
- 	TheClient->Flush();
-
-	//Draw an empty, blue transparent top window.
- 	CPartialRedrawEmptyWin* topWin = new (ELeave) CPartialRedrawEmptyWin();
- 	CleanupStack::PushL(topWin);
- 	topWin->ConstructL(*TheClient->iGroup);
- 	topWin->Init(KRgbBlue);
- 	topWin->AssignGC(*TheClient->iGc);
- 	topWin->BaseWin()->SetShadowDisabled(ETrue);
- 	topWin->BaseWin()->SetShadowHeight(0);
- 	topWin->SetExt(TPoint(scrSize.iWidth-(2*iWinSize.iWidth)-gap,0), iWinSize);
- 	topWin->Win()->Activate();		
- 	topWin->DrawPartial(TRect(TPoint(0,0), iWinSize));
-	TheClient->Flush();
-
-	if (aTestMode == 1)		//If polygon low priority redraw test.
-		{
-		//Clear all redraw stores.
-		TheClient->iWs.ClearAllRedrawStores();
-		TheClient->Flush();
-		TheClient->WaitForRedrawsToFinish();
-		}
-
-	//Hide the top window, so the bottom window will be redrawn.
-	topWin->SetVisible(EFalse);
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-
-	if (aTestMode==0)		//If polygon redraw test.
-		{
-		//Compare bottomWin against polyTestWin.
-		TEST(TheClient->iScreen->RectCompare(TRect(TPoint(scrSize.iWidth-2*iWinSize.iWidth-gap,0),iWinSize),TRect(TPoint(scrSize.iWidth-iWinSize.iWidth,0),iWinSize)));
-		CleanupStack::PopAndDestroy(3,polyTestWin);
-		}
-	else					//If polygon low priority redraw test.
-		{
-		//Test bottomWin has only called DoDraw once.
-		TEST(bottomWin->ReturnCount()==1);
-		if (bottomWin->ReturnCount()!=1)
-			{
-			_LIT(KLog,"Number of redraws of bottom window %d, 1 expected (windowMode %d)");
-			LOG_MESSAGE3(KLog,bottomWin->ReturnCount(),aWindowMode);
-			}
-		CleanupStack::PopAndDestroy(2,bottomWin);
-		}
-	}
-
-void CTRedrawStoring::DoRedrawOOMTestL()
-	{
-	_LIT(KFailedTestInfo,"Failure information: redrawCount=%d  failRate=%d");
-	_LIT(KCompletedTest,"OOM test started succeeding at failRate = %d");
-	const TInt KConsecutiveSuccessfulRedraws = 20;
-	
-	//draw a white test window
-	CRedrawRectWin* testWin = new (ELeave) CRedrawRectWin();
-	CleanupStack::PushL(testWin);
-	testWin->ConstructL(*TheClient->iGroup);
-	testWin->Init();
-	testWin->AssignGC(*TheClient->iGc);
-	testWin->BaseWin()->SetShadowDisabled(ETrue);
-	testWin->BaseWin()->SetShadowHeight(0);
-	testWin->SetExt(iWinPos+TPoint(0,0), iWinSize);
-	testWin->Win()->Activate();
-	testWin->DrawNow();
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	
-	TPoint pointTest = iWinPos + TPoint(30,30);
-	TRgb colourTest;
-	TRgb expectedColour = KRgbGreen;
-	TInt numberOfSuccessfulRedraws = 0;
-	TInt failRate = 1;
-	do
-		{
-		expectedColour=((expectedColour==KRgbGreen)?KRgbRed:KRgbGreen);
-		testWin->ResetWindow(expectedColour);
-		testWin->SetLogging(failRate<3?this:NULL);
-		testWin->Win()->Invalidate();
-		TheClient->iWs.HeapSetFail(RHeap::EDeterministic,failRate);
-		TheClient->WaitForRedrawsToFinish();
-		TheClient->iWs.HeapSetFail(RHeap::ENone,0);
-		TheClient->iScreen->GetPixel(colourTest,pointTest);
-		const TInt redrawCount = testWin->RedrawCount();
-
-		if (redrawCount>2)				//If DoDraw called too often:
-			{
-			TBool passed=(failRate<3 && redrawCount<9);		//For a failrate of 2 allow upto 8 redraws
-			TEST(passed);					//Fail.
-			LOG_MESSAGE3(KFailedTestInfo,redrawCount,failRate);
-			if (!passed)
-				{
-				CleanupStack::PopAndDestroy(testWin);
-				return;
-				}
-			}
-		else if (colourTest==expectedColour && redrawCount==1)	//If drawn correctly.
-			{
-		#if defined(LOGGING)
-			_LIT(KLog,"FailRate %d  Drawing Corect  RedrawCount %d");
-			LOG_MESSAGE3(KLog,failRate,redrawCount);
-		#endif
-			numberOfSuccessfulRedraws++;
-			}
-		else									//If not drawn.
-			{
-		#if defined(LOGGING)
-			_LIT(KLog,"FailRate %d  Drawing Wrong   RedrawCount %d");
-			LOG_MESSAGE3(KLog,failRate,redrawCount);
-		#endif
-			numberOfSuccessfulRedraws=0;
-			}
-		failRate++;
-		} while (numberOfSuccessfulRedraws<KConsecutiveSuccessfulRedraws);
-	LOG_MESSAGE2(KCompletedTest,(failRate-KConsecutiveSuccessfulRedraws-1));
-	CleanupStack::PopAndDestroy(testWin);
-	}
-
-void CTRedrawStoring::RedrawStoreWithBadRectL()
-	{
-	RWindow win(TheClient->iWs);
-	CleanupClosePushL(win);
-	User::LeaveIfError(win.Construct(*TheClient->iGroup->GroupWin(),ENullWsHandle));
-	win.SetRequiredDisplayMode(EColor64K);
-	TPoint winPos(270,70);
-	win.SetExtent(winPos, TSize(100,100));
-	win.SetBackgroundColor( KRgbRed );
-	win.Activate();
-	
-	TheGc->Activate(win);
-	win.BeginRedraw();
-	TheGc->SetBrushColor(KRgbGreen);
-	TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
- 	TheGc->DrawRect(TRect(0,0,100,40));
-	win.EndRedraw();
-		
-	win.BeginRedraw(TRect(10,20,20,0));
-	TheGc->SetBrushColor(KRgbBlue);
- 	TheGc->DrawRect(TRect(0,0,40,100));
-	win.EndRedraw();
-	
-	win.SetVisible(EFalse);
-	win.SetVisible(ETrue);
-   	TheGc->Deactivate();
-   	TheClient->Flush();
-   	
-	TRgb color;
-	TheClient->iScreen->GetPixel(color,winPos+TPoint(20,20));
-	TBool passed=(color==KRgbGreen);
-	TEST(passed);
-   	
-	CleanupStack::Pop(&win);
-	win.Close();
-	}
-
-
-/*CPartialRedrawEmptyWin*/
-
-void CPartialRedrawEmptyWin::Init(TRgb aColor)
-	{
-	Win()->SetRequiredDisplayMode(EColor16MA);
-	Win()->SetTransparencyAlphaChannel();
-	Win()->SetBackgroundColor(aColor);
-	iCount = 0;
-	}
-
-void CPartialRedrawEmptyWin::Draw()
-	{
-	DoDraw();
-	iCount++;
-	}
-
-void CPartialRedrawEmptyWin::DoDraw()
-	{
-	DrawFullWindowRect();
-	}
-
-void CPartialRedrawEmptyWin::DrawFullWindowRect()
-	{
-	// Only draw when we've looped too many times
-	if (ReturnCount() > KEmptyLoopThreshold)
-		{
-		TRect rect = TRect(TPoint(0,0),iSize);
-		iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-		iGc->SetBrushColor(KRgbBlack);
-		iGc->DrawRect(rect);
-		}
-	}
-
-void CPartialRedrawEmptyWin::DrawPartial(TRect aRect)
-	{
-	Invalidate(aRect);
-	Win()->BeginRedraw(aRect);
-	iGc->Activate(*Win());
-	DrawFullWindowRect();
-	iGc->Deactivate();
-	Win()->EndRedraw();
-	}
-
-inline TInt CPartialRedrawEmptyWin::ReturnCount()
-	{
-	return iCount;
-	}
-
-
-/*CPartialRedrawPolygonWin*/
-
-void CPartialRedrawPolygonWin::Init(TInt aWindowMode, TRgb aColor)
-	{
-	Win()->SetRequiredDisplayMode(EColor16MA);
-	if (aWindowMode == 1)
-		{
-		Win()->SetTransparencyAlphaChannel();
-		}
-	Win()->SetBackgroundColor(aColor);
-	iCount = 0;
-	}
-
-void CPartialRedrawPolygonWin::Draw()
-	{
-	DoDraw();
-	iCount++;
-	}
-
-void CPartialRedrawPolygonWin::DoDraw()
-	{
-	DrawFullWindowPolygonL();
-	}
-
-void CPartialRedrawPolygonWin::DrawFullWindowPolygonL()
-	{
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	iGc->SetBrushColor(KRgbBlack);
-	CArrayFixFlat<TPoint>* longPolygon = new CArrayFixFlat<TPoint>(84);
-	CleanupStack::PushL(longPolygon);
-	TInt forLoop = 0, loopValue = 0;
-	TInt tempX=18, tempY=49;
-	TPoint polygonPoint(tempX, tempY);
-	
-	//Create jagged line for the polygon
-	for (forLoop=0; forLoop<81; forLoop++)
-		{
-		tempX += 2;
-		if (loopValue==0)
-			{
-			tempY +=2;
-			loopValue = 1;
-			}
-		else
-			{
-			tempY -=2;
-			loopValue = 0;
-			}
-		polygonPoint.SetXY(tempX, tempY);
-		longPolygon->AppendL(polygonPoint);
-		}
-	polygonPoint.SetXY(tempX,70);
-	longPolygon->AppendL(polygonPoint);
-	polygonPoint.SetXY(20,70);
-	longPolygon->AppendL(polygonPoint);
-	iGc->DrawPolygon(longPolygon);
-	CleanupStack::PopAndDestroy(longPolygon);
-	}
-
-void CPartialRedrawPolygonWin::DrawPartial()
-	{
-	Invalidate();
-	Win()->BeginRedraw();
-	iGc->Activate(*Win());
-	DrawFullWindowPolygonL();
-	iGc->Deactivate();
-	Win()->EndRedraw();
-	}
-
-inline TInt CPartialRedrawPolygonWin::ReturnCount()
-	{
-	return iCount;
-	}
-
-
-/*CRedrawRectWin*/
-
-void CRedrawRectWin::Init()
-	{
-	Win()->SetRequiredDisplayMode(EColor16MA);
-	Win()->SetTransparencyAlphaChannel();
-	Win()->SetBackgroundColor(KRgbWhite);
-	iRedrawCount = 0;
-	iRectColour = KRgbGreen;
-	}
-
-void CRedrawRectWin::Draw()
-	{
-	DoDraw();
-	iRedrawCount++;
-	}
-
-void CRedrawRectWin::DoDraw()
-	{
-	DrawFullWindowRect();
-	}
-
-void CRedrawRectWin::DrawFullWindowRect()
-	{
-	TRect Rect(TPoint(10,10), TSize(30, 30));
-	Gc()->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	Gc()->SetBrushColor(iRectColour);
-	Gc()->SetPenStyle(CGraphicsContext::ESolidPen);
-	Gc()->SetPenColor(0);	
-	Gc()->DrawRect(Rect);
-	}
-
-void CRedrawRectWin::DrawNow()
-	{
-	Win()->Invalidate();
-	Win()->BeginRedraw();
-	Gc()->Activate(*Win());
-	DrawFullWindowRect();
-	Gc()->Deactivate();
-	Win()->EndRedraw();
-	}
-
-inline TInt CRedrawRectWin::RedrawCount()
-	{
-	return iRedrawCount;
-	}
-
-void CRedrawRectWin::ResetWindow(TRgb aColour)
-	{
-	iRectColour = aColour;
-	iRedrawCount = 0;
-	}
-
-inline void CRedrawRectWin::SetLogging(CTWsGraphicsBase* aTest)
-	{
-	iLog=aTest;
-	}
-
-void CRedrawRectWin::Redraw(const TRect& aRect)
-	{
-	if (iLog)
-		{
-		_LIT(KLog,"Redraw Count %d  Rect=(%d,%d,%d,%d)");
-		iLog->LOG_MESSAGE6(KLog,RedrawCount(),aRect.iTl.iX,aRect.iTl.iY,aRect.iBr.iX,aRect.iBr.iY);
-		}
-	CTWin::Redraw(aRect);
-	}
-
-
-//
-
-void CTRedrawStoring::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(KNormalDrawing,"Normal Draw Test");
-	_LIT(KFadeWindow1,"Fade Window1");
-	_LIT(KFadeWindow2,"Fade Window2");
-	_LIT(KRedrawQueue2,"Empty Redraw Queue");
-	_LIT(KDisableRedrawStore,"Disable redraw store");
-	_LIT(KResizeRedraws,"Redraw on Resize event");
-	_LIT(KFontCacheOverflow,"Font Cache Overflow test");
-	_LIT(KDrawBitmapMask,"Test DrawBitmapMasked");
-	_LIT(KInvisibleRedrawStore,"Test invisible window redraw storing");
-	_LIT(KBrushDraw,"Test UseBrushPattern storing");
-	_LIT(KInvisibleRedrawStoreTransparent,"Test invisible transparent window redraw storing");
-	_LIT(KPartialDrawNow,"Test partial DrawNow");
-	_LIT(KPartialDrawNowTransparent,"Test partial transparent DrawNow");
-	_LIT(KBeginEndRedraw,"Redraw in between Begin and EndRedraw");
-	_LIT(KRedrawStoreAlphaChannelTransparency,"Redraw store for Alpha Channel Transparency");
-	_LIT(KDrawBitBltAndMaskedNegTestsL,"Test BitBltMasked by passing Neg,UnExpected Values");
-	_LIT(KRedrawStoringExposeWindow,"Redraw Storing Window Exposed");
-	_LIT(KRedrawStoringExposeWindow2,"Redraw Storing Window behind Transparent Exposed");
-	_LIT(KAutoResetRedrawStore,"Test automatic redraw store reset");
-	_LIT(KRedrawStoreWithSetExtent,"Redraw store with set extent");
-	_LIT(KPartialRedrawWithEmptyRedrawStore,"Partial redraw with empty redraw store");
-	_LIT(KScrollingWin,"Test scrolling when partial redraw is enabled");
-	_LIT(KRedrawStoringEmptyDrawWindow0,"Empty window under redraw storing - full case");
-	_LIT(KRedrawStoringEmptyDrawWindow1,"Empty window under redraw storing - corner case");
-	_LIT(KRedrawOOMTest,"Testing OOM redraw");
-	_LIT(KRedrawWithBadRect, "Redraw storing when BeginRedraw with bad rect");
-	if (iState==0)
-		{
-		// Check to see if Transparency is enabled before running tests
-		if (TransparencySupportedL()==KErrNotSupported)
-			{
-			_LIT(KLog,"Transparency is not enabled");
-			LOG_MESSAGE(KLog);
-			TestComplete();
-			return;
-			}
-		}
-	TInt err=KErrNone;
-	//if (iTest->iState==1) iTest->iState=KLastDrawingCase+2;	//Set one less that the test you want to run
-	iState=++iTest->iState;
-	((CTRedrawStoringStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(iTest->iState)
-		{
-	case 6:
-		((CTRedrawStoringStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0086"));
-		// Special case handled seperately because unfading the 
-		// window requires a redraw
-		iTest->LogSubTest(KFadeWindow1);
-		FadeWindowTest();
-		break; 
-	case 12:
-		((CTRedrawStoringStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0087"));
-		iTest->LogSubTest(KFadeWindow2);
-		FadeWindowTest2L();
-		break;
-	case 14:
-		((CTRedrawStoringStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0090"));
-		iTest->LogSubTest(KRedrawQueue2);
-		DoNothingInRedrawTest();
-		break;
-	case 17:
-		((CTRedrawStoringStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0091"));
-		iTest->LogSubTest(KDisableRedrawStore);
-		DoDisableRedrawStoreTest();
-		break;
-	case 18:
-		((CTRedrawStoringStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0092"));
-		iTest->LogSubTest(KResizeRedraws);
-		DoResizeTest();
-		break;
-	case 22:
-/**
-	@SYMTestCaseID GRAPHICS-WSERV-0508
-*/
-		((CTRedrawStoringStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0508"));
-		iTest->LogSubTest(KBeginEndRedraw);
-		DoBeginEndRedraw();
-		break;
-	case 23:
-/**
-	@SYMTestCaseID GRAPHICS-WSERV-0509
-*/
-		((CTRedrawStoringStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0509"));
-		iTest->LogSubTest(KRedrawStoreAlphaChannelTransparency);
-		DoRedrawStoreAlphaChannelTransTest();
-		break;
-	case 24:
-/**
-	@SYMTestCaseID GRAPHICS-WSERV-0510
-*/
-		((CTRedrawStoringStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0510"));
-		iTest->LogSubTest(KScrollingWin);
-		ScrollWinTest();
-		break;
-	case KLastDrawingCase + 1:
-/**
-	@SYMTestCaseID GRAPHICS-WSERV-0511
-*/
-		((CTRedrawStoringStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0511"));
-		iTest->LogSubTest(KDrawBitmapMask);
-		TRAP(err,DoTestDrawBitmapMaskedL());
-		break;
-	case KLastDrawingCase + 2:
-
-		((CTRedrawStoringStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0511"));
-		iTest->LogSubTest(KDrawBitmapMask);
-		TRAP(err,DoTestDrawBitmapMaskedL(ETrue));
-		break;
-	case KLastDrawingCase + 3:
-/**
-	@SYMTestCaseID GRAPHICS-WSERV-0512
-*/
-		((CTRedrawStoringStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0512"));
-		iTest->LogSubTest(KFontCacheOverflow);
-		DoFontCacheOverflowTestL();
-		break;
-	case KLastDrawingCase + 4:
-		((CTRedrawStoringStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-00XX-0006"));
-		iTest->LogSubTest(KInvisibleRedrawStore);
-		TRAP(err,DoInvisibleRedrawStoreTestL( EFalse ));
-		break;
-	case KLastDrawingCase + 5:
-		((CTRedrawStoringStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-00XX-0006"));
-		iTest->LogSubTest(KInvisibleRedrawStoreTransparent);
-		TRAP(err,DoInvisibleRedrawStoreTestL( ETrue ));
-		break;
-	case KLastDrawingCase + 6:
-		((CTRedrawStoringStep*)iStep)->SetTestStepID(_L("GRAPHICS-CODEBASE-WSERV-0052-0001"));
-		iTest->LogSubTest(KDrawBitBltAndMaskedNegTestsL);
-		TRAP(err,DoBitBltAndMaskedNegTestsL());
-		break;
-	case KLastDrawingCase + 7:	
-/**
-	@SYMTestCaseID GRAPHICS-WSERV-0513
-*/
-		((CTRedrawStoringStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0513"));
-		iTest->LogSubTest(KPartialDrawNow);
-		TRAP(err,DoPartialDrawNowTestL(EFalse));
-		break;
-	case KLastDrawingCase + 8:
-/**
-	@SYMTestCaseID GRAPHICS-WSERV-0514
-*/
-		((CTRedrawStoringStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0514"));
-		iTest->LogSubTest(KPartialDrawNowTransparent);
-		TRAP(err,DoPartialDrawNowTestL(ETrue));
-		break;
-	case KLastDrawingCase + 9:
-/**
-	@SYMTestCaseID GRAPHICS-WSERV-0515
-*/
-		((CTRedrawStoringStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0515"));
-		TInt iteration;
-		for(iteration=0;iteration<3 && err==KErrNone;iteration++)
-			{
-			iTest->LogSubTest(KRedrawStoringExposeWindow);
-			TRAP(err,DoExposeTestL(iteration));
-			}
-		break;
-	case KLastDrawingCase + 10:
-		{
-/**
-	@SYMTestCaseID GRAPHICS-WSERV-0516
-*/
-		((CTRedrawStoringStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0516"));
-		TInt iteration;
-		for(iteration=0;iteration<2 && err==KErrNone;iteration++)
-			{
-			iTest->LogSubTest(KRedrawStoringExposeWindow2);
-			TRAP(err,DoExposeTest2L(iteration));
-			}
-		break;
-		}
-	case KLastDrawingCase + 11:
-		((CTRedrawStoringStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-		iTest->LogSubTest(KAutoResetRedrawStore);
-		AutoResetRedrawStoreTestsL();
-		break;
-	case KLastDrawingCase + 12:
-/**
-	@SYMTestCaseID GRAPHICS-WSERV-0517
-*/
-		((CTRedrawStoringStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0517"));
-		iTest->LogSubTest(KRedrawStoreWithSetExtent);
-		RedrawStoreWithSetExtentL();
-		break;
-	case KLastDrawingCase + 13:
-/**
-	@SYMTestCaseID GRAPHICS-WSERV-0518
-*/
-		((CTRedrawStoringStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0518"));
-		iTest->LogSubTest(KPartialRedrawWithEmptyRedrawStore);
-		PartialRedrawWithEmptyRedrawStoreL();
-		break;
-	case KLastDrawingCase + 14:
-	((CTRedrawStoringStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-103713-0001"));
-		iTest->LogSubTest(KRedrawStoringEmptyDrawWindow0);
-		TRAP(err,DoEmptyDrawTestL(0));	// Completely covered case
-		if (err!=KErrNone)
-			break;
-		iTest->LogSubTest(KRedrawStoringEmptyDrawWindow1);
-		TRAP(err,DoEmptyDrawTestL(1));	// Quarter covered case
-		break;
-
-/**
-@SYMTestCaseID				GRAPHICS-WSERV-0439
-
-@SYMDEF						DEF107817
-
-@SYMTestCaseDesc			Drawing polygons with many points panics WServ (redraw store enabled)
-
-@SYMTestPriority			Normal
-
-@SYMTestStatus				Implemented
-
-@SYMTestActions				Draw a polygon in opaque and transparent windows testing redraw and low priority redraw
-
-@SYMTestExpectedResults		Redraw tests display correctly, low priority redraw tests call DoDraw only once
-*/
-	case KLastDrawingCase + 15:
-	((CTRedrawStoringStep*)iStep)->SetTestStepID(_L("	GRAPHICS-WSERV-0439"));
-		TRAP(err,DoPolygonRedrawTestSetL());
-		break;
-
-/**
-@SYMTestCaseID				GRAPHICS-WSERV-0442
-
-@SYMDEF						DEF107984
-
-@SYMTestCaseDesc			OOM causing infinite redraw loop
-
-@SYMTestPriority			Normal
-
-@SYMTestStatus				Implemented
-
-@SYMTestActions				Redraw rectangles in OOM situations
-
-@SYMTestExpectedResults		There are no extended redraw loops
-*/
-	case KLastDrawingCase + 16:
-	    ((CTRedrawStoringStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0442"));
-		iTest->LogSubTest(KRedrawOOMTest);
-		TRAP(err,DoRedrawOOMTestL());
-		break;
-	case KLastDrawingCase + 17:
-/**
-	@SYMTestCaseID GRAPHICS-WSERV-0519
-*/
-		((CTRedrawStoringStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0519"));
-		iTest->LogSubTest(KRedrawWithBadRect);
-		TRAP(err,RedrawStoreWithBadRectL());
-		break;
-	case KLastDrawingCase + 18:
-		((CTRedrawStoringStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0498"));
-		iTest->LogSubTest(KBrushDraw);
-		TRAP(err,DoBrushDrawTestL());
-		break;
-	case KLastDrawingCase + 19:
-		((CTRedrawStoringStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-		((CTRedrawStoringStep*)iStep)->CloseTMSGraphicsStep();
-		TestComplete();
-		break; 
-	default:
-		iTest->LogSubTest(KNormalDrawing);
-		((CTRedrawStoringStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0085"));
-		DoDrawTest();
-		if (iDoScrollTest)
-			ScrollTest();
-		}
-	((CTRedrawStoringStep*)iStep)->RecordTestResultL();
-	if (err!=KErrNone)
-		{
-		TEST(EFalse);
-		_LIT(KLog,"Sub-Test[%d] left with error code %d");
-		LOG_MESSAGE3(KLog,iState,err);
-		}
-	}
-
-
-__WS_CONSTRUCT_STEP__(RedrawStoring)
--- a/windowing/windowserver/tauto/TREDRSTR.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,363 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TREDRSTR_H__
-#define __TREDRSTR_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-#include "TScreenModeScaling.h"
-
-
-class CRedrawStoreWin;
-class CNoDrawWin;
-class CBitmapMaskedWin;
-class CResetRedrawStoreWin;
-
-
-class CTRedrawStoring : public CTWsGraphicsBase
-	{
-public:
-	CTRedrawStoring(CTestStep* aStep);
-	~CTRedrawStoring();
-	void ConstructL();
-
-	void CheckWindowsMatch();
-	void CheckWindowsMatchLossy();
-	void CheckWindowsNotMatch();
-	void HideRevealTest();
-	void MultipleHideReveal(TInt aX,TInt aY);
-	void RedrawWindows();
-	void DoDrawingL(CWindowGc* aWinGc);
-	void DoDrawingL(TInt aDraw,CBitmapContext* aGc,TBool aWinGc);
-	void ScrollTest();
-	void FadeWindowTest();
-	void FadeWindowTest2L();
-	void DoDrawTest();
-	void DoScrollTest();
-	void SetScrolling(TPoint aScrollSource, TRect aScrollTarget);
-	//Pure Virtual Function from CTestBase
-	void DoNothingInRedrawTest();
-	void DoDisableRedrawStoreTest();
-	void DoBitBltAndMaskedNegTestsL();
-	void DoResizeTest();
-	void DoTestDrawBitmapMaskedL(TBool aWsBitmap=EFalse);
-	void DrawBitmapAndCheckL(const TSize aSize,TDisplayMode aDisplayMode,CFbsBitmap* aSrceBitmap,CFbsBitmap* aMaskBitmap,TBool aInvertMask);
-	void DoFontCacheOverflowTestL();
-	void FontCacheOverflowDrawingTestL(TBool aDiffGc, RWindow& aWindow);
-	void DoInvisibleRedrawStoreTestL( TBool aUseTransparency );
-	void DoBrushDrawTestL();
-	void DoPartialDrawNowTestL( TBool aUseTransparency );
-	void DoBeginEndRedraw();
-	void DoRedrawStoreAlphaChannelTransTest();
-
-	void DoExposeTestL(TInt aIteration);
-	void DoExposeTest2L(TInt aIteration);
-	void DoEmptyDrawTestL(TInt aTestMode);
-	void DoPolygonRedrawTestSetL();
-	void DoPolygonRedrawTestL(TInt aWindowMode, TInt aTestMode);
-	void DoRedrawOOMTestL();
-	void RedrawStoreWithBadRectL();
-protected:
-	virtual void RunTestCaseL(TInt aCurTestCase);
-	void DoAutoResetRedrawStoreTestL(TBool aTwoWins, TBool aAnimateBothWins, TBool aKeepGcActive, TBool aUpdateInRedraw);
-	void AutoResetRedrawStoreTestsL();
-	void RedrawStoreWithSetExtentL();
-	void PartialRedrawWithEmptyRedrawStoreL();
-	void DoPartialRedrawWithEmptyRedrawStoreL(TInt aNumWins, TBool aDoWinOnTop, TBool aRedrawWindow, TBool aChildWindows);
-	CResetRedrawStoreWin* CreatePartialRedrawWinLC(const TPoint& aPos, const TSize& aSize, CTWin* aParent=NULL);
-	CNoDrawWin* CreateNoDrawWinLC(const TPoint &aPos, const TSize &aSize);
-	void GetTestWinSizeAndPos(TInt aWinIndex, TPoint &aPos, TSize &aSize) const;
-	void ScrollWinTest();
-public:
-	TInt iDrawOrder;
-	TBool iQueueTest;
-
-private:
-	enum TDrawingMode
-		{
-		EServerRedraw,
-		EClientRedrawsNormal,
-		EClientRedrawsScrolled,
-		};
-	TPoint ComputeTextPosition(TPoint aPoint);
-	CTBackedUpWin* iCheckWin;
-	CFbsBitmap* iCheckBitmap;
-	CFbsBitmapDevice* iCheckDevice;
-	CFbsBitGc* iCheckGc;
-	CRedrawStoreWin* iTestWin;
-	TSize iWinSize;
-	TPoint iWinPos;
-	TDrawingMode iDrawMode;
-	RBlankWindow iBlankWin;
-	RRegion iRegion;
-	RWindow iWinTestGc;
-	TBool iWindowsFaded;
-	TRect iScrollTarget;
-	TPoint iScrollSource;
-	TBool iDoScrollTest;
-	CNoDrawWin* iNoDrawWin;
-	TBool iClientDidDraw;
-	CWsBitmap* iAlphaBitmap[3];
-	TBool iAlphaSupported;
-	CBitmapMaskedWin* iBitmapMaskedWin;
-	CBitmap* iTestBitmap;
-	CBitMapWin* iTestBitmapWin;
-	TRect iWinRect;
-	TPoint iTestWinPoint;
-	TBool iXPlus;
-	TBool iYPlus;
-	TInt iState;
-	TInt iYPoz;
-	TDisplayMode iTestDisplayMode;
-	CFbsBitmap *iTestWinCopy;
-	CFbsBitmap *iCheckWinCopy;
-	};
-
-class CRedrawStoreWin : public CTWin
-	{
-public:
-	inline CRedrawStoreWin(CTRedrawStoring* aTest) : iDrawOrder(0), iTest(aTest){}
-	//Virtual Function from CTBaseWin
-	void Draw();
-public:
-	TInt iDrawOrder;
-private:
-	CTRedrawStoring *iTest;
-	};
-
-class CNoDrawWin : public CTWin
-	{
-public:
-	void Draw();
-	};
-
-class CBrushDrawWin : public CTWin
-	{
-public:
-	CBrushDrawWin();
-	void Draw();
-	void Redraw();
-
-private:
-	};
-
-class CBitmapMaskedWin : public CTWin
-	{
-public:
-	static CBitmapMaskedWin* NewL(CFbsBitmap* aFbsBitmap,CFbsBitmap* aFbsMaskBitmap,
-								  CWsBitmap* aWsBitmap,CWsBitmap* aWsMaskBitmap,
-								  TRgb aBackground,TRect aRect,TBool aInvertMask,TBool aWsFbs);
-	~CBitmapMaskedWin();
-	//Virtual Function from CTBaseWin
-	void Draw();
-	void SetDestRectSize(const TSize aSize);
-	inline void SetInvertMask(TBool aInvertMask){iInvertMask=aInvertMask;}
-private:
-	inline CBitmapMaskedWin(CFbsBitmap* aFbsBitmap,CFbsBitmap* aFbsMaskBitmap,CWsBitmap* aWsBitmap,CWsBitmap* aWsMaskBitmap,
-							TRect aRect,TBool aInvertMask,TBool aWsFbs):
-							iFbsBitmap(aFbsBitmap),iFbsMaskBitmap(aFbsMaskBitmap),
-							iWsBitmap(aWsBitmap),iWsMaskBitmap(aWsMaskBitmap),
-							iRect(aRect),iInvertMask(aInvertMask),iWsFbs(aWsFbs) {}
-private:
-	CFbsBitmap* iFbsBitmap;
-	CFbsBitmap* iFbsMaskBitmap;
-	CWsBitmap* iWsBitmap;
-	CWsBitmap* iWsMaskBitmap;
-	TRect iRect;
-	TBool iInvertMask;
-	TBool iWsFbs;
-	};
-
-class CPartialRedrawWin : public CTWin
-	{
-public:
-	void Init();
-	virtual void Draw();
-	void DrawToBmp(CGraphicsContext& aGc);
-	void DrawPartial(TPartialRedrawType aPartialRedrawType);
-	static void DrawRects(CGraphicsContext& aGc, TSize aSize, TPoint aPosition,
-		TBool aIsFullRedraw, TPartialRedrawType aPartialRedrawType);
-	void RedrawSubRectWithBitmapL(TRgb aBitmapColour);
-public:
-	TBool iClientDrawn;
-	TBool iClientCanDraw;
-private:
-	void DoDraw(CGraphicsContext& aGc);
-private:
-	};
-
-class CPartialRedrawBottomWin : public CTWin
-	{
-public:
-	void Init();
-	virtual void Draw();
-	void DrawPartial(TRect aRect);
-	void DrawFullWindowRect();
-private:
-	void DoDraw();
-	};
-	
-class CPartialRedrawTopWin : public CTWin
-	{
-public:
-	void Init();
-	virtual void Draw();
-	void DrawPartial(TRect aRect);
-	void DrawFullWindowRect();
-private:
-	void DoDraw();
-	};
-	
-class CPartialRedrawTiledWin : public CTWin
-	{
-public:
-	void Init(TRgb aColour,TBool aTransparent);
-	virtual void Draw();
-	void DrawPartial(TRect aRect);
-	void DrawFullWindowRect();
-private:
-	void DoDraw();
-private:
-	TRgb iColour;
-	};
-	
-class CInvisibleRedrawWin: public CTWin
-	{
-public:
-	CInvisibleRedrawWin();
-	TInt MakeTransparent();
-	void MakeVisible( TBool aVisible );
-	virtual void Redraw();
-	virtual void Redraw( const TRect &aRect );
-
-private:
-	void DrawIfVisible();
-
-private:
-	TBool iVisible;
-	TBool iTransparent;
-	};
-
-class CPartialDrawNowWin: public CTWin
-	{
-public:
-	CPartialDrawNowWin();
-	TInt MakeTransparent();
-	void SetLodger( const TRect &aLodger );
-	virtual void Redraw();
-	virtual void Redraw( const TRect &aRect );
-
-private:
-	void DrawWindowAndLodger();
-
-private:
-	TRect iLodger;
-	TBool iTransparent;
-	};
-
-class CPartialRedrawEmptyWin : public CTWin
-	{
-public:
-	void Init(TRgb aColor);
-	virtual void Draw();
-	void DrawPartial(TRect aRect);
-	void DrawFullWindowRect();
-	inline TInt ReturnCount();
-private:
-	void DoDraw();
-	TInt iCount;
-	};
-
-class CPartialRedrawPolygonWin : public CTWin
-	{
-public:
-	void Init(TInt aWindowMode, TRgb aColor);
-	virtual void Draw();
-	void DrawPartial();
-	void DrawFullWindowPolygonL();
-	inline TInt ReturnCount();
-private:
-	void DoDraw();
-	TInt iCount;
-	};
-
-class CRedrawRectWin : public CTWin
-	{
-public:
-	void Init();
-	void DrawNow();
-	void DrawFullWindowRect();
-	inline TInt RedrawCount();
-	void ResetWindow(TRgb aColour);
-	inline void SetLogging(CTWsGraphicsBase* aTest);
-	//Virtual function from CTBaseWin
-	void Draw();
-	//Virtual function from CTWin
-	void Redraw(const TRect& aRect);
-private:
-	void DoDraw();
-private:
-	TInt iRedrawCount;
-	TRgb iRectColour;
-	CTWsGraphicsBase* iLog;
-	};
-
-class CTRedrawStoringStep : public CTGraphicsStep
-	{
-public:
-	CTRedrawStoringStep();
-protected:
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-class CResetRedrawStoreWin : public CPartialRedrawWin
-	{
-public:
-	~CResetRedrawStoreWin();
-	void SetUpdateInRedraw(TBool aUpdateInRedraw);
-	void SetKeepGcActive(TBool aState);
-	void UpdateAnim(TInt aSteps);
-	void PreSetSize(const TSize &aSize);
-	TBool Failed() const;
-private:
-	virtual void Draw();
-	void DoDraw(CGraphicsContext& aGc) const;
-	void DoDrawAnim(CGraphicsContext& aGc) const;
-	TRect AnimRect() const;
-private:
-	TInt iAnimState;
-	TBool iKeepGcActive;
-	TBool iUpdateInRedraw;
-	TBool iFailed;
-	CWindowGc* iExtraGc;
-	};
-
-const TInt KEmptyLoopThreshold = 3;
-
-_LIT(KTRedrawStoringStep,"TRedrawStoring");
-
-
-#endif
--- a/windowing/windowserver/tauto/TRegion.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TREGION_H__
-#define __TREGION_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include <bitstd.h>
-#include "TGraphicsHarness.h"
-
-class CTRegion : public CTWsGraphicsBase
-	{
-public:
-	CTRegion(CTestStep* aStep);
-	~CTRegion();
-	void ConstructL();
-
-protected:
-	virtual void RunTestCaseL(TInt aCurTestCase);
-	
-private:
-	void DrawNonClippedSample1(CTWin *aDrawable, const TPoint &aOrigin);
-	void DrawNonClippedSample1(CTWin *aDrawable, const TRegion &aRegion, const TPoint &aOrigin);
-	void DrawClippedSample1(TestWindow *aDrawable, const TRegion &aRegion, const TRect &aClippingRect, const TPoint &aOrigin);
-	void DrawNonClippedSample2(CTWin *aDrawable, const TPoint &aOrigin);
-	void DrawNonClippedSample2(CTWin *aDrawable, const TRegion &aRegion, const TPoint &aOrigin);
-	void DrawClippedSample2(TestWindow *aDrawable, const TRegion &aRegion, const TRect &aClippingRect, const TPoint &aOrigin);
-	void DrawClippedSample3(CBitmapContext &aGc);
-	void DrawNonClippedSample1(CBitmapContext &aGc);
-	void DrawClippedSample1(CBitmapContext &aGc);
-	void DrawNonClippedSample2(CBitmapContext &aGc, CFont *aFont);
-	void DrawClippedSample2(CBitmapContext &aGc, CFont *aFont);
-	void TestRegionL(const TRegion &aClippingRegion, const TRect &aClippingRect, const TPoint &aOrigin);
-	void ScrollBugL();
-	void ExposeTestL();
-	void ExposeTest2L();
-	void CoverTestL();
-	void OffsetTestL();
-	void ClipTestL();
-	void CreateChildWindowsL();
-	void DeleteChildWindows();
-	void ClearBitmapAndWindows();
-	void CompareRectsL(TPoint aTl1,TPoint aTl2,TSize aSize);
-
-private:
-	CFbsFont *iFont;
-	CFbsFont *iBitFont;
-	CFbsBitmap iPicture;
-	CFbsBitmapDevice *iBitmapDevice;
-	CWsBitmap *iBitmap;
-	CFbsBitGc *iBitGc;
-	TSize iDrawableSize;
-	CBlankWindow *iBaseChildWin;
-	CBlankWindow *iTestChildWin;
-	};
-
-class CTRegionStep : public CTGraphicsStep
-	{
-public:
-	CTRegionStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTRegionStep,"TRegion");
-
-
-#endif
--- a/windowing/windowserver/tauto/TRegion.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,854 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Code for testing CWindowGc::SetCurrentRegion
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TRegion.H"
-
-TBool RegionCanFade;
-TBool RegionCanFadeSet;
-
-LOCAL_D TBuf<0x10> text=_L("SOME TEXT");
-LOCAL_D TPoint textRefPos(210, 80);
-
-LOCAL_D TRect regionRectList[]={
-					TRect(0,0,0,0),	TRect(30,10,70,40),TRect(60,30,80,70),TRect(10,110,70,170),
-					TRect(190,0,240,60),TRect(62,63,67,115),TRect(0,180,240,200),TRect(40,50,210,130),
-					TRect(160,130,190,160),TRect(100,140,140,170),TRect(140,170,100,140),TRect(90,120,230,200)};
-LOCAL_D TRect clippingRectList[]={
-					TRect(0,0,200,400),	TRect(30,10,500,600),TRect(-60,0,80,70),TRect(20,0,170,500),
-					TRect(0,0,2000,6000),TRect(-1000,-2000,123,195),TRect(10,10,230,190),TRect(0,0,510,730),
-					TRect(110,30,190,150),TRect(1,1,500,11170),TRect(0,0,800,940),TRect(-10,-20,240,210)};
-LOCAL_D TPoint originList[]={
-					TPoint(0,0),TPoint(10,0),TPoint(0,10),TPoint(-5,-20),
-					TPoint(1,1),TPoint(0,0),TPoint(0,0),TPoint(100,0),
-					TPoint(0,111),TPoint(90,40),TPoint(0,0),TPoint(-1,0)};
-
-CTRegion::CTRegion(CTestStep* aStep) : CTWsGraphicsBase(aStep)
-	{
-	}
-
-void CTRegion::ConstructL()
-	{
-	iDrawableSize=TestWin->Size();
-//
-	User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInTwips((CFont *&)iFont,TFontSpec(_L("Arial"),200)));
-  	User::LeaveIfError(iPicture.Load(TEST_BITMAP_NAME,0));
-  
-	iBitmap = new (ELeave) CWsBitmap(TheClient->iWs);
-	User::LeaveIfError(iBitmap->Create(TSize(iDrawableSize.iWidth+1,iDrawableSize.iHeight),EGray16));
-	iBitmap->SetSizeInTwips(TheClient->iScreen);
-	iBitmapDevice=CFbsBitmapDevice::NewL(iBitmap);
-	User::LeaveIfError(iBitmapDevice->CreateContext(iBitGc));
-	User::LeaveIfError(iBitmapDevice->GetNearestFontToDesignHeightInTwips((CFont *&)iBitFont,TFontSpec(_L("Arial"),200)));
-	}
-
-CTRegion::~CTRegion()
-	{
-	delete iBitGc;
-	TheClient->iScreen->ReleaseFont(iFont);
-	if (iBitmapDevice)
-		iBitmapDevice->ReleaseFont(iBitFont);
-	delete iBitmapDevice;
-	DeleteChildWindows();
-	delete iBitmap;
-	}
-
-void CTRegion::CreateChildWindowsL()
-	{
-	TSize screenSize=TheClient->iGroup->Size();
-	TInt winWidth=(screenSize.iWidth/3)-10;
-	TInt winHeight=screenSize.iHeight-10;
-	iBaseChildWin=new(ELeave) CBlankWindow();
-	iBaseChildWin->SetUpL(BaseWin->Win()->InquireOffset(*TheClient->iGroup->GroupWin())+TPoint(winWidth>>2,winHeight>>2),TSize(winWidth>>2,winHeight>>1),TheClient->iGroup,*TheClient->iGc);
-	iBaseChildWin->Win()->SetShadowHeight(2);
-	iTestChildWin=new(ELeave) CBlankWindow();
-	iTestChildWin->SetUpL(TestWin->Win()->InquireOffset(*TheClient->iGroup->GroupWin())+TPoint(winWidth>>2,winHeight>>2),TSize(winWidth>>2,winHeight>>1),TheClient->iGroup,*TheClient->iGc);
-	}
-
-void CTRegion::DeleteChildWindows()
-	{
-	delete iBaseChildWin;
-	iBaseChildWin=NULL;
-	delete iTestChildWin;
-	iTestChildWin=NULL;
-	}
-
-void CTRegion::DrawNonClippedSample1(CBitmapContext &aGc)
-	{
-	aGc.SetPenColor(TRgb::Gray4(0));
-	aGc.SetBrushColor(TRgb::Gray4(2));
-	aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
-	aGc.DrawRect(TRect(TPoint(30,100), TPoint(120,200)));
-	TheClient->iWs.Flush();
-	}
-
-void CTRegion::DrawClippedSample1(CBitmapContext &aGc)
-	{
-	aGc.SetPenColor(TRgb::Gray4(0));
-	aGc.SetBrushColor(TRgb::Gray4(1));
-	aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
-	aGc.DrawRect(TRect(TSize(100,200)));
-
-//	aGc.BitBlt(TPoint(55,65), iPicture);
-
-	aGc.SetPenStyle(CGraphicsContext::ENullPen);
-	aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
-	aGc.SetBrushColor(TRgb::Gray4(2));
-	aGc.DrawEllipse(TRect(TPoint(20,35), TPoint(90,79)));
-
-	aGc.SetBrushColor(TRgb::Gray4(0));
-	aGc.DrawEllipse(TRect(TPoint(110,110), TPoint(175,200)));
-
-	aGc.SetBrushColor(TRgb::Gray4(1));
-	aGc.DrawEllipse(TRect(TPoint(170,30), TPoint(220,150)));
-
-	aGc.SetBrushColor(TRgb::Gray4(3));
-	aGc.DrawEllipse(TRect(TPoint(0,150), TPoint(240,190)));
-
-	aGc.SetPenStyle(CGraphicsContext::ESolidPen);
-	aGc.SetBrushStyle(CGraphicsContext::ENullBrush);
-
-	TheClient->iWs.Flush();
-	}
-
-void CTRegion::DrawNonClippedSample2(CBitmapContext &aGc, CFont *aFont)
-	{
-	aGc.SetPenColor(TRgb::Gray4(0));
-	aGc.SetPenColor(TRgb::Gray4(0));
-	aGc.UseFont(aFont);
-	TPoint textPos=textRefPos-TPoint(iFont->TextWidthInPixels(text)*3/4, 0);
-	aGc.DrawText(text, textPos);
-	aGc.DiscardFont();
-
-	TheClient->iWs.Flush();
-	}
-
-void CTRegion::DrawClippedSample2(CBitmapContext &aGc, CFont *aFont)
-	{
-	aGc.SetPenColor(TRgb::Gray4(0));
-	aGc.SetPenColor(TRgb::Gray4(2));
-	aGc.UseFont(aFont);
-	TPoint textPos=textRefPos-TPoint(iFont->TextWidthInPixels(text)*3/4, -20);
-	aGc.DrawText(text, textPos);
-	aGc.DiscardFont();
-	aGc.SetBrushColor(TRgb::Gray4(3));
-	aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
-	aGc.DrawRect(TRect(TPoint(10,100), TPoint(210,120)));
-	TheClient->iWs.Flush();
-	}
-
-void CTRegion::DrawClippedSample3(CBitmapContext &aGc)
-	{
-	aGc.SetPenColor(TRgb::Gray4(0));
-	aGc.SetPenColor(TRgb::Gray4(2));
-	aGc.DrawRect(TRect(TPoint(10,200), TPoint(20,210)));
-	}
-
-void CTRegion::DrawNonClippedSample1(CTWin *aWindow, const TPoint &aOrigin)
-	{
-	TheGc->Activate(*aWindow->Win());
-	TheGc->SetOrigin(aOrigin);
-	DrawNonClippedSample1(*TheGc);
-	TheGc->Deactivate();
-	}
-
-void CTRegion::DrawNonClippedSample1(CTWin *aWindow, const TRegion &aRegion, const TPoint &aOrigin)
-	{
-	TheGc->Activate(*aWindow->Win());
-	TheGc->SetOrigin(aOrigin);
-	TheGc->SetClippingRegion(aRegion);
-	DrawNonClippedSample1(*TheGc);
-	TheGc->Deactivate();
-	}
-
-void CTRegion::DrawClippedSample1(TestWindow *aWindow, const TRegion &aRegion, const TRect &aClippingRect, const TPoint &aOrigin)
-	{
-	TheGc->Activate(*aWindow->Win());
-	TheGc->SetOrigin(aOrigin);
-	TheGc->SetClippingRegion(aRegion);
-	TheGc->SetClippingRect(aClippingRect);
-	DrawClippedSample1(*TheGc);
-	TheGc->Deactivate();
-	}
-
-void CTRegion::DrawNonClippedSample2(CTWin *aWindow, const TPoint &aOrigin)
-	{
-	TheGc->Activate(*aWindow->Win());
-	TheGc->SetOrigin(aOrigin);
-	DrawNonClippedSample2(*TheGc,iFont);
-	TheGc->Deactivate();
-	}
-
-void CTRegion::DrawNonClippedSample2(CTWin *aWindow, const TRegion &aRegion, const TPoint &aOrigin)
-	{
-	TheGc->Activate(*aWindow->Win());
-	TheGc->SetOrigin(aOrigin);
-	TheGc->SetClippingRegion(aRegion);
-	DrawNonClippedSample2(*TheGc,iFont);
-	TheGc->Deactivate();
-	}
-
-void CTRegion::DrawClippedSample2(TestWindow *aWindow, const TRegion &aRegion, const TRect &aClippingRect, const TPoint &aOrigin)
-	{
-	TheGc->Activate(*aWindow->Win());
-	TheGc->SetClippingRegion(TRegionFix<1>());
-	DrawClippedSample3(*TheGc);	// needed to trigger region update in wserv
-	TheGc->SetOrigin(aOrigin);
-	TheGc->SetClippingRect(aClippingRect);
-	TheGc->SetClippingRegion(aRegion);
-	DrawClippedSample2(*TheGc,iFont);
-	TheGc->CancelClippingRegion();
-	TheGc->Deactivate();
-	}
-
-void CTRegion::ClearBitmapAndWindows()
-	{
-	TestWin->Win()->Invalidate();
-	TestWin->Win()->BeginRedraw();
-	TheGc->Activate(*TestWin->Win());
-	TheGc->SetBrushColor(TRgb::Gray4(3));
-	TheGc->Clear();
-	TheGc->Deactivate();
-	TestWin->Win()->EndRedraw();
-//
-	BaseWin->Win()->Invalidate();
-	BaseWin->Win()->BeginRedraw();
-	TheGc->Activate(*BaseWin->Win());
-	TheGc->SetBrushColor(TRgb::Gray4(3));
-	TheGc->Clear();
-	TheGc->Deactivate();
-	BaseWin->Win()->EndRedraw();
-//
-	iBitGc->SetBrushColor(TRgb::Gray4(3));
-	iBitGc->Clear();
-	TheClient->iWs.Flush();
-	}
-
-void CTRegion::TestRegionL(const TRegion &aClippingRegion, const TRect &aClippingRect, const TPoint &aOrigin)
-	{
-	if (aClippingRegion.CheckError())
-		User::Leave(KErrGeneral);
-	ClearBitmapAndWindows();
-
-	// draw to iWindow1 (clipping intermittently) and iBitmap (not clipping)
-	DrawNonClippedSample1(TestWin,aOrigin);
-	DrawNonClippedSample1(*iBitGc);
-
-	DrawNonClippedSample2(TestWin,aOrigin);
-	DrawNonClippedSample2(*iBitGc, iBitFont);
-
-	DrawClippedSample1(TestWin,aClippingRegion,aClippingRect,aOrigin);
-	DrawClippedSample1(*iBitGc);
-
-	DrawClippedSample2(TestWin,aClippingRegion,aClippingRect,aOrigin);
-	DrawClippedSample2(*iBitGc, iBitFont);
-
-	// copy each rectangle of the clipping region from iBitmap to iWindow2
-	TheGc->Activate(*BaseWin->Win());
-	for (TUint i=0; i<(TUint)aClippingRegion.Count(); i++)
-		{
-		TRect rect=aClippingRegion.RectangleList()[i];
-		rect.Intersection(aClippingRect);
-		TheGc->SetOrigin(aOrigin);
-		TheGc->BitBlt(rect.iTl, iBitmap, rect);
-		TheClient->Flush();
-		}
-	TheGc->Deactivate();
-
-	// draw the non-clipped samples to everywhere in iWindow2 *except* the clipping region
-	RRegion inverseClippingRegion(TRect(-aOrigin,iDrawableSize));
-	RRegion clip;
-	clip.Copy(aClippingRegion);
-	clip.ClipRect(aClippingRect);
-	inverseClippingRegion.SubRegion(clip);
-	clip.Close();
-	DrawNonClippedSample1(BaseWin,inverseClippingRegion,aOrigin);
-	DrawNonClippedSample2(BaseWin,inverseClippingRegion,aOrigin);
-	inverseClippingRegion.Close();
-	CompareWindows(_L("CTRegion::TestRegionL"));
-	}
-
-void CTRegion::CompareRectsL(TPoint aTl1,TPoint aTl2,TSize aSize)
-	{
-	_LIT(KError,"Pixels Differ: (%d,%d),(%d,%d)");
-	CFbsScreenDevice* device;
-	device=CFbsScreenDevice::NewL(KNullDesC,iBaseChildWin->BaseWin()->DisplayMode());
-	TPoint br=aTl1+aSize;
-	TInt startX1=aTl1.iX;
-	TInt startX2=aTl2.iX;
-	TSize pixelSize(1,1);
-	TPoint zero;
-	while(aTl1.iY<br.iY+1)
-		{
-		while (aTl1.iX<br.iX+1)
-			{
-			if (!device->RectCompare(TRect(aTl1,pixelSize),*device,TRect(aTl2,pixelSize)))
-				{
-				RDebug::Print(KError,aTl1.iX,aTl1.iY,aTl2.iX,aTl2.iY);
-				iTest->LogColors(*device,zero,aTl1,aTl1);
-				iTest->LogColors(*device,zero,aTl2,aTl2);
-				}
-			++aTl1.iX;
-			++aTl2.iX;
-			}
-		aTl1.iX=startX1;
-		aTl2.iX=startX2;
-		++aTl1.iY;
-		++aTl2.iY;
-		}
-	}
-
-void CTRegion::ScrollBugL()
-	{
-	CBlankWindow* testWin;
-	RBlankWindow win(TheClient->iWs);
-	CleanupClosePushL(win);
-	TSize screenSize=TheClient->iGroup->Size();
-	testWin=new(ELeave) CBlankWindow(TRgb::Gray4(0));
-	CleanupStack::PushL(testWin);
-	//testWin->ConstructL(*TheClient->iGroup);
-	testWin->SetUpL(TPoint(screenSize.iWidth/3,0),TSize(screenSize.iWidth/3,screenSize.iHeight),TheClient->iGroup,*TheGc);
-	//testWin->Win()->SetBackgroundColor(TRgb::Gray2(1));
-	testWin->Win()->EnableRedrawStore(EFalse);
-	testWin->SetColor(TRgb::Gray4(1));
-	testWin->RealDraw(ETrue);
-	win.Construct(*TheClient->iGroup->WinTreeNode(),3456);
-	win.SetColor(TRgb::Gray4(2));
-	win.SetExtent(TPoint(screenSize.iWidth/3+30,20),TSize(screenSize.iWidth/3-62,25));
-	win.Activate();
-	TheClient->iWs.Flush();
-	TheClient->WaitForRedrawsToFinish();
-	win.SetVisible(EFalse);
-	TheClient->iWs.Flush();
-	testWin->Win()->BeginRedraw();
-	testWin->DrawNow();
-	testWin->SetColor(TRgb::Gray4(2));
-	testWin->Win()->Scroll(TPoint(0,-50));
-	testWin->DrawNow();
-	testWin->Win()->EndRedraw();
-	TheClient->iWs.Flush();
-	TBool retVal = TheClient->iScreen->RectCompare(TRect(TPoint(screenSize.iWidth/3,0),TSize(screenSize.iWidth/3,screenSize.iHeight/2-30))
-							,TRect(TPoint(screenSize.iWidth/3,screenSize.iHeight/2-30),TSize(screenSize.iWidth/3,screenSize.iHeight/2-30)));
-	TEST(retVal);
-	if (!retVal)
-		INFO_PRINTF3(_L("TheClient->iScreen->RectCompare() return value  - Expected: %d, Actual: %d"), ETrue, retVal);		
-															
-	retVal = !TheClient->iScreen->RectCompare(TRect(TPoint(screenSize.iWidth/3,screenSize.iHeight-60),TSize(10,10))
-							,TRect(TPoint(screenSize.iWidth/3,screenSize.iHeight-50),TSize(10,10)));
-	TEST(retVal);
-	if (!retVal)
-		INFO_PRINTF3(_L("!TheClient->iScreen->RectCompare() return value  - Expected: %d, Actual: %d"), ETrue, retVal);		
-
-	TheClient->WaitForRedrawsToFinish();
-	win.SetVisible(ETrue);
-	win.SetVisible(EFalse);
-	testWin->Win()->BeginRedraw();
-	testWin->Win()->Scroll(TPoint(0,-50));
-	testWin->SetColor(TRgb::Gray4(1));
-	testWin->DrawNow();
-	testWin->Win()->EndRedraw();
-	TheClient->iWs.Flush();	
-	retVal = TheClient->iScreen->RectCompare(TRect(TPoint(screenSize.iWidth/3+35,0),TSize(screenSize.iWidth/6-35,100))
-							,TRect(TPoint(screenSize.iWidth/2,0),TSize(screenSize.iWidth/6-35,100)));
-	TEST(retVal);
-	if (!retVal)
-		INFO_PRINTF3(_L("TheClient->iScreen->RectCompare() return value  - Expected: %d, Actual: %d"), ETrue, retVal);		
-																			
-	retVal = !TheClient->iScreen->RectCompare(TRect(TPoint(screenSize.iWidth/3+30,20),TSize(10,10))
-							,TRect(TPoint(screenSize.iWidth/3+30,50),TSize(10,10)));
-	TEST(retVal);
-	if (!retVal)
-		INFO_PRINTF3(_L("!TheClient->iScreen->RectCompare() return value  - Expected: %d, Actual: %d"), ETrue, retVal);		
-
-	TheClient->WaitForRedrawsToFinish();
-	testWin->Win()->BeginRedraw();
-	testWin->DrawNow();
-	testWin->Win()->EndRedraw();
-	CleanupStack::PopAndDestroy(2,&win);
-	}
-
-void CTRegion::ExposeTestL()
-	{
-	CBlankWindow* testWin;
-	TSize screenSize=TheClient->iGroup->Size();
-	TRect topHalf(0,0,screenSize.iWidth/3,screenSize.iHeight/2);
-	TRect leftHalf(0,0,screenSize.iWidth/6,screenSize.iHeight);
-	testWin=new(ELeave) CBlankWindow(TRgb::Gray4(0));
-	CleanupStack::PushL(testWin);
-	testWin->SetUpL(TPoint(screenSize.iWidth/3,0),TSize(screenSize.iWidth/3,screenSize.iHeight),TheClient->iGroup,*TheGc);
-	testWin->Win()->EnableRedrawStore(EFalse);
-	testWin->SetColor(TRgb::Gray4(2));
-	testWin->RealDraw(ETrue);
-	TheClient->iWs.Flush();
-	TheClient->WaitForRedrawsToFinish();
-	testWin->Win()->BeginRedraw();
-	testWin->DrawNow();
-	testWin->Win()->Invalidate(topHalf);
-	testWin->SetColor(TRgb::Gray4(1));
-	testWin->DrawNow();
-	testWin->Win()->EndRedraw();
-	TheClient->iWs.Flush();
-	CheckRectNoMatch(TPoint(screenSize.iWidth/3,0),TPoint(screenSize.iWidth/3,screenSize.iHeight/2),TSize(10,10),_L("CTRegion::ExposeTestL() A"));
-
-	TheClient->WaitForRedrawsToFinish();
-	CheckRect(TPoint(screenSize.iWidth/3,0),TPoint(screenSize.iWidth/3,screenSize.iHeight/2),TSize(screenSize.iWidth/3,screenSize.iHeight/2),_L("CTRegion::ExposeTestL() B"));
-
-	testWin->Win()->Invalidate(topHalf);
-	testWin->SetColor(TRgb::Gray4(2));
-	testWin->Win()->BeginRedraw();
-	testWin->Win()->Invalidate(leftHalf);
-	testWin->DrawNow();
-	testWin->Win()->EndRedraw();
-	TheClient->iWs.Flush();
-	CheckRect(TPoint(screenSize.iWidth/3,0),TPoint(screenSize.iWidth/3,screenSize.iHeight/2),TSize(screenSize.iWidth/6-10,screenSize.iHeight/2),_L("CTRegion::ExposeTestL() C"));
-	CheckRectNoMatch(TPoint(screenSize.iWidth/2,0),TPoint(screenSize.iWidth/2,screenSize.iHeight/2),TSize(10,10),_L("CTRegion::ExposeTestL() D"));
-	CheckRectNoMatch(TPoint(screenSize.iWidth/3,0),TPoint(screenSize.iWidth/2,0),TSize(10,10),_L("CTRegion::ExposeTestL() E"));
-	CheckRect(TPoint(screenSize.iWidth/3,screenSize.iHeight/2),TPoint(screenSize.iWidth/2,screenSize.iHeight/2),TSize(((screenSize.iWidth/6-5)/4*4),screenSize.iHeight/2),_L("CTRegion::ExposeTestL() F"));
-	testWin->Win()->BeginRedraw();
-	testWin->DrawNow();
-	testWin->Win()->EndRedraw();
-	TheClient->iWs.Flush();
-	
-	CheckRect(TPoint(screenSize.iWidth/3,0),TPoint(screenSize.iWidth/3,screenSize.iHeight/2),TSize(screenSize.iWidth/6-10,screenSize.iHeight/2),_L("CTRegion::ExposeTestL() G"));
-	CheckRectNoMatch(TPoint(screenSize.iWidth/2,0),TPoint(screenSize.iWidth/2,screenSize.iHeight/2),TSize(10,10),_L("CTRegion::ExposeTestL() H"));
-	CheckRect(TPoint(screenSize.iWidth/3,0),TPoint(screenSize.iWidth/2,0),TSize(((screenSize.iWidth/6-5)/4*4),screenSize.iHeight/2),_L("CTRegion::ExposeTestL() I"));
-	CheckRectNoMatch(TPoint(screenSize.iWidth/3,screenSize.iHeight/2),TPoint(screenSize.iWidth/2,screenSize.iHeight/2),TSize(10,10),_L("CTRegion::ExposeTestL() J"));
-
-	CleanupStack::PopAndDestroy(testWin);
-	}
-
-#if defined(__MARM_ARM4__)
-	#define FADING ETrue
-#elif defined(__MARM__)
-	#define FADING EFalse
-#else
-	#define FADING ETrue
-#endif
-void CTRegion::ExposeTest2L()
-	{
-	TBool canFade=FADING;
-#if defined(__MARM_THUMB__)
-	if (!RegionCanFadeSet)
-		return;
-	canFade=RegionCanFade;
-#endif
-	INFO_PRINTF1(_L("AUTO REGN ExpostTest2 "));
-	CBlankWindow* testWin;
-	RBlankWindow win(TheClient->iWs);
-	CleanupClosePushL(win);
-	TSize screenSize=TheClient->iGroup->Size();
-	TRect topHalf(0,0,screenSize.iWidth/3,screenSize.iHeight/2);
-	testWin=new(ELeave) CBlankWindow(TRgb::Gray4(0));
-	CleanupStack::PushL(testWin);
-	testWin->SetUpL(TPoint(screenSize.iWidth/3,0),TSize(screenSize.iWidth/3,screenSize.iHeight),TheClient->iGroup,*TheGc);
-	testWin->Win()->EnableRedrawStore(EFalse);
-	testWin->Win()->SetRequiredDisplayMode(EGray16);
-	testWin->SetColor(TRgb::Gray16(12));
-	testWin->RealDraw(ETrue);
-	win.Construct(*TheClient->iGroup->WinTreeNode(),3456);
-	win.SetColor(TRgb::Gray4(2));
-	win.SetExtent(TPoint(0,-screenSize.iHeight),TSize(screenSize.iWidth/3-2,2*screenSize.iHeight));
-	win.SetShadowHeight(screenSize.iWidth/9);
-	win.Activate();
-	TheClient->iWs.Flush();
-	TheClient->WaitForRedrawsToFinish();
-	INFO_PRINTF1(_L(" Constructed Windows"));
-	testWin->DrawNow();
-	testWin->Win()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
-	testWin->DrawNow(topHalf);
-	TheClient->iWs.Flush();
-	INFO_PRINTF1(_L(" Drawn TopHalf Faded"));
-	TBool retVal = TheClient->iScreen->RectCompare(TRect(TPoint(screenSize.iWidth/3,0),TSize(screenSize.iWidth/3,screenSize.iHeight/2))
-						,TRect(TPoint(screenSize.iWidth/3,screenSize.iHeight/2),TSize(screenSize.iWidth/3,screenSize.iHeight/2)));
-	TEST(retVal);
-	if (!retVal)
-		INFO_PRINTF3(_L("TheClient->iScreen->RectCompare() return value  - Expected: %d, Actual: %d"), ETrue, retVal);		
-
-	testWin->DrawNow(topHalf);
-	TheClient->iWs.Flush();
-	canFade!=TheClient->iScreen->RectCompare(TRect(TPoint(screenSize.iWidth/3,0),TSize(10,10))
-															,TRect(TPoint(screenSize.iWidth/3,screenSize.iHeight/2),TSize(10,10)));
-	TEST(canFade);
-	if (!canFade)
-		INFO_PRINTF3(_L("TheClient->iScreen->RectCompare() return value  - Expected: %d, Actual: %d"), ETrue, canFade);		
-
-	testWin->DrawNow();
-	TheClient->iWs.Flush();
-	INFO_PRINTF1(_L(" All Faded (Flush)"));
-	
-	retVal = TheClient->iScreen->RectCompare(TRect(TPoint(screenSize.iWidth/3,0),TSize(screenSize.iWidth/3,screenSize.iHeight/2))
-						,TRect(TPoint(screenSize.iWidth/3,screenSize.iHeight/2),TSize(screenSize.iWidth/3,screenSize.iHeight/2)));
-	TEST(retVal);
-	if (!retVal)
-		INFO_PRINTF3(_L("TheClient->iScreen->RectCompare() return value  - Expected: %d, Actual: %d"), ETrue, retVal);		
-
-	testWin->Win()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
-	TheClient->iWs.Flush();
-	TheClient->WaitForRedrawsToFinish();
-	INFO_PRINTF1(_L(" Redrawn Screen Unfaded"));
-	testWin->Win()->Invalidate(topHalf);
-	testWin->Win()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
-	testWin->DrawNow();
-	TheClient->iWs.Flush();
-	INFO_PRINTF1(_L(" Re Drawn Top Half Faded Again"));
-	retVal = TheClient->iScreen->RectCompare(TRect(TPoint(screenSize.iWidth/3,0),TSize(screenSize.iWidth/3,screenSize.iHeight/2))
-						,TRect(TPoint(screenSize.iWidth/3,screenSize.iHeight/2),TSize(screenSize.iWidth/3,screenSize.iHeight/2)));
-	TEST(retVal);
-	if (!retVal)
-		INFO_PRINTF3(_L("TheClient->iScreen->RectCompare() return value  - Expected: %d, Actual: %d"), ETrue, retVal);		
-
-	testWin->DrawNow();
-	TheClient->iWs.Flush();
-	INFO_PRINTF1(_L(" Re Drawn Top Half Faded Yet Again"));
-	canFade!=TheClient->iScreen->RectCompare(TRect(TPoint(screenSize.iWidth/3,0),TSize(10,10))
-															,TRect(TPoint(screenSize.iWidth/3,screenSize.iHeight/2),TSize(10,10)));
-	TEST(canFade);
-	if (!canFade)
-		INFO_PRINTF3(_L("TheClient->iScreen->RectCompare() return value  - Expected: %d, Actual: %d"), ETrue, canFade);		
-
-	testWin->DrawNow();
-	TheClient->iWs.Flush();
-	INFO_PRINTF1(_L(" All Faded Again"));
-	retVal = TheClient->iScreen->RectCompare(TRect(TPoint(screenSize.iWidth/3,0),TSize(screenSize.iWidth/3,screenSize.iHeight/2))
-						,TRect(TPoint(screenSize.iWidth/3,screenSize.iHeight/2),TSize(screenSize.iWidth/3,screenSize.iHeight/2)));
-	TEST(retVal);
-	if (!retVal)
-		INFO_PRINTF3(_L("TheClient->iScreen->RectCompare() return value  - Expected: %d, Actual: %d"), ETrue, retVal);		
-
-	CleanupStack::PopAndDestroy(2,&win);
-	INFO_PRINTF1(_L(" Killed Windows"));
-	}
-
-void CTRegion::CoverTestL()
-	{
-	CBlankWindow* testWin;
-	RBlankWindow win(TheClient->iWs);
-	CleanupClosePushL(win);
-	TSize screenSize=TheClient->iGroup->Size();
-	testWin=new(ELeave) CBlankWindow(TRgb::Gray4(0));
-	CleanupStack::PushL(testWin);
-	testWin->SetUpL(TPoint(screenSize.iWidth/3,0),TSize(screenSize.iWidth/3,screenSize.iHeight),TheClient->iGroup,*TheGc);
-	testWin->SetColor(TRgb::Gray4(1));
-	testWin->RealDraw(ETrue);
-	win.Construct(*TheClient->iGroup->WinTreeNode(),3456);
-	win.SetColor(TRgb::Gray4(0));
-	win.SetExtent(TPoint(screenSize.iWidth/3+30,20),TSize(screenSize.iWidth/3-62,25));
-	win.SetVisible(EFalse);
-	win.Activate();
-	TheClient->iWs.Flush();
-	TheClient->WaitForRedrawsToFinish();
-	testWin->DrawNow();
-	testWin->SetColor(TRgb::Gray4(2));
-	win.SetVisible(ETrue);
-	testWin->DrawNow();
-	TheClient->iWs.Flush();
-	CheckRectNoMatch(TPoint(screenSize.iWidth/3,0),TPoint(screenSize.iWidth/3+30,20),TSize(10,10),_L("TRegion::CoverTestL() A"));
-
-	TheClient->WaitForRedrawsToFinish();
-	CheckRectNoMatch(TPoint(screenSize.iWidth/3,0),TPoint(screenSize.iWidth/3+30,20),TSize(10,10),_L("TRegion::CoverTestL() B"));
-
-	win.SetVisible(EFalse);
-	TheClient->iWs.Flush();
-	TheClient->WaitForRedrawsToFinish();
-	testWin->SetColor(TRgb::Gray4(1));
-	testWin->Win()->Invalidate();
-	win.SetVisible(ETrue);
-	testWin->DrawNow();
-	TheClient->iWs.Flush();
-	CheckRectNoMatch(TPoint(screenSize.iWidth/3,0),TPoint(screenSize.iWidth/3+30,20),TSize(10,10),_L("TRegion::CoverTestL() C"));
-
-	CleanupStack::PopAndDestroy(2,&win);
-	}
-
-void CTRegion::OffsetTestL()
-	{
-	CBlankWindow* testWin;
-	RBlankWindow win(TheClient->iWs);
-	CleanupClosePushL(win);
-	TSize screenSize=TheClient->iGroup->Size();
-	testWin=new(ELeave) CBlankWindow(TRgb::Gray4(0));
-	CleanupStack::PushL(testWin);
-	testWin->SetUpL(TPoint(screenSize.iWidth/3,0),TSize(screenSize.iWidth/3,screenSize.iHeight-40),TheClient->iGroup,*TheGc);
-	testWin->Win()->EnableRedrawStore(EFalse);
-	testWin->SetColor(TRgb::Gray4(1));
-	testWin->RealDraw(ETrue);
-	win.Construct(*testWin->WinTreeNode(),3456);
-	win.SetColor(TRgb::Gray4(2));
-	win.SetExtent(TPoint(30,20),TSize(screenSize.iWidth/3-62,25));
-	win.Activate();
-	TheClient->iWs.Flush();
-	TheClient->WaitForRedrawsToFinish();
-	win.SetVisible(EFalse);
-	TheClient->iWs.Flush();
-	testWin->DrawNow();
-	testWin->SetColor(TRgb::Gray4(2));
-	testWin->Win()->SetPosition(TPoint(screenSize.iWidth/3+30,35));
-	testWin->DrawNow();
-	TheClient->iWs.Flush();
-	/* Andy - this is verifying that the complete redraw of the window in the second DrawNow only affects part
-	of the window.  I don't understand it atall.
-	CheckRectNoMatch(TPoint(screenSize.iWidth/3+60,55),TPoint(screenSize.iWidth/3+70,85),TSize(10,10),_L("CTRegion::OffsetTestL() A"));
-	*/
-	TheClient->WaitForRedrawsToFinish();
-	CheckRect(TPoint(screenSize.iWidth/3+60,55),TPoint(screenSize.iWidth/3+70,85),TSize(screenSize.iWidth/3-62,25),_L("CTRegion::OffsetTestL() A"));
-
-	win.SetVisible(ETrue);
-	win.SetVisible(EFalse);
-	testWin->Win()->SetPosition(TPoint(screenSize.iWidth/3+5,5));
-	testWin->SetColor(TRgb::Gray4(1));
-	testWin->DrawNow();
-	TheClient->iWs.Flush();
-	CheckRect(TPoint(screenSize.iWidth/3+60,55),TPoint(screenSize.iWidth/3+55,90),TSize(screenSize.iWidth/3-62,25),_L("CTRegion::OffsetTestL() B"));
-	/* Andy - this is verifying that the complete redraw of the window during DrawNow only affects part
-	of the window.  I don't understand it atall.
-	CheckRectNoMatch(TPoint(screenSize.iWidth/3+30,20),TPoint(screenSize.iWidth/3+50,90),TSize(10,10),_L("CTRegion::OffsetTestL() B"));
-	*/
-	CleanupStack::PopAndDestroy(2,&win);
-	}
-
-void CTRegion::ClipTestL()
-	{
-	CBlankWindow* testWin;
-	RBlankWindow win(TheClient->iWs);
-	CleanupClosePushL(win);
-	TSize screenSize=TheClient->iGroup->Size();
-	testWin=new(ELeave) CBlankWindow(TRgb::Gray4(0));
-	CleanupStack::PushL(testWin);
-	testWin->SetUpL(TPoint(screenSize.iWidth/3,0),TSize(screenSize.iWidth/3,screenSize.iHeight),TheClient->iGroup,*TheGc);
-	testWin->Win()->EnableRedrawStore(EFalse);
-	testWin->SetColor(TRgb::Gray4(1));
-	testWin->RealDraw(ETrue);
-	win.Construct(*testWin->WinTreeNode(),3456);
-	win.SetColor(TRgb::Gray4(2));
-	win.SetExtent(TPoint(30,20),TSize(screenSize.iWidth/3-62,25));
-	win.Activate();
-	TheClient->iWs.Flush();
-	TheClient->WaitForRedrawsToFinish();
-	win.SetVisible(EFalse);
-	TheClient->iWs.Flush();
-	testWin->DrawNow();
-	testWin->SetColor(TRgb::Gray4(2));
-	User::LeaveIfError(testWin->Win()->SetSizeErr(TSize(screenSize.iWidth/6,screenSize.iHeight-2)));
-	RRegion invalid;
-	testWin->Win()->GetInvalidRegion(invalid);
-	testWin->DrawNow();
-	TheClient->iWs.Flush();
-	TBool retVal = !invalid.CheckError();
-	TEST(retVal);
-	if (!retVal)
-		INFO_PRINTF3(_L("!invalid.CheckError() return value  - Expected: %d, Actual: %d"), ETrue, retVal);			
-	
-	TEST(invalid.BoundingRect().iBr.iX<=screenSize.iWidth/6);
-	if (invalid.BoundingRect().iBr.iX>screenSize.iWidth/6)
-		INFO_PRINTF3(_L("invalid.BoundingRect().iBr.iX<=screenSize.iWidth/6  - Expected: %d, Actual: %d"), screenSize.iWidth/6, invalid.BoundingRect().iBr.iX);			
-	TheClient->iWs.Finish();
-	TheClient->WaitForRedrawsToFinish();
-	testWin->Win()->GetInvalidRegion(invalid);
-	
-	retVal = invalid.IsEmpty();
-	TEST(retVal);
-	if (!retVal)
-		{
-		INFO_PRINTF3(_L("!invalid.CheckError() return value  - Expected: %d, Actual: %d"), ETrue, retVal);
-		}
-
-	User::LeaveIfError(testWin->Win()->SetSizeErr(TSize(screenSize.iWidth/3,screenSize.iHeight-4)));
-	win.SetVisible(ETrue);
-	win.SetVisible(EFalse);
-	User::LeaveIfError(testWin->Win()->SetSizeErr(TSize(screenSize.iWidth/6,screenSize.iHeight-6)));
-	testWin->SetColor(TRgb::Gray4(1));
-	testWin->DrawNow();
-	TheClient->iWs.Flush();
-	//PeterI This is testing an intermediate state i.e. "flicker" and will never pass on mk3
-/*	CheckRectNoMatch(TPoint(screenSize.iWidth/3+30,20),TPoint(screenSize.iWidth/3+50,90),TSize(10,10),_L("CTRegion::ClipTestL()"));
-	TEST(retVal);
-	if (!retVal)
-		{
-		INFO_PRINTF3(_L("!CheckRect() return value  - Expected: %d, Actual: %d"), ETrue, retVal);
-		}
-		*/
-	CleanupStack::PopAndDestroy(2,&win);
-	}
-
-void CTRegion::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	((CTRegionStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(++iTest->iState)
-		{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0272
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test drawing to a region including clipping
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Draw to a region that has clipping enabled and the check the
-					drawing occurs correctly
-
-@SYMTestExpectedResults Drawing to the region occurs correctly
-*/
-		case 1:
-			{
-			((CTRegionStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0272"));
-			iTest->LogSubTest(_L("Main"));
-			RRegion clippingRegion;
-			CreateChildWindowsL();
-			TheClient->iWs.Finish();
-			TheClient->WaitForRedrawsToFinish();
-			TSize scrSize(TheClient->iScreen->SizeInPixels());
-			for(TUint index=0;index<(sizeof(regionRectList)/sizeof(regionRectList[0]));index++)
-				{
-				regionRectList[index].SetWidth((regionRectList[index].Width()*scrSize.iWidth)/640);
-				regionRectList[index].SetHeight((regionRectList[index].Height()*scrSize.iHeight)/240);
-				clippingRectList[index].SetWidth((clippingRectList[index].Width()*scrSize.iWidth)/640);
-				clippingRectList[index].SetHeight((clippingRectList[index].Height()*scrSize.iHeight)/240);
-				originList[index].iX = (originList[index].iX*scrSize.iWidth)/640;
-				originList[index].iY = (originList[index].iY*scrSize.iHeight)/240;
-
-				clippingRegion.AddRect(regionRectList[index]);
-				TestRegionL(clippingRegion,clippingRectList[index],originList[index]);
-				}
-			clippingRegion.Close();
-			DeleteChildWindows();
-			}
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0273
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test drawing to a region including clipping as it is exposed
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Draw to a region that has clipping enabled as it is exposed
-					and the check the drawing occurs correctly
-
-@SYMTestExpectedResults Drawing to the region occurs correctly
-*/
-		case 2:
-			((CTRegionStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0273"));
-			//PeterI This appears to be testing "flicker" of a window after an expose
-			//Mk3 doesn't exhibit this behaviour. Is the flicker expected behaviour?
-//			iTest->LogSubTest(_L("Expose Test"));
-//			ExposeTestL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0274
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test drawing to a region including clipping as it is exposed
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Draw to a region that has clipping enabled as it is exposed
-					and the check the drawing occurs correctly
-
-@SYMTestExpectedResults Drawing to the region occurs correctly
-*/
-		case 3:
-			((CTRegionStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0274"));
-			iTest->LogSubTest(_L("Expose Test2"));
-			ExposeTest2L();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0275
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test drawing to a region including clipping as it is covered
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Draw to a region that has clipping enabled as it is covered
-					and the check the drawing occurs correctly
-
-@SYMTestExpectedResults Drawing to the region occurs correctly
-*/
-		case 4:
-			((CTRegionStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0275"));
-			iTest->LogSubTest(_L("Cover Test"));
-			CoverTestL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0276
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test drawing to a region including clipping and with an offset
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Draw to a region that has clipping enabled and with an offset
-					and the check the drawing occurs correctly
-
-@SYMTestExpectedResults Drawing to the region occurs correctly
-*/
-		case 5:
-			((CTRegionStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0276"));
-			iTest->LogSubTest(_L("Offset Test"));
-			OffsetTestL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0277
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Test drawing to a region including clipping
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Draw to a region that has clipping enabled
-					and the check the drawing occurs correctly
-
-@SYMTestExpectedResults Drawing to the region occurs correctly
-*/
-		case 6:
-			((CTRegionStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0277"));
-			iTest->LogSubTest(_L("Clip Test"));
-			ClipTestL();
-			break;
-		default:
-			((CTRegionStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTRegionStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-		}
-	((CTRegionStep*)iStep)->RecordTestResultL();
-	}
-
-	
-__WS_CONSTRUCT_STEP__(Region)
--- a/windowing/windowserver/tauto/TSCRDEV.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,642 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Screen device test code
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TSCRDEV.H"
-
-//Define this to get visible pauses (in test 6: DeviceResSwitchL)
-//#define VISIBLE_PAUSES
-
-//Define this to get extra logging which may be useful in tracking down a fail
-//#define EXTRA_LOGGING
-
-CTScreenDevice::CTScreenDevice(CTestStep* aStep) : CTWsGraphicsBase(aStep)
-	{}
-
-CTScreenDevice::~CTScreenDevice()
-	{}
-
-void CTScreenDevice::ConstructL()
-	{
-	//The following is just another test... it doesn't leave any resources for use by the test class AFAICT...
-	RWsSession aSession;
-	CWsScreenDevice *device1;
-	CWsScreenDevice *device2;
-	CWsScreenDevice *device3;
-
-	aSession.Connect();
-	device1=new(ELeave) CWsScreenDevice(aSession);
-	device1->Construct(iTest->iScreenNumber);
-	delete device1;
-	device1=new(ELeave) CWsScreenDevice(aSession);
-	device1->Construct(iTest->iScreenNumber);
-	device2=new(ELeave) CWsScreenDevice(aSession);
-	device2->Construct(iTest->iScreenNumber);
-	device3=new(ELeave) CWsScreenDevice(aSession);
-	device3->Construct(iTest->iScreenNumber);
-	delete device3;
-	CFbsFont *font;
-	User::LeaveIfError(device1->GetNearestFontToDesignHeightInTwips((CFont *&)font,TFontSpec()));
-	RWindowGroup group(aSession);
-	group.Construct(777);
-	group.SetOwningWindowGroup(TheClient->iGroup->GroupWin()->Identifier());
-	RWindow win(aSession);
-	win.Construct(group,77);
-	CWindowGc *gc=new(ELeave) CWindowGc(device1);
-	gc->Construct();
-	gc->Activate(win);
-	gc->UseFont(font);
-	device1->ReleaseFont(font);
-	aSession.Flush();
-	delete gc;
-	win.Close();
-	group.Close();
-	delete device1;
-	delete device2;
-	aSession.Close();
-	}
-
-
-void CTScreenDevice::TestTwipPixelConversions()
-	{
-	TInt result=TheClient->iScreen->HorizontalTwipsToPixels(TheClient->iScreen->HorizontalPixelsToTwips(1234));
-	TEST(result==1234);
-	if (result!=1234)
-		INFO_PRINTF3(_L("TheClient->iScreen->HorizontalTwipsToPixels(TheClient->iScreen->HorizontalPixelsToTwips(1234) return value  - Expected: %d, Actual: %d"), 1234, result);
-
-	result=TheClient->iScreen->VerticalTwipsToPixels(TheClient->iScreen->VerticalPixelsToTwips(1234));
-	TEST(result==1234);
-	if (result!=1234)
-		INFO_PRINTF3(_L("TheClient->iScreen->VerticalTwipsToPixels(TheClient->iScreen->VerticalPixelsToTwips(1234) return value  - Expected: %d, Actual: %d"), 1234, result);
-
-	TSize pixels=TheClient->iScreen->SizeInPixels();
-	TSize twips=TheClient->iScreen->SizeInTwips();
-	TInt conv=TheClient->iScreen->HorizontalPixelsToTwips(pixels.iWidth);
-	TEST(conv==twips.iWidth);
-	if (conv!=twips.iWidth)
-		INFO_PRINTF3(_L("TheClient->iScreen->HorizontalPixelsToTwips(pixels.iWidth) return value  - Expected: %d, Actual: %d"), twips.iWidth, conv);
-
-	conv=TheClient->iScreen->VerticalPixelsToTwips(pixels.iHeight);
-	TEST(conv==twips.iHeight);
-	if (conv!=twips.iHeight)
-		INFO_PRINTF3(_L("TheClient->iScreen->VerticalPixelsToTwips(pixels.iHeight) return value  - Expected: %d, Actual: %d"), twips.iHeight, conv);
-	}
-
-#define TEST_VALUE 100000000
-void CTScreenDevice::TestTwipPixelOverflow()
-	{
-	TInt result=TheClient->iScreen->HorizontalTwipsToPixels(TheClient->iScreen->HorizontalPixelsToTwips(TEST_VALUE));
-	TEST(result==TEST_VALUE);
-	if (result!=TEST_VALUE)
-		INFO_PRINTF3(_L("TheClient->iScreen->HorizontalTwipsToPixels(TheClient->iScreen->HorizontalPixelsToTwips(TEST_VALUE)) return value  - Expected: %d, Actual: %d"), TEST_VALUE, result);
-
-	result=TheClient->iScreen->VerticalTwipsToPixels(TheClient->iScreen->VerticalPixelsToTwips(TEST_VALUE));
-	TEST(result==TEST_VALUE);
-	if (result!=TEST_VALUE)
-		INFO_PRINTF3(_L("TheClient->iScreen->VerticalTwipsToPixels(TheClient->iScreen->VerticalPixelsToTwips(TEST_VALUE)) return value  - Expected: %d, Actual: %d"), TEST_VALUE, result);
-
-	result = TheClient->iScreen->HorizontalPixelsToTwips(TEST_VALUE);
-	TEST(result>0);
-	if (!result>0)
-		INFO_PRINTF3(_L("TheClient->iScreen->HorizontalPixelsToTwips(TEST_VALUE) return value  - Expected: %d less than, Actual: %d"), 0, result);
-
-	result = TheClient->iScreen->VerticalPixelsToTwips(TEST_VALUE);
-	TEST(result>0);
-	if (!result>0)
-		INFO_PRINTF3(_L("TheClient->iScreen->VerticalPixelsToTwips(TEST_VALUE) return value  - Expected: %d less than, Actual: %d"), 0, result);
-
-	result = TheClient->iScreen->HorizontalTwipsToPixels(TEST_VALUE);
-	TEST(result>0);
-	if (!result>0)
-		INFO_PRINTF3(_L("TheClient->iScreen->HorizontalTwipsToPixels(TEST_VALUE) return value  - Expected: %d less than, Actual: %d"), 0, result);
-
-	result = TheClient->iScreen->VerticalTwipsToPixels(TEST_VALUE);
-	TEST(result>0);
-	if (!result>0)
-		INFO_PRINTF3(_L("TheClient->iScreen->VerticalTwipsToPixels(TEST_VALUE) return value  - Expected: %d less than, Actual: %d"), 0, result);
-	}
-
-void CTScreenDevice::TwipsCacheFlushL()
-	{
-	RWsSession session;
-	CWsScreenDevice* device;
-	CFont* font;
-	CFont* font2;
-	const TFontSpec fontspec(KTestFontTypefaceName,250);
-	TPixelsTwipsAndRotation sizeAndRotation;
-
-	// create a CWsScreenDevice instance
-	User::LeaveIfError(session.Connect());
-	device=new(ELeave) CWsScreenDevice(session);
-	device->Construct(iTest->iScreenNumber);
-
-	// Record a font height for use by latter tests
-	User::LeaveIfError(device->GetNearestFontToDesignHeightInTwips(font,fontspec));
-	const TInt height0=font->HeightInPixels();
-	device->ReleaseFont(font);
-
-	// 1. find font with best-matching height in twips,
-	// 2. change twips size of the screen (leaving pixel-size same),
-	// 3. find font with best-matching height in twips,
-	// 4. make sure that the newly found font is not the same as previous and has the different height in pixels
-	device->GetDefaultScreenSizeAndRotation(sizeAndRotation);
-#if defined(EXTRA_LOGGING)
-	_LIT(KLog1,"Font height: %d for unchanged device.   pixels=%d,%d  twips=%d,%d");
-	LOG_MESSAGE6(KLog1,height0,sizeAndRotation.iPixelSize.iWidth,sizeAndRotation.iPixelSize.iHeight
-						,sizeAndRotation.iTwipsSize.iWidth,sizeAndRotation.iTwipsSize.iHeight);
-#endif
-	sizeAndRotation.iTwipsSize.iHeight=2000;
-	sizeAndRotation.iTwipsSize.iWidth =3000;
-	device->SetScreenSizeAndRotation(sizeAndRotation);
-
-	User::LeaveIfError(device->GetNearestFontToDesignHeightInTwips(font,fontspec));
-	TInt height=font->HeightInPixels();
-#if defined(EXTRA_LOGGING)
-	_LIT(KLog2,"Font height: %d for device with twips set to 2000x3000");
-	LOG_MESSAGE2(KLog2,height);
-#endif
-	TFontSpec returnedSpec=font->FontSpecInTwips();
-
-	sizeAndRotation.iTwipsSize.iHeight=4000;
-	sizeAndRotation.iTwipsSize.iWidth =6000;
-	device->SetScreenSizeAndRotation(sizeAndRotation);
-
-	User::LeaveIfError(device->GetNearestFontToDesignHeightInTwips(font2,fontspec));
-	TInt height2=font2->HeightInPixels();
-	TFontSpec returnedSpec2 = font2->FontSpecInTwips();
-#if defined(EXTRA_LOGGING)
-	_LIT(KLog3,"Font height: %d for device with twips set to 4000x6000");
-	LOG_MESSAGE2(KLog3,height2);
-#endif
-
-	TEST(font!=font2);
-	TEST(height!=height2);
-	_LIT(KLogErrM,"Font Heights in pixels match unexpectantly, height=%d");
-	if (height==height2)
-		INFO_PRINTF2(KLogErrM,height);
-
-	device->ReleaseFont(font2);
-	device->ReleaseFont(font);
-
-	// 1. find font with best-matching height in twips,
-	// 2. change pixel size of the screen (leaving twip-size same),
-	// 3. find font with best-matching height in twips,
-	// 4. make sure that the newly found font is not the same as previous and has the different height in pixels
-	device->GetDefaultScreenSizeAndRotation(sizeAndRotation);
-	sizeAndRotation.iPixelSize.iHeight=240;
-	sizeAndRotation.iPixelSize.iWidth =640;
-	device->SetScreenSizeAndRotation(sizeAndRotation);
-
-	User::LeaveIfError(device->GetNearestFontToDesignHeightInTwips(font,fontspec));
-	height=font->HeightInPixels();
-	returnedSpec=font->FontSpecInTwips();
-#if defined(EXTRA_LOGGING)
-	_LIT(KLog4,"Font height: %d for device with pixels set to 240x640   twips=%d,%d");
-	LOG_MESSAGE4(KLog4,height,sizeAndRotation.iTwipsSize.iWidth,sizeAndRotation.iTwipsSize.iHeight);
-#endif
-
-	sizeAndRotation.iPixelSize.iHeight=480;
-	sizeAndRotation.iPixelSize.iWidth =1280;
-	device->SetScreenSizeAndRotation(sizeAndRotation);
-
-	User::LeaveIfError(device->GetNearestFontToDesignHeightInTwips(font2,fontspec));
-	height2=font2->HeightInPixels();
-	returnedSpec2=font2->FontSpecInTwips();
-#if defined(EXTRA_LOGGING)
-	_LIT(KLog5,"Font height: %d for device with pixels set to 480x1280");
-	LOG_MESSAGE2(KLog5,height2);
-#endif
-
-	TEST(font!=font2);
-	TEST(height!=height2);
-	if (height==height2)
-		INFO_PRINTF2(KLogErrM,height);
-
-	device->ReleaseFont(font2);
-	device->ReleaseFont(font);
-
-	// 1. double the width and height of screen in both pixels and twips
-	// 2. find font with best-matching height in twips,
-	// 3. make sure that the newly found font is the same as previous and has the same height in pixels
-	device->GetDefaultScreenSizeAndRotation(sizeAndRotation);
-	device->SetScreenSizeAndRotation(sizeAndRotation);
-	User::LeaveIfError(device->GetNearestFontToDesignHeightInTwips(font,fontspec));
-	sizeAndRotation.iPixelSize.iHeight*=2;
-	sizeAndRotation.iPixelSize.iWidth *=2;
-	sizeAndRotation.iTwipsSize.iHeight*=2;
-	sizeAndRotation.iTwipsSize.iWidth *=2;
-	device->SetScreenSizeAndRotation(sizeAndRotation);
-
-	User::LeaveIfError(device->GetNearestFontToDesignHeightInTwips(font2,fontspec));
-	height2=font2->HeightInPixels();
-#if defined(EXTRA_LOGGING)
-	_LIT(KLog6,"Font height: %d for device doubled size.   pixels=%d,%d  twips=%d,%d");
-	LOG_MESSAGE6(KLog6,height2,sizeAndRotation.iPixelSize.iWidth,sizeAndRotation.iPixelSize.iHeight
-							,sizeAndRotation.iTwipsSize.iWidth,sizeAndRotation.iTwipsSize.iHeight);
-#endif
-
-	TEST(font==font2);
-	TEST(height0==height2);
-	_LIT(KLogErrD,"Font Heights in pixels don't match, expected=%d, actual=%d");
-	if (height0!=height2)
-		INFO_PRINTF3(KLogErrD,height0,height2);
-
-	device->ReleaseFont(font2);
-	device->ReleaseFont(font);
-
-	// 1. swap width and height sizes of screen for both pixels and twips
-	// 2. find font with best-matching height in twips,
-	// 3. make sure that the newly found font is the same as previous and has the same height in pixels
-	device->GetDefaultScreenSizeAndRotation(sizeAndRotation);
-	device->SetScreenSizeAndRotation(sizeAndRotation);
-	User::LeaveIfError(device->GetNearestFontToDesignHeightInTwips(font,fontspec));
-	TInt swap=sizeAndRotation.iPixelSize.iHeight;
-	sizeAndRotation.iPixelSize.iHeight=sizeAndRotation.iPixelSize.iWidth;
-	sizeAndRotation.iPixelSize.iWidth =swap;
-	swap=sizeAndRotation.iTwipsSize.iHeight;
-	sizeAndRotation.iTwipsSize.iHeight=sizeAndRotation.iTwipsSize.iWidth;
-	sizeAndRotation.iTwipsSize.iWidth =swap;
-	device->SetScreenSizeAndRotation(sizeAndRotation);
-	User::LeaveIfError(device->GetNearestFontToDesignHeightInTwips(font2,fontspec));
-	height2 = font2->HeightInPixels();
-#if defined(EXTRA_LOGGING)
-	_LIT(KLog7,"Font height: %d for device rotated size.   pixels=%d,%d  twips=%d,%d");
-	LOG_MESSAGE6(KLog7,height2,sizeAndRotation.iPixelSize.iWidth,sizeAndRotation.iPixelSize.iHeight
-							,sizeAndRotation.iTwipsSize.iWidth,sizeAndRotation.iTwipsSize.iHeight);
-#endif
-
-	TEST(font==font2);
-	TEST(height0==height2);
-	if (height0!=height2)
-		INFO_PRINTF3(KLogErrD,height0,height2);
-
-	device->ReleaseFont(font2);
-	device->ReleaseFont(font);
-
-	delete device;
-	session.Close();
-	}
-
-void CTScreenDevice::CheckBitmapL(CFbsBitmap *aBitmap, const TRect &aRect)
-	{
-	CFbsBitmapDevice *device=CFbsBitmapDevice::NewL(aBitmap);
-	CleanupStack::PushL(device);
-	TInt height=Min(aRect.Size().iHeight,aBitmap->SizeInPixels().iHeight);
-	TInt width=Min(aRect.Size().iWidth,aBitmap->SizeInPixels().iWidth);
-	TPoint pos(0,0);
-	TInt bufLen=CFbsBitmap::ScanLineLength(width,EGray4);
-	TAny *buf1=User::AllocLC(bufLen);
-	TAny *buf2=User::AllocLC(bufLen);
-	TPtr8 scanBuf1((TUint8 *)buf1,bufLen);
-	TPtr8 scanBuf2((TUint8 *)buf2,bufLen);
-	TInt oddPixels=width%4;
-	TInt byte1,byte2;
-	for(;pos.iY<height;pos.iY++)
-		{
-		TheClient->iScreen->GetScanLine(scanBuf1,pos+aRect.iTl,width,EGray4);
-		device->GetScanLine(scanBuf2,pos,width,EGray4);
-		if (oddPixels>0)
-			{
-			byte1=(scanBuf1[bufLen-1]<<(2*(4-oddPixels)))%256;
-			byte2=(scanBuf2[bufLen-1]<<(2*(4-oddPixels)))%256;
-			TEST(byte1==byte2);
-			if (byte1!=byte2)
-				INFO_PRINTF3(_L("byte1==byte2  - byte1: %d, byte2 Height: %d"), byte1, byte2);
-
-			scanBuf1=scanBuf1.Left(bufLen-1);
-			scanBuf2=scanBuf2.Left(bufLen-1);
-			}
-		TBool retVal = !scanBuf1.Compare(scanBuf2);
-		TEST(retVal);
-		if (!retVal)
-			INFO_PRINTF3(_L("!scanBuf1.Compare(scanBuf2) return value  - Expected: %d, Actual: %d"), ETrue, retVal);
-		}
-	CleanupStack::PopAndDestroy(3);
-	}
-
-void CTScreenDevice::doTestScreenToBitmapL()
-	{
-	RBlankWindow shieldWin(TheClient->iWs);
-	shieldWin.Construct(*TheClient->iGroup->GroupWin(),1);
-	shieldWin.SetOrdinalPosition(0,-1);
-	shieldWin.SetColor(TRgb::Gray4(1));
-	shieldWin.Activate();
-	CleanupStack::PushL(TCleanupItem(CleanUpWindow,&shieldWin));
-	TSize scrSize(TheClient->iScreen->SizeInPixels());
-	CWsBitmap *wsBitmap=new(ELeave) CWsBitmap(TheClient->iWs);
-	CleanupStack::PushL(wsBitmap);
-	User::LeaveIfError(wsBitmap->Create(scrSize,EGray4));
-	CFbsBitmap *bitmap=new(ELeave) CFbsBitmap;
-	CleanupStack::PushL(bitmap);
-
-	TheClient->iWs.Finish();
-	TheClient->WaitForRedrawsToFinish();
-	
-	User::LeaveIfError(bitmap->Create(TSize(30,10),EGray4));
-//
-	User::LeaveIfError(TheClient->iScreen->CopyScreenToBitmap(wsBitmap));
-	CheckBitmapL(wsBitmap,TRect(scrSize));
-//
-	User::LeaveIfError(TheClient->iScreen->CopyScreenToBitmap(bitmap));
-	CheckBitmapL(bitmap,TRect(scrSize));
-//
-	TRect rect1(111,10,222,20);
-	User::LeaveIfError(TheClient->iScreen->CopyScreenToBitmap(wsBitmap,rect1));
-	CheckBitmapL(wsBitmap,rect1);
-//
-	TRect rect2(10,20,100,200);
-	User::LeaveIfError(TheClient->iScreen->CopyScreenToBitmap(bitmap,rect2));
-	CheckBitmapL(bitmap,rect2);
-//
-// Now some mad values
-//
-// Right edge left of left edge
-	User::LeaveIfError(TheClient->iScreen->CopyScreenToBitmap(bitmap,TRect(100,20,90,200)));
-// Off the edge of the screen
-	User::LeaveIfError(TheClient->iScreen->CopyScreenToBitmap(bitmap,TRect(-10,20,-5,200)));
-// Off the edge of the screen again
-	User::LeaveIfError(TheClient->iScreen->CopyScreenToBitmap(bitmap,TRect(scrSize.AsPoint()+TPoint(5,5),TSize(10,10))));
-//
-	CleanupStack::PopAndDestroy(3);
-	}
-
-
-
-void CTScreenDevice::TestScreenToBitmap()
-	{
-	TRAPD(ret,doTestScreenToBitmapL());
-	TEST(ret==KErrNone);
-	if (ret!=KErrNone)
-		INFO_PRINTF3(_L("doTestScreenToBitmapL() return value  - Expected: %d, Actual: %d"), KErrNone, ret);
-	}
-	
-
-CCachePanic::~CCachePanic()
-	{
-	delete iWsScrDev;
-	iWs.Close();
-	}
-
-void CCachePanic::ConstructL(TInt aScreenNumber, TInt aInt)
-	{
-	iScreenNumber = aScreenNumber;
-	iInt = aInt;
-
-	User::LeaveIfError(iWs.Connect());
-	iWsScrDev=new(ELeave) CWsScreenDevice(iWs);
-	User::LeaveIfError(iWsScrDev->Construct(iScreenNumber));
-	}
-
-TInt CCachePanic::DoTest(CCachePanic* aTestClass)
-	{
-	CActiveScheduler* activeScheduler=new(ELeave) CActiveScheduler;
-	CActiveScheduler::Install(activeScheduler);
-	CleanupStack::PushL(activeScheduler);
-	TRAP_IGNORE(aTestClass->TestL());
-	CleanupStack::PopAndDestroy(activeScheduler);
-	return EWsExitReasonFinished;
-	}
-
-void CCachePanic::TestL()
-	{
-	AutoPanic(EAutoPanicTestFailed);
-	}
-
-TInt CTwipsPanic::RunTest(TInt aInt, TAny* aPtr)
-	{
-	TInt error = KErrNone;
-
-	CTwipsPanic* self=new(ELeave) CTwipsPanic();
-	CleanupStack::PushL(self);
-
-	TRAP(error, self->ConstructL((TInt)aPtr, aInt));
-	if (!error)
-		{
-		error = CCachePanic::DoTest(self);
-		}
-	CleanupStack::PopAndDestroy(self);
-	return error;
-	}
-
-void CTwipsPanic::TestL()
-	{
-	TPixelsTwipsAndRotation sizeAndRotation;
-	TFontSpec fontspec(KTestFontTypefaceName,250);
-
-	CFbsFont *font;
-	CFbsFont *font2;
-
-	iWsScrDev->GetDefaultScreenSizeAndRotation(sizeAndRotation);
-	sizeAndRotation.iTwipsSize.iHeight = 2000;
-	sizeAndRotation.iTwipsSize.iWidth  = 3000;
-	iWsScrDev->SetScreenSizeAndRotation(sizeAndRotation);
-	iWsScrDev->GetNearestFontToDesignHeightInTwips((CFont *&)font,fontspec);
-	iWsScrDev->GetNearestFontToDesignHeightInTwips((CFont *&)font2,fontspec);
-	sizeAndRotation.iTwipsSize.iHeight = 4000;
-	sizeAndRotation.iTwipsSize.iWidth  = 6000;
-	iWsScrDev->SetScreenSizeAndRotation(sizeAndRotation);
-	iWsScrDev->ReleaseFont(font);
-	}
-
-TInt CScanLinePanic::RunTest(TInt aInt, TAny* aPtr)
-	{
-	TInt error = KErrNone;
-
-	CScanLinePanic* self=new(ELeave) CScanLinePanic();
-	CleanupStack::PushL(self);
-
-	TRAP(error, self->ConstructL((TInt)aPtr, aInt));
-	if (!error)
-		{
-		error = CCachePanic::DoTest(self);
-		}
-	CleanupStack::PopAndDestroy(self);
-	return error;    
-	}
-
-void CScanLinePanic::TestL()
-	{
-	switch (iInt)
-		{
-		case TESTCASE_GRAPHICS_WSERV_0473:
-			TestLengthInvariant();
-			break;
-		case TESTCASE_GRAPHICS_WSERV_0474:
-			TestBufferInvariant();
-			break;
-		}
-	}
-
-void CScanLinePanic::TestLengthInvariant()
-	{
-	TInt buffLength=50;
-	TInt length=-1;
-	TUint8* buffer=new(ELeave) TUint8[buffLength];
-	TPtr8 scanline(buffer, buffLength, buffLength);
-	iWsScrDev->GetScanLine(scanline, TPoint(), length, EColor64K);
-	delete buffer;    
-	}
-
-void CScanLinePanic::TestBufferInvariant()
-	{
-	TInt buffLength=19;
-	TInt length=10;
-	TUint8* buffer=new(ELeave) TUint8[buffLength];
-	TPtr8 scanline(buffer, buffLength, buffLength);
-	iWsScrDev->GetScanLine(scanline, TPoint(), length, EColor64K);
-	delete buffer;    
-	}
-
-void CTScreenDevice::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	((CTScreenDeviceStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(++iTest->iState)
-		{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0080
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Test twips to pixels conversions
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Converts pixels to twips and then back the result back to pixels. Checks screen size request methods both in pixels and twips
-
-@SYMTestExpectedResults Expects that back and forth conversions preserve an original value.
-*/
-		case 1:
-			((CTScreenDeviceStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0080"));
-			iTest->LogSubTest(_L("Screen Device 1"));
-			TestTwipPixelConversions();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0081
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Tests CWsScreenDevice::CopyScreenToBitmap method
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates a blank window on the screen and uses CWsScreenDevice::CopyScreenToBitmap to copy parts of the screen image to either CWsBitmap or CFbsBitmap
-
-@SYMTestExpectedResults Expects that the method will not fail and that the image is copied correctly making pixel-to-pixel comparisons
-*/
-		case 2:
-			((CTScreenDeviceStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0081"));
-			iTest->LogSubTest(_L("Copy Screen To Bitmap"));
-			TestScreenToBitmap();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0082
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Test for integrity of twips to pixels conversions providing big values
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Calls twips to pixels (and backward) conversions for 100000000 value
-
-@SYMTestExpectedResults Expects that back and forth conversions preserve an original value. Make sure that the result is always greater that 0.
-*/
-		case 3:
-			((CTScreenDeviceStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0082"));
-			iTest->LogSubTest(_L("Twip To Pixels Overflow"));
-			TestTwipPixelOverflow();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0083
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Test that twips-in-pixel ratio change for screen size affects twips-in-pixel ratio of font
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Changes number of twips on screen (leaving number of pixels same), changes number of pixels on screen (leaving number of twips same), makes proportional changes of screen size for both twips and pixels
-
-@SYMTestExpectedResults Expects that twips-in-pixel ratio of font leaves the same only when screen size was changed through multipying of width by a coefficient (same for both twips and pixels) and multipying of height by a coefficient (same for both twips and pixels)
-*/
-		case 4:
-			((CTScreenDeviceStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0083"));
-			iTest->LogSubTest(_L("Twips cache flush after device size change"));
-			TwipsCacheFlushL();
-			break;
-		case 5:
-			((CTScreenDeviceStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0083"));
-			iTest->LogSubTest(_L("Twips cache reset"));
-			// not expecting any panic
-			TEST(iTest->TestPanicL(CTwipsPanic::RunTest, 0, 0, (TAny*)iTest->iScreenNumber, _L("")));
-			break;
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0473
-
-@SYMDEF             DEF116127
-
-@SYMTestCaseDesc    Invariant testing length parameter of less then 0 values in CWsScreenDevice::GetScanLine()
-					method
-
-@SYMTestActions     Calls CWsScreenDevice::GetScanLine with aLength of -1.
-
-**/            
-		case 6:
-			((CTScreenDeviceStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0473"));
-			iTest->LogSubTest(_L("Testing ScanLine length invariant"));
-			TEST(iTest->TestPanicL(CScanLinePanic::RunTest, EWservPanicInvalidParameter, 
-				 CScanLinePanic::TESTCASE_GRAPHICS_WSERV_0473,
-				 (TAny*)iTest->iScreenNumber, _L("WSERV")));
-			break;
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0474
-
-@SYMDEF             DEF116127
-
-@SYMTestCaseDesc    Invariant testing buffer parameter for required size.
-
-@SYMTestActions     Calls CWsScreenDevice::GetScanLine with buffer too small to contain requested data.
-**/            
-		case 7:
-			((CTScreenDeviceStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0474"));
-			iTest->LogSubTest(_L("Testing ScanLine buffer invariant"));
-			TEST(iTest->TestPanicL(CScanLinePanic::RunTest, EWservPanicInvalidParameter,
-				 CScanLinePanic::TESTCASE_GRAPHICS_WSERV_0474,
-				 (TAny*)iTest->iScreenNumber, _L("WSERV")));
-			break;
-		default:
-			((CTScreenDeviceStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTScreenDeviceStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-		}
-	((CTScreenDeviceStep*)iStep)->RecordTestResultL();
-	}
-
-__WS_CONSTRUCT_STEP__(ScreenDevice)
--- a/windowing/windowserver/tauto/TSCRDEV.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TSCRDEV_H__
-#define __TSCRDEV_H__
-
-#include <e32std.h>
-#include "w32std.h"
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-class CTScreenDevice : public CTWsGraphicsBase
-	{
-public:
-	CTScreenDevice(CTestStep* aStep);
-	~CTScreenDevice();
-	void ConstructL();
-	void TestTwipPixelConversions();
-	void TestTwipPixelOverflow();
-	void TwipsCacheFlushL();
-	void CheckBitmapL(CFbsBitmap *aBitmap, const TRect &aRect);
-	void TestScreenToBitmap();
-protected:
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	void doTestScreenToBitmapL();
-	};
-
-class CTScreenDeviceStep : public CTGraphicsStep
-	{
-public:
-	CTScreenDeviceStep();
-protected:
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-class CCachePanic : public CBase
-	{
-protected:
-	CCachePanic()
-		{
-		};
-	~CCachePanic();
-	virtual void TestL();
-	void ConstructL(TInt aScreenNumber, TInt aInt);
-	static TInt DoTest(CCachePanic* aTestClass);
-
-protected:
-	RWsSession iWs;
-	CWsScreenDevice* iWsScrDev;
-	TInt iScreenNumber;
-	TInt iInt;
-	};
-
-class CTwipsPanic : public CCachePanic
-	{
-public:
-	static TInt RunTest(TInt aInt, TAny* aPtr);
-
-private:
-	virtual void TestL();
-	};
-
-class CScanLinePanic : public CCachePanic
-	{
-public:
-	enum ScanLineTestCases
-		{
-		TESTCASE_GRAPHICS_WSERV_0473 = 0,
-		TESTCASE_GRAPHICS_WSERV_0474
-		};
-public:
-	static TInt RunTest(TInt aInt, TAny* aPtr);
-
-private:
-	virtual void TestL();
-
-	// Methods for test cases go here
-private:
-	void TestLengthInvariant();
-	void TestBufferInvariant();
-
-	};
-
-_LIT(KTScreenDeviceStep,"TScreenDevice");
-
-#endif
--- a/windowing/windowserver/tauto/TSCRDEVRESSWITCH.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,581 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Screen device test code
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TSCRDEVRESSWITCH.H"
-
-//Define this to get visible pauses (in test 6: DeviceResSwitchL)
-//#define VISIBLE_PAUSES
-
-//Define this to get extra logging which may be useful in tracking down a fail
-//#define EXTRA_LOGGING
-
-CTScreenDeviceResSwitch::CTScreenDeviceResSwitch(CTestStep* aStep) : CTWsGraphicsBase(aStep)
-	{}
-
-CTScreenDeviceResSwitch::~CTScreenDeviceResSwitch()
-	{}
-
-void CTScreenDeviceResSwitch::ConstructL()
-	{
-	//The following is just another test... it doesn't leave any resources for use by the test class AFAICT...
-	RWsSession aSession;
-	CWsScreenDevice *device1;
-	CWsScreenDevice *device2;
-	CWsScreenDevice *device3;
-
-	aSession.Connect();
-	device1=new(ELeave) CWsScreenDevice(aSession);
-	device1->Construct(iTest->iScreenNumber);
-	delete device1;
-	device1=new(ELeave) CWsScreenDevice(aSession);
-	device1->Construct(iTest->iScreenNumber);
-	device2=new(ELeave) CWsScreenDevice(aSession);
-	device2->Construct(iTest->iScreenNumber);
-	device3=new(ELeave) CWsScreenDevice(aSession);
-	device3->Construct(iTest->iScreenNumber);
-	delete device3;
-	CFbsFont *font;
-	User::LeaveIfError(device1->GetNearestFontToDesignHeightInTwips((CFont *&)font,TFontSpec()));
-	RWindowGroup group(aSession);
-	group.Construct(777);
-	group.SetOwningWindowGroup(TheClient->iGroup->GroupWin()->Identifier());
-	RWindow win(aSession);
-	win.Construct(group,77);
-	CWindowGc *gc=new(ELeave) CWindowGc(device1);
-	gc->Construct();
-	gc->Activate(win);
-	gc->UseFont(font);
-	device1->ReleaseFont(font);
-	aSession.Flush();
-	delete gc;
-	win.Close();
-	group.Close();
-	delete device1;
-	delete device2;
-	aSession.Close();
-	}
-
-	
-class CPrimaryColoursWin : public CTWin
-	{
-public:
-	enum	//various size factors	
-		{  	
-			kShrinkFactor=5,
-			kPlotSize=16,
-			kPlotMargin=4,
-			kPlotWithMargin=kPlotSize+kPlotMargin,
-			kPlotsAccross=3,
-			kPlotsDown=1,
-			kMinWidth=kPlotWithMargin*kPlotsAccross+kPlotMargin,
-			kMinHeight=kPlotWithMargin*kPlotsDown+kPlotMargin,
-		    KNumChannels=3,
-		    KNumColours=256
-		};
-		
-	CPrimaryColoursWin();
-	~CPrimaryColoursWin();
-	//Virtual Function from CTBaseWin
-	void Draw();
-	TInt CountUniquePlottedColours();
-	TInt iDrawn;
-	TInt iNumColours;
-	TBool iBadPixels[KNumChannels][KNumColours];
-	TBuf<0x40> iDisplayText;
-	};
-	
-CPrimaryColoursWin::CPrimaryColoursWin()
-	{
-	for (TInt channelnum=0;channelnum<KNumChannels;channelnum++)
-		{
-		for (TInt colour=0;colour<KNumColours;colour++)
-			{
-			iBadPixels[channelnum][colour]=EFalse;
-			}
-		}
-		
-	iDisplayText.Zero();
-	iDisplayText.Format(_L("Test text"));
-	}
-	
-CPrimaryColoursWin::~CPrimaryColoursWin()
-	{
-
-	}
-	
-void CPrimaryColoursWin::Draw()
-	{
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	iGc->SetPenStyle(CGraphicsContext::ESolidPen);
-	iGc->SetPenColor(TRgb(255, 255, 255));
-	iGc->SetBrushColor(TRgb(0, 0, 0));
-	TSize winSize = Size();
-	iGc->DrawRect(TRect(winSize));
-	
-	CFont* font;
-	TFontSpec fontSpec(_L(""), 300);
-	TheClient->iScreen->GetNearestFontInTwips(font, fontSpec);
-	
-	if (font)
-		{
-		iGc->UseFont(font);
-		TRect r(TPoint(0, 0), Size());
-		r.Shrink(kMinHeight, kMinHeight);
-		iGc->DrawText(iDisplayText, r, font->AscentInPixels(), iGc->ECenter, 0);
-		iGc->DiscardFont();
-		TheClient->iScreen->ReleaseFont(font);
-		}
-	
-	iNumColours = 0;
-	TPoint lhsAbs = Win()->AbsPosition();
-	
-	for(TInt channelnum = 0, channelmul = 1, xoordinate = kPlotMargin; channelnum < KNumChannels; channelnum++, channelmul <<= 8, xoordinate += kPlotWithMargin)
-		{
-		TRgb lastPixel(255, 255, 255, 255);
-		
-		for(TInt colour = 0; colour < KNumColours; colour++)
-			{
-			if(!iBadPixels[channelnum][colour])
-				{
-				iGc->SetPenColor(TRgb(colour * channelmul));				
-				}
-			else
-				{
-				iGc->SetPenColor(TRgb(255, 255, 255));			
-				}
-
-			TPoint point = TPoint(xoordinate + (colour & 0x0f), kPlotMargin + (colour >> 4));
-			iGc->Plot(point);
-			}
-		}
-		
-	iDrawn=ETrue;
-	}
-	
-TInt CPrimaryColoursWin::CountUniquePlottedColours()
-	{
-	iNumColours = 0;
-	TPoint lhsAbs = Win()->AbsPosition();
-	
-	for(TInt channelnum = 0, channelmul = 1, xoordinate = kPlotMargin; channelnum < 3; channelnum++, channelmul <<=8 , xoordinate += kPlotWithMargin)
-		{
-		TRgb lastPixel(255, 255, 255, 255);
-		
-		for(TInt colour = 0; colour < 256; colour++)
-			{
-			TRgb readPixel;
- 			TPoint point = TPoint(xoordinate + (colour & 0x0f), kPlotMargin + (colour >> 4));
-			TheClient->iScreen->GetPixel(readPixel, lhsAbs + point);
-			
-			if(readPixel != lastPixel)
-				{
-				lastPixel = readPixel;
-				iNumColours++;
-				iBadPixels[channelnum][colour] = EFalse;
-				}
-			else
-				{
-				iBadPixels[channelnum][colour] = ETrue;
-				}
-			} // for loop 
-		} // for loop
-		
-	return iNumColours;
-	}
-	
-/**
-	Intended primarily as a visual check that the mode is displayed correctly,
-	for each rotated mode.
-**/
-void    CTScreenDeviceResSwitch::DeviceResSwitchWithRotationsL()
-	{
-	CWsScreenDevice *screen=TheClient->iScreen;
-	TInt originalScreenMode = screen->CurrentScreenMode();
-	TPixelsTwipsAndRotation originalModeSettings;
-	screen->GetScreenModeSizeAndRotation(originalScreenMode,originalModeSettings);
-	CArrayFixFlat<TInt> *rotations=new(ELeave) CArrayFixFlat<TInt>(1);
-	CleanupStack::PushL(rotations);
-	INFO_PRINTF2(_L("ScreenMode and rotation with colour depth. ScreenModes=%i"),TheClient->iScreenModes.Count());
-	
-	for (TInt rr=0,maxrr=3;rr<maxrr;++rr)
-	for (TInt ii=0,maxii=TheClient->iScreenModes.Count();ii<maxii;++ii)
-		{
-		TInt newMode=TheClient->iScreenModes[ii];
-		if (	screen->GetScreenModeOrigin(ii)!=TPoint(0,0)	||	screen->GetScreenModeScale(ii)!=TSize(1,1)	)
-			{
-			INFO_PRINTF2(_L("ScreenMode %i skipped: has scalind and/ or rotation"),ii);
-			INFO_PRINTF1(_L("This scaling code is known to be broken if all modes do not support scaling"));
-			INFO_PRINTF1(_L("See defect DEF111847 and break request 2226"));
-			INFO_PRINTF5(_L("Origin: %i %i Scale %i %i"),
-					screen->GetScreenModeOrigin(ii).iX,screen->GetScreenModeOrigin(ii).iY,
-					screen->GetScreenModeScale(ii).iWidth,screen->GetScreenModeScale(ii).iHeight
-				);
-			continue;
-			}
-			
-		screen->SetAppScreenMode(newMode);
-		screen->SetScreenMode(newMode);
-		TInt currentScreenMode = screen->CurrentScreenMode();
-		TEST(currentScreenMode == newMode);
-
-		User::LeaveIfError(screen->GetRotationsList(newMode,rotations));
-		INFO_PRINTF4(_L("ScreenMode and rotation with colour depth. Mode#%i=%i. Rotations=%i"),ii,newMode,rotations->Count());
-		TPixelsTwipsAndRotation currentModeSettings;
-		screen->GetDefaultScreenSizeAndRotation(currentModeSettings);
-		screen->SetScreenSizeAndRotation(currentModeSettings);
-		for (TInt jj=0,maxjj=rotations->Count();jj<maxjj;jj++)
-			{
-			CFbsBitGc::TGraphicsOrientation newOrientation=STATIC_CAST(CFbsBitGc::TGraphicsOrientation,rotations[0][jj]);
-			INFO_PRINTF3(_L("ScreenMode and rotation with colour depth. Rotation#%i=%i(0..3)"),jj,newOrientation);
-			screen->SetCurrentRotations(newMode,newOrientation);
-			TheClient->iWs.Flush();
-			
-			TPixelsAndRotation modeSettings;
-			TheClient->iScreen->GetDefaultScreenSizeAndRotation(modeSettings);
-			TRect screenRect(TPoint(0,0),modeSettings.iPixelSize);
-
-			//move the debug windows to inside the area 
-			//actually don't bother yet!
-			if (screenRect.Width()>screenRect.Height())
-				{
-				}
-			else
-				{
-				}
-			DeviceResSwitchL();
-			}
-		screen->SetCurrentRotations(newMode,currentModeSettings.iRotation);
-		screen->SetScreenSizeAndRotation(currentModeSettings);
-		}
-	
-	CleanupStack::PopAndDestroy();
-	screen->SetScreenMode(originalScreenMode);
-	screen->SetCurrentRotations(originalScreenMode,originalModeSettings.iRotation);
-	screen->SetScreenSizeAndRotation(originalModeSettings);
-	}
-	
-/**
-	Intended primarily as a visual check that the mode is displayed correctly, 
-	this code also verifies that the number of physical colours matches the reported mode.
-	Note that although written to test GCE, this test is general and applies to all display versions.
-**/	
-void CTScreenDeviceResSwitch::DeviceResSwitchL()
-	{		
-	INFO_PRINTF1(_L("DeviceResSwitchL: Entering function"));
-	TInt error = KErrNone;
-	TInt isTransparencySupportedResult = KErrNone;
-		
-	TRAP(error, isTransparencySupportedResult = IsTransparencySupportedL());
-	
-	if(error != KErrNone)
-		{
-		INFO_PRINTF1(_L("DeviceResSwitchL: Transparency is not supported. Exits."));
-		return;
-		}	
-	
-	TRAP(error, CalculateDisplayPropertiesL());
-	
-	if(error != KErrNone)
-		{
-		INFO_PRINTF1(_L("DeviceResSwitchL: Could not calculate display properties. Test not supported. Exits."));
-		return;		
-		}	
-
-	TDisplayMode startDisplayMode = TheClient->iScreen->DisplayMode();
-	TInt startColoursPixel = TDisplayModeUtils::NumDisplayModeColors(startDisplayMode);
-		
-	TPixelsAndRotation modeSettings;
-	TheClient->iScreen->GetDefaultScreenSizeAndRotation(modeSettings);
-	TRect r(TPoint(0, 0), modeSettings.iPixelSize);
-
-	// Starts off full-screen. Only shrink it if it will still be large enough to run the test
-	// It should be... the test only needs 60x20 pixels
-	
-	if(r.Width() > r.Height())
-		{
-		if(r.Width() > (CPrimaryColoursWin::kMinWidth) * (CPrimaryColoursWin::kShrinkFactor-2) * 3 / (CPrimaryColoursWin::kShrinkFactor * 2))
-			{
-			r.iTl.iX = r.iBr.iX / 3;				
-			}
-		}
-	else
-		{
-		if (r.Height() > (CPrimaryColoursWin::kMinHeight) * (CPrimaryColoursWin::kShrinkFactor - 2) * 3/ (CPrimaryColoursWin::kShrinkFactor * 2))
-			{
-			r.iTl.iY = r.iBr.iY / 3;				
-			}
-		}
-	if(r.Width() > (CPrimaryColoursWin::kMinWidth) * (CPrimaryColoursWin::kShrinkFactor - 2) / CPrimaryColoursWin::kShrinkFactor)
-		{
-		if(r.Height() > (CPrimaryColoursWin::kMinHeight) * (CPrimaryColoursWin::kShrinkFactor - 2) / CPrimaryColoursWin::kShrinkFactor)
-			{
-			r.Shrink(r.Width() / CPrimaryColoursWin::kShrinkFactor, r.Height() / CPrimaryColoursWin::kShrinkFactor);
-			}
-		}
-		
-	for(TInt i = 0; i < EColorLast; i++)
-		{
-		TDisplayMode tryMode = TDisplayMode(i);
-		TInt tryColoursPixel = NumDisplayModeColors(tryMode);		
-		
-		INFO_PRINTF3(_L("DeviceResSwitchL: tryColoursPixel = %d, tryMode = %d"), tryColoursPixel, tryMode);
-		
-		if(TDisplayModeUtils::IsDisplayModeColor(tryMode) && startColoursPixel <= tryColoursPixel)
-			{
-				  //Create a test window at this mode, and see if it changes the screen mode
-				{ // The braces define the lifetime of testWin. It must be destroyed before we check if mode changed back successfully.
-				
-				CPrimaryColoursWin* testWin1 = new (ELeave) CPrimaryColoursWin;
-				CleanupStack::PushL(testWin1);
-				
-				TInt expectedColoursPerChannel = 1;
-				TInt tt;
-				
-				testWin1->SetUpL(r.iTl, r.Size(), TheClient->iGroup, *TheClient->iGc, &tryMode);
-				TheClient->iWs.Flush();
-				TDisplayMode newDisplayMode = TheClient->iScreen->DisplayMode();
-				
-				TEST(TDisplayModeUtils::NumDisplayModeColors(newDisplayMode) >= tryColoursPixel);	
-				
-				if(!(TDisplayModeUtils::NumDisplayModeColors(newDisplayMode) >= tryColoursPixel))
-					{
-					ERR_PRINTF3(_L("testWin1: newDisplayMode = %d, tryColoursPixel = %d"), newDisplayMode, tryColoursPixel);
-					}
-				
-				// Estimate the minimum number of shades of primary colours given the bits per pixel.
-				// The maximum is twice this. Very appoximate but seems to work OK for 256 colours. Probably not good for grey modes. 
-				for(tt = tryColoursPixel; tt >= 8; tt >>= 3)
-					{
-					expectedColoursPerChannel <<= 1;
-					}
-					
-				// Draw some test data on the test window.
-			    testWin1->DrawNow();
-				TheClient->iWs.Flush();
-				 
-#ifdef VISIBLE_PAUSES
-			    TheClient->StdLogWindow().LogMessage(EFalse, _L("Mode: "), tryMode);
-				User::After(1000000);
-#endif 
-				TInt numUniqueColours = testWin1->CountUniquePlottedColours();
-				INFO_PRINTF2(_L("testWin1: numUniqueColours = %d"), numUniqueColours);
-			    testWin1->DrawNow();
-			    TheClient->StdLogWindow().LogMessage(EFalse, _L("Channel Colours: "), numUniqueColours);
-				TheClient->iWs.Flush();
-				
-#ifdef VISIBLE_PAUSES
-				User::After(1000000); 
-#endif
-				// Read it back and see if it has the expected quality
-				TEST(numUniqueColours >= (expectedColoursPerChannel * 3));
-				
-				if(!(numUniqueColours >= (expectedColoursPerChannel * 3)))
-					{
-					ERR_PRINTF3(_L("testWin1: numUniqueColours = %d, (expectedColoursPerChannel * 3) = %d"), numUniqueColours, (expectedColoursPerChannel * 3));
-					}				
-		
-				/*
-				 * Defect 107176 was rejected. This test for transparency is therefore removed.
-				 * 
-				 */
-				if (false) //newDisplayMode != startDisplayMode)	 // Hide the window under a startmode window and see if we switch back?
-				if (isTransparencySupportedResult==KErrNone && newDisplayMode != startDisplayMode)	 // Hide the window under a startmode window and see if we switch back?
-				/*
-				 * Defect 107176 was rejected. This test for transparency is therefore removed.
-				 * The crash demonstrated by this code is related to the inconsistant support for origin and scale
-				 * See defect DEF111847 and break request 2226
-				 */
-				if (false) //newDisplayMode != startDisplayMode)	 // Hide the window under a startmode window and see if we switch back?
-					{
-					// Demonstration of defect 107176
-					// Create a translucent window which obscures the high-colour window
-					// The existing code reduces the display colour depth because it thinks the obscured window is not visible any more
-					// However, the obscured window is actually visible trough the transparency
-					CPrimaryColoursWin* testWin2 = new (ELeave) CPrimaryColoursWin;
-					CleanupStack::PushL(testWin2);
-	
-					testWin2->SetUpL(r.iTl - TPoint(20,20), r.Size() + TSize(40,40), TheClient->iGroup, *TheClient->iGc, &startDisplayMode, ETrue, 0x80);
-					TheClient->iWs.Flush();
-				    testWin2->DrawNow();
-					TheClient->iWs.Flush();
-					
-					TDisplayMode newnewDisplayMode = TheClient->iScreen->DisplayMode();
-					TInt newNumUniqueColours = testWin2->CountUniquePlottedColours();	
-					INFO_PRINTF2(_L("testWin2: newNumUniqueColours = %d"), newNumUniqueColours);		
-					
-					TEST(newnewDisplayMode == newDisplayMode);				
-				  
-					if(!(newnewDisplayMode == newDisplayMode))
-						{
-						ERR_PRINTF3(_L("testWin2: newnewDisplayMode = %d, newDisplayMode = %d"), newnewDisplayMode, newDisplayMode);
-						}
-					  
-				    testWin2->DrawNow();
-					TheClient->iWs.Flush();
-					
-#ifdef VISIBLE_PAUSES
-					User::After(1000000); 
-#endif
-					TheClient->iWs.Flush();
-					
-					CleanupStack::PopAndDestroy(testWin2);
-					testWin2 = NULL;						
-					}
-					
-					CleanupStack::PopAndDestroy(testWin1);
-					testWin1 = NULL;
-				}
-			 
-				TDisplayMode afterDisplayMode = TheClient->iScreen->DisplayMode();
-				TEST(afterDisplayMode == startDisplayMode);
-				
-				if(afterDisplayMode != startDisplayMode)
-					{
-					ERR_PRINTF3(_L("DeviceResSwitchL: Original colour depth not restored. Was %i, now %i (TDisplayMode)"), startDisplayMode, afterDisplayMode);						
-					}
-
-#ifdef VISIBLE_PAUSES
-				User::After(1000000); 
-#endif			
-			} // context 
-		} // for loop ends
-		
-	INFO_PRINTF1(_L("DeviceResSwitchL: Returning from function"));		
-	}
-	
-void CTScreenDeviceResSwitch::CalculateDisplayPropertiesL()
-	{
-	INFO_PRINTF1(_L("CalculateDisplayPropertiesL: Entering function"));
-	
-	TDisplayMode tryMode = (TDisplayMode) (EColorLast - 1);
-	TPixelsAndRotation modeSettings;
-	TheClient->iScreen->GetDefaultScreenSizeAndRotation(modeSettings);
-	TRect r(TPoint(0, 0), modeSettings.iPixelSize);
-
-	CPrimaryColoursWin* tempWin = new (ELeave) CPrimaryColoursWin;
-	CleanupStack::PushL(tempWin);
-	
-	tempWin->SetUpL(r.iTl, r.Size(), TheClient->iGroup, *TheClient->iGc, &tryMode);
-	TheClient->iWs.Flush();
-	
-	iMaxDisplayMode = TheClient->iScreen->DisplayMode();
-	INFO_PRINTF2(_L("CalculateDisplayPropertiesL: iMaxDisplayMode %d"), iMaxDisplayMode);
-	iMaxDisplayModeColors = TDisplayModeUtils::NumDisplayModeColors(iMaxDisplayMode);
-	INFO_PRINTF2(_L("CalculateDisplayPropertiesL: iMaxDisplayModeColors %d"), iMaxDisplayModeColors);	
-	
-	CleanupStack::PopAndDestroy(tempWin);
-	INFO_PRINTF1(_L("CalculateDisplayPropertiesL: Returning from function"));
-	}
-	
-TInt CTScreenDeviceResSwitch::NumDisplayModeColors(TDisplayMode aDispMode)
-	{
-	TInt dispModeColors = TDisplayModeUtils::NumDisplayModeColors(aDispMode);
-	
-	if(dispModeColors > iMaxDisplayModeColors)
-		{
-		return iMaxDisplayModeColors;
-		}
-		
-	return dispModeColors;
-	}
-	
-TInt CTScreenDeviceResSwitch::IsTransparencySupportedL()
-	{
-	INFO_PRINTF1(_L("IsTransparencySupportedL: Entering function"));
-	// Creates a window and sets the transparency, if this feature
-	// is not enabled, KErrNotSupported will be returned
-	const TRgb KTransparencyColor(85,85,85);		
-	RWindow win(TheClient->iWs);
-	win.Construct(*TheClient->iGroup->GroupWin(), ENullWsHandle);	
-	win.SetExtent(TPoint(0,0), TSize(50,50));	
-	win.SetRequiredDisplayMode(EColor256);
-	TInt ret = win.SetTransparencyFactor(KTransparencyColor);
-	win.Close();
-	
-	if(!ret)
-		{
-		INFO_PRINTF1(_L("IsTransparencySupportedL: Transparency is supported"));
-		}
-	else
-		{
-		INFO_PRINTF1(_L("IsTransparencySupportedL: Transparency is not supported"));
-		}
-	
-	INFO_PRINTF1(_L("IsTransparencySupportedL: Returning from function"));
-	return ret;
-	}
-
-void CTScreenDeviceResSwitch::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	((CTScreenDeviceResSwitchStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(++iTest->iState)
-		{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0440
-
-@SYMDEF             DEF107176
-
-@SYMTestCaseDesc    Intended primarily as a visual check that the mode is displayed correctly. Checks correct display mode is set.
-                    The test also verifies that the number of physical colours matches the reported mode.
-                    Note that although written to test GCE, this test is general and applies to all display versions.               
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates a windows with a higher display mode. Then creates a transparent
-                    window with lower display mode that completely covers the first window.
-                    Checks the display mode is not changed to the lower diplay mode when 
-                    the higher display mode window is visible through transparency.
-
-@SYMTestExpectedResults The higher display mode should still be set after the second window is drawn.
-*/
-		case 1:
-			((CTScreenDeviceResSwitchStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0440"));
-			iTest->LogSubTest(_L("Device resolution switching"));
-			DeviceResSwitchL();		
-			break;			
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0520
-
-@SYMTestCaseDesc	Test for device switching when mode increased.
-
-@SYMTestActions     Windows are created in increasing modes and pixel colours written and read back.
-					This code verifies that the mode change actually takes place.
-					I am using this visually to verify that the new GCE is actually changing the mode.
-
-**/
-		case 2:
-			((CTScreenDeviceResSwitchStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0520"));
-			iTest->LogSubTest(_L("More device resolution switching"));
-			DeviceResSwitchWithRotationsL();
-			break;
-		default:
-			((CTScreenDeviceResSwitchStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTScreenDeviceResSwitchStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-		}
-	((CTScreenDeviceResSwitchStep*)iStep)->RecordTestResultL();
-	}
-
-__WS_CONSTRUCT_STEP__(ScreenDeviceResSwitch)
--- a/windowing/windowserver/tauto/TSCRDEVRESSWITCH.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TSCRDEVRESSWITCH_H__
-#define __TSCRDEVRESSWITCH_H__
-
-#include <e32std.h>
-#include "w32std.h"
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-class CTScreenDeviceResSwitch : public CTWsGraphicsBase
-	{
-public:
-	CTScreenDeviceResSwitch(CTestStep* aStep);
-	~CTScreenDeviceResSwitch();
-	void ConstructL();
-	void DeviceResSwitchL();
-	void DeviceResSwitchWithRotationsL();
-protected:
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	TInt NumDisplayModeColors(TDisplayMode aDispMode);
-	void CalculateDisplayPropertiesL();
-	TInt IsTransparencySupportedL();
-private:
-	TDisplayMode iMaxDisplayMode;
-	TInt iMaxDisplayModeColors;
-	};
-
-class CTScreenDeviceResSwitchStep : public CTGraphicsStep
-	{
-public:
-	CTScreenDeviceResSwitchStep();
-protected:
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTScreenDeviceResSwitchStep,"TScreenDeviceResSwitch");
-
-#endif
--- a/windowing/windowserver/tauto/TSCREENMODEPOSITIONING.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1164 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test code for screen mode positioning CR
-// GT 0164 Uikon: A3.26. IM 9.
-// Test code for the positioning part of Change Request PHAR-5SJGAM
-// ("Enable screen mode positioning and scaling").
-// Note this feature is also in GT0199 as PREQ673"Screen Positioning".
-// Tests screen position being configurable for a screen mode -
-// eg it is now possible to set in wsini.ini the position on the
-// physical screen where the origin of the screen mode's screen will appear.
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TSCREENMODEPOSITIONING.H"
-#include <graphics/displaycontrol.h>
-
-//#define LOGGING on		//Uncomment this line to get extra logging useful when there is a tests that fails
-
-LOCAL_D TSize FullScreenModeSize;
-LOCAL_D TDisplayMode ScreenDisplayMode;
-LOCAL_D TInt Copy2ndHalfOfScreen;
-
-
-void CBasicWin::Draw()
-	{
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	iGc->SetPenStyle(CGraphicsContext::ENullPen);
-	iGc->SetBrushColor(TRgb(255,0,0));
-	TSize winSize=Size();
-	iGc->DrawRect(TRect(winSize));
-	iGc->SetBrushColor(TRgb(0,221,221));
-	iGc->DrawEllipse(TRect(TPoint(winSize.iWidth/2,winSize.iHeight/2),winSize));
-	iGc->DrawEllipse(TRect(TPoint(-winSize.iWidth/2,-winSize.iHeight/2),winSize));
-	iDrawn=ETrue;
-	}
-
-void CSpriteWin::UpdateState(TInt aState)
-	{
-	SetState(aState);
-	DrawNow();
-	}
-
-TPoint CheckSpritePos(233,60);
-TPoint CheckSpritePos2(18,60);
-
-void CSpriteWin::Draw()
-	{
-	switch(iState)
-		{
-		case 0:
-			iGc->BitBlt(CheckSpritePos,&iSpriteBitmap);
-			break;
-		case 1:
-			iGc->BitBlt(CheckSpritePos+TPoint(30,30),&iSpriteBitmap);
-			iGc->BitBlt(CheckSpritePos,&iSpriteBitmap);
-			break;
-		case 2:
-			iGc->BitBlt(CheckSpritePos2+TPoint(-10,40),&iSpriteBitmap);
-			iGc->BitBlt(CheckSpritePos2+TPoint(-10,20),&iSpriteBitmap);
-			break;
-		case 3:
-			iGc->BitBlt(TPoint(),&iSpriteBitmap);
-			break;
-		default:
-			break;
-		}
-	}
-
-CSpriteWin::~CSpriteWin()
-	{
-	}
-
-void CBmpWin::Draw()
-	{
-	iGc->BitBlt(TPoint(),&iScreenBmp);
-	}
-
-CConnection2::~CConnection2()
-	{
-	delete iScreenBitmap;
-	delete iBitmapWin;
-	delete iSpriteWin;
-	iGroup->GroupWin()->EnableReceiptOfFocus(EFalse);
-	delete iGroup;
-	delete iClient;
-	}
-
-void CConnection2::ConstructL(CTestBase *aTest,CFbsBitmap& aBitmap)
-	{
-	iClient=new(ELeave) CTClient;
-	iClient->SetScreenNumber(aTest->ScreenNumber());
-	iClient->ConstructL();
-	iGroup=new(ELeave) CConnection2Group(iClient,this,aTest);
-	iGroup->ConstructL();
-	iGroup->GroupWin()->EnableScreenChangeEvents();
-	iClient->Flush();
-	iSpriteWin=new(ELeave) CSpriteWin(aBitmap);
-	iSpriteWin->ConstructExtLD(*iGroup,TPoint(),TSize(433,240));
-	User::LeaveIfError(iSpriteWin->BaseWin()->SetRequiredDisplayMode(EColor256));
-	iSpriteWin->AssignGC(*iClient->iGc);
-	iSpriteWin->Activate();
-	iSpriteWin->SetVisible(EFalse);
-	iSpriteWin->BaseWin()->SetShadowDisabled(ETrue);
-	iSpriteWin->BaseWin()->SetShadowHeight(0);
-	iScreenBitmap=new(ELeave) CFbsBitmap();
-	User::LeaveIfError(iScreenBitmap->Create(TSize(FullScreenModeSize.iWidth/2,FullScreenModeSize.iHeight), ScreenDisplayMode));
-	iBitmapWin=new(ELeave) CBmpWin(*iScreenBitmap);
-	iBitmapWin->ConstructExtLD(*iGroup,TPoint(FullScreenModeSize.iWidth/2,0),iScreenBitmap->SizeInPixels());
-	User::LeaveIfError(iBitmapWin->BaseWin()->SetRequiredDisplayMode(EColor256));
-	iBitmapWin->AssignGC(*iClient->iGc);
-	iBitmapWin->Activate();
-	iBitmapWin->SetVisible(EFalse);
-	iBitmapWin->BaseWin()->SetShadowDisabled(ETrue);
-	iBitmapWin->BaseWin()->SetShadowHeight(0);
-	}
-
-void CConnection2::DrawBitmapWin()
-	{
-	TPoint pos=(Copy2ndHalfOfScreen? TPoint() : TPoint(FullScreenModeSize.iWidth/2,0));
-	iBitmapWin->SetPos(pos);
-	iBitmapWin->SetVisible(ETrue);
-	iBitmapWin->DrawNow();
-	iClient->Flush();
-	}
-
-CConnection2Group::CConnection2Group(CTClient *aClient, CConnection2 *aSecondConnection, CTestBase *aTest) : CTWindowGroup(aClient), iTest(aTest), iConnection2(aSecondConnection)
-	{}
-
-
-
-
-//CTScreenModePositioning
-CTScreenModePositioning::CTScreenModePositioning(CTestStep* aStep) : CTWsGraphicsBase(aStep)
-	{
-	}
-
-
-CTScreenModePositioning::~CTScreenModePositioning()
-	{
-	delete iTestWin;
-	delete iConnection2;
-	delete iBlankWin;
-	delete iBackedUpWin;
-	delete iTestChildWin;
-	}
-
-void CTScreenModePositioning::ConstructL()
-	{
-	User::LeaveIfError(iSpriteBitmap.Load(TEST_BITMAP_NAME,0));
-	iScalingSupported=CheckScalingSupportedOrNot();
-	TheClient->iScreen->SetScreenMode(TheClient->iScreenModes[0]);
-	FullScreenModeSize=TheClient->iScreen->SizeInPixels();
-	ScreenDisplayMode=TheClient->iScreen->DisplayMode();
-	iConnection2=new(ELeave) CConnection2;
-	iConnection2->ConstructL(iTest,iSpriteBitmap);
-	iBlankWin=new(ELeave) CTBlankWindow();
-	iBlankWin->ConstructL(*TheClient->iGroup);
-	User::LeaveIfError(iBlankWin->BaseWin()->SetRequiredDisplayMode(EColor256));
-	iBlankWin->SetExt(TPoint(),FullScreenModeSize);
-	iBlankWin->SetVisible(EFalse);
-	iBlankWin->Activate();
-	iTestWin=new(ELeave) CBasicWin;
-	iTestWin->ConstructExtLD(*TheClient->iGroup,TPoint(),FullScreenModeSize);
-	User::LeaveIfError(iTestWin->BaseWin()->SetRequiredDisplayMode(EColor256));
-	iTestWin->AssignGC(*TheClient->iGc);
-	iTestWin->BaseWin()->SetShadowDisabled(ETrue);
-	iTestWin->BaseWin()->SetShadowHeight(0);
-	iTestWin->SetVisible(EFalse);
-	iTestWin->Activate();
-	iBackedUpWin=new(ELeave) CTBackedUpWin(EColor256);
-	iBackedUpWin->ConstructExtLD(*iTestWin,TPoint(),FullScreenModeSize);
-	iBackedUpWin->SetVisible(EFalse);
-	iBackedUpWin->Activate();
-	iTestChildWin=new(ELeave) CTBlankWindow();
-	iTestChildWin->ConstructL(*iTestWin);
-	User::LeaveIfError(iTestChildWin->BaseWin()->SetRequiredDisplayMode(EColor256));
-	iTestChildWin->BaseWin()->SetShadowDisabled(ETrue);
-	iTestChildWin->SetColor(KRgbGreen);
-	iTestChildWin->BaseWin()->SetVisible(EFalse);
-	iTestChildWin->Activate();
-	//The Cursor appearing on screen will affect the result of RectCompare function. 
-	//Set it to the position out of the screen
-	TheClient->iWs.SetPointerCursorPosition(TPoint(-1,-1));
-	}
-
-void CTScreenModePositioning::ChangeScreenMode(CTClient* aClient,TPixelsAndRotation aPixelsAndRotation,TInt aMode)
-	{
-	ChangeScreenMode(aClient,aPixelsAndRotation,ESizeEnforcementNone,aMode);
-	}
-
-void CTScreenModePositioning::ChangeScreenMode(CTClient* aClient,TPixelsAndRotation aPixelsAndRotation,TScreenModeEnforcement aScreenModeEnforcement,TInt aMode)
-	{
-	aClient->iScreen->SetScreenSizeAndRotation(aPixelsAndRotation);
-	aClient->iScreen->SetScreenModeEnforcement(aScreenModeEnforcement);
-	aClient->iScreen->SetScreenMode(aMode);
-	}
-
-void CTScreenModePositioning::SetScreenMode(CTClient* aClient,TInt aMode,TScreenModeEnforcement aScreenModeEnforcement)
-	{
-	TPixelsAndRotation pixelsAndRotation;
-	aClient->iScreen->SetScreenModeEnforcement(aScreenModeEnforcement);
-	aClient->iScreen->SetScreenMode(aMode);
-	aClient->iScreen->GetDefaultScreenSizeAndRotation(pixelsAndRotation);
-	aClient->iScreen->SetScreenSizeAndRotation(pixelsAndRotation);
-	aClient->Flush();
-	}
-
-void CTScreenModePositioning::SetUpSpriteLC(RWsSprite &aSprite, RWsSession &aSession, RWindowTreeNode &aWindow,TInt aFlags)
-	{
-	aSprite=RWsSprite(aSession);
-	User::LeaveIfError(aSprite.Construct(aWindow,TPoint(),aFlags));
-	CleanupClosePushL(aSprite);
-	TSpriteMember member;
-	iTest->SetUpMember(member);
-	member.iBitmap=&iSpriteBitmap;
-	User::LeaveIfError(aSprite.AppendMember(member));
-	User::LeaveIfError(aSprite.Activate());
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0098
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Window Tests. Please see test cases GRAPHICS-WSERV-(0099-0103) which are a subset of this test case.
-					REQUIREMENT: CR PHAR-5SJGAM, PREQ673
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Tests on windows in different screen modes each with differing screen mode origin's defined in the
-					wsini file. This test case only tests screen modes with 0 orientation.
-					Goes through each screen mode defined in the wsini file and exercises test cases GRAPHICS-WSERV-(0099-0103) for each mode.
-					For more details see test cases GRAPHICS-WSERV-(0099-0103) which are a subset of this test case.
-
-@SYMTestExpectedResults
-
-*/
-void CTScreenModePositioning::WindowTestsL()
-	{
-	TheClient->iGroup->GroupWin()->EnableScreenChangeEvents();
-	TInt numOfModes=TheClient->iScreenModes.Count();
-	TInt ii;
-	for (ii=0; ii<numOfModes; ++ii)
-		{
-		iCurrentMode=TheClient->iScreenModes[ii];
-		TPixelsAndRotation pixelsAndRotation;
-		iCurrentScreenModeOrigin=TheClient->iScreen->GetScreenModeScaledOrigin(iCurrentMode);
-		iCurrentScreenModeScale=TheClient->iScreen->GetScreenModeScale(iCurrentMode);
-		TheClient->iScreen->GetScreenModeSizeAndRotation(iCurrentMode,pixelsAndRotation);
-		iCurrentScreenModeSize=pixelsAndRotation.iPixelSize;
-		if (iCurrentScreenModeOrigin.iX<=FullScreenModeSize.iWidth/2-10 /*&& iCurrentScreenModeOrigin!=TPoint() */&& pixelsAndRotation.iRotation==CFbsBitGc::EGraphicsOrientationNormal)
-			{
-		#if defined(LOGGING)
-			_LIT(KLog,"Test mode %d");
-			LOG_MESSAGE2(KLog,ii);
-		#endif
-			TRAPD(ret,DoWindowTestsL());
-			if (ret==KErrNone)
-				continue;
-			RestoreScreenMode();
-			if (ret<KErrNone)
-				TEST(EFalse);
-			else
-				User::Leave(ret);
-			}
-		}
-	}
-
-void CTScreenModePositioning::DoWindowTestsL()
-	{
-	// Make this visible so that the display mode remains EColor256
-	iBlankWin->SetVisible(ETrue);
-	Copy2ndHalfOfScreen=(iCurrentScreenModeOrigin.iX>FullScreenModeSize.iWidth/2? 1 : 0);
-	TInt testWinWidth=Max(FullScreenModeSize.iWidth/2-iCurrentScreenModeOrigin.iX,iCurrentScreenModeOrigin.iX-FullScreenModeSize.iWidth/2);
-	iTestWinSize=TSize(testWinWidth,FullScreenModeSize.iHeight-iCurrentScreenModeOrigin.iY-60);
-	iTestWinSize.iWidth/=(iCurrentScreenModeScale.iWidth > 1 ? iCurrentScreenModeScale.iWidth*2 : iCurrentScreenModeScale.iWidth);
-	iTestWinSize.iHeight/=(iCurrentScreenModeScale.iHeight > 1 ? iCurrentScreenModeScale.iHeight*2 : iCurrentScreenModeScale.iHeight);
-#if defined(LOGGING)
-	_LIT(KLog1,"  PosTest1");
-	LOG_MESSAGE(KLog1);
-#endif
-	PositionTest1L(TPoint());
-#if defined(LOGGING)
-	_LIT(KLog2,"  PosTest2");
-	LOG_MESSAGE(KLog2);
-#endif
-	PositionTest1L(TPoint(25,35));
-#if defined(LOGGING)
-	_LIT(KLog3,"  PosTest3");
-	LOG_MESSAGE(KLog3);
-#endif
-	PositionTest2L(TPoint(10,10));
-#if defined(LOGGING)
-	_LIT(KLog4,"  GetInvalidRegion");
-	LOG_MESSAGE(KLog4);
-#endif
-	GetInvalidRegionTestL(TPoint(10,10));
-#if defined(LOGGING)
-	_LIT(KLog5,"  CreateWin1");
-	LOG_MESSAGE(KLog5);
-#endif
-	CreateWindowsTestL(TPoint());
-#if defined(LOGGING)
-	_LIT(KLog6,"  CreateWin2");
-	LOG_MESSAGE(KLog6);
-#endif
-	CreateWindowsTestL(TPoint(33,15));
-#if defined(LOGGING)
-	_LIT(KLog7,"  NextMode");
-	LOG_MESSAGE(KLog7);
-#endif
-	NextScreenModeTestL(TPoint(12,6));
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0099
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Position Test 1
-					REQUIREMENT: CR PHAR-5SJGAM, PREQ673
-					API: RWindowBase::InquireOffset(), RWindowBase::AbsPosition(),RWindowBase::Position()
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Sets the new screen mode on the main client's screen device. Checks that an window whose group window
-					has this screen device is in the correct position and for the origin of the new screen mode.
-					(Does this by copying the window to a bitmap, switching back to screen mode 0 and then setting the position
-					of the window to be the expected position. Then the bitmap is blitted to the other half of the screen and the
-					2 halves of the screen compared)
-
-@SYMTestExpectedResults Checks the window is positioned correctly for the origin of the new screen mode.
-
-*/
-void CTScreenModePositioning::PositionTest1L(TPoint aPos)
-	{
-    ((CTScreenModePositioningStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0099"));    
-	SetScreenMode(TheClient,iCurrentMode,ESizeEnforcementPixelsAndRotation);
-	iTestWin->SetExt(aPos,iTestWinSize);
-	iTestWin->SetVisible(ETrue);
-	iTestWin->Invalidate();
-	TheClient->Flush();
-	TestTopClientWindowPositionAPIs(aPos,iTestWin->BaseWin());
-	TheClient->WaitForRedrawsToFinish();
-	CopyAndCompareL(aPos);
-	((CTScreenModePositioningStep*)iStep)->RecordTestResultL();
-	}
-
-template <TBool newstate>
-class TCleanupSetVisible:public TCleanupItem
-	{
-	static void Cleanup(void*v)
-		{
-			((CTWinBase*)v)[0].SetVisible(newstate);
-		}
-	public:
-	TCleanupSetVisible(CTWinBase* v): 
-		TCleanupItem(Cleanup,v)	
-		{}
-	};
-
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0100
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Position Test 2
-					REQUIREMENT: CR PHAR-5SJGAM, PREQ673
-					API: RWindowBase::SetPosition(),RWindowBase::InquireOffset(), RWindowBase::AbsPosition(),RWindowBase::Position()
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     As in test case GRAPHICS-WSERV-0099 but also tests moving and resizing the window and also does these tests on a backed up child window.
-
-@SYMTestExpectedResults Checks both the windows are positioned correctly for the origin of the new screen mode.
-
-*/
-void CTScreenModePositioning::PositionTest2L(TPoint aPos)
-	{
-	((CTScreenModePositioningStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0100"));
-	SetScreenMode(TheClient,iCurrentMode,ESizeEnforcementPixelsAndRotation);
-	iTestWin->SetPos(aPos);
-
-	CleanupStack::PushL(TCleanupSetVisible<EFalse>(iBackedUpWin));
-	iTestWin->SetVisible(ETrue);
-	TestTopClientWindowPositionAPIs(aPos,iTestWin->BaseWin());
-	TPoint backedUpWinPt=TPoint(iTestWinSize.iWidth/3,iTestWinSize.iHeight/4);
-	iBackedUpWin->SetExtL(backedUpWinPt,TSize(iTestWinSize.iWidth/6,iTestWinSize.iHeight/6));
-	iBackedUpWin->SetVisible(ETrue);
-	TestChildWindowPositionAPIs(backedUpWinPt,aPos,iBackedUpWin->BaseWin(),iTestWin->BaseWin());
-	aPos+=TPoint(20,20);
-	iTestWin->SetPos(aPos);
-	TestTopClientWindowPositionAPIs(aPos,iTestWin->BaseWin());
-	TestChildWindowPositionAPIs(backedUpWinPt,aPos,iBackedUpWin->BaseWin(),iTestWin->BaseWin());
-	iTestWin->Invalidate();
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	TestTopClientWindowPositionAPIs(aPos,iTestWin->BaseWin());
-	TestChildWindowPositionAPIs(backedUpWinPt,aPos,iBackedUpWin->BaseWin(),iTestWin->BaseWin());
-	CopyAndCompareL(aPos);
-	CleanupStack::PopAndDestroy(iBackedUpWin);	//TCleanupSetVisible
-	((CTScreenModePositioningStep*)iStep)->RecordTestResultL();
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0101
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Invalid Region Test
-					REQUIREMENT: CR PHAR-5SJGAM, PREQ673
-					API: RWindow::GetInvalidRegion()
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Sets the new screen mode, then invalidates different parts of the test window. Checks that the above API gets
-					the correct invalid area from the server. Also tests moving the invalid area.
-
-@SYMTestExpectedResults Checks the invalid region is correct for the origin of the new screen mode.
-
-*/
-void CTScreenModePositioning::GetInvalidRegionTestL(TPoint aPos)
-	{
-	((CTScreenModePositioningStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0101"));
-	SetScreenMode(TheClient,iCurrentMode,ESizeEnforcementPixelsAndRotation);
-	iTestWin->SetExt(aPos,iTestWinSize);
-	iTestWin->SetVisible(ETrue);
-	iTestChildWin->SetExt(TPoint(iTestWinSize.iWidth>>2,iTestWinSize.iHeight>>2),TSize(iTestWinSize.iWidth>>1,iTestWinSize.iHeight>>1));
-	iTestChildWin->SetVisible(ETrue);
-	iTestWin->Win()->BeginRedraw();
-	iTestWin->Win()->EndRedraw();
-	const TInt KNumRects=3;
-	TRect rects[KNumRects];
-	rects[0]=TRect(1,1,5,2);
-	rects[1]=TRect(TPoint(iTest->StdTestWindowSize().iWidth>>1,iTest->StdTestWindowSize().iHeight>>1),iTest->StdTestWindowSize());
-	rects[2]=TRect(2,0,4,5);
-	RRegion region;
-	CleanupClosePushL(region);
-	for (TInt index=0;index<KNumRects;++index)
-		{
-		iTestWin->Invalidate(rects[index]);
-		region.AddRect(rects[index]);
-		}
-	//PeterI original wserv assumes a region hidden beneath a child is not invalid
-	//Mk3 doesn't make this assumption 
-	//TRect subRect;
-	//subRect.iTl=iTestChildWin->BaseWin()->InquireOffset(*iTestWin->BaseWin());
-	//subRect.SetSize(iTestChildWin->Size());
-	//region.Tidy();
-	//region.SubRect(subRect);
-	//region.ClipRect(TRect(iTestWin->Size()));
-	RRegion invalidRegion;
-	CleanupClosePushL(invalidRegion);
-	iTestWin->Win()->GetInvalidRegion(invalidRegion);
-	CompareRegionsL(region,invalidRegion);
-	CleanupStack::PopAndDestroy(2,&region);
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	iTestChildWin->SetVisible(EFalse);
-	TRect rect1(TPoint(0,0),iTestWinSize);
-	TestGetInvalidRegionL(rect1);
-	TInt width=iTestWinSize.iWidth;
-	TInt height=iTestWinSize.iHeight;
-	TRect rect2(TPoint(width/6,height/6),TSize(width/3,height/3));
-	TestGetInvalidRegionL(rect2);
-	iTestWin->Invalidate();
-	iTestWin->SetPos(TPoint(15,15));
-	iTestWin->SetPos(TPoint());
-	iTestWin->SetPos(TPoint(-15,-15));
-	iTestWin->SetPos(aPos);
-	RRegion invalid;
-	RRegion testRegion(rect1);
-	CleanupClosePushL(invalid);
-	CleanupClosePushL(testRegion);
-	iTestWin->Win()->GetInvalidRegion(invalid);
-	TBool err=invalid.CheckError();
-	TEST(!err);
-	if (err)
-		{
-		_LIT(KLog,"Returned Invalid Region has an error");
-		LOG_MESSAGE(KLog);
-		}
-
-	TEST(invalid.BoundingRect().iBr.iX<=iTestWinSize.iWidth);
-	if (invalid.BoundingRect().iBr.iX>iTestWinSize.iWidth)
-		{
-		_LIT(KLog,"Invalid Region extends beyond right edge of window");
-		LOG_MESSAGE(KLog);
-		}
-
-	CompareRegionsL(testRegion,invalid);
-	CleanupStack::PopAndDestroy(2,&invalid);
-	iTestWin->DrawNow();
-	TheClient->Flush();
-	CopyAndCompareL(aPos);
-	((CTScreenModePositioningStep*)iStep)->RecordTestResultL();
-	}
-
-void CTScreenModePositioning::CopyAndCompareL(TPoint aPos)
-	{
-	CopyScreenAndChangeBackToDefScrModeL();
-	iTestWin->SetPos(iCurrentScreenModeOrigin+aPos);
-	iConnection2->DrawBitmapWin();
-	TheClient->WaitForRedrawsToFinish();
-	TestRect();
-	iConnection2->BitmapWin()->SetVisible(EFalse);
-	iTestWin->SetVisible(EFalse);
-	}
-
-void CTScreenModePositioning::TestGetInvalidRegionL(TRect& aRect)
-	{
-	RRegion testRegion;
-	RRegion invalid;
-	iTestWin->Invalidate(aRect);
-	testRegion.AddRect(aRect);
-	iTestWin->Win()->GetInvalidRegion(invalid);
-	CompareRegionsL(testRegion,invalid);
-	invalid.Close();
-	testRegion.Close();
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	}
-
-void CTScreenModePositioning::CompareRegionsL(const TRegion &aRegion1,const TRegion &aRegion2)
-	{
-	_LIT(KLog,"Regions do not contain same area.");
-	RRegion tmp;
-	tmp.Copy(aRegion1);
-	tmp.SubRegion(aRegion2);
-	if (tmp.CheckError())
-		User::Leave(KErrNoMemory);
-	TBool retVal1=tmp.IsEmpty();
-	TEST(retVal1);
-	if (!retVal1)
-		LOG_MESSAGE(KLog);
-
-	tmp.Copy(aRegion2);
-	tmp.SubRegion(aRegion1);
-	if (tmp.CheckError())
-		User::Leave(KErrNoMemory);
-	TBool retVal2=tmp.IsEmpty();
-	TEST(retVal2);
-	if (!retVal2 && retVal1)
-		LOG_MESSAGE(KLog);
-
-	tmp.Close();
-	}
-
-void CTScreenModePositioning::TestTopClientWindowPositionAPIs(TPoint aPos,RWindowBase* aWin)
-	{
-	TEST(aWin->AbsPosition()==aPos);
-	TEST(aWin->Position()==aPos);
-	TEST(aWin->InquireOffset(*TheClient->iGroup->GroupWin())==aPos);
-	}
-
-void CTScreenModePositioning::TestChildWindowPositionAPIs(TPoint aPos,TPoint aParentPos,RWindowBase* aWin,RWindowBase* aParentWin)
-	{
-	TEST(aWin->AbsPosition()==aParentPos+aPos);
-	TEST(aWin->Position()==aPos);
-	TEST(aWin->InquireOffset(*TheClient->iGroup->GroupWin())==aParentPos+aPos);
-	TEST(aWin->InquireOffset(*aParentWin)==aPos);
-	}
-
-void CTScreenModePositioning::RestoreScreenMode()
-	{
-	TPixelsAndRotation pixelsAndRotation;
-	pixelsAndRotation.iPixelSize=FullScreenModeSize;
-	TheClient->iScreen->GetDefaultScreenSizeAndRotation(pixelsAndRotation);
-	ChangeScreenMode(TheClient,pixelsAndRotation,ESizeEnforcementNone,TheClient->iScreenModes[0]);
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0102
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Create Windows Test
-					REQUIREMENT: CR PHAR-5SJGAM, PREQ673
-					API: RWindowBase::SetPosition(),RWindowBase::InquireOffset(), RWindowBase::AbsPosition(),RWindowBase::Position()
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     As in test case GRAPHICS-WSERV-0100 but tests windows that are created in the new screen mode. Also tests moving and resizing these windows
-
-@SYMTestExpectedResults Checks both the windows are positioned correctly for the origin of the new screen mode.
-
-*/
-void CTScreenModePositioning::CreateWindowsTestL(TPoint aPos)
-	{
-	((CTScreenModePositioningStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0102"));
-	SetScreenMode(TheClient,iCurrentMode,ESizeEnforcementPixelsAndRotation);
-	CBasicWin* basicWin=new(ELeave) CBasicWin;
-	basicWin->ConstructExtLD(*TheClient->iGroup,aPos,iTestWinSize);
-	CleanupStack::PushL(basicWin);
-	TInt mode=basicWin->BaseWin()->SetRequiredDisplayMode(EColor256);
-	basicWin->AssignGC(*TheClient->iGc);
-	basicWin->BaseWin()->SetShadowDisabled(ETrue);
-	basicWin->BaseWin()->SetShadowHeight(0);
-	basicWin->Activate();
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	TestTopClientWindowPositionAPIs(aPos,basicWin->BaseWin());
-	CTBlankWindow* blankChildWin=new(ELeave) CTBlankWindow ;
-	CleanupStack::PushL(blankChildWin);
-	blankChildWin->ConstructL(*basicWin);
-	blankChildWin->BaseWin()->SetRequiredDisplayMode(EColor256);
-	blankChildWin->BaseWin()->SetShadowDisabled(ETrue);
-	blankChildWin->SetColor(KRgbYellow);
-	TPoint childPos(iTestWinSize.iWidth/4,iTestWinSize.iHeight/4);
-	blankChildWin->SetExtL(childPos,TSize(iTestWinSize.iWidth/2,iTestWinSize.iHeight/2));
-	blankChildWin->Activate();
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	TestChildWindowPositionAPIs(childPos,aPos,blankChildWin->BaseWin(),basicWin->BaseWin());
-	blankChildWin->SetPos(TPoint(-15,-20));
-	TheClient->Flush();
-	basicWin->DrawNow();
-	TestChildWindowPositionAPIs(TPoint(-15,-20),aPos,blankChildWin->BaseWin(),basicWin->BaseWin());
-	CopyScreenAndChangeBackToDefScrModeL();
-	basicWin->SetPos(iCurrentScreenModeOrigin+aPos);
-	iConnection2->DrawBitmapWin();
-	TheClient->WaitForRedrawsToFinish();
-	TestRect();
-	iConnection2->BitmapWin()->SetVisible(EFalse);
-	iTestWin->SetVisible(EFalse);
-	CleanupStack::PopAndDestroy(blankChildWin);
-	CleanupStack::PopAndDestroy(basicWin);
-	((CTScreenModePositioningStep*)iStep)->RecordTestResultL();
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0103
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Changing to next screen mode
-					REQUIREMENT: CR PHAR-5SJGAM, PREQ673
-					API: RWindowBase::SetPosition(),RWindowBase::InquireOffset(), RWindowBase::AbsPosition(),RWindowBase::Position()
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Sets the new screen mode, creates a new child window and then changes to the next screen mode with non-zero origin,
-					checks windows are in the expected position for the origin of the new screen mode.
-
-@SYMTestExpectedResults Checks both the windows are positioned correctly for the origin of the new screen mode.
-
-*/
-void CTScreenModePositioning::NextScreenModeTestL(TPoint aPos)
-	{
-	((CTScreenModePositioningStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0103"));
-	if (iCurrentScreenModeOrigin==TPoint())
-		{
-		return;
-		}
-	TInt numOfModes=TheClient->iScreenModes.Count();
-	TInt defaultMode=TheClient->iScreenModes[0];
-	TInt lastMode=TheClient->iScreenModes[numOfModes-1];
-	TInt mode=(iCurrentMode<lastMode? iCurrentMode:defaultMode);
-	// find current mode index
-	TInt ii;
-	TInt modeIdx=0;
-	for (ii=0; ii<numOfModes; ++ii)
-		{
-		if (mode==TheClient->iScreenModes[ii])
-			{
-			modeIdx=ii;
-			break;
-			}
-		}
-	TPoint screenModeOrigin(0,0);
-	TPixelsAndRotation pixelsAndRotation;
-	while (screenModeOrigin==TPoint()||(pixelsAndRotation.iRotation!=CFbsBitGc::EGraphicsOrientationNormal))
-		{
-		mode=(mode==lastMode? defaultMode : TheClient->iScreenModes[++modeIdx]);
-		if (mode==iCurrentMode)
-			{
-			return;
-			}
-		else if (mode==lastMode)
-			{
-			modeIdx=0;
-			}		
-		screenModeOrigin=TheClient->iScreen->GetScreenModeOrigin(mode);
-		TheClient->iScreen->GetScreenModeSizeAndRotation(mode,pixelsAndRotation);
-		}
-	SetScreenMode(TheClient,iCurrentMode,ESizeEnforcementPixelsAndRotation);
-	iTestWin->SetExt(aPos,iTestWinSize);
-	iTestWin->SetVisible(ETrue);
-	TheClient->Flush();
-	CBasicWin* basicWin=new(ELeave) CBasicWin;
-	CleanupStack::PushL(basicWin);
-	basicWin->ConstructExtLD(*iTestWin,TPoint(),TSize(iTestWinSize.iWidth/5,iTestWinSize.iHeight/5));
-	User::LeaveIfError(basicWin->BaseWin()->SetRequiredDisplayMode(EColor256));
-	basicWin->AssignGC(*TheClient->iGc);
-	basicWin->BaseWin()->SetShadowDisabled(ETrue);
-	basicWin->BaseWin()->SetShadowHeight(0);
-	basicWin->Activate();
-	TPoint pos(iTestWinSize.iWidth/3,iTestWinSize.iWidth/4);
-	basicWin->SetPos(pos);
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	TestChildWindowPositionAPIs(pos,aPos,basicWin->BaseWin(),iTestWin->BaseWin());
-	iCurrentScreenModeScale=TheClient->iScreen->GetScreenModeScale(mode);
-	iCurrentScreenModeOrigin=TheClient->iScreen->GetScreenModeOrigin(mode);
-	iTestWinSize.iWidth/=(iCurrentScreenModeScale.iWidth > 1 ? iCurrentScreenModeScale.iWidth*2 : iCurrentScreenModeScale.iWidth);
-	iTestWinSize.iHeight/=(iCurrentScreenModeScale.iHeight > 1 ?  iCurrentScreenModeScale.iHeight*2 : iCurrentScreenModeScale.iHeight);
-	iTestWin->SetExt(aPos,iTestWinSize);
-	SetScreenMode(TheClient,mode,ESizeEnforcementPixelsAndRotation);
-	CopyScreenAndChangeBackToDefScrModeL();
-	iTestWin->SetPos(aPos+iCurrentScreenModeOrigin);
-	basicWin->SetPos(pos);
-	iConnection2->DrawBitmapWin();
-	TestRect();
-	iConnection2->BitmapWin()->SetVisible(EFalse);
-	iTestWin->SetVisible(EFalse);
-	CleanupStack::PopAndDestroy(basicWin);
-	iCurrentScreenModeOrigin=TheClient->iScreen->GetScreenModeOrigin(iCurrentMode);
-	((CTScreenModePositioningStep*)iStep)->RecordTestResultL();
-	}
-
-void CTScreenModePositioning::CopyScreenAndChangeBackToDefScrModeL()
-	{
-	// clear the content of bitmap before it is used for copying
-	ClearBitmap(iConnection2->iScreenBitmap);
-
-	// Copy the current content of the screen before moving to screen sizemode 0.
-	if (!iScalingSupported)
-		{
-		TPoint pt=(Copy2ndHalfOfScreen? TPoint(FullScreenModeSize.iWidth/2,0) : TPoint());
-		User::LeaveIfError(iConnection2->iClient->iScreen->CopyScreenToBitmap(iConnection2->iScreenBitmap,TRect(pt,TSize(FullScreenModeSize.iWidth/2,FullScreenModeSize.iHeight))));
-		}
-	else
-		{
-		TPoint pt=(Copy2ndHalfOfScreen? TPoint((iCurrentScreenModeSize.iWidth+iCurrentScreenModeOrigin.iX)/2,0) : -iCurrentScreenModeOrigin);
-		TPoint ptBottom(FullScreenModeSize.iWidth/2,FullScreenModeSize.iHeight);
-		ptBottom-=iCurrentScreenModeOrigin;
-		ptBottom.iX=(ptBottom.iX>=0 ? ptBottom.iX/iCurrentScreenModeScale.iWidth : ((-ptBottom.iX)*iCurrentScreenModeScale.iWidth+ptBottom.iX)/iCurrentScreenModeScale.iWidth+ptBottom.iX);
-		ptBottom.iY=(ptBottom.iY>=0 ? ptBottom.iY/iCurrentScreenModeScale.iHeight : ((-ptBottom.iY)*iCurrentScreenModeScale.iHeight+ptBottom.iY)/iCurrentScreenModeScale.iHeight+ptBottom.iY);
-		User::LeaveIfError(iConnection2->iClient->iScreen->CopyScreenToBitmap(iConnection2->iScreenBitmap,TRect(pt,ptBottom)));
-		}
-	TheClient->Flush();
-	SetScreenMode(TheClient,TheClient->iScreenModes[0],ESizeEnforcementPixelsAndRotation);
-	TPixelsAndRotation dummySize;
-	dummySize.iPixelSize=TSize(0,0);
-	iConnection2->iClient->iScreen->SetScreenSizeAndRotation(dummySize); //to force an update in the server when we do the next line
-	TPixelsAndRotation pixelsAndRotation;
-	TheClient->iScreen->GetDefaultScreenSizeAndRotation(pixelsAndRotation);
-	iConnection2->iClient->iScreen->SetScreenSizeAndRotation(pixelsAndRotation);
-	iConnection2->iClient->iScreen->SetScreenModeEnforcement(ESizeEnforcementPixelsAndRotation);
-	iConnection2->iClient->iScreen->SetScreenMode(TheClient->iScreenModes[0]);
-	}
-
-TBool CTScreenModePositioning::TestRect()
-	{
-	TSize size(FullScreenModeSize.iWidth/2,FullScreenModeSize.iHeight);
-	TRect right(TPoint(FullScreenModeSize.iWidth/2,0),size);
-	TBool retVal=TheClient->iScreen->RectCompare(TRect(size),right);
-//	User::After(2000000);
-	//Let the pixels cool down for a bit
-	User::After(10);
-	TEST(retVal);
-	if(!retVal)
-		{
-		_LIT(KLog,"Left and Right halves of display don't match. RightHalf=(%d,%d,%d,%d)");
-		LOG_MESSAGE5(KLog,right.iTl.iX,right.iTl.iY,right.iBr.iX,right.iBr.iY);
-		}
-	return retVal;
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0104
-
-@SYMDEF  			DEF081259, DEF111847
-
-@SYMTestCaseDesc    Sprite Tests
-					REQUIREMENT: CR PHAR-5SJGAM, PREQ673
-					API: RWsSprite::SetPosition()
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Test sprites associated with group windows in screen modes with non-zero origin:
-					Sets such a new screen mode and creates 2 sprites.
-					compares these sprites with	some blitted onto the screen in the expected position.
-					Sets the rotation of screen mode to be 180 deg, sets the position of the sprites
-					and does the same as above to compare expected position.
-					Then changes back to screen mode 0 and sets a new positions of the sprites,changes to the new
-					screen mode and checks the sprites have been moved to the correct position.
-					Additionally, as part of defect fix DEF111847, this also loops through all display modes above and including Color256, 
-					and if possible tests each with the above described method. Previously, it use to only test Color256.
-					Display modes lower than EColor256 are not tested as they are not supported for origin change.
-
-@SYMTestExpectedResults Checks the sprites are positioned correctly according to the origin
-					of the new screen mode.
-
-*/
-void CTScreenModePositioning::SpriteTestL()
-	{
-
-#if defined(__WINS__)
-	TBool retVal;
-	if (iScalingSupported)
-		{
-		TDisplayMode curDispMode; // Holds the current display mode being tested 
-		
-		for(curDispMode = EColor256; curDispMode < EColorLast; curDispMode = TDisplayMode(curDispMode+1))
-			{
-			if (curDispMode == ERgb)
-				{
-				continue;
-				}
-			// Set screen mode to 3
-			iCurrentMode=3;
-			SetScreenMode(TheClient,iCurrentMode,ESizeEnforcementPixelsAndRotation);
-			TPoint topLeft(-TheClient->iScreen->GetScreenModeOrigin(iCurrentMode));
-			TPoint botRight(TheClient->iScreen->SizeInPixels().AsPoint());
-
-			// Create a sprite at position (0,0) from current origin
-			RWsSprite sprite;
-			TSize spriteSize=iSpriteBitmap.SizeInPixels();
-			SetUpSpriteLC(sprite,TheClient->iWs,*iBlankWin->BaseWin());
-			TPoint winPos;
-			if (botRight.iX<spriteSize.iWidth)
-				{
-				winPos.iX=botRight.iX-spriteSize.iWidth;
-				iBlankWin->BaseWin()->SetPosition(winPos);
-				}
-			
-			// Now create a spritewin at top left of the visible screen
-			CSpriteWin* spriteWin=new(ELeave) CSpriteWin(iSpriteBitmap);
-			CleanupStack::PushL(spriteWin);
-			spriteWin->ConstructExtLD(*TheClient->iGroup,topLeft,spriteSize);
-			
-			// Set the display mode of the base window
-			TInt setBlankWinDispMode = iBlankWin->BaseWin()->SetRequiredDisplayMode(curDispMode);
-			// Set the display mode of the sprite window
-			TInt setSpriteWinDispMode = spriteWin->BaseWin()->SetRequiredDisplayMode(curDispMode);
-			
-			//Only do the tests if the requested mode was actually set on both windows
-			if(curDispMode == setBlankWinDispMode && curDispMode == setSpriteWinDispMode)
-				{
-				//Create and show DisplayMode details message
-				_LIT(KModeDetails, "Display Mode: ");
-				TBuf<30> modeDetailsMessage(KModeDetails);
-				modeDetailsMessage.Append(DisplayModeAsString(curDispMode));
-				LOG_MESSAGE(modeDetailsMessage);
-			
-				spriteWin->AssignGC(*TheClient->iGc);
-				spriteWin->SetState(3);
-				spriteWin->Activate();
-				spriteWin->DrawNow();
-				TheClient->WaitForRedrawsToFinish();
-				retVal=TheClient->iScreen->RectCompare(TRect(topLeft,spriteSize),TRect(winPos,spriteSize),CWsScreenDevice::EIncludeSprite);
-				TEST(retVal);
-				if(!retVal)
-					{
-					_LIT(KLog,"Initial Drawing of sprite fails - does not compare to same bitmap drawn in window.");
-					LOG_MESSAGE(KLog);
-					}
-
-				// Move position of the window and sprite and then test
-				TPoint spritePos(Min(20,botRight.iX-spriteSize.iWidth-winPos.iX),20);
-				spriteWin->SetExt(topLeft+spritePos,spriteSize);
-				sprite.SetPosition(spritePos);
-				spriteWin->DrawNow();
-				TheClient->WaitForRedrawsToFinish();
-				retVal=TheClient->iScreen->RectCompare(TRect(topLeft+spritePos,spriteSize),TRect(winPos+spritePos,spriteSize),CWsScreenDevice::EIncludeSprite);
-				TEST(retVal);
-				if(!retVal)
-					{
-					_LIT(KLog,"Second position of sprite fails - does not compare to same bitmap drawn in window.");
-					LOG_MESSAGE(KLog);
-					}
-				iBlankWin->BaseWin()->SetPosition(TPoint());
-
-				// Now test the same by moving into other screen mode
-				iCurrentMode=4;
-				SetScreenMode(TheClient,iCurrentMode,ESizeEnforcementNone);
-				spritePos.SetXY(0,160);
-				sprite.SetPosition(spritePos);
-				spriteWin->SetExt(TPoint(),spriteSize);
-				spriteWin->DrawNow();
-				TheClient->WaitForRedrawsToFinish();
-				retVal=TheClient->iScreen->RectCompare(TRect(TPoint(),spriteSize),TRect(spritePos,spriteSize),CWsScreenDevice::EIncludeSprite);
-				TEST(retVal);
-				if(!retVal)
-					{
-					_LIT(KLog,"Third position of sprite fails - does not compare to same bitmap drawn in window.");
-					LOG_MESSAGE(KLog);
-					}
-				}
-
-			CleanupStack::PopAndDestroy(spriteWin);
-			CleanupStack::PopAndDestroy(&sprite);
-			RestoreScreenMode();
-			}
-		}
-	else
-		{
-		const TInt KScreenModeWithOffset = 2;
-		TheClient->iGroup->GroupWin()->EnableScreenChangeEvents();
-		iTestWin->SetVisible(EFalse);
-		TheClient->Flush();
-		iConnection2->iClient->Flush();
-		TheClient->WaitForRedrawsToFinish();
-		TPixelsAndRotation pixelsAndRotation1;
-		TheClient->iScreen->GetScreenModeSizeAndRotation(KScreenModeWithOffset,pixelsAndRotation1);
-		ChangeScreenMode(TheClient,pixelsAndRotation1,KScreenModeWithOffset);
-		RWsSprite sprite[2];
-		for (TInt ii=0;ii<2;ii++)
-			{
-			SetUpSpriteLC(sprite[ii],TheClient->iWs,*TheClient->iGroup->WinTreeNode());
-			}
-		TheClient->Flush();
-		TheClient->WaitForRedrawsToFinish();
-		TPixelsAndRotation pixelsAndRotation2;
-		TheClient->iScreen->GetScreenModeSizeAndRotation(0,pixelsAndRotation2);
-		iConnection2->iSpriteWin->UpdateState(0);
-		iConnection2->iSpriteWin->SetVisible(ETrue);
-		iConnection2->iClient->Flush();
-		TSize spriteSize=iSpriteBitmap.SizeInPixels();
-		TPoint screenMode2Origin;
-		screenMode2Origin=TheClient->iScreen->GetScreenModeOrigin(KScreenModeWithOffset);
-		//Check all reference bitmaps can be drawn inside the screen
-		MDisplayControl* interface = static_cast<MDisplayControl*>
-					(TheClient->iScreen->GetInterface(MDisplayControl::ETypeId));
-		if(interface)
-			{
-			TDisplayConfiguration config;
-			interface->GetConfiguration(config);
-			TSize screenSize;
-			config.GetResolution(screenSize);
-			TEST(screenSize.iWidth > screenMode2Origin.iX+CheckSpritePos.iX+spriteSize.iWidth+30
-					&& screenSize.iHeight > screenMode2Origin.iY+CheckSpritePos.iY + spriteSize.iHeight+30);
-			}
-		
-		retVal = iConnection2->iClient->iScreen->RectCompare(TRect(screenMode2Origin+CheckSpritePos,spriteSize),TRect(screenMode2Origin,spriteSize),CWsScreenDevice::EIncludeSprite);
-		TEST(retVal);
-		if(!retVal)
-			INFO_PRINTF3(_L("iConnection2->iClient->iScreen->RectCompare() return value  - Expected: %d, Actual: %d"), ETrue, retVal);
-
-		TheClient->iScreen->SetCurrentRotations(KScreenModeWithOffset,CFbsBitGc::EGraphicsOrientationRotated180);
-		ChangeScreenMode(TheClient,pixelsAndRotation1,KScreenModeWithOffset);
-		TheClient->Flush();
-		sprite[0].SetPosition(TPoint(0,0));
-		sprite[1].SetPosition(TPoint(30,30));
-		TheClient->Flush();
-		TheClient->WaitForRedrawsToFinish();
-		iConnection2->iSpriteWin->UpdateState(1);
-		iConnection2->iClient->Flush();
-		retVal = iConnection2->iClient->iScreen->RectCompare(TRect(screenMode2Origin+CheckSpritePos,spriteSize+TPoint(30,30)),TRect(screenMode2Origin,spriteSize+TPoint(30,30)),CWsScreenDevice::EIncludeSprite);
-		TEST(retVal);
-		if(!retVal)
-			INFO_PRINTF3(_L("iConnection2->iClient->iScreen->RectCompare() return value  - Expected: %d, Actual: %d"), ETrue, retVal);
-
-		TheClient->iScreen->SetCurrentRotations(KScreenModeWithOffset,CFbsBitGc::EGraphicsOrientationNormal);
-		ChangeScreenMode(TheClient,pixelsAndRotation2,0);
-		iConnection2->iSpriteWin->SetExt(TPoint(215,0),TSize(218,240));
-		TheClient->Flush();
-		TheClient->WaitForRedrawsToFinish();
-		sprite[0].SetPosition(TPoint(-10,20));
-		sprite[1].SetPosition(TPoint(-10,40));
-		TheClient->Flush();
-		TheClient->WaitForRedrawsToFinish();
-		ChangeScreenMode(TheClient,pixelsAndRotation1,ESizeEnforcementPixelsAndRotation,KScreenModeWithOffset);
-		TheClient->Flush();
-		TheClient->WaitForRedrawsToFinish();
-		iConnection2->iSpriteWin->UpdateState(2);
-		iConnection2->iClient->Flush();
-		retVal = iConnection2->iClient->iScreen->RectCompare(TRect(screenMode2Origin+CheckSpritePos+TPoint(0,20),spriteSize+TPoint(-10,20)),TRect(screenMode2Origin+TPoint(0,20),spriteSize+TPoint(-10,20)),CWsScreenDevice::EIncludeSprite);
-		TEST(retVal);
-		if(!retVal)
-			INFO_PRINTF3(_L("iConnection2->iClient->iScreen->RectCompare() return value  - Expected: %d, Actual: %d"), ETrue, retVal);
-
-		CleanupStack::PopAndDestroy(2,&sprite[0]);
-		iConnection2->iSpriteWin->SetVisible(EFalse);
-		ChangeScreenMode(TheClient,pixelsAndRotation2,ESizeEnforcementPixelsAndRotation,0);
-		TheClient->Flush();
-		TheClient->WaitForRedrawsToFinish();
-		}
-#endif
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0105
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Rotation Tests
-					REQUIREMENT: CR PHAR-5SJGAM, PREQ673
-					API: RWindowBase::InquireOffset(), RWindowBase::AbsPosition(),RWindowBase::Position()
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Goes through all the screen modes defined in the wsini file and all the rotations in
-					each screen mode. For each case sets the new screen mode and the the rotation on the current
-					client's screen device. Then sets a suitable size and position of 2 windows (an RWindow
-					and a child RBackedUpWindow) whose group window has the above screen device.
-
-@SYMTestExpectedResults Checks the windows are positioned correctly according to the origin and rotation
-					of the new screen mode.
-
-*/
-void CTScreenModePositioning::RotationTestsL()
-	{
-	RBlankWindow color256(TheClient->iWs);
-	User::LeaveIfError(color256.Construct(*TheClient->iGroup->GroupWin(),ENullWsHandle));
-	CleanupClosePushL(color256);
-	color256.SetRequiredDisplayMode(EColor256);
-	color256.SetOrdinalPosition(2);
-	color256.Activate();
-	TInt ii;
-	for (ii=0;ii<TheClient->iScreenModes.Count();)
-		{
-		iCurrentMode=TheClient->iScreenModes[ii];
-		SetScreenMode(TheClient,iCurrentMode,ESizeEnforcementPixelsAndRotation);
-		TPixelsAndRotation pixelsAndRotation;
-		TheClient->iScreen->GetDefaultScreenSizeAndRotation(pixelsAndRotation);
-		TInt oldCurrentMode=iCurrentMode;
-		CArrayFixFlat<TInt>* rotations=new(ELeave) CArrayFixFlat<TInt>(1);
-		CleanupStack::PushL(rotations);
-		User::LeaveIfError(TheClient->iScreen->GetRotationsList(iCurrentMode,rotations));
-		TInt count=rotations->Count();
-		TInt jj=0;
-		if (count>1)
-			{
-			for (jj=0;jj<count;)
-				{
-				if ((*rotations)[jj++]==pixelsAndRotation.iRotation)
-					{
-					break;
-					}
-				}
-			if (jj==count)
-				{
-				jj=0;
-				}
-			}
-		if (jj==0)
-			{
-			ii++;
-			}
-		TInt currentRotation=(*rotations)[jj];
-		TheClient->iScreen->SetCurrentRotations(oldCurrentMode,REINTERPRET_CAST(CFbsBitGc::TGraphicsOrientation&,currentRotation));
-		CleanupStack::PopAndDestroy(rotations);
-		iCurrentScreenModeOrigin=TheClient->iScreen->GetScreenModeOrigin(oldCurrentMode);
-		iCurrentScreenModeOrigin=TheClient->iScreen->GetScreenModeScaledOrigin(oldCurrentMode);
-		TPoint point1(iCurrentScreenModeOrigin.iX,iCurrentScreenModeOrigin.iY+(iCurrentScreenModeOrigin.iY+pixelsAndRotation.iPixelSize.iHeight)/2);
-		TPoint point2(iCurrentScreenModeOrigin.iX+(iCurrentScreenModeOrigin.iX+pixelsAndRotation.iPixelSize.iWidth)/2,pixelsAndRotation.iPixelSize.iHeight+iCurrentScreenModeOrigin.iY);
-		TRect rect0(point1,point2);
-		iTestWin->SetExtL(TPoint(),rect0.Size());
-		iTestWin->Invalidate();
-		
-		iTestWin->SetVisible(ETrue);
-		TheClient->Flush();
-		TheClient->WaitForRedrawsToFinish();
-		TestTopClientWindowPositionAPIs(TPoint(),iTestWin->BaseWin());
-		TPoint backedUpWinPt=TPoint(rect0.Width()/3,rect0.Height()/4);
-		iBackedUpWin->SetVisible(ETrue);
-
-		CleanupStack::PushL(TCleanupSetVisible<EFalse>(iBackedUpWin));
-		CleanupStack::PushL(TCleanupSetVisible<EFalse>(iTestWin));
-
-		
-		iBackedUpWin->SetExtL(backedUpWinPt,TSize(rect0.Width()/6,rect0.Height()/6));
-		TestChildWindowPositionAPIs(backedUpWinPt,TPoint(),iBackedUpWin->BaseWin(),iTestWin->BaseWin());
-
-		CleanupStack::PopAndDestroy(2,iBackedUpWin); //TCleanupSetVisible
-		}
-	CleanupStack::PopAndDestroy(&color256);
-	}
-
-TBool CTScreenModePositioning::ScalingSupportedByDisplayMode()
-	{
-	//PeterI Standard ScreenDriver only supports scaling in EColor256 and EColor64k
-	//see CDrawBitmap::CanBeScaled(), as mk3 is always in 16mu the tests will not pass.
-	TBool ret=EFalse;
-	TDisplayMode mode=TheClient->iScreen->DisplayMode();
-	if (mode==EColor64K || mode==EColor256)
-		{
-		ret=ETrue;
-		}
-	return ret;
-	}
-void CTScreenModePositioning::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(KWindowTests,"Window Tests");
-	_LIT(KSpriteTest,"Sprite Test");
-	_LIT(KRotationTests,"Rotation Tests");
-	((CTScreenModePositioningStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(iTest->iState)
-		{
-	case 0:
-		((CTScreenModePositioningStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-		if (!CheckNonZeroOriginsSupportedOrNot())
-			{
-			_LIT(KLog,"Non Zero Origins not supported");
-			LOG_MESSAGE(KLog);
-			TestComplete();
-			return;
-			}
-		break;
-	case 1:
-		iTest->LogSubTest(KWindowTests);
-		if(ScalingSupportedByDisplayMode())
-			WindowTestsL();
-		((CTScreenModePositioningStep*)iStep)->SetOverallTestStepID(_L("GRAPHICS-WSERV-0098"));
-		break;
-	case 2:
-		((CTScreenModePositioningStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0104"));
-		iTest->LogSubTest(KSpriteTest);
-		if(ScalingSupportedByDisplayMode())
-			SpriteTestL();
-		break;
-	case 3:
-		((CTScreenModePositioningStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0105"));
-		iTest->LogSubTest(KRotationTests);
-		RotationTestsL();
-		break;
-	default:
-		((CTScreenModePositioningStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-  		((CTScreenModePositioningStep*)iStep)->CloseTMSGraphicsStep();
-		RestoreScreenMode();
-		TestComplete();
-		return;
-		}
-	((CTScreenModePositioningStep*)iStep)->RecordTestResultL();
-	++iTest->iState; // still used in the remaining code
-	}
-
-__WS_CONSTRUCT_STEP__(ScreenModePositioning)
--- a/windowing/windowserver/tauto/TSCREENMODEPOSITIONING.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,123 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-
-#ifndef __TSCREENMODEPOSITIONING_H__
-#define __TSCREENMODEPOSITIONING_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TScreenModeScaling.h"
-#include "TGraphicsHarness.h"
-
-class CConnection2;
-
-class CConnection2Group : public CTWindowGroup
-	{
-public:
-	CConnection2Group(CTClient *aClient, CConnection2 *aSecondConnection, CTestBase *aTest);
-private:
-	CTestBase* iTest;
-public:
-	CConnection2* iConnection2;
-	};
-
-class CConnection2 : public CBase
-	{
-public:
-	~CConnection2();
-	void ConstructL(CTestBase *aTest,CFbsBitmap& aBitmap);
-	void DrawBitmapWin();
-	CBmpWin* BitmapWin() {return iBitmapWin;}
-public:
-	CTClient* iClient;
-	CFbsBitmap* iScreenBitmap;
-	CSpriteWin*	iSpriteWin;
-private:
-	CConnection2Group *iGroup;
-	CBmpWin* iBitmapWin;
-	};
-
-
-
-class CTScreenModePositioning : public CTWsGraphicsBase
-	{
-public:
-	CTScreenModePositioning(CTestStep* aStep);
-	~CTScreenModePositioning();
-	void ConstructL();
-
-	void WindowTestsL();
-	void SpriteTestL();
-	void RotationTestsL();
-	TBool ScalingSupportedByDisplayMode();
-
-protected:
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	TBool TestRect();
-	void CopyScreenAndChangeBackToDefScrModeL();
-	void PositionTest1L(TPoint aPosTSize);
-	void PositionTest2L(TPoint aPos);
-	void GetInvalidRegionTestL(TPoint aPos);
-	void DoWindowTestsL();
-	void CreateWindowsTestL(TPoint aPos);
-	void NextScreenModeTestL(TPoint aPos);
-	void ChangeScreenMode(CTClient* aClient,TPixelsAndRotation aPixelsAndRotation,TInt aMode);
-	void ChangeScreenMode(CTClient* aClient,TPixelsAndRotation aPixelsAndRotation,TScreenModeEnforcement aScreenModeEnforcement,TInt aMode);
-	void SetScreenMode(CTClient* aClient,TInt aMode,TScreenModeEnforcement aScreenModeEnforcement);
-	void SetUpSpriteLC(RWsSprite &aSprite, RWsSession &aSession, RWindowTreeNode &aWindow,TInt aFlags=ESpriteNoShadows);
-	void CompareRegionsL(const TRegion &aRegion1,const TRegion &aRegion2);
-	void TestGetInvalidRegionL(TRect& aRect);
-	void TestTopClientWindowPositionAPIs(TPoint aPos,RWindowBase* aWin);
-	void TestChildWindowPositionAPIs(TPoint aPos,TPoint aParentPos,RWindowBase* aWin,RWindowBase* aParentWin);
-	void CopyAndCompareL(TPoint aPos);
-	void RestoreScreenMode();
-private:
-	CFbsBitmap iSpriteBitmap;
-	CConnection2* iConnection2;
-	CBasicWin *iTestWin;
-	CTBackedUpWin* iBackedUpWin;
-	CTBlankWindow* iBlankWin;
-	CTBlankWindow* iTestChildWin;
-	TInt iCurrentMode;
-	TSize iTestWinSize;
-	TPoint iCurrentScreenModeOrigin;
-	TSize iCurrentScreenModeScale;
-	TSize iCurrentScreenModeSize;
-	TInt iScalingSupported;
- 	};
-
-class CTScreenModePositioningStep : public CTGraphicsStep
-	{
-public:
-	CTScreenModePositioningStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTScreenModePositioningStep,"TScreenModePositioning");
-
-
-#endif
--- a/windowing/windowserver/tauto/TSCRMODE.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1701 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test screen mode switching
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TSCRMODE.H"
-
-const TInt KBlankWinPosX=10;
-const TInt KBlankWinPosY=20;
-const TInt KBlankWinSizeX=30;
-const TInt KBlankWinSizeY=25;
-
-const TInt KScreenMode0=0;
-const TInt KScreenMode1=1;
-_LIT(KScreenModeDisplayMode,"GetScreenModeDisplayMode");
-
-
-CTScrMode::CTScrMode(CTestStep* aStep) : CTWsGraphicsBase(aStep)
-	{
-	}
-
-//
-// Static func to check windows
-//
-
-LOCAL_C TInt DoPanicTest(TInt aInt, TAny *aScreenNumber)
-	{
-	RWsSession ws;
-	CWsScreenDevice *screen=NULL;
-	if (ws.Connect()==KErrNone)
-		{
-		screen = new (ELeave) CWsScreenDevice(ws);
-		if (screen && screen->Construct((TInt)aScreenNumber)==KErrNone)
-			{
-			TPixelsTwipsAndRotation sar;
-			CFbsBitGc::TGraphicsOrientation rot=CFbsBitGc::EGraphicsOrientationNormal;
-			TInt mode=0;
-			switch(aInt)
-				{
-				case 0:
-				case 1:
-					screen->SetScreenMode(aInt==0?1000:-1);
-					break;
-				case 2:
-				case 3:
-					screen->GetScreenModeSizeAndRotation(aInt==2?screen->NumScreenModes():-100000, sar);
-					break;
-				case 4:
-				case 5:
-					screen->GetScreenModeSizeAndRotation(aInt==4?screen->NumScreenModes()+100:-10, sar);
-					break;
-				case 6:
-					mode=screen->NumScreenModes();
-					goto SetRot;
-				case 7:
-					mode=-55;
-					goto SetRot;
-				case 8:
-					mode=234;
-					goto SetRot;
-				case 9:
-					mode=screen->NumScreenModes()+2;
-					rot=CFbsBitGc::EGraphicsOrientationRotated270;
-				SetRot:
-					screen->SetCurrentRotations(mode,rot);
-					break;
-				case 10:
-				case 11:
-					ws.SetPointerCursorArea(aInt==10?1000:-1,TRect());
-					break;
-				case 12:
-				case 13:
-					ws.PointerCursorArea(aInt==12?1003:-2);
-					break;
-				case 14:
-				case 15:
-					{
-					CArrayFixFlat<TInt> *rotations=new(ELeave) CArrayFixFlat<TInt>(1);
-					screen->GetRotationsList(aInt==12?1003:-2,rotations);
-					}
-					break;
-				case 100:
-					rot=CFbsBitGc::EGraphicsOrientationRotated90;
-					goto SetRot;
-				case 101:
-					rot=CFbsBitGc::EGraphicsOrientationRotated270;
-					goto SetRot;
-				case 102:
-					mode=1;
-					rot=CFbsBitGc::EGraphicsOrientationRotated270;
-					goto SetRot;
-				case 103:
-					mode=1;
-				#if defined(__EPOC32__)
-					rot=CFbsBitGc::EGraphicsOrientationRotated180;
-				#else
-					rot=CFbsBitGc::EGraphicsOrientationNormal;
-				#endif
-					goto SetRot;
-				}
-			ws.Flush();
-			}
-		}
-
-	return(EWsExitReasonBad);
-	}
-
-void SetupTestRWindowLC(RWindow& aWindow, const TPoint& aPos, const TSize& aSize, TDisplayMode aDisplayMode)
-	{
-	CleanupClosePushL(aWindow);
-	User::LeaveIfError(aWindow.Construct(*TheClient->iGroup->GroupWin(), (TUint)&aWindow));
-	aWindow.SetExtent(aPos, aSize);
-	User::LeaveIfError(aWindow.SetRequiredDisplayMode(aDisplayMode));
-	aWindow.Activate();
-	}
-
-void CTScrMode::TestPanicsL()
-	{
-	TInt ii;
-	for (ii=0;ii<16;++ii)
-		TEST(iTest->TestWsPanicL(DoPanicTest,EWservPanicScreenModeNumber,ii,(TAny*)iTest->iScreenNumber));
-	for (ii=100;ii<104;++ii)
-		TEST(iTest->TestWsPanicL(DoPanicTest,EWservPanicRotation,ii,(TAny*)iTest->iScreenNumber));
-	iTest->CloseAllPanicWindows();
-	}
-
-CTScrMode::~CTScrMode()
-	{
-	((CTScrModeStep*)iStep)->CloseTMSGraphicsStep();
-	delete iSecondConnection;
-	TheClient->iGroup->GroupWin()->DisableScreenChangeEvents();
-	SetScreenModeEnforcement(iOldEnfMode);
-	}
-
-void CTScrMode::ConstructL()
-	{
-	//Remove next line when bitmaps are stored correctly
-	TestWin->Win()->EnableRedrawStore(EFalse);
-	BaseWin->Win()->EnableRedrawStore(EFalse);
-//
-	TheClient->iGroup->GroupWin()->EnableScreenChangeEvents();
-//
-	//TheClient->iWs.SetAutoFlush(ETrue);
-	ValidateWin(BaseWin,TRgb::Gray256(204));
-	ValidateWin(TestWin,TRgb::Gray256(204));
-//
-	iWinState=0;
-	iWinPos=TPoint(2*TheClient->iGroup->Size().iWidth/3,0);
-//
-	iSecondConnection=new(ELeave) CSecondConnection;
-	iSecondConnection->ConstructL(iTest->iScreenNumber, TRect(KBlankWinPosX,KBlankWinPosY,KBlankWinPosX+KBlankWinSizeX,KBlankWinPosY+KBlankWinSizeY),iTest,iStep);
-//
-	iOldEnfMode=TheClient->iScreen->ScreenModeEnforcement();
-	if (TheClient->iScreenModes.Count()<2)
-		{
-		iTest->iState=1000;	// Miss all tests
-		_LIT(KLog,"Skipping all tests as less that 2 screen size modes");
-		LOG_MESSAGE(KLog);
-		}
-	else
-		{
-		SetScreenModeEnforcement(ESizeEnforcementNone);
-		TheClient->iScreen->SetScreenMode(TheClient->iScreenModes[0]);
-		}
-	}
-
-void CTScrMode::SetScreenModeEnforcement(TScreenModeEnforcement aMode)
-	{
-	iCurEnforcement=aMode;
-	TheClient->iScreen->SetScreenModeEnforcement(iCurEnforcement);
-	}
-
-void CTScrMode::ScaledDrawingL()
-	{
-	const TInt KLineXPos=10;
-	const TInt KLineYPos=30;
-	const TInt KLineLength=10;
-	const TInt KXScaleFactor=4;
-	const TInt KYScaleFactor=3;
-//
-	// Draw rectangle onto TestWin
- 	CWindowGc *gc=TheClient->iGc;
-	gc->Activate(*(TestWin->Win()));
-	gc->SetBrushColor(KRgbBlack);
-	gc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	gc->DrawRect(TRect(TPoint(KLineXPos,KLineYPos),TSize(KLineLength*KXScaleFactor,KYScaleFactor)));
-	gc->Deactivate();
-//
-	// Draw scaled bitmap onto BaseWin
-	TSize bitSize(KLineLength,1);
-	TSize bitTwipSize(TheClient->iScreen->HorizontalPixelsToTwips(bitSize.iWidth*KXScaleFactor),
-					  TheClient->iScreen->VerticalPixelsToTwips(bitSize.iHeight*KYScaleFactor));
-	CFbsBitGc *bitGc=NULL;
-	CFbsBitmapDevice *device=NULL;
-	CFbsBitmap *bitmap=NULL;
-	bitmap=new(ELeave) CFbsBitmap();
-	CleanupStack::PushL(bitmap);
-	User::LeaveIfError(bitmap->Create(bitSize,EGray16));
-	bitmap->SetSizeInTwips(bitTwipSize);
-	device=CFbsBitmapDevice::NewL(bitmap);
-	CleanupStack::PushL(device);
-	User::LeaveIfError(device->CreateContext(bitGc));
-	bitGc->SetBrushColor(KRgbBlack);
-	bitGc->Clear();
-	delete bitGc;
-//
- 	gc->Activate(*(BaseWin->Win()));
-	gc->DrawBitmap(TPoint(KLineXPos,KLineYPos),bitmap);
-	gc->Deactivate();
-//
-	TheClient->iWs.Flush();
-
-	CleanupStack::PopAndDestroy(2);	// bitmap,device
-
-	CompareWindows(_L("CTScrMode::ScaledDrawingL() CompareWindows() failed"));
-	}
-
-void CTScrMode::ValidateWin(TestWindow *aWin, TRgb aColor)
-	{
-	aWin->Win()->Invalidate();
-	RedrawWin(*aWin->Win(),aColor);
-	}
-
-void CTScrMode::RedrawWin(RWindow &aWin, TRgb aColor)
-	{
-	aWin.BeginRedraw();
-	TheClient->iGc->Activate(aWin);
-	TheClient->iGc->SetBrushColor(aColor);
-	TheClient->iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TheClient->iGc->SetPenStyle(CGraphicsContext::ENullPen);
-	TheClient->iGc->Clear();
-	TheClient->iGc->Deactivate();
-	aWin.EndRedraw();
-	}
-
-void CTScrMode::CheckWindows(TBool aWinIsVis)
-	{
-	iSecondConnection->SetWindow2Visibility(aWinIsVis);
-	TheClient->WaitForRedrawsToFinish();
-	TheClient->iWs.Finish();
-	CompareWindows(_L("CTScrMode::CheckWindows() CompareWindows() failed"));
-	}
-
-void CTScrMode::ScreenRotationsL()
-	{
-	CWsScreenDevice *screen=TheClient->iScreen;
-	CArrayFixFlat<TInt> *rotations=new(ELeave) CArrayFixFlat<TInt>(1);
-	CFbsBitGc::TGraphicsOrientation currentRotation;
-	TPixelsAndRotation sizeAndRotation;
-	TPixelsTwipsAndRotation sizeAndRotation2;
-	TBool found;
-	TInt numModes=TheClient->iScreenModes.Count();
-	TInt count;
-	TInt ii,jj;
-	CleanupStack::PushL(rotations);
-	for (ii=0;ii<numModes;++ii)
-		{
-		TInt mode=TheClient->iScreenModes[ii];
-		User::LeaveIfError(screen->GetRotationsList(mode,rotations));
-		screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation);
-		screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation2);
-		TEST(sizeAndRotation.iPixelSize.iWidth==sizeAndRotation2.iPixelSize.iWidth);
-		if (sizeAndRotation.iPixelSize.iWidth!=sizeAndRotation2.iPixelSize.iWidth)
-			INFO_PRINTF3(_L("sizeAndRotation.iPixelSize.iWidth==sizeAndRotation2.iPixelSize.iWidth  - Expected: %d, Actual: %d"), sizeAndRotation.iPixelSize.iWidth, sizeAndRotation2.iPixelSize.iWidth);
-
-		TEST(sizeAndRotation.iPixelSize.iHeight==sizeAndRotation2.iPixelSize.iHeight);
-		if (sizeAndRotation.iPixelSize.iHeight!=sizeAndRotation2.iPixelSize.iHeight)
-			INFO_PRINTF3(_L("sizeAndRotation.iPixelSize.iHeight==sizeAndRotation2.iPixelSize.iHeight  - Expected: %d, Actual: %d"), sizeAndRotation.iPixelSize.iHeight, sizeAndRotation2.iPixelSize.iHeight);
-
-		count=rotations->Count();
-		TEST(count>=1);
-		if (count<1)
-			INFO_PRINTF3(_L("rotations->Count() return value  - Expected: %d or more, Actual: %d"), 1, count);
-
-		TBool retVal;
-
-		if (sizeAndRotation.iPixelSize.iWidth!=sizeAndRotation.iPixelSize.iHeight)
-			{
-			TEST(count<=2);
-			if (count>2)
-				INFO_PRINTF3(_L("rotations->Count() return value  - Expected: %d or less, Actual: %d"), 2, count);
-
-			if (count==2)
-				{
-				retVal = (*rotations)[0]+2==(*rotations)[1];
-				TEST(retVal);		//Must only have rotations 180 degrees apart
-				if (!retVal)
-					INFO_PRINTF3(_L("(*rotations)[0]+2==(*rotations)[1]  - Expected: %d, Actual: %d"), ETrue, retVal);
-				}
-			}
-		found=EFalse;
-		for (jj=0;jj<count;++jj)
-			{
-			if ((*rotations)[jj]==sizeAndRotation.iRotation)
-				{
-				retVal = (*rotations)[jj]==sizeAndRotation2.iRotation;
-				TEST(retVal);
-				if (!retVal)
-					INFO_PRINTF3(_L("(*rotations)[jj]==sizeAndRotation2.iRotation  - Expected: %d, Actual: %d"), ETrue, retVal);
-
-				found=ETrue;
-				break;
-				}
-			}
-		TEST(found);
-		if (!found)
-				INFO_PRINTF3(_L("found  - Expected: %d, Actual: %d"), ETrue, found);
-
-		if (count>1)
-			{
-			currentRotation=sizeAndRotation.iRotation;
-			for (jj=0;jj<count;++jj)
-				{
-				screen->SetCurrentRotations(mode,REINTERPRET_CAST(CFbsBitGc::TGraphicsOrientation&,(*rotations)[jj]));
-				screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation);
-				screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation2);
-				retVal = (*rotations)[jj]==sizeAndRotation.iRotation;
-				TEST(retVal);
-				if (!retVal)
-					INFO_PRINTF3(_L("(*rotations)[jj]==sizeAndRotation.iRotation  - Expected: %d, Actual: %d"), ETrue, retVal);
-
-				retVal = (*rotations)[jj]==sizeAndRotation2.iRotation;
-				TEST(retVal);
-				if (!retVal)
-					INFO_PRINTF3(_L("(*rotations)[jj]==sizeAndRotation2.iRotation  - Expected: %d, Actual: %d"), ETrue, retVal);
-
-				}
-			screen->SetCurrentRotations(mode,REINTERPRET_CAST(CFbsBitGc::TGraphicsOrientation&,currentRotation));
-			screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation);
-			screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation2);
-
-			retVal = currentRotation==sizeAndRotation.iRotation;
-			TEST(retVal);
-			if (!retVal)
-				INFO_PRINTF3(_L("currentRotation==sizeAndRotation.iRotation  - Expected: %d, Actual: %d"), ETrue, retVal);
-
-			retVal = currentRotation==sizeAndRotation2.iRotation;
-			TEST(retVal);
-			if (!retVal)
-				INFO_PRINTF3(_L("currentRotation==sizeAndRotation2.iRotation  - Expected: %d, Actual: %d"), ETrue, retVal);
-			}
-		}
-	CleanupStack::PopAndDestroy();
-	}
-
-void CTScrMode::MoreScreenRotationsL()
-	{
-	RWindow shield4Gray(TheClient->iWs);
-	// The default display mode needs to be updated to EColor64K for Oghma integ
-	SetupTestRWindowLC(shield4Gray,TPoint(),TSize(100000,100000),EColor64K);
-//
-	CWsScreenDevice *screen=TheClient->iScreen;
-	//CFbsBitGc::TGraphicsOrientation currentRotation;
-	TPixelsAndRotation sizeAndRotation;
-	TInt currentRotation;
-	TInt currentMode=FindCurrentMode();
-	TInt numModes=TheClient->iScreenModes.Count();
-	TInt currentScreenMode;
-	TInt count;
-	TInt ii,jj;
-	CArrayFixFlat<TInt> *currentRotations=new(ELeave) CArrayFixFlat<TInt>(1);
-	CleanupStack::PushL(currentRotations);
-	currentRotations->ResizeL(numModes);
-	CArrayFixFlat<TInt> *originalRotation=new(ELeave) CArrayFixFlat<TInt>(1);
-	CleanupStack::PushL(originalRotation);
-	originalRotation->ResizeL(numModes);
-	CArrayFixFlat<TInt> *rotations=new(ELeave) CArrayFixFlat<TInt>(1);
-	CleanupStack::PushL(rotations);
-	for (ii=0;ii<numModes;++ii)
-		{
-		TInt mode=TheClient->iScreenModes[ii];
-		screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation);
-		(*currentRotations)[ii]=sizeAndRotation.iRotation;
-		(*originalRotation)[ii]=sizeAndRotation.iRotation;
-		}
-	for (ii=0;ii<numModes;++ii)
-		{
-		TInt mode=TheClient->iScreenModes[ii];
-		screen->SetScreenMode(mode);
-		currentScreenMode = screen->CurrentScreenMode();
-		TEST(currentScreenMode == mode);
-		if (currentScreenMode != mode)
-			INFO_PRINTF3(_L("screen->CurrentScreenMode() return value - Expected: %d, Actual: %d"), mode, currentScreenMode);
-
-		screen->GetDefaultScreenSizeAndRotation(sizeAndRotation);
-		currentRotation=(*currentRotations)[ii];
-		TEST(sizeAndRotation.iRotation==currentRotation);
-
-		screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation);
-		TEST(sizeAndRotation.iRotation==currentRotation);
-
-		User::LeaveIfError(screen->GetRotationsList(mode,rotations));
-		count=rotations->Count();
-		if (count>1)
-			{
-			for (jj=0;jj<count;)
-				{
-				if ((*rotations)[jj++]==currentRotation)
-					break;
-				}
-			if (jj==count)
-				jj=0;
-			currentRotation=(*rotations)[jj];
-			screen->SetCurrentRotations(mode,REINTERPRET_CAST(CFbsBitGc::TGraphicsOrientation&,currentRotation));
-			(*currentRotations)[ii]=currentRotation;
-			}
-		}
-	for (ii=0;ii<numModes;++ii)
-		{
-		TInt mode=TheClient->iScreenModes[ii];
-		screen->SetScreenMode(mode);
-		currentScreenMode = screen->CurrentScreenMode();
-		TEST(currentScreenMode == mode);
-		if (currentScreenMode != mode)
-			INFO_PRINTF3(_L("(screen->CurrentScreenMode() return value - Expected: %d, Actual: %d"), mode, currentScreenMode);
-
-		screen->GetDefaultScreenSizeAndRotation(sizeAndRotation);
-		currentRotation=(*currentRotations)[ii];
-		TEST(sizeAndRotation.iRotation==currentRotation);
-		if (sizeAndRotation.iRotation != currentRotation)
-			INFO_PRINTF3(_L("(screen->GetDefaultScreenSizeAndRotation() return value - Expected: %d, Actual: %d"), currentRotation, sizeAndRotation.iRotation);
-
-		screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation);
-		TEST(sizeAndRotation.iRotation==currentRotation);
-		if (sizeAndRotation.iRotation != currentRotation)
-			INFO_PRINTF3(_L("(screen->GetDefaultScreenSizeAndRotation() return value - Expected: %d, Actual: %d"), currentRotation, sizeAndRotation.iRotation);
-
-		if (currentRotation!=(*originalRotation)[ii])
-			screen->SetCurrentRotations(mode,REINTERPRET_CAST(CFbsBitGc::TGraphicsOrientation&,(*originalRotation)[ii]));
-		}
-	screen->SetScreenMode(currentMode);
-	currentScreenMode = screen->CurrentScreenMode();
-	TEST(currentScreenMode == currentMode);
-	if (currentScreenMode != currentMode)
-		INFO_PRINTF3(_L("(screen->CurrentScreenMode() return value - Expected: %d, Actual: %d"), currentMode, currentScreenMode);
-
-	CleanupStack::PopAndDestroy(4,&shield4Gray);
-	}
-
-TInt CTScrMode::FindCurrentMode()
-	{
-	CWsScreenDevice *screen=TheClient->iScreen;
-	TPixelsTwipsAndRotation sizeAndRotation;
-	TPixelsTwipsAndRotation sizeAndRotation2;
-	TInt numModes=TheClient->iScreenModes.Count();
-	TInt ii;
-	screen->GetDefaultScreenSizeAndRotation(sizeAndRotation);
-	for (ii=0;ii<numModes;++ii)
-		{
-		TInt mode=TheClient->iScreenModes[ii];
-		screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation2);
-		if (Equal(sizeAndRotation,sizeAndRotation2))
-			return mode;
-		}
-	TEST(EFalse);
-	return -1;
-	}
-
-TBool CTScrMode::Equal(const TPixelsTwipsAndRotation& aLeft,const TPixelsTwipsAndRotation& aRight)
-	{
-	if (aLeft.iPixelSize!=aRight.iPixelSize)
-		return EFalse;
-	if (aLeft.iRotation!=aRight.iRotation)
-		return EFalse;
-	if (aLeft.iTwipsSize!=aRight.iTwipsSize)
-		return EFalse;
-	return ETrue;
-	}
-
-TBool CTScrMode::RectClearBugL()
-	{
-	CWsScreenDevice *screen=TheClient->iScreen;
-	TPixelsTwipsAndRotation sizeAndRotation1;
-	TPixelsTwipsAndRotation sizeAndRotation2;
-	TInt screenMode=FindCurrentMode();
-	TInt largeMode=0;
-	TInt smallMode=1;
-	INFO_PRINTF1(_L("Rotation 1"));
-	screen->GetScreenModeSizeAndRotation(0,sizeAndRotation1);
-	INFO_PRINTF1(_L("Rotation 2"));
-	screen->GetScreenModeSizeAndRotation(1,sizeAndRotation2);
-	TSize winSize=TSize(Max(sizeAndRotation1.iPixelSize.iWidth,sizeAndRotation2.iPixelSize.iWidth)
-						,Max(sizeAndRotation1.iPixelSize.iHeight,sizeAndRotation2.iPixelSize.iHeight));
-	if (sizeAndRotation1.iPixelSize.iWidth<=sizeAndRotation2.iPixelSize.iWidth
-									&& sizeAndRotation1.iPixelSize.iHeight<=sizeAndRotation2.iPixelSize.iHeight)
-		{
-		largeMode=1;
-		smallMode=0;
-		}
-	if (screenMode!=largeMode)
-	{
-		INFO_PRINTF2(_L("Large Mode %d\r\n"),largeMode);
-		screen->SetScreenMode(largeMode);
-	}
-	CBlankWindow *blankWin=new(ELeave) CBlankWindow(TRgb::Gray256(204));
-	CleanupStack::PushL(blankWin);
-	blankWin->SetUpL(TPoint(),winSize,TheClient->iGroup,*TheClient->iGc);
-	TheClient->iGc->Activate(*blankWin->Win());		//blankWin->Win()->Invalidate();
-	blankWin->Draw();
-	TheClient->iWs.Flush();
-	blankWin->Win()->SetRequiredDisplayMode(EGray4);
-	INFO_PRINTF2(_L("Small Mode %d\r\n"),smallMode);
-	screen->SetScreenMode(smallMode);
-	TheClient->iWs.Flush();
-	TheClient->iGc->Deactivate();
-	CleanupStack::PopAndDestroy();
-	if (screenMode!=smallMode)
-	{
-		INFO_PRINTF2(_L("Screen Mode %d\r\n"),screenMode);
-		screen->SetScreenMode(screenMode);
-	}
-
-	return ETrue;
-	}
-
-void CTScrMode::ScreenModeChange1L()
-	{
-	CTWin* color64win;
-	color64win=new(ELeave) CTWin();
-	CleanupStack::PushL(color64win);
-	color64win->ConstructL(*TheClient->iGroup);
-	color64win->BaseWin()->SetRequiredDisplayMode(EColor64K);
-	//color64win->SetBackgroundColor(TRgb(0,0,255));
-	color64win->Win()->SetBackgroundColor();
-	color64win->Activate();
-	TheClient->Flush();
-	CTWin* color4win;
-	color4win=new(ELeave) CTWin();
-	CleanupStack::PushL(color4win);
-	color4win->ConstructL(*TheClient->iGroup);
-	color4win->BaseWin()->SetRequiredDisplayMode(EColor4K);
-	//color4win->SetBackgroundColor(TRgb(255,0,0));
-	color4win->Win()->SetBackgroundColor();
-	color4win->SetSize(TSize(600,200));
-	color4win->Activate();
-	TheClient->Flush();
-	color4win->SetSize(TSize(640,240));
-	TheClient->Flush();
-	color64win->SetSize(TSize(20,20));
-	color64win->WinTreeNode()->SetOrdinalPosition(0);
-	TheClient->Flush();
-	CleanupStack::Pop(2,color64win);
-	delete color64win;
-	TheClient->Flush();
-	delete color4win;
-	//CleanupStack::PopAndDestroy(2,color64win);
-	}
-
-void CTScrMode::ScreenModeChange2L()
-	{
-	CTBlankWindow* color64win;
-	color64win=new(ELeave) CTBlankWindow();
-	CleanupStack::PushL(color64win);
-	color64win->ConstructL(*TheClient->iGroup);
-	color64win->BaseWin()->SetRequiredDisplayMode(EColor64K);
-	color64win->SetColor(TRgb(0,0,255));
-	//color64win->SetColor();
-	color64win->Activate();
-	TheClient->Flush();
-	CTBlankWindow* color4win;
-	color4win=new(ELeave) CTBlankWindow();
-	CleanupStack::PushL(color4win);
-	color4win->ConstructL(*TheClient->iGroup);
-	color4win->BaseWin()->SetRequiredDisplayMode(EColor4K);
-	color4win->SetColor(TRgb(255,0,0));
-	//color4win->SetColor();
-	color4win->SetSize(TSize(600,200));
-	color4win->Activate();
-	TheClient->Flush();
-	color4win->SetSize(TSize(640,240));
-	TheClient->Flush();
-	color64win->SetSize(TSize(20,20));
-	color64win->WinTreeNode()->SetOrdinalPosition(0);
-	TheClient->Flush();
-	CleanupStack::Pop(2,color64win);
-	delete color64win;
-	TheClient->Flush();
-	delete color4win;
-	//CleanupStack::PopAndDestroy(2,color64win);
-	}
-
-LOCAL_C void ResetAndDestroyWindows(TAny* aPointerArray)
-	{
-	static_cast<RPointerArray<CBlankWindow>*>(aPointerArray)->ResetAndDestroy();
-	}
-
-LOCAL_C TBool WalkThroughTree(RPointerArray<CBlankWindow> aListOfWindows)
-	{
-	TBool ret=ETrue;
-	TInt count = aListOfWindows.Count();
-	while (--count>=0 && ret)
-		{
-		RRegion region;
-		((aListOfWindows)[count])->Win()->GetInvalidRegion(region);
-		ret=region.IsEmpty();
-		}
-	return ret;
-	}
-
-void CTScrMode::InvisibleWndAndInfiniteRedrawBugL()
-	{
-	// Current Test client state
-	CTClient* clientA=TheClient;
-	CWsScreenDevice* screenClientA=clientA->iScreen;
-	const TScreenModeEnforcement screenModeEnforcement = screenClientA->ScreenModeEnforcement();
-	const TInt currentScreenMode=FindCurrentMode();
-	TPixelsTwipsAndRotation sizeAndRotation;
-	screenClientA->GetScreenModeSizeAndRotation(currentScreenMode,sizeAndRotation);
-
-
-	SecondClientConnection* clientB = new(ELeave) SecondClientConnection();
-	CleanupStack::PushL(clientB);
-	clientB->SetScreenNumber(iTest->iScreenNumber);
-	clientB->ConstructL(currentScreenMode, sizeAndRotation);
-
-// Start test
-	CWindowGc& gc=*clientB->iGc;
-	RWsSession ws=clientB->iWs;
-	CTWindowGroup* group=clientB->iGroup;
-
-	const TInt shrinkFactor = 5;
-	TRect parentRect(0,0, sizeAndRotation.iPixelSize.iWidth, sizeAndRotation.iPixelSize.iHeight);
-	RPointerArray<CBlankWindow> windows;
-	CleanupStack::PushL(TCleanupItem(ResetAndDestroyWindows, &windows));
-	// create several children
-	const TInt count = (iTest->iTestLevel==iTest->ELevelQuick ? 5 : 7);
-	CBlankWindow* blankWin=NULL;
-	CTWinBase* parent=group;
-	for (TInt childNum=0; childNum<count; ++childNum)
-		{
-		blankWin=new(ELeave) CBlankWindow();
-		CleanupStack::PushL(blankWin);
-		User::LeaveIfError(windows.Append(blankWin));
-		CleanupStack::Pop(blankWin);
-		blankWin->SetUpL(parentRect.iTl, parentRect.Size(), parent, gc);
-		// make it visible and draw it
-		blankWin->Win()->Invalidate();
-		gc.Activate(*blankWin->Win());
-		blankWin->Draw();
-		ws.Flush();
-		gc.Deactivate();
-		// prepare for next window
-		parent=blankWin;
-		parentRect.Shrink(shrinkFactor, shrinkFactor);
-		}
-
-	// change screen mode and check visibility of all windows
-
-	const TInt newScreenMode = (currentScreenMode==KScreenMode0?KScreenMode1:KScreenMode0);
-	TPixelsTwipsAndRotation sizeAndRotationForDifferentScreenMode;
-	screenClientA->GetScreenModeSizeAndRotation(newScreenMode, sizeAndRotationForDifferentScreenMode);
-	screenClientA->SetScreenSizeAndRotation(sizeAndRotationForDifferentScreenMode);
-	screenClientA->SetScreenMode(newScreenMode);
-
-	TheClient->WaitForRedrawsToFinish();
-	TBool retVal = WalkThroughTree(windows);
-	TEST(retVal);
-	if (!retVal)
-		INFO_PRINTF3(_L("WalkThroughTree(windows) return value - Expected: %d, Actual: %d"), ETrue, retVal);
-
-
-	screenClientA->SetScreenModeEnforcement(screenModeEnforcement);
-	screenClientA->SetScreenMode(currentScreenMode);
-	screenClientA->SetScreenSizeAndRotation(sizeAndRotation);
-
-	// destroy all windows
-	CleanupStack::PopAndDestroy(2, clientB); // ResetAndDestroyWindows and client
-	// Needed to get system back into a good state as this test can leave the shell in front of the test app
-	TheClient->iGroup->GroupWin()->SetOrdinalPosition(0);
-	}
-
-//To test the APIs GetScreenModeDisplayMode() & GetDefModeMaxNumColors()
-void CTScrMode::GetScreenDisplayMode()
-	{
-	TInt color,gray;
-	CWsScreenDevice *screen=TheClient->iScreen;
-	TInt currentScreenMode=screen->CurrentScreenMode(); //finding the current screen mode
-	screen->SetScreenMode(KScreenMode1); //changing the current screen mode to 1
-
-	//testing the display mode of Screen Mode using the API GetScreenModeDisplayMode()
-	TDisplayMode displayMode=screen->GetScreenModeDisplayMode(KScreenMode1);
-
-	TEST(displayMode!=ENone);
-	TEST(displayMode!=ERgb);
-	//testing the default mode of Screen Mode using the API GetDefModeMaxNumColors()
-	TDisplayMode defaultMode=TheClient->iWs.GetDefModeMaxNumColors(color,gray);
-	TDisplayMode defaultModeForScreen=TheClient->iWs.GetDefModeMaxNumColors(screen->GetScreenNumber(),color,gray);
-	TEST(defaultMode==defaultModeForScreen);
-	TEST(defaultMode!=ENone);
-	TEST(defaultMode!=ERgb);
-	TEST(color == 16777216 || color == 0 || color == 16 || color == 256  || color == 4096 || color == 65536);
-	TEST(gray == 0 || gray == 2 || gray == 4  || gray == 16  || gray == 256);
-  	screen->SetScreenMode(currentScreenMode);
-  	
-	CArrayFixFlat<TInt>* modeList=new CArrayFixFlat<TInt>(15);
-	TEST(modeList != NULL);
-	if(!modeList)
-		{
-		return;
-		}
-	TInt res = TheClient->iWs.GetColorModeList(modeList);
-	TEST(res == KErrNone);
-	TDisplayMode modeMax = ENone;
-	for(TInt index = 0; index < modeList->Count(); index++)
-		{
-		TDisplayMode mode = (TDisplayMode) ((*modeList)[index]);
-		if(mode > modeMax)
-			{
-			modeMax = mode;
-			}
-		}
-	modeList->Reset();
-	delete modeList;
-	TInt realColor = 0;
-	TInt realGray = 0;
-	switch(modeMax)
-		{
-	case EGray2:
-		realColor = 2;
-		realGray = 2;
-		break;
-	case EGray4:
-		realColor = 4;
-		realGray = 4;
-		break;
-	case EGray16:
-		realColor = 16;
-		realGray = 16;
-		break;
-	case EGray256:
-		realColor = 256;
-		realGray = 256;
-		break;
-	case EColor16:
-		realColor = 16;
-		break;
-	case EColor256:
-		realColor = 256;
-		break;
-	case EColor4K:
-		realColor = 4096;
-		break;
-	case EColor64K:
-		realColor = 65536;
-		break;
-	case EColor16M:
-	case EColor16MU:
-	case EColor16MA:
-	case EColor16MAP:
-		realColor = 16777216;
-		break;
-	default:
-		break;
-		}
- 
- 	if (realColor > 0)
- 	 	TEST(realColor == color);
- 	if (realGray > 0)
- 	 	TEST(gray == realGray);	
-	}
-
-void CTScrMode::SetScreenModeAfterScreenDeviceDeletedL()
-	{
-	// A separate session is needed, because this test will delete the primary screen device
-	RWsSession ws; 
-	User::LeaveIfError(ws.Connect());
-
-	// Push the secondary screen device first onto the cleanup stack
-	// so that we can pop and destroy the primary screen device first
-	CWsScreenDevice* secondaryScreenDevice = new (ELeave) CWsScreenDevice(ws);
-	CleanupStack::PushL(secondaryScreenDevice);
-
-	CWsScreenDevice* primaryScreenDevice = new (ELeave) CWsScreenDevice(ws);
-	CleanupStack::PushL(primaryScreenDevice);
-
-	// Construct the primary screen device first to ensure that it is
-	// used by the group window
-	User::LeaveIfError(primaryScreenDevice->Construct(iTest->iScreenNumber));
-	User::LeaveIfError(secondaryScreenDevice->Construct(iTest->iScreenNumber));
-
-	RWindowGroup group(ws);
-	User::LeaveIfError(group.Construct(888));
-	group.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
-
-	RArray<TInt> screenModes;
-	primaryScreenDevice->GetScreenSizeModeList(&screenModes);
-	primaryScreenDevice->SetScreenMode(screenModes[0]);
-
-	// Prematurely destroy the primary screen device used by the group window
-	CleanupStack::PopAndDestroy(primaryScreenDevice);
-
-	// Simulate screen rotation - call SetScreenMode()
-	// This would trigger the defective behaviour and wserv would panic if broken
-	secondaryScreenDevice->SetScreenMode(screenModes[0]);
-
-	// Tidy up
-	screenModes.Close();
-	group.Close();
-	CleanupStack::PopAndDestroy(secondaryScreenDevice);
-	ws.Flush();
-	ws.Close();
-	}
-	
-void CTScrMode::DrawTestBmpL(CFbsBitmap* aTestBitmap)
-	{
-	CFbsBitmapDevice* device=CFbsBitmapDevice::NewL(aTestBitmap);
-	CleanupStack::PushL(device);
-	CGraphicsContext* bmpgc;
-	User::LeaveIfError(device->CreateContext(bmpgc));
-	CleanupStack::PushL(bmpgc);
-	bmpgc->SetPenColor(KRgbDarkRed);
-	bmpgc->SetBrushColor(KRgbYellow);
-	bmpgc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	bmpgc->SetPenStyle(CGraphicsContext::ESolidPen);
-	bmpgc->DrawRect(TRect(aTestBitmap->SizeInPixels()));
-	CleanupStack::PopAndDestroy(2,device);
-	}
-
-void CTScrMode::TestDrawingToWindows(CWindowGc* aWinGc1, CWindowGc* aWinGc2, RWindow& aWindow1,RWindow& aWindow2,CFbsBitmap* aBitmap64K,CFbsBitmap* aBitmap16M,CFbsFont* aFont, TBool aAllInRedraw, TBool aUseSystemGc, TBool aUseBmp16M)
-	{
-	CFbsBitmap* bitmap=aUseBmp16M?aBitmap16M:aBitmap64K;
-	TInt ascent=aFont->AscentInPixels();
-	for(TInt win=0;win<2;win++)
-		{
-		RWindow* winPtr=(win==0)?&aWindow1:&aWindow2;
-		winPtr->Invalidate();
-		winPtr->BeginRedraw();
-		CWindowGc* winGc;
-		if (aUseSystemGc)
-			{
-			winGc=TheClient->iGc;
-			winGc->Activate(*winPtr);
-			}
-		else
-			{
-			winGc=(win==0)?aWinGc1:aWinGc2;
-			winGc->Reset();
-			}
-		winGc->SetBrushColor(KRgbBlue);
-		winGc->Clear();
-		if (!aAllInRedraw)
-			winPtr->EndRedraw();
-//
-		winGc->BitBlt(TPoint(0,0),bitmap);
-		winGc->UseFont(aFont);
-		_LIT(KTestText123,"Test text 123");
-		winGc->DrawText(KTestText123,TPoint(0,ascent));
-		if (aAllInRedraw)
-			winPtr->EndRedraw();
-		if (aUseSystemGc)
-			winGc->Deactivate();
-		}
-	TBool winCheck=DoCheckRectRWin(aWindow1,aWindow2,TRect(aWindow1.Size()));
-	if (!winCheck)
-		{
-		TBuf<256> errBuf(_L("Rot-mode test failed"));
-		if (aAllInRedraw)
-			errBuf.Append(_L(", All in Redraw"));
-		if (aUseSystemGc)
-			errBuf.Append(_L(", System Gc"));
-		if (aUseBmp16M)
-			errBuf.Append(_L(", 16M bmp"));
-		else
-			errBuf.Append(_L(", 64K bmp"));
-		INFO_PRINTF1(errBuf);
-		}
-	TEST(winCheck);
-	}
-
-void SetWsAndAppScreenModes(TInt aMode)
-	{
-	TheClient->iScreen->SetScreenMode(aMode);
-	TheClient->iScreen->SetAppScreenMode(aMode);
-	}
-	
-TDisplayMode HighestMatch(CArrayFixFlat<TInt>* aModeList,TInt &aMaxBpp)
-	{
-	TDisplayMode highMode=ENone;
-	TInt highBpp=0;
-	for(TInt loop=aModeList->Count()-1;loop>=0;loop--)
-		{
-		TDisplayMode mode=(TDisplayMode)(*aModeList)[loop];
-		TInt bpp;
-		switch(mode)
-			{
-			case EGray2:
-				bpp=1;
-				break;
-			case EGray4:
-				bpp=2;
-				break;
-			case EGray16:
-			case EColor16:
-				bpp=4;
-				break;
-			case EColor256:
-			case EGray256:
-				bpp=8;
-				break;
-			case EColor64K:
-				bpp=16;
-				break;
-			case EColor4K:
-				bpp=12;
-				break;
-			case EColor16M:
-			case EColor16MU:
-			case EColor16MA:
-			case EColor16MAP:
-				bpp=32;
-				break;
-			default:
-				bpp=0;
-				break;
-			}
-		if (bpp>highBpp && bpp<aMaxBpp)
-			{
-			highBpp=bpp;
-			highMode=mode;
-			}
-		}
-	aMaxBpp=highBpp;
-	return(highMode);
-	}
-
-void CTScrMode::TestRotateAndScreenModeL()
-	{
-	TheClient->iGroup->GroupWin()->SetOrdinalPosition(0);
-// When switching colour modes Wserv takes into account the full device size, not the clipped size
-// associated with any specific screen mode. Therefore any windows designed to influence the screen
-// mode must use the appropriately rotated device base screen size, not any cutdown screen mode sizes.
-	TSize baseScreenSize=TheClient->iScreen->SizeInPixels();
-	TSize rotatedBaseSize(baseScreenSize.iHeight,baseScreenSize.iWidth);
-	TInt maxScreenDimension=Max(baseScreenSize.iHeight,baseScreenSize.iWidth);
-//
-	CArrayFixFlat<TInt>* modeList=new(ELeave) CArrayFixFlat<TInt>(15);
-	CleanupStack::PushL(modeList);
-	User::LeaveIfError(TheClient->iWs.GetColorModeList(modeList));
-	TInt maxBpp=KMaxTInt;
-	TDisplayMode testDispModeHigh=HighestMatch(modeList,maxBpp);
-	TDisplayMode testDispModeLow=HighestMatch(modeList,maxBpp);
-	CleanupStack::PopAndDestroy(modeList);
-// If only one available display mode skip tests
-	if (testDispModeLow==ENone)
-		return;
-//
-	CFbsFont* font;
-	TFontSpec fspec;
-	fspec.iHeight=240;
-	User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInTwips((CFont*&)font,fspec));
-// Create a massive 16M window to make sure 16M is the fallback mode when any area of the screen is exposed
-	RWindow shield16M(TheClient->iWs);
-	SetupTestRWindowLC(shield16M,TPoint(),TSize(100000,100000),testDispModeHigh);
-	RedrawWin(shield16M,KRgbBlack);
-//
-	TInt numModes=TheClient->iScreenModes.Count();
-	for(TInt modeIndex=0;modeIndex<numModes;modeIndex++)
-		{
-		TInt screenMode=TheClient->iScreenModes[modeIndex];
-		TPoint origin=TheClient->iScreen->GetScreenModeScaledOrigin(screenMode);
-		if (origin.iX!=0 || origin.iY!=0)
-			continue;
-		TPixelsTwipsAndRotation sar;
-		TheClient->iScreen->GetScreenModeSizeAndRotation(screenMode,sar);
-		TSize screenSize=sar.iPixelSize;
-		if (screenSize.iWidth>baseScreenSize.iWidth || screenSize.iHeight>baseScreenSize.iHeight)
-			continue;
-		TSize rotatedScreenDeviceSize(sar.iRotation==CFbsBitGc::EGraphicsOrientationRotated90 || sar.iRotation==CFbsBitGc::EGraphicsOrientationRotated270?
-				rotatedBaseSize:baseScreenSize);
-//
-		TheClient->iScreen->SetScreenMode(screenMode);
-//
-		TSize screenSize1 = screenSize;
-		screenSize1.iWidth = Min(screenSize1.iWidth, rotatedScreenDeviceSize.iWidth); //this is to guarantee we won't compare beyond screen size
-		TSize testSize(screenSize1.iWidth/2,screenSize1.iHeight);
-		TSize testBmpSize(testSize.iWidth,testSize.iHeight/4);
-//
-		CFbsBitmap* testBitmap64=new(ELeave) CFbsBitmap;
-		CleanupStack::PushL(testBitmap64);
-		User::LeaveIfError(testBitmap64->Create(testBmpSize,testDispModeLow));
-		DrawTestBmpL(testBitmap64);
-//
-		CFbsBitmap* testBitmap16M=new(ELeave) CFbsBitmap;
-		CleanupStack::PushL(testBitmap16M);
-		User::LeaveIfError(testBitmap16M->Create(testBmpSize,testDispModeHigh));
-		DrawTestBmpL(testBitmap16M);
-//
-		RWindow window(TheClient->iWs);
-		SetupTestRWindowLC(window,TPoint(0,0), testSize,testDispModeHigh);
-		RWindow window2(TheClient->iWs);
-		SetupTestRWindowLC(window2,TPoint(testSize.iWidth,0),testSize,testDispModeHigh);
-//
-		CWindowGc* winGc1=new(ELeave) CWindowGc(TheClient->iScreen);
-		CleanupStack::PushL(winGc1);
-		User::LeaveIfError(winGc1->Construct());
-		winGc1->Activate(window);
-		CWindowGc* winGc2=new(ELeave) CWindowGc(TheClient->iScreen);
-		CleanupStack::PushL(winGc2);
-		User::LeaveIfError(winGc2->Construct());
-		winGc2->Activate(window2);
-//
-		for(TInt modeIndex2=0;modeIndex2<numModes;modeIndex2++)
-			{
-			if (modeIndex==modeIndex2)
-				continue;
-			TInt screenMode2=TheClient->iScreenModes[modeIndex2];
-			TPoint origin2=TheClient->iScreen->GetScreenModeScaledOrigin(screenMode2);
-			if (origin2.iX!=0 || origin2.iY!=0)
-				continue;
-			TDisplayMode baseDisplayMode=TheClient->iScreen->DisplayMode();
-			INFO_PRINTF5(_L("Testing with screen modes %d/%d, display modes %d/%d"),modeIndex,modeIndex2,testDispModeLow,testDispModeHigh);
-			SetWsAndAppScreenModes(screenMode2);
-			TDisplayMode dispMode11 = TheClient->iScreen->DisplayMode();
-			TPixelsTwipsAndRotation sar1;
-			TheClient->iScreen->GetScreenModeSizeAndRotation(screenMode2, sar1);
-			if(sar1.iRotation == sar.iRotation)
-				{
-				continue;
-				}
-//
-			RWindow window64K(TheClient->iWs);
-			SetupTestRWindowLC(window64K,TPoint(),TSize(maxScreenDimension,maxScreenDimension),testDispModeLow);
-			RedrawWin(window64K,KRgbGreen);
-			// Should now have switched Wserv to 64K mode
-			TEST(TheClient->iScreen->DisplayMode()==testDispModeLow);
-//
-			RWindow window16M(TheClient->iWs);
-			SetupTestRWindowLC(window16M,TPoint(),TSize(maxScreenDimension/2,maxScreenDimension/2),testDispModeHigh);
-			RedrawWin(window16M,KRgbCyan);
-			// Should switch Wserv back to 16M mode
-			TEST(TheClient->iScreen->DisplayMode()==testDispModeHigh);
-//
-			window64K.SetOrdinalPosition(-1);
-			window16M.SetOrdinalPosition(-1);
-			SetWsAndAppScreenModes(screenMode);
-			TEST(TheClient->iScreen->DisplayMode()==baseDisplayMode);
-//
-			const TInt KNumTestFlags=3;
-			const TInt KMaxTestFlags=1<<KNumTestFlags;
-			for(TUint testFlags=0;testFlags<KMaxTestFlags;testFlags++)
-				{
-				TestDrawingToWindows(winGc1,winGc2,window,window2,testBitmap64,testBitmap16M,font,testFlags&0x1,testFlags&0x2,testFlags&0x4);
-				}
-// Test various functions change the display mode appropriately
-			window64K.SetOrdinalPosition(0);
-			TEST(TheClient->iScreen->DisplayMode()==testDispModeLow);
-			window64K.SetVisible(EFalse);
-			TEST(TheClient->iScreen->DisplayMode()==baseDisplayMode);
-			window64K.SetVisible(ETrue);
-			TEST(TheClient->iScreen->DisplayMode()==testDispModeLow);
-			window64K.SetSize(rotatedScreenDeviceSize);
-			TEST(TheClient->iScreen->DisplayMode()==testDispModeLow);
-			// Changing screen mode now should expose the 16M window
-			SetWsAndAppScreenModes(screenMode2);
-			TEST(TheClient->iScreen->DisplayMode()==testDispModeHigh);
-			SetWsAndAppScreenModes(screenMode);
-			// And back to the 64K win covering the screen
-			TEST(TheClient->iScreen->DisplayMode()==testDispModeLow);
-// Create a new group with a 16M window and switching ordinal pos to back and back to front
-			RWindowGroup testGroup(TheClient->iWs);
-			CleanupClosePushL(testGroup);
-			User::LeaveIfError(testGroup.Construct(111,EFalse));
-			RWindow testGroupWin(TheClient->iWs);
-			CleanupClosePushL(testGroupWin);
-			User::LeaveIfError(testGroupWin.Construct(testGroup, 112));
-			testGroupWin.SetExtent(TPoint(), TSize(1,1));	// Just enough to change mode
-			testGroupWin.SetRequiredDisplayMode(testDispModeHigh);
-			testGroupWin.Activate();
-			TEST(TheClient->iScreen->DisplayMode()==testDispModeHigh);
-			TInt oldPos=testGroup.OrdinalPosition();
-			testGroup.SetOrdinalPosition(oldPos+1);
-			TEST(TheClient->iScreen->DisplayMode()==testDispModeLow);
-			testGroup.SetOrdinalPosition(oldPos);
-			TEST(TheClient->iScreen->DisplayMode()==testDispModeHigh);
-			CleanupStack::PopAndDestroy(2,&testGroup);
-			TEST(TheClient->iScreen->DisplayMode()==testDispModeLow);
-//
-			CleanupStack::PopAndDestroy(2,&window64K);
-			}
-		CleanupStack::PopAndDestroy(2,winGc1);
-		CleanupStack::PopAndDestroy(2,&window);
-		CleanupStack::PopAndDestroy(2,testBitmap64);
-		}
-	CleanupStack::PopAndDestroy(&shield16M);
-	TheClient->iScreen->ReleaseFont(font);
-	SetWsAndAppScreenModes(TheClient->iScreenModes[0]);
-	}
-
-void CTScrMode::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	TBuf<32> buf;
-	TBool checkWindowParam=EFalse;
-	TInt count=0;
-	TInt mode=0;
-	TBool enable=EFalse;
-	TBool disable=EFalse;
-	TInt retVal;
-	
-	((CTScrModeStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(++iTest->iState)
-		{
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0296
-
-  @SYMDEF  			DEF081259
-
-  @SYMTestCaseDesc Test screen modes can be set while the screen is rotated
-  					through 180 degrees.
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Rotate the screen through 180 degrees while setting each
-  					of the screen modes available
-
-  @SYMTestExpectedResults The screen is rotated and screen modes set correctly
-
-*/
-		case 1:
-			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0296"));
-			iTest->LogSubTest(_L("Orientation1"));
-			ScreenRotationsL();
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0297
-
-  @SYMDEF  			DEF081259
-
-  @SYMTestCaseDesc Change the screen orientation then test screen modes can
-  					be set while the screen is rotated through 180 degrees.
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Rotate the screen through 180 degrees while setting each
-  					of the screen modes available
-
-  @SYMTestExpectedResults The screen is rotated and screen modes set correctly
-
-*/
-		case 2:
-			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0297"));
-			iTest->LogSubTest(_L("Orientation2"));
-			MoreScreenRotationsL();
-			iSubState=0;
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0298
-
-  @SYMDEF  			DEF081259
-
-  @SYMTestCaseDesc Test for the rect clear defect while setting screen mode
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Change the screen mode and check the rect clear defect is
-  					not present
-
-  @SYMTestExpectedResults The defect is not present
-
-*/
-		case 3:
-			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0298"));
-			iTest->LogSubTest(_L("Rect Clear Defect"));
-			RectClearBugL();
-			break;
-		case 4:
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0299
-
-  @SYMDEF  			DEF081259
-
-  @SYMTestCaseDesc Test display mode can be set for test windows and
-  					that the windows then function correctly
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Set the display mode in two test windows and then call
-  					methods on the windows
-
-  @SYMTestExpectedResults The windows function correctly
-
-*/
-			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0299"));
-
-			iTest->LogSubTest(_L("ScreenModeChange"));
-			ScreenModeChange1L();
-			ScreenModeChange2L();
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0300
-
-  @SYMDEF  			DEF081259
-
-  @SYMTestCaseDesc Test display mode can be set and retrieved
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Set the display mode in a window and the retrieve it
-
-  @SYMTestExpectedResults The display mode retrieved is the same as the
-  							one set.
-
-*/
-		case 5:
-			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0300"));
-			iTest->LogSubTest(KScreenModeDisplayMode);
-			GetScreenDisplayMode();
-			break;
-
-	
-#if defined(SCREEN_MODE_TESTING)
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0301
-
-  @SYMDEF  			DEF081259
-
-  @SYMTestCaseDesc Case 101 to 105 tests that the screen is drawn correctly
-  					as different screen modes and screen orientation are
-  					set for the screen
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Set different screen modes and orientations for the screen and
-  					redraw the screen
-
-  @SYMTestExpectedResults The screen is drawn correctly for each setting
-
-*/
-		case 101:
-			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0301"));
-			iSubState = 0;
-			buf.Format(TRefByValue<const TDesC>(_L("Screen mode %d:%d")),101,iSubState);
-			INFO_PRINTF1(buf);
-			checkWindowParam=ETrue;
-			mode=1;
-			if (iCurEnforcement==ESizeEnforcementPixelsAndRotation)
-				count+=3;
-			else if (iCurEnforcement==ESizeEnforcementPixelsTwipsAndRotation)
-				count+=6;
-			if (iSecondConnection->DeviceMessageCount()!=count)
-				{
-				TLogMessageText buf;
-				_LIT(KFailCount,"Event Mismatch, Exp=%d, Act=%d");
-				buf.Format(KFailCount,count,iSecondConnection->DeviceMessageCount());
-				TheClient->iWs.LogMessage(buf);
-				TheClient->iWs.Flush();
-				}
-			retVal = iSecondConnection->DeviceMessageCount();
-			TEST(retVal==count);
-			if (retVal!=count)
-				INFO_PRINTF3(_L("(iSecondConnection->DeviceMessageCount() return value - Expected: %d, Actual: %d"),count ,retVal);
-			
-			CheckWindows(iCurEnforcement==ESizeEnforcementNone?ETrue:checkWindowParam);
-			if (enable)
-				iSecondConnection->EnableMessages();
-			if (disable)
-				iSecondConnection->DisableMessages();
-			TheClient->iScreen->SetScreenMode(mode);
-			TheClient->iWs.Flush();
-			iSubState++;
-			break;
-		case 102:
-/**
-  @SYMTestCaseID GRAPHICS-WSERV-0521
-*/
-			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0521"));
-			buf.Format(TRefByValue<const TDesC>(_L("Screen mode %d:%d")),101,iSubState);
-			INFO_PRINTF1(buf);
-			checkWindowParam=EFalse;
-			enable=ETrue;
-			if (iCurEnforcement==ESizeEnforcementPixelsAndRotation)
-				count+=3;
-			else if (iCurEnforcement==ESizeEnforcementPixelsTwipsAndRotation)
-				count+=6;
-			if (iSecondConnection->DeviceMessageCount()!=count)
-				{
-				TLogMessageText buf;
-				_LIT(KFailCount,"Event Mismatch, Exp=%d, Act=%d");
-				buf.Format(KFailCount,count,iSecondConnection->DeviceMessageCount());
-				TheClient->iWs.LogMessage(buf);
-				TheClient->iWs.Flush();
-				}
-			retVal = iSecondConnection->DeviceMessageCount();
-			TEST(retVal==count);
-			if (retVal!=count)
-				INFO_PRINTF3(_L("(iSecondConnection->DeviceMessageCount() return value - Expected: %d, Actual: %d"),count ,retVal);
-
-			if (enable)
-				iSecondConnection->EnableMessages();
-			if (disable)
-				iSecondConnection->DisableMessages();
-			TheClient->iScreen->SetScreenMode(mode);
-			TheClient->iWs.Flush();
-			iSubState++;
-			break;
-		case 103:
-/**
-  @SYMTestCaseID GRAPHICS-WSERV-0522
-*/
-			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0522"));
-			buf.Format(TRefByValue<const TDesC>(_L("Screen mode %d:%d")),101,iSubState);
-			INFO_PRINTF1(buf);
-			count=1;
-			mode=1;
-			checkWindowParam=ETrue;
-			if (iCurEnforcement==ESizeEnforcementPixelsAndRotation)
-				count+=3;
-			else if (iCurEnforcement==ESizeEnforcementPixelsTwipsAndRotation)
-				count+=6;
-			if (iSecondConnection->DeviceMessageCount()!=count)
-				{
-				TLogMessageText buf;
-				_LIT(KFailCount,"Event Mismatch, Exp=%d, Act=%d");
-				buf.Format(KFailCount,count,iSecondConnection->DeviceMessageCount());
-				TheClient->iWs.LogMessage(buf);
-				TheClient->iWs.Flush();
-				}
-			retVal = iSecondConnection->DeviceMessageCount();
-			TEST(retVal==count);
-			if (retVal!=count)
-				INFO_PRINTF3(_L("(iSecondConnection->DeviceMessageCount() return value - Expected: %d, Actual: %d"),count ,retVal);
-
-			CheckWindows(iCurEnforcement==ESizeEnforcementNone?ETrue:checkWindowParam);
-			if (enable)
-				iSecondConnection->EnableMessages();
-			if (disable)
-				iSecondConnection->DisableMessages();
-			TheClient->iScreen->SetScreenMode(mode);
-			TheClient->iWs.Flush();
-			iSubState++;
-			break;
-		case 104:
-/**
-  @SYMTestCaseID GRAPHICS-WSERV-0523
-*/
-			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0523"));
-			buf.Format(TRefByValue<const TDesC>(_L("Screen mode %d:%d")),101,iSubState);
-			INFO_PRINTF1(buf);
-			checkWindowParam=ETrue;
-			count=2;
-			disable=ETrue;
-			if (iCurEnforcement==ESizeEnforcementPixelsAndRotation)
-				count+=3;
-			else if (iCurEnforcement==ESizeEnforcementPixelsTwipsAndRotation)
-				count+=6;
-			if (iSecondConnection->DeviceMessageCount()!=count)
-				{
-				TLogMessageText buf;
-				_LIT(KFailCount,"Event Mismatch, Exp=%d, Act=%d");
-				buf.Format(KFailCount,count,iSecondConnection->DeviceMessageCount());
-				TheClient->iWs.LogMessage(buf);
-				TheClient->iWs.Flush();
-				}
-			retVal = iSecondConnection->DeviceMessageCount();
-			TEST(retVal==count);
-			if (retVal!=count)
-				INFO_PRINTF3(_L("(iSecondConnection->DeviceMessageCount() return value - Expected: %d, Actual: %d"),count ,retVal);
-
-			if (enable)
-				iSecondConnection->EnableMessages();
-			if (disable)
-				iSecondConnection->DisableMessages();
-			TheClient->iScreen->SetScreenMode(mode);
-			TheClient->iWs.Flush();
-			iSubState++;
-			break;
-		case 105:
-/**
-  @SYMTestCaseID GRAPHICS-WSERV-0524
-*/
-			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0524"));
-			buf.Format(TRefByValue<const TDesC>(_L("Screen mode %d:%d")),101,iSubState);
-			INFO_PRINTF1(buf);
-			checkWindowParam=EFalse;
-			count=2;
-			enable=ETrue;
-			if (iCurEnforcement==ESizeEnforcementPixelsAndRotation)
-				count+=3;
-			else if (iCurEnforcement==ESizeEnforcementPixelsTwipsAndRotation)
-				count+=6;
-			if (iSecondConnection->DeviceMessageCount()!=count)
-				{
-				TLogMessageText buf;
-				_LIT(KFailCount,"Event Mismatch, Exp=%d, Act=%d");
-				buf.Format(KFailCount,count,iSecondConnection->DeviceMessageCount());
-				TheClient->iWs.LogMessage(buf);
-				TheClient->iWs.Flush();
-				}
-			retVal = iSecondConnection->DeviceMessageCount();
-			TEST(retVal==count);
-			if (retVal!=count)
-				INFO_PRINTF3(_L("(iSecondConnection->DeviceMessageCount() return value - Expected: %d, Actual: %d"),count ,retVal);
-
-			CheckWindows(iCurEnforcement==ESizeEnforcementNone?ETrue:checkWindowParam);
-			if (enable)
-				iSecondConnection->EnableMessages();
-			if (disable)
-				iSecondConnection->DisableMessages();
-			TheClient->iScreen->SetScreenMode(mode);
-			TheClient->iWs.Flush();
-
-
-			iSecondConnection->DisableMessages();
-			if (iCurEnforcement==ESizeEnforcementNone)
-				{	// Do it again with different enforcement mode
-				SetScreenModeEnforcement(ESizeEnforcementPixelsAndRotation);
-				ResetCounter(100);
-				}
-			else if (iCurEnforcement==ESizeEnforcementPixelsAndRotation)
-				{	// Do it again with different enforcement mode
-				SetScreenModeEnforcement(ESizeEnforcementPixelsTwipsAndRotation);
-				ResetCounter(100);
-				}
-			else
-				{
-				SetScreenModeEnforcement(ESizeEnforcementNone);
-				delete iSecondConnection;
-				iSecondConnection=NULL;
-				}
-			TheClient->iWs.Flush();
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0302
-
-  @SYMDEF  			DEF099638
-
-  @SYMTestCaseDesc Test that a drawing can be scaled while different screen
-  					modes are set
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Set different screen modes and scale a drawing
-
-  @SYMTestExpectedResults The drawing is redrawn to scale
-
-*/
-		case 110:
-			{
-			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0302"));
-			// Ensure that the TestWin and BaseWin will be drawn properly in all screen modes
-			SetScreenModeEnforcement(ESizeEnforcementPixelsAndRotation);
-			TheClient->SetTestClientScreenMode(0);
-			INFO_PRINTF1(_L("Scaled drawing - screen mode 0"));
-			ScaledDrawingL();
-			TheClient->SetTestClientScreenMode(1);
-			INFO_PRINTF1(_L("Scaled drawing - screen mode 1"));
-			ScaledDrawingL();
-			// Restore screen mode and enforcement mode				
-			TheClient->SetTestClientScreenMode(0);
-			SetScreenModeEnforcement(iOldEnfMode);
-			break;
-			}
-
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0303
-
-  @SYMDEF  			DEF081259
-
-  @SYMTestCaseDesc Test screen mode and rotation panic messages
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Test the panics fro screen mode and rotation respond as
-  					expected
-
-  @SYMTestExpectedResults Panics respond as expected
-
-*/
-		case 111:
-			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0303"));
-			INFO_PRINTF1(_L("Panic"));
-			TestPanicsL();
-			break;
-#endif
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0304
-
-  @SYMDEF  			DEF081259
-
-  @SYMTestCaseDesc Test that if there are invisible windows and then the
-  					screen mode is changed, the windows are redrawn correctly
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Create some windows, make some invisible, change the screen
-  					mode and redraw the windows
-
-  @SYMTestExpectedResults The windows are redrawn without error
-
-*/
-		case 112:
-			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0304"));
-			INFO_PRINTF1(_L("Invisible Wnds And Infinite Redraw Bugs")); // two defects one problem
-			InvisibleWndAndInfiniteRedrawBugL();
-			break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0358
-
-  @SYMDEF  			PDEF096151
-
-  @SYMTestCaseDesc Ensure that wserv does not panic when calling CWsScreenDevice::SetScreenMode()
-                   after a client has deleted a screen device used by an active group window
-
-  @SYMTestPriority Critical
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Creates a RWsSession
-                  Creates a primary screen device
-                  Creates another screen device
-                  Creates a group window
-                  Gets all the valid screen modes
-                  Deletes the primary screen device 
-                  Calls SetScreenMode on the second screen device
-                    (this step triggered the defect - panicking wserv)
-                  Cleans up the above
-
-  @SYMTestExpectedResults The call to SetScreenMode should not cause wserv to panic
-
-*/
- 		case 113:
- 			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0358"));
-			INFO_PRINTF1(_L("Set screen mode after a client has deleted the screen device"));
-			SetScreenModeAfterScreenDeviceDeletedL();
-			break;
-		case 114:
-			INFO_PRINTF1(_L("Rotate/screen mode test"));
-/**
-  @SYMTestCaseID GRAPHICS-WSERV-0525
-*/
-			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0525"));
-			TestRotateAndScreenModeL();
-			break;
-		default:
-            ((CTScrModeStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			if (iTest->iState==115 || iTest->iState>1000)
-				TestComplete();
-			break;
-		}
-	((CTScrModeStep*)iStep)->RecordTestResultL();
-	}
-
-//
-// CSecondConnection
-//
-
-CSecondConnection::~CSecondConnection()
-	{
-	delete iWindow;
-	delete iWindow2;
-	iGroup->GroupWin()->EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
-	delete iGroup;
-	delete iClient;
-	}
-
-void CSecondConnection::ConstructL(TInt aScreenNumber,const TRect &aWinRect, CTestBase *aTest, CTestStep* aTestStep)
-	{
-	iClient=new(ELeave) CTClient;
-	iClient->SetScreenNumber(aScreenNumber);
-	iClient->ConstructL();
-	iGroup=new(ELeave) CSecondConnectionGroup(iClient,this,aTest,aTestStep);
-	iGroup->ConstructL();
-//
-	iWindow=new(ELeave) CTBlankWindow;
-	iWindow->ConstructL(*iGroup);
-	iWindow->BaseWin()->SetShadowDisabled(ETrue);
-	iWindow->SetColor(TRgb::Gray4(1));
-	TPoint offset=BaseWin->BaseWin()->InquireOffset((*iGroup->GroupWin()));
-	iWindow->SetExtL(offset+aWinRect.iTl,aWinRect.Size());
-	iWindow->Activate();
-//
-	iWindow2=new(ELeave) CTBlankWindow;
-	iWindow2->ConstructL(*iGroup);
-	iWindow2->BaseWin()->SetShadowDisabled(ETrue);
-	iWindow2->SetColor(TRgb::Gray4(1));
-	TPoint offset2=TestWin->BaseWin()->InquireOffset((*iGroup->GroupWin()));
-	iWindow2->SetExtL(offset2+aWinRect.iTl,aWinRect.Size());
-	iWindow2->BaseWin()->SetVisible(EFalse);
-	iWindow2->Activate();
-	}
-
-void CSecondConnection::SetWindow2Visibility(TBool aVisible)
-	{
-	iWindow2->BaseWin()->SetVisible(aVisible);
-	iClient->iWs.Flush();
-	iClient->iWs.Finish();
-	}
-
-void CSecondConnection::EnableMessages()
-	{
-	iGroup->GroupWin()->EnableScreenChangeEvents();
-	iClient->iWs.Flush();
-	}
-
-void CSecondConnection::DisableMessages()
-	{
-	iGroup->GroupWin()->DisableScreenChangeEvents();
-	iClient->iWs.Flush();
-	}
-
-TInt CSecondConnection::DeviceMessageCount() const
-	{
-	return(iMessageCount);
-	}
-
-void CSecondConnection::ScreenDeviceChanged()
-	{
-	iMessageCount++;
-	}
-
-//
-// CSecondConnectionGroup
-//
-
-CSecondConnectionGroup::CSecondConnectionGroup(CTClient *aClient, CSecondConnection *aSecondConnection, CTestBase *aTest, CTestStep* aTestStep) : CTWindowGroup(aClient), iTest(aTest), iSecondConnection(aSecondConnection), iTestStep(aTestStep)
-	{}
-
-void CSecondConnectionGroup::ScreenDeviceChanged()
-	{
-	iSecondConnection->ScreenDeviceChanged();
-	TPixelsTwipsAndRotation sar;
-	Client()->iScreen->GetDefaultScreenSizeAndRotation(sar);
-	Client()->iScreen->SetScreenSizeAndRotation(sar);
-//
-	iTestStep->TEST(Client()->iScreen->SizeInPixels()==sar.iPixelSize);
-	iTestStep->TEST(Client()->iScreen->SizeInTwips()==sar.iTwipsSize);
-	TSize pixelConv;
-	pixelConv.iWidth=Client()->iScreen->HorizontalTwipsToPixels(sar.iTwipsSize.iWidth);
-	pixelConv.iHeight=Client()->iScreen->VerticalTwipsToPixels(sar.iTwipsSize.iHeight);
-	iTestStep->TEST(pixelConv==sar.iPixelSize);
-	}
-
-
-//
-// SecondClientConnection
-//
-
-SecondClientConnection::SecondClientConnection()
-	{
-	}
-
-SecondClientConnection::~SecondClientConnection()
-	{
-	}
-
-void SecondClientConnection::ConstructL(TInt aScreenMode, const TPixelsTwipsAndRotation& aSizeAndRotation)
-	{
-	CTClient::ConstructL();
-	iGroup=new(ELeave) TestWindowGroup(this);
-	iGroup->ConstructL();
-	iScreen->SetScreenModeEnforcement(ESizeEnforcementPixelsAndRotation);
-	iScreen->SetScreenSizeAndRotation(aSizeAndRotation);
-	iScreen->SetScreenMode(aScreenMode);
-	}
-
-__WS_CONSTRUCT_STEP__(ScrMode)
--- a/windowing/windowserver/tauto/TSCRMODE.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,128 +0,0 @@
-
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TSCRMODE_H__
-#define __TSCRMODE_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-class CSecondConnection;
-
-class CSecondConnectionGroup : public CTWindowGroup
-	{
-public:
-	CSecondConnectionGroup(CTClient *aClient, CSecondConnection *aSecondConnection, CTestBase *aTest, CTestStep* aTestStep);
-	void ScreenDeviceChanged();
-private:
-	CTestBase *iTest;
-	CSecondConnection *iSecondConnection;
-	CTestStep* iTestStep;
-	};
-
-class CSecondConnection : public CBase
-	{
-public:
-	~CSecondConnection();
-	void ConstructL(TInt aScreenNumber,const TRect &aWinRect, CTestBase *aTest, CTestStep* aTestStep);
-	void EnableMessages();
-	void DisableMessages();
-	TInt DeviceMessageCount() const;
-	void ScreenDeviceChanged();
-	void SetWindow2Visibility(TBool aVisible);
-public:
-	CSecondConnectionGroup *iGroup;
-private:
-	CTClient *iClient;
-	CTBlankWindow *iWindow;
-	CTBlankWindow *iWindow2;
-	TInt iMessageCount;
-	};
-	
-class SecondClientConnection : public CTClient
-	{
-public:
-	SecondClientConnection();
-	~SecondClientConnection();
-	void ConstructL(TInt aScreenMode, const TPixelsTwipsAndRotation &aSizeAndRotation);
-	};
-
-class CTScrMode : public CTWsGraphicsBase
-	{
-public:
-	CTScrMode(CTestStep* aStep);
-	~CTScrMode();
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	void ConstructL();
-	void doMoveWindowTest();
-	TBool MoveWindow();
-	void TestPanicsL();
-	void ScaledDrawingL();
-	void SetScreenModeEnforcement(TScreenModeEnforcement aMode);
-	void CheckWindows(TBool aWinIsVis);
-	void ValidateWin(TestWindow *aWin, TRgb aColor);
-	void RedrawWin(RWindow &aWin, TRgb aColor);
-	void ScreenRotationsL();
-	void MoreScreenRotationsL();
-	TBool RectClearBugL();
-	void ScreenModeChange1L();
-	void ScreenModeChange2L();
-	TInt FindCurrentMode();
-	TBool Equal(const TPixelsTwipsAndRotation& aLeft,const TPixelsTwipsAndRotation& aRight);
-	void InvisibleWndAndInfiniteRedrawBugL();
-	void GetScreenDisplayMode();
-	void SetScreenModeAfterScreenDeviceDeletedL();
-	void TestRotateAndScreenModeL();
-private:
-	void DrawTestBmpL(CFbsBitmap* aTestBitmap);
-	void TestDrawingToWindows(CWindowGc* aWinGc1, CWindowGc* aWinGc2, RWindow& aWindow1,RWindow& aWindow2,CFbsBitmap* aBitmap64K,CFbsBitmap* aBitmap16M,CFbsFont* aFont,TBool aAllInRedraw, TBool aUseSystemGc, TBool aUseBmp16M);
-private:
-	TInt iSubState;
-	CSecondConnection *iSecondConnection;
-	TSize iWinSize;
-	TPoint iWinPos;
-	TInt iWinState;
-	TScreenModeEnforcement iOldEnfMode;
-	TScreenModeEnforcement iCurEnforcement;
-	};
-
-
-	
-class CTScrModeStep : public CTGraphicsStep
-	{
-public:
-	CTScrModeStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTScrModeStep,"TScrMode");
-
-
-#endif
--- a/windowing/windowserver/tauto/TSCROLL.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,850 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Window scroll tests
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TSCROLL.H"
-	
-#pragma warning(disable : 4710)
-
-//
-// Scroll window, used to test the Scroll() command
-//
-
-void DrawScrollWin(CBitmapContext *aGc, const TPoint &aOffset, const TSize &aSize)
-	{
-	aGc->Clear();
-	TPoint drawBase(-10,-20);
-	TSize drawSize(aSize.iWidth-2*drawBase.iX,aSize.iHeight-2*drawBase.iY);
-	aGc->DrawRect(TRect(drawBase,drawBase+drawSize));
-	TPoint offset=drawBase+aOffset;
-	aGc->SetPenColor(TRgb::Gray4(2));
-//	aGc->SetDrawMode(CGraphicsContext::EDrawModeXOR);
-	aGc->DrawRect(TRect(offset+TPoint(13,23),offset+TPoint(22,32)));
-	TInt xpos,xplus;
-	for(xpos=0,xplus=2;xpos<drawSize.iWidth;xplus+=2,xpos+=xplus)
-		aGc->DrawLine(TPoint(xpos,0)+offset,TPoint(xpos,drawSize.iHeight)+offset);
-	for(TInt ypos=0,yplus=2;ypos<drawSize.iHeight;yplus+=2,ypos+=yplus)
-		aGc->DrawLine(TPoint(0,ypos)+offset,TPoint(drawSize.iWidth,ypos)+offset);
-//
-	aGc->SetPenColor(TRgb(0,0,0));
-	aGc->SetDrawMode(CGraphicsContext::EDrawModePEN);
-	TheClient->iWs.Flush();
-	for(xpos=0;xpos<drawSize.iWidth;xpos+=16)
-		{
-		aGc->DrawLine(TPoint(xpos,0)+offset,TPoint(drawSize.iWidth,xpos*drawSize.iHeight/drawSize.iWidth)+offset);
-		aGc->DrawLine(TPoint(xpos,0)+offset,TPoint(0,drawSize.iHeight-xpos*drawSize.iHeight/drawSize.iWidth)+offset);
-		aGc->DrawLine(TPoint(xpos,drawSize.iHeight)+offset,TPoint(drawSize.iWidth,drawSize.iHeight-xpos*drawSize.iHeight/drawSize.iWidth)+offset);
-		aGc->DrawLine(TPoint(xpos,drawSize.iHeight)+offset,TPoint(0,xpos*drawSize.iHeight/drawSize.iWidth)+offset);
-		}
-		
-	}
-
-CScrollWindowNorm::CScrollWindowNorm() : CTWin()
-	{
-	}
-
-void DrawScrollWin(const TPoint &aOffset, const TSize &aSize)
-	{
-	::DrawScrollWin(TheClient->iGc, aOffset, aSize);
-	}
-
-void CScrollWindowNorm::Draw()
-	{
-	DrawScrollWin(iScrollTest->Offset(), Size());
-	}
-
-void CScrollWindowNorm::SetScrollTest(CScrollTestBase *aScrollTest)
-	{
-	iScrollTest=aScrollTest;
-	}
-
-//
-// CScrollWindowBackedUp
-//
-
-CScrollWindowBackedUp::CScrollWindowBackedUp(TDisplayMode aDisplayMode) : CTBackedUpWin(aDisplayMode)
-	{
-	}
-
-void CScrollWindowBackedUp::Draw()
-	{
-	DrawScrollWin(iScrollTest->Offset(), Size());
-	}
-
-void CScrollWindowBackedUp::SetScrollTest(CScrollTestBase *aScrollTest)
-	{
-	iScrollTest=aScrollTest;
-	}
-
-//
-// CScrollTestBase
-//
-
-void CScrollTestBase::Reset()
-	{
-	iOffset=TPoint(0,0);
-	iInvalid.Clear();
-	}
-
-void CScrollTestBase::DoInvalidate()
-	{
-	}
-
-TPoint CScrollTestBase::Offset() const
-	{
-	return(iOffset);
-	}
-
-CScrollTestBase::~CScrollTestBase()
-	{
-	delete iBlankWin;
-	iInvalid.Close();
-	}
-
-void CScrollTestBaseNorm::ConstructL(const TPoint &aPos, const TSize &aSize)
-	{
-	iScrollWin=new(ELeave) CScrollWindowNorm();
-	iScrollWin->SetUpL(aPos, aSize, TheClient->iGroup, *TheClient->iGc);
-	iScrollWin->SetScrollTest(this);
-	iSize=iScrollWin->Size();
-	}
-
-CScrollTestBaseNorm::~CScrollTestBaseNorm()
-	{
-	delete iScrollWin;
-	}
-
-void CScrollTestBaseNorm::Redraw()
-	{
-	iScrollWin->Redraw();
-	}
-
-void CScrollTestBaseNorm::Reset()
-	{
-	iScrollWin->Win()->Invalidate();
-	iScrollWin->Redraw();
-	CScrollTestBase::Reset();
-	}
-
-CTDrawableWin *CScrollTestBaseNorm::ScrollWin() const
-	{
-	return(iScrollWin);
-	}
-
-void CScrollTestBaseNorm::AdjustTestScrollRegion(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect)
-	{
-	RRegion clipped_visible;
-	VisibleRegion(clipped_visible);
-	clipped_visible.ClipRect(aClipRect);
-//
-//
-	RRegion invalidate(aRect);
-	invalidate.SubRegion(clipped_visible);
-	invalidate.Offset(aOffset);
-	invalidate.ClipRect(aClipRect);
-//
-	RRegion invalidate2(aRect);
-	invalidate2.ClipRect(aClipRect);
-	invalidate2.Intersect(iInvalid);
-	invalidate2.Offset(aOffset);
-	invalidate2.ClipRect(aClipRect);
-//
-	RRegion validate(aRect);
-	validate.Intersect(clipped_visible);
-	validate.SubRegion(iInvalid);
-	validate.Offset(aOffset);
-	validate.ClipRect(aClipRect);
-//
-	iInvalid.SubRegion(validate);
-	iInvalid.Union(invalidate);
-	iInvalid.Union(invalidate2);
-	RRegion visible;
-	VisibleRegion(visible);
-	iInvalid.Intersect(visible);
-	iInvalid.Tidy();
-//
-	invalidate2.Close();
-	invalidate.Close();
-	validate.Close();
-	visible.Close();
-	clipped_visible.Close();
-
-	iOffset+=aOffset;
-	}
-
-void CScrollTestBaseNorm::VisibleRegion(RRegion &aRegion)
-	{
-	aRegion.Clear();
-	aRegion.AddRect(TRect(iSize));
-	TRect child;
-	child.iTl=iBlankWin->BaseWin()->InquireOffset(*ScrollWin()->BaseWin());
-	child.iBr=child.iTl+iBlankWin->BaseWin()->Size();
-	aRegion.SubRect(child);
-	}
-
-void CScrollWindow1::DoTestScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect)
-	{
-	TheGc->Activate(*iScrollWin->DrawableWin());
-	RRegion region(aRect);
-	RRegion visible;
-	VisibleRegion(visible);
-	visible.ClipRect(aClipRect);
-	region.Intersect(visible);
-	visible.Close();
-	region.SubRegion(iInvalid);
-	region.Offset(aOffset);
-	region.ClipRect(aClipRect);
-	TheGc->SetClippingRegion(region);
-	TheGc->CopyRect(aOffset,aRect);
-	TheGc->Deactivate();
-	AdjustTestScrollRegion(aClipRect, aOffset,aRect);
-	iInvalid.Union(TRegionFix<1>(TRect(aClipRect)));
-	region.Close();
-	}
-
-void CScrollWindow1::DoTestScroll(const TPoint &aOffset)
-	{
-	DoTestScroll(TRect(TPoint(0,0),iSize), aOffset,TRect(-aOffset,iSize));
-	}
-
-void CScrollWindow1::DoTestScroll(const TPoint &aOffset, const TRect &aRect)
-	{
-	DoTestScroll(TRect(TPoint(0,0),iSize), aOffset, aRect);
-	}
-
-void CScrollWindow1::DoTestScroll(const TRect &aClipRect, const TPoint &aOffset)
-	{
-	DoTestScroll(aClipRect, aOffset, TRect(-aOffset.iX,-aOffset.iY,iSize.iWidth-aOffset.iX, iSize.iHeight-aOffset.iY));
-	}
-
-void CScrollWindow1::DoInvalidate()
-	{
-	for(TInt index=0;index<iInvalid.Count();index++)
-		iScrollWin->Invalidate(iInvalid[index]);
-	}
-
-void CScrollWindow2::Reset()
-	{
-	CScrollTestBaseNorm::Reset();
-	iClipped=EFalse;
-	}
-
-CScrollWindow2::CScrollWindow2(CTScroll *aTest) : iTest(aTest)
-	{
-	}
-
-void CScrollWindow2::Draw()
-	{
-	if (iClipped)
-		TheClient->iGc->SetClippingRegion(iInvalid);
-	iScrollWin->Draw();
-	if (iClipped)
-		TheClient->iGc->CancelClippingRegion();
-	}
-
-void CScrollWindow2::DoTestScroll(const TPoint &aOffset)
-	{
-	AdjustTestScrollRegion(TRect(iSize), aOffset, TRect(-aOffset.iX,-aOffset.iY,iSize.iWidth-aOffset.iX, iSize.iHeight-aOffset.iY));
-	iClipped=ETrue;
-	iScrollWin->DrawableWin()->Scroll(aOffset);
-	}
-
-void CScrollWindow2::DoTestScroll(const TRect &aClipRect, const TPoint &aOffset)
-	{
-	AdjustTestScrollRegion(aClipRect, aOffset, TRect(-aOffset.iX,-aOffset.iY,iSize.iWidth-aOffset.iX, iSize.iHeight-aOffset.iY));
-	iClipped=ETrue;
-	iScrollWin->DrawableWin()->Scroll(aClipRect, aOffset);
-	}
-
-void CScrollWindow2::DoTestScroll(const TPoint &aOffset, const TRect &aRect)
-	{
-	AdjustTestScrollRegion(TRect(iSize), aOffset, aRect);
-	iClipped=ETrue;
-	iScrollWin->DrawableWin()->Scroll(aOffset, aRect);
-	}
-
-void CScrollWindow2::DoTestScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect)
-	{
-	AdjustTestScrollRegion(aClipRect, aOffset, aRect);
-	iClipped=ETrue;
-	iScrollWin->DrawableWin()->Scroll(aClipRect, aOffset, aRect);
-	}
-
-void CScrollWindow3::DrawScrollBit()
-	{
-	::DrawScrollWin(iBitmapGc, iOffset, iSize);
-	}
-
-void CScrollWindow3::Reset()
-	{
-	CScrollTestBase::Reset();
-	iBitmapGc->Clear(TRect(iSize));
-	DrawScrollBit();
-	DoInvalidate();
-	}
-
-CScrollWindow3::~CScrollWindow3()
-	{
-	delete iBitmapGc;
-	delete iBitmapDevice;
-	delete iBitmap;
-	}
-
-void CScrollWindow3::ConstructL(const TPoint &aPos, const TSize &aSize)
-	{
-	CScrollTestBaseNorm::ConstructL(aPos,aSize);
-	iBitmap=new(ELeave) CFbsBitmap();
-	User::LeaveIfError(iBitmap->Create(iSize,EGray4));
-	iBitmapDevice=CFbsBitmapDevice::NewL(iBitmap);
-	User::LeaveIfError(iBitmapDevice->CreateContext(iBitmapGc));
-	DrawScrollBit();
-	}
-
-void CScrollWindow3::DoTestScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect)
-	{
-	iOffset+=aOffset;
-	RRegion blank(aRect);
-	TRect clipRect(aClipRect);
-	clipRect.Intersection(TRect(iSize));
-	blank.SubRect(clipRect);
-	blank.Offset(aOffset);
-	blank.ClipRect(clipRect);
-	TRect rect(aRect);
-	rect.Intersection(clipRect);		
-	TRect rect2(clipRect);
-	rect2.Move(-aOffset);
-	rect.Intersection(rect2);			
-	iBitmapGc->CopyRect(aOffset,rect);
-	iBitmapGc->SetClippingRegion(&blank);
-	iBitmapGc->Clear(TRect(iSize));
-	iBitmapGc->SetClippingRegion(NULL);
-	blank.Close();
-	}
-
-void CScrollWindow3::DoTestScroll(const TPoint &aOffset)
-	{
-	DoTestScroll(TRect(iSize), aOffset,TRect(-aOffset.iX,-aOffset.iY,iSize.iWidth-aOffset.iX, iSize.iHeight-aOffset.iY));
-	}
-
-void CScrollWindow3::DoTestScroll(const TPoint &aOffset, const TRect &aRect)
-	{
-	DoTestScroll(TRect(iSize), aOffset, aRect);
-	}
-
-void CScrollWindow3::DoTestScroll(const TRect &aClipRect, const TPoint &aOffset)
-	{
-	DoTestScroll(aClipRect, aOffset, TRect(-aOffset.iX,-aOffset.iY,iSize.iWidth-aOffset.iX, iSize.iHeight-aOffset.iY));
-	}
-
-void CScrollWindow3::Draw()
-	{
-	TheGc->BitBlt(TPoint(),iBitmap);
-	}
-
-void CScrollWindow3::DoInvalidate()
-	{
-	RWindow win=*iScrollWin->Win();
-	win.Invalidate();
-	win.BeginRedraw();
-	TheGc->Activate(win);
-	Draw();
-	TheGc->Deactivate();
-	win.EndRedraw();
-	}
-
-void CScrollWindow4::ConstructL(const TPoint &aPos, const TSize &aSize)
-	{
-	iScrollWin=new(ELeave) CScrollWindowBackedUp(EGray4);
-	iScrollWin->SetUpL(aPos, aSize, TheClient->iGroup, *TheClient->iGc);
-	iScrollWin->SetScrollTest(this);
-	iSize=iScrollWin->Size();
-	TheClient->iGc->Activate(*iScrollWin->DrawableWin());
-	TheClient->iGc->Clear();
-	DrawScrollWin(TPoint(), iSize);
-	TheClient->iGc->Deactivate();
-	}
-
-CScrollWindow4::~CScrollWindow4()
-	{
-	delete iScrollWin;
-	}
-
-void CScrollWindow4::Redraw()
-	{
-	}
-
-void CScrollWindow4::Reset()
-	{
-	TheClient->iGc->Activate(*iScrollWin->DrawableWin());
-	TheClient->iGc->Clear();
-	DrawScrollWin(TPoint(), iSize);
-	TheClient->iGc->Deactivate();
-	CScrollTestBase::Reset();
-	}
-
-void CScrollWindow4::DoTestScroll(const TPoint &aOffset)
-	{
-	iScrollWin->DrawableWin()->Scroll(aOffset);
-	iOffset+=aOffset;
-	}
-
-void CScrollWindow4::DoTestScroll(const TPoint &aOffset, const TRect &aRect)
-	{
-	iScrollWin->DrawableWin()->Scroll(aOffset, aRect);
-	iOffset+=aOffset;
-	}
-
-void CScrollWindow4::DoTestScroll(const TRect &aClipRect, const TPoint &aOffset)
-	{
-	iScrollWin->DrawableWin()->Scroll(aClipRect, aOffset);
-	iOffset+=aOffset;
-	}
-
-void CScrollWindow4::DoTestScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect)
-	{
-	iScrollWin->DrawableWin()->Scroll(aClipRect, aOffset, aRect);
-	iOffset+=aOffset;
-	}
-
-CTDrawableWin *CScrollWindow4::ScrollWin() const
-	{
-	return(iScrollWin);
-	}
-
-//
-
-CTScroll::CTScroll(CTestStep* aStep):
-	CTWsGraphicsBase(aStep)
-	{
-	}
-
-CTScroll::~CTScroll()
-	{
-	BaseWin->SetVisible(ETrue);
-	TestWin->SetVisible(ETrue);
-	delete iBaseScrollWin;
-	delete iTestScrollWin;
-	}
-
-void CTScroll::ConstructL()
-	{
-	BaseWin->SetVisible(EFalse);
-	TestWin->SetVisible(EFalse);
-//
-	iTest->iState=1;
-	TSize screenSize=TheClient->iGroup->Size();
-	TInt winWidth=(screenSize.iWidth/3)-10;
-	TInt winHeight=screenSize.iHeight-10;
-	TInt winBaseX=(screenSize.iWidth/3);
-	if (iMode==0)
-		{
-		iBaseScrollWin=new(ELeave) CScrollWindow1();
-		iTestScrollWin=new(ELeave) CScrollWindow2(this);
-		}
-	else
-		{
-		iBaseScrollWin=new(ELeave) CScrollWindow3();
-		iTestScrollWin=new(ELeave) CScrollWindow4();
-		}
-	iWinSize=TSize(winWidth,winHeight);
-	iBaseScrollWin->ConstructL(TPoint(winBaseX+5,5),iWinSize);
-	iTestScrollWin->ConstructL(TPoint(winBaseX+winWidth+15,5),iWinSize);
-
-	iBaseScrollWin->iBlankWin=new(ELeave) CTBlankWindow();
-	iBaseScrollWin->iBlankWin->SetUpL(iBaseScrollWin->ScrollWin()->BaseWin()->InquireOffset(*TheClient->iGroup->GroupWin())+TPoint(winWidth>>2,winHeight>>2),TSize(winWidth>>2,winHeight>>1),TheClient->iGroup,*TheClient->iGc);
-	iBaseScrollWin->iBlankWin->BlankWin()->SetShadowHeight(2);
-	
-	iTestScrollWin->iBlankWin=new(ELeave) CTBlankWindow();
-	iTestScrollWin->iBlankWin->SetUpL(iTestScrollWin->ScrollWin()->BaseWin()->InquireOffset(*TheClient->iGroup->GroupWin())+TPoint(winWidth>>2,winHeight>>2),TSize(winWidth>>2,winHeight>>1),TheClient->iGroup,*TheClient->iGc);
-	}
-
-void CTScroll::CheckScrollWindows()
-	{
-	CheckRect(iBaseScrollWin->ScrollWin(),iTestScrollWin->ScrollWin(),TRect(iBaseScrollWin->ScrollWin()->Size()),_L("CTScroll::CheckScrollWindows()"));
-	}
-
-void CTScroll::DoTestScroll(const TPoint &aOffset)
-	{
-	iTestScrollWin->DoTestScroll(aOffset);
-	iBaseScrollWin->DoTestScroll(aOffset);
-	}
-
-void CTScroll::DoTestScroll(const TRect &aClipRect, const TPoint &aOffset)
-	{
-	iTestScrollWin->DoTestScroll(aClipRect,aOffset);
-	iBaseScrollWin->DoTestScroll(aClipRect,aOffset);
-	}
-
-void CTScroll::DoTestScroll(const TPoint &aOffset, const TRect &aRect)
-	{
-	iTestScrollWin->DoTestScroll(aOffset,aRect);
-	iBaseScrollWin->DoTestScroll(aOffset,aRect);
-	}
-
-void CTScroll::DoTestScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect)
-	{
-	iTestScrollWin->DoTestScroll(aClipRect,aOffset,aRect);
-	iBaseScrollWin->DoTestScroll(aClipRect,aOffset,aRect);
-	}
-
-void CTScroll::FinishedRectScrolls()
-	{
-	iBaseScrollWin->DoInvalidate();
-	}
-
-void CTScroll::CheckOomScroll()
-	{
-	TheClient->iWs.HeapSetFail(RHeap::ENone,0);
-	FinishedRectScrolls();
-	iTestScrollWin->Redraw();
-	iBaseScrollWin->Redraw();
-//	if (iMode!=1)				// Out of memory scrolling of backed up windows can not work 100% when out of memory
-//		CheckScrollWindows();	// Redraw window code can't check these cases properly yet
-	}
-
-void CTScroll::OomScrolling()
-	{
-	iTestScrollWin->iBlankWin->BaseWin()->SetShadowHeight(0);
-	iBaseScrollWin->iBlankWin->BaseWin()->SetShadowHeight(0);
-	iTestScrollWin->ScrollWin()->BaseWin()->SetShadowHeight(0);
-	iTestScrollWin->Redraw();
-	iBaseScrollWin->Redraw();
-	for(TInt count=1;count<20;count++)
-		{
-		TheClient->iWs.HeapSetFail(RHeap::EDeterministic,count);
-		DoTestScroll(TPoint(50,0));
-		CheckOomScroll();
-	//
-		TheClient->iWs.HeapSetFail(RHeap::EDeterministic,count);
-		iTestScrollWin->Reset();
-		iBaseScrollWin->Reset();
-		DoTestScroll(TPoint(-6,-14),TRect(20,20,100,50));
-		CheckOomScroll();
-	//
-		TheClient->iWs.HeapSetFail(RHeap::EDeterministic,count);
-		iTestScrollWin->Reset();
-		iBaseScrollWin->Reset();
-		DoTestScroll(TRect(TPoint(1,1),iWinSize-TSize(1,1)),TPoint(50,0),TRect(10,10,50,50));
-		CheckOomScroll();
-		}
-	}
-
-void CTScroll::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(KScroll,"Scroll");
-	//if (iTest->iState==0) iTest->iState=22;
-	if (iDoCheck)
-		{
-		if (iMode==1)		// The test code does not mimic scrolling to a non-backed up window properly
-			{
-			TheClient->iWs.Flush();
-			TheClient->iWs.Finish();
-			CheckScrollWindows();
-			}
-		iTestScrollWin->Reset();
-		iBaseScrollWin->Reset();
-		TheClient->iWs.Flush();
-		++iTest->iState;
-		iDoCheck=EFalse;
-		return;
-		}
-	((CTScrollStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(iTest->iState)
-		{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0249
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Test window scrolling by different offsets
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Pass different offsets for scrolling a window by and
-					check the window is scrolled correctly
-
-@SYMTestExpectedResults Window scrolls correctly to offsets
-*/	 
-		case 1:
-			((CTScrollStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0249"));
-			//DemoWindowScroll();
-			iTest->LogSubTest(KScroll);
-			DoTestScroll(TPoint(6,0));
-			DoTestScroll(TPoint(-6,-14));
-			DoTestScroll(TPoint(-6,-14));
-			DoTestScroll(TPoint(0,10));
-			DoTestScroll(TPoint(0,0));
-			DoTestScroll(TPoint(10,23));		
-			break;
-		case 2:
-			((CTScrollStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0249"));
-			iTest->LogSubTest(KScroll);
-			DoTestScroll(TPoint(50,0));
-			break;
-		case 3:
-			((CTScrollStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0249"));
-			iTest->LogSubTest(KScroll);
-			DoTestScroll(TPoint(0,33));
-			break;
-		case 4:
-			((CTScrollStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0249"));
-			iTest->LogSubTest(KScroll);
-			DoTestScroll(TPoint(-10,0));
-			break;
-		case 5:
-			((CTScrollStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0249"));
-			iTest->LogSubTest(KScroll);
-			DoTestScroll(TPoint(0,-13));
-			break;
-		case 6:
-			((CTScrollStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0249"));
-			iTest->LogSubTest(KScroll);
-			DoTestScroll(TPoint(0,0));
-			break;
-		case 7:
-			((CTScrollStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0249"));
-			iTest->LogSubTest(KScroll);
-			DoTestScroll(TPoint(-234,-1400));
-			break;
-		case 8:
-			((CTScrollStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0249"));
-			iTest->LogSubTest(KScroll);
-			DoTestScroll(TPoint(-69,15));
-			break;
-		case 9:
-			((CTScrollStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0249"));
-			iTest->LogSubTest(KScroll);
-			DoTestScroll(TPoint(-234,-1400));
-			DoTestScroll(TPoint(233,1401));
-			break;
-		case 10:
-			((CTScrollStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0249"));
-			iTest->LogSubTest(KScroll);
-			DoTestScroll(TPoint(10,-1));
-			DoTestScroll(TPoint(11,-10));
-			DoTestScroll(TPoint(-5,-40));
-			DoTestScroll(TPoint(0,50));
-			break;
-			
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0250
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Test window scrolling by different offsets and
-				source rectangles
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Pass different offsets for scroll a window by and
-				different source rectangles.
-				Check the window is scrolled correctly
-
-@SYMTestExpectedResults Window scrolls correctly to offsets and source
-					rectangles
-*/	 
-		case 11:
-			((CTScrollStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0250"));
-			iTest->LogSubTest(KScroll);
-			DoTestScroll(TPoint(-6,-14),TRect(20,20,100,50));
-			DoTestScroll(TPoint(-6,-14),TRect(20,20,100,50));
-			DoTestScroll(TPoint(-6,-14),TRect(40,10,130,130));
-			break;
-		case 12:
-			((CTScrollStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0250"));
-			iTest->LogSubTest(KScroll);
-			DoTestScroll(TPoint(10,-1),TRect(20,20,21,21));
-			break;
-		case 13:
-			((CTScrollStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0250"));
-			iTest->LogSubTest(KScroll);
-			DoTestScroll(TPoint(-20,-14),TRect(10,10,10,10));
-			break;
-		case 14:
-			((CTScrollStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0250"));
-			iTest->LogSubTest(KScroll);
-			DoTestScroll(TPoint(-6,-14),TRect(20,20,200,300));
-			DoTestScroll(TPoint(10,-24),TRect(20,20,200,300));
-			DoTestScroll(TPoint(3,12),TRect(20,20,200,300));
-			DoTestScroll(TPoint(-20,19),TRect(20,20,200,300));
-			break;
-		case 15:
-			((CTScrollStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0250"));
-			iTest->LogSubTest(KScroll);
-			DoTestScroll(TPoint(-6,-14),TRect(20000,200000,30000,300000));
-			DoTestScroll(TPoint(10,-24),TRect(20,20,-200,-300));
-			DoTestScroll(TPoint(10,-24),TRect(20,20,-200,300));
-			DoTestScroll(TPoint(10,-24),TRect(20,20,200,-300));
-			DoTestScroll(TPoint(3,12),TRect(-100,-200,1000,2000));
-			DoTestScroll(TPoint(-20,19),TRect(0,0,0,0));
-			break;
-			
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0251
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Test window scrolling by different offsets and
-				clipping rectangles
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Pass different offsets for scroll a window by and
-				different clipping rectangles.
-				Check the window is scrolled correctly
-
-@SYMTestExpectedResults Window scrolls correctly to offsets and clipping
-					rectangles
-*/	
-		case 16:
-			((CTScrollStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0251"));
-			iTest->LogSubTest(KScroll);
-			DoTestScroll(TRect(10,10,200,200),TPoint(-6,-14));
-			break;
-		case 17:
-			((CTScrollStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0251"));
-			iTest->LogSubTest(KScroll);
-			DoTestScroll(TRect(10,50,210,200),TPoint(10,20));
-			DoTestScroll(TRect(0,0,100,100),TPoint(-22,4));
-			DoTestScroll(TRect(50,50,300,500),TPoint(-5,-2));
-			break;
-		case 18:
-			((CTScrollStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0251"));
-			iTest->LogSubTest(KScroll);
-			DoTestScroll(TRect(-1000,-10000,23456,1111),TPoint(-6,-14));
-			break;
-		case 19:
-			((CTScrollStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0251"));
-			iTest->LogSubTest(KScroll);
-			DoTestScroll(TRect(20,5,198,202),TPoint(-100,1));
-			DoTestScroll(TRect(1,1,200,123),TPoint(2,1));
-			DoTestScroll(TRect(23,23,200,400),TPoint(5,-1));
-			break;
-		case 20:
-			((CTScrollStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0251"));
-			iTest->LogSubTest(KScroll);
-			DoTestScroll(TRect(0,0,0,0),TPoint(-10,1));
-			DoTestScroll(TRect(-1000,1,2000,123),TPoint(2,1));
-			DoTestScroll(TRect(23,-23,200,40000),TPoint(5,-1));
-			DoTestScroll(TRect(-1000,-10000,23456,1111),TPoint(-6,-14));
-			break;
-			
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0252
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Test window scrolling by different offsets and
-				clipping ans source rectangles
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Pass different offsets for scroll a window by and
-				different clipping and source rectangles.
-				Check the window is scrolled correctly
-
-@SYMTestExpectedResults Window scrolls correctly to offsets and source
-					and clipping rectangles
-*/	
-		case 21:
-			((CTScrollStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0252"));
-			iTest->LogSubTest(KScroll);
-			DoTestScroll(TRect(TPoint(1,1),iWinSize-TSize(1,1)),TPoint(-6,-14),TRect(10,10,50,50));
-			DoTestScroll(TRect(TPoint(1,1),iWinSize-TSize(1,1)),TPoint(16,4),TRect(10,10,50,50));
-			break;
-		case 22:
-			((CTScrollStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0252"));
-			iTest->LogSubTest(KScroll);
-			DoTestScroll(TRect(TPoint(10,100),iWinSize-TSize(0,10)),TPoint(26,22),TRect(iWinSize));
-			DoTestScroll(TRect(iWinSize),TPoint(2,-1),TRect(-10,-10,50,50));
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0253
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Out of memory window scrolling test 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Out of memory window scrolling test 
-
-@SYMTestExpectedResults Out of memory scrolling is handled correctly
-*/
-		case 23:		
-			((CTScrollStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0253"));
-			iTest->LogSubTest(KScroll);
-			OomScrolling();
-			iTest->CloseAllPanicWindows();
-			++iTest->iState;
-			return;
-		case 24:		
-			((CTScrollStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0253"));
-			++iTest->iState;
-			++iMode;
-			if (iMode==1)
-				{
-				delete iBaseScrollWin;
-				delete iTestScrollWin;
-				ConstructL();
-				}
-			return;
-		default:
-			((CTScrollStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTScrollStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-			break;
-		}
-	((CTScrollStep*)iStep)->RecordTestResultL();
-	FinishedRectScrolls();
-	iDoCheck=ETrue;
-	}
-
-void CTScroll::DemoWindowScrollL()
-	//Function to see what scrolling does.
-	{
-	CBlankWindow* iWin;
-	iWin=new(ELeave) CBlankWindow(TRgb(64,64,224));
-	iWin->SetUpL(TPoint(20,10),TSize(120,100),TheClient->iGroup,*TheClient->iGc);
-	iWin->BaseWin()->SetRequiredDisplayMode(EColor256);
-	iWin->Win()->SetBackgroundColor(TRgb(64,224,64));
-	iWin->RealDraw(ETrue);
-	TheClient->WaitForRedrawsToFinish();
-	iWin->DrawableWin()->Scroll(TPoint(8,5),TRect(20,20,100,80));
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	TheClient->Flush();
-	}
-
-
-__WS_CONSTRUCT_STEP__(Scroll)
-#pragma warning(default : 4710)
--- a/windowing/windowserver/tauto/TSCROLL.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,203 +0,0 @@
-
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TSCROLL_H__
-#define __TSCROLL_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include <bitstd.h>
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-class CTScroll;
-class CScrollTestBase;
-
-class CScrollWindowNorm : public CTWin
-	{
-public:
-	CScrollWindowNorm();
-	void Draw();
-	void SetScrollTest(CScrollTestBase *aScrollTest);
-private:
-	CScrollTestBase *iScrollTest;
-	};
-
-class CScrollWindowBackedUp : public CTBackedUpWin
-	{
-public:
-	CScrollWindowBackedUp(TDisplayMode aDisplayMode);
-	void Draw();
-	void SetScrollTest(CScrollTestBase *aScrollTest);
-private:
-	CScrollTestBase *iScrollTest;
-	};
-
-class CScrollTestBase : public CBase
-	{
-public:
-	~CScrollTestBase();
-	virtual void ConstructL(const TPoint &aPos, const TSize &aSize)=0;
-	virtual void DoTestScroll(const TPoint &aOffset)=0;
-	virtual void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset)=0;
-	virtual void DoTestScroll(const TPoint &aOffset, const TRect &aRect)=0;
-	virtual void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect)=0;
-	virtual void Reset();
-	TPoint Offset() const;
-	virtual CTDrawableWin *ScrollWin() const=0;
-	virtual void DoInvalidate();
-	virtual void Redraw()=0;
-protected:
-	TSize iSize;
-	TPoint iOffset;
-	friend class CTScroll;
-	RRegion iInvalid;
-	CTBlankWindow *iBlankWin;
-	};
-
-class CScrollTestBaseNorm : public CScrollTestBase
-	{
-public:
-	void ConstructL(const TPoint &aPos, const TSize &aSize);
-	~CScrollTestBaseNorm();
-	virtual CTDrawableWin *ScrollWin() const;
-	virtual void Reset();
-	void VisibleRegion(RRegion &aRegion);
-	void AdjustTestScrollRegion(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect);
-	void DrawScrollWin(const TPoint &aOffset, const TSize &aSize);
-	void Redraw();
-protected:
-	CScrollWindowNorm *iScrollWin;
-	};
-
-class CScrollWindow1 : public CScrollTestBaseNorm
-//
-// Used as control window for a normal redraw window
-//
-	{
-public:
-	void DoTestScroll(const TPoint &aOffset);
-	void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset);
-	void DoTestScroll(const TPoint &aOffset, const TRect &aRect);
-	void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect);
-	void DoInvalidate();
-	};
-
-class CScrollWindow2 : public CScrollTestBaseNorm
-//
-// Used to test a normal redraw window
-//
-	{
-public:
-	CScrollWindow2(CTScroll *aTest);
-	virtual void Draw();
-	virtual void Reset();
-	void DoTestScroll(const TPoint &aOffset);
-	void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset);
-	void DoTestScroll(const TPoint &aOffset, const TRect &aRect);
-	void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect);
-private:
-	TBool iClipped;
-	CTScroll *iTest;
-	};
-
-class CScrollWindow3 : public CScrollTestBaseNorm
-//
-// Used as control window for testing backed up windows
-//
-	{
-public:
-	void ConstructL(const TPoint &aPos, const TSize &aSize);
-	~CScrollWindow3();
-	virtual void Reset();
-	void Draw();
-	void DoTestScroll(const TPoint &aOffset);
-	void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset);
-	void DoTestScroll(const TPoint &aOffset, const TRect &aRect);
-	void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect);
-	void DoInvalidate();
-	void DrawScrollBit();
-private:
-	CFbsBitmap *iBitmap;
-	CFbsDevice *iBitmapDevice;
-	CFbsBitGc *iBitmapGc;
-	};
-
-class CScrollWindow4 : public CScrollTestBase
-//
-// Tests a backed up window
-//
-	{
-public:
-	~CScrollWindow4();
-	void ConstructL(const TPoint &aPos, const TSize &aSize);
-	void DoTestScroll(const TPoint &aOffset);
-	void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset);
-	void DoTestScroll(const TPoint &aOffset, const TRect &aRect);
-	void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect);
-	virtual CTDrawableWin *ScrollWin() const;
-	virtual void Reset();
-	void Redraw();
-protected:
-	CScrollWindowBackedUp *iScrollWin;
-	};
-
-class CTScroll : public CTWsGraphicsBase
-	{
-public:
-	CTScroll(CTestStep* aStep);
-	~CTScroll();
-	void ConstructL();
-	void CheckScrollWindows();
-	void DoTestScroll(const TPoint &aOffset);
-	void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset);
-	void DoTestScroll(const TPoint &aOffset, const TRect &aRect);
-	void DoTestScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect);
-	void FinishedRectScrolls();
-	void CheckOomScroll();
-	void OomScrolling();
-	void DemoWindowScrollL();
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	TSize iWinSize;
-	TInt iMode;
-	TBool iDoCheck;
-	CScrollTestBase *iBaseScrollWin;
-	CScrollTestBase *iTestScrollWin;
-	};
-
-class CTScrollStep : public CTGraphicsStep
-	{
-public:
-	CTScrollStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTScrollStep,"TScroll");
-
-
-#endif
--- a/windowing/windowserver/tauto/TSPRITE.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,996 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TSPRITE.H"
-
-CTTSprite::CTTSprite(CTestStep* aStep):
-	CTWsGraphicsBase(aStep)
-	{
-	INFO_PRINTF1(_L("Testing TSprite functions"));
-	}
-
-void CTTSprite::SetUpMember(TSpriteMember &aMember)
-	{
-	aMember.iMaskBitmap=NULL;
-	aMember.iInvertMask=EFalse;
-	aMember.iDrawMode=CGraphicsContext::EDrawModePEN;
-	aMember.iOffset=TPoint();
-	aMember.iInterval=TTimeIntervalMicroSeconds32(0);
-	aMember.iBitmap=&iBitmap;
-	}
-
-void CTTSprite::SetUpPointerCursorL(RWsPointerCursor &aCursor, RWsSession &aSession)
-	{
-	aCursor=RWsPointerCursor(aSession);
-	TSpriteMember member;
-	SetUpMember(member);
-	User::LeaveIfError(aCursor.Construct(0));
-	User::LeaveIfError(aCursor.AppendMember(member));
-	User::LeaveIfError(aCursor.Activate());
-	}
-
-void CTTSprite::SetUpSpriteL(RWsSprite &aSprite, RWsSession &aSession, RWindowTreeNode &aWindow,TInt aFlags/*=0*/)
-	{
-	aSprite=RWsSprite(aSession);
-	User::LeaveIfError(aSprite.Construct(aWindow,TPoint(),aFlags));
-	TSpriteMember member;
-	SetUpMember(member);
-	User::LeaveIfError(aSprite.AppendMember(member));
-	User::LeaveIfError(aSprite.Activate());
-	}
-
-void CTTSprite::ConstructL()
-	{
-  	User::LeaveIfError(iBitmap.Load(TEST_BITMAP_NAME,0));
-	}
-	
-CTTSprite::~CTTSprite()
-	{
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0018
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    General cursor tests involving a sprite
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Carries out cursor and window tests before updating
-					a cursor's member with a sprite
-
-@SYMTestExpectedResults When the cursor member is update returns KErrArgument
-*/
-
-void CTTSprite::GeneralTestsL()
-	{
-//
-// Close cursor while still active on a window
-//
-	
-	RWindow win(TheClient->iWs);
-	win.Construct(*TheClient->iGroup->GroupWin(),1);
-	win.Activate();
-	SetUpPointerCursorL(iCursor1,TheClient->iWs);
-	win.SetCustomPointerCursor(iCursor1);
-	iCursor1.Close();
-//
-// Close window while cursor active on it
-//
-	SetUpPointerCursorL(iCursor1,TheClient->iWs);
-	win.SetCustomPointerCursor(iCursor1);
-	win.Close();
-	iCursor1.Close();
-	
-//
-// Close session with:
-// An open cursor active on a window & A closed cursor active on another window
-//
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	// use correct screen
-	//
-	ws.SetFocusScreen(iTest->iScreenNumber);
-	CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws);
-	CleanupStack::PushL(screen);
-	User::LeaveIfError(screen->Construct(0));
-
-	RWindowGroup group(ws);
-	User::LeaveIfError(group.Construct(123));
-	group.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
-	RWindow win2(ws);
-	User::LeaveIfError(win2.Construct(group, 1));
-	win2.Activate();
-	RWindow win3(ws);
-	User::LeaveIfError(win3.Construct(group, 2));
-	win3.Activate();
-//
-	SetUpPointerCursorL(iCursor1,ws);
-	SetUpPointerCursorL(iCursor2,ws);
-	win2.SetCustomPointerCursor(iCursor1);
-	win3.SetCustomPointerCursor(iCursor2);
-//
-	TSpriteMember member;
-	member.iBitmap=member.iMaskBitmap=NULL;
-	TInt err = iCursor1.UpdateMember(9999,member);
-	TEST(err==KErrArgument);
-	if (err!=KErrArgument)
-		INFO_PRINTF3(_L("iCursor1.UpdateMember(9999,member) return value  - Expected: %d, Actual: %d"), KErrArgument, err);
-
-	iCursor1.Close();
-
-	CleanupStack::PopAndDestroy(screen);	
-	ws.Close();
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0019
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Construct a sprite in a group window
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates a sprite in a group window
-
-@SYMTestExpectedResults The sprite is created without error
-*/
-void CTTSprite::GroupWindowSpritesL()
-	{
-	RWsSprite sprite1;
-	RWsSprite sprite2;
-	SetUpSpriteL(sprite1,TheClient->iWs,*TheClient->iGroup->GroupWin());
-	SetUpSpriteL(sprite2,TheClient->iWs,*TheClient->iGroup->GroupWin());
-	TheClient->iWs.Flush();
-	sprite2.Close();
-	sprite1.Close();
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0020
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Constructs a number of different sprites in different windows
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates many sprites in three different windows and the checks
-					the sprites can be manipulated
-
-@SYMTestExpectedResults The sprite are created and manipulated without error
-*/
-#define NUM_SPRITES 8
-void CTTSprite::LotsSpritesL()
-	{
-	CTBlankWindow* win=new(ELeave) CTBlankWindow();
-	CTBlankWindow* win2=new(ELeave) CTBlankWindow();
-	TSize size(100,120);
-	win->ConstructL(*TheClient->iGroup);
-	win2->ConstructL(*win);
-	win2->SetExt(TPoint(100,100),size);
-	win2->SetColor(TRgb::Gray4(2));
-	RWindowBase window=*win->BaseWin();
-	RWindowBase window2=*win2->BaseWin();
-	window.Activate();
-	window2.Activate();
-	RWsSprite sprite[NUM_SPRITES];
-	TInt ii;
-	//TheClient->iWs.SetAutoFlush(ETrue);
-	for (ii=0;ii<NUM_SPRITES;ii++)
-		SetUpSpriteL(sprite[ii],TheClient->iWs,window);
-	sprite[4].Close();
-	sprite[2].SetPosition(TPoint(20,20));
-	sprite[0].Close();
-	win2->SetExt(TPoint(80,100),size);
-	sprite[6].SetPosition(TPoint(60,120));
-	sprite[7].Close();
-	sprite[5].SetPosition(TPoint(100,120));
-	sprite[3].Close();
-	SetUpSpriteL(sprite[7],TheClient->iWs,window);
-	sprite[7].SetPosition(TPoint(80,150));
-	sprite[1].Close();
-	win2->SetExt(TPoint(60,110),size);
-	sprite[5].SetPosition(TPoint(50,40));
-	sprite[7].Close();
-	SetUpSpriteL(sprite[0],TheClient->iWs,window);
-	sprite[0].SetPosition(TPoint(55,65));
-	sprite[6].Close();
-	win2->SetExt(TPoint(40,90),size);
-	sprite[2].SetPosition(TPoint(80,45));
-	sprite[5].Close();
-	sprite[0].SetPosition(TPoint(90,60));
-	sprite[2].Close();
-	SetUpSpriteL(sprite[2],TheClient->iWs,window);
-	sprite[2].SetPosition(TPoint(70,80));
-	sprite[0].Close();
-	win2->SetExt(TPoint(20,80),size);
-	sprite[2].SetPosition(TPoint(600,200));
-	sprite[2].Close();
-	SetUpSpriteL(sprite[0],TheClient->iWs,window2,ESpriteFlash);
-	sprite[0].SetPosition(TPoint(0,25));
-	SetUpSpriteL(sprite[1],TheClient->iWs,window2,ESpriteFlash);
-	SetUpSpriteL(sprite[2],TheClient->iWs,window2,ESpriteFlash);
-	sprite[2].SetPosition(TPoint(25,0));
-	win2->SetExt(TPoint(40,70),size);
-	CTBlankWindow* win3=new(ELeave) CTBlankWindow();
-	win3->ConstructL(*TheClient->iGroup);
-	win3->SetExt(TPoint(30,60),TSize(30,30));
-	win3->SetColor(TRgb::Gray4(1));
-	win3->BaseWin()->SetShadowHeight(10);
-	win3->BaseWin()->Activate();
-	User::After(1000000);		//1 sec so sprites has time to flash
-	delete win2;
-	delete win;
-	delete win3;
-	sprite[0].Close();
-	sprite[1].Close();
-	sprite[2].Close();
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0021
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    General PointerCursor Tests
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Exercise the different pointercursor methods of a Window Server Session
-
-@SYMTestExpectedResults The methods are called without error
-*/
-void CTTSprite::GeneralPointerCursor()
-	{
-	if (!TestBase()->ConfigurationSupportsPointerEventTesting())
-	    {
-	    INFO_PRINTF1(_L("Test skipped because config does not support pointer event testing"));
-	    return;
-	    }
-	TInt currentSMode=TheClient->iScreen->CurrentScreenMode();
-	TInt altSMode=-1;
-	if (TheClient->iScreen->NumScreenModes()>1)
-		altSMode=(currentSMode==1?0:1);
-	RWsSession &ws=TheClient->iWs;
-	TRect rect=ws.PointerCursorArea();
-	TRect testRect1(TPoint(rect.iBr.iX/4,rect.iBr.iY/4),TSize(rect.Width()/2,rect.Height()/2));
-	TRect testRect2(TPoint(rect.iBr.iX/3,rect.iBr.iY/3),TSize(2*rect.Width()/3,2*rect.Height()/3));
-	ws.SetPointerCursorArea(testRect1);
-	TEST(ws.PointerCursorArea()==testRect1);
-	TEST(ws.PointerCursorArea(currentSMode)==testRect1);
-	ws.SetPointerCursorArea(currentSMode,testRect2);
-	TEST(ws.PointerCursorArea()==testRect2);
-	TEST(ws.PointerCursorArea(currentSMode)==testRect2);
-	ws.SetPointerCursorArea(rect);
-	TEST(ws.PointerCursorArea()==rect);
-	
-	if (altSMode>=0)
-		{
-		rect=ws.PointerCursorArea(altSMode);
-		testRect1.iTl.iX=rect.iBr.iX/4;
-		testRect1.iTl.iY=rect.iBr.iY/4;
-		testRect1.SetWidth(rect.Width()/2);
-		testRect1.SetHeight(rect.Height()/2);
-		ws.SetPointerCursorArea(altSMode,testRect1);
-		TEST(ws.PointerCursorArea(altSMode)==testRect1);
-		ws.SetPointerCursorArea(altSMode,rect);
-		TEST(ws.PointerCursorArea(altSMode)==rect);
-		}
-	TPointerCursorMode currentMode=ws.PointerCursorMode();
-	TInt ii;
-	TInt err1;
-	for(ii=EPointerCursorFirstMode;ii<=EPointerCursorLastMode;ii++)
-		{	
-		ws.SetPointerCursorMode(STATIC_CAST(TPointerCursorMode,ii));
-		err1 = ws.PointerCursorMode();
-		TEST(ii==err1);
-		if (ii!=err1)
-			INFO_PRINTF3(_L("ws.PointerCursorMode() return value  - Expected: %d, Actual: %d"), ii, err1);		
-		}
-	ws.SetPointerCursorMode(currentMode);
-	TEST(currentMode==ws.PointerCursorMode());
-	TPoint point1(10,12);
-	TPoint point2(24,20);
-	ws.PointerCursorPosition();
-	ws.SetPointerCursorPosition(point1);
-	TEST(ws.PointerCursorPosition()==point1);
-	ws.SetPointerCursorPosition(point2);
-	TEST(ws.PointerCursorPosition()==point2);
-	}
-
-
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0498
-
-@SYMDEF             PDEF137614 - Propagation to TB92
-
-@SYMTestCaseDesc    Test activating a pointer cursor
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Construct and activate a pointer cursor. 
-                    Check it is visible.
-                    Deactivate it
-                    Check it is removed
-                    
-
-@SYMTestExpectedResults 
-                    The pointer cursor bitmp should be visible when activated and removed when deactivated.
-*/
-
-void CTTSprite::PointerCursorVisibleL()
-    {
-    if (!TestBase()->ConfigurationSupportsPointerEventTesting())
-        {
-        INFO_PRINTF1(_L("Test skipped because config does not support pointer event testing"));
-        return;
-        }
-    
-    // The pointer events need time to have an affect on the wserv
-    static const TInt eventPropagationDelay = 100 * 1000; // 100 ms
-    
-    TInt screenNumber = TheClient->iScreen->GetScreenNumber();
-    
-    if(screenNumber != 0) // pointer events only supported on emulator screen 0
-        {
-        LOG_MESSAGE(_L("Pointer Cursor Visible only runs on screen 0"));
-        return;
-        }
-    
-    // set up objects used in test
-    // 50x50 red rectangle colour 24
-    CFbsBitmap bitmap;
-    User::LeaveIfError(bitmap.Load(TEST_BITMAP_NAME, 8));
-    
-    TSize bmSize = bitmap.SizeInPixels();
-    TPoint bmSample = TPoint(bmSize.iWidth / 2, bmSize.iHeight / 2);
-    TRgb bmColour;
-    bitmap.GetPixel(bmColour, bmSample);
-    TEST(bmColour == KRgbRed);
-
-    // single window, size of screen
-    RWindow win(TheClient->iWs);
-    User::LeaveIfError(win.Construct(*TheClient->iGroup->GroupWin(),1));
-    win.Activate();
-
-    // setup cursor mode
-    TheClient->iWs.SetPointerCursorMode(EPointerCursorWindow);
-    
-    // setup cursor to contain single 50x50 red bitmap
-    RWsPointerCursor iCursor1 = RWsPointerCursor(TheClient->iWs);
-    TSpriteMember member;
-    SetUpMember(member);
-    member.iBitmap=&bitmap;
-    User::LeaveIfError(iCursor1.Construct(0));
-    User::LeaveIfError(iCursor1.AppendMember(member));
-    User::LeaveIfError(iCursor1.Activate());
-    win.SetCustomPointerCursor(iCursor1);
-    iCursor1.UpdateMember(0);
-
-    // draw a green rect, size of screen as defined background and wait till it is rendered
-    win.BeginRedraw();
-    TheGc->Activate(win);
-    TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-    TheGc->SetBrushColor(KRgbGreen);
-    TSize wSize = win.Size();
-    TheGc->DrawRect(TRect(TPoint(0,0), wSize));
-    TheGc->Deactivate();
-    win.EndRedraw();
-    TheClient->iWs.Finish();
-    
-    // #### do test ####
-    // define locations of simulated pointer events and sample positions of where we expect to see the cursor
-    // The cursor will be moved and a check will be made to see if this has actually happened
-    
-    TPoint pos1(wSize.iWidth / 2, wSize.iHeight / 2); // top left of cursor at centre screen
-    TPoint sample1(pos1 + bmSample); // centre of sprite at pos1
-    TPoint pos2 = pos1 - bmSize; // bottom right of cursor at centre screen
-    TPoint sample2 = pos2 + bmSample;  // centre of sprite at pos2
-
-    TRgb pixel;
-    
-    // check initial state of screen at both sample positions
-    TheClient->iScreen->GetPixel(pixel, sample1);
-    TEST(pixel == KRgbGreen);
-
-    TheClient->iScreen->GetPixel(pixel, sample2);
-    TEST(pixel == KRgbGreen);
-    
-    TRawEvent e; // to simulate pointer events
-
-    // simulate button 1 down event at pos1
-    e.Set(TRawEvent::EButton1Down, pos1.iX, pos1.iY);
-    e.SetDeviceNumber(screenNumber);
-    UserSvr::AddEvent(e);
-
-    User::After(eventPropagationDelay);
-    
-    // check red cursor visible on top of background
-    TheClient->iScreen->GetPixel(pixel, sample1);
-    TEST(pixel == KRgbRed);
-    
-    // simulate button 1 up event
-    e.Set(TRawEvent::EButton1Up, pos1.iX, pos1.iY);
-    UserSvr::AddEvent(e);
-    User::After(eventPropagationDelay);
-    
-    // Move cursor away to pos2 
-    e.Set(TRawEvent::EButton1Down, pos2.iX, pos2.iY);
-    e.SetDeviceNumber(screenNumber);
-    UserSvr::AddEvent(e);
-    
-    User::After(eventPropagationDelay);
-    
-    // check cursor has left this position ...
-    TheClient->iScreen->GetPixel(pixel, sample1);
-    TEST(pixel == KRgbGreen);
-    // and arrived at the correct place
-    TheClient->iScreen->GetPixel(pixel, sample2);
-    TEST(pixel == KRgbRed);
-
-    // simulate button 1 up event
-    e.Set(TRawEvent::EButton1Up, pos2.iX, pos2.iY);
-    UserSvr::AddEvent(e);
-    User::After(eventPropagationDelay);
-    
-    // remove the cursor
-    win.ClearPointerCursor();
-    User::After(eventPropagationDelay);
-    
-    // check it has gone
-    TheClient->iScreen->GetPixel(pixel, sample2);
-    TEST(pixel == KRgbGreen);
-    
-    // #### clean up ####
-    iCursor1.Close();
-    win.Close();
-    }
-
-
-/**
-	@SYMTestCaseID GRAPHICS-CODEBASE-WSERV-0053-0001
-  
-	@SYMPREQ PGM027
-  
-	@SYMTestCaseDesc Tests RWsPointerCursor::UpdateMember APIs. 
-   
-	@SYMTestPriority 1 
-  
-	@SYMTestStatus Implemented
-   
-	@SYMTestActions This test calls RWsPointerCursor::UpdateMember
-		
-	@SYMTestExpectedResults Should run properly with out any Panics.
-
-  */
-void CTTSprite::SpriteUpdateMemberTestsL()
-	{
-	RWsPointerCursor iCursor1;
-	
-	CFbsBitmap bitmap;
-	bitmap.Load(TEST_BITMAP_NAME,0);
-		
-	RWindow win(TheClient->iWs);
-	win.Construct(*TheClient->iGroup->GroupWin(),1);
-	win.Activate();
-
-	iCursor1=RWsPointerCursor(TheClient->iWs);
-	TSpriteMember member;
-	SetUpMember(member);
-	member.iBitmap=&bitmap;
-	User::LeaveIfError(iCursor1.Construct(0));
-	User::LeaveIfError(iCursor1.AppendMember(member));
-	User::LeaveIfError(iCursor1.Activate());
-	win.SetCustomPointerCursor(iCursor1);
-	iCursor1.UpdateMember(0);
-	
-	RWsPointerCursor iCursor2;
-	bitmap.Load(TEST_NEW_BITMAP_NAME,0);
-	iCursor2=RWsPointerCursor(TheClient->iWs);
-	User::LeaveIfError(iCursor2.Construct(0));
-	User::LeaveIfError(iCursor2.AppendMember(member));
-	User::LeaveIfError(iCursor2.Activate());
-	win.SetCustomPointerCursor(iCursor2);
-	iCursor2.UpdateMember(1);
-	
-	iCursor1.Close();
-	iCursor2.Close();
-	win.Close();
-	}
-
-/**
-	@SYMTestCaseID GRAPHICS-CODEBASE-WSERV-0054-0001
-  
-	@SYMPREQ PGM027
-  
-	@SYMTestCaseDesc Negative Tests RWsSpriteBase::UpdateMember API. 
-   
-	@SYMTestPriority 1 
-  
-	@SYMTestStatus Implemented
-   
-	@SYMTestActions This test calls RWsPointerCursor::UpdateMember
-		
-	@SYMTestExpectedResults Should run properly with out any Panics.
-
- */
-void CTTSprite::SpriteUpdateMemberNegTestsL()
-	{
-	RWsPointerCursor iCursor1;
-	
-	CFbsBitmap bitmap;
-	bitmap.Load(TEST_BITMAP_NAME,0);
-		
-	RWindow win(TheClient->iWs);
-	win.Construct(*TheClient->iGroup->GroupWin(),1);
-	win.Activate();
-
-	iCursor1=RWsPointerCursor(TheClient->iWs);
-	TSpriteMember member;
-	SetUpMember(member);
-	member.iBitmap=&bitmap;
-	User::LeaveIfError(iCursor1.Construct(0));
-	User::LeaveIfError(iCursor1.AppendMember(member));
-	User::LeaveIfError(iCursor1.Activate());
-	win.SetCustomPointerCursor(iCursor1);
-	iCursor1.UpdateMember(-100);
-	
-	RWsPointerCursor iCursor2;
-	bitmap.Load(TEST_NEW_BITMAP_NAME,0);
-	iCursor2=RWsPointerCursor(TheClient->iWs);
-	User::LeaveIfError(iCursor2.Construct(0));
-	User::LeaveIfError(iCursor2.AppendMember(member));
-	User::LeaveIfError(iCursor2.Activate());
-	win.SetCustomPointerCursor(iCursor2);
-	iCursor2.UpdateMember(10000);
-	
-	iCursor1.Close();
-	iCursor2.Close();
-	win.Close();
-	}
-
-/**
-	@SYMTestCaseID GRAPHICS-CODEBASE-WSERV-0055-0001
-  
-	@SYMPREQ PGM027
-  
-	@SYMTestCaseDesc Tests FindWindowGroupIdentifier API. 
-   
-	@SYMTestPriority 1 
-  
-	@SYMTestStatus Implemented
-   
-	@SYMTestActions Create windows session and call FindWindowGroupIdentifier \n
-	with different thread Id's both with valid thread ids and in valid thread id's.
-	
-	@SYMTestExpectedResults Should run properly.
-
- */	
-void CTTSprite::FindWindowGroupThreadTestsL()	
-	{
-	RThread proc;
-	TInt ident;
-	TUint64 id=proc.Id();
-	RWsSession ws1;
-	User::LeaveIfError(ws1.Connect());
-	CleanupClosePushL(ws1);
-	//Positive test for FindWindowGroupIdentifier
-	ident=ws1.FindWindowGroupIdentifier(0,id);
-	TEST(ws1.SetWindowGroupOrdinalPosition(ident,0)==KErrNone);
-	TEST(ws1.SetWindowGroupOrdinalPosition(ident,1)==KErrNone);
-	//Negative test for FindWindowGroupIdentifier
-    TInt ret=ws1.FindWindowGroupIdentifier(0,id+200);
-	TEST(ret==KErrNotFound);
-	#if defined __WINS__ || defined __WINSCW__
-	ret=ws1.FindWindowGroupIdentifier(0,-200);
-	TEST(ret==KErrNotFound);
-	#endif//defined __WINS__ || defined __WINSCW__
-	CleanupStack::PopAndDestroy(1, &ws1);
-	ws1.Close();
-	}	
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0462
-
-@SYMDEF  			PDEF114190
-
-@SYMTestCaseDesc    Test sprite list cleanup when a window is deleted in low memory conditions
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Have a loop which increases the number of allocations in the server thread before failure;
-					Within the loop:
-					1) Create a parent window and a child window of the parent;
-					2) Create a sprite on the child window; 
-					3) Delete the parent window only, but not the child window; 
-					4) Create a testWindow and do redraw on this window; 
-					5) Do redraw on the testWindow. This testWindow's redraw will force checking the sprite list. 
-					This would panic the client thread due to this defect because the sprite on the orphaned 
-					window (which is the previous child window) is still in the sprite list;
-					6) Delete all the windows involved.
-
-@SYMTestExpectedResults The sprite should be disabled when a window is deleted;
-						The client thread should not be panic'd.
-						The test should pass.
-*/
-void CTTSprite::SpriteOnWindowOrphanedTestsL()
-	{
-	TInt handles = 344;
-	TInt loop = 0;
-	TInt allocFailRate = 0;
-	TInt err = KErrNone;
-
-	CFbsBitmap* bitmap = new(ELeave) CFbsBitmap;
-	CleanupStack::PushL(bitmap);
-	User::LeaveIfError(bitmap->Create(TSize(500, 500), EColor16MU));
-	TSpriteMember spritemember;
-	spritemember.iBitmap = bitmap;
-	spritemember.iMaskBitmap = NULL;	
-	
-	RWindowGroup group(TheClient->iWs);
-	RWindow parent1(TheClient->iWs);
-	RWindow child1(TheClient->iWs);
-	RWindow testWindow(TheClient->iWs);
-	RWsSprite sprite(TheClient->iWs);
-	
-	while (loop < 5)
-		{
-		TRect mainRect(TPoint(0,0), TSize(500,500));
-		err = group.Construct(++handles, EFalse);	
-		if (err == KErrNone)
-			{
-			TheClient->iWs.HeapSetFail(RHeap::EDeterministic, allocFailRate);
-
-			//Create parent 1
-			err = parent1.Construct(group,++handles);
-			if (err == KErrNone)
-				{
-				parent1.SetExtent(mainRect.iTl, mainRect.Size());
-				parent1.EnableRedrawStore(ETrue);
-				parent1.Activate();
-				}			
-			}
-		
-		//Create child 1
-		if (err == KErrNone)
-			{
-			TRect childRect(TPoint (10, 10), TSize (200, 150));
-			err = child1.Construct(parent1,++handles);
-			if (err == KErrNone)
-				{
-				child1.SetExtent(childRect.iTl, childRect.Size());
-				child1.SetBackgroundColor(TRgb(128,100,255,20));
-				child1.Activate();
-				}
-			}
-		
-		//Add sprite to child 1
-		if (err == KErrNone) 
-			{
-			err = sprite.Construct(child1,TPoint(10,10), 0);
-			if (err == KErrNone)
-				{
-				err = sprite.AppendMember(spritemember);
-				if (err == KErrNone)
-					err = sprite.Activate();	
-				}
-			}
-
-		//Only delete parent 1, but not child 1	
-		parent1.Close();		
-
-		if (err == KErrNone) 
-			{
-			TRect testRect(TPoint(10, 30), TSize(200, 150));
-			//Create testWindow
-			err = testWindow.Construct(group,++handles);
-			if (err == KErrNone)
-				{
-				testWindow.SetExtent(testRect.iTl, testRect.Size());
-				testWindow.SetBackgroundColor(TRgb(128,100,255,20));
-				testWindow.EnableRedrawStore(ETrue);
-				testWindow.Activate();
-				testWindow.BeginRedraw();
-				testWindow.EndRedraw();	
-				TheClient->Flush();			
-				}
-			}
-		TheClient->iWs.HeapSetFail(RAllocator::ENone, 0);
-
-		sprite.Close();
-		child1.Close();
-		testWindow.Close();
-		group.Close();		
-		++allocFailRate;
-		loop = (err == KErrNone) ? loop + 1 : 0;
-		}
-	CleanupStack::PopAndDestroy(bitmap);
-	}
-void CTTSprite::ResizeMemberL()
-	{
-#ifndef __WINS__
-	CTBlankWindow* win=new(ELeave) CTBlankWindow();
-	CleanupStack::PushL(win);
-	win->ConstructL(*TheClient->iGroup);
-	win->SetExt(TPoint(),TSize(640,240));
-	RWindowBase& window=*win->BaseWin();
-	window.Activate();
-	RWsSprite sprite(TheClient->iWs);
-	CleanupClosePushL(sprite);
-	User::LeaveIfError(sprite.Construct(window,TPoint(),0));
-	TSpriteMember member;
-	member.iMaskBitmap=NULL;
-	member.iInvertMask=EFalse;
-	member.iDrawMode=CGraphicsContext::EDrawModePEN;
-	member.iOffset=TPoint();
-	member.iInterval=TTimeIntervalMicroSeconds32(250000);
-	member.iBitmap=&iBitmap;
-	User::LeaveIfError(sprite.AppendMember(member));
-	User::LeaveIfError(sprite.AppendMember(member));
-	User::LeaveIfError(sprite.Activate());
-	User::After(1000000); // // Interval is 1 sec.
-	User::LeaveIfError(iBitmap.Resize(iBitmap.SizeInPixels() + TSize(100,100)));
-	User::After(1000000);  // Interval is 1 sec.
-	CleanupStack::PopAndDestroy(&sprite);
-	CleanupStack::PopAndDestroy(win);
-#endif // __WINS__
-	}
-
-
-void CTTSprite::SetUpSpriteL(RWsSprite &aSprite, RWindowTreeNode &aWindow,TPoint aPoint, TSpriteMember aMember, TInt aFlags/*=0*/)
-	{
-	User::LeaveIfError(aSprite.Construct(aWindow,aPoint,aFlags));
-	User::LeaveIfError(aSprite.AppendMember(aMember));
-	User::LeaveIfError(aSprite.Activate());
-	}
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-00-0001
-
-@SYMDEF  			PDEF117721
-
-@SYMTestCaseDesc    Test Screenrotation does not cause panic by sprite with NULL bitmap and NULL maskbitmap
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Defines two sprites and one with Null iBitmap and Null iMaskBitmap, then rotate the screen to 90 degrees
-
-@SYMTestExpectedResults the screen rotation will not cause wserv a panic
-*/
-void CTTSprite::RotateNullSpriteL()
-	{
-	if (TheClient->iScreen->NumScreenModes() < 2)
-		{
-		LOG_MESSAGE(_L("WARNING: Unable to rotate screen"));
-		return;
-		}
-// Sprite Members		
-	TSpriteMember spriteMember1,spriteMember2;
-	SetUpMember(spriteMember1);
-	SetUpMember(spriteMember2);
-	spriteMember2.iBitmap = NULL;
-	
-// Create windows
-	RWindowGroup group(TheClient->iWs);
-	User::LeaveIfError(group.Construct(ENullWsHandle,EFalse));	//Creates a Group Window
-	CleanupClosePushL(group);
-	RBlankWindow win(TheClient->iWs);
-	User::LeaveIfError(win.Construct(group,ENullWsHandle));	//Creates a Blank Window
-	CleanupClosePushL(win);
-	win.SetVisible(ETrue);
-	win.SetColor(TRgb::Gray4(2));
-	win.Activate();
-	TheClient->Flush();
-	
-// Create Sprites
-	RWsSprite sprite1(TheClient->iWs);
-	CleanupClosePushL(sprite1);
-	SetUpSpriteL(sprite1, win,TPoint(20,70),spriteMember1,0);
-	RWsSprite sprite2(TheClient->iWs);
-	CleanupClosePushL(sprite2);
-	SetUpSpriteL(sprite2, win,TPoint(80,130),spriteMember2,0);
-	RWsSprite sprite3(TheClient->iWs);
-	CleanupClosePushL(sprite3);
-	SetUpSpriteL(sprite3, win,TPoint(2800,2130),spriteMember1,0);
-	TheClient->Flush();
-
-// Get the original screen mode	
-	CWsScreenDevice* device = TheClient->iScreen;
-	TInt originalScreenMode = device->CurrentScreenMode();
-	TPixelsTwipsAndRotation originalModeSettings;
-	device->GetScreenModeSizeAndRotation(originalScreenMode,originalModeSettings);
-
-// Rotate screens	
-	TPixelsAndRotation pixelsAndRotation;
-	device->SetScreenMode( 1 );
-	device->GetDefaultScreenSizeAndRotation(pixelsAndRotation);
-	device->SetCurrentRotations(1,pixelsAndRotation.iRotation);
-	device->SetScreenSizeAndRotation(pixelsAndRotation);
-	User::After(1000000);
-	
-	CleanupStack::PopAndDestroy(5,&group);
-//	Restore the original screen mode	
-	device->SetScreenMode(originalScreenMode);
-	device->SetCurrentRotations(originalScreenMode,originalModeSettings.iRotation);
-	device->SetScreenSizeAndRotation(originalModeSettings);
-	TheClient->Flush();
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-GCE-0700
-
-@SYMDEF  			DEF123129
-
-@SYMTestCaseDesc    Test activating a sprite twice does not cause the system to hang
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Construct a sprite and add a member to it. Activate twice.
-
-@SYMTestExpectedResults The test should terminate smoothly and it should not hang the system.
-*/
-void CTTSprite::DoubleActivateL()
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	CleanupClosePushL(ws);
-	
-	RWindowGroup group(ws);
-	User::LeaveIfError(group.Construct(890, EFalse));
-	CleanupClosePushL(group);
-	
-	RWsSprite sprite = RWsSprite(ws);
-	User::LeaveIfError(sprite.Construct(group,TPoint(),0));
-	CleanupClosePushL(sprite);
-	CFbsBitmap* bitmap=new(ELeave) CFbsBitmap;
-	CleanupStack::PushL(bitmap);
-	User::LeaveIfError(bitmap->Create(TSize(10,12),EColor256));
-	TSpriteMember member;
-	member.iMaskBitmap=NULL;
-	member.iInvertMask=EFalse;
-	member.iDrawMode=CGraphicsContext::EDrawModePEN;
-	member.iOffset=TPoint();
-	member.iInterval=TTimeIntervalMicroSeconds32(0);
-	member.iBitmap=bitmap;
-	User::LeaveIfError(sprite.AppendMember(member));
-	User::LeaveIfError(sprite.Activate());
-	User::LeaveIfError(sprite.Activate());
-	
-	sprite.Close();
-	CleanupStack::PopAndDestroy(4, &ws);
-	
-	group.Close();
-	ws.Close();
-	}
-
-void CTTSprite::RunTestCaseL(TInt /*aCurTestCase*/)
-	{	
-	_LIT(KTest1, "General Tests");
-	_LIT(KTest2, "Group Window Sprites Tests");
-	_LIT(KTest3, "Lots Sprites Tests");
-	_LIT(KTest4, "General Pointer Cursor Tests");
-    _LIT(KTest5, "Pointer Cursor Visible Tests");
-    _LIT(KTest6, "Update member tests");
-    _LIT(KTest7, "Negative tests for Update member");
-    _LIT(KTest8, "Window Group with Thread");
-    _LIT(KTest9, "Resize Sprite Member Tests");
-    _LIT(KTest10, "Rotate a NULL sprite");
-    _LIT(KTest11, "Sprite On Window Orphaned Tests");
-    _LIT(KTest12, "Sprite Double Activation Test");
-	
-	((CTTSpriteStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(++iTest->iState)
-		{
-	case 1:		
-		((CTTSpriteStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0018"));
-		TheClient->iWs.SetFocusScreen(0);
-		iTest->LogSubTest(KTest1);
-		GeneralTestsL();
-		break;
-	case 2:
-		((CTTSpriteStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0019"));
-		iTest->LogSubTest(KTest2);
-		GroupWindowSpritesL();
-		break;
-	case 3:
-		((CTTSpriteStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0020"));
-		iTest->LogSubTest(KTest3);
-		LotsSpritesL();
-		break;
-	case 4:
-		((CTTSpriteStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0021"));
-		iTest->LogSubTest(KTest4);
-		GeneralPointerCursor();
-		break;
-    case 5:
-        ((CTTSpriteStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0498"));
-        iTest->LogSubTest(KTest5);
-        TRAPD(err, PointerCursorVisibleL());
-        TEST(err == KErrNone);
-        break;
-	case 6:
-		((CTTSpriteStep*)iStep)->SetTestStepID(_L("GRAPHICS-CODEBASE-WSERV-0053-0001"));
-		iTest->LogSubTest(KTest6);
-		TRAP(err, SpriteUpdateMemberTestsL());
-		TEST(err == KErrNone);
-		break;
-	case 7:
-		((CTTSpriteStep*)iStep)->SetTestStepID(_L("GRAPHICS-CODEBASE-WSERV-0054-0001"));
-		iTest->LogSubTest(KTest7);
-		TRAP(err, SpriteUpdateMemberNegTestsL());
-		TEST(err == KErrNone);
-		break;
-	case 8:
-		((CTTSpriteStep*)iStep)->SetTestStepID(_L("GRAPHICS-CODEBASE-WSERV-0055-0001"));
-		iTest->LogSubTest(KTest8);
-		TRAP(err, FindWindowGroupThreadTestsL());
-		TEST(err == KErrNone);
-		break;
-	case 9:
-		((CTTSpriteStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0526"));
-		iTest->LogSubTest(KTest9);
-		ResizeMemberL();
-		break;
-	case 10:
-		((CTTSpriteStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-00-0001"));
-		iTest->LogSubTest(KTest10);
-		RotateNullSpriteL();
-		break;
-	case 11:
-		((CTTSpriteStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0462"));
-		iTest->LogSubTest(KTest11);
-		SpriteOnWindowOrphanedTestsL();
-		break;
-	case 12:
-		((CTTSpriteStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-GCE-0700"));
-		iTest->LogSubTest(KTest12);
-		DoubleActivateL();
-		break;
-	default:
-		((CTTSpriteStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-		((CTTSpriteStep*)iStep)->CloseTMSGraphicsStep();
-		TestComplete();
-		break;
-		}
-	((CTTSpriteStep*)iStep)->RecordTestResultL();
-	}
-
-//--------------
-__WS_CONSTRUCT_STEP__(TSprite)
-
--- a/windowing/windowserver/tauto/TSPRITE.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TSPRITE_H__
-#define __TSPRITE_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-#define TEST_NEW_BITMAP_NAME _L("Z:\\WSTEST\\mytest.mbm")
-
-class CTTSprite : public CTWsGraphicsBase
-	{
-public:
-	CTTSprite(CTestStep* aStep);
-	~CTTSprite();
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-public:
-	void ConstructL();
-	void GeneralTestsL();
-	void GroupWindowSpritesL();
-	void LotsSpritesL();
-	void GeneralPointerCursor();
-    void PointerCursorVisibleL();
-	void SpriteUpdateMemberTestsL();
-	void SpriteUpdateMemberNegTestsL();
-	void FindWindowGroupThreadTestsL();
-	void SpriteOnWindowOrphanedTestsL();
-	void ResizeMemberL();
-	void RotateNullSpriteL();
-	void DoubleActivateL();
-private:
-	void SetUpMember(TSpriteMember &aMember);
-	void SetUpPointerCursorL(RWsPointerCursor &aCursor, RWsSession &aSession);
-	void SetUpSpriteL(RWsSprite &aSprite, RWsSession &aSession, RWindowTreeNode &aWindow,TInt aFlags=0);
-	void SetUpSpriteL(RWsSprite &aSprite, RWindowTreeNode &aWindow,TPoint aPoint, TSpriteMember aMember, TInt aFlags=0);
-
-private:
-	RWsPointerCursor iCursor1;
-	RWsPointerCursor iCursor2;
-	CFbsBitmap iBitmap;
-	};
-
-class CTTSpriteStep : public CTGraphicsStep
-	{
-public:
-	CTTSpriteStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTTSpriteStep,"TSprite");
-
-
-#endif
--- a/windowing/windowserver/tauto/TScreenModeScaling.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1104 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test code for screen mode scaling CR
-// Test code for the Scaling part of Change Request PHAR-5SJGAM 
-// ("Enable screen mode positioning and scaling").
-// Tests screen scale being configurable for a screen mode -  
-// eg it is now possible to set in wsini.ini amount by which a screen 
-// mode's screen will be scaled when drawn on the physical screen. 
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TScreenModeScaling.h"
-
-#define MY_TEST_BITMAP _L("Z:\\WSTEST\\MYTEST.MBM")
-
-LOCAL_D TSize FullScreenModeSize;
-LOCAL_D TInt Copy2ndHalfOfScreen;
-
-void ClearBitmap(CFbsBitmap* aBitMap)
-	{
-	// clear the content of bitmap before it is used for copying
-	CFbsBitmapDevice *device=CFbsBitmapDevice::NewL(aBitMap);
-	CleanupStack::PushL(device);
-	CFbsBitGc *gc=NULL;
-	User::LeaveIfError(device->CreateContext(gc));
-	CleanupStack::PushL(gc);
-	gc->Clear();
-	CleanupStack::PopAndDestroy(2,device);
-	}
-
-/*CBitMapWin*/
-
-void CBitMapWin::Draw()
-	{
-	iGc->BitBlt(TPoint(),&iBackup->Bitmap());
-	}
-
-/*CTestSpriteWin*/
-
-CTestSpriteWin::~CTestSpriteWin()
-	{
-	}
-
-void CTestSpriteWin::UpdateWin(TPoint aOrigin)
-	{
-	SetOrigin(aOrigin);
-	DrawNow();
-	}
-
-void CTestSpriteWin::Draw()
-	{
-	iGc->BitBlt(iOrigin,&iSpriteBitmap);
-	}
-
-/*CTScreenModeScaling*/
-
-CTScreenModeScaling::CTScreenModeScaling(CTestStep* aStep) : CTWsGraphicsBase(aStep)
-	{
-	}
-	
-CTScreenModeScaling::~CTScreenModeScaling()
-	{
-	delete iTestWin;
-	delete iBlankWin;
-	delete iBackedUpWin;
-	delete iTestChildWin;
-	delete iScreenBitmap;
-	delete iBitmapWin;
-	delete iCheckWin;
-	delete iTransWin;
-	delete iBackgroundWin;
-	delete iCheckBitmap;
-	delete iTransparencyBitmap;
-	delete iBackgroundBitmap;
-	delete iForegroundBitmap;
-	}
-
-void CTScreenModeScaling::ConstructL()
-	{
-	iDisplayMode=TheClient->iScreen->DisplayMode();
-	if (iDisplayMode<EColor256)
-		iDisplayMode=EColor256;
-	User::LeaveIfError(iSpriteBitmap.Load(MY_TEST_BITMAP,0));
-
-	TheClient->iScreen->SetAppScreenMode(TheClient->iScreenModes[0]);
-	FullScreenModeSize=TheClient->iScreen->SizeInPixels();
-	iBlankWin=new(ELeave) CTBlankWindow();
-	iBlankWin->ConstructL(*TheClient->iGroup);
-	User::LeaveIfError(iBlankWin->BaseWin()->SetRequiredDisplayMode(EColor256));
-	iBlankWin->SetExt(TPoint(),FullScreenModeSize);
-	iBlankWin->Activate();
-
-	iTestWin=new(ELeave) CBasicWin;
-	iTestWin->ConstructExtLD(*TheClient->iGroup,TPoint(),FullScreenModeSize);
-	User::LeaveIfError(iTestWin->BaseWin()->SetRequiredDisplayMode(EColor256));
-	iTestWin->AssignGC(*TheClient->iGc);
-	iTestWin->SetVisible(EFalse);
-	iTestWin->Activate();
-	iTestWin->BaseWin()->SetShadowDisabled(ETrue);
-	iTestWin->BaseWin()->SetShadowHeight(0);
-
-	iBackedUpWin=new(ELeave) CTBackedUpWin(iDisplayMode);
-	iBackedUpWin->ConstructExtLD(*iTestWin,TPoint(),FullScreenModeSize);
-	iBackedUpWin->SetVisible(EFalse);
-	iBackedUpWin->Activate();
-
-	iTestChildWin=new(ELeave) CTBlankWindow();
-	iTestChildWin->ConstructL(*iTestWin);
-	User::LeaveIfError(iTestChildWin->BaseWin()->SetRequiredDisplayMode(EColor256));
-	iTestChildWin->BaseWin()->SetShadowDisabled(ETrue);
-	iTestChildWin->SetColor(KRgbGreen);
-	iTestChildWin->BaseWin()->SetVisible(EFalse);
-	iTestChildWin->Activate();
-
-	iScreenBitmap=new(ELeave) CFbsBitmap();
-	User::LeaveIfError(iScreenBitmap->Create(TSize(FullScreenModeSize.iWidth/2,FullScreenModeSize.iHeight),iDisplayMode));
-
-	iBitmapWin=new(ELeave) CBmpWin(*iScreenBitmap);
-	iBitmapWin->ConstructExtLD(*TheClient->iGroup,TPoint(),iScreenBitmap->SizeInPixels());
-	User::LeaveIfError(iBitmapWin->BaseWin()->SetRequiredDisplayMode(EColor256));
-	iBitmapWin->AssignGC(*TheClient->iGc);
-	iBitmapWin->Activate();
-	iBitmapWin->SetVisible(EFalse);
-	iBitmapWin->BaseWin()->SetShadowDisabled(ETrue);
-	iBitmapWin->BaseWin()->SetShadowHeight(0);
-
-	//.. Create all the bitmaps and transparent windows
-	iWinSize.SetSize(20,20);
-	iTransparencyBitmap=CBitmap::NewL(iWinSize,EGray256);
-	iBackgroundBitmap=CBitmap::NewL(iWinSize,iDisplayMode);
-	iForegroundBitmap=CBitmap::NewL(iWinSize,iDisplayMode);
-
-	CBitMapWin* backgroundWin=new(ELeave) CBitMapWin(iBackgroundBitmap);
-	backgroundWin->ConstructExtLD(*TheClient->iGroup,TPoint(),iWinSize);
-	iBackgroundWin=backgroundWin;
-	User::LeaveIfError(iBackgroundWin->BaseWin()->SetRequiredDisplayMode(EColor256));
-	iBackgroundWin->SetVisible(EFalse);
-	iBackgroundWin->BaseWin()->SetShadowDisabled(ETrue);
-	iBackgroundWin->BaseWin()->SetShadowHeight(0);
-	iBackgroundWin->AssignGC(*TheClient->iGc);
-	iBackgroundWin->Activate();
-
-	CBitMapWin* transWin=new(ELeave) CBitMapWin(iForegroundBitmap);
-	transWin->ConstructExtLD(*TheClient->iGroup,TPoint(),iWinSize);
-	iTransWin=transWin;
-	RWindowBase& transWinB=*iTransWin->BaseWin();
-	User::LeaveIfError(transWinB.SetRequiredDisplayMode(EColor256));
-	transWinB.SetShadowDisabled(ETrue);
-	transWinB.SetShadowHeight(0);
-	iTransWin->SetVisible(EFalse);
-	iTransWin->AssignGC(*TheClient->iGc);
-	iTransWin->Win()->SetTransparencyBitmap(iTransparencyBitmap->Bitmap());
-	iTransWin->Activate();
-
-	CTBackedUpWin* checkWin=new(ELeave) CTBackedUpWin(iDisplayMode);
-	checkWin->ConstructExtLD(*TheClient->iGroup,TPoint(iWinSize.iWidth+1,0),iWinSize);
-	iCheckWin=checkWin;
-	RBackedUpWindow& win=*iCheckWin->BackedUpWin();
-	win.SetShadowHeight(0);
-	iCheckWin->Activate();
-	win.MaintainBackup();
-	iCheckBitmap=CBitmap::NewL(win.BitmapHandle());
-	iCheckWin->BaseWin()->SetShadowDisabled(ETrue);
-	iCheckWin->BaseWin()->SetShadowHeight(0);
-	iCheckWin->BaseWin()->SetVisible(EFalse);
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	}
-
-void CTScreenModeScaling::TestTopClientWindowPositionAPIs(TPoint aPos,RWindowBase* aWin)
-	{
-	TEST(aWin->AbsPosition()==aPos);
-	TEST(aWin->Position()==aPos);
-	TEST(aWin->InquireOffset(*TheClient->iGroup->GroupWin())==aPos);
-	}
-
-void CTScreenModeScaling::TestChildWindowPositionAPIs(TPoint aPos,TPoint aParentPos,RWindowBase* aWin,RWindowBase* aParentWin)
-	{
-	TEST(aWin->AbsPosition()==aParentPos+aPos);
-	TEST(aWin->Position()==aPos);
-	TEST(aWin->InquireOffset(*TheClient->iGroup->GroupWin())==aParentPos+aPos);
-	TEST(aWin->InquireOffset(*aParentWin)==aPos);
-	}
-
-void CTScreenModeScaling::TestRect()
-	{
-	// Here if the width or height of the screen cannot be divided by 2 
-	// then make both the rect size same by reducing the first or second which ever is smaller
-	// and make sure that top left corner is not disturbed.
-	TRect rect1=TRect(PhysicalToLogical(TPoint()-iCurrentScreenModeOrigin,iCurrentScreenModeScale),
-					  PhysicalToLogical(TPoint(FullScreenModeSize.iWidth/2,FullScreenModeSize.iHeight)-iCurrentScreenModeOrigin,
-										iCurrentScreenModeScale)
-					  );
-	TRect rect2=TRect(PhysicalToLogical(TPoint(FullScreenModeSize.iWidth/2,0)-iCurrentScreenModeOrigin,
-										iCurrentScreenModeScale),
-					  PhysicalToLogical(FullScreenModeSize.AsPoint()-iCurrentScreenModeOrigin,
-										iCurrentScreenModeScale)
-					  );
-	if ((Abs(rect1.iBr.iX-rect1.iTl.iX)>Abs(rect2.iBr.iX-rect2.iTl.iX)) || (Abs(rect1.iBr.iY-rect1.iTl.iY)>Abs(rect2.iBr.iY-rect2.iTl.iY)))
-		{
-		rect1.SetRect(rect1.iTl,rect2.Size());
-		}
-	if ((Abs(rect1.iBr.iX-rect1.iTl.iX)<Abs(rect2.iBr.iX-rect2.iTl.iX)) || (Abs(rect1.iBr.iY-rect1.iTl.iY)<Abs(rect2.iBr.iY-rect2.iTl.iY)))
-		{
-		rect2.SetRect(rect2.iTl,rect1.Size());
-		}
-	TBool retVal = TheClient->iScreen->RectCompare(rect1,rect2);
-	TEST(retVal);
-	if (!retVal)
-		INFO_PRINTF3(_L("TheClient->iScreen->RectCompare(rect1,rect2) return value  - Expected: %d, Actual: %d"), ETrue, retVal);		
-	}
-
-void CTScreenModeScaling::CompareRegionsL(const TRegion &aRegion1,const TRegion &aRegion2)
-	{
-	RRegion tmp;
-	tmp.Copy(aRegion1);
-	tmp.SubRegion(aRegion2);
-	if (tmp.CheckError())
-		User::Leave(KErrNoMemory);	
-	TBool retVal = tmp.IsEmpty();
-	TEST(retVal);
-	if (!retVal)
-		INFO_PRINTF3(_L("RRegion1.IsEmpty() return value  - Expected: %d, Actual: %d"), ETrue, retVal);		
-	tmp.Copy(aRegion2);
-	tmp.SubRegion(aRegion1);
-	if (tmp.CheckError())
-		User::Leave(KErrNoMemory);
-	retVal = tmp.IsEmpty();
-	TEST(retVal);
-	if (!retVal)
-		INFO_PRINTF3(_L("RRegion2.IsEmpty() return value  - Expected: %d, Actual: %d"), ETrue, retVal);		
-
-	tmp.Close();
-	}
-
-void CTScreenModeScaling::SetUpSpriteLC(RWsSprite &aSprite, RWsSession &aSession, RWindowTreeNode &aWindow,TInt aFlags)
-	{
-	aSprite=RWsSprite(aSession);
-	User::LeaveIfError(aSprite.Construct(aWindow,TPoint(),aFlags));
-	CleanupClosePushL(aSprite);
-	TSpriteMember member;
-	iTest->SetUpMember(member);
-	member.iBitmap=&iSpriteBitmap;
-	User::LeaveIfError(aSprite.AppendMember(member));
-	User::LeaveIfError(aSprite.Activate());
-	}
-
-void CTScreenModeScaling::TestGetInvalidRegionL(TRect& aRect)
-	{
-	RRegion testRegion;
-	RRegion invalid;
-	iTestWin->Invalidate(aRect);
-	testRegion.AddRect(aRect);
-	iTestWin->Win()->GetInvalidRegion(invalid);
-	CleanupClosePushL(testRegion);
-	CleanupClosePushL(invalid);
-	CompareRegionsL(testRegion, invalid);
-	CleanupStack::PopAndDestroy(2, &testRegion);
-	TheClient->WaitForRedrawsToFinish();
-	}
-
-void CTScreenModeScaling::CopyAndCompareL()
-	{
-	TInt oldOrdinalPriority = TheClient->iGroup->GroupWin()->OrdinalPriority();
-	TInt oldOrdinalPosition = TheClient->iGroup->GroupWin()->OrdinalPosition();
-	// the following line makes sure that a console object hidden outside of
-	// screens range doesn't affect test results ocerlapping the bitmap window
-	TheClient->iGroup->GroupWin()->SetOrdinalPosition(0, 65535); 
-
-	// clear the content of bitmap before it is used for copying
-	ClearBitmap(iScreenBitmap);	
-
-	// Copy first half or second half of the screen to a bitmap then paste it to second or first half of the screen
-	TRect testWinRect(PhysicalToLogical(TPoint((Copy2ndHalfOfScreen ? FullScreenModeSize.iWidth/2 : 0),0)-iCurrentScreenModeOrigin,iCurrentScreenModeScale),
-					  PhysicalToLogical(TPoint((Copy2ndHalfOfScreen ? FullScreenModeSize.iWidth : FullScreenModeSize.iWidth/2),FullScreenModeSize.iHeight)-iCurrentScreenModeOrigin,iCurrentScreenModeScale)
-					  );
-	TheClient->iScreen->CopyScreenToBitmap(iScreenBitmap,testWinRect);
-	iBitmapWin->SetExt(PhysicalToLogical(TPoint((Copy2ndHalfOfScreen ? 0 : FullScreenModeSize.iWidth/2),0)-iCurrentScreenModeOrigin,iCurrentScreenModeScale),testWinRect.Size());
-	iBitmapWin->SetVisible(ETrue);
-	iBitmapWin->DrawNow();
-	TheClient->Flush();
-	TestRect();
-	iBitmapWin->SetVisible(EFalse);
-	iTestWin->SetVisible(EFalse);
-	TheClient->Flush();
-
-	TheClient->iGroup->GroupWin()->SetOrdinalPosition(oldOrdinalPosition, oldOrdinalPriority); 
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0093
-
-@SYMDEF             DEF081259, DEF111847
-
-@SYMTestCaseDesc    Window tests
-					REQUIREMENT: PREQ673 (Screen Scaling)
-					API: RWindowBase::InquireOffset(), RWindowBase::AbsPosition(),RWindowBase::Position()
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Loops through all the screen modes present in the wsini file, and then moves to the test screen
-	mode where it goes on changing the screen scale and origin. In each of the wsini screen modes and test
-	screen modes, it checks the test window's API's RWindowBase::InquireOffset(), RWindowBase::AbsPosition()
-	RWindowBase::Position(). Then it copies the content from either first or second half to second or first
-	half and compares both the regions so that its content are same.
-	Additionally, as part of defect fix DEF111847, this also loops through all the display modes, and if possible
-	tests each with the above described method. Previously, it use to only test Color256.
-
-@SYMTestExpectedResults The content of both halves of the screen should match.
-*/		
-void CTScreenModeScaling::WindowTestsL()
-	{
-	INFO_PRINTF1(_L("AUTO  WindowTests : "));
-	
-	TDisplayMode curDispMode; // Holds the current display mode being tested 
-	
-	for(curDispMode = EGray2; curDispMode < EColorLast; curDispMode = TDisplayMode(curDispMode+1))
-		{
-		if (curDispMode == ERgb)
-			{
-			continue;
-			}
-		CTClient* client=new(ELeave) CTClient();
-		CleanupStack::PushL(client);
-		client->SetScreenNumber(iTest->iScreenNumber);
-		client->ConstructL();
-		client->iGroup=new(ELeave) TestWindowGroup(client);
-		client->iGroup->ConstructL();
-		client->iGroup->WinTreeNode()->SetOrdinalPosition(1);
-		RBlankWindow testWindow(client->iWs);
-		User::LeaveIfError(testWindow.Construct(*TheClient->iGroup->GroupWin(),ENullWsHandle));
-		CleanupClosePushL(testWindow);
-	
-		TInt setDispMode; // Holds the actual display mode that was set
-		setDispMode = testWindow.SetRequiredDisplayMode(curDispMode);
-		
-		//Only do the tests if the requested mode was actually set
-		if(curDispMode == setDispMode)
-			{
-			//Create and show DisplayMode details message
-			_LIT(KModeDetails, "Display Mode: ");
-			TBuf<30> modeDetailsMessage(KModeDetails);
-			modeDetailsMessage.Append(DisplayModeAsString(curDispMode));
-			LOG_MESSAGE(modeDetailsMessage);
-			
-			testWindow.Activate();
-			TheClient->iGroup->GroupWin()->EnableScreenChangeEvents();
-			TInt numOfModes=TheClient->iScreenModes.Count();
-			TInt ii;
-			for (ii=0; ii<numOfModes; ++ii)
-				{
-				INFO_PRINTF1(_L(" Start of Loop"));
-				iCurrentMode=TheClient->iScreenModes[ii];
-				TPixelsAndRotation pixelsAndRotation;
-				iCurrentScreenModeOrigin=TheClient->iScreen->GetScreenModeOrigin(iCurrentMode);
-				iCurrentScreenModeScale=TheClient->iScreen->GetScreenModeScale(iCurrentMode);
-				TheClient->iScreen->GetScreenModeSizeAndRotation(iCurrentMode,pixelsAndRotation);
-				if (pixelsAndRotation.iRotation==CFbsBitGc::EGraphicsOrientationNormal)
-					{
-					INFO_PRINTF1(_L(" Do Tests"));
-					TRAPD(ret,DoWindowTestsL());
-					TEST(ret==KErrNone);
-					if (ret!=KErrNone)
-						{
-						INFO_PRINTF3(_L("DoWindowTestsL() return value  - Expected: %d, Actual: %d"), KErrNone, ret);		
-						}
-
-					INFO_PRINTF1(_L(" Window Trees"));
-					client->iScreen->SetAppScreenMode(iCurrentMode);
-					client->Flush();
-					}
-				}
-				TestDifferentScales(numOfModes-1);
-			}
-		CleanupStack::PopAndDestroy(2,client);
-		}
-	}
-
-void CTScreenModeScaling::TestDifferentScales(TInt aLastModeIdx)
-	{
-	if (aLastModeIdx<0) return;
-	TPixelsAndRotation pixelsAndRotation;
-	for (TInt modeCount=aLastModeIdx;modeCount>=0;--modeCount)
-		{
-		TheClient->iScreen->GetScreenModeSizeAndRotation(TheClient->iScreenModes[modeCount],pixelsAndRotation);
-		if (pixelsAndRotation.iRotation==CFbsBitGc::EGraphicsOrientationNormal)
-			break;
-		}
-	iCurrentMode=TheClient->iScreenModes[aLastModeIdx];
-	TheClient->iScreen->SetAppScreenMode(iCurrentMode);
-	TheClient->iScreen->SetScreenMode(iCurrentMode);
-	TSizeMode storeModeData=TheClient->iScreen->GetCurrentScreenModeAttributes();
-	TSizeMode testMode=storeModeData;
-	for (TInt xScale=1;xScale<4;++xScale)
-		{
-		for (TInt yScale=1;yScale<4;++yScale)
-			{
-			testMode.iScreenScale=TSize(xScale,yScale);
-			TestDifferentOrigin(testMode,TPoint(20,20));
-			TestDifferentOrigin(testMode,TPoint(20,30));
-			TestDifferentOrigin(testMode,TPoint(30,20));
-			TestDifferentOrigin(testMode,TPoint(FullScreenModeSize.iWidth/2+640/FullScreenModeSize.iWidth*10,60));
-			}
-		}
-	TheClient->iScreen->SetScreenMode(iCurrentMode);
-	TheClient->iScreen->SetCurrentScreenModeAttributes(storeModeData);
-	TInt defaultMode=TheClient->iScreenModes[0];
-	TheClient->iScreen->SetAppScreenMode(defaultMode);
-	TheClient->iScreen->SetScreenMode(defaultMode);
-	}
-
-void CTScreenModeScaling::TestDifferentOrigin(TSizeMode &aMode,TPoint aOrigin)
-	{
-	TheClient->iScreen->SetScreenMode(iCurrentMode);//.. this is required because at the end of next screenmode test it will be set to zero screen mode
-	aMode.iOrigin=aOrigin;
-	TheClient->iScreen->SetCurrentScreenModeAttributes(aMode);
-	TheClient->iScreen->SetAppScreenMode(iCurrentMode);
-	TheClient->iScreen->SetScreenMode(iCurrentMode);
-	iCurrentScreenModeOrigin=TheClient->iScreen->GetScreenModeOrigin(iCurrentMode);
-	iCurrentScreenModeScale=TheClient->iScreen->GetScreenModeScale(iCurrentMode);
-	TRAPD(ret,DoWindowTestsL());
-	TEST(ret==KErrNone);
-	if (ret!=KErrNone)
-		INFO_PRINTF3(_L("DoWindowTestsL() return value  - Expected: %d, Actual: %d"), KErrNone, ret);		
-	}
-
-void CTScreenModeScaling::DoWindowTestsL()
-	{
-	TheClient->iScreen->SetAppScreenMode(iCurrentMode);
-	TheClient->iScreen->SetScreenMode(iCurrentMode);
-	Copy2ndHalfOfScreen=(iCurrentScreenModeOrigin.iX>FullScreenModeSize.iWidth/2? 1 : 0);
-	TRect testWinRect(PhysicalToLogical(TPoint(),iCurrentScreenModeScale),
-					  PhysicalToLogical(TPoint((Copy2ndHalfOfScreen ? FullScreenModeSize.iWidth 
-																	: FullScreenModeSize.iWidth/2),
-											   FullScreenModeSize.iHeight)-iCurrentScreenModeOrigin,iCurrentScreenModeScale) 
-					  );
-	testWinRect.Shrink(10,10);
-	iTestWinSize=testWinRect.Size();
-	PositionTestL(testWinRect.iTl);
-	testWinRect.Shrink(10,10);
-	iTestWinSize=testWinRect.Size();
-	PositionTestL(testWinRect.iTl);
-	BackedUpChildWindowTestL(testWinRect.iTl);
-	GetInvalidRegionTestL(testWinRect.iTl);
-	//NextScreenModeTestL(testWinRect.iTl);		//This test needs a lot more work ###
-	}
-
-void CTScreenModeScaling::PositionTestL(TPoint aPostion)
-	{
-	iTestWin->SetExt(aPostion,iTestWinSize);
-	iTestWin->SetVisible(ETrue);
-	iTestWin->Invalidate();
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	TestTopClientWindowPositionAPIs(aPostion,iTestWin->BaseWin());
-	CopyAndCompareL();
-	}
-
-void CTScreenModeScaling::BackedUpChildWindowTestL(TPoint aPostion)
-	{
-	iTestWin->SetVisible(ETrue);
-	TPoint backedUpWinPt=TPoint(iTestWinSize.iWidth/3,iTestWinSize.iHeight/4);
-	iBackedUpWin->SetExtL(backedUpWinPt,TSize(iTestWinSize.iWidth/6,iTestWinSize.iHeight/6));
-	iBackedUpWin->SetVisible(ETrue);
-	TestChildWindowPositionAPIs(backedUpWinPt,aPostion,iBackedUpWin->BaseWin(),iTestWin->BaseWin());
-	aPostion+=TPoint(10,10);
-	iTestWin->SetPos(aPostion);
-	TestTopClientWindowPositionAPIs(aPostion,iTestWin->BaseWin());
-	TestChildWindowPositionAPIs(backedUpWinPt,aPostion,iBackedUpWin->BaseWin(),iTestWin->BaseWin());
-	iTestWin->Invalidate();
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	TestTopClientWindowPositionAPIs(aPostion,iTestWin->BaseWin());
-	TestChildWindowPositionAPIs(backedUpWinPt,aPostion,iBackedUpWin->BaseWin(),iTestWin->BaseWin());
-	CopyAndCompareL();
-	iBackedUpWin->SetVisible(EFalse);
-	}
-
-void CTScreenModeScaling::NextScreenModeTestL(TPoint aPos)
-	{
-	TInt numOfModes=TheClient->iScreenModes.Count();
-	TInt defaultMode=TheClient->iScreenModes[0];
-	TInt lastMode=TheClient->iScreenModes[numOfModes-1];
-	TInt mode=(iCurrentMode<lastMode? iCurrentMode:defaultMode);
-	// find current mode index
-	TInt ii;
-	TInt modeIdx=0;
-	for (ii=0; ii<numOfModes; ++ii)
-		{
-		if (mode==TheClient->iScreenModes[ii])
-			{
-			modeIdx=ii;
-			break;
-			}
-		}
-	TPoint screenModeOrigin(0,0);
-	TPixelsAndRotation pixelsAndRotation;
-	while (screenModeOrigin==TPoint()||(pixelsAndRotation.iRotation!=CFbsBitGc::EGraphicsOrientationNormal))
-		{
-		mode=(mode==lastMode? defaultMode : TheClient->iScreenModes[++modeIdx]);
-		if (mode==iCurrentMode)
-			{
-			return;
-			}
-		screenModeOrigin=TheClient->iScreen->GetScreenModeOrigin(mode);
-		TheClient->iScreen->GetScreenModeSizeAndRotation(mode,pixelsAndRotation);
-		}
-	iTestWin->SetExt(aPos,iTestWinSize);
-	iTestWin->SetVisible(ETrue);
-	TheClient->Flush();
-	CBasicWin* basicWin=new(ELeave) CBasicWin;
-	CleanupStack::PushL(basicWin);
-	basicWin->ConstructExtLD(*iTestWin,TPoint(),TSize(iTestWinSize.iWidth/5,iTestWinSize.iHeight/5));
-	User::LeaveIfError(basicWin->BaseWin()->SetRequiredDisplayMode(EColor256));
-	basicWin->AssignGC(*TheClient->iGc);
-	basicWin->BaseWin()->SetShadowDisabled(ETrue);
-	basicWin->BaseWin()->SetShadowHeight(0);
-	basicWin->Activate();
-	TPoint pos(iTestWinSize.iWidth/3,iTestWinSize.iWidth/4);
-	basicWin->SetPos(pos);
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	TestChildWindowPositionAPIs(pos,aPos,basicWin->BaseWin(),iTestWin->BaseWin());
-	iCurrentScreenModeScale=TheClient->iScreen->GetScreenModeScale(mode);
-	iCurrentScreenModeOrigin=TheClient->iScreen->GetScreenModeOrigin(mode);
-	Copy2ndHalfOfScreen=(iCurrentScreenModeOrigin.iX>FullScreenModeSize.iWidth/2? 1 : 0);
-	TheClient->iScreen->SetAppScreenMode(mode);
-	TheClient->iScreen->SetScreenMode(mode);
-	iTestWin->SetVisible(ETrue);
-	CopyAndCompareL();
-	TheClient->iScreen->SetAppScreenMode(defaultMode);
-	TheClient->iScreen->SetScreenMode(defaultMode);
-	CleanupStack::PopAndDestroy(basicWin);
-	}
-
-void CTScreenModeScaling::GetInvalidRegionTestL(TPoint aPos)
-	{
-	iTestWin->SetExt(aPos,iTestWinSize);
-	iTestWin->SetVisible(ETrue);
-	iTestChildWin->SetExt(TPoint(iTestWinSize.iWidth>>2,iTestWinSize.iHeight>>2),TSize(iTestWinSize.iWidth>>1,iTestWinSize.iHeight>>1));
-	iTestChildWin->SetVisible(ETrue);
-	TheClient->Flush(); // ensure testchildwin is on-screen
-
-	CArrayFixFlat<TRect> *rectList=new(ELeave) CArrayFixFlat<TRect>(3);
-	CleanupStack::PushL(rectList);
-	rectList->AppendL(TRect(1,1,5,2));
-	rectList->AppendL(TRect(iTest->StdTestWindowSize().iWidth>>1,iTest->StdTestWindowSize().iHeight>>1,iTest->StdTestWindowSize().iWidth,iTest->StdTestWindowSize().iHeight));
-	rectList->AppendL(TRect(2,0,4,5));
-	
-	// set iTestWin to a 'clean state' before invalidating rects in the window
-	iTestWin->DrawNow();
-	TheClient->Flush();
-
-	// invalidate the various rectangles in iTestWin & then initiate a redraw of the window
-	RRegion invalidRegion;
-	RRegion region;
-	for (TInt index=0;index<rectList->Count();index++)
-		{
-		const TRect& myRect = (*rectList)[index];
-		iTestWin->Invalidate(myRect);
-		region.AddRect(myRect);
-		}
-	CleanupStack::PopAndDestroy(rectList);
-	CleanupClosePushL(invalidRegion);
-	CleanupClosePushL(region);
-	iTestWin->Win()->GetInvalidRegion(invalidRegion);
-	CompareRegionsL(region, invalidRegion);
-	CleanupStack::PopAndDestroy(2,&invalidRegion);
-	iTestChildWin->SetVisible(EFalse);
-
-	// ensure the test child win is removed
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-
-	TRect rect1(iTestWinSize);
-	TestGetInvalidRegionL(rect1);
-	TInt width=iTestWinSize.iWidth;
-	TInt height=iTestWinSize.iHeight;
-	TRect rect2(TPoint(width/6,height/6),TSize(width/3,height/3));
-	TestGetInvalidRegionL(rect2);
-	
-	// invalidate the entire test window
-	iTestWin->Invalidate();
-	TheClient->Flush();
-
-	iTestWin->SetPos(TPoint(15,15));
-	iTestWin->SetPos(TPoint());
-	iTestWin->SetPos(TPoint(-15,-15));
-	iTestWin->SetPos(aPos);	
-	RRegion invalid;
-	RRegion testRegion(rect1);
-	CleanupClosePushL(invalid);
-	CleanupClosePushL(testRegion);
-	iTestWin->Win()->GetInvalidRegion(invalid);
-	TBool retVal = !invalid.CheckError();
-	TEST(retVal);
-	if (!retVal)
-		INFO_PRINTF3(_L("RRegion.CheckError() return value  - Expected: %d, Actual: %d"), ETrue, retVal);		
-	TEST(invalid.BoundingRect().iBr.iX<=iTestWinSize.iWidth);
-	if (invalid.BoundingRect().iBr.iX>iTestWinSize.iWidth)
-		INFO_PRINTF3(_L("invalid.BoundingRect().iBr.iX<=iTestWinSize.iWidth  - Expected: %d, Actual: %d"), invalid.BoundingRect().iBr.iX, iTestWinSize.iWidth);		
-	CompareRegionsL(testRegion,invalid);
-	CleanupStack::PopAndDestroy(2,&invalid);
-
-	// redraw the test window & confirm
-	iTestWin->DrawNow();
-	TheClient->Flush();
-	CopyAndCompareL();
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0094
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    SpriteTestL
-					REQUIREMENT: PREQ673 (Screen Scaling)
-					API: RWsSprite::SetPosition()
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     In the same way as in window tests it shifts the screen modes.
-					In each screen modes it creates a sprite window and then it moves slightly
-					either side or bottom of the sprite, then it compares both the regions
-					to check whether content are same.
-
-@SYMTestExpectedResults The content of both halves of the screen should match.
-*/		
-void CTScreenModeScaling::SpriteTestL()
-	{
-	CTClient* client=new(ELeave) CTClient();
-	CleanupStack::PushL(client);
-	client->SetScreenNumber(iTest->iScreenNumber);
-	client->ConstructL();
-	client->iGroup=new(ELeave) TestWindowGroup(client);
-	client->iGroup->ConstructL();
-	client->iGroup->WinTreeNode()->SetOrdinalPosition(1);
-	RBlankWindow color256(client->iWs);
-	User::LeaveIfError(color256.Construct(*TheClient->iGroup->GroupWin(),ENullWsHandle));
-	CleanupClosePushL(color256);
-	color256.SetRequiredDisplayMode(EColor256);
-	color256.Activate();
-	TInt numOfModes=TheClient->iScreenModes.Count();
-	TInt flushState=TheClient->iWs.SetAutoFlush(ETrue);
-	TInt ii;
-	for (ii=0; ii<numOfModes; ++ii)
-		{
-		iCurrentMode=TheClient->iScreenModes[ii];
-		TPixelsAndRotation pixelsAndRotation;
-		iCurrentScreenModeOrigin=TheClient->iScreen->GetScreenModeOrigin(iCurrentMode);
-		iCurrentScreenModeScale=TheClient->iScreen->GetScreenModeScale(iCurrentMode);
-		TheClient->iScreen->GetScreenModeSizeAndRotation(iCurrentMode,pixelsAndRotation);
-		DoSpriteTestsL();
-		client->iScreen->SetAppScreenMode(iCurrentMode);
-		client->Flush();
-		}
-	iCurrentMode=TheClient->iScreenModes[numOfModes-1];
-	TheClient->iScreen->SetAppScreenMode(iCurrentMode);
-	TheClient->iScreen->SetScreenMode(iCurrentMode);
-	TSizeMode storeModeData=TheClient->iScreen->GetCurrentScreenModeAttributes();
-	TSizeMode testMode=storeModeData;
-	for (TInt xScale=1;xScale<4;xScale++)
-		{
-		for (TInt yScale=1;yScale<4;yScale++)
-			{
-			testMode.iScreenScale=TSize(xScale,yScale);
-			TestDifferentOriginAndScaleForSpritesL(testMode,TPoint(20,20));
-			TestDifferentOriginAndScaleForSpritesL(testMode,TPoint(20,30));
-			TestDifferentOriginAndScaleForSpritesL(testMode,TPoint(30,20));
-			TestDifferentOriginAndScaleForSpritesL(testMode,TPoint(FullScreenModeSize.iWidth/2+10,60));
-			}
-		}
-	TheClient->iScreen->SetScreenMode(iCurrentMode);
-	TheClient->iScreen->SetCurrentScreenModeAttributes(storeModeData);
-	TInt defaultMode=TheClient->iScreenModes[0];
-	TheClient->iScreen->SetAppScreenMode(defaultMode);
-	TheClient->iScreen->SetScreenMode(defaultMode);
-	CleanupStack::PopAndDestroy(2,client);
-	TheClient->iWs.SetAutoFlush(flushState);
-	}
-
-void CTScreenModeScaling::TestDifferentOriginAndScaleForSpritesL(TSizeMode &aMode, TPoint aOrigin)
-	{
-	TheClient->iScreen->SetScreenMode(iCurrentMode);
-	aMode.iOrigin=aOrigin;
-	TheClient->iScreen->SetCurrentScreenModeAttributes(aMode);
-	iCurrentScreenModeOrigin=TheClient->iScreen->GetScreenModeOrigin(iCurrentMode);
-	iCurrentScreenModeScale=TheClient->iScreen->GetScreenModeScale(iCurrentMode);
-	DoSpriteTestsL();
-	}
-
-void CTScreenModeScaling::DoSpriteTestsL()
-	{
-	TheClient->iScreen->SetAppScreenMode(iCurrentMode);
-	TheClient->iScreen->SetScreenMode(iCurrentMode);
-	TPixelsAndRotation pixelsAndRotation;
-	TheClient->iScreen->GetScreenModeSizeAndRotation(iCurrentMode,pixelsAndRotation);
-	RWsSprite sprite;
-	TSize spriteSize=iSpriteBitmap.SizeInPixels();
-	if (spriteSize.iWidth*iCurrentScreenModeScale.iWidth>FullScreenModeSize.iWidth/2)
-		spriteSize.iWidth=(FullScreenModeSize.iWidth/2-20)/iCurrentScreenModeScale.iWidth;
-	SetUpSpriteLC(sprite,TheClient->iWs,*iBlankWin->BaseWin());
-	sprite.SetPosition(TPoint());
-	CTestSpriteWin* spriteWin=new(ELeave) CTestSpriteWin(iSpriteBitmap);
-	CleanupStack::PushL(spriteWin);
-	spriteWin->ConstructExtLD(*TheClient->iGroup,PhysicalToLogical(TPoint()-iCurrentScreenModeOrigin,iCurrentScreenModeScale),spriteSize);
-	User::LeaveIfError(spriteWin->BaseWin()->SetRequiredDisplayMode(EColor256));
-	spriteWin->AssignGC(*TheClient->iGc);
-	spriteWin->SetVisible(ETrue);
-	spriteWin->Activate();
-	spriteWin->UpdateWin(TPoint());
-	spriteWin->BaseWin()->SetShadowDisabled(ETrue);
-	spriteWin->BaseWin()->SetShadowHeight(0);
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	TPoint spritePosition;
-	if (iCurrentScreenModeOrigin.iX<=spriteSize.iWidth || iCurrentScreenModeOrigin.iY<=spriteSize.iHeight)
-		{
-		if (pixelsAndRotation.iRotation==CFbsBitGc::EGraphicsOrientationNormal || pixelsAndRotation.iRotation==CFbsBitGc::EGraphicsOrientationRotated180)
-			spritePosition=TPoint(spriteSize.iWidth+1,0);
-		else
-			spritePosition=TPoint(0,spriteSize.iHeight+1);
-		}
-	sprite.SetPosition(spritePosition);	
-	const TInt KAnimationGrace = 35000; //defined in server.cpp, but can be changed in wsini.ini
-	User::After(KAnimationGrace);
-	TBool retVal = TheClient->iScreen->RectCompare(TRect(PhysicalToLogical(TPoint()-iCurrentScreenModeOrigin,iCurrentScreenModeScale),spriteSize),TRect(spritePosition,spriteSize),CWsScreenDevice::EIncludeSprite);
-	TEST(retVal);
-	if (!retVal)
-		INFO_PRINTF3(_L("TheClient->iScreen->RectCompare(rect1,rect2) return value  - Expected: %d, Actual: %d"), ETrue, retVal);		
-
-	sprite.SetPosition(TPoint());	
-	CleanupStack::PopAndDestroy(spriteWin);
-	CleanupStack::PopAndDestroy(&sprite);
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0095
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    Rotation Tests
-					REQUIREMENT: PREQ673 (Screen Scaling)
-					API: RWindowBase::InquireOffset(), RWindowBase::AbsPosition(),RWindowBase::Position()
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     For each of the screen mode with all its rotation it checks whether the window
-					is correctly placed in particular screen mode. Then it creates a child window
-					and checks whether it s correctly placed.
-
-@SYMTestExpectedResults Checks the windows are positioned correctly according to the origin,scale and rotation 
-					of the new screen mode.
-*/		
-void CTScreenModeScaling::RotationTestsL()
-	{
-	CTClient* client=new(ELeave) CTClient();
-	CleanupStack::PushL(client);
-	client->SetScreenNumber(iTest->iScreenNumber);
-	client->ConstructL();
-	client->iGroup=new(ELeave) TestWindowGroup(client);
-	client->iGroup->ConstructL();
-	client->iGroup->WinTreeNode()->SetOrdinalPosition(1);
-	RBlankWindow color256(client->iWs);
-	User::LeaveIfError(color256.Construct(*TheClient->iGroup->GroupWin(),ENullWsHandle));
-	CleanupClosePushL(color256);
-	color256.SetRequiredDisplayMode(EColor256);
-	color256.Activate();
-	TInt oldCurrentMode=0;
-	TInt ii;
-	//TInt screenMode=TheClient->iScreen->CurrentScreenMode();
-	for (ii=0;ii<TheClient->iScreenModes.Count();)
-		{
-		iCurrentMode=TheClient->iScreenModes[ii];
-		if (iCurrentMode!=oldCurrentMode)
-			{
-			client->iScreen->SetAppScreenMode(iCurrentMode);
-			TheClient->iScreen->SetScreenMode(iCurrentMode);
-			TheClient->iScreen->SetAppScreenMode(iCurrentMode);
-			}
-		TPixelsAndRotation pixelsAndRotation;
-		TheClient->iScreen->GetDefaultScreenSizeAndRotation(pixelsAndRotation);
-		oldCurrentMode=iCurrentMode;
-		CArrayFixFlat<TInt>* rotations=new(ELeave) CArrayFixFlat<TInt>(1);
-		CleanupStack::PushL(rotations);
-		User::LeaveIfError(TheClient->iScreen->GetRotationsList(iCurrentMode,rotations));
-		TInt count=rotations->Count();
-		TInt jj=0;
-		if (count>1)
-			{
-			for (jj=0;jj<count;)
-				{
-				if ((*rotations)[jj++]==pixelsAndRotation.iRotation)
-					{
-					break;
-					}
-				}
-			if (jj==count)
-				{
-				jj=0;
-				}
-			}
-		if (jj==0)
-			{
-			ii++;
-			}
-		TInt currentRotation=(*rotations)[jj];
-		TheClient->iScreen->SetCurrentRotations(oldCurrentMode,REINTERPRET_CAST(CFbsBitGc::TGraphicsOrientation&,currentRotation));
-		CleanupStack::PopAndDestroy(rotations);
-		iCurrentScreenModeOrigin=TheClient->iScreen->GetScreenModeOrigin(oldCurrentMode);
-		iCurrentScreenModeScale=TheClient->iScreen->GetScreenModeScale(oldCurrentMode);
-		TRect testWinRect(PhysicalToLogical(TPoint(),iCurrentScreenModeScale),
-						  PhysicalToLogical(TPoint((Copy2ndHalfOfScreen ? FullScreenModeSize.iWidth : FullScreenModeSize.iWidth/2),FullScreenModeSize.iHeight)-iCurrentScreenModeOrigin,iCurrentScreenModeScale) 
-						 );
-		testWinRect.Shrink(10,10);
-		iTestWin->SetExtL(testWinRect.iTl,testWinRect.Size());
-		iTestWin->Invalidate();
-		iTestWin->SetVisible(ETrue);
-		TheClient->Flush();
-		TheClient->WaitForRedrawsToFinish();
-		TestTopClientWindowPositionAPIs(testWinRect.iTl,iTestWin->BaseWin());
-		TPoint backedUpWinPt=TPoint(testWinRect.Width()/3,testWinRect.Height()/4);
-		iBackedUpWin->SetVisible(ETrue);
-		iBackedUpWin->SetExtL(backedUpWinPt,TSize(testWinRect.Width()/6,testWinRect.Height()/6));
-		TestChildWindowPositionAPIs(backedUpWinPt,testWinRect.iTl,iBackedUpWin->BaseWin(),iTestWin->BaseWin());
-		iTestWin->SetVisible(EFalse);
-		iBackedUpWin->SetVisible(EFalse);
-		}
-	CleanupStack::PopAndDestroy(2,client);
-	}
-
-void CTScreenModeScaling::DrawTransparentWindows()
-	{
-	//.. First Draw on Backgroundbitmap
-	iBackgroundBitmap->Gc().SetBrushColor(TRgb(255,0,255));
-	iBackgroundBitmap->Gc().SetBrushStyle(CGraphicsContext::ESolidBrush);
-	iBackgroundBitmap->Gc().SetPenStyle(CGraphicsContext::ENullPen);
-	iBackgroundBitmap->Gc().DrawRect(iWinSize);
-	
-	//.. Invalidate the background bitmap and do bitBlt to iCheckBitmap also
-	iBackgroundWin->BaseWin()->SetVisible(ETrue);
-	iBackgroundWin->DrawNow();
-
-	//.. Copy to checkbitmap
-	iCheckBitmap->Gc().SetFaded(EFalse);
-	iCheckBitmap->Gc().BitBlt(TPoint(),&iBackgroundBitmap->Bitmap());
-
-	//.. Set the grade of transperency
-	iTransparencyBitmap->Gc().SetBrushColor(TRgb::Gray256(128));
-	iTransparencyBitmap->Gc().SetBrushStyle(CGraphicsContext::ESolidBrush);
-	iTransparencyBitmap->Gc().SetPenStyle(CGraphicsContext::ENullPen);
-	iTransparencyBitmap->Gc().DrawRect(iWinSize);
-
-	//.. Then draw to the fore ground bitmap and invalidate the second window
-	iForegroundBitmap->Gc().Reset();
-	iForegroundBitmap->Gc().SetPenStyle(CGraphicsContext::ESolidPen);
-	iForegroundBitmap->Gc().SetPenSize(TSize(1,1));
-	iForegroundBitmap->Gc().SetPenColor(TRgb(0,0,0));
-	iForegroundBitmap->Gc().DrawLine(TPoint(0,0),TPoint(iWinSize.iWidth,iWinSize.iHeight));
-	iForegroundBitmap->Gc().DrawLine(TPoint(iWinSize.iWidth,0),TPoint(0,iWinSize.iHeight));
-	iTransWin->BaseWin()->SetVisible(ETrue);
-	iTransWin->Invalidate();
-	iTransWin->DrawNow();
-
-	iCheckBitmap->Gc().AlphaBlendBitmaps(TPoint(0,0),&iForegroundBitmap->Bitmap(),&iCheckBitmap->Bitmap()
-													,TRect(iWinSize),TPoint(0,0),&iTransparencyBitmap->Bitmap(),TPoint(0,0));
-	iCheckWin->BaseWin()->SetVisible(ETrue);
-	iCheckWin->BackedUpWin()->UpdateScreen();
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	CheckRect(iTransWin,iCheckWin,TRect(iWinSize),_L("DrawTransparentWindows() CheckRect failed"));
-	}
-
-// !!! THE COMMENT BELOW IS DISABLED BECAUSE TransparentTests() METHOD IS NOT USED !!!
-//**
-//@SYMTestCaseID		GRAPHICS-WSERV-0096
-//
-//@SYMDEF             DEF081259
-//
-//@SYMTestCaseDesc    TransparentTests
-//					REQUIREMENT: PREQ673 (Screen Scaling)
-//					API: CWindowGc::AlphaBlendBitmaps()
-//
-//@SYMTestPriority    High
-//
-//@SYMTestStatus      Implemented
-//
-//@SYMTestActions     The main logic behind this test is to copy the content of the background window
-//					bitmap to checkwindow bitmap and then use the foreground window bitmap and transparency bitmap
-//					with the function AlphaBlendBitmaps() to get the content present on the combination of 
-//					foreground(transparent) window and background window. Then compare both the regions of the 
-//					window to check whether the content is same.
-//
-//@SYMTestExpectedResults The content of both halves of the screen should match.
-//*/		
-void CTScreenModeScaling::TransparentTestsL()
-	{
-	TInt flushState=TheClient->iWs.SetAutoFlush(ETrue);
-	TInt defaultMode=TheClient->iScreenModes[0];
-	TheClient->iScreen->SetAppScreenMode(defaultMode);
-	TheClient->iScreen->SetScreenMode(defaultMode);
-	CTClient* client=new(ELeave) CTClient();
-	CleanupStack::PushL(client);
-	client->SetScreenNumber(iTest->iScreenNumber);
-	client->ConstructL();
-	client->iGroup=new(ELeave) TestWindowGroup(client);
-	client->iGroup->ConstructL();
-	client->iGroup->WinTreeNode()->SetOrdinalPosition(1);
-	RBlankWindow color256(client->iWs);
-	User::LeaveIfError(color256.Construct(*TheClient->iGroup->GroupWin(),ENullWsHandle));
-	CleanupClosePushL(color256);
-	color256.SetRequiredDisplayMode(EColor256);
-	color256.Activate();
-	client->Flush();
-	DrawTransparentWindows();
-	iCurrentMode=TheClient->iScreenModes[TheClient->iScreenModes.Count()-1];
-	TheClient->iScreen->SetAppScreenMode(iCurrentMode);
-	TheClient->iScreen->SetScreenMode(iCurrentMode);
-	TSizeMode storeModeData=TheClient->iScreen->GetCurrentScreenModeAttributes();
-	TSizeMode testMode=storeModeData;
-	for (TInt xScale=1;xScale<4;xScale++)
-		{
-		for (TInt yScale=1;yScale<4;yScale++)
-			{
-			testMode.iScreenScale=TSize(xScale,yScale);
-			TestDifferentOriginAndScaleForTranspWin(testMode,TPoint(20,20));
-			TestDifferentOriginAndScaleForTranspWin(testMode,TPoint(20,30));
-			TestDifferentOriginAndScaleForTranspWin(testMode,TPoint(30,20));
-			TestDifferentOriginAndScaleForTranspWin(testMode,TPoint(FullScreenModeSize.iWidth/2+1,60));
-			}
-		}
-	TheClient->iScreen->SetScreenMode(iCurrentMode);
-	TheClient->iScreen->SetCurrentScreenModeAttributes(storeModeData);
-	client->iScreen->SetAppScreenMode(iCurrentMode);
-	client->Flush();
-	TheClient->iScreen->SetAppScreenMode(defaultMode);
-	TheClient->iScreen->SetScreenMode(defaultMode);
-	TheClient->iWs.SetAutoFlush(flushState);
-	CleanupStack::PopAndDestroy(2,client);
-	}
-
-void CTScreenModeScaling::TestDifferentOriginAndScaleForTranspWin(TSizeMode &aMode,TPoint aOrigin)
-	{
-	TheClient->iScreen->SetScreenMode(iCurrentMode);
-	aMode.iOrigin=aOrigin;
-	TheClient->iScreen->SetCurrentScreenModeAttributes(aMode);
-	TheClient->iScreen->SetAppScreenMode(iCurrentMode);
-	TheClient->iScreen->SetScreenMode(iCurrentMode);
-	TRAPD(ret,DrawTransparentWindows());
-	TEST(ret==KErrNone);
-	if (ret!=KErrNone)
-		INFO_PRINTF3(_L("DrawTransparentWindows() return value  - Expected: %d, Actual: %d"), KErrNone, ret);		
-
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0097
-
-@SYMDEF             DEF081259
-
-@SYMTestCaseDesc    AppScreenModeTest
-					REQUIREMENT: PREQ673 (Screen Scaling)
-					API: CWsScreenDevice::SetAppScreenMode()
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Enable the visibility of Test window, Call SetAppScreenMode() API with different
-					screen mode. Check the variable which is set in its draw function. 
-
-@SYMTestExpectedResults The variable should not be set when the application screen mode is different 
-					then current screen mode. 
-*/
-void CTScreenModeScaling::AppScreenModeTestL()
-	{
-	TheClient->iScreen->SetAppScreenMode(0);
-	TheClient->iScreen->SetScreenMode(0);
-	iTestWin->iDrawn=EFalse;
-	iTestWin->SetExtL(TPoint(),TSize(FullScreenModeSize.iWidth/2,FullScreenModeSize.iHeight));
-	iTestWin->SetVisible(ETrue);
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	TEST(iTestWin->iDrawn);
-	if (!iTestWin->iDrawn)
-		INFO_PRINTF3(_L("iTestWin->iDrawn  - Expected: %d, Actual: %d"), ETrue, iTestWin->iDrawn);
-
-	iTestWin->iDrawn=EFalse;
-	TheClient->iScreen->SetAppScreenMode(2);
-	TheClient->iScreen->SetScreenMode(0);
-	iTestWin->Invalidate();
-	TheClient->Flush();
-	TEST(!iTestWin->iDrawn);
-	if (iTestWin->iDrawn)
-		INFO_PRINTF3(_L("iTestWin->iDrawn  - Expected: %d, Actual: %d"), EFalse, iTestWin->iDrawn);
-
-	TheClient->iScreen->SetAppScreenMode(0);
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	TEST(iTestWin->iDrawn);
-	if (!iTestWin->iDrawn)
-		INFO_PRINTF3(_L("iTestWin->iDrawn  - Expected: %d, Actual: %d"), ETrue, iTestWin->iDrawn);
-
-	iTestWin->iDrawn=EFalse;
-	TheClient->iScreen->SetScreenMode(1);
-	iTestWin->Invalidate();
-	TheClient->Flush();
-	TEST(!iTestWin->iDrawn);
-	if (iTestWin->iDrawn)
-		INFO_PRINTF3(_L("iTestWin->iDrawn  - Expected: %d, Actual: %d"), EFalse, iTestWin->iDrawn);
-
-	iTestWin->SetVisible(EFalse);
-	TheClient->iScreen->SetAppScreenMode(0);
-	TheClient->iScreen->SetScreenMode(0);
-	}
-
-void CTScreenModeScaling::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(KWindowTests,"Window Tests");
-	_LIT(KSpriteTest,"Sprite Test");
-	_LIT(KRotationTests,"Rotation Tests");
-	_LIT(KTransparentTests,"Transparent Tests");
-	_LIT(KAppScreenModeTest,"AppScreenMode Test");
-	_LIT(KScalling,"Scaling not Supported");
-	_LIT(KModes,"Only one Screen Size Mode");
-	
-	((CTScreenModeScalingStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(++iTest->iState)
-		{
-		case 1:
-			{
-			((CTScreenModeScalingStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0097"));
-			TInt numScrModes=TheClient->iScreen->NumScreenModes();
-			if (numScrModes<2 || !CheckScalingSupportedOrNot())
-				{
-				if (numScrModes<2)
-					LOG_MESSAGE(KModes);
-				else
-					LOG_MESSAGE(KScalling);
-				TestComplete();
-				return;
-				}
-			iTest->LogSubTest(KAppScreenModeTest);
-			AppScreenModeTestL();
-			}
-			break;
-		case 2:
-			((CTScreenModeScalingStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0093"));
-			iTest->LogSubTest(KWindowTests);
-			WindowTestsL();
-			break;
-		case 3:
-			((CTScreenModeScalingStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0094"));
-			iTest->LogSubTest(KSpriteTest);
-			SpriteTestL();
-			break;
-		case 4:
-			((CTScreenModeScalingStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0095"));
-			iTest->LogSubTest(KRotationTests);
-			RotationTestsL();
-			break;
-		case 5:
-			((CTScreenModeScalingStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			iTest->LogSubTest(KTransparentTests);
-			//TransparentTestsL();		//This tests currently fails sometimes for reasons not understood ####
-			break;
-		default:
-			{
-			TInt defaultMode=TheClient->iScreenModes[0];
-			TheClient->iScreen->SetAppScreenMode(defaultMode);
-			TheClient->iScreen->SetScreenMode(defaultMode);
-			}
-			((CTScreenModeScalingStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTScreenModeScalingStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-			return;
-		}
-	((CTScreenModeScalingStep*)iStep)->RecordTestResultL();
-	}
-
-__WS_CONSTRUCT_STEP__(ScreenModeScaling)
--- a/windowing/windowserver/tauto/TScreenModeScaling.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,164 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Definitions common for both scren mode positioning and scaling
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TSCREENMODESCALING_H__
-#define __TSCREENMODESCALING_H__
-
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-_LIT(ScalingTestName,"Screen Mode Scaling");
-
-GLREF_C void ClearBitmap(CFbsBitmap* aBitMap);
-
-class CBasicWin : public CTWin
-	{
-public:
-	//Virtual Function from CTBaseWin
-	void Draw();
-	TInt iDrawn;
-	};
-
-class CBmpWin : public CTWin
-	{
-public:
-	inline CBmpWin(CFbsBitmap& aScreenBmp) :iScreenBmp(aScreenBmp) {}
-	//Virtual Function from CTBaseWin
-	void Draw();
-private:
-	CFbsBitmap& iScreenBmp;
-	};
-
-class CSpriteWin : public CTWin
-	{
-public:
-	inline CSpriteWin(CFbsBitmap& aSpriteBitmap) :iSpriteBitmap(aSpriteBitmap) {}
-	~CSpriteWin();
-	inline void SetState(TInt aState) {iState=aState;}
-	void UpdateState(TInt aState);
-	//Virtual Function from CTBaseWin
-	void Draw();
-private:
-	CFbsBitmap& iSpriteBitmap;
-	TInt iState;
-	};
-
-class CTestSpriteWin : public CTWin
-	{
-public:
-	inline CTestSpriteWin(CFbsBitmap& aSpriteBitmap) :iSpriteBitmap(aSpriteBitmap) {}
-	~CTestSpriteWin();
-	inline void SetOrigin(TPoint aOrigin) {iOrigin=aOrigin;}
-	void UpdateWin(TPoint aOrigin);
-	//Virtual Function from CTBaseWin
-	void Draw();
-private:
-	CFbsBitmap& iSpriteBitmap;
-	TPoint iOrigin;
-	};
-
-class CBitMapWin : public CTWin
-	{
-public:
-	inline CBitMapWin(CBitmap* aBackupBitmap) :iBackup(aBackupBitmap) {}
-	//Virtual Function from CTBaseWin
-	void Draw();
-private:
-	CBitmap* iBackup;
-	};
-
-
-
-class CTScreenModeScaling : public CTWsGraphicsBase
-	{
-public:
-	CTScreenModeScaling(CTestStep* aStep);
-	~CTScreenModeScaling();
-	void ConstructL();
-	void WindowTestsL();
-	void SpriteTestL();
-	void RotationTestsL();
-	void TransparentTestsL();
-	void AppScreenModeTestL();
-	
-protected:
-	virtual void RunTestCaseL(TInt aCurTestCase);
-
-private:
-	void DoWindowTestsL();
-	void TestTopClientWindowPositionAPIs(TPoint aPos,RWindowBase* aWin);
-	void TestChildWindowPositionAPIs(TPoint aPos,TPoint aParentPos,RWindowBase* aWin,RWindowBase* aParentWin);
-	void TestRect();
-	void CompareRegionsL(const TRegion &aRegion1,const TRegion &aRegion2);
-	void TestGetInvalidRegionL(TRect& aRect);
-	void CopyAndCompareL();
-	void PositionTestL(TPoint aPostion);
-	void BackedUpChildWindowTestL(TPoint aPostion);
-	void NextScreenModeTestL(TPoint aPos);
-	void GetInvalidRegionTestL(TPoint aPos);
-	void TestDifferentScales(TInt aLastMode);
-	void TestDifferentOrigin(TSizeMode &aMode,TPoint aOrigin);
-	void DoSpriteTestsL();
-	void TestDifferentOriginAndScaleForSpritesL(TSizeMode &aMode,TPoint aOrigin);
-	void SetUpSpriteLC(RWsSprite &aSprite,RWsSession &aSession,RWindowTreeNode &aWindow,TInt aFlags=ESpriteNoShadows);
-	void DrawTransparentWindows();
-	void TestDifferentOriginAndScaleForTranspWin(TSizeMode &aMode,TPoint aOrigin);
-private:
-	CFbsBitmap iSpriteBitmap;
-	CBmpWin* iBitmapWin;
-	CFbsBitmap* iScreenBitmap;
-	CBasicWin *iTestWin;
-	CTBackedUpWin* iBackedUpWin;
-	CTBlankWindow* iBlankWin;
-	CTBlankWindow* iTestChildWin;
-	TInt iCurrentMode;
-	TSize iTestWinSize;
-	TPoint iCurrentScreenModeOrigin;
-	TSize iCurrentScreenModeScale;
-	CTBackedUpWin* iCheckWin;
-	CBitmap* iCheckBitmap;
-	CBitmap* iTransparencyBitmap;
-	CBitmap* iBackgroundBitmap;
-	CBitmap* iForegroundBitmap;
-	CBitMapWin* iTransWin;
-	CBitMapWin* iBackgroundWin;
-	TSize iWinSize;
-	TDisplayMode iDisplayMode;
-	};
-
-class CTScreenModeScalingStep : public CTGraphicsStep
-	{
-public:
-	CTScreenModeScalingStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTScreenModeScalingStep,"TScreenModeScaling");
-
-#endif
--- a/windowing/windowserver/tauto/TTEXTCURS.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2040 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test the text cursor.
-//
-// This suite of tests checks to see if the TextCursors are operating
-// correctly for a number of use case scenarios; see doxygen comments
-// for each sub-test.  This test suite is applicable on both winscw
-// emulator and armv5 target hardware.  However, it must be noted that
-// text cursors are special due to their timeliness.  The text cursor
-// must flash every second: half a second ON, half a second OFF.  One
-// consequence of this is that when the test suite is run on emulator,
-// the PC must be otherwise quiescent.  No other IO or CPU intensive
-// activities may occur on the system, because these will cause delays
-// to the flashing of the text cursor giving unreliable results.
-// Where timeliness is a consideration, we use TEST_SOFTFAIL_WINSCW so
-// that if the test fails and we are running on the PC emulator, we only
-// record the fact, but don't mark the test as failing.
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TTEXTCURS.H"
-#include "graphics/windowserverconstants.h"
-
-const TInt KNumberOfCustoTextCursors	= 3;
-const TInt KTextCursorInitialIdValue	= 1001;
-const TInt KTextCursorPanicUid1			= 200;
-const TInt KTextCursorPanicUid2			= 2000;
-const TInt KTextCursorPanicUid3			= 3000;
-const TInt KTextCursorPanicUid4			= 4000;
-const TInt KTextCursorPanicUid5			= 5000;
-
-CTestBase* CTCursorTest::iStaticTest = NULL;
-const TInt kWinWidth=400;
-const TInt kWinHeight=100;
-const TSize kWinSize(kWinWidth,kWinHeight);
-const TInt kWinXPos=150;
-const TInt kCursorWidth = 10;
-const TInt kCursorHeight = 20;
-const TSize kCursorSize(kCursorWidth,kCursorHeight);
-const TPoint kWin1TopLeft(kWinXPos,0);
-const TPoint kWin2TopLeft(kWinXPos,kWinHeight+10);
-
-LOCAL_D void DeleteSpriteMember(TAny* aSpriteMember)
-	{
-	TSpriteMember* member=reinterpret_cast<TSpriteMember*>(aSpriteMember);
-	delete member->iBitmap;
-	member->iBitmap=NULL;
-	delete member->iMaskBitmap;
-	member->iMaskBitmap=NULL;
-	}
-
-CCustomTextCursor::~CCustomTextCursor()
-	{
-	const TInt count = iSpriteMemberArray.Count();
-	for (TInt index=0; index<count; ++index)
-		{
-		DeleteSpriteMember(&iSpriteMemberArray[index]);
-		}
-	iSpriteMemberArray.Close();
-	}
-	
-CCustomTextCursor::CCustomTextCursor(CTestBase* aTest)
-	: iTest(aTest)
-	{	
-	}
-
-void CCustomTextCursor::ConstructL(TInt aScreenNumber,TInt aBmpIndex)
-	{
-	ASSERT(aBmpIndex < KNumberOfCustoTextCursors);
-	
-
-	TSpriteMember spriteMember;
-	spriteMember.iBitmap = NULL;
-	spriteMember.iMaskBitmap = NULL;
-	spriteMember.iInvertMask =EFalse;
-	spriteMember.iDrawMode = CGraphicsContext::EDrawModePEN;
-	spriteMember.iOffset = TPoint();
-	spriteMember.iInterval = TTimeIntervalMicroSeconds32(0);
-	CleanupStack::PushL(TCleanupItem(DeleteSpriteMember, &spriteMember));
-	spriteMember.iBitmap = new (ELeave) CFbsBitmap;
-	User::LeaveIfError(spriteMember.iBitmap->Load(TEST_BITMAP_NAME, EMbmWsautotestBmp1));
-	spriteMember.iMaskBitmap = new (ELeave) CFbsBitmap;
-	User::LeaveIfError(spriteMember.iMaskBitmap->Load(TEST_BITMAP_NAME, EMbmWsautotestBmp1mask));
-
-	User::LeaveIfError(iSpriteMemberArray.Append(spriteMember));
-	CleanupStack::Pop(&spriteMember);
-
-	// create unique-id accross screens
-	//
-	iIdentifier = KTextCursorInitialIdValue + aScreenNumber*KNumberOfCustoTextCursors + aBmpIndex;
-	iAlignment = (RWsSession::TCustomTextCursorAlignment)(aBmpIndex);
-	}
-
-CCustomTextCursor* CCustomTextCursor::CreateCustomTextCursorL(TInt aScreenNumber,TInt aBmpIndex,CTestBase* aTest)
-	{
-	CCustomTextCursor* customTextCursor = new (ELeave) CCustomTextCursor(aTest);
-	CleanupStack::PushL(customTextCursor);
-	customTextCursor->ConstructL(aScreenNumber,aBmpIndex);
-	CleanupStack::Pop(customTextCursor);
-	return customTextCursor;
-	}
-
-/*
- * Wrapper class for a list of custom text cursor.
- */
-class CCustomTextCursorsWrapper : public CBase
-	{
-public:
-	static CCustomTextCursorsWrapper* NewLC(TInt aScreenNumber,CTestBase* aTest);
-	~CCustomTextCursorsWrapper();
-	inline RPointerArray<CCustomTextCursor>& CustomTextCursorsArray();
-	inline CCustomTextCursor& CustomTextCursor(TInt aIndex);
-private:
-	void ConstructL(TInt aScreenNumber,CTestBase* aTest);
-private:
-	RPointerArray<CCustomTextCursor> iCustomTextCursors;
-	};
-
-inline RPointerArray<CCustomTextCursor>& CCustomTextCursorsWrapper::CustomTextCursorsArray()
-		{
-		return iCustomTextCursors;
-		}
-
-inline CCustomTextCursor& CCustomTextCursorsWrapper::CustomTextCursor(TInt aIndex)
-		{
-		return *(iCustomTextCursors[aIndex]);
-		}
-
-CCustomTextCursorsWrapper* CCustomTextCursorsWrapper::NewLC(TInt aScreenNumber,CTestBase* aTest)
-	{
-	CCustomTextCursorsWrapper* self = new(ELeave) CCustomTextCursorsWrapper();
-	CleanupStack::PushL(self);
-	self->ConstructL(aScreenNumber,aTest);
-	return self;
-	}
-
-CCustomTextCursorsWrapper::~CCustomTextCursorsWrapper()
-	{
-	iCustomTextCursors.ResetAndDestroy();
-	iCustomTextCursors.Close();
-	}
-
-void CCustomTextCursorsWrapper::ConstructL(TInt aScreenNumber, CTestBase* aTest)
-	{
-	for (TInt index=0; index<KNumberOfCustoTextCursors; ++index)
-		{
-		CCustomTextCursor* customTextCursor=CCustomTextCursor::CreateCustomTextCursorL(aScreenNumber,index, aTest);
-		CleanupStack::PushL(customTextCursor);
-		User::LeaveIfError(iCustomTextCursors.Append(customTextCursor));
-		CleanupStack::Pop(customTextCursor);
-		}
-	}
-
-CTCursorTest::CTCursorTest(CTestStep* aStep) :
-	CTWsGraphicsBase(aStep)
-	{
-	iCursorType = TTextCursor::ETypeFirst;
-	iStaticTest=iTest;
-	}
-	
-CTCursorTest::~CTCursorTest()
-	{
-	delete iWorkInProgress;
-	delete iComparisonWindow;
-	}
-
-TInt CTCursorTest::DoPanicTest(TInt aInt, TAny *aScreenNumber)
-	{
-	RWsSession ws;
-	if (ws.Connect()==KErrNone)
-		{
-		// use correct screen
-		CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws);
-		User::LeaveIfError(screen->Construct((TInt)aScreenNumber));
-		RWindowGroup group(ws);
-		if (group.Construct(444)==KErrNone)
-			{
-			group.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
-			RWindow wnd(ws);
-			if (wnd.Construct(group, TInt32(&ws))==KErrNone)
-				{
-				TTextCursor tc;
-				tc.iHeight=10;
-				tc.iAscent=5;
-				tc.iWidth=10;
-				tc.iFlags=0;
-				tc.iColor=TRgb(0,0,0);
-				switch(aInt)
-					{
-					case 0:
-						{
-						/* TESTCASE:	6.1
-						* TITLE:		Invalid use of a custom text cursor ID (basic text cursor).
-						* IMPORTANCE:	1
-						* REQUIREMENT:	Unknown.
-						* 
-						* ACTION:		This test tries to set a text cursor using an ID which is invalid.
-						* 
-						* CHECK:		The thread should panic with the exit reason EWservPanicInvalidTextCursor
-						*/ 
-						tc.iType=(TTextCursor::EType)KTextCursorPanicUid1;
-						group.SetTextCursor(wnd,TPoint(10,10),tc);
-						}
-						break;
-					case 1:
-						{
-						/* TESTCASE:	6.2
-						* TITLE:		Invalid use of a window for a text cursor.
-						* IMPORTANCE:	1
-						* REQUIREMENT:	REQ 1079, CR RDEF-5F7Q24 (10/04/2003).
-						* 
-						* ACTION:		This test tries to set a text cursor using a window which is not part
-						*				of the window group calling the setting API.
-						* 
-						* CHECK:		The thread should panic with the exit reason EWservPanicWindow
-						*/ 
-						tc.iType=(TTextCursor::EType)KTextCursorPanicUid2;
-						group.SetTextCursor(*TestWin->Win(),TPoint(10,10),tc);
-						}
-						break;
-					case 2:
-						{
-						/* TESTCASE:	6.3
-						* TITLE:		Invalid use of a custom text cursor ID.
-						* IMPORTANCE:	1
-						* REQUIREMENT:	REQ 1079, CR RDEF-5F7Q24 (10/04/2003).
-						* 
-						* ACTION:		This test tries to set a text cursor using an ID which is associated to
-						*				an non-existing custom text cursor.
-						* 
-						* CHECK:		The thread should panic with the exit reason EWservPanicNoCustomTextCursor
-						*/ 
-						tc.iType=(TTextCursor::EType)KTextCursorPanicUid3;
-						group.SetTextCursor(wnd,TPoint(10,10),tc);
-						}
-						break;
-					case 3:
-						{
-						/* TESTCASE:	6.4
-						* TITLE:		Invalid use of a custom text cursor ID.
-						* IMPORTANCE:	1
-						* REQUIREMENT:	REQ 1079, CR RDEF-5F7Q24 (10/04/2003).
-						* 
-						* ACTION:		This test tries to set a custom text cursor which has been set to use
-						*				an invalid alignment.
-						* 
-						* CHECK:		The thread should panic with the exit reason EWservPanicCustomTextCursorAlign
-						*/ 
-						CCustomTextCursor* customTextCursor=NULL;
-						TRAPD(error, customTextCursor=CCustomTextCursor::CreateCustomTextCursorL((TInt)aScreenNumber,0,iStaticTest));
-						if (error==KErrNone)
-							{
-							error = ws.SetCustomTextCursor(KTextCursorPanicUid4, customTextCursor->iSpriteMemberArray.Array(), 0, (RWsSession::TCustomTextCursorAlignment)(RWsSession::ECustomTextCursorAlignBottom+1));
-							if (error==KErrNone || error==KErrAlreadyExists)
-								{
-								tc.iType=(TTextCursor::EType)KTextCursorPanicUid4;
-								group.SetTextCursor(wnd,TPoint(10,10),tc);
-								}
-							}
-						delete customTextCursor;
-						}
-						break;
-					case 4:
-						{
-						/* TESTCASE:	6.5
-						* TITLE:		Use of an invalid custom text cursor
-						* IMPORTANCE:	1
-						* REQUIREMENT:	REQ 1079, CR RDEF-5F7Q24 (10/04/2003).
-						* 
-						* ACTION:		This test tries to set a custom text cursor which does not have
-						*				any sprite member set.
-						* 
-						* CHECK:		The thread should panic with the exit reason EWservPanicNoSpriteMember
-						*/ 
-						RArray<TSpriteMember> spriteMemberArray;
-						const TInt error = ws.SetCustomTextCursor(KTextCursorPanicUid5, spriteMemberArray.Array(), 0, (RWsSession::TCustomTextCursorAlignment)(RWsSession::ECustomTextCursorAlignBottom));
-						if (error==KErrNone || error==KErrAlreadyExists)
-							{
-							tc.iType=(TTextCursor::EType)KTextCursorPanicUid5;
-							group.SetTextCursor(wnd,TPoint(10,10),tc);
-							}
-						}
-						break;
-					case 5:
-						{
-						// Uncover set.cursor.iType < TTextCursor::ETypeFirst code path
-						tc.iType=(TTextCursor::EType)TTextCursor::ETypeFirst - 1;
-						group.SetTextCursor(wnd,TPoint(10,10),tc);
-						}
-						break;
-					case 6:
-						{
-						// Uncover (set.cursor.iFlags&static_cast<TUint>(TTextCursor::EPrivateFlags) code path
-						tc.iFlags=ETextCursorPrivateFlags;
-						group.SetTextCursor(wnd,TPoint(10,10),tc);
-						}
-						break;
-					case 7:
-						{
-						// Uncover (iGroupWin != searchWin) i.e. bogus group window
-						tc.iType=(TTextCursor::EType)TTextCursor::ETypeRectangle;
-						RWindow windowNotAssociatedWithAGroup(ws);
-						group.SetTextCursor(windowNotAssociatedWithAGroup, TPoint(10,10),tc);
-						}
-						break;
-					}
-				}
-			ws.Flush();
-			}
-		}
-	return(EWsExitReasonBad);
-	}
-
-void CTCursorTest::TestPanicsL()
-	{	
-		TEST(iTest->TestWsPanicL(DoPanicTest, EWservPanicInvalidTextCursor, 0, (TAny*)iTest->iScreenNumber));
-		TEST(iTest->TestWsPanicL(DoPanicTest, EWservPanicWindow, 1, (TAny*)iTest->iScreenNumber));
-		TEST(iTest->TestWsPanicL(DoPanicTest, EWservPanicNoCustomTextCursor, 2, (TAny*)iTest->iScreenNumber));
-		TEST(iTest->TestWsPanicL(DoPanicTest, EWservPanicCustomTextCursorAlign, 3, (TAny*)iTest->iScreenNumber));
-		TEST(iTest->TestWsPanicL(DoPanicTest, EWservPanicNoSpriteMember, 4, (TAny*)iTest->iScreenNumber));
-		TEST(iTest->TestWsPanicL(DoPanicTest, EWservPanicInvalidTextCursor, 5, (TAny*)iTest->iScreenNumber));
-		TEST(iTest->TestWsPanicL(DoPanicTest, EWservPanicInvalidTextCursor, 6, (TAny*)iTest->iScreenNumber));
-		TEST(iTest->TestWsPanicL(DoPanicTest, EWservPanicWindow, 7, (TAny*)iTest->iScreenNumber));
-		iTest->CloseAllPanicWindows();
-	}
-
-void CTCursorTest::TextCursorSetLCoverageTests()
-	{
-	ValidateWin(BaseWin,TRgb::Gray256(255));
-	ValidateWin(TestWin,TRgb::Gray256(255));	
-	TTextCursor textCursor;
-	textCursor.iHeight = 10;
-	textCursor.iAscent = 0;
-	textCursor.iWidth = 10;
-	textCursor.iFlags = 0;
-	textCursor.iColor = KRgbBlack;
-	textCursor.iType = (TTextCursor::EType)TTextCursor::ETypeRectangle;
-	TPoint position(10, 10);
-	TRect clipRect0(10, 10, 10, 10);
-	TRect clipRect1(10, 10, 5, 5);
-	RWindowGroup *group = TheClient->iGroup->GroupWin(); 
-	group->SetTextCursor(*TestWin->Win(), position, textCursor);
-	/*
-	 * Duplicate the previous SetTextCursor command to uncover the code which checks for any delta in SetL
-	 * compared to the current settings.
-	 */
-	group->SetTextCursor(*TestWin->Win(), position, textCursor);
-	/*
-	 * Change the type only to pick up that difference in SetL.
-	 */
-	textCursor.iType++;
-	group->SetTextCursor(*TestWin->Win(), position, textCursor);
-	textCursor.iType--;
-	/*
-	 * Vary the clipping rectangle.
-	 */
-	group->SetTextCursor(*TestWin->Win(), position, textCursor, clipRect0);
-	group->SetTextCursor(*TestWin->Win(), position, textCursor, clipRect1);
-	/*
-	 * Vary the color.
-	 */
-	textCursor.iColor = KRgbGreen;
-	group->SetTextCursor(*TestWin->Win(), position, textCursor);
-	textCursor.iColor = KRgbBlack;
-	group->SetTextCursor(*TestWin->Win(), position, textCursor);
-	/*
-	 * Vary the target Window.
-	 */
-	group->SetTextCursor(*BaseWin->Win(), position, textCursor);
-	group->SetTextCursor(*TestWin->Win(), position, textCursor);
-	/*
-	 * Vary the size of the cursor.
-	 */
-	textCursor.iWidth++;
-	group->SetTextCursor(*TestWin->Win(), position, textCursor);
-	textCursor.iWidth--;
-	/*
-	 * Set different custom cursors.
-	 */
-	CCustomTextCursorsWrapper* customTextCursorsWrapper = CCustomTextCursorsWrapper::NewLC(iTest->iScreenNumber, iTest);
-	const TInt count = customTextCursorsWrapper->CustomTextCursorsArray().Count();
-	for (TInt index=0; index<count; ++index)
-		{
-		CCustomTextCursor& customTextCursor = customTextCursorsWrapper->CustomTextCursor(index);
-		textCursor.iType = customTextCursor.iIdentifier;
-		group->SetTextCursor(*TestWin->Win(), position, textCursor);
-		}			
-	CleanupStack::PopAndDestroy(customTextCursorsWrapper);
-	/*
-	 * Set the last custom cursor from the above loop again so the
-	 * product code sees the same Custom Text Cursor settings come
-	 * in a second time.
-	 */
-	group->SetTextCursor(*TestWin->Win(), position, textCursor);
-	textCursor.iType = (TTextCursor::EType)TTextCursor::ETypeRectangle;
-	/*
-	 * Vary the horizontal clipping.
-	 */
-	textCursor.iFlags = TTextCursor::EFlagClipHorizontal;
-	group->SetTextCursor(*TestWin->Win(), position, textCursor);
-	/*
-	 * Vary the horizontal clipping.
-	 */
-	textCursor.iFlags = TTextCursor::EFlagClipVertical;
-	group->SetTextCursor(*TestWin->Win(), position, textCursor);
-	/*
-	 * Try both horizontal and vertical clipping.
-	 */
-	textCursor.iFlags = TTextCursor::EFlagClipVertical|TTextCursor::EFlagClipHorizontal;
-	group->SetTextCursor(*TestWin->Win(), position, textCursor);
-	textCursor.iFlags = 0;
-	
-	TheClient->iWs.Flush();
-	CancelTextCursor();
-	}
-
-void CTCursorTest::SetCursor(const TPoint &aPos,const TSize &aSize,TRgb aColor, const TRect &aRect, TUint aFlags)
-	{
-	TTextCursor tc;
-	tc.iType=iCursorType;
-    tc.iHeight=aSize.iHeight;
-    tc.iAscent=aSize.iHeight*4/5;
-    tc.iWidth=aSize.iWidth;
-    tc.iFlags=aFlags;
-	tc.iColor=aColor;
-	TheClient->iGroup->GroupWin()->SetTextCursor(*TestWin->Win(),TPoint(aPos.iX,aPos.iY+tc.iAscent),tc,aRect);
-	}
-
-void CTCursorTest::SetCursor(const TPoint &aPos,const TSize &aSize,TRgb aColor, TUint aFlags)
-	{
-	TTextCursor tc;
-	tc.iType=iCursorType;
-    tc.iHeight=aSize.iHeight;
-    tc.iAscent=aSize.iHeight*4/5;
-    tc.iWidth=aSize.iWidth;
-    tc.iFlags=aFlags;
-	tc.iColor=aColor;
-	TheClient->iGroup->GroupWin()->SetTextCursor(*TestWin->Win(),TPoint(aPos.iX,aPos.iY+tc.iAscent),tc);
-	}
-
-void CTCursorTest::SetCursorPlusBox(const TPoint &aPos,const TSize &aSize,TRgb aColor, const TRect *aClipRect, TUint aFlags)
-	{
-	if (aClipRect)
-		SetCursor(aPos,aSize,aColor,*aClipRect,aFlags);
-	else
-		SetCursor(aPos,aSize,aColor,aFlags);
-	TRect rect(aPos,aSize);
-	if (aClipRect)
-		rect.Intersection(*aClipRect);
-	rect.Grow(2,2);
-	
-	TheClient->iGc->Activate(*(TestWin->Win()));
-	TestWin->Invalidate(rect);
-	TestWin->Win()->BeginRedraw(rect);
-	TheClient->iGc->SetPenColor(aColor);
-	TheClient->iGc->SetDrawMode(CGraphicsContext::EDrawModeXOR);
-
-	TheClient->iGc->DrawRect(rect);
-	TheClient->iGc->Deactivate();
-	TestWin->Win()->EndRedraw();
-	
-	}
-
-void CTCursorTest::CancelTextCursor()
-	{
-	TheClient->iGroup->GroupWin()->CancelTextCursor();
-	}
-
-void CTCursorTest::ConstructL()
-	{
-	// for allocating some cached memory
-	CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
-	CleanupStack::PushL(bitmap);
-	User::LeaveIfError(bitmap->Load(TEST_BITMAP_NAME, 0));
-	CleanupStack::PopAndDestroy(bitmap);
-
-	CCustomTextCursorsWrapper* customTextCursorsWrapper = CCustomTextCursorsWrapper::NewLC(iTest->iScreenNumber, iTest);
-	const TInt count = customTextCursorsWrapper->CustomTextCursorsArray().Count();
-	for (TInt index=0; index<count; ++index)
-		{
-		CCustomTextCursor& customTextCursor = customTextCursorsWrapper->CustomTextCursor(index);
-		TInt err = TheClient->iWs.SetCustomTextCursor(customTextCursor.iIdentifier, customTextCursor.iSpriteMemberArray.Array(), customTextCursor.iSpriteFlags, customTextCursor.iAlignment);
-		TEST(err == KErrNone || err == KErrAlreadyExists);
-		if (err!=KErrNone && err != KErrAlreadyExists)
-			INFO_PRINTF4(_L("TheClient->iWs.SetCustomTextCursor return value  - Expected: %d or %d, Actual: %d"), KErrNone, KErrAlreadyExists, err);
-
-		__UHEAP_MARK;
-		err = TheClient->iWs.SetCustomTextCursor(customTextCursor.iIdentifier, customTextCursor.iSpriteMemberArray.Array(), customTextCursor.iSpriteFlags, customTextCursor.iAlignment);
-		__UHEAP_MARKEND;
-		TEST(err == KErrAlreadyExists);
-		if (err != KErrAlreadyExists)
-			INFO_PRINTF3(_L("TheClient->iWs.SetCustomTextCursor return value  - Expected: %d, Actual: %d"), KErrAlreadyExists, err);
-
-		}
-	_LIT(KLog,"Text Cursor: Loaded %d Custom Cursors");
-	TLogMessageText buf;
-	buf.Format(KLog,count);
-	TheClient->LogMessage(buf);
-	CleanupStack::PopAndDestroy(customTextCursorsWrapper);
-//
-	ValidateWin(BaseWin,TRgb::Gray256(204));
-	ValidateWin(TestWin,TRgb::Gray256(204));
-//
-	SetCursor(TPoint(10,90),TSize(80,100),TRgb(255,255,255));
-//
-	iWinState=0;
-	iWinPos=TPoint(2*TheClient->iGroup->Size().iWidth/3,0);
-//
-	iMoveWin=new(ELeave) CBlankWindow(TRgb::Gray256(220));
-	TDisplayMode mode=EGray16;
-	TInt testWinWidth = TestWin->Size().iWidth;
-	TInt halfTestWinWidth = testWinWidth/2;
-	TInt halfTestWinHeight = TestWin->Size().iHeight/2;
-	
-	iMoveWin->SetUpL(iWinPos,TSize(halfTestWinHeight,halfTestWinHeight),
-			TheClient->iGroup,*TheClient->iGc,&mode);
-
-	iCheckWin=new(ELeave) CBlankWindow(TRgb::Gray256(220));
-	iCheckWin->SetUpL(TPoint(testWinWidth+halfTestWinWidth,halfTestWinHeight),
-			TSize(halfTestWinWidth,halfTestWinHeight),
-			TheClient->iGroup,*TheClient->iGc,&mode);
-	}
-
-void CTCursorTest::DeleteMoveWindows()
-	{
-	delete iMoveWin;
-	delete iCheckWin;
-	CancelTextCursor();
-	}
-
-void CTCursorTest::ResetMoveWindowsL()
-	{
-	SetCursor(TPoint(10,90),TSize(80,100),TRgb(255,255,255));
-	iWinState=0;
-	iWinPos=TPoint(2*TheClient->iGroup->Size().iWidth/3,0);
-	iMoveWin->SetExtL(iWinPos,TSize(TestWin->Size().iWidth/2,TestWin->Size().iHeight/2));
-	iCheckWin->SetExtL(TPoint(TestWin->Size().iWidth+(TestWin->Size().iWidth>>1),TestWin->Size().iHeight>>1),
-														TSize(TestWin->Size().iWidth/2,TestWin->Size().iHeight/2));
-	}
-
-TBool CTCursorTest::MoveWindow()
-	{
-	TSize scrSize(TheClient->iScreen->SizeInPixels());
-	iWinState++;
-	if (iWinState<20)
-		iWinPos+=TPoint((4*scrSize.iWidth)/640,(4*scrSize.iHeight)/240);
-	else if (iWinState<40)
-		iWinPos+=TPoint((1*scrSize.iWidth)/640,(-3*scrSize.iHeight)/240);
-	else if (iWinState<60)
-		iWinPos+=TPoint((-6*scrSize.iWidth)/640,(3*scrSize.iHeight)/240);
-	else
-		iWinPos+=TPoint((1*scrSize.iWidth)/640,(-2*scrSize.iHeight)/240);
-	iMoveWin->SetPos(iWinPos);
-	return (iWinState==80);
-	}
-
-void CTCursorTest::ValidateWin(TestWindow *aWin, TRgb aColor)
-	{
-	aWin->Win()->Invalidate();
-	RedrawWin(*aWin->Win(),aColor);
-	}
-
-void CTCursorTest::RedrawWin(RWindow &aWin, TRgb aColor)
-	{
-	aWin.BeginRedraw();
-	TheClient->iGc->Activate(aWin);
-	TheClient->iGc->SetBrushColor(aColor);
-	TheClient->iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TheClient->iGc->SetPenStyle(CGraphicsContext::ENullPen);
-	TheClient->iGc->Clear();
-	TheClient->iGc->Deactivate();
-	aWin.EndRedraw();
-	}
-
-void CTCursorTest::ScrollTest()
-	{
-	const TSize size(20,40);
-	ValidateWin(TestWin,TRgb::Gray256(255));
-
-	SetCursor(TPoint(10,20),size,TRgb::Gray256(255),TTextCursor::EFlagNoFlash);
-	TheClient->iWs.Flush();
-	TheClient->WaitForRedrawsToFinish();
-	TheClient->iWs.Finish();
-
-	for(TInt ii=0;ii<20;ii++)
-		{
-		TInt dist=(ii&3)*2;
-		TInt nx=ii&0x1?1:-1;
-		TInt ny=ii&0x2?1:-1;
-		TestWin->Win()->Scroll(TPoint(dist*nx,dist*ny),TRect(10,20,30,40));
-		TheClient->iWs.Flush();
-		}
-	TheClient->WaitForRedrawsToFinish();
-	TheClient->iWs.Finish();
-
-	BaseWin->Win()->Invalidate();
-	BaseWin->Win()->BeginRedraw();
-	TheClient->iGc->Activate(*(BaseWin->Win()));
-	TheClient->iGc->Clear();
-	TheClient->iGc->SetBrushColor(TRgb::Gray256(255));
-	TheClient->iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TheClient->iGc->SetPenStyle(CGraphicsContext::ENullPen);
-	TheClient->iGc->Clear(TRect(TPoint(10,20),size));
-	TheClient->iGc->Deactivate();
-	BaseWin->Win()->EndRedraw();
-
-	TheClient->iWs.Flush();
-	TheClient->WaitForRedrawsToFinish();
-	TheClient->iWs.Finish();
-
-	/*
-	 * NOTE: Reason for removal of COMPARE_WINDOWS_SOFTFAIL_WINSCW
-	 * Due to the new implementation of sprites in wserv2, the sprites no longer keep a 
-	 * backup bitmap of what the screen looks like beneath them. As it is not possible to 
-	 * move the sprites associated with the custom text cursors that were created in second 
-	 * phase construction of the CTCursorTest object, the COMPARE_WINDOWS_SOFTFAIL_WINSCW; 
-	 * macro function has been removed. Otherwise the test case is going to subject to the
-	 * timing of the flashing sprite. An alternative solution would be to assign NULL values
-	 * to the sprite bitmaps in second phase construction, but this is avoided as it would
-	 * trigger failures in some test cases later on (that are depended on these "embedded"
-	 * sprite images).
-	 */	
-	CancelTextCursor();
-	}
-
-void DrawTestSprite(CBitmapContext *aGc,TInt , const TSize &aSize, TBool aDoMask, TAny *)
-	{
-	aGc->SetBrushColor(TRgb::Gray4(aDoMask ? 0 : 2));
-	aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	aGc->SetPenStyle(CGraphicsContext::ENullPen);
-	aGc->DrawRect(TRect(aSize));
-	aGc->SetPenStyle(CGraphicsContext::ESolidPen);
-	aGc->SetPenColor(TRgb::Gray4(aDoMask ? 3 : 0));
-	aGc->SetBrushColor(TRgb::Gray4(aDoMask ? 3 : 1));
-	aGc->DrawEllipse(TRect(aSize));
-	}
-
-CTSprite *CTCursorTest::CreateTestSpriteLC(RWindowTreeNode &aWindow, const TPoint &aPos, TInt aCount)
-//
-// At the moment aCount must be 1 or 2
-//
-	{
-	TSpriteCreateParams params(TSize(30,70),TPoint(0,0),DrawTestSprite);
-	TSpriteCreateParams paramarray[2];
-	params.iInterval=TTimeIntervalMicroSeconds32(200000);
-
-	paramarray[0]=params;
-	paramarray[1]=params;
-	paramarray[1].iSize=TSize(100,10);
-	CTSprite *sprite=new(ELeave) CTSprite(TheClient->iWs);
-	CleanupStack::PushL(sprite);
-	sprite->ConstructL(aWindow,aPos,aCount,&paramarray[0],0);
-	return(sprite);
-	}
-
-void CTCursorTest::doMoveWindowTestL()
-	{
-	RBlankWindow blankwin(TheClient->iWs);
-	User::LeaveIfError(blankwin.Construct(*TestWin->Win(),1));
-	CleanupStack::PushL(TCleanupItem(CleanUpWindow,&blankwin));
-//
-	blankwin.SetExtent(TPoint(35,165),TSize(40,40));
-	blankwin.SetColor(TRgb::Gray256(220));
-	blankwin.Activate();
-	TheClient->iWs.SetAutoFlush(ETrue);
-	User::After(500000);
-	blankwin.SetPosition(TPoint(25,55));
-	User::After(500000);
-	blankwin.SetPosition(TPoint(30,160));
-	User::After(500000);
-	blankwin.SetPosition(TPoint(12,22));	// Almost totally covering sprite
-	User::After(500000);
-	blankwin.SetPosition(TPoint(-100,-100));	// Totally off the sprite
-	User::After(500000);
-	blankwin.SetPosition(TPoint(10,20));	// Write on top of sprite
-	User::After(500000);
-	blankwin.SetPosition(TPoint(24,24));	// moving off...
-	User::After(500000);
-	blankwin.SetPosition(TPoint(38,28));	// ...
-	User::After(500000);
-	blankwin.SetPosition(TPoint(58,48));	// ...
-	User::After(500000);
-	blankwin.SetPosition(TPoint(92,62));	// ... off
-	User::After(500000);
-	CleanupStack::PopAndDestroy();	// blank window
-	TheClient->iWs.Flush();
-	TheClient->WaitForRedrawsToFinish();
-	TheClient->iWs.Finish();
-
-	TheClient->iWs.SetAutoFlush(EFalse);
-	}
-
-void CTCursorTest::MoveWindowTest1L()
-	{
-	ValidateWin(TestWin,TRgb::Gray256(255));
-// Check it with a static sprite
-	CTSprite * sprite_static = CreateTestSpriteLC(*TestWin->Win(), TPoint(10,20), 1);
-	doMoveWindowTestL();
-	(sprite_static->Sprite()).SetPosition(TPoint(500,500)); //move the sprite out of the viewing area before the window comparison 
-	CleanupStack::PopAndDestroy(1);	// sprite
-// Check it an animated sprite
-	CTSprite * sprite_anim = CreateTestSpriteLC(*TestWin->Win(), TPoint(10,20), 2);
-	doMoveWindowTestL();
-	(sprite_anim->Sprite()).SetPosition(TPoint(500,500)); //move the sprite out of the viewing area before the window comparison
-	CleanupStack::PopAndDestroy(1);	// sprite
-	}
-
-void CTCursorTest::MoveWindowTest2L()
-	{
-	const TSize size(20,40);
-// Check it with a text cursor
-	ValidateWin(TestWin,TRgb::Gray256(255));
-	SetCursor(TPoint(10,25),size,TRgb::Gray256(255),TTextCursor::EFlagNoFlash);
-	doMoveWindowTestL();
-	CancelTextCursor();
-// Check it with an anaimated sprite and a text cursor
-	ValidateWin(TestWin,TRgb::Gray256(255));
-	CTSprite * sprite_anim = CreateTestSpriteLC(*TestWin->Win(), TPoint(10,20), 2);
-	SetCursor(TPoint(10,45),size,TRgb::Gray256(255),TTextCursor::EFlagNoFlash);
-	doMoveWindowTestL();
-	(sprite_anim->Sprite()).SetPosition(TPoint(500,500));
-	CancelTextCursor();
-	CleanupStack::PopAndDestroy(1);	// sprite
-	}
-
-TBool CTCursorTest::IncrementCursorType()
-	{
-	// each screen has it own set of cursor
-	//
-	// the values would be ETypeLast=2 ETypeLastBasic=1009
-	//
-	if (iCursorType == TTextCursor::ETypeFirst)
-		{
-		iCursorType = (TTextCursor::EType)(TTextCursor::ETypeLastBasic + 1 + iTest->iScreenNumber*KNumberOfCustoTextCursors);
-		return ETrue;
-		}
-	else if (iCursorType >= TTextCursor::ETypeLastBasic + (iTest->iScreenNumber+1)*KNumberOfCustoTextCursors)
-		{
-		iCursorType = TTextCursor::ETypeFirst;
-		return EFalse;
-		}
-	else
-		{
-		iCursorType = (TTextCursor::EType)(iCursorType + 1);
-		return ETrue;
-		}
-	}
-
-void CTCursorTest::GeneralTestsL()
-	{
-	const TInt winColor=255;		//Best to use Light Grey that is 170, but this code is bugged and doing so shows them up.
-	ValidateWin(BaseWin,TRgb::Gray256(255));
-	ValidateWin(TestWin,TRgb::Gray256(255));
-	SetCursor(TPoint(-1000,10),TSize(10,30),TRgb::Gray256(255));
-	TheClient->iWs.Flush();
-	SetCursor(TPoint(10,10),TSize(10,30),TRgb::Gray256(255));
-	TheClient->iWs.Flush();
-	TRect rect(15,15,18,25);
-	SetCursorPlusBox(TPoint(10,10),TSize(10,30),TRgb::Gray256(255), &rect);
-	CancelTextCursor();
-//
-	ValidateWin(BaseWin,TRgb::Gray256(255));
-	ValidateWin(TestWin,TRgb::Gray256(255));
-	TheClient->iWs.Flush();
-	for(TInt winType=0;winType<3;winType++)
-		{
-		RWindowBase *cursorwin=NULL;
-		RBackedUpWindow backcursorwin(TheClient->iWs);
-		RWindow backwindow(TheClient->iWs);
-		RBlankWindow backblankwin(TheClient->iWs);
-		switch(winType)
-			{
-			case 0:
-				cursorwin=&backcursorwin;
-				User::LeaveIfError(backcursorwin.Construct(*TestWin->BaseWin(),EGray4,1));
-				break;
-			case 1:
-				cursorwin=&backwindow;
-				User::LeaveIfError(backwindow.Construct(*TestWin->BaseWin(),1));
-				break;
-			case 2:
-				cursorwin=&backblankwin;
-				User::LeaveIfError(backblankwin.Construct(*TestWin->BaseWin(),1));
-				break;
-			}
-		CleanupStack::PushL(TCleanupItem(CleanUpWindow,cursorwin));
-		User::LeaveIfError(cursorwin->SetSizeErr(TestWin->BaseWin()->Size()));
-		cursorwin->Activate();
-//
-		TTextCursor tc;
-		tc.iType=iCursorType;
-		tc.iHeight=30;
-		tc.iAscent=0;
-		tc.iWidth=50;
-		tc.iFlags=0;
-		tc.iColor=TRgb::Gray256(255);
-		TheClient->iGroup->GroupWin()->SetTextCursor(*cursorwin,TPoint(10,10),tc);
-//
-		CreateTestSpriteLC(*cursorwin, TPoint(10,20), 2);
-//
-		if (cursorwin==&backwindow)
-			RedrawWin(backwindow,TRgb::Gray256(255));
-		for(TInt count=0;count<9;count++)
-			{
-			RWindowBase *pwin=NULL;
-			RBackedUpWindow backedup(TheClient->iWs);
-			RWindow window(TheClient->iWs);
-			RBlankWindow blankwin(TheClient->iWs);
-			switch(count%3)
-				{
-				case 0:
-					pwin=&window;
-					window.Construct(*cursorwin,2);
-					window.SetBackgroundColor(TRgb(winColor,winColor,winColor));
-					break;
-				case 1:
-					pwin=&backedup;
-					backedup.Construct(*cursorwin,EGray4,2);
-					break;
-				case 2:
-					pwin=&blankwin;
-					blankwin.Construct(*cursorwin,2);
-					blankwin.SetColor(TRgb(winColor,winColor,winColor));
-					break;
-				}
-			CleanupStack::PushL(TCleanupItem(CleanUpWindow,pwin));
-			pwin->SetExtentErr(TPoint(30,30),TSize(50,80));
-			pwin->Activate();
-			TheClient->iWs.Flush();
-			CleanupStack::PopAndDestroy();	// window
-			if (cursorwin==&backwindow)
-				RedrawWin(backwindow,TRgb::Gray256(255));
-			TheClient->iWs.Flush();
-			TheClient->WaitForRedrawsToFinish();
-			COMPARE_WINDOWS_SOFTFAIL_WINSCW;
-			User::After(200000);	// Wait a fifth of a second to make sure the test is run during different states of flashing
-			}
-		for(TInt count2=0;count2<4;count2++)
-			{
-			cursorwin->SetPosition(TPoint(10,5));
-			TheClient->iWs.Flush();
-			User::After(100000);
-			cursorwin->SetPosition(TPoint(5,10));
-			TheClient->iWs.Flush();
-			User::After(100000);
-			cursorwin->SetPosition(TPoint(0,0));
-			TheClient->iWs.Flush();
-			User::After(100000);
-			TheClient->WaitForRedrawsToFinish();
-			COMPARE_WINDOWS_SOFTFAIL_WINSCW;
-			}
-		CleanupStack::PopAndDestroy(2);	// sprite & window containing sprite and cursor
-		}
-	CancelTextCursor();
-	}
-
-void CTCursorTest::INC040489L()
-	{
-	INFO_PRINTF1(_L("AUTO_TCur INC040489 "));
-	RWindowGroup group1(TheClient->iWs);
-	PushWindowL(&group1);
-	User::LeaveIfError(group1.Construct(ENullWsHandle));
-	RBlankWindow blank1(TheClient->iWs);
-	PushWindowL(&blank1);
-	User::LeaveIfError(blank1.Construct(group1,ENullWsHandle));
-	blank1.SetRequiredDisplayMode(EColor4K);
-	blank1.SetColor(TRgb(250,150,0));
-	blank1.Activate();
-	RWindowGroup group2(TheClient->iWs);
-	PushWindowL(&group2);
-	User::LeaveIfError(group2.Construct(ENullWsHandle));
-	RBlankWindow blank2(TheClient->iWs);
-	PushWindowL(&blank2);
-	User::LeaveIfError(blank2.Construct(group2,ENullWsHandle));
-	blank2.SetRequiredDisplayMode(EColor4K);
-	blank2.SetColor(TRgb(75,200,125));
-	blank2.Activate();
-	TheClient->Flush();
-	INFO_PRINTF1(_L(" Created Windows "));
-	TTextCursor tc;
-	tc.iType=KTextCursorInitialIdValue + iTest->iScreenNumber*KNumberOfCustoTextCursors;
-	tc.iHeight=80;
-	tc.iAscent=10;
-	tc.iWidth=30;
-	tc.iFlags=0;
-	tc.iColor=TRgb::Gray256(255);
-	INFO_PRINTF1(_L(" About to Set Text Cursor 1 "));
-	group2.SetTextCursor(blank2,TPoint(20,20),tc);
-	TheClient->Flush();
-	INFO_PRINTF1(_L(" Set Text Cursor 1 "));
-	User::After(2000000);		//2sec
-	TheClient->iWs.PrepareForSwitchOff();
-	TheClient->Flush();
-	User::After(2000000);		//2sec
-	group1.SetOrdinalPosition(0);
-	group2.CancelTextCursor();
-	TheClient->Flush();
-	INFO_PRINTF1(_L(" Canceled Text Cursor "));
-	User::After(2000000);		//2sec
-	//
-	// Before applying the fix, the following operations makes the Custom Text 
-	// Cursor Sprite invisible (happens even without wserv heartbeat suppression)
-	INFO_PRINTF1(_L(" About to Set Text Cursor 2 "));
-	group1.SetOrdinalPosition(2);
-	group2.SetTextCursor(blank2,TPoint(20,20),tc);
-	TheClient->Flush();
-	INFO_PRINTF1(_L(" Set Text Cursor 2 "));
-	User::After(2000000);		//2sec
-	TRawEvent event;
-	event.Set(TRawEvent::EActive);
-	TheClient->iWs.SimulateRawEvent(event);
-	TheClient->Flush();
-	INFO_PRINTF1(_L(" Simulated Active Event "));
-	User::After(2000000);		//2sec
-	CleanupStack::PopAndDestroy(4, &group1);
-	INFO_PRINTF1(_L(" End of test "));
-	}
-
-void CTCursorTest::CursorUpdatedBeforeWindowRenderedL()
-	{
-	INFO_PRINTF1(_L("CursorUpdatedBeforeWindowRenderedL"));
-	TheClient->iGroup->WinTreeNode()->SetOrdinalPosition(0);
-	// We use some unique looking colors otherwise its harder
-	// to spot which test is which
-	TRgb kAqua(134, 242, 251);
-	
-	iWorkInProgress = new(ELeave) CBlankWindow(kAqua);
-	iComparisonWindow = new(ELeave) CBlankWindow(kAqua);
-	CancelTextCursor();
-	
-	const TSize screenSize=TheClient->iGroup->Size();
-	const TInt kPad = 5;
-	const TInt kThirdOfScreenWidth = screenSize.iWidth/3;
-	const TInt kWinWidth = kThirdOfScreenWidth - 2*kPad;
-	const TInt kWinHeight = screenSize.iHeight - 2*kPad;
-	const TSize kWinSize(kWinWidth, kWinHeight);
-	const TPoint kCursorPos(30, 30);
-	iComparisonWindow->SetUpL(TPoint(2*kThirdOfScreenWidth + kPad, kPad), kWinSize, TheClient->iGroup, *TheClient->iGc);
-	iWorkInProgress->SetUpL(  TPoint(  kThirdOfScreenWidth + kPad, kPad), kWinSize, TheClient->iGroup, *TheClient->iGc);
-	
-	TTextCursor nonFlashingCursor;
-	nonFlashingCursor.iType = TTextCursor::ETypeRectangle;
-	nonFlashingCursor.iHeight=kCursorHeight;
-	nonFlashingCursor.iAscent=0;
-	nonFlashingCursor.iWidth=kCursorWidth;
-	nonFlashingCursor.iFlags=TTextCursor::EFlagNoFlash;
-	nonFlashingCursor.iColor = KRgbBlack; 
-	TheClient->iGroup->GroupWin()->SetTextCursor(*iWorkInProgress->BaseWin(), kCursorPos, nonFlashingCursor);
-	
-	// Up till this point, there has not been a CWsWindow::Render() for iWorkInProgress
-	// because the window has not been invalid
-	
-	/*
-	 * Here is the crux of the test.  We want to create the following condition in a window group:
-	 * 1) None of its windows have yet been Rendered using CWsWindow::Render()
-	 * 2) A text cursor is present
-	 * 3) Focus is lost then received
-	 * 
-	 * It used to be the case that Wserv picked up the handle to the Render Stage Text Cursor
-	 * drawer upon a Refresh caused by Rendering the window.  But drawing the Text Cursor could
-	 * come either from a Window Render or a change to the state of the Text Cursor, such as
-	 * receiving focus in the window.  A bug was experienced when the Text Cursor was drawn in
-	 * a window which never had been rendered.  This meant that the handle was not set up causing
-	 * an assert.
-	 * 
-	 * The code has been modified since then, to setup the handle to the Render Stage Text
-	 * Cursor during Wserv initialisation.  However, to guard against future changes, its
-	 * worthwhile to have this corner case test to ensure it is possible to receive focus
-	 * in a window which has never been rendered.  That is because the text cursor state
-	 * is updated in such circumstances, and that might trigger a draw of the cursor in a
-	 * future version of the text cursor code.
-	 */
-	TheClient->iGroup->WinTreeNode()->SetOrdinalPosition(1);  // lose focus
-	TheClient->iWs.Finish();
-	TheClient->iGroup->WinTreeNode()->SetOrdinalPosition(0); // gain focus
-	TheClient->iWs.Finish();
-	
-	// If we get this far without a panic or assert, we have passed this test.
-	
-	// Now allow CWsWindow::Render() to occur in iWorkInProgress
-	// The reason for doing this is so that when you watch the test
-	// progress you can see visual confirmation via the progress message and
-	// the coloured windows appear on the screen.  Otherwise you would think
-	// that the test had either been skipped or had broken.
-	iWorkInProgress->Invalidate();
-	iWorkInProgress->Redraw();
-	iComparisonWindow->Invalidate();
-	iComparisonWindow->Redraw();
-	TheClient->iWs.Finish();
-	delete iWorkInProgress;
-	iWorkInProgress = NULL;
-	delete iComparisonWindow;
-	iComparisonWindow = NULL;
-	INFO_PRINTF1(_L("End of test"));
-	}
-
-void CTCursorTest::INC097774()
-	{
-	TTimeIntervalMicroSeconds32 initialRepeatRate;
-	TTimeIntervalMicroSeconds32 repeatRate;
-	TheClient->iWs.GetKeyboardRepeatRate(initialRepeatRate,repeatRate);
-	
-	//simulates a text cursor moving across the screen as if a user was holding down
-	//a key to scroll the cursor through a section of text.
-	//before applying the fix the cursor only shows up intermittently instead of smoothly
-	//scrolling across the screen.
-	const TSize cursorSize(3,20);
-	const TInt moveInterval=10;
-	SetCursor(TPoint(0,20),cursorSize,TRgb::Gray256(255),TTextCursor::EFlagNoFlash);
-	TheClient->Flush();
-	User::After(initialRepeatRate);
-	for(TInt offset=10;offset<=100;offset+=moveInterval)
-		{
-		SetCursor(TPoint(offset,20),cursorSize,TRgb::Gray256(255),TTextCursor::EFlagNoFlash);
-		TheClient->Flush();
-		User::After(repeatRate);
-		}
-		
-	//simulate clipped text cursor moving accross the screen
-	TRect rect(0,20,3,40);
-	SetCursor(TPoint(0,20),cursorSize,TRgb::Gray256(255),rect,TTextCursor::EFlagNoFlash);
-	TheClient->Flush();
-	User::After(initialRepeatRate);
-	for(TInt offset=10;offset<=100;offset+=moveInterval)
-		{
-		rect.Move(moveInterval,0);
-		SetCursor(TPoint(offset,20),cursorSize,TRgb::Gray256(255),rect,TTextCursor::EFlagNoFlash);
-		TheClient->Flush();
-		User::After(repeatRate);
-		}	
-	}
-/** What happens when a cursor becomes off-screen when the screen is resized/rotated? 
- * 
- * 
- **/
-void CTCursorTest::INC117232()
-	{
-	const TInt initialRepeatRate=300000;	// 3/10 seconds should be long enough to update everything!
-	TInt currMode=TheClient->iScreen->CurrentScreenMode();
-	TInt testMode=currMode;
-	TPixelsTwipsAndRotation currModeSize;
-	TheClient->iScreen->GetScreenModeSizeAndRotation(currMode, currModeSize);
-	//find a (rotated) mode where the dimensions of the screen shrank
-	for (TInt mode=0;mode<TheClient->iScreenModes.Count();mode++)
-		{
-		TPixelsTwipsAndRotation testModeSize;
-		TheClient->iScreen->GetScreenModeSizeAndRotation(mode,testModeSize);
-		if (	testModeSize.iPixelSize.iWidth<currModeSize.iPixelSize.iWidth-10
-			||	testModeSize.iPixelSize.iHeight<currModeSize.iPixelSize.iHeight-10
-			)
-			{
-			testMode=mode;
-			break;
-			}
-		}
-	if (testMode==currMode)
-		{
-		_LIT(KLog,"No smaller screen-size modes available - INC117232 test skipped");
-		LOG_MESSAGE(KLog);
-		//iStep->SetTestStepResult(EInconclusive);		//With this line the whole test fails which is too drastic
-		return;
-		}
-	//enable a cursor on the bottom right corner of the screen
-	TestWin->SetFullScreenExtL();
-	TheClient->Flush();
-	iCursorType=TTextCursor::ETypeRectangle;
-	SetCursor(TPoint(-20,-20)+TestWin->Size(),TSize(40,40),KRgbDarkMagenta,TTextCursor::EFlagNoFlash);
-	TheClient->Flush();
-	User::After(initialRepeatRate);
-	//shrink the screen
-	TheClient->iScreen->SetScreenMode(testMode);
-	TheClient->iScreen->SetAppScreenMode(testMode);
-	//The defect was that WServ would now crash! 
-	TheClient->Flush();
-	User::After(initialRepeatRate);
-	//Set everything back
-	TheClient->iScreen->SetScreenMode(currMode);
-	TheClient->iScreen->SetAppScreenMode(currMode);
-	TheClient->Flush();
-	User::After(initialRepeatRate);
-	}
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-/**
- * Sets up a text cursor whose attributes indicate it should not be flashing
- * and then checks to ensure this is the actual behaviour.
- */
-void CTCursorTest::TextCursorNoFlashTestL()
-	{
-	TheClient->iGroup->WinTreeNode()->SetOrdinalPosition(0);
-	// We use some unique looking colors otherwise its harder
-	// to spot which test is which
-	TRgb kGentleYellow(251, 249, 198);
-	TRgb kGentlePink(253, 196, 221);
-	
-	iWorkInProgress = new(ELeave) CBlankWindow(kGentleYellow);
-	iComparisonWindow = new(ELeave) CBlankWindow(kGentleYellow);
-	CancelTextCursor();
-	TheClient->Flush();
-	
-	const TSize screenSize=TheClient->iGroup->Size();
-	const TInt kPad = 5;
-	const TInt kThirdOfScreenWidth = screenSize.iWidth/3;
-	const TInt kWinWidth = kThirdOfScreenWidth - 2*kPad;
-	const TInt kWinHeight = screenSize.iHeight - 2*kPad;
-	const TSize kWinSize(kWinWidth, kWinHeight);
-	const TPoint kCursorPos(30, 30);
-	iWorkInProgress->SetUpL(  TPoint(  kThirdOfScreenWidth + kPad, kPad), kWinSize, TheClient->iGroup, *TheClient->iGc);
-	iComparisonWindow->SetUpL(TPoint(2*kThirdOfScreenWidth + kPad, kPad), kWinSize, TheClient->iGroup, *TheClient->iGc);
-	
-	TTextCursor nonFlashingCursor;
-	
-	nonFlashingCursor.iType = TTextCursor::ETypeRectangle;
-	nonFlashingCursor.iHeight=kCursorHeight;
-	nonFlashingCursor.iAscent=0;
-	nonFlashingCursor.iWidth=kCursorWidth;
-	nonFlashingCursor.iFlags=TTextCursor::EFlagNoFlash;
-	nonFlashingCursor.iColor = kGentlePink; // We expect a Flicker Buffer Render Stage to ignore this color
-	
-	iWorkInProgress->Invalidate();
-	iWorkInProgress->Redraw();
-	iComparisonWindow->Invalidate();
-	iComparisonWindow->Redraw();
-	
-	DrawTextCursorSimilarToRenderStage(*TheClient->iGc, *iComparisonWindow->Win(), kCursorPos, nonFlashingCursor);
-	TheClient->iGroup->GroupWin()->SetTextCursor(*iWorkInProgress->BaseWin(), kCursorPos, nonFlashingCursor);
-	TheClient->Flush();
-		
-	CheckCursorDoesNotFlash(iWorkInProgress->BaseWin()->Size());
-	
-	delete iWorkInProgress;
-	iWorkInProgress = NULL;
-	delete iComparisonWindow;
-	iComparisonWindow = NULL;
-	}
-
-void CTCursorTest::TextCursorFlashTestL()
-	{
-	TheClient->iGroup->WinTreeNode()->SetOrdinalPosition(0);
-	// We use some unique looking colors otherwise its harder
-	// to spot which test is which
-	TRgb kMildPurple(218, 155, 244);
-	TRgb kPaleGreen(146, 190, 12);
-	
-	iWorkInProgress = new(ELeave) CBlankWindow(kMildPurple);
-	iComparisonWindow = new(ELeave) CBlankWindow(kMildPurple);
-	CancelTextCursor();
-	TheClient->Flush();
-	
-	const TSize screenSize=TheClient->iGroup->Size();
-	const TInt kPad = 5;
-	const TInt kThirdOfScreenWidth = screenSize.iWidth/3;
-	const TInt kWinWidth = kThirdOfScreenWidth - 2*kPad;
-	const TInt kWinHeight = screenSize.iHeight - 2*kPad;
-	const TSize kWinSize(kWinWidth, kWinHeight);
-	const TPoint kCursorPos(30, 30);
-	iWorkInProgress->SetUpL(  TPoint(  kThirdOfScreenWidth + kPad, kPad), kWinSize, TheClient->iGroup, *TheClient->iGc);
-	iComparisonWindow->SetUpL(TPoint(2*kThirdOfScreenWidth + kPad, kPad), kWinSize, TheClient->iGroup, *TheClient->iGc);
-	
-	TTextCursor flashingCursor;
-	
-	flashingCursor.iType = TTextCursor::ETypeRectangle;
-	flashingCursor.iHeight=kCursorHeight;
-	flashingCursor.iAscent=0;
-	flashingCursor.iWidth=kCursorWidth;
-	flashingCursor.iFlags=0; // implies that cursor SHOULD flash
-	flashingCursor.iColor = kPaleGreen; // We expect a Flicker Buffer Render Stage to ignore this color
-
-	iWorkInProgress->Invalidate();
-	iWorkInProgress->Redraw();
-	iComparisonWindow->Invalidate();
-	iComparisonWindow->Redraw();
-	
-	DrawTextCursorSimilarToRenderStage(*TheClient->iGc, *iComparisonWindow->Win(), kCursorPos, flashingCursor);
-	TheClient->iGroup->GroupWin()->SetTextCursor(*iWorkInProgress->BaseWin(), kCursorPos, flashingCursor);
-	TheClient->Flush();
-	
-	CheckCursorDoesFlash(kCursorPos, flashingCursor, kMildPurple);
-	CancelTextCursor();
-	TheClient->Flush();
-	
-	delete iWorkInProgress;
-	iWorkInProgress = NULL;
-	delete iComparisonWindow;
-	iComparisonWindow = NULL;
-	}
-
-void CTCursorTest::DrawTextCursorSimilarToRenderStage(CWindowGc& aGc, RWindow& aWin, const TPoint& aPos, const TTextCursor& aTextCursor)
-	{
-	// This method duplicates the way in which the default FlickerBuffer Render
-	// Stage draws a Text Cursor of ETypeRectangle.  @see CFbRenderStage::DrawTextCursor
-	// This code must be kept in sync with the FlickerBuffer Render Stage
-	
-	ASSERT(aTextCursor.iType == TTextCursor::ETypeRectangle);
-	const TRect updatedRegion(aPos,TSize(aTextCursor.iWidth,aTextCursor.iHeight));
-	aWin.Invalidate();
-	aWin.BeginRedraw();
-	aGc.Activate(aWin);
-	aGc.Clear();
-	aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
-	aGc.SetBrushColor(KRgbBlack);
-	aGc.SetPenStyle(CGraphicsContext::ENullPen);
-	aGc.Clear(updatedRegion);
-	aGc.Deactivate();
-	aWin.EndRedraw();
-	}
-
-void CTCursorTest::CheckCursorDoesNotFlash(const TSize& aSize)
-	{
-	const TInt kSampleTime = 100000; // one tenth of a second
-	const TInt kSampleLimit = 100;
-	TInt sampleIteration = 0;
-	TBool comparisonOkay = EFalse;
-	
-	while (sampleIteration < kSampleLimit)
-		{	
-		comparisonOkay = DoCheckRect(iWorkInProgress, iComparisonWindow, TRect(TPoint(), aSize), CWsScreenDevice::EIncludeTextCursor);
-		if (!comparisonOkay)
-			{
-			INFO_PRINTF2(_L("CheckCursorDoesNotFlash difference found after %d milliseconds"), sampleIteration*100);
-			break;
-			}
-		sampleIteration++;
-		User::After(kSampleTime);
-		}
-	TEST(comparisonOkay);
-	}
-
-void CTCursorTest::UpdateCountersOnCursorTransition(
-		const TBool	aTransitionedToOn,
-		TTime& 		aNow,
-		TInt64&		aDeltaTime,
-		TTime&		aLastDeltaTime,
-		TInt&		aWarmUpIterations,
-		const TInt&	aFlashChangeTime,
-		const TInt&	aToleranceMargin,
-		TInt&		aSampleNumber,
-		TInt&		aToleranceViolations
-		)
-	{
-	_LIT(KTxtOn,	" On");
-	_LIT(KTxtOff,	"Off");
-	TBufC<3> transitionType;	
-	transitionType = aTransitionedToOn ? KTxtOn : KTxtOff;
-	
-	aNow.UniversalTime();
-	aDeltaTime = aNow.MicroSecondsFrom(aLastDeltaTime).Int64();
-	aLastDeltaTime = aNow;
-	
-	if (aWarmUpIterations > 0)
-		{
-		aWarmUpIterations--;
-		}
-	else
-		{
-		if (aDeltaTime > aFlashChangeTime + aToleranceMargin ||
-				aDeltaTime < aFlashChangeTime - aToleranceMargin)
-			{
-			INFO_PRINTF5(_L(" Iteration %d, Cursor %S after %d, errorDelta %d microseconds"),
-					aSampleNumber, &transitionType, I64INT(aDeltaTime), I64INT(aDeltaTime - aFlashChangeTime));
-			aToleranceViolations++;
-			}
-		}
-	}
-void CTCursorTest::CheckCursorDoesFlash(const TPoint& aPos, const TTextCursor& aTextCursor, TRgb /* aBackgroundColor */)
-	{	
-	
-	/**
-	 * Quality of Service based thresholding
-	 * 
-	 * The idea behind this test is to identify tolerances which would either
-	 * cause the test to fail when the user would perceive the text cursor as
-	 * not flashing uniformly, or would point to an unexpected delay outside
-	 * the way the flashing (and scheduling of animations) is supposed to work.
-	 * 
-	 * Potentially the cursor can be late if we miss a V-SYNC from hardware.  In
-	 * such cases we expect to see the cursor on the next frame.  Since the V-SYNC
-	 * is typically 1/50 second, a tolerance of two frames, or 1/25 second is reasonable.
-	 * 
-	 * If the cursor is delayed longer than this, say a long time of 1 second, but this
-	 * does not happen too often, then the user is likely to still be happy.  So we
-	 * set the period of testing to 60 seconds, and set the violations limit to 2.
-	 */
-	const TInt kOneSecond = 1000000;
-	const TInt kFlashPeriod = kOneSecond; 		// comprises one "ON" and one "OFF"
-	const TInt kToleranceFactor = 25; 			// meaning 1/25 of a Flash Period
-	const TInt kNumberTestFlashPeriods = 60;	// meaning 60 Flash Periods worth of testing
-	const TInt kMaximumToleranceViolations = 2;	// number of times an occassional flash may be late or early
-	
-	const TInt kToleranceMargin = kFlashPeriod / kToleranceFactor;
-	const TInt kNumberSamples = kNumberTestFlashPeriods * kToleranceFactor;
-	const TInt kFlashChangeTime = kFlashPeriod / 2;
-	
-	// The first couple of changes to the cursor should be ignored because
-	// when the test is started, the cursor may have been on for a while.
-	// Then when the cursor goes off, it appears to have switched to the
-	// off state too early.  We therefore ignore the first two changes
-	// so we start cleanly.
-	TInt warmUpIterations = 2;
-	
-	// Empirically we see that cursors mostly flash with good timeliness apart from
-	// occasional events causing them to be either early or late.  In order to keep
-	// a tight tolerance (1/50 second is around the screen refresh time) but still
-	// allow for the occasional variance (seen to be 1/23 second) we use a counter
-	// toleranceViolations < kMaximumToleranceViolations
-	TInt toleranceViolations = 0;
-	TBool cursorShownLastTime = EFalse;
-	TBool cursorShown = EFalse;
-	TTime lastDeltaTime;
-	TTime now;
-	TInt64 deltaTime = 0;
-	lastDeltaTime.UniversalTime();
-	now.UniversalTime();
-
-	TRect textCursorRect(TRect(aPos, TSize(aTextCursor.iWidth, aTextCursor.iHeight)));
-
-	for (TInt sampleNumber = 0; sampleNumber < kNumberSamples; sampleNumber++)
-		{
-		cursorShown = DoCheckRect(iWorkInProgress, iComparisonWindow, textCursorRect, CWsScreenDevice::EIncludeTextCursor);
-
-		if (cursorShown && !cursorShownLastTime)
-			{
-			cursorShownLastTime = ETrue;
-			UpdateCountersOnCursorTransition(
-					cursorShownLastTime, now, deltaTime, lastDeltaTime, warmUpIterations, kFlashChangeTime,
-					kToleranceMargin, sampleNumber, toleranceViolations);
-			}
-		else if (!cursorShown && cursorShownLastTime)
-			{
-			cursorShownLastTime = EFalse;
-			UpdateCountersOnCursorTransition(
-					cursorShownLastTime, now, deltaTime, lastDeltaTime, warmUpIterations, kFlashChangeTime,
-					kToleranceMargin, sampleNumber, toleranceViolations);
-			}
-
-		if (toleranceViolations > kMaximumToleranceViolations)
-			break;
-
-		User::After(kToleranceMargin);
-		}
-	// Check was some flashing
-	TEST_SOFTFAIL_WINSCW(warmUpIterations == 0);
-	// Check cursor flashed on and off, regularly and on-time
-	TEST_SOFTFAIL_WINSCW(toleranceViolations <= kMaximumToleranceViolations);
-	}
-#endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-
-void CTCursorTest::MakeCursors(TTextCursor& aTextCursor, TTextCursor& aCustomCursor)
-	{
-	aCustomCursor.iType = KTextCursorInitialIdValue + iTest->iScreenNumber*KNumberOfCustoTextCursors; // custom text cursor
-	aCustomCursor.iAscent=0;
-	aCustomCursor.iHeight=kCursorHeight;
-	aCustomCursor.iWidth=kCursorWidth;
-	aCustomCursor.iFlags=TTextCursor::EFlagNoFlash; 
-	aCustomCursor.iColor=TRgb::Color256(217);	
-		
-	// Create a standard cursor for the tests
-	aTextCursor.iType = TTextCursor::ETypeRectangle; // Normal rectangular text cursor
-	aTextCursor.iHeight=kCursorHeight;
-	aTextCursor.iAscent=0;
-	aTextCursor.iWidth=kCursorWidth;
-	aTextCursor.iFlags=TTextCursor::EFlagNoFlash;
-	}
-
-void CTCursorTest::StartDoubleCursorTestL(TInt aTestNumber)
-	{
-	// general setup
-	CBlankWindow* win1=new(ELeave) CBlankWindow(KRgbWhite);
-	CleanupStack::PushL(win1);
-
-	win1->SetUpL(kWin1TopLeft,kWinSize,TheClient->iGroup,*TheClient->iGc,EColor64K);
-	
-	win1->Redraw();
-	
-	// Create the second window
-	CBlankWindow* win2=new(ELeave) CBlankWindow(KRgbWhite);
-	CleanupStack::PushL(win2);
-
-	win2->SetUpL(kWin2TopLeft,kWinSize,TheClient->iGroup,*TheClient->iGc,EColor64K);
-	win2->Redraw();
-
-	// Create normal and custom cursor for the tests
-	TTextCursor textCursor;
-	TTextCursor customCursor;
-	MakeCursors(textCursor, customCursor);
-
-	TheClient->Flush();
-	CWindowGc* winGc = TheClient->iGc;	
-
-	switch(aTestNumber)
-		{
-		case 1:
-		CheckNoDoubleCursorTest1L(win1, win2, textCursor, customCursor, winGc);
-		break;
-		
-		case 2:
-		CheckNoDoubleCursorTest2L(win1, win2, textCursor, customCursor, winGc);
-		break;
-		
-		case 3:
-		CheckNoDoubleCursorTest3L(win1, win2, textCursor, customCursor, winGc);
-		break;
-		
-		default:
-		TEST(EFalse);
-		break;
-		}
-	CleanupStack::PopAndDestroy(2); 	
-	}
-
-// DEF098704
-void CTCursorTest::CheckNoDoubleCursorTest1L(CBlankWindow* aWin1, CBlankWindow* aWin2, TTextCursor& /*aTextCursor*/, TTextCursor& aCustomCursor, CWindowGc* aWinGc)
-	{
-	// Test that changing the focus of a custom text cursor does not leave that cursor drawn where it was (INC093898)
-
-	TheClient->iGroup->GroupWin()->SetTextCursor(*aWin1->BaseWin(),TPoint(),aCustomCursor);
-		
-	// Bit blit the TEST_BITMAP_NAME image to the second window to use as a comparison
-	// this is the same image that the custom cursor is using
-	CFbsBitmap* bitmap = new(ELeave) CFbsBitmap;
-	CleanupStack::PushL(bitmap);
-	TEST(KErrNone == bitmap->Load(TEST_BITMAP_NAME,0,ETrue)); 
-
-	aWinGc->Activate(*aWin2->Win());
-	TRect updateArea(TPoint(0,0), bitmap->SizeInPixels());
-	aWin2->Win()->Invalidate(updateArea);
-	aWin2->Win()->BeginRedraw(updateArea);
-	aWinGc->BitBlt(TPoint(0,0),bitmap); 
-	aWinGc->Deactivate();
-	aWin2->Win()->EndRedraw();
-	TheClient->Flush();
-	doCheckNoDoubleCursor(aWin1,aWin2,kWin1TopLeft,kWin2TopLeft,aCustomCursor,bitmap->SizeInPixels(),CWsScreenDevice::EIncludeSprite);
-	CleanupStack::PopAndDestroy(1); // bitmap
-	}
-
-// DEF098704
-void CTCursorTest::CheckNoDoubleCursorTest2L(CBlankWindow* aWin1, CBlankWindow* aWin2, TTextCursor& /*aTextCursor*/, TTextCursor& aCustomCursor, CWindowGc* aWinGc)
-	{
-	//TEST 2: Checks that no artifacts are left behind when a text cursor is moved from under a transparent sprite
-	
-	// Construct the window win1 with a transparent sprite
-	
-	// Clear the top and bottom windows
-	ResetWindows(aWinGc,aWin1,aWin2);	
-	
-	// Create a bitmap and a corresponding bitmap mask
-	CFbsBitmap* bitmap = new(ELeave) CFbsBitmap;
-	CleanupStack::PushL(bitmap);
-	TEST(KErrNone == bitmap->Load(TEST_BITMAP_NAME,0,ETrue)); 
-	CBitmap* spriteBitmap=CBitmap::NewL(kWinSize,EColor256);
-	CleanupStack::PushL(spriteBitmap);
-	spriteBitmap->Gc().SetBrushColor(KRgbBlack);
-	spriteBitmap->Gc().SetBrushStyle(CGraphicsContext::ESolidBrush);
-	spriteBitmap->Gc().SetPenStyle(CGraphicsContext::ESolidPen); 
-	spriteBitmap->Gc().DrawRect(TRect(kWinSize));
-	CBitmap* mask=CBitmap::NewL(kWinSize,EColor256);
-	CleanupStack::PushL(mask);
-	mask->Gc().SetBrushStyle(CGraphicsContext::ESolidBrush);
-	mask->Gc().SetBrushColor(KRgbBlack);
-	mask->Gc().DrawRect(TRect(kWinSize));	
-	
-	// Create a sprite
-	RWsSprite sprite = RWsSprite(TheClient->iWs);
-	CleanupClosePushL(sprite);
-	TEST(KErrNone == sprite.Construct(*aWin1->BaseWin(),TPoint(),0));
-	
-	// Add the bitmap to the sprite
-	TSpriteMember member;
-	member.iInvertMask=EFalse;
-	member.iDrawMode=CGraphicsContext::EDrawModePEN;
-	member.iOffset=TPoint();
-	member.iInterval=TTimeIntervalMicroSeconds32(0);
-	member.iBitmap = &spriteBitmap->Bitmap();
-	member.iMaskBitmap = &mask->Bitmap(); 
-	TEST(KErrNone == sprite.AppendMember(member));
-	
-	// Activate the sprite in win1
-	TEST(KErrNone == sprite.Activate());
-	
-	// Put a cursor in win1
-	TheClient->iGroup->GroupWin()->SetTextCursor(*aWin1->BaseWin(),TPoint(),aCustomCursor);
-	
-	// Bit blit the matching bitmap to the bottom window
-	TRect bitmapArea(TPoint(0,0), bitmap->SizeInPixels());
-	aWin2->Win()->Invalidate(bitmapArea);
-	aWin2->Win()->BeginRedraw(bitmapArea);
-	aWinGc->Activate(*aWin2->Win());
-	aWinGc->BitBlt(TPoint(),bitmap); 
-	aWinGc->Deactivate();
-	aWin2->Win()->EndRedraw();
-		
-	TheClient->Flush();
-	doCheckNoDoubleCursor(aWin1,aWin2,kWin1TopLeft,kWin2TopLeft,aCustomCursor,bitmap->SizeInPixels(),CWsScreenDevice::EIncludeSprite);
-	CleanupStack::PopAndDestroy(4); // sprite, mask, spriteBitmap, bitmap
-	}
-
-// DEF098704		
-void CTCursorTest::CheckNoDoubleCursorTest3L(CBlankWindow* aWin1, CBlankWindow* aWin2, TTextCursor& aTextCursor,TTextCursor& aCustomCursor, CWindowGc* aWinGc)
-	{
-	//
-	// TEST 3: Test a flashing text cursor does not leave artifacts when a redraw + change position happens during
-	// the time the cursor flashing 'off'
-	// 
-	// This test moves a flashing cursor a number of times over a two second period to a seconds position.
-	// it does it a number of times so some of the redraws will occur during the 'flash off' period
-	// We then compare the 'after' position to what we expect
-	// 
-	// There are four possible outcomes when we look at the bitmap after the redraw + move
-	// Position 1 is the original position, position 2 is the new position after the redraw
-	// 
-	// cursor artifact @ pos1 and flashed on cursor @ pos2
-	// cursor artifact at pos1 and flashed off cursor @ pos2
-	// no artifact at pos1 and flashed off cursor @ pos2
-	// no artifact at pos1 and flashed on cursor @ pos2
-	// 
-	// any artifacts left over will cause the complete test to fail.
-	//
-	
-	//
-	// PART A: 
-	aTextCursor.iFlags=0; 	// flashing
-
-	ResetWindows(aWinGc,aWin1,aWin2);	
-	TestForArtifacts(aWin1, aTextCursor);
-	
-	//
-	// PART B - For a non-custom text cursor
-	aCustomCursor.iFlags=0; // flashing
-
-	ResetWindows(aWinGc,aWin1,aWin2);	
-	TestForArtifacts(aWin1, aCustomCursor);	
-	}
-	
-// moves the cursor between two positions while flashing and tests no artifacts are left at the position it moved from
-// The moves take place in a loop so it is tested happening when the cursor is flashed on and also off
-void CTCursorTest::TestForArtifacts(CBlankWindow* aWin1, TTextCursor& aCursor)
-	{
-	const TInt KIterations = 30;
-	const TPoint kStartPos(0,0);
-	const TPoint kMoveToPos(200,0);
-	TRect r1(kWin1TopLeft,kCursorSize);
-	TRect r2(kWin2TopLeft,kCursorSize);
-	const TPoint kWin1TopLeft; 
-	const TPoint kWin2TopLeft; 
-	const TSize aCursorSize;
-
-	TheClient->iGroup->GroupWin()->SetTextCursor(*aWin1->BaseWin(),kStartPos,aCursor);
-	TheClient->Flush();
-
-	TInt initialRepeatRate = 1000000; 
-	const TInt KIncrement = 30000;
-	TInt i=0;
-
-	for(i=0; i<KIterations; i++)		
-		{
-		// move the cursor to its new position
-		TheClient->iGroup->GroupWin()->SetTextCursor(*aWin1->BaseWin(),kMoveToPos,aCursor);
-		TheClient->Flush();
-
-		User::After(initialRepeatRate);
-		
-		// check no artifact was left in position 1 by comparing against (blank) win2
-		if(!TheClient->iScreen->RectCompare( r1,r2, CWsScreenDevice::EIncludeTextCursor))
-			{
-			break; // detected an artifact remaining, test failed
-			}
-
-		// move the cursor back to its start position, this resets the flash timer which is why we increment initialRepeatRate 
-		TheClient->iGroup->GroupWin()->SetTextCursor(*aWin1->BaseWin(),kStartPos,aCursor);
-		TheClient->Flush();
-		initialRepeatRate += KIncrement;
-		}
-		
-		// if all went well i should equal KIterations, if it doesnt its because we detected 
-		// an artifact and quit the test early
-	TEST_SOFTFAIL_WINSCW(i==KIterations);
-	}
-	
-
-// Tests the two windows match, moves the cursor off win 1 then tests they no longer match 		
-void CTCursorTest::doCheckNoDoubleCursor(CBlankWindow* aWin1,
-											CBlankWindow* aWin2,
-											const TPoint& aWin1Tl,
-											const TPoint& aWin2Tl,
-											const TTextCursor& aCursor,
-											const TSize& aCursorSize,
-											CWsScreenDevice::TSpriteInCompare aFlags)
-	{
-	TRect r1(aWin1Tl,aCursorSize);
-	TRect r2(aWin2Tl,aCursorSize);
-	
-	TInt compareTries = 0;
-	const TInt compareLimit = 5;
-	
-	TBool correctComparison = EFalse;
-	while (!correctComparison && compareTries < compareLimit)
-		{
-		compareTries++;
-		User::After(500000);
-		correctComparison = TheClient->iScreen->RectCompare(r1,r2, aFlags);
-		}
-
-	INFO_PRINTF3(_L("Result Before %d (attempts %d)"), correctComparison, compareTries);
-	TEST_SOFTFAIL_WINSCW(correctComparison);
-
-	
-	// Change the focus off win1, by drawing the text cursor on the second window
-	TheClient->iGroup->GroupWin()->SetTextCursor(*aWin2->BaseWin(),aWin2Tl,aCursor);
-	TheClient->Flush();
-
-	// Cause a redraw
-	aWin1->CTWin::DrawNow();
-	TheClient->WaitForRedrawsToFinish();
-
-	// make sure any cursor has actually moved	
-	User::After(1000000); // 1 sec
-	
-	TBool resultAfter;
-	resultAfter = !TheClient->iScreen->RectCompare(r1,r2, aFlags);
-	INFO_PRINTF2(_L("Result After %d"), resultAfter);
-	TEST_SOFTFAIL_WINSCW(resultAfter);
-	}	
-
-// resets the windows to their initial state
-void CTCursorTest::ResetWindows(CWindowGc* aWinGc,CBlankWindow* aWin1,CBlankWindow* aWin2)
-	{
-	TheClient->iGroup->GroupWin()->CancelTextCursor();
-	aWinGc->Activate(*aWin1->Win());
-	aWinGc->Reset();
-	aWinGc->Clear();
-	aWinGc->Deactivate();
-
-	aWin1->Invalidate();
-	aWin1->Redraw();
-	aWin2->Invalidate();
-	aWin2->Redraw();
-	TheClient->Flush();
-	}
-	
-void CTCursorTest::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	TBool deleteMove=EFalse;
-	((CTCursorTestStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-
-	switch(++iTest->iState)
-		{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0241
-
-@SYMDEF				DEF081259
-
-@SYMTestCaseDesc    Test the text cursor functions properly as a window is moved
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Move a window about the screen and meanwhile check the text
-					cursor functions correctly
-
-@SYMTestExpectedResults The text cursor functions correctly as the window is moved
-*/
-	case 1:
-		((CTCursorTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0241"));
-		while (!deleteMove)
-			{
-			if (iCursorType==TTextCursor::ETypeFirst)
-				iTest->LogSubTest(_L("Cursor 1"));
-			if (MoveWindow())
-				{
-				if (IncrementCursorType())
-					{
-					ResetMoveWindowsL();
-					}
-				else
-					{
-					DeleteMoveWindows();
-					deleteMove =true;
-					}
-				}
-			}
-		break;
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0242
-
-@SYMDEF				DEF081259
-
-@SYMTestCaseDesc    Test the text cursor functions properly as the window is scrolled
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Scroll the window and meanwhile check the text cursor functions correctly
-
-@SYMTestExpectedResults The text cursor functions correctly as the window is scrolled
-*/
-		case 2:
-			((CTCursorTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0242"));
-			iTest->LogSubTest(_L("Cursor 2"));
-			iCursorType=TTextCursor::ETypeRectangle;
-			ScrollTest();
-			iCursorType=TTextCursor::ETypeFirst;
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0244
-
-@SYMDEF				DEF081259
-
-@SYMTestCaseDesc    Test the text cursor functions properly as a blank window is moved
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Move a blank window about the screen and meanwhile check the text
-					cursor functions correctly
-
-@SYMTestExpectedResults The text cursor functions correctly as the blank window is moved
-*/
-		case 3:
-			((CTCursorTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0244"));
-			iTest->LogSubTest(_L("Move window1"));
-			MoveWindowTest1L();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0245
-
-@SYMDEF				DEF081259
-
-@SYMTestCaseDesc    Test that a non flashing text cursor functions properly as a 
-					blank window is moved
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Move a blank window about the screen and meanwhile check that a non
-					flashing text cursor functions correctly
-
-@SYMTestExpectedResults The text cursor functions correctly as the blank window is moved
-*/
-		case 4:
-			((CTCursorTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0245"));
-			while (IncrementCursorType())
-				{
-				iTest->LogSubTest(_L("Move window2"));
-				MoveWindowTest2L();
-				}
-			break;		
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0247
-
-@SYMDEF				DEF081259
-
-@SYMTestCaseDesc    Tests a Custom Text Cursor Sprite visibility after wserv hearbeat suppression
-					REQUIREMENT:	INC040489.
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Create a window group with an associated window for it, then activate it.
-					Create another window group with an associated window along with a custom cursor, 
-					then active it. Make a call to suppress the wserv hearbeat, which will stop 
-					the custom cursor from flashing with flash ON state. Bring the first window 
-					group to the foreground and cancel the custom test cursor in the second window group.
-					After that, put the first window group to the background and set the custom test 
-					cursor in the second window group. Simulate a raw key event to start 
-					the wserv heartbeat, which will make the custom cursor flashing.
-
-@SYMTestExpectedResults The Custom text cursor in the second window group should be visible and flashing, 
-						when it comes to the foreground after the first window group sent to the background.
-*/
-		case 5:
-			((CTCursorTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0247"));
-			iTest->LogSubTest(_L("Custom Text Cursor Sprite visibility"));
-			INC040489L();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-2095-0015
-
-@SYMTestCaseDesc    Text Cursor allows Update before Rendering the owning window
-
-@SYMTestPriority    Normal
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Create a window group and two windows, one with a Text Cursor.
-					Stimulate a state change in the Text Cursor by receiving
-					window focus, but before the Window has ever been Rendered.
-					This shakes out logic in RWsTextCursor which depends on
-					side effects arising from having executed CWsWindow::Render()
-					
-@SYMTestExpectedResults 
-					There should be no panic or assertion.
-*/
-		case 6:
-			((CTCursorTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-2095-0015"));
-			iTest->LogSubTest(_L("Update before Render"));
-			CursorUpdatedBeforeWindowRenderedL();
-			break;
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0248
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Tests a bad use of text cursor functionality from a client.
-					REQ 1079, CR RDEF-5F7Q24 (10/04/2003).
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     This test case checks whether the window server is able to detect a bad
-					use of the text cursor functionality (including the custom text cursor)
-					by a client.
-					This test case launches several threads and each of them will try
-					to use the text cursor functionality in a non-proper way.
-
-@SYMTestExpectedResults Each new thread has panic code associated to it. This is the expected panic when
-						the thread dies.
-						The thread once launched is expected to panic and the returning panic code should
-						match the expected one.
-*/
-		case 7:
-			((CTCursorTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0248"));
-			iTest->LogSubTest(_L("Panic"));
-			TestPanicsL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0400
-
-@SYMDEF				PDEF099013
-
-@SYMTestCaseDesc    Cursor moves slowly in text editors. 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     This test case is a VISUAL TEST only on whether a scrolling text cursor is drawn to the
-					screen correctly. 2 types of cursor are checked both clipped and non clipped cursors.
-					In each case the test simulates a text cursor moving across the screen as if a user were
-					holding down a key to scroll the cursor through a section of text.
-
-@SYMTestExpectedResults The text cursor in both cases should scroll smoothly to the centre of the screen.
-						In versions prior to this fix the cursor was not correctly drawn and appeared to move 	
-						slowly.
-*/
-		case 8:
-			((CTCursorTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0400"));
-			iTest->LogSubTest(_L("Text Cursor Update Tests"));
-			INC097774();
-			break;	
-		
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0401
-
-@SYMDEF  			DEF098704
-
-@SYMTestCaseDesc    Test code for implemented fix to remove double cursors 
-					
-@SYMTestPriority    Normal
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     This test case tests for artifacts left over when normal/custon flashing/non-flashing cursors are drawn.
-					Test that changing the focus of a custom text cursor does not leave that cursor drawn where it was (INC093898)
-
-@SYMTestExpectedResults 
-*/			
-	case 9:
-		((CTCursorTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0401"));
-		iTest->LogSubTest(_L("Double cursors test 1"));
-		StartDoubleCursorTestL(1);
-		break;
-
-	/**
-	@SYMTestCaseID		GRAPHICS-WSERV-0402
-
-	@SYMDEF				DEF098704
-
-	@SYMTestCaseDesc    Test code for implemented fix to remove double cursors 
-
-	@SYMTestPriority    Normal
-
-	@SYMTestStatus      Implemented
-
-	@SYMTestActions     Checks that no artifacts are left behind when a text cursor is moved from under a transparent sprite
-
-	@SYMTestExpectedResults 
-	*/
-	case 10:
-		((CTCursorTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0402"));
-		iTest->LogSubTest(_L("Double cursors test 2"));
-		StartDoubleCursorTestL(2);
-		break;
-
-	/**
-	@SYMTestCaseID		GRAPHICS-WSERV-0403
-
-	@SYMDEF				DEF098704
-
-	@SYMTestCaseDesc    Test code for implemented fix to remove double cursors 
-						
-	@SYMTestPriority    Normal
-
-	@SYMTestStatus      Implemented
-
-	@SYMTestActions     This test moves a flashing cursor a number of times over a two second period to a seconds position.
-						it does it a number of times so some of the redraws will occur during the 'flash off' period
-						We then compare the 'after' position to what we expect
-
-	@SYMTestExpectedResults 
-	*/
-	case 11:
-		((CTCursorTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0403"));
-		iTest->LogSubTest(_L("Double cursors test 3"));
-		StartDoubleCursorTestL(3);
-		break;
-
-	/**
-	@SYMTestCaseID		GRAPHICS-WSERV-0483
-
-	@SYMDEF				INC117232
-
-	@SYMTestCaseDesc    Test code: Refreshing cursors becoming offscreen due to screen size change should not panic 
-
-	@SYMTestPriority    Normal
-
-	@SYMTestStatus      Implemented
-
-	@SYMTestActions     Create a cursor on bottom right of screen, change to a screen mode that excludes that coordinate
-
-	@SYMTestExpectedResults 
-						The server should not panic.
-	*/
-	case 12:
-		((CTCursorTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0483"));
-		iTest->LogSubTest(_L("Screen resize invalidate cursor off-screen"));
-		INC117232();
-		break;
-
-	/**
-	@SYMTestCaseID		GRAPHICS-WSERV-2095-0016
-
-	@SYMTestCaseDesc    Text Cursor flag TTextCursor::EFlagNoFlash honored 
-
-	@SYMTestPriority    Normal
-
-	@SYMTestStatus      Implemented
-
-	@SYMTestActions     Create a text cursor with the TTextCursor::EFlagNoFlash setting.  Observe the screen over
-						a short period of time to verify that it remains continuously in the Flash ON state.
-
-	@SYMTestExpectedResults 
-						The text cursor should be always shown.
-	*/
-	case 13:
-	#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-		((CTCursorTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-2095-0016"));
-		iTest->LogSubTest(_L("Text cursor EFlagNoFlash test"));
-		TextCursorNoFlashTestL();
-	#endif
-		break;
-
-	/**
-	@SYMTestCaseID		GRAPHICS-WSERV-2095-0009
-
-	@SYMTestCaseDesc    Text Cursor flashes when flag value is 0
-
-	@SYMTestPriority    Normal
-
-	@SYMTestStatus      Implemented
-
-	@SYMTestActions     Create a text cursor with the 0 flag setting.  Observe the screen over
-						a short period of time to verify that the cursor flashes ON and OFF at
-						the correct period of one second.
-
-	@SYMTestExpectedResults 
-						The text cursor should flash.
-	*/
-	case 14:
-	#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-		((CTCursorTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-2095-0009"));
-		iTest->LogSubTest(_L("Text cursor will Flash test"));
-		TextCursorFlashTestL();
-	#endif
-		break;
-
-	/**
-	@SYMTestCaseID		GRAPHICS-WSERV-2095-0017
-
-	@SYMTestCaseDesc    Text Cursor handles different valid Cursor Setttings
-
-	@SYMTestPriority    Normal
-
-	@SYMTestStatus      Implemented
-
-	@SYMTestActions     Create a text cursor and then issue a SetTextCursor.  Then repeatedly
-						call SetTextCursor, varying the arguments relating to the Text Cursor
-						as well as keeping the arguments the same on one occassion.
-
-	@SYMTestExpectedResults 
-						The system should not panic as the arguments supplied are never invalid.
-	*/
-	case 15:
-		((CTCursorTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-2095-0017"));
-		iTest->LogSubTest(_L("SetTextCursor test"));
-		TextCursorSetLCoverageTests();
-		break;
-
-		default:
-			((CTCursorTestStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTCursorTestStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-			break;
-		}
-	((CTCursorTestStep*)iStep)->RecordTestResultL();
-	}
-
-__WS_CONSTRUCT_STEP__(CursorTest)
--- a/windowing/windowserver/tauto/TTEXTCURS.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TTEXTCURS_H__
-#define __TTEXTCURS_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-/*
- * Wrapper class for a custom text cursor.
- */
-class CCustomTextCursor : public CBase
-	{
-public:
-	static CCustomTextCursor* CreateCustomTextCursorL(TInt aScreenNumber,TInt aBmpIndex,CTestBase* aTest);
-	~CCustomTextCursor();
-	
-private:
-	CCustomTextCursor(CTestBase* aTest);
-	void ConstructL(TInt aScreenNumber,TInt aBmpIndex);
-	
-public:
-	TInt iIdentifier;
-	RArray<TSpriteMember> iSpriteMemberArray;
-	TUint iSpriteFlags;
-	RWsSession::TCustomTextCursorAlignment iAlignment;
-	CTestBase* iTest;
-	};
-	
-class CTCursorTest : public CTWsGraphicsBase
-	{
-public:
-	CTCursorTest(CTestStep* aStep);
-	~CTCursorTest();
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	void SetCursor(const TPoint &aPos,const TSize &aSize,TRgb aColor, TUint aFlags=0);
-	void SetCursor(const TPoint &aPos,const TSize &aSize,TRgb aColor, const TRect &aRect, TUint aFlags=0);
-	void SetCursorPlusBox(const TPoint &aPos,const TSize &aSize,TRgb aColor, const TRect *aRect, TUint aFlags=0);
-	void CancelTextCursor();
-	void ConstructL();
-	void doMoveWindowTestL();
-	TBool MoveWindow();
-	void TestPanicsL();
-	void ScrollTest();
-	void GeneralTestsL();
-	void MoveWindowTest1L();
-	void MoveWindowTest2L();
-	void INC041278L();
-	void INC040489L();
-	void CursorUpdatedBeforeWindowRenderedL();
-	void INC097774();
-	void INC117232();
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-	void TextCursorNoFlashTestL();
-	void TextCursorFlashTestL();
-	void CheckCursorDoesNotFlash(const TSize& aSize);
-	void UpdateCountersOnCursorTransition(
-			const TBool	aTransitionedToOn,
-			TTime& 		aNow,
-			TInt64&		aDeltaTime,
-			TTime&		aLastDeltaTime,
-			TInt&		aWarmUpIterations,
-			const TInt&	aFlashChangeTime,
-			const TInt&	aToleranceMargin,
-			TInt&		aSampleNumber,
-			TInt&		aToleranceViolations
-			);
-	void CheckCursorDoesFlash(const TPoint& aPos, const TTextCursor& aTextCursor, TRgb aBackgroundColor);
-	void DrawTextCursorSimilarToRenderStage(CWindowGc& aGc, RWindow& aWin, const TPoint& aPos, const TTextCursor& aTextCursor);
-#endif
-	TBool IncrementCursorType();
-	CTSprite* CreateTestSpriteLC(RWindowTreeNode &aWindow, const TPoint &aPos, TInt aCount);
-	void TestForArtifacts(CBlankWindow* aWin1, TTextCursor& aCursor);
-	void CheckNoDoubleCursorTest1L(CBlankWindow* aWin1, CBlankWindow* win2, TTextCursor& aTextCursor,TTextCursor& aCustomCursor, CWindowGc* winGc);
-	void CheckNoDoubleCursorTest2L(CBlankWindow* aWin1, CBlankWindow* win2, TTextCursor& aTextCursor,TTextCursor& aCustomCursor, CWindowGc* winGc);
-	void CheckNoDoubleCursorTest3L(CBlankWindow* aWin1, CBlankWindow* win2, TTextCursor& aTextCursor,TTextCursor& aCustomCursor, CWindowGc* winGc);
-	void MakeCursors(TTextCursor& aTextCursor, TTextCursor& aCustomCursor);										  
-	void StartDoubleCursorTestL(TInt aTestNumber);
-	void doCheckNoDoubleCursor(CBlankWindow* aWin1,
-								CBlankWindow* aWin2,
-								const TPoint& aWin1Tl,
-								const TPoint& aWin1T2,
-								const TTextCursor& aCursor,
-								const TSize& aCursorSize,
-								CWsScreenDevice::TSpriteInCompare aFlags);
-	
-	void ResetWindows(CWindowGc* aWinGc,CBlankWindow* aWin1,CBlankWindow* aWin2);
-	void ValidateWin(TestWindow *aWin, TRgb aColor);
-	void RedrawWin(RWindow &aWin, TRgb aColor);
-	void DeleteMoveWindows();
-	void ResetMoveWindowsL();
-	static TInt DoPanicTest(TInt aInt, TAny *aScreenNumber);
-	void TextCursorSetLCoverageTests();
-	
-private:
-	TSize iWinSize;
-	TPoint iWinPos;
-	TInt iWinState;
-	CBlankWindow *iMoveWin;
-	CBlankWindow *iCheckWin;
-	CBlankWindow *iWorkInProgress;
-	CBlankWindow *iComparisonWindow;
-	TTextCursor::EType iCursorType;
-	static CTestBase* iStaticTest;	// static because it is used by DoPanicTest
-	};
-
-
-class CTCursorTestStep : public CTGraphicsStep
-	{
-public:
-	CTCursorTestStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTCursorTestStep,"TCursorTest");
-
-
-#endif
--- a/windowing/windowserver/tauto/TTransptAnim.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,367 +0,0 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-#include "TTransptAnim.h"
-
-struct FrameSet
-	{
-	TRgb* iFrames;
-	const TInt iFrameCount;
-	FrameSet(TRgb* aFrames, const TInt aFrameCount)
-	: iFrames(aFrames),
-	iFrameCount(aFrameCount)
-		{
-		}
-	};
-
-TRgb FrameSequenceAlpha[]= 
-{ TRgb(255, 0, 0, 50), TRgb(0, 255, 0, 70), TRgb(0, 0, 255, 100), TRgb(255, 255, 0, 150), TRgb(0, 255, 255, 200) };
-TRgb FrameSequenceNoAlpha[] =
-{ TRgb(255, 0, 0), TRgb(0, 255, 0), TRgb(0, 0, 255), TRgb(255, 255, 0), TRgb(0, 255, 255) };
-
-FrameSet frameSetAlpha(FrameSequenceAlpha, 	sizeof(FrameSequenceAlpha)/sizeof(TRgb));
-FrameSet frameSetNoAlpha(FrameSequenceNoAlpha, sizeof(FrameSequenceNoAlpha)/sizeof(TRgb));
-FrameSet TestFrameSets[] =
-	{
-	frameSetAlpha, frameSetNoAlpha
-	};
-
-static const TInt 	FRAME_DELAY 			= 2000000;
-static const TInt 	DRAW_LINE_ANIMATION 	= 36;
-static const TBool 	ALPHATRANSPARENCY_ON 	= ETrue;
-static const TInt	ALPHA_FRAMESET 			= 0;
-
-//*****************************************************************************
-CTTestCase* CTTransparentAnim::CreateTestCaseL(CTTransparentAnim* aTransAnim, TInt aTestCaseId)
-	{
-	CTTestCase* testCase = aTransAnim->GetCurrent();
-	
-	if (!testCase)
-		{
-		switch (aTestCaseId)
-			{
-		case GraphicsWServ0483 :
-			testCase =  CTGraphicsWServ0483::NewL();
-			break;
-			}
-		}
-	
-	return testCase;
-	}
-
-//*****************************************************************************
-CTTransparentAnim::CTTransparentAnim(CTestStep* aStep)
-: CTWsGraphicsBase(aStep), iCurrentTestCase(NULL)
-	{}
-
-CTTransparentAnim::~CTTransparentAnim()
-	{
-	TheClient->iWs.SetAutoFlush(EFalse);
-	}
-
-void CTTransparentAnim::ConstructL()
-	{
-	TheClient->iWs.SetAutoFlush(ETrue);
-	}
-
-void CTTransparentAnim::RunTestCaseL(TInt)
-	{
-	((CTTransparentAnimStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0483"));
-	CTTestCase* testCase = CTTransparentAnim::CreateTestCaseL(this, iTest->iState);
-	
-	if (!testCase)
-		{
-		TestComplete();
-		return ;
-		}
-
-	TInt err = KErrNone;
-	
-	if (!testCase->IsAlreadyRunning())
-		{
-		SetCurrent(testCase);
-		iTest->LogSubTest(testCase->TestCaseName());
-		TRAP(err, testCase->StartL());
-		testCase->SetError(err);
-		}
-	
-	if (testCase->IsComplete() || err != KErrNone)
-		{
-		((CTTransparentAnimStep*)iStep)->RecordTestResultL();
-		((CTTransparentAnimStep*)iStep)->CloseTMSGraphicsStep();
-		if (testCase->HasFailed())
-			{
-			INFO_PRINTF3(_L("ErrorStatus  - Expected: %d, Actual: %d"), ETrue, EFalse);
-			}
-		++iTest->iState;
-		SetCurrent(NULL);
-		delete testCase;
-		}
-	else
-		{
-		// Prevent test harness from repeatedly running the test case too quickly.
-		User::After(TTimeIntervalMicroSeconds32(FRAME_DELAY));
-		}
-	}
-
-void CTTransparentAnim::SetCurrent(CTTestCase* aTestCase)
-	{
-	iCurrentTestCase = aTestCase;
-	}
-
-CTTestCase* CTTransparentAnim::GetCurrent()
-	{
-	return iCurrentTestCase;
-	}
-
-//*****************************************************************************
-CTTAnimation::CTTAnimation(CTWin* aWin, TInt aDrawArg)
-: iWin(aWin), iFrameCount(0), iCurrentFrameSet(0), iIsComplete(EFalse), iDrawArg(aDrawArg)
-	{
-	iAnimDll = RAnimDll(TheClient->iWs);
-	iAnimDll.Load(KAnimDLLName);
-	iDrawAnim = RTestAnim(iAnimDll);
-	iDrawAnim.Construct(*iWin->BaseWin(), EAnimTypeTrans, TPckgBuf<TRect>(aWin->Size()));
-	}
-
-CTTAnimation::~CTTAnimation()
-	{
-	iDrawAnim.Close();
-	iAnimDll.Close();
-	delete iWin;
-	}
-
-void CTTAnimation::StartL()
-	{
-	iAnimTimer.ConstructL();
-	iAnimTimer.Start(FRAME_DELAY, TCallBack(CTTAnimation::NextFrame,this));
-	}
-
-TBool CTTAnimation::IsComplete()
-	{
-	return iIsComplete;
-	}
-
-void CTTAnimation::SetCurrentFrameSet(TInt aFrameSet)
-	{
-	iCurrentFrameSet = aFrameSet;
-	}
-
-CTWin* CTTAnimation::GetWindow()
-	{
-	return iWin;
-	}
-
-void CTTAnimation::Attach(MAnimationObserver* aObserver)
-	{
-	iObserver = aObserver;
-	}
-
-TInt CTTAnimation::NextFrame(TAny* aAnim)
-	{
-	STATIC_CAST(CTTAnimation*,aAnim)->NextFrame();
-
-	return KErrNone;
-	}
-
-void CTTAnimation::NextFrame()
-	{
-	TRgb Color;
-	TPckgBuf<TFrameData> paramsPckg;
-
-	if (iFrameCount == TestFrameSets[iCurrentFrameSet].iFrameCount)
-		{
-		iIsComplete = ETrue;
-		iObserver->Update(this);
-		return ;
-		}
-	
-	Color = TestFrameSets[iCurrentFrameSet].iFrames[iFrameCount++];
-	
-	paramsPckg().draw = iDrawArg;
-	paramsPckg().color = Color;
-	
-	iDrawAnim.Command(EADllNextFrame, paramsPckg);
-
-	iAnimTimer.Start(FRAME_DELAY, TCallBack(CTTAnimation::NextFrame,this));
-	}
-
-//*****************************************************************************
-CTransAnimTimer::CTransAnimTimer() 
-: CTimer(EPriorityStandard)
-	{}
-
-CTransAnimTimer::~CTransAnimTimer()
-	{}
-
-void CTransAnimTimer::ConstructL()
-	{
-	CTimer::ConstructL();
-	CActiveScheduler::Add(this);
-	}
-
-void CTransAnimTimer::RunL()
-	{
-	iCallBack.CallBack();
-	}
-
-void CTransAnimTimer::Start(TTimeIntervalMicroSeconds32 aInterval,TCallBack aCallBack)
-	{
-	iCallBack = aCallBack;
-	After(aInterval);
-	}
-
-//*****************************************************************************
-CTTestCase::CTTestCase()
-: iError(KErrNone), iIsComplete(EFalse), iIsRunning(EFalse)
-	{}
-
-TBool CTTestCase::IsAlreadyRunning()
-	{
-	return iIsRunning;
-	}
-
-void CTTestCase::Update(CTTAnimation* aAnim)
-	{
-	iIsComplete = aAnim->IsComplete();
-	}
-
-TBool CTTestCase::IsComplete()
-	{
-	return iIsComplete;
-	}
-
-void CTTestCase::StartL()
-	{
-	if (!iIsRunning)
-		{
-		RunTestCaseL();
-		iIsRunning = ETrue;
-		}
-	}
-
-TBool CTTestCase::HasFailed()
-	{
-	TBool ret = EFalse;
-	if (iError != KErrNone)
-		{
-		ret = ETrue;
-		}
-	return ret;
-	}
-
-void CTTestCase::SetIsCompleted(TBool aIsComplete)
-	{
-	iIsComplete = aIsComplete;
-	}
-
-void CTTestCase::SetError(TInt aError)
-	{
-	iError = aError;
-	}
-
-//*********************** New Test Case Classes go here************************
-
-/**
- * @SYMTestCaseID GRAPHICS-WSERV-0483
- *
- * @SYMTestCaseDesc There are two animations running, one attached to a transparent
- * window using SetTransparencyAlphaChannel and a second animation with a non-transparent
- * window. The animations draw a line and then change the color of the line in subsequent
- * frames. After the last frame the alpha channel for the first animation is set to
- * opaque and then compared with the second animation to make certain that no artifacts
- * are present.
- *
- * @SYMTestPriority High
- *
- * @SYMTestStatus Implemented
- *
- * @SYMTestActions An anim is attached with a Transparent window.
- * 	The anim draws several frames using WSERV's Anim animation functionality.
- *
- * @SYMTestExpectedResults Both animations draw a line and then change it's color, the first
- * animation doing it in a tranparent window and the second doing it in a non-transparent window.
- **/
-CTGraphicsWServ0483* CTGraphicsWServ0483::NewL()
-	{
-	CTGraphicsWServ0483* testCase = new(ELeave) CTGraphicsWServ0483();
-	
-	CleanupStack::PushL(testCase);
-	testCase->ConstructL();
-	CleanupStack::Pop();
-	
-	return testCase;
-	}
-
-CTGraphicsWServ0483::~CTGraphicsWServ0483()
-	{
-	delete iAnim;
-	delete iCheckAnim;
-	}
-
-void CTGraphicsWServ0483::ConstructL()
-	{
-	iAnim = new(ELeave) CTTAnimation(CTAnimWin<ALPHATRANSPARENCY_ON>::NewL(
-										BaseWin->GetBorderWin()->Position(),
-										BaseWin->GetBorderWin()->Size()), DRAW_LINE_ANIMATION);
-	
-	iCheckAnim = new(ELeave) CTTAnimation(CTAnimWin<>::NewL(
-										TestWin->GetBorderWin()->Position(),
-										TestWin->GetBorderWin()->Size()), DRAW_LINE_ANIMATION);
-	TheClient->WaitForRedrawsToFinish();
-	}
-
-void CTGraphicsWServ0483::RunTestCaseL()
-	{
-	iAnim->Attach(this);
-	iCheckAnim->Attach(this);
-	
-	iAnim->SetCurrentFrameSet(ALPHA_FRAMESET);
-	iAnim->StartL();
-	
-	iCheckAnim->SetCurrentFrameSet(ALPHA_FRAMESET);
-	iCheckAnim->StartL();	
-	}
-
-void CTGraphicsWServ0483::Update(CTTAnimation*)
-	{
-	if (iAnim->IsComplete() && iCheckAnim->IsComplete())
-		{
-		TRgb bgColor(150, 150, 150, 255); 
-		iAnim->GetWindow()->Win()->SetBackgroundColor(bgColor);
-		iAnim->GetWindow()->Win()->Invalidate();
-		TheClient->iWs.Finish();
-		TheClient->WaitForRedrawsToFinish();
-		if (!DoCheckRect(iAnim->GetWindow(), iCheckAnim->GetWindow()))
-			{
-			SetError(KErrGeneral);
-			}
-		SetIsCompleted(ETrue);
-		}
-	}
-
-TPtrC CTGraphicsWServ0483::TestCaseName()
-	{
-	_LIT(KTransparentAlphaChannelAnimationTest, "Transparent Anim Test");
-	
-	return TPtrC(KTransparentAlphaChannelAnimationTest);
-	}
-
-__WS_CONSTRUCT_STEP__(TransparentAnim)
--- a/windowing/windowserver/tauto/TTransptAnim.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,203 +0,0 @@
-
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-#ifndef __TTRANSPTANIM__
-#define __TTRANSPTANIM__
-
-#include <e32std.h>
-#include <e32base.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "AUTODLL.H"
-
-enum
-	{
-	GraphicsWServ0483 = 0
-	};
-
-class CTTestCase;
-class CTransAnimTimer;
-class CTTransparentAnim;
-class CTTAnimation;
-class MAnimationObserver;
-
-class CTTransparentAnim : public CTWsGraphicsBase
-	{
-public:
-	static CTTestCase* CreateTestCaseL(CTTransparentAnim*, TInt);
-public:
-	CTTransparentAnim(CTestStep*);
-	virtual ~CTTransparentAnim();
-	void ConstructL();
-
-	void SetCurrent(CTTestCase*);
-	CTTestCase* GetCurrent();
-protected:
-	virtual void RunTestCaseL(TInt);
-	
-private:
-	CTTestCase* iCurrentTestCase;
-	};
-
-class CTTransparentAnimStep : public CTGraphicsStep
-	{
-public:
-	CTTransparentAnimStep();
-
-protected:
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-class CTransAnimTimer : public CTimer
-	{
-public:
-	CTransAnimTimer();
-	~CTransAnimTimer();
-	void ConstructL();
-	void Start(TTimeIntervalMicroSeconds32 aInterval,TCallBack aCallBack);
-private:
-	void RunL();
-	TCallBack iCallBack;
-	};
-
-class CTTAnimation
-	{
-public:
-	CTTAnimation(CTWin*, TInt);
-	~CTTAnimation();
-	
-	void StartL();
-	TBool IsComplete();
-	void SetCurrentFrameSet(TInt);
-	CTWin* GetWindow();
-	void Attach(MAnimationObserver*);
-private:
-	static TInt NextFrame(TAny*);
-	void NextFrame();
-
-private:
-	CTWin* iWin;
-	MAnimationObserver* iObserver;
-	RAnimDll iAnimDll;
-	RTestAnim iDrawAnim;
-	CTransAnimTimer iAnimTimer;
-	TInt iFrameCount;
-	TInt iCurrentFrameSet;
-	TBool iIsComplete;
-	TInt iDrawArg;
-	};
-
-template <TBool AlphaTransparency = EFalse>
-class CTAnimWin : public CTWin
-	{
-public:
-	static CTWin* NewL(TPoint aPosition, TSize aSize)
-		{
-		CTAnimWin* w = new(ELeave) CTAnimWin();
-	
-		CleanupStack::PushL(w);
-		w->ConstructL(aPosition, aSize);
-		CleanupStack::Pop();
-		
-		return w;	
-		}
-public:
-	virtual ~CTAnimWin(){}
-
-	void Draw(){}
-private:
-	CTAnimWin(){}
-
-	void ConstructL(TPoint aPoint, TSize aSize)
-		{
-		TRgb bgColor(150, 150, 150);
-		ConstructExtLD(*TheClient->iGroup, aPoint, aSize);
-		AssignGC(*TheClient->iGc);
-		Win()->SetRequiredDisplayMode(EColor16MA);
-		if (AlphaTransparency)
-			{
-			Win()->SetTransparencyAlphaChannel();
-			bgColor.SetAlpha(150);
-			}
-		Win()->SetBackgroundColor(bgColor);
-		Win()->Activate();
-		}
-	};
-
-//*****************************************************************************
-class MAnimationObserver
-	{
-public:
-	virtual void Update(CTTAnimation*) = 0;
-	};
-
-class CTTestCase : public MAnimationObserver
-	{
-public:
-	CTTestCase();
-	virtual ~CTTestCase() {}
-
-	TBool IsAlreadyRunning();
-	TBool IsComplete();
-	void StartL();
-	TBool HasFailed();
-	void SetError(TInt);
-	
-	// Implemented for MAnimationObserver
-	virtual void Update(CTTAnimation*);
-	virtual void ConstructL() = 0;
-	virtual TPtrC TestCaseName() = 0;
-
-protected:
-	virtual void RunTestCaseL() = 0;
-	void SetIsCompleted(TBool);
-	
-private:
-	TInt iError;
-	TBool iIsComplete;
-	TBool iIsRunning;
-	};
-
-class CTGraphicsWServ0483 : public CTTestCase
-	{
-public:
-	static CTGraphicsWServ0483* NewL();
-	
-public:
-	virtual ~CTGraphicsWServ0483();
-	virtual void RunTestCaseL();
-	
-	void Update(CTTAnimation*);
-	
-protected:
-	CTGraphicsWServ0483(){}
-	virtual void ConstructL();
-	virtual TPtrC TestCaseName();	
-	
-private:
-	CTTAnimation* iAnim;
-	CTTAnimation* iCheckAnim;
-	};
-
-_LIT(KTTransparentAnimStep,"TTransparentAnim");
-
-#endif // __TTRANSPTANIM__
--- a/windowing/windowserver/tauto/TWINDOW.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2943 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// General window tests
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TWINDOW.H"
-
-const TInt ENumCornerInsets=6;
-const TInt corner0[ENumCornerInsets]={0,0,0,0,0,0};
-const TInt corner1[ENumCornerInsets]={1,0,0,0,0,0};
-const TInt corner2[ENumCornerInsets]={2,1,0,0,0,0};
-const TInt corner3[ENumCornerInsets]={3,1,1,0,0,0};
-const TInt corner5[ENumCornerInsets]={5,3,2,1,1,0};
-const TInt KBaseUserEvent=61750;		//0xF136 - a random number that is unlikely to be used by other applicaions for user event sending
-
-//
-
-CWinTestWindow::CWinTestWindow(TRgb aCol) : CBlankWindow(aCol)
-	{
-	}
-
-CWinTestWindow::~CWinTestWindow()
-	{
-	delete iChild;
-	}
-
-void CWinTestWindow::ConstructL(TPoint pos,TSize size,CTWinBase *aParent, CWindowGc &aGc, TInt aDepth)
-	{
-	iWin=RWindow(TheClient->iWs);
-	User::LeaveIfError(iWin.Construct(*(aParent->WinTreeNode()),ENullWsHandle));
-	SetExt(pos,size);
-	if (aDepth<3)
-		{
-		iChild=new(ELeave) CWinTestWindow(TRgb::Gray256(iCol.Gray256()+34));
-		size.iWidth-=8;
-		size.iHeight-=8;
-		iChild->ConstructL(TPoint(4,4),size,this,aGc,aDepth+1);
-		}
-	Activate();
-	AssignGC(aGc);
-	}
-
-//
-
-CEvWindowGroup* CEvWindowGroup::NewLC(CTClient* aClient,CTWsGraphicsBase* aTest)
-	{
-	CEvWindowGroup* self=new(ELeave) CEvWindowGroup(aClient,aTest);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	return self;
-	}
-
-CEvWindowGroup::CEvWindowGroup(CTClient* aClient,CTWsGraphicsBase* aTest) : CTWindowGroup(aClient), iTest(aTest)
-	{}
-
-void CEvWindowGroup::ConstructL()
-	{
-	CTWindowGroup::ConstructL();
-	iGroupWin.EnableReceiptOfFocus(EFalse);
-	}
-
-void CEvWindowGroup::SetExpectedEvent(TInt aType)
-	{
-	iTest->TEST(!iExpectingEvent);
-	if (iExpectingEvent)
-		{
-		_LIT(KLog,"Setting expected event of type %d, when previouse event of type %d has not arrived (GpWinId=%d).");
-		iTest->LOG_MESSAGE4(KLog,aType,iExpectedEvent,iGroupWin.Identifier());
-		}
-	iExpectedEvent=aType;
-	iExpectingEvent=ETrue;
-	}
-
-void CEvWindowGroup::SendEvent(TInt aType)
-	{
-	TWsEvent event;
-	event.SetType(aType);
-	iClient->iWs.SendEventToWindowGroup(iGroupWin.Identifier(),event);
-	SetExpectedEvent(aType);
-	iClient->Flush();
-	}
-
-void CEvWindowGroup::UserEvent(TInt aEventType)
-	{
-	iTest->TEST(iExpectingEvent && iExpectedEvent==aEventType);
-	if (!iExpectingEvent || iExpectedEvent!=aEventType)
-		{
-		TInt id=iGroupWin.Identifier();
-		if (!iExpectingEvent)
-			{
-			_LIT(KLog,"Event of type %d recieved when not expecting an event (GpWinId=%d).");
-			iTest->LOG_MESSAGE3(KLog,aEventType,id);
-			}
-		else
-			{
-			_LIT(KLog,"Event of type %d when expecting an event of type %d (GpWinId=%d).");
-			iTest->LOG_MESSAGE4(KLog,aEventType,iExpectingEvent,id);
-			}
-		}
-	iExpectingEvent=EFalse;
-	}
-
-//
-
-CTWindowTest::CTWindowTest(CTestStep* aStep) : CTWsGraphicsBase(aStep)
-	{}
-
-CTWindowTest::~CTWindowTest()
-	{
-	delete iWin;
-	}
-
-void CTWindowTest::ConstructL()
-	{}
-
-TInt CTWindowTest::MoveGroup(TAny* aParam)
-	{
-	RWsSession ws;
-	TInt err=ws.Connect();
-	if (err==KErrNone)
-		{
-		TInt command=static_cast<TWindowThreadParam*>(aParam)->iCommand;
-		err=ws.SetWindowGroupOrdinalPosition(command&EIdMask,(command&EPosMask)>>EPosShift);
-		ws.Finish();
-		ws.Close();
-		}
-	return err;
-	}
-
-void CTWindowTest::CreateTestWindowL()
-	{
-	iWin=new(ELeave) CWinTestWindow(TRgb(0,0,0));
-	iWin->ConstructL(TPoint(1,1),TSize(TestWin->Size().iWidth/2,TestWin->Size().iHeight/2),TheClient->iGroup,*TheClient->iGc,0);
-	}
-
-void CTWindowTest::DrawWindows(CWinTestWindow *aWin)
-	{
-	if (aWin->iChild)
-		DrawWindows(aWin->iChild);
-	aWin->Win()->BeginRedraw();
-	TheGc->Activate(*aWin->Win());
-	TheGc->DrawRect(TRect(aWin->Win()->Size()));
-	TheGc->Deactivate();
-	aWin->Win()->EndRedraw();
-	TheClient->iWs.Flush();
-	}
-
-void CTWindowTest::CheckAndDestroyWindows()
-	{
-	DrawWindows(iWin);
-	delete iWin;
-	iWin=NULL;
-	}
-
-void CTWindowTest::DestroyWindowWithActiveGc()
-	{
-	iWin->Win()->BeginRedraw();
-	TheGc->Activate(*iWin->Win());
-	delete iWin;
-	TheGc->Deactivate();
-	iWin=NULL;
-	}
-
-void CTWindowTest::DestroyWindowWithActiveGc2L()
-	{
-	iWin->Win()->BeginRedraw();
-	TheGc->Activate(*iWin->Win());
-	CWindowGc *gc1=new(ELeave) CWindowGc(TheClient->iScreen);
-	CWindowGc *gc2=new(ELeave) CWindowGc(TheClient->iScreen);
-	CWindowGc *gc3=new(ELeave) CWindowGc(TheClient->iScreen);
-	gc1->Construct();
-	gc2->Construct();
-	gc3->Construct();
-	gc1->Activate(*iWin->Win());
-	gc2->Activate(*iWin->Win());
-	gc3->Activate(*iWin->Win());
-	delete iWin;
-	TheGc->Deactivate();
-	delete gc1;
-	delete gc2;
-	delete gc3;
-	iWin=NULL;
-	}
-
-LOCAL_C TInt DoPanicTest(TInt aInt, TAny *aScreenNumber)
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	// use correct screen
-	//
-	CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws);
-	User::LeaveIfError(screen->Construct((TInt)aScreenNumber));
-
-	RWindowGroup group(ws);
-	group.Construct(888);
-	group.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
-
-	RWindow redraw(ws);
-	redraw.Construct(group,88);
-
-	RBackedUpWindow backedUp(ws);
-	backedUp.Construct(group,EGray16,99);
-
-	RBlankWindow blank(ws);
-	blank.Construct(group,111);
-
-	RWindowBase *base=NULL;
-	TInt source=aInt/10000;
-	TInt target=(aInt%10000)/100;
-	TInt panic=aInt%100;
-	switch(source)
-		{
-		case 0:
-			base= &redraw;
-			break;
-		case 1:
-			base= &backedUp;
-			break;
-		case 2:
-			base= &blank;
-			break;
-		}
-	switch(target)
-		{
-		case 0:
-			{
-			RWindow *win=(RWindow *)base;
-			switch(panic)
-				{
-				case 0:
-					win->BeginRedraw();
-					break;
-				case 1:
-					ws.SetAutoFlush(ETrue);
-					win->BeginRedraw(TRect(0,0,1,1));
-					ws.SetAutoFlush(EFalse);
-					break;
-				case 2:
-					ws.SetAutoFlush(ETrue);
-					win->EndRedraw();
-					ws.SetAutoFlush(EFalse);
-					break;
-				case 3:
-					win->Invalidate();
-					break;
-				case 4:
-					win->Invalidate(TRect(0,0,1,1));
-					break;
-				case 5:
-					{
-					RRegion region;
-					win->GetInvalidRegion(region);
-					}
-					break;
-				case 6:
-					win->SetBackgroundColor(TRgb(0,0,0));
-					break;
-				case 7:
-					return(EWsExitReasonFinished);
-				}
-			break;
-			}
-		case 1:
-			{
-			RBackedUpWindow *win=(RBackedUpWindow *)base;
-			switch(panic)
-				{
-				case 0:
-					win->BitmapHandle();
-					break;
-				case 1:
-					win->UpdateScreen();
-					break;
-				case 2:
-					win->UpdateScreen(TRegionFix<1>(TRect(10,10,20,20)));
-					break;
-				case 3:
-					win->UpdateBackupBitmap();
-					break;
-				case 4:
-					win->MaintainBackup();
-					break;
-				case 5:
-					return(EWsExitReasonFinished);
-				}
-			break;
-			}
-		case 2:
-			{
-			RBlankWindow *win=(RBlankWindow *)base;
-			switch(panic)
-				{
-				case 0:
-					win->SetColor(TRgb(0));
-					break;
-				case 1:
-					return(EWsExitReasonFinished);
-				}
-			break;
-			}
-		}
-	ws.Flush();
-	return(EWsExitReasonBad);	// Should never get here, but it's baaddd if it does
-	}
-
-struct TWsLocalStructure
-	{
-	TInt xPos;
-	TInt yPos;
-	TInt Length;
-	TAny *ptr;
-	};
-
-LOCAL_C TInt DoPanicTest2(TInt aInt, TAny *aScreenNumber)
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-//
-	CWsScreenDevice *screen=new(ELeave) CWsScreenDevice(ws);
-	screen->Construct((TInt)aScreenNumber);
-//
-	RWindowGroup group(ws);
-	group.Construct(999);
-	group.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
-
-	RWindow win(ws);
-	win.Construct(group,122);
-	win.Activate();
-
-	switch(aInt)
-		{
-		case 0:
-			{
-			win.BeginRedraw();
-			CWindowGc *gc;
-			screen->CreateContext(gc);
-			gc->Activate(win);
-			CFbsFont *font;
-			screen->GetNearestFontToDesignHeightInTwips((CFont *&)font,TFontSpec());
-			gc->UseFont(font);
-			TWsLocalStructure params;
-			params.xPos=0;
-			params.yPos=0;
-			params.Length=1;
-			TPckgC<TWsLocalStructure> pkg(params);
-			TPtr8 ptr(NULL,10,10);
-			ws.TestWriteReplyByProvidingRemoteReadAccess(gc->WsHandle(),EWsGcOpDrawTextPtr,pkg,ptr); // Bad source descriptor
-			}
-			break;
-		case 1:
-			{
-			TPtr8 bad(NULL,0); // Bad descriptor
-			ws.TestWriteReplyP(win.WsHandle(),EWsWinOpSize,NULL,0,&bad); // Bad descriptor
-			}
-			break;
-		case 2:
-			{
-			TSize size;
-			TPtr8 bad((TUint8 *)&size,4,4); // Short descriptor
-			ws.TestWriteReplyP(win.WsHandle(),EWsWinOpSize,NULL,0,&bad); // Short descriptor
-			}
-			break;
-		case 3:
-			win.EnablePointerMoveBuffer();
-			break;
-		case 4:
-			{
-			RBackedUpWindow backup(ws);
-			backup.Construct(group,EGray16,123);
-			backup.Activate();
-			backup.SetRequiredDisplayMode(EGray16);
-			}
-			break;
-		default:
-			return(EWsExitReasonFinished);
-		}
-	ws.Flush();
-	return(EWsExitReasonBad);	// Should never get here, but it's baaddd if it does
-	}
-
-LOCAL_C TInt CallWindowFuction(RWindowTreeNode* aWin,TInt aWinType,TInt aFunc,RWsSession aWs)
-	{
-	switch(aWinType)
-		{
-	case 0:		//Call functions from RWindowTreeNode
-		{
-		RWindowTreeNode* win=aWin;
-		switch(aFunc)
-			{
-		case 0:
-			win->OrdinalPosition();
-			break;
-		case 1:
-			win->SetOrdinalPosition(1);
-			break;
-		case 2:
-			win->SetOrdinalPosition(1,2);
-			break;
-		case 3:
-			win->FullOrdinalPosition();
-			break;
-		case 4:
-			win->Parent();
-			break;
-		case 5:
-			win->PrevSibling();
-			break;
-		case 6:
-			win->SetFaded(0,RWindowTreeNode::EFadeIncludeChildren);
-			break;
-		case 7:
-			win->WindowGroupId();
-			break;
-		//The following can be called on a window with no parent without panicking
-		case 8:
-			win->ClearPointerCursor();
-			break;
-		case 9:
-			win->ClientHandle();
-			break;
-		case 10:
-			win->DisableErrorMessages();
-			break;
-		case 11:
-			win->DisableFocusChangeEvents();
-			break;
-		case 12:
-			win->DisableGroupChangeEvents();
-			break;
-		case 13:
-			win->DisableGroupListChangeEvents();
-			break;
-		case 14:
-			win->DisableModifierChangedEvents();
-			break;
-		case 15:
-			win->DisableOnEvents();
-			break;
-		case 16:
-			win->DisableVisibilityChangeEvents();
-			break;
-		case 17:
-			win->EnableErrorMessages(EEventControlAlways);
-			break;
-		case 18:
-			win->EnableFocusChangeEvents();
-			break;
-		case 19:
-			win->EnableGroupChangeEvents();
-			break;
-		case 20:
-			win->EnableGroupListChangeEvents();
-			break;
-		case 21:
-			win->EnableModifierChangedEvents(0,EEventControlAlways);
-			break;
-		case 22:
-			win->EnableVisibilityChangeEvents();
-			break;
-		case 23:
-			win->NextSibling();
-			break;
-		case 24:
-			win->OrdinalPriority();
-			break;
-		case 25:
-			win->SetNonFading(0);
-			break;
-		case 26:
-			win->SetPointerCursor(0);
-			break;
-		case 27:
-			win->Child();
-			break;
-		case 28:
-			return(EWsExitReasonFinished);
-		default:;
-			}
-		}
-		break;
-	case 1:		//Call functions from RWindowGroup
-		{
-		RWindowGroup* win=(RWindowGroup*)aWin;
-		switch(aFunc)
-			{
-		case 0:
-			win->EnableReceiptOfFocus(ETrue);
-			break;
-		case 1:
-			win->AutoForeground(ETrue);
-			break;
-		case 2:
-			win->SetOrdinalPriorityAdjust(5);
-			break;
-		case 3:
-			win->CaptureKey(20,0,0);
-			break;
-		case 4:
-			win->CaptureKeyUpAndDowns(20,0,0);
-			break;
-		case 5:
-		case 6:
-			{
-			RWindowGroup group(aWs);
-			group.Construct(876);
-			group.EnableReceiptOfFocus(EFalse);		// Stop auto group switching on close
-			if (aFunc==5)
-				win->CancelCaptureKey(group.CaptureKey(20,0,0));
-			else
-				win->CancelCaptureKeyUpAndDowns(group.CaptureKeyUpAndDowns(20,0,0));
-			}
-			break;
-		case 7:
-			win->AddPriorityKey(20,0,0);
-			break;
-		case 8:
-			win->RemovePriorityKey(20,0,0);
-			break;
-		case 9:
-		case 10:
-			{
-			RWindowGroup group(aWs);
-			group.Construct(765);
-			group.EnableReceiptOfFocus(EFalse);		// Stop auto group switching on close
- 			RWindow window(aWs);
-			window.Construct(group,79);
-			if (aFunc==9)
-				win->SetTextCursor(window,TPoint(45,46),TTextCursor());
-			else
-				win->SetTextCursor(window,TPoint(55,66),TTextCursor(),TRect(TSize(5,8)));
-			}
-			break;
-		case 11:
-			win->CancelTextCursor();
-			break;
-		case 12:
-			win->SetOwningWindowGroup(456);
-			break;
-		case 13:
-			win->DefaultOwningWindow();
-			break;
-		case 14:
-			{
-			TBufC<8> text(_L("abcdef"));
-			win->SetName(text);
-			}
-			break;
-		case 15:
-			{
-			TBuf<16> text;
-			User::LeaveIfError(win->Name(text));
-			}
-			break;
-		case 16:
-			win->Identifier();
-			break;
-		case 17:
-			win->DisableKeyClick(ETrue);
-			break;
-		case 18:
-			/*{
-			TPtr8 text(NULL,0);
-			TUid uid;
-			User::LeaveIfError(win->FetchMessage(uid,text));
-			}*/
-			win->Identifier();
-			break;
-		case 19:
-			User::LeaveIfError(win->EnableScreenChangeEvents());
-			break;
-		case 20:
-			win->EnableScreenChangeEvents();
-			break;
-		case 21:
-			win->DisableScreenChangeEvents();
-			break;
-		case 22:
-			win->SimulatePointerEvent(TRawEvent());
-			break;
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-        case 23: 	
-        	win->SimulateAdvancedPointerEvent(TRawEvent());
-  	  		break;
-        case 24:	
-			return(EWsExitReasonFinished);
-#else
-		case 23:	
-			return(EWsExitReasonFinished);
-#endif			
-		default:;
-			}
-		}
-		break;
-	case 2:					//Call functions from RWindowBase
-		{
-		RWindowBase* win=(RWindowBase*)aWin;
-		switch(aFunc)
-			{
-		case 0:
-			win->SetPosition(TPoint(7,8));
-			break;
-		case 1:
-			User::LeaveIfError(win->SetSizeErr(TSize(21,22)));
-			break;
-		case 2:
-			User::LeaveIfError(win->SetExtentErr(TPoint(8,9),TSize(21,22)));
-			break;
-		case 3:
-			win->ClaimPointerGrab();
-			break;
-		case 4:
-			win->SetVisible(ETrue);
-			break;
-		case 5:
-			win->EnableBackup();
-			break;
-		case 6:
-			win->RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32(100000),TRect());
-			break;
-		case 7:
-			win->PasswordWindow(EPasswordCancel);
-			break;
-		case 8:
-			win->FadeBehind(ETrue);
-			break;
-		//These can all be called on a window with no parent without panicking
-		case 9:
-			win->SetVisible(EFalse);
-			break;
-		case 10:
-			{
-			RWindowGroup group(aWs);
-			group.Construct(567);
-			group.EnableReceiptOfFocus(EFalse);		// Stop auto group switching on close
- 			RWindow window(aWs);
-			window.Construct(group,97);
-			win->InquireOffset(window);
-			}
-			break;
-		case 11:
-			win->PointerFilter(0,0);
-			break;
-		case 12:
-			win->SetPointerGrab(ETrue);
-			break;
-		case 13:
-			win->SetPointerCapture(0);
-			break;
-		case 14:
-			win->Size();
-			break;
-		case 15:
-			win->Position();
-			break;
-		case 16:
-			User::LeaveIfError(win->SetCornerType(EWindowCorner5,0));
-			break;
-		case 17:
-			{
-			TRegionFix<3> region;
-			User::LeaveIfError(win->SetShape(region));
-			}
-			break;
-		case 18:
-			User::LeaveIfError(win->SetRequiredDisplayMode(EColor16));
-			break;
-		case 19:
-			win->DisplayMode();
-			break;
-		case 20:
-			win->CancelPointerRepeatEventRequest();
-			break;
-		case 21:
-			win->AllocPointerMoveBuffer(10,0);
-			break;
-		case 22:
-			win->FreePointerMoveBuffer();
-			break;
-		case 23:
-			win->DisablePointerMoveBuffer();
-			break;
-		case 24:
-			{
-			TBuf8<16> buf;
-			win->RetrievePointerMoveBuffer(buf);
-			}
-			break;
-		case 25:
-			win->DiscardPointerMoveBuffer();
-			break;
-		case 26:
-			User::LeaveIfError(win->AddKeyRect(TRect(TSize(10,10)),20,ETrue));
-			break;
-		case 27:
-			win->RemoveAllKeyRects();
-			break;
-		case 28:
-			win->EnablePointerMoveBuffer();
-			break;
-		case 29:
-			return(EWsExitReasonFinished);
-		default:;
-			}
-		}
-		break;
-	case 3:					//Call functions from RDrawableWindow
-		{
-		RDrawableWindow* win=(RDrawableWindow*)aWin;
-		switch(aFunc)
-			{
-		//The following can be called on a window with no parent without panicking
-		case 0:
-			win->Scroll(TPoint(7,8));
-			break;
-		case 1:
-			win->Scroll(TRect(9,10,11,12),TPoint(13,14));
-			break;
-		case 2:
-			win->Scroll(TPoint(15,16),TRect(17,18,19,20));
-			break;
-		case 3:
-			win->Scroll(TRect(21,22,23,24),TPoint(25,26),TRect(27,28,29,30));
-			break;
-		case 4:
-			return(EWsExitReasonFinished);
-		default:;
-			}
-		}
-		break;
-	case 4:					//Call functions from RBlankWindow
-		{
-		RBlankWindow* win=(RBlankWindow*)aWin;
-		switch(aFunc)
-			{
-		case 0:
-			win->SetSize(TSize(7,8));
-			break;
-		case 1:
-			win->SetExtent(TPoint(27,28),TSize(17,18));
-			break;
-		//The following function can be called on a window with no parent without panicking
-		case 2:
-			win->SetColor(TRgb::Gray4(2));
-			break;
-		case 3:
-			return(EWsExitReasonFinished);
-		default:;
-			}
-		}
-		break;
-	case 5:					//Call functions from RWindow
-		{
-		RWindow* win=(RWindow*)aWin;
-		switch(aFunc)
-			{
-		case 0:
-			win->BeginRedraw();
-			break;
-		case 1:
-			aWs.SetAutoFlush(ETrue);
-			win->BeginRedraw(TRect(31,32,43,44));
-			aWs.SetAutoFlush(EFalse);
-			break;
-		case 2:
-			win->SetSize(TSize(5,6));
-			break;
-		case 3:
-			win->SetExtent(TPoint(25,26),TSize(15,16));
-			break;
-		//The following can be called on a window with no parent without panicking
-		case 4:
-			win->Invalidate();
-			break;
-		case 5:
-			win->Invalidate(TRect(51,52,63,64));
-			break;
-		case 6:			//These ones don't panic
-			aWs.SetAutoFlush(ETrue);
-			win->EndRedraw();
-			aWs.SetAutoFlush(EFalse);
-			break;
-		case 7:
-			{
-			RRegion region;
-			win->GetInvalidRegion(region);
-			}
-			break;
-		case 8:
-			win->SetBackgroundColor(TRgb::Gray4(1));
-			break;
-		case 9:
-			win->SetBackgroundColor();
-			break;
-		case 10:
-			return(EWsExitReasonFinished);
-		default:;
-			}
-		}
-		break;
-	case 6:					//Call functions from RBackedUpWindow
-		{
-		RBackedUpWindow* win=(RBackedUpWindow*)aWin;
-		switch(aFunc)			//None of these functions panic
-			{
-		//The following can be called on a window with no parent without panicking
-		case 0:
-			win->BitmapHandle();
-			break;
-		case 1:
-			win->UpdateBackupBitmap();
-			break;
-		case 2:
-			win->MaintainBackup();
-			break;
-		case 3:
-			win->UpdateScreen();
-			break;
-		case 4:
-			win->UpdateScreen(TRegionFix<1>(TRect(1,1,22,22)));
-			break;
-		case 5:
-			return(EWsExitReasonFinished);
-		default:;
-			}
-		}
-		break;
-		}
-	aWs.Flush();
-	return(EWsExitReasonBad);	// Should never get here, but it's baaddd if it does
-	}
-
-LOCAL_C TInt DoPanicTest3(TInt aInt, TAny *aScreenNumber)
-	{
-	TInt winType=aInt/CTWindowTest::EWinTypeFactor;
-	TInt func=aInt%CTWindowTest::EWinTypeFactor;
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	// use correct screen
-	//
-	CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws);
-	User::LeaveIfError(screen->Construct((TInt)aScreenNumber));
-
-	RWindowGroup group(ws);
-	group.Construct(888);
-	group.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
- 	RWindow window(ws);
-	window.Construct(group,789);
-	RWindowTreeNode* win;
-	if (winType==1)
-		win=&window;
-	else
-		win=&group;
-
-	return CallWindowFuction(win,winType,func,ws);
-	}
-
-//PanicTestNoPanic
-//This function is called from DoPanicTest4 for window functions that should run without
-//panicking the user thread if its parent has been deleted.
-TInt PanicTestNoPanic(RWindowTreeNode* aWin,TInt aWinType,TInt aFunc,RWsSession aWs,const TInt* const aFuncToSkip)
-	{
-	TInt funcReturn;
-	for(;;)
-		{
-		if (aFuncToSkip && *aFuncToSkip == aFunc)
-			{
-			aFunc++;
-			}
-		funcReturn = CallWindowFuction(aWin,aWinType,aFunc,aWs);
-		if (funcReturn==EWsExitReasonBad)
-			{
-			aFunc++;
-			}
-		else if (funcReturn==EWsExitReasonFinished)
-			{
-			return EWsExitReasonFinished;
-			}
-		else
-			{
-			return EWsExitReasonBad;
-			}
-		}
-	}
-
-LOCAL_C TInt DoPanicTest4(TInt aInt, TAny *aScreenNumber)
-	{
- 	TInt winType=aInt/CTWindowTest::EWinTypeFactor;
-	TInt func=aInt%CTWindowTest::EWinTypeFactor;
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	// use correct screen
-	//
-	CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws);
-	User::LeaveIfError(screen->Construct((TInt)aScreenNumber));
-
-	RWindowGroup group(ws);
-	group.Construct(234);
-	group.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
- 	RWindow window(ws);
-	window.Construct(group,897);
-	RBackedUpWindow backedUp(ws);
-	backedUp.Construct(group,EGray16,98);
-	RBlankWindow blank(ws);
-	blank.Construct(group,169);
-	RWindowTreeNode* win=&window;
-	switch (winType)
-		{
-	case 0:
-		{
-		if (func > 8)			//if a func 8+ had panicked, fail the test
-			{
-			return EWsExitReasonBad;
-			}
-		else if (func==8)
-			{
-			group.Close();
-			return PanicTestNoPanic(win,winType,func,ws,NULL);
-			}
-		}
-		break;
-	case 2:
-		{
-		if (func>9)			//if a func 9+ had panicked, fail the test
-			{
-			return EWsExitReasonBad;
-			}
-		else if (func==9)	//set window visible so that SetVisible(EFalse) (func 9) would crash before fix
-			{
-			window.SetVisible(ETrue);
-			ws.Flush();
-			group.Close();
-			TInt funcToSkip = 28;	//this call needs to have already successfully allocated a pointer cursor
-			return PanicTestNoPanic(win,winType,func,ws,&funcToSkip);
-			}
-		}
-		break;
-	case 4:
-		{
-		win=&blank;
-		if (func>2)			//if a func 2+ had panicked, fail the test
-			{
-			return EWsExitReasonBad;
-			}
-		else if (func==2)
-			{
-			group.Close();
-			return PanicTestNoPanic(win,winType,func,ws,NULL);
-			}
-		}
-		break;
-	case 5:
-		{
-		if (func>6)			//if a func 4+ had panicked, fail the test
-			{
-			return EWsExitReasonBad;
-			}
-		else if (func==4 || func==5)
-			{
-			if (CallWindowFuction(win,winType,func,ws)==EWsExitReasonBad)
-				{
-				func = 1;
-				}
-			else
-				{
-				return EWsExitReasonBad;
-				}
-			}
-		else if (func==6)
-			{
-			group.Close();
-			TInt funcToSkip = 6;	//Skip the call to EndRedraw in CallWindowFunction, it is not safe to call it on Window casts.
-			return PanicTestNoPanic(win,winType,func,ws,&funcToSkip);
-			}
-		}
-		break;
-	case 6:
-		{
-		win=&backedUp;
-		if (func>0)
-			return EWsExitReasonBad;
-		else		//if (func==0)
-			{
-			TInt end=2;
-			while (func==0)
-				{
-				group.Close();
-				while (CallWindowFuction(win,winType,func,ws)==EWsExitReasonBad && ++func<end)
-					{}
-				if (func==end && end==2)
-					{
-					func=0;
-					end=4;
-					}
-				}
-			if (func==end)
-				return EWsExitReasonFinished;
-			else
-				return EWsExitReasonBad;
-			}
-		}
-		/*break;*/
-	default:;
-		}
-	group.Close();
-	return CallWindowFuction(win,winType,func,ws);
-	}
-
-LOCAL_C TInt DoPanicTest5(TInt aTest, TAny *aScreenNumber)
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-
-	CWsScreenDevice *scrDev=new(ELeave) CWsScreenDevice(ws);
-	scrDev->Construct((TInt)aScreenNumber);
-
-	RWindowGroup group(ws);
-	group.Construct(235);
-	group.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
- 	RWindow window(ws);
-	window.Construct(group,896);
-	CWindowGc *gc=new(ELeave) CWindowGc(scrDev);
-	gc->Construct();
-	gc->Activate(window);
-	group.Close();
-	switch (aTest)
-		{
-	case 0:
-		gc->Deactivate();
-		gc->Activate(window);
-		break;
-	case 1:
-		gc->DrawLine(TPoint(0,0),TPoint(10,10));
-		break;
-	default:
-		return(EWsExitReasonFinished);
-		}
-	ws.Flush();
-	return(EWsExitReasonBad);	// Should never get here, but it's baaddd if it does
-	}
-
-#if defined(_DEBUG)
-LOCAL_C TInt DoPanicTest6(TInt /*aInt*/, TAny *aScreenNumber)
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	RWindowGroup group1(ws);
-	CWsScreenDevice* screen=new(ELeave) CWsScreenDevice(ws);
-	User::LeaveIfError(screen->Construct((TInt)aScreenNumber));
-	group1.Construct(123456,ETrue,screen);
-	RWindowGroup group2(ws);
-	group2.Construct(123456,ETrue,screen);	// Should panic client here
-	return(EWsExitReasonBad);	// Should never get here
-	}
-#endif
-
-void CTWindowTest::TestInvalidFunctionsL()
-//
-// This code casts windows to be different types and then sends messages for the 'cast' that
-// should not be sent to the original type of window. These should all result in panics
-//
-	{
-	static TClientPanic PanicCode[]={EWservPanicDescriptor,EWservPanicDescriptor,EWservPanicDescriptor,
-									 EWservPanicNoPointerBuffer,EWservPanicBackupDisplayMode,
-									 EWservPanicNoFont};	// Dummy end value to catch out overflowing the array
-	INFO_PRINTF1(_L("AUTO  Test Invalid Functions "));
-	INFO_PRINTF1(_L(" Opcode Panics"));
-
-	for (TInt source=0;source<3;source++)
-		for (TInt target=0;target<3;target++)
-			if (source!=target)
-				for (TInt panic=0;;panic++)
-					{
-					TBool testFinished=EFalse;
-					TEST(iTest->TestWsPanicL(DoPanicTest,EWservPanicOpcode,source*10000+target*100+panic,(TAny*)iTest->iScreenNumber,&testFinished));
-					if (testFinished)
-						break;
-					}
-	_LIT(KSet,"Various Different Panics");
-	INFO_PRINTF1(KSet);
-	RDebug::Print(KPlatsecBegin);
-	for(TInt index=0;;index++)
-		{
-		TBool testFinished=EFalse;
-		TEST(iTest->TestWsPanicL(DoPanicTest2,PanicCode[index],index,(TAny*)iTest->iScreenNumber,&testFinished));
-		if (testFinished)
-			break;
-		}
-	RDebug::Print(KPlatsecEnd);
-	iTest->CloseAllPanicWindows();
-	}
-
-void CTWindowTest::ShadowAutoClearTest()
-	{
-	RWindowGroup group(TheClient->iWs);
-	group.Construct(1111);
-	group.EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
-
-	RWindow background(TheClient->iWs);
-	background.Construct(group,133);
-	background.SetBackgroundColor();
-	background.Activate();
-
-	background.BeginRedraw();
-	TheClient->iGc->Activate(background);
-	TheClient->iGc->SetBrushColor(TRgb::Gray4(1));
-	TheClient->iGc->Clear();
-	background.EndRedraw();
-//
-	RBlankWindow tab2(TheClient->iWs);
-	tab2.Construct(group,144);
-	tab2.SetExtent(TPoint(10,00),TSize(200,10));
-	tab2.SetColor(TRgb::Gray256(170));
-	tab2.SetShadowHeight(1);
-	tab2.Activate();
-	RBlankWindow tab1(TheClient->iWs);
-	tab1.Construct(group,155);
-	tab1.SetExtent(TPoint(70,00),TSize(10,10));
-	tab1.SetColor(TRgb::Gray256(170));
-	tab1.SetShadowHeight(1);
-	tab1.Activate();
-	RBlankWindow blank(TheClient->iWs);
-	blank.Construct(group,156);
-	blank.SetExtent(TPoint(50,10),TSize(100,100));
-	blank.SetColor(TRgb::Gray256(170));
-	blank.SetShadowHeight(0);
-	blank.Activate();
-//
-	tab1.Close();
-	tab1.Construct(group,166);
-	tab1.SetExtent(TPoint(50,00),TSize(10,10));
-	tab1.SetColor(TRgb::Gray256(170));
-	tab1.SetShadowHeight(1);
-	tab1.Activate();
-	blank.Close();
-	RBlankWindow blank2(TheClient->iWs);
-	blank2.Construct(group,177);
-	blank2.SetColor(TRgb::Gray256(255));
-	blank2.SetExtent(TPoint(10,10),TSize(100,120));
-	blank2.SetShadowHeight(2);
-	blank2.Activate();
-	TheClient->iWs.Flush();
-//
-	background.BeginRedraw();
-	TheClient->iGc->SetBrushColor(TRgb::Gray4(1));
-	TheClient->iGc->Clear();
-	background.EndRedraw();
-//
-	tab1.Close();
-	tab2.Close();
-	blank2.Close();
-	background.BeginRedraw();
-	TheClient->iGc->Clear();
-	TheClient->iGc->Deactivate();
-	background.EndRedraw();
-	TheClient->iWs.Finish();
-	TSize size=TheClient->iScreen->SizeInPixels();
-	TBool rectCompare = TheClient->iScreen->RectCompare(TRect(0,0,size.iWidth>>1,size.iHeight),TRect(size.iWidth>>1,0,(size.iWidth>>1)<<1,size.iHeight));	
-	TEST(rectCompare);
-	if(!rectCompare)
-		INFO_PRINTF3(_L("TheClient->iScreen->RectCompare return value - Expected: %d, Actual: %d"), ETrue, rectCompare);
-	background.Close();
-	group.Close();
-	}
-
-void CTWindowTest::ClearRedraw(RWindow &aWindow, TRgb aRgb)
-	{
-	aWindow.BeginRedraw();
-	TheClient->iGc->Activate(aWindow);
-	TheClient->iGc->SetBrushColor(aRgb);
-	TheClient->iGc->Clear();
-	TheClient->iGc->Deactivate();
-	aWindow.EndRedraw();
-	}
-
-void CTWindowTest::CheckCorner(TCorner aCorner, const TInt *aInsetList)
-	{
-	TRect rect(TPoint(1,1),iBlankWin2->Size());
-	TPoint pos;
-	TInt direction;
-	if (aCorner==ECornerTL || aCorner==ECornerTR)
-		{
-		pos.iY=rect.iTl.iY;
-		direction=1;
-		}
-	else
-		{
-		pos.iY=rect.iBr.iY-1;
-		direction= -1;
-		}
-	if (aCorner==ECornerTL || aCorner==ECornerBL)
-		pos.iX=rect.iTl.iX;
-	else
-		pos.iX=rect.iBr.iX-8;
-	TRgb rgbBuf[8];
-	TPtr8 desc((TUint8 *)rgbBuf,sizeof(rgbBuf));
-	for(TInt count=0;count<ENumCornerInsets;count++,pos.iY+=direction)
-		{
-		iScreenDev->GetScanLine(desc,pos,8,EColor16MA);
-		if (aCorner==ECornerTR || aCorner==ECornerBR)
-			{
-			for(TInt loop=0;loop<4;loop++)
-				{
-				TRgb tmp=rgbBuf[loop];
-				rgbBuf[loop]=rgbBuf[8-1-loop];
-				rgbBuf[8-1-loop]=tmp;
-				}
-			}
-		// We can't compare rgb value from original source against screen value in EColor64K mode as
-		// the color component might be truncated (EColor64K is 16-bit using format RGB565),
-		// ie R or B components might be reduced from 8-bit to 5-bit and G from 8-bit to 6-bit
-		//
-		// For example: RGB value of Gray4(1) is 0x555555, it is drawn to screen in RGB565 as 0x52AA,
-		// when it's converted back to RGB for comparison, the value becomes 0x525552
-		TRgb col1=TRgb::Gray4(1);
-		TRgb col2=TRgb::Gray4(3);
-		if (iScreenDev->DisplayMode()==EColor64K)
-			{
-			col1=TRgb::Color64K(col1.Color64K());
-			col2=TRgb::Color64K(col2.Color64K());
-			}
-		TInt loop2=0;
-		for(;loop2<aInsetList[count];loop2++)
-			{	
-			TEST(rgbBuf[loop2]==col1);				
-			}
-		for(;loop2<8;loop2++)
-			{		
-			TEST(rgbBuf[loop2]==col2);
-			}
-		}
-	}
-
-void CTWindowTest::doCornerTest(TCornerType aCornerType, TInt aFlags)
-	{
-	const TInt *corners=corner0;
-	switch(aCornerType)
-		{
-		case EWindowCorner1:
-			corners=corner1;
-			break;
-		case EWindowCorner2:
-			corners=corner2;
-			break;
-		case EWindowCorner3:
-			corners=corner3;
-			break;
-		case EWindowCorner5:
-			corners=corner5;
-			break;
-		default:
-			break;
-		}
-	iBlankWin2->BaseWin()->SetCornerType(aCornerType,aFlags);
-	if (!(aFlags&EWindowCornerNotTL))
-		CheckCorner(ECornerTL, corners);
-	if (!(aFlags&EWindowCornerNotTR))
-		CheckCorner(ECornerTR, corners);
-	if (!(aFlags&EWindowCornerNotBL))
-		CheckCorner(ECornerBL, corners);
-	if (!(aFlags&EWindowCornerNotBR))
-		CheckCorner(ECornerBR, corners);
-//
-	if (aFlags&EWindowCornerNotTL)
-		CheckCorner(ECornerTL, corner0);
-	if (aFlags&EWindowCornerNotTR)
-		CheckCorner(ECornerTR, corner0);
-	if (aFlags&EWindowCornerNotBL)
-		CheckCorner(ECornerBL, corner0);
-	if (aFlags&EWindowCornerNotBR)
-		CheckCorner(ECornerBR, corner0);
-	}
-
-void CTWindowTest::doCornerTestsL()
-	{
-	iScreenDev=new(ELeave) CWsScreenDevice(TheClient->iWs);
-	User::LeaveIfError(iScreenDev->Construct(iTest->iScreenNumber));
-	iBlankWin1=new(ELeave) CTBlankWindow();
-	iBlankWin1->SetUpL(TPoint(1,1),TSize(100,50),TheClient->iGroup,*TheClient->iGc);
-	iBlankWin1->SetColor(TRgb::Gray4(1));
-	iBlankWin2=new(ELeave) CTBlankWindow();
-	iBlankWin2->SetUpL(TPoint(1,1),iBlankWin1->Size(),TheClient->iGroup,*TheClient->iGc);
-	iBlankWin2->SetColor(TRgb::Gray4(3));
-	iBlankWin2->BaseWin()->SetShadowHeight(0);
-	doCornerTest(EWindowCornerSquare,0);
-	doCornerTest(EWindowCornerSquare,EWindowCornerNotBL);
-	doCornerTest(EWindowCorner1,0);	// 0 + all corners missing
-	doCornerTest(EWindowCorner1,EWindowCornerNotTL|EWindowCornerNotTR|EWindowCornerNotBL|EWindowCornerNotBR);
-	doCornerTest(EWindowCorner2,0);	// 0 + all sets of 3 corners missing
-	doCornerTest(EWindowCorner2,EWindowCornerNotTR|EWindowCornerNotBL|EWindowCornerNotBR);
-	doCornerTest(EWindowCorner2,EWindowCornerNotTL|EWindowCornerNotBL|EWindowCornerNotBR);
-	doCornerTest(EWindowCorner2,EWindowCornerNotTL|EWindowCornerNotTR|EWindowCornerNotBR);
-	doCornerTest(EWindowCorner2,EWindowCornerNotTL|EWindowCornerNotTR|EWindowCornerNotBL);
-	doCornerTest(EWindowCorner3,0);	// 0 + all 4 individual corners missing
-	doCornerTest(EWindowCorner3,EWindowCornerNotTL);
-	doCornerTest(EWindowCorner3,EWindowCornerNotTR);
-	doCornerTest(EWindowCorner3,EWindowCornerNotBL);
-	doCornerTest(EWindowCorner3,EWindowCornerNotBR);
-	doCornerTest(EWindowCorner5,0);	// 0 + all pairs of corners missing
-	doCornerTest(EWindowCorner5,EWindowCornerNotTL|EWindowCornerNotTR);
-	doCornerTest(EWindowCorner5,EWindowCornerNotTL|EWindowCornerNotBL);
-	doCornerTest(EWindowCorner5,EWindowCornerNotTL|EWindowCornerNotBR);
-	doCornerTest(EWindowCorner5,EWindowCornerNotTR|EWindowCornerNotBL);
-	doCornerTest(EWindowCorner5,EWindowCornerNotTR|EWindowCornerNotBR);
-	doCornerTest(EWindowCorner5,EWindowCornerNotBL|EWindowCornerNotBR);
-	}
-
-void CTWindowTest::CornerTests()
-	{
-	TRAP_IGNORE(doCornerTestsL());
-	delete iBlankWin2;
-	delete iBlankWin1;
-	delete iScreenDev;
-	}
-
-LOCAL_C void doMegaTreeThread(TInt aScreenNumber)
-	{
-	CTrapCleanup::New();
-	RWsSession ws;
-	ws.Connect();
-	CWsScreenDevice *scrDev=new(ELeave) CWsScreenDevice(ws);
-	scrDev->Construct(aScreenNumber);
-	RWindowGroup group(ws);
-	group.Construct(1);
-	group.EnableReceiptOfFocus(EFalse);
-	RWindow parent(ws);
-	parent.Construct(group,123);
-	parent.Activate();
-	CWindowGc *gc=new(ELeave) CWindowGc(scrDev);
-	gc->Construct();
-	TSize max(parent.Size());
-	RWindow prev=parent;
-	TBool horiz=EFalse;
-	TInt color=0;
-	for(TInt count=0;count<100;count++)
-		{
-		RWindow win(ws);
-		if (win.Construct(prev,ENullWsHandle)!=KErrNone)
-			break;
-		win.SetExtent(horiz?TPoint(1,0):TPoint(0,1),max);
-		win.SetBackgroundColor(TRgb::Gray4(color));
-		color=(color+1)%4;
-		win.Activate();
-		win.BeginRedraw();
-		gc->Activate(win);
-		gc->Clear();
-		gc->Deactivate();
-		win.EndRedraw();
-		prev=win;
-		horiz=!horiz;
-		}
-	parent.SetVisible(EFalse);
-	parent.SetVisible(ETrue);
-	parent.SetPosition(TPoint(-1,-1));
-	parent.SetPosition(TPoint(0,0));
-	parent.Close();
-	ws.Close();
-	}
-
-LOCAL_C TInt MegaTreeThread(TAny *aScreenNumber)
-	{
-	TRAPD(err,doMegaTreeThread((TInt)aScreenNumber));
-	return(err);
-	}
-
-void CTWindowTest::CreateMegaTree()
-	{
-	const TUint KThreadHeapSize=0x2000;
-	RThread thread;
-	if (thread.Create(_L("MegaTree"),MegaTreeThread,KDefaultStackSize,KThreadHeapSize,KThreadHeapSize,(TAny*)iTest->iScreenNumber,EOwnerThread)==KErrNone)
-		{
-		TRequestStatus stat;
-		thread.Logon(stat);
-		thread.Resume();
-		User::WaitForRequest(stat);		
-		TEST(stat==KErrNone);
-		}
-	thread.Close();
-	}
-
-void CTWindowTest::TiledWindowTestL()
-	{
-	RWindow parent(TheClient->iWs);
-	User::LeaveIfError(parent.Construct(*TheClient->iGroup->GroupWin(),ENullWsHandle));
-	CleanupStack::PushL(TCleanupItem(CleanUpWindow,&parent));
-	parent.SetExtent(TPoint(10,10),TSize(50,50));
-	parent.Activate();
-//
-	RWindow child1(TheClient->iWs);
-	User::LeaveIfError(child1.Construct(parent,ENullWsHandle));
-	CleanupStack::PushL(TCleanupItem(CleanUpWindow,&child1));
-	child1.SetExtent(TPoint(0,0),TSize(50,20));
-	child1.Activate();
-//
-	RWindow child2(TheClient->iWs);
-	User::LeaveIfError(child2.Construct(parent,ENullWsHandle));
-	CleanupStack::PushL(TCleanupItem(CleanUpWindow,&child2));
-	child2.SetExtent(TPoint(0,20),TSize(50,30));
-	child2.Activate();
-//
-	child1.BeginRedraw();
-	TSize rect1Size(25,20);
-	TheGc->Activate(child1);
-	TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TheGc->DrawRect(TRect(rect1Size));
-	TheGc->DrawRect(TRect(TPoint(rect1Size.iWidth,0),rect1Size));
-	TheGc->Deactivate();
-	child1.EndRedraw();
-//
-	child2.BeginRedraw();
-	TSize rect2Size(25,30);
-	TheGc->Activate(child2);
-	TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TheGc->DrawRect(TRect(rect2Size));
-	TheGc->DrawRect(TRect(TPoint(rect2Size.iWidth,0),rect2Size));
-	TheGc->Deactivate();
-	child2.EndRedraw();
-//
-// Left and right halves should be identical
-//
-	TBool rectCompare = !TheClient->iScreen->RectCompare(TRect(10,10,35,60),TRect(35,10,70,60));	
-	TEST(rectCompare);
-	if(!rectCompare)
-		INFO_PRINTF3(_L("TheClient->iScreen->RectCompare return value - Expected: %d, Actual: %d"), ETrue, rectCompare);
-//
-	CleanupStack::PopAndDestroy(3);
-	}
-
-void CTWindowTest::TiledWindowTest2L()
-	{
-	TSize size(200,240);		//Parent Windows
-	TSize childSize(TSize(size.iWidth/2,size.iHeight/2));		//Child Windows
-	TSize dialogueSize(50,50);
-
-	TheClient->iWs.SetAutoFlush(ETrue);
-	RBlankWindow parent1(TheClient->iWs);
-	User::LeaveIfError(parent1.Construct(*TheClient->iGroup->GroupWin(),ENullWsHandle));
-	CleanupStack::PushL(TCleanupItem(CleanUpWindow,&parent1));
-	parent1.SetExtent(TPoint(240,0),size);
-	parent1.SetColor(TRgb::Gray4(2));
-	parent1.Activate();
-
-	TheClient->iWs.SetAutoFlush(ETrue);
-	RBlankWindow parent2(TheClient->iWs);
-	User::LeaveIfError(parent2.Construct(*TheClient->iGroup->GroupWin(),ENullWsHandle));
-	CleanupStack::PushL(TCleanupItem(CleanUpWindow,&parent2));
-	parent2.SetExtent(TPoint(440,0),size);
-	parent2.SetColor(TRgb::Gray4(2));
-	parent2.Activate();
-
-	TheClient->iWs.SetAutoFlush(ETrue);
-	RBlankWindow child1(TheClient->iWs);
-	User::LeaveIfError(child1.Construct(parent1,ENullWsHandle));
-	CleanupStack::PushL(TCleanupItem(CleanUpWindow,&child1));
-	child1.SetExtent(TPoint(0,0),childSize);
-	child1.SetColor(TRgb::Gray4(2));
-	child1.Activate();
-
-	TheClient->iWs.SetAutoFlush(ETrue);
-	RBlankWindow child2(TheClient->iWs);
-	User::LeaveIfError(child2.Construct(parent1,ENullWsHandle));
-	CleanupStack::PushL(TCleanupItem(CleanUpWindow,&child2));
-	child2.SetExtent(TPoint(0,childSize.iHeight),childSize);
-	child2.SetColor(TRgb::Gray4(2));
-	child2.Activate();
-
-	TheClient->iWs.SetAutoFlush(ETrue);
-	RBlankWindow child3(TheClient->iWs);
-	User::LeaveIfError(child3.Construct(parent1,ENullWsHandle));
-	CleanupStack::PushL(TCleanupItem(CleanUpWindow,&child3));
-	child3.SetExtent(TPoint(childSize.iWidth,0),TSize(childSize.iWidth,size.iHeight));
-	child3.SetColor(TRgb::Gray4(2));
-	child3.Activate();
-
-	TPoint dialoguePos(375,93);
-	TheClient->iWs.SetAutoFlush(ETrue);
-	RBlankWindow dialog1(TheClient->iWs);
-	User::LeaveIfError(dialog1.Construct(*TheClient->iGroup->GroupWin(),ENullWsHandle));
-	CleanupStack::PushL(TCleanupItem(CleanUpWindow,&dialog1));
-	dialog1.SetExtent(dialoguePos,dialogueSize);
-	dialog1.SetColor(TRgb::Gray4(3));
-	dialog1.SetShadowHeight(4);
-	dialog1.Activate();
-
-	TheClient->iWs.SetAutoFlush(ETrue);
-	RBlankWindow dialog2(TheClient->iWs);
-	User::LeaveIfError(dialog2.Construct(*TheClient->iGroup->GroupWin(),ENullWsHandle));
-	CleanupStack::PushL(TCleanupItem(CleanUpWindow,&dialog2));
-	dialog2.SetExtent(TPoint(dialoguePos.iX+size.iWidth,dialoguePos.iY),dialogueSize);
-	dialog2.SetColor(TRgb::Gray4(3));
-	dialog2.SetShadowHeight(0);
-	dialog2.Activate();
-
-	TInt ii;
-	for (ii=400;ii>374;ii-=25)
-		dialog1.SetPosition(TPoint(ii,93));
-	TheClient->iWs.SetAutoFlush(EFalse);
-	CleanupStack::PopAndDestroy(7);
-	}
-
-void CTWindowTest::ColorTestL()
-	{
-	if (iTest->MaxGrays() == 0)
-		return;
-
-	_LIT(KSet,"AUTO  Color Test ");
-	INFO_PRINTF1(KSet);
-	RWindow window(TheClient->iWs);
-	User::LeaveIfError(window.Construct(*TheClient->iGroup->GroupWin(),ENullWsHandle));
-	PushWindowL(&window);
-	window.SetExtent(TPoint(10,10),TSize(50,50));
-	window.Activate();
-	TInt colorMode,mode;
-	TInt currentMode=TheClient->iScreen->DisplayMode();	
-	TEST(currentMode==EGray4 || currentMode==EColor16 || currentMode==EColor256 || currentMode == EColor64K);
-	if(currentMode!=EGray4 && currentMode!=EColor16 && currentMode!=EColor256 && currentMode != EColor64K)
-		INFO_PRINTF5(_L("TheClient->iScreen->DisplayMode() return value - Expected: %d or %d or %d, Actual: %d"), EGray4, EColor16, EColor256, currentMode);
-	INFO_PRINTF1(_L(" Done Setup"));
-	for(colorMode=EGray4;colorMode<EColorLast;colorMode++)
-		{
-		INFO_PRINTF1(_L(" Loop 1"));
-		if (colorMode==ERgb || (colorMode==EGray256 && TDisplayModeUtils::IsDisplayModeColor(REINTERPRET_CAST(TDisplayMode&,currentMode))) ||  (colorMode==EGray256 && TDisplayModeUtils::IsDisplayModeColor(REINTERPRET_CAST(TDisplayMode&,currentMode))) )
-			continue;
-		User::LeaveIfError(window.SetRequiredDisplayMode((TDisplayMode&)colorMode));
-		mode=window.DisplayMode();
-		if (!(mode==currentMode || mode==colorMode))
-			{
-			_LIT(KModes," Failed in Loop1  SetTo=%d, Actual=%d, Current=%d");
-			TBuf<64> log;
-			log.Format(KModes,colorMode,mode,currentMode);
-			INFO_PRINTF1(log);
-			}
-		if (mode>ERgb && colorMode==EColor64K)
-			break;	
-		TEST(mode==currentMode || mode==colorMode );
-		if (mode!=currentMode && mode!=colorMode)
-			INFO_PRINTF4(_L("window.DisplayMode() return value - Expected: %d or %d, Actual: %d"), currentMode, colorMode, mode);
-		INFO_PRINTF1(_L(" Loop 2"));
-		if (mode>currentMode)
-			currentMode=mode;
-		if (colorMode==EColor16)
-			window.SetSize(TSize(40,60));
-		else if (colorMode==EColor4K)
-			window.SetSize(TSize(60,40));
-		mode=TheClient->iScreen->DisplayMode();
-		if(TDisplayModeUtils::NumDisplayModeColors(STATIC_CAST(TDisplayMode,currentMode))==16777216)
-			{
-			TEST(mode==CFbsDevice::DisplayMode16M());
-			if (mode!=CFbsDevice::DisplayMode16M())
-				INFO_PRINTF3(_L("window.DisplayMode() return value - Expected: %d, Actual: %d"), CFbsDevice::DisplayMode16M(), mode);
-			}
-		else
-			{		
-			TEST(currentMode==mode || currentMode==colorMode);
-			if (currentMode!=mode && currentMode!=colorMode)
-				INFO_PRINTF3(_L("TheClient->iScreen->DisplayMode() return value  return value - Expected: %d , Actual: %d"), currentMode, mode);
-			}
-		}
-	INFO_PRINTF1(_L(" Done First Loop"));
-	TInt color,gray;
-	TDisplayMode defMode=TheClient->iWs.GetDefModeMaxNumColors(color,gray);
-	TInt screenNo =TheClient->iScreen->GetScreenNumber();
-	TDisplayMode defModeForScreen=TheClient->iWs.GetDefModeMaxNumColors(screenNo,color,gray); 
-	TEST(defMode==defModeForScreen);
-	if (defMode!=defModeForScreen)
-		INFO_PRINTF3(_L("TheClient->iScreen->DisplayMode() return value  return value - Expected: %d , Actual: %d"), defMode, defModeForScreen);
-	if (color==16777216 && gray==256)
-		{		
-		TEST(defMode==EGray4 || defMode==EColor256 || defMode==EColor64K);		//WINS
-		if (defMode!=EGray4 && defMode!=EColor256 && defMode != EColor64K)
-			INFO_PRINTF4(_L("TheClient->iWs.GetDefModeMaxNumColors(color,gray) return value  return value - Expected: %d or %d, Actual: %d"), EGray4, EColor256, defMode);
-		}
-	else
-		{
-		if (color==0 && gray==16)
-			{		
-			TEST(defMode==EGray4);		//S5 family
-			if (defMode!=EGray4)
-				INFO_PRINTF3(_L("TheClient->iScreen->DisplayMode() return value  return value - Expected: %d , Actual: %d"), EGray4, defMode);
-			}
-		else
-			{
-			TLogMessageText buf;
-			_LIT(KColorSettings,"##Data  Most Colors=%d, Most Greys=%d, DefMode=%d");
-			buf.Format(KColorSettings,color,gray,defMode);
-			TheClient->iWs.LogMessage(buf);
-			TheClient->iWs.Flush();		
-			TEST(defMode==EGray4 || defMode==EColor256);
-			if (defMode!=EGray4 && defMode!=EColor256)
-				INFO_PRINTF4(_L("TheClient->iWs.GetDefModeMaxNumColors(color,gray) return value  return value - Expected: %d or %d, Actual: %d"), EGray4, EColor256, defMode);
-			}
-		}
-	CArrayFixFlat<TInt> *colorModes=new(ELeave) CArrayFixFlat<TInt>(1);
-	CleanupStack::PushL(colorModes);
-	User::LeaveIfError(TheClient->iWs.GetColorModeList(screenNo,colorModes));
-	TDisplayMode mostColor=ENone;
-	TDisplayMode lastGray=ENone;
-	TDisplayMode dispMode;
-	TInt ii;
-	TInt colorModes16M = 0;
-	INFO_PRINTF1(_L(" Done Setup 2"));
-	for (ii=0;ii<colorModes->Count();ii++)
-		{
-		dispMode=(TDisplayMode)(*colorModes)[ii];	
-		TEST(dispMode!=ERgb);
-		if (dispMode==ERgb)
-			INFO_PRINTF3(_L("(TDisplayMode)(*colorModes)[i] return value - Not Expected: %d , Actual: %d"), ERgb, dispMode);	
-		TEST(dispMode!=ENone);
-		if (dispMode==ENone)
-			INFO_PRINTF3(_L("(TDisplayMode)(*colorModes)[i] return value - Not Expected: %d , Actual: %d"), ENone, dispMode);
-		if (dispMode<=EGray256)
-			lastGray=dispMode;
-		else
-			mostColor=dispMode;
-		if(dispMode == EColor16M || dispMode == EColor16MU || dispMode == EColor16MA)
-			colorModes16M++;
-		}	
-	TEST(mostColor!=ERgb);
-	if (mostColor==ERgb)
-		INFO_PRINTF3(_L("mostColor - Not Expected: %d , Actual: %d"), ERgb, mostColor);	
-	TEST(colorModes16M <= 1);
-	if (colorModes16M > 1)
-		INFO_PRINTF3(_L("Number of times color Modes 16M - less than or equal to: %d , Actual: %d"), 1, colorModes16M);
-#if defined(__WINS__)	
-	TEST(colorModes16M == 1);
-	if (colorModes16M != 1)
-		INFO_PRINTF3(_L("Number of times color Modes 16M on wins - equal to: %d , Actual: %d"), 1, colorModes16M);
-#endif
-	TInt retVal;
-	if (color==0)
-		{
-		TEST(mostColor==ENone);
-		if (mostColor!=ENone)
-			INFO_PRINTF3(_L("Most color - equal to: %d , Actual: %d"), ENone ,mostColor);
-		}
-	else
-		{
-		retVal = TDisplayModeUtils::NumDisplayModeColors(mostColor);		
-		TEST(color==retVal);
-		if (color!=retVal)
-			INFO_PRINTF3(_L("TDisplayModeUtils::NumDisplayModeColors(mostColor) return value - equal to: %d , Actual: %d"), TDisplayModeUtils::NumDisplayModeColors(mostColor), retVal);
-		}
-	if (gray==0)
-		{		
-		TEST(lastGray==ENone);
-		if (lastGray!=ENone)
-			INFO_PRINTF3(_L("LastGray - equal to: %d , Actual: %d"), ENone, lastGray);
-		}
-	else
-		{
-		retVal = TDisplayModeUtils::NumDisplayModeColors(lastGray);	
-		TEST(gray==retVal);	
-		if(gray!=retVal)
-			INFO_PRINTF3(_L("Gray - equal to: %d , Actual: %d"), retVal, gray);
-		}
-	retVal = TDisplayModeUtils::NumDisplayModeColors(ENone);	
-	TEST(retVal==0);
-	if (retVal!=0)
-		INFO_PRINTF3(_L("TDisplayModeUtils::NumDisplayModeColors(ENone) return value - equal to: %d , Actual: %d"), 0, retVal);	
-	CleanupStack::PopAndDestroy(2);		//window and mode-array
-	}
-
-void CTWindowTest::TestInvalidFunctions2L()
-//
-// This code casts windows to group windows and vice-versa and then sends messages for the 'cast' that
-// should not be sent to the original type of window. These should all result in panics
-//
-	{
-	for (TInt winType=1;winType<7;++winType)		//Skip type 0 (RWindowTreeNode)
-		for (TInt panic=0;;panic++)
-			{
-			TBool testFinished=EFalse;
-			TEST(iTest->TestWsPanicL(DoPanicTest3,EWservPanicOpcode,EWinTypeFactor*winType+panic,(TAny*)iTest->iScreenNumber,&testFinished));
-			if (testFinished)
-				break;
-			}
-	iTest->CloseAllPanicWindows();
-	}
-
-void CTWindowTest::TestDeletedParentPanics1L()
-	{
-	for (TInt winType=0;winType<7;++winType)
-		{
-		if (winType==1)		//Skip type 1 (RWindowGroup)
-			++winType;
-		for (TInt panic=0;;panic++)
-			{
-			TBool testFinished=EFalse;
-			TEST(iTest->TestWsPanicL(DoPanicTest4,EWservPanicParentDeleted,EWinTypeFactor*winType+panic,(TAny*)iTest->iScreenNumber,&testFinished));
-			if (testFinished)
-				break;
-			}
-		}
-	iTest->CloseAllPanicWindows();
-	}
-
-void CTWindowTest::TestDeletedParentPanics2L()
-	{
-	for (TInt panic=0;;panic++)
-		{
-		TBool testFinished=EFalse;
-		TEST(iTest->TestWsPanicL(DoPanicTest5,EWservPanicParentDeleted,panic,(TAny*)iTest->iScreenNumber,&testFinished));
-		if (testFinished)
-			break;
-		}
-	iTest->CloseAllPanicWindows();
-	}
-
-void CTWindowTest::Bug1L()
-//
-// Test a defect found with WSERV 099 that caused a full Eikon ROM to crash before even the splach screen appeared
-//
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	// use correct screen
-	CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws);
-	CleanupStack::PushL(screen);
-	User::LeaveIfError(screen->Construct(iTest->iScreenNumber));
-
-	RWindowGroup group(ws);
-	group.Construct(344);
-	group.EnableReceiptOfFocus(EFalse);		//Not done by Eikon, but needed to stop shell window comming to front.
-	RBlankWindow blank(ws);
-	blank.Construct(group,345);
-	blank.SetOrdinalPosition(0,1000);
-	blank.Activate();
-	RWindow window(ws);
-	window.Construct(group,346);
-
-	//Must delete this window to tidy up
-	window.Close();
-	blank.Close();
-	group.Close();
-
-	CleanupStack::PopAndDestroy(screen);
-	ws.Close();
-	}
-
-void CTWindowTest::TestWindowDelete()
-	{
-	TInt handles = 344;
-	TInt err = KErrNone;
-	TInt loop = 0;
-	TInt allocFailRate = 0;
-	
-	RWindowGroup group(TheClient->iWs);
-	RWindow parent1(TheClient->iWs);
-	RWindow child1(TheClient->iWs);
-	RWindow testWindow(TheClient->iWs);
-	
-	while (loop < 5)
-		{
-		err = group.Construct(++handles, EFalse);		
-		if (err == KErrNone)
-			{
-			TheClient->iWs.HeapSetFail(RHeap::EDeterministic, allocFailRate);
-
-			//Create parent 1
-			err = parent1.Construct(group,++handles);
-			if (err == KErrNone)
-				{
-				parent1.SetExtent(TPoint(10,10),TSize(50,50));
-				parent1.Activate();
-				}			
-			}
-		//Create child 1
-		if (err == KErrNone)
-			{
-			err = child1.Construct(parent1,++handles);
-			if (err == KErrNone)
-				{
-				child1.SetExtent(TPoint(),TSize(50,20));
-				child1.Activate();
-				}
-			//Only delete the parent 1, but not the child 1
-			parent1.Close();	
-			}
-		
-		if (err == KErrNone) 
-			{			
-			//Create testWindow
-			err = testWindow.Construct(group,++handles);
-			if (err == KErrNone)
-				{
-				testWindow.SetExtent(TPoint(0,20),TSize(50,30));
-				testWindow.Activate();
-				}
-			}
-		TheClient->iWs.HeapSetFail(RAllocator::ENone, 0);
-			
-		child1.Close();
-		testWindow.Close();
-		group.Close();
-		++allocFailRate;
-		loop = (err == KErrNone) ? loop + 1 : 0; 
-		}
-	}
-void CTWindowTest::Bug2L()
-//
-// Test a defect ...
-//
-	{
-	TSize offset(20,20);
-	TRect screen(TheClient->iScreen->SizeInPixels()-offset);
-	TRgb color;
-	RWsSession ws1;
-	User::LeaveIfError(ws1.Connect());
-	ws1.SetAutoFlush(ETrue);
-
-	// use correct screen
-	//
-	CWsScreenDevice* scr1 = new (ELeave) CWsScreenDevice(ws1);
-	CleanupStack::PushL(scr1);
-	User::LeaveIfError(scr1->Construct(iTest->iScreenNumber));
-
-	RWsSession ws2;
-	User::LeaveIfError(ws2.Connect());
-	ws2.SetAutoFlush(ETrue);
-
-	// use correct screen
-	//
-	CWsScreenDevice* scr2 = new (ELeave) CWsScreenDevice(ws2);
-	CleanupStack::PushL(scr2);
-	User::LeaveIfError(scr2->Construct(iTest->iScreenNumber));
-
-	RWindowGroup group1a(ws1);
-	group1a.Construct(344);
-	group1a.EnableReceiptOfFocus(EFalse);
-	group1a.SetOrdinalPosition(0,5);
-	RBlankWindow blank1a(ws1);
-	blank1a.Construct(group1a,345);
-	color=TRgb::Gray4(0);
-	blank1a.SetColor(color);
-	blank1a.SetExtent(screen.iTl,screen.Size());
-	blank1a.EnableBackup();
-	blank1a.Activate();
-
-	RWindowGroup group2(ws2);
-	group2.Construct(342);
-	group2.EnableReceiptOfFocus(EFalse);
-	group2.SetOrdinalPosition(0,5);
-	RBlankWindow blank2(ws2);
-	blank2.Construct(group2,347);
-	color=TRgb::Gray4(1);
-	blank2.SetColor(color);
-	blank2.SetExtent(screen.iTl+TSize(20,0),screen.Size());
-	blank2.EnableBackup();
-	blank2.Activate();
-
-	RWindowGroup group1b(ws1);
-	group1b.Construct(343);
-	//group1b.EnableReceiptOfFocus(EFalse);
-	group1b.SetOrdinalPosition(0,5);
-	RBlankWindow blank1b(ws1);
-	blank1b.Construct(group1b,346);
-	color=TRgb::Gray4(2);
-	blank1b.SetColor(color);
-	blank1b.SetExtent(screen.iTl+offset,screen.Size());
-	blank1b.EnableBackup();
-	blank1b.Activate();
-
-	group1b.Close();
-	blank1a.Close();
-	blank1b.Close();
-	blank2.Close();
-	group1a.Close();
-	group2.Close();
-
-	CleanupStack::PopAndDestroy(2,scr1);
-	ws1.Close();
-	ws2.Close();
-	}
-
-void CTWindowTest::Bug3L()
-//
-// Actiate then make visible and backup behind window caused panic.
-//
-	{
-	TSize offset(20,20);
-	TRect screen(TheClient->iScreen->SizeInPixels()-offset);
-	TRgb color;
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	ws.SetAutoFlush(ETrue);
-
-	// use correct screen
-	//
-	CWsScreenDevice* scr = new (ELeave) CWsScreenDevice(ws);
-	CleanupStack::PushL(scr);
-	User::LeaveIfError(scr->Construct(iTest->iScreenNumber));
-
-	RWindowGroup group(ws);
-	group.Construct(348);
-	group.EnableReceiptOfFocus(EFalse);
-	RBlankWindow blank1(ws);
-	blank1.Construct(group,341);
-	color=TRgb::Gray4(1);
-	blank1.SetColor(color);
-	blank1.SetExtent(screen.iTl,screen.Size());
-	blank1.EnableBackup();
-	blank1.SetVisible(EFalse);
-	blank1.Activate();
-	blank1.SetVisible(ETrue);
-	RBlankWindow blank2(ws);
-	blank2.Construct(group,342);
-	color=TRgb::Gray4(2);
-	blank2.SetColor(color);
-	blank2.SetExtent(screen.iTl,screen.Size());
-	blank2.EnableBackup();
-	blank2.SetVisible(EFalse);
-	blank2.SetVisible(ETrue);
-	blank2.Activate();
-	group.Close();
-	blank1.Close();
-	blank2.Close();
-
-	CleanupStack::PopAndDestroy(scr);
-	ws.Close();
-	}
-
-void CTWindowTest::ErrorCodesL()
-	{
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	// use correct screen
-	//
-	CWsScreenDevice* scr = new (ELeave) CWsScreenDevice(ws);
-	CleanupStack::PushL(scr);
-	User::LeaveIfError(scr->Construct(iTest->iScreenNumber));
-
-
-	RWindowGroup group(ws);
-	group.Construct(349);
-	group.EnableReceiptOfFocus(EFalse);
-	RWindow window(TheClient->iWs);
-	User::LeaveIfError(window.Construct(*TheClient->iGroup->GroupWin(),ENullWsHandle));
-	TInt retVal = window.MoveToGroup(22222);		
-	TEST(retVal==KErrNotFound);
-	if (retVal!=KErrNotFound)
-		INFO_PRINTF3(_L("window.MoveToGroup(22222) return value - equal to: %d , Actual: %d"), KErrNotFound, retVal);
-	retVal = window.MoveToGroup(group.Identifier());	
-	TEST(retVal==KErrNotFound);
-	if (retVal!=KErrNotFound)
-		INFO_PRINTF3(_L("window.MoveToGroup(group.Identifier()) return value - equal to: %d , Actual: %d"), KErrNotFound, retVal);
-	window.Close();
-	group.Close();
-
-	CleanupStack::PopAndDestroy(scr);
-	ws.Close();
-	}
-
-void CTWindowTest::BackColorBugL()
-//
-// Test a defect with window being drawn with the wrong background color when they are moved on the screen
-//
-	{
-	TSize scrSize(TheClient->iScreen->SizeInPixels());
-	TSize checkSize(12,10);			//X-Size needs to be multiple of 4 due to BITGDI change/defect
-	CBlankWindow* win;
-	win=new(ELeave) CBlankWindow(TRgb(16,16,240));
-	CleanupStack::PushL(win);
-	win->SetUpL(TPoint(5,5),scrSize-TSize(10,10),TheClient->iGroup,*TheClient->iGc);
-	TInt mode=win->BaseWin()->SetRequiredDisplayMode(EColor256);
-	const TDisplayMode actualMode=reinterpret_cast<TDisplayMode&>(mode);
-	if (!TDisplayModeUtils::IsDisplayModeColor(actualMode) || TDisplayModeUtils::NumDisplayModeColors(actualMode)<256)
-		{
-		CleanupStack::PopAndDestroy(win);
-		return;
-		}
-	win->RealDraw(ETrue);
-	win->Win()->SetBackgroundColor(TRgb(64,224,64));
-	CBlankWindow* win3;
-	win3=new(ELeave) CBlankWindow(TRgb::Gray16(8));
-	CleanupStack::PushL(win3);
-	win3->SetUpL(TPoint(12,12),checkSize,TheClient->iGroup,*TheClient->iGc);
-	win3->BaseWin()->SetRequiredDisplayMode(EColor256);
-	CBlankWindow* win2;
-	win2=new(ELeave) CBlankWindow(TRgb(240,16,16));
-	CleanupStack::PushL(win2);
-	win2->SetUpL(TPoint(10,scrSize.iHeight/2),TSize(scrSize.iWidth/3,scrSize.iHeight/2-10),TheClient->iGroup,*TheClient->iGc);
-	win2->BaseWin()->SetRequiredDisplayMode(EColor256);
-	win2->RealDraw(EFalse);
-
-	win2->Win()->SetBackgroundColor(TRgb::Gray16(8));
-	win2->SetExt(TPoint(scrSize.iWidth/4,30),TSize(scrSize.iWidth/2,2*scrSize.iHeight/3));
-	TheClient->iWs.Finish();
-	TheClient->WaitForRedrawsToFinish();
-	if (!CheckRect(win2,win3,TRect(checkSize)))
-		{
-		_LIT(KLog,"After window is moved and resizes it doesn't matches the other window");
-		LOG_MESSAGE(KLog);
-		//Code to save a screen shot useful if this test fails
-		/*_LIT(KTest,"E:\\logs\\testexecute\\Window%d");
-		TBuf<64> buf;
-		buf.Format(KTest,iTest->iState);
-		TInt err=iTest->SaveScreen(buf);
-		_LIT(KLogSave,"Saved screenshot to file %S, (err=%d)");
-		LOG_MESSAGE3(KLogSave,&buf,err);*/
-		}
-	TheClient->WaitForRedrawsToFinish();
-	CleanupStack::PopAndDestroy(3,win);
-	}
-
-void CTWindowTest::FocusChangedL()
-//
-// Test that the focus change is available when the redraw is
-// it should be available before, but it isn't always possible to test that
-//
-	{
-	_LIT(KThreadName,"MoveGroup");
-	_LIT(KEventWaiting,"Event Waiting when none expected.");
-	TInt command;
-	iThreadParam.iScreenNumber=iTest->iScreenNumber;
-	iFirstFunction=TThreadStartUp(CTWindowTest::MoveGroup,&iThreadParam);
-	TRequestStatus status;
-	TSize scrSize(TheClient->iScreen->SizeInPixels());
-	CTWindowGroup* group1=new(ELeave) CTWindowGroup(TheClient);
-	group1->ConstructL();
-	CleanupStack::PushL(group1);
-	TInt winId1=group1->GroupWin()->Identifier();
-	CBlankWindow* win1=new(ELeave) CBlankWindow(TRgb::Gray4(1));
-	CleanupStack::PushL(win1);
-	win1->SetUpL(TPoint(1,1),TSize(2*scrSize.iWidth/3,2*scrSize.iHeight/3),group1,*TheClient->iGc);
-	win1->RealDraw(ETrue);
-	win1->Win()->SetBackgroundColor(TRgb::Gray4(3));
-	CTWindowGroup* group2=new(ELeave) CTWindowGroup(TheClient);
-	group2->ConstructL();
-	CleanupStack::PushL(group2);
-	TInt winId2=group2->GroupWin()->Identifier();
-	CBlankWindow* win2=new(ELeave) CBlankWindow(TRgb::Gray4(2));
-	CleanupStack::PushL(win2);
-	win2->SetUpL(TPoint(scrSize.iWidth/3-5,scrSize.iHeight/3-5),TSize(2*scrSize.iWidth/3,2*scrSize.iHeight/3),group2,*TheClient->iGc);
-	win2->RealDraw(ETrue);
-	win2->Win()->SetBackgroundColor(TRgb::Gray4(0));
-
-	TheClient->WaitForRedrawsToFinish();
-	TheClient->WaitForAllEventProcessingToFinish();
-	command=winId1;
-	iThreadParam.iCommand=command;
-	TBool noEventWaiting=!TheClient->IsEventWaiting();
-	TEST(noEventWaiting);
-	if (!noEventWaiting)
-		LOG_MESSAGE(KEventWaiting);
-	_LIT(KTest1,"FocusChangedL: 1st test completed");
-	LOG_MESSAGE(KTest1);
-	CProcess* iMoveGroup=CProcess::NewSimpleThreadL(KThreadName,&iFirstFunction,&status);
-	User::WaitForRequest(status);
-	delete iMoveGroup;
-	TEST(TheClient->WaitForEvent());
-	TheClient->WaitForAllEventProcessingToFinish();
-
-	command=winId2;
-	iThreadParam.iCommand=command;
-	TheClient->WaitForRedrawsToFinish();
-	noEventWaiting=!TheClient->IsEventWaiting();
-	TEST(noEventWaiting);
-	if (!noEventWaiting)
-		LOG_MESSAGE(KEventWaiting);
-	_LIT(KTest2,"FocusChangedL: 2nd test completed");
-	LOG_MESSAGE(KTest2);
-	iMoveGroup=CProcess::NewSimpleThreadL(KThreadName,&iFirstFunction,&status);
-	User::WaitForRequest(status);
-	delete iMoveGroup;
-	TEST(TheClient->WaitForEvent());
-	TheClient->WaitForAllEventProcessingToFinish();
-
-	command=winId2|(1<<EPosShift);
-	iThreadParam.iCommand=command;
-	TheClient->WaitForRedrawsToFinish();
-	noEventWaiting=!TheClient->IsEventWaiting();
-	TEST(noEventWaiting);
-	if (!noEventWaiting)
-		LOG_MESSAGE(KEventWaiting);
-	_LIT(KTest3,"FocusChangedL: 3rd test completed");
-	LOG_MESSAGE(KTest3);
-	iMoveGroup=CProcess::NewSimpleThreadL(KThreadName,&iFirstFunction,&status);
-	User::WaitForRequest(status);
-	delete iMoveGroup;
-	TEST(TheClient->WaitForEvent());
-	TheClient->WaitForAllEventProcessingToFinish();
-
-	command=winId1|(1<<EPosShift);
-	iThreadParam.iCommand=command;
-	TheClient->WaitForRedrawsToFinish();
-	noEventWaiting=!TheClient->IsEventWaiting();
-	TEST(noEventWaiting);
-	if (!noEventWaiting)
-		LOG_MESSAGE(KEventWaiting);
-	_LIT(KTest4,"FocusChangedL: 4th test completed");
-	LOG_MESSAGE(KTest4);
-	iMoveGroup=CProcess::NewSimpleThreadL(KThreadName,&iFirstFunction,&status);
-	User::WaitForRequest(status);
-	delete iMoveGroup;
-	TEST(TheClient->WaitForEvent());
-	TheClient->WaitForAllEventProcessingToFinish();
-
-	TheClient->WaitForRedrawsToFinish();
-	noEventWaiting=!TheClient->IsEventWaiting();
-	TEST(noEventWaiting);
-	if (!noEventWaiting)
-		LOG_MESSAGE(KEventWaiting);
-	_LIT(KTest5,"FocusChangedL: 5th and last test completed");
-	LOG_MESSAGE(KTest5);
-	CleanupStack::PopAndDestroy(2,group2);
-	TheClient->Flush();
-	TEST(TheClient->WaitForEvent());
-	TheClient->WaitForAllEventProcessingToFinish();
-	CleanupStack::PopAndDestroy(2,group1);
-	}
-
-#define ALT_PRI 78
-void CTWindowTest::EventsToAllL()
-	{
-	CTClient* client1=new(ELeave) CTClient;
-	CleanupStack::PushL(client1);
-	client1->SetScreenNumber(iTest->iScreenNumber);
-	client1->ConstructL();
-	CTClient* client2=new(ELeave) CTClient;
-	CleanupStack::PushL(client2);
-	client2->SetScreenNumber(iTest->iScreenNumber);
-	client2->ConstructL();
-	CEvWindowGroup* group1a=CEvWindowGroup::NewLC(client1,this);
-	CEvWindowGroup* group1b=CEvWindowGroup::NewLC(client1,this);
-	CEvWindowGroup* group2a=CEvWindowGroup::NewLC(client2,this);
-	CEvWindowGroup* group2b=CEvWindowGroup::NewLC(client2,this);
-	/*_LIT(KLog,"Window Group Id's: %d,%d,%d,%d");
-	LOG_MESSAGE5(KLog,group1a->GroupWin()->Identifier(),group1b->GroupWin()->Identifier(),group2a->GroupWin()->Identifier(),group2b->GroupWin()->Identifier());*/
-	group1a->SendEvent(KBaseUserEvent+1);
-	group2b->SendEvent(KBaseUserEvent+2);
-	client1->WaitForAllEventProcessingToFinish();
-	client2->WaitForAllEventProcessingToFinish();
-	TWsEvent event;
-	// Assigned random value because before PREQ1226, TWsevent's data wasn't zero initialised.
-	// In techview, following function
-	// void CEikServAppUi::HandleSystemEventL(const TWsEvent& aEvent)
-	// was relaying on TWsevent's data not be zero 
-	*(event.Int()) = 0XCCCCCCCC;
-	event.SetType(KBaseUserEvent+3);
-	group1a->SetExpectedEvent(KBaseUserEvent+3);
-	group1b->SetExpectedEvent(KBaseUserEvent+3);
-	group2a->SetExpectedEvent(KBaseUserEvent+3);
-	group2b->SetExpectedEvent(KBaseUserEvent+3);
-	TheClient->iWs.SendEventToAllWindowGroups(event);
-	client1->WaitForAllEventProcessingToFinish();
-	client2->WaitForAllEventProcessingToFinish();
-	event.SetType(KBaseUserEvent+4);
-	group1a->SetExpectedEvent(KBaseUserEvent+4);
-	group1b->SetExpectedEvent(KBaseUserEvent+4);
-	group2a->SetExpectedEvent(KBaseUserEvent+4);
-	group2b->SetExpectedEvent(KBaseUserEvent+4);
-	TheClient->iWs.SendEventToAllWindowGroups(event);
-	client1->WaitForAllEventProcessingToFinish();
-	client2->WaitForAllEventProcessingToFinish();
-	event.SetType(KBaseUserEvent+5);
-	//group1a->SetExpectedEvent(KBaseUserEvent+5);
-	group1b->SetExpectedEvent(KBaseUserEvent+5);
-	//group2a->SetExpectedEvent(KBaseUserEvent+5);
-	group2b->SetExpectedEvent(KBaseUserEvent+5);
-	TheClient->iWs.SendEventToOneWindowGroupsPerClient(event);
-	client1->WaitForAllEventProcessingToFinish();
-	client2->WaitForAllEventProcessingToFinish();
-	group1a->WinTreeNode()->SetOrdinalPosition(0);
-	client1->Flush();
-	event.SetType(KBaseUserEvent+6);
-	group1a->SetExpectedEvent(KBaseUserEvent+6);
-	group2b->SetExpectedEvent(KBaseUserEvent+6);
-	TheClient->iWs.SendEventToOneWindowGroupsPerClient(event);
-	client1->WaitForAllEventProcessingToFinish();
-	client2->WaitForAllEventProcessingToFinish();
-	group2b->WinTreeNode()->SetOrdinalPosition(6);
-	client2->Flush();
-	event.SetType(KBaseUserEvent+7);
-	group1a->SetExpectedEvent(KBaseUserEvent+7);
-	group2a->SetExpectedEvent(KBaseUserEvent+7);
-	TheClient->iWs.SendEventToOneWindowGroupsPerClient(event);
-	client1->WaitForAllEventProcessingToFinish();
-	client2->WaitForAllEventProcessingToFinish();
-	event.SetType(KBaseUserEvent+8);
-	group1a->SetExpectedEvent(KBaseUserEvent+8);
-	group1b->SetExpectedEvent(KBaseUserEvent+8);
-	group2a->SetExpectedEvent(KBaseUserEvent+8);
-	group2b->SetExpectedEvent(KBaseUserEvent+8);
-	TheClient->iWs.SendEventToAllWindowGroups(0,event);
-	group1a->WinTreeNode()->SetOrdinalPosition(0,ALT_PRI);
-	client1->Flush();
-	client1->WaitForAllEventProcessingToFinish();
-	client2->WaitForAllEventProcessingToFinish();
-	event.SetType(KBaseUserEvent+9);
-	group1a->SetExpectedEvent(KBaseUserEvent+9);
-	TheClient->iWs.SendEventToAllWindowGroups(ALT_PRI,event);
-	client1->WaitForAllEventProcessingToFinish();
-	client2->WaitForAllEventProcessingToFinish();
-	group2b->WinTreeNode()->SetOrdinalPosition(0,ALT_PRI);
-	client2->Flush();
-	client1->WaitForAllEventProcessingToFinish();
-	client2->WaitForAllEventProcessingToFinish();
-	event.SetType(KBaseUserEvent+10);
-	group1a->SetExpectedEvent(KBaseUserEvent+10);
-	group2b->SetExpectedEvent(KBaseUserEvent+10);
-	TheClient->iWs.SendEventToAllWindowGroups(ALT_PRI,event);
-	client1->WaitForAllEventProcessingToFinish();
-	client2->WaitForAllEventProcessingToFinish();
-	event.SetType(KBaseUserEvent+11);
-	group1b->SetExpectedEvent(KBaseUserEvent+11);
-	group2a->SetExpectedEvent(KBaseUserEvent+11);
-	TheClient->iWs.SendEventToAllWindowGroups(0,event);
-	client1->WaitForAllEventProcessingToFinish();
-	client2->WaitForAllEventProcessingToFinish();
-	event.SetType(KBaseUserEvent);
-	group1a->SetExpectedEvent(KBaseUserEvent);
-	group1b->SetExpectedEvent(KBaseUserEvent);
-	group2a->SetExpectedEvent(KBaseUserEvent);
-	group2b->SetExpectedEvent(KBaseUserEvent);
-	TheClient->iWs.SendEventToAllWindowGroups(event);
-	client1->WaitForAllEventProcessingToFinish();
-	client2->WaitForAllEventProcessingToFinish();
-	CleanupStack::PopAndDestroy(6,client1);
-	}
-
-void DestroyWindow(TAny* aWindow)
-	{
-	static_cast<RWindowTreeNode*>(aWindow)->Destroy();
-	}
-
-void CTWindowTest::GroupIdL()
-	{
-	const TInt numWindows=10;
-	RWindowGroup group(TheClient->iWs);
-	CleanupClosePushL(group);
-	User::LeaveIfError(group.Construct(ENullWsHandle));
-	TInt id=group.Identifier();
-	RWindowTreeNode* prevWindow=&group;
-	TInt ii;
-	for (ii=0;ii<numWindows;++ii)
-		{
-		RBlankWindow* window=new(ELeave) RBlankWindow(TheClient->iWs);
-		CleanupStack::PushL(TCleanupItem(&DestroyWindow,window));
-		User::LeaveIfError(window->Construct(*prevWindow,ENullWsHandle));
-		TInt retVal = window->WindowGroupId();		
-		TEST(retVal==id);
-		if (retVal!=id)
-			INFO_PRINTF3(_L("window->WindowGroupId() return value  - equal to: %d , Actual: %d"), id, retVal);
-		prevWindow=window;
-		}
-	CleanupStack::PopAndDestroy(numWindows+1);
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0495
-
-@SYMDEF				PDEF131541
-
-@SYMTestCaseDesc	Sending Events using one of the functions SendEventToWindowGroup, SendEventToAllWindowGroups (x2) 
-					and SendEventToOneWindowGroupsPerClient when an event queue is full returns an error
-
-@SYMTestPriority	Low
-
-@SYMTestStatus		Implemented
-
-@SYMTestActions		Call the functions repeatly many times and check that an error gets returned eventually
-
-@SYMTestExpectedResults		Functions return the error KErrNoMemory
-*/
-const TInt numTest=75;		//Must be at least 33
-void CTWindowTest::SaturateSendEvent()
-	{
-	const TInt id=TheClient->iGroup->GroupWin()->Identifier();
-	TWsEvent event;
-	event.SetType(KBaseUserEvent);
-	TInt ii;
-
-	TInt err=KErrNone;
-	for (ii=0; ii<=numTest && err==KErrNone;)
-		{
-		++ii;
-		err=TheClient->iWs.SendEventToWindowGroup(id,event);
-		}
-	TEST(err==KErrNoMemory);
-	if (err!=KErrNoMemory)
-		{
-		_LIT(KLog,"After %d/%d iterations SendEventToWindowGroup returned the error %d");
-		LOG_MESSAGE4(KLog,ii,numTest,err);
-		}
-	TheClient->WaitForAllEventProcessingToFinish();
-
-	err=KErrNone;
-	for (ii=0; ii<=numTest && err==KErrNone;)
-		{
-		++ii;
-		err=TheClient->iWs.SendEventToAllWindowGroups(event);
-		}
-	TEST(err==KErrNoMemory);
-	if (err!=KErrNoMemory)
-		{
-		_LIT(KLog,"After %d/%d iterations SendEventToAllWindowGroups returned the error %d");
-		LOG_MESSAGE4(KLog,ii,numTest,err);
-		}
-	TheClient->WaitForAllEventProcessingToFinish();
-	User::After(1000000);		//1sec, give other sessions a chance to respond to the events
-
-	err=KErrNone;
-	for (ii=0; ii<=numTest && err==KErrNone;)
-		{
-		++ii;
-		err=TheClient->iWs.SendEventToAllWindowGroups(0,event);
-		}
-	TEST(err==KErrNoMemory);
-	if (err!=KErrNoMemory)
-		{
-		_LIT(KLog,"After %d/%d iterations SendEventToAllWindowGroups_Priority0 returned the error %d");
-		LOG_MESSAGE4(KLog,ii,numTest,err);
-		}
-	TheClient->WaitForAllEventProcessingToFinish();
-	User::After(1000000);		//1sec, give other sessions a chance to respond to the events
-
-	err=KErrNone;
-	for (ii=0; ii<=numTest && err==KErrNone;)
-		{
-		++ii;
-		err=TheClient->iWs.SendEventToOneWindowGroupsPerClient(event);
-		}
-	TEST(err==KErrNoMemory);
-	if (err!=KErrNoMemory)
-		{
-		_LIT(KLog,"After %d/%d iterations SendEventToOneWindowGroupsPerClient returned the error %d");
-		LOG_MESSAGE4(KLog,ii,numTest,err);
-		}
-	TheClient->WaitForAllEventProcessingToFinish();
-	User::After(1000000);		//1sec, give other sessions a chance to respond to the events
-	}
-
-void CTWindowTest::TestNotSupportedFunctionality()
-    {
-    TInt err = KErrNone;
-    TSize windowSize = TSize(10,10);
-    TSize testSize = TSize();
-    
-    RWindowGroup group(TheClient->iWs);
-    RWindow window(TheClient->iWs);
-
-    err = group.Construct((TUint32)&group, EFalse);
-    TEST(err==KErrNone);
-    err = window.Construct(group,(TUint32)&window);
-    TEST(err==KErrNone);
-    
-    window.SetExtent(TPoint(0,0),windowSize);
-    window.Activate();
-    
-    testSize = window.Size();
-    TEST((testSize.iWidth==windowSize.iWidth) && (testSize.iHeight==windowSize.iHeight));
-    
-    testSize = window.SizeForEgl();
-    TEST((testSize.iWidth==windowSize.iWidth) && (testSize.iHeight==windowSize.iHeight));
-    
-    err = window.FixNativeOrientation();
-    TEST(err==KErrNotSupported);
-
-    testSize = window.Size();
-    TEST((testSize.iWidth==windowSize.iWidth) && (testSize.iHeight==windowSize.iHeight));
-    
-    testSize = window.SizeForEgl();
-    TEST((testSize.iWidth==windowSize.iWidth) && (testSize.iHeight==windowSize.iHeight));
-
-    window.Close();
-    group.Close();  
-    }
-
-void CTWindowTest::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(KTest1,"Window");
-	_LIT(KTest2,"DestroyWindowWithActiveGc");
-	_LIT(KTest3,"Shadow/NoAutoClear");
-	_LIT(KTest4,"Corner Tests");
-	_LIT(KTest5,"Invalid Window Functions");
-	_LIT(KTest7,"Mega-Tree");
-	_LIT(KTest8,"Tiled Window One");
-	_LIT(KTest9,"Tiled Window Two");
-	_LIT(KTest10,"Color Test");
-	_LIT(KTest11,"Invalid Window Functions2");
-	_LIT(KTest12,"Defect 1");
-	_LIT(KTest13,"Defect 2");
-	_LIT(KTest14,"Parent Deleted 1");
-	_LIT(KTest15,"Parent Deleted 2");
-	_LIT(KTest16,"Defect 3");
-	_LIT(KTest17,"Background Color");
-	_LIT(KTest18,"Focus Changed");
-	_LIT(KTest21,"Events To All");
-	_LIT(KTest22,"Error Codes");
-	_LIT(KTest23,"Group Id");
-	_LIT(KTest24,"DeleteParentWindowOnly");
-#if defined(_DEBUG)
-	_LIT(KTest25,"DuplicateWindowHandles");
-#else
-	_LIT(KTest25skipped,"DuplicateWindowHandles skipped");
-#endif
-
-	((CTWindowTestStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-
-	_LIT(KTest26,"Saturate SendEvent");
-	_LIT(KTest27,"Not Supported Functionality");
-
-	switch(++iTest->iState)
-		{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0029
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Test window can be created and destroyed correctly
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates and destroys a window
-
-@SYMTestExpectedResults Window is created and destroyed without error
-*/
-		case 1:
-			((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0029"));
-			iTest->LogSubTest(KTest1);
-			CreateTestWindowL();
-			CheckAndDestroyWindows();
-			//iState=17;
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0030
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Creates and destroys window with an active gc
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Create and destroy a window with an active gc
-
-@SYMTestExpectedResults Window is created and destroyed without error
-*/
-		case 2:
-			((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0030"));
-			iTest->LogSubTest(KTest2);
-			CreateTestWindowL();
-			DestroyWindowWithActiveGc();
-			CreateTestWindowL();
-			DestroyWindowWithActiveGc2L();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0031
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Test that shadow is not automatically cleared when
-					drawing a window
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Draw windows and check that the shadow is not automatically
-					cleared
-
-@SYMTestExpectedResults Screen comparison returns that the shadow was not cleared
-*/
-		case 3:
-			((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0031"));
-			//window shadowing is no longer supported. keep the test to make sure clients can still call the methods
-			iTest->LogSubTest(KTest3);
-			ShadowAutoClearTest();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0032
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Test the drawing of different types of corner of
-					a window
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Draw a window with different types of corner
-
-@SYMTestExpectedResults The window is drawn correctly for each corner type
-*/
-		case 4:
-			((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0032"));
-			iTest->LogSubTest(KTest4);
-			CornerTests();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0033
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Test for panics when window is sent wrong requests
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Send wrong requests to windows and deal with panic
-
-@SYMTestExpectedResults The windows panic as expected
-*/
-		case 5:
-			((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0033"));
-			iTest->LogSubTest(KTest5);
-			TestInvalidFunctionsL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0035
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Draw 100 windows from a thread
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Draw 100 windows from the same thread
-
-@SYMTestExpectedResults The windows are all drawn without error
-*/
-		case 6:
-			((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0035"));
-			iTest->LogSubTest(KTest7);
-			CreateMegaTree();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0036
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Check that windows can be drawn in a tiled format
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Draw two windows in a tiled format and check they
-					are identical
-
-@SYMTestExpectedResults The tiled windows are identical
-*/
-		case 7:
-			((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0036"));
-
-			iTest->LogSubTest(KTest8);
-			TiledWindowTestL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0037
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Check that windows and dialogs can be drawn in a
-					tiled format
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Draw windows and dialogs in a tiled format
-
-@SYMTestExpectedResults The windows and dialogs are drawn correctly
-*/
-		case 8:
-			((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0037"));
-			iTest->LogSubTest(KTest9);
-			TiledWindowTest2L();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0038
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Check drawing into a window with different
-					colour set ups
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Draw in a window using different colour
-					configurations
-
-@SYMTestExpectedResults The different colours are drawn correctly
-*/
-		case 9:
-			((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0038"));
-			iTest->LogSubTest(KTest10);
-			ColorTestL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0039
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Test for panics when window is sent wrong requests
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Send wrong requests to windows and deal with panic
-
-@SYMTestExpectedResults The windows panic as expected
-*/
-		case 10:
-			((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0039"));
-			iTest->LogSubTest(KTest11);
-			TestInvalidFunctions2L();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0040
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Test for a defect that causes ROM to crash
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Test a defect is not present which causes the ROM
-					to crash
-
-@SYMTestExpectedResults The defect is not present
-*/
-		case 11:
-			((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0040"));
-			iTest->LogSubTest(KTest12);
-			Bug1L();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0041
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Test a previous defect has not returned
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Exercise the code the defect was discovered in
-
-@SYMTestExpectedResults The defect is not present
-*/
-		case 12:
-			((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0041"));
-			iTest->LogSubTest(KTest13);
-			Bug2L();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0042
-
-@SYMDEF  			DEF081259
-					DEF115543
-
-@SYMTestCaseDesc    Test that when a parent window is deleted a panic
-					occurs
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Delete a parent window and check for a panic
-					NOTE: DEF115543 has corrected GRAPHICS-WSERV-0042, and added a lot
-					more window functions.
-
-@SYMTestExpectedResults All functions either:
-					Panic the owner thread with EWservPanicParentDeleted or
-					Get performed without accessing any NULL iParent pointers in the WSERV thread
-*/
-		case 13:
-			((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0042"));
-			iTest->LogSubTest(KTest14);
-			TestDeletedParentPanics1L();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0043
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Test that when a parent window is deleted a panic
-					occurs
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Delete a parent window and check for a panic
-
-@SYMTestExpectedResults The panic occurs as expected
-*/
-		case 14:
-			((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0043"));
-			iTest->LogSubTest(KTest15);
-			TestDeletedParentPanics2L();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0044
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Check that activate then make visible and backup
-					behind a window does not panic.
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Activate then make visible and backup
-					behind a window
-
-@SYMTestExpectedResults No panic occurs
-*/
-		case 15:
-			((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0044"));
-			iTest->LogSubTest(KTest16);
-			Bug3L();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0045
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Test window being drawn with the correct background
-					color when they are moved on the screen
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Move window on the screen and check it is drawn with
-					the correct background colour
-
-@SYMTestExpectedResults The background coloour is correct
-*/
-		case 16:
-			((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0045"));
-			iTest->LogSubTest(KTest17);
-			BackColorBugL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0046
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Test that the focus change is available after redraw
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Redraw and check the focus change is available
-
-@SYMTestExpectedResults The focus change is available
-*/
-		case 17:
-			((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0046"));
-			iTest->LogSubTest(KTest18);
-			FocusChangedL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0048
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Test that events can be sent to a number of window
-					groups simultaneously
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Send events to a number of window groups and check
-					that they all receive them
-
-@SYMTestExpectedResults The events and sent to the window groups correctly
-*/
-		case 18:
-			((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0048"));
-			iTest->LogSubTest(KTest21);
-			EventsToAllL();
-			break;
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0049
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Test error code when incorrectly moving a window to
-					a group.
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Try to move a window to a group and check the error
-					codes
-
-@SYMTestExpectedResults The correct error codes are returned
-*/
-		case 19:
-			((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0049"));
-			iTest->LogSubTest(KTest22);
-			ErrorCodesL();
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0050
-
-@SYMDEF  			DEF081259
-
-@SYMTestCaseDesc    Check that the correct group id is assigned to a
-					chain of windows
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Create a chain of windows in the same group and check
-					the all have the same group id
-
-@SYMTestExpectedResults The windows all have the same group id
-*/
-		case 20:
-			((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0050"));
-			iTest->LogSubTest(KTest23);
-			GroupIdL();
-			break;
-			
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0461
-
-@SYMDEF  			PDEF114190
-
-@SYMTestCaseDesc    Test window redraw queue cleanup when window is deleted in low memory conditions
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Have a loop which increases the number of allocations in the server thread before failure;
-					Within the loop:
-					1) Create a parent window and a child window of the parent; 
-					2) Delete the parent window only, but not the child window; 
-					3) Create a testWindow. This new window gets added to the redraw queue which will force it 
-					reordering. This would crash WSERV due to this defect because the orphaned window (which is 
-					the previous child window) is still in the redraw queue
-					4) Delete all the windows involved;
-
-@SYMTestExpectedResults		The window redraw queue should be cleaned up when the first window is deleted;
-							WSERV should not crash. The test should pass. 
-*/		
-		case 21:
-			((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0461"));
-			iTest->LogSubTest(KTest24);
-			TestWindowDelete();
-			break;
-			
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0463
-
-@SYMDEF				DEF115601
-
-@SYMTestCaseDesc    Two RWindowGroup objects using same window client handle cause Emulator crash
-
-@SYMTestPriority    Medium
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Create two window groups with the same handle.
-
-@SYMTestExpectedResults		WSERV should panic the client thread with the code EWservPanicDuplicateHandle
-							and then destroy the window groups without crashing WSERV
-*/
-		case 22:
-#if defined(_DEBUG)
-			((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0463"));
-			iTest->LogSubTest(KTest25);
-			TEST(iTest->TestWsPanicL(DoPanicTest6,EWservPanicDuplicateHandle,0,(TAny*)iTest->iScreenNumber,NULL));
-			iTest->CloseAllPanicWindows();
-#else
-			iTest->LogSubTest(KTest25skipped);	//Client side panic will only occur in debug builds of WServ
-#endif
-			break;
-		case 23:
-			((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0495"));
-			iTest->LogSubTest(KTest26);
-			SaturateSendEvent();
-			break;
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0655
-
-@SYMDEF             ou1cimx1#329309
-
-@SYMTestCaseDesc    Fix native orientation functionality not supported
-
-@SYMTestPriority    Medium
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Call fucntions related to fix native orientation on a window
-
-@SYMTestExpectedResults     Fix native orientation functionality not supported
-			*/			
-        case 24:
-            ((CTWindowTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0655"));
-            iTest->LogSubTest(KTest27);
-            TestNotSupportedFunctionality();
-            break;			
-		default:
-            		((CTWindowTestStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTWindowTestStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-			break;
-		}
-	((CTWindowTestStep*)iStep)->RecordTestResultL();
-	}
-
-__WS_CONSTRUCT_STEP__(WindowTest)
--- a/windowing/windowserver/tauto/TWINDOW.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,149 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TWINDOW_H__
-#define __TWINDOW_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "AUTO.H"
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-#include "../nonnga/CLIENT/w32comm.h"
-#endif
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-#include "../nga/CLIENT/w32comm.h"
-#endif
-
-#include "../tlib/testbase.h"
-#include "TGraphicsHarness.h"
-
-struct TWindowThreadParam
-	{
-	TInt iCommand;
-	TInt iScreenNumber;
-	};
-
-class CWinTestWindow : public CBlankWindow
-	{
-public:
-	CWinTestWindow(TRgb aCol);
-	~CWinTestWindow();
-	void ConstructL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc, TInt aDepth);
-public:
-	CWinTestWindow *iChild;
-	};
-
-class CEvWindowGroup : public CTWindowGroup
-	{
-public:
-	static CEvWindowGroup* NewLC(CTClient* aClient,CTWsGraphicsBase* aTest);
-	CEvWindowGroup(CTClient* aClient,CTWsGraphicsBase* aTest);
-	void SetExpectedEvent(TInt aType);
-	void SendEvent(TInt aType);
-	//Virtual functions from CTWindowGroup
-	void ConstructL();
-	void UserEvent(TInt aEventType);
-private:
-	CTWsGraphicsBase* iTest;
-	TInt iExpectedEvent;
-	TBool iExpectingEvent;
-	};
-
-class CTWindowTest : public CTWsGraphicsBase
-	{
-public:
-	enum {EWinTypeFactor=1000};
-	enum
-		{
-		EIdMask=0x0000FFFF,
-		EPosMask=0xFFFF0000,
-		EPosShift=16
-		};
-private:
-	enum TCorner {ECornerTL,ECornerTR,ECornerBL,ECornerBR};
-public:
-	CTWindowTest(CTestStep* aStep);
-	~CTWindowTest();
-	TestState DoTestL();
-	void ConstructL();
-	void CreateTestWindowL();
-	void CheckAndDestroyWindows();
-	void DestroyWindowWithActiveGc();
-	void DestroyWindowWithActiveGc2L();
-	void DrawWindows(CWinTestWindow *aWin);
-	void ClearRedraw(RWindow &aWindow, TRgb aRgb);
-	void TestInvalidFunctionsL();
-	void ShadowAutoClearTest();
-	void CreateMegaTree();
-	void TiledWindowTestL();
-	void TiledWindowTest2L();
-	void CornerTests();
-	void ColorTestL();
-	void TestInvalidFunctions2L();
-	void Bug1L();
-	void Bug2L();
-	void Bug3L();
-	void TestDeletedParentPanics1L();
-	void TestDeletedParentPanics2L();
-	void BackColorBugL();
-	void FocusChangedL();
-	void FadeRegionsL();
-	void FadeRegionsWithRedrawStoringL();
-	void EventsToAllL();
-	void ErrorCodesL();
-	void GroupIdL();
-	void doCornerTestsL();
-	void doCornerTest(TCornerType aCornerType, TInt aFlags);
-	void CheckCorner(TCorner aCorner, const TInt *aInsetList);
-	void ShadowTestL();
-	void TestWindowDelete();
-	void SaturateSendEvent();
-	void TestNotSupportedFunctionality();
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	static TInt MoveGroup(TAny* aParam);
-	void DoFadeRegionsL(TBool aRedrawStoring);
-private:
-	CWinTestWindow *iWin;
-	CTBlankWindow *iBlankWin1;
-	CTBlankWindow *iBlankWin2;
-	CWsScreenDevice *iScreenDev;
-	TThreadStartUp iFirstFunction;
-	TWindowThreadParam iThreadParam;
-	};
-
-class CTWindowTestStep : public CTGraphicsStep
-	{
-public:
-	CTWindowTestStep();
-protected:
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTWindowTestStep,"TWindowTest");
-
-
-#endif
--- a/windowing/windowserver/tauto/TWSGRAPHS.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2593 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// This test step contains a series of tests cases to validate the correct behaviour of PREQ1246 implementation.
-// In order to create these test cases, basic implementations of the objects involved in this PREQ will be created,
-// .i.e. CWsGraphic-derived objects (generically named CWsGraphicTest) and CWsGraphicDrawer-derived objects
-// (generically named CWsGraphicDrawerTest).
-// Actual construction is performed by a UI-specific entity such as a theme manager. The test code shall replace
-// that theme manager functionality, in terms of being the test code who owns a collection of CWsGraphicTest
-// objects.
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "TWSGRAPHS.H"
-#include "../inc/WSGRAPHICDRAWERARRAY.H"
-#include "../../nga/graphicdrawer/panics.h"
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-#include "wsbufferdrawer.h"
-#endif
-
-_LIT(KTestExe, "TWSGRAPHICTEST.exe");
-_LIT(KSpace, " ");
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-const TInt KCustomTextCursorId = TTextCursor::ETypeLastBasic + 57; // 57 is arbitrary
-#endif
-
-CCrWin* CCrWin::NewL(TInt aScreenId, TBool aDraw)
-	{
-	CCrWin* win = new(ELeave) CCrWin;
-	CleanupStack::PushL(win);
-	win->ConstructL(aScreenId, aDraw);
-	CleanupStack::Pop(win);
-	return win;
-	}
-
-CCrWin::~CCrWin()
-	{
-	iWin.Close();
-	iGroup.Close();
-	delete iGc;
-	delete iScr;
-	iWs.Close();
-	}
-
-void CCrWin::ConstructL(TInt aScreenId, TBool aDraw)
-	{
-	User::LeaveIfError(iWs.Connect());
-	iScr = new(ELeave) CWsScreenDevice(iWs);
-	User::LeaveIfError(iScr->Construct(aScreenId));
-	User::LeaveIfError(iScr->CreateContext(iGc));
-	iGroup = RWindowGroup(iWs);
-	User::LeaveIfError(iGroup.Construct(0xbadbabe,ETrue));
-	iGroup.SetOrdinalPosition(0,100);
-	iWin = RWindow(iWs);
-	User::LeaveIfError(iWin.Construct(iGroup,0xbadcafe));
-	iWin.SetRequiredDisplayMode(EColor64K);
-	iWin.Activate();
-	iWs.Flush();
-	if (aDraw)
-	Draw();
-	}
-
-void CCrWin::Draw()
-	{
-	iWin.BeginRedraw();
-	iGc->Activate(iWin);
-	iGc->SetBrushColor(KRgbRed);
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TRect rect(iScr->SizeInPixels());
-	iGc->DrawRect(rect);
-	iGc->SetBrushColor(KRgbBlue);
-	iGc->DrawEllipse(TRect(rect.iTl.iX,rect.iTl.iY,rect.iBr.iX/2,rect.iBr.iY));
-	iGc->DrawEllipse(TRect(rect.iBr.iX/2,rect.iTl.iY,rect.iBr.iX,rect.iBr.iY));
-	iGc->Deactivate();
-	iWin.EndRedraw();
-	iWs.Flush();
-	}
-
-
-void CCrWin::DrawFirstHalf()
-	{
-	iWin.BeginRedraw();
-	iGc->Activate(iWin);
-	iGc->SetBrushColor(KRgbRed);
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TRect rect(TPoint(0,0),TSize(iScr->SizeInPixels().iWidth/2,iScr->SizeInPixels().iHeight));
-	iGc->DrawRect(rect);
-	iWs.Flush();	
-	}
-
-void CCrWin::DrawSecondHalf()
-	{
-	TRect rect(TPoint(iScr->SizeInPixels().iWidth/2,0),TSize(iScr->SizeInPixels().iWidth/2,iScr->SizeInPixels().iHeight));
-	iGc->DrawRect(rect);
-	iGc->Deactivate();
-	iWin.EndRedraw();	
-	iWs.Flush();		
-	}
-
-/** 
-The objective of this function is, two animations should run independently
-with respective frame rate in the given time interval.
-The time delay allows to draw animations freely and the plug-in
-calculates number of times DoDraw() function called during this interval.
-
-@param TInt Wsgrphic test plug-in id.
-*/
-void CCrWin::DrawGraphic(TInt aWsId)
-	{
-	// draw the animation in two positions
-	const TSize screenSize = iScr->SizeInPixels();	
-	const TRect position(0,0,screenSize.iWidth/2,screenSize.iHeight);
-	const TRect position2((screenSize.iWidth/2)+1,0,screenSize.iWidth,screenSize.iHeight);
-	//PeterI if CWsGraphic animation areas overlap then when one redraws the other will as well.
-	//2 separate positions are needed otherwise the framerates will be identical.
-	
-	iWin.BeginRedraw();
-	iGc->Activate(iWin);
-	const TUint8 animid1=0;
-	const TUint8 fps1=20;
-	TBuf8<2> animData1;
-	animData1.Append(animid1);   //animId1
-	animData1.Append(fps1); //20fps
-	iGc->DrawWsGraphic(aWsId,position,animData1);
-	iWs.Flush();
-	User::After(200000);
-	const TUint8 animid2=1;
-	const TUint8 fps2=60;
-	TBuf8<2> animData2;
-	animData2.Append(animid2);   //animId2
-	animData2.Append(fps2); //60fps
-	iGc->DrawWsGraphic(aWsId,position2,animData2);
-	iWs.Flush();
-	User::After(200000);
-	iGc->Deactivate();
-	iWin.EndRedraw();
-	iWs.Flush();
-	}
-
-/**
- * Set a standard text cursor on this window.
- * @see RWindowGroup::SetTextCursor()
- */
-void CCrWin::SetTextCursor(const TPoint &aPos, const TTextCursor &aCursor)
-	{
-	iGroup.SetTextCursor(iWin, aPos, aCursor);
-	}
-
-/**
- * Cancel a text cursor from this window.
- * @see RWindowGroup::CancelTextCursor()
- */
-void CCrWin::CancelTextCursor()
-	{
-	iGroup.CancelTextCursor();
-	}
-
-CCrAlphaWin* CCrAlphaWin::NewL(TInt aScreenId)
-	{
-	CCrAlphaWin* win = new(ELeave) CCrAlphaWin;
-	CleanupStack::PushL(win);
-	win->ConstructL(aScreenId);
-	CleanupStack::Pop(win);
-	return win;
-	}
-
-CCrAlphaWin::~CCrAlphaWin()
-	{
-	iWin.Close();
-	iGroup.Close();
-	delete iScr;
-	iWs.Close();
-	}
-
-void CCrAlphaWin::ConstructL(TInt aScreenId)
-	{
-	User::LeaveIfError(iWs.Connect());
-	iScr = new(ELeave) CWsScreenDevice(iWs);
-	User::LeaveIfError(iScr->Construct(aScreenId));
-	iGroup = RWindowGroup(iWs);
-	User::LeaveIfError(iGroup.Construct(0xbadc0de,ETrue));
-	iGroup.SetOrdinalPosition(0,100);
-	iWin = RWindow(iWs);
-	User::LeaveIfError(iWin.Construct(iGroup,0xbadbeef));
-	iWin.SetRequiredDisplayMode(EColor64K);
-	iWin.SetTransparencyAlphaChannel();
-	iWin.SetBackgroundColor(TRgb(0xff,0xff,0,0x80));
-	iWin.Activate();
-	iWs.Flush();
-	}
-
-
-//
-//  CTWsGraphs
-//
-
-CTWsGraphs::CTWsGraphs(CTestStep* aStep):
-	CTWsGraphicsBase(aStep)
-	{
-	}
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-LOCAL_D void DeleteSpriteMember(TAny* aSpriteMember)
-	{
-	TSpriteMember* member=reinterpret_cast<TSpriteMember*>(aSpriteMember);
-	delete member->iBitmap;
-	member->iBitmap=NULL;
-	delete member->iMaskBitmap;
-	member->iMaskBitmap=NULL;
-	}
-#endif
-
-CTWsGraphs::~CTWsGraphs()
-	{
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-	DeleteSpriteMember(&iSpriteMemberArray[0]);
-	iSpriteMemberArray.Close();
-#endif
-	delete iGdCoverage;
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-	delete iAfter;
-	delete iBefore;
-	delete iBackCopy;
-	delete iFrontCopy;
-#endif
-	delete iListen;
-	delete iNotify2;
-	delete iNotify1;
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-	delete iRedir;
-#endif
-	}
-
-void CTWsGraphs::ConstructL()
-	{
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-	iRedir = CWsRedir::NewL(iTest->iScreenNumber,ETrue);
-	iRedir->SetCallBack(TCallBack(CTWsGraphs::PluginCallBack,this));
-#endif
-	iNotify1 = CWsNotify::NewL(EFalse);
-	iNotify2 = CWsNotify::NewL(ETrue);
-	iListen = CWsListen::NewL(ETrue);
-	iListen->SetCallBack(TCallBack(CTWsGraphs::PluginCallBack,this));
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-	iFrontCopy = new(ELeave) CFbsBitmap;
-	iBackCopy = new(ELeave) CFbsBitmap;
-	iBefore = new(ELeave) CFbsBitmap;
-	User::LeaveIfError(iBefore->Create(TheClient->iScreen->SizeInPixels(), EColor64K));
-	iAfter = new(ELeave) CFbsBitmap;
-	User::LeaveIfError(iAfter->Create(TheClient->iScreen->SizeInPixels(), EColor64K));
-#endif
-	iGdCoverage = CWsGdCoverage::NewL();
-	iGdCoverage->SetCallBack(TCallBack(CTWsGraphs::PluginCallBack,this));
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-	TSpriteMember spriteMember;
-	spriteMember.iBitmap = NULL;
-	spriteMember.iMaskBitmap = NULL;
-	spriteMember.iInvertMask =EFalse;
-	spriteMember.iDrawMode = CGraphicsContext::EDrawModePEN;
-	spriteMember.iOffset = TPoint();
-	spriteMember.iInterval = TTimeIntervalMicroSeconds32(0);
-	CleanupStack::PushL(TCleanupItem(DeleteSpriteMember, &spriteMember));
-	spriteMember.iBitmap = new (ELeave) CFbsBitmap;
-	User::LeaveIfError(spriteMember.iBitmap->Load(TEST_BITMAP_NAME, EMbmWsautotestBmp1));
-	spriteMember.iMaskBitmap = new (ELeave) CFbsBitmap;
-	User::LeaveIfError(spriteMember.iMaskBitmap->Load(TEST_BITMAP_NAME, EMbmWsautotestBmp1mask));
-	User::LeaveIfError(iSpriteMemberArray.Append(spriteMember));
-	CleanupStack::Pop(&spriteMember);
-#endif
-	}
-
-void CTWsGraphs::LaunchNewProcess(const TDesC& aExecutable)
-	{
-	TBuf<128> args;
- 	args.Append(KSpace);
-	args.AppendNum(iTest->iScreenNumber);
-	RProcess pr;
-	TInt err = pr.Create(aExecutable,args);
-	if (err == KErrNone)
-		{
-		TRequestStatus status;
-		pr.Logon(status);
-		pr.Resume();
-		User::WaitForRequest(status);
-		err = pr.ExitReason();
-		pr.Close();
-		if (err != KErrNone)
-			{
-			_LIT(KLog,"%S returned error: %d. Check RDebug output.");
-			LOG_MESSAGE3(KLog, &aExecutable, err);
-			}
-		}
-	else
-		{
-		_LIT(KLog,"Can't create the process (%S), err=%d");
-		LOG_MESSAGE3(KLog, &aExecutable, err);
-		}
-	TEST(err == KErrNone);
-	// Restore main test group to foreground.
-	TheClient->iGroup->GroupWin()->SetOrdinalPosition(0);
-	}
-
-TInt CTWsGraphs::PluginCallBack(TAny* /*aArg*/)
-	{
-	return (TInt)EWait;
-	}
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-
-/**
- @SYMTestCaseID				GRAPHICS-WSERV-0371
- @SYMREQ					GT247-CR0714
- @SYMTestCaseDesc			Test interface extension
- @SYMTestPriority			High
- @SYMTestStatus				Implemented
- @SYMTestActions			Retrieves object interfaces from Content Rendering Plugin (plugin).
-							Actions step:
-							-Create plugin
-							-Query interfaces obtained from plugin side
- @SYMTestExpectedResults	Supported interfaces should return non null
-*/
-TestState CTWsGraphs::TestInterfaceExtensionL()
-	{
-	if (iSubState==0)
-		{
-		_LIT(KTestInterfaceExtension, "TestInterfaceExtension");
-		INFO_PRINTF1(KTestInterfaceExtension);
-
-		++iSubState;
-		Mem::FillZ(&iRedirInfo, sizeof(TRedirectorInfo));
-		iRedir->QueryPlugin(iRedirInfo);
-		return EWait;
-		}
-	TEST(iRedirInfo.iScreenConfigInterface!=NULL);
-	TEST(iRedirInfo.iFrontBufferInterface!=NULL);
-	TEST(iRedirInfo.iScreenBitmapHandle!=0);
-	iFrontCopy->Duplicate(iRedirInfo.iScreenBitmapHandle);
-
-	if (TransparencySupportedL()!=KErrNotSupported)
-		{
-		TEST(iRedirInfo.iBackBufferInterface!=NULL);
-		TEST(iRedirInfo.iFlickerBitmapHandle!=0);
-		iBackCopy->Duplicate(iRedirInfo.iFlickerBitmapHandle);
-		}
-
-	++(iTest->iState);
-	iSubState = 0;
-	return ENext;
-	}
-
-#endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-
-void CTWsGraphs::CreateWindowL(TBool aDraw)
-	{
-	iWin = CCrWin::NewL(iTest->iScreenNumber, aDraw);
-	}
-
-void CTWsGraphs::DestroyWindowL()
-	{
-	delete iWin;
-	iWin = NULL;
-	}
-
-void CTWsGraphs::CreateAlphaWindowL()
-	{
-	iAlpha = CCrAlphaWin::NewL(iTest->iScreenNumber);
-	}
-
-void CTWsGraphs::DestroyAlphaWindowL()
-	{
-	delete iAlpha;
-	iAlpha = NULL;
-	}
-
-TBool CTWsGraphs::CompareBitmapArea16Bpp(CFbsBitmap* aBmp1, const TPoint& aPos1, CFbsBitmap* aBmp2, const TPoint& aPos2, const TSize& aSize)
-	{
-	const TDisplayMode dispmode = aBmp1->DisplayMode();
-	if (dispmode!=aBmp2->DisplayMode())
-		return EFalse;
-	const TInt stride1 = aBmp1->DataStride();
-	const TInt stride2 = aBmp2->DataStride();
-	const TInt linebytes = aSize.iWidth * 2;
-	const TInt pixelbytes = 2;
-	aBmp1->LockHeap();
-	const TUint8* p1 = ((const TUint8*)aBmp1->DataAddress())+aPos1.iY*stride1+aPos1.iX*pixelbytes;
-	const TUint8* p2 = ((const TUint8*)aBmp2->DataAddress())+aPos2.iY*stride2+aPos2.iX*pixelbytes;
-	for (TInt y=0; y<aSize.iHeight; ++y)
-		{
-		if (Mem::Compare(p1+y*stride1,linebytes,p2+y*stride2,linebytes)!=0)
-			{
-			aBmp1->UnlockHeap();
-			return EFalse;
-			}
-		}
-	aBmp1->UnlockHeap();
-	return ETrue;
-	}
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-TestState CTWsGraphs::TestScreenRedirectionL()
-	{
-	if (iSubState==0)
-		{
-		_LIT(KTestScreenRedirection, "TestScreenRedirection");
-		INFO_PRINTF1(KTestScreenRedirection);
-
-		++iSubState;
-		/**
-		 @SYMTestCaseID				GRAPHICS-WSERV-0372
-		 @SYMREQ					GT247-CR0714
-		 @SYMTestCaseDesc			Redirect wserv screen drawing to custom graphics context
-		 @SYMTestPriority			High
-		 @SYMTestStatus				Implemented
-		 @SYMTestActions			Redirects wserv screen drawing to bitmap context owned by plugin.
-									Actions step:
-									-Draw opaque window.
-									-Save screen content to a bitmap
-									-Instruct plugin to redirect wserv screen drawing to a bitmap device
-									-Draw the same window again
-									-Retrieve plugin bitmap and compare against  the saved bitmap
-		 @SYMTestExpectedResults	Bitmap content match
-		*/
-		CreateWindowL();		
-		TheClient->iScreen->CopyScreenToBitmap(iBefore);
-		DestroyWindowL();
-		iRedir->Redirect(CWsRedir::EFrontBuffer, ETrue);
-		return EWait;
-		}
-
-	if (iSubState==1)
-		{
-		++iSubState;
-		CreateWindowL();
-		TSize sz = iBefore->SizeInPixels();
-		TInt bytes = sz.iWidth*sz.iHeight*2; // EColor64K
-		iBefore->LockHeap();
-		TEST(Mem::Compare((const TUint8*)iFrontCopy->DataAddress(),bytes,(const TUint8*)iBefore->DataAddress(),bytes)==0);
-		iBefore->UnlockHeap();
-
-		Mem::FillZ(&iRedirInfo, sizeof(TRedirectorInfo));			
-		iRedir->QueryPlugin(iRedirInfo);
-		return EWait;
-		}
-
-	if (iSubState==2)
-		{
-		++iSubState;
-		/**
-		 @SYMTestCaseID				GRAPHICS-WSERV-0047
-		 @SYMTestCaseDesc			Screen update event
-		 @SYMTestPriority			Medium
-		 @SYMTestStatus				Implemented
-		 @SYMTestActions			Check plugin receive screen update event during redirection
-		 @SYMTestExpectedResults	Counter is non-zero
-		*/
-		TEST(iRedirInfo.iUpdateCounter>0);
-
-		DestroyWindowL();
-		/**
-		 @SYMTestCaseID				GRAPHICS-WSERV-0373
-		 @SYMREQ					GT247-CR0714
-		 @SYMTestCaseDesc			Stop wserv screen drawing redirection
-		 @SYMTestPriority			High
-		 @SYMTestStatus				Implemented
-		 @SYMTestActions			Stop wserv screen drawing redirection.
-									Actions step:
-									-Instruct plugin to stop wserv screen drawing redirection
-									-Draw the same window again
-									-Save screen content to another bitmap
-									-Compare the saved bitmap against newly saved bitmap
-		 @SYMTestExpectedResults	Bitmap content match
-		*/
-		iRedir->Redirect(CWsRedir::EFrontBuffer, EFalse);
-		return EWait;
-		}
-
-	if (iSubState==3)
-		{
-		++iSubState;
-		CreateWindowL();
-		TheClient->iScreen->CopyScreenToBitmap(iAfter);
-		TSize sz = iBefore->SizeInPixels();	
-		TInt bytes = sz.iWidth*sz.iHeight*2; // EColor64K	
-		iAfter->LockHeap();
-		TEST(Mem::Compare((const TUint8*)iAfter->DataAddress(),bytes,(const TUint8*)iBefore->DataAddress(),bytes)==0);
-		iAfter->UnlockHeap();
-		DestroyWindowL();
-
-		Mem::FillZ(&iRedirInfo, sizeof(TRedirectorInfo));			
-		iRedir->QueryPlugin(iRedirInfo);
-		return EWait;
-		}
-
-	/**
-	 @SYMTestCaseID				GRAPHICS-WSERV-0374
-	 @SYMTestCaseDesc			Screen update event
-	 @SYMTestPriority			Medium
-	 @SYMTestStatus				Implemented
-	 @SYMTestActions			Check plugin receive no screen update event when redirection is terminated
-	 @SYMTestExpectedResults	Counter is zero
-	*/
-	TEST(iRedirInfo.iUpdateCounter==0);
-
-	++(iTest->iState);
-	iSubState = 0;
-
-	return ENext;
-	}
-
-TestState CTWsGraphs::TestTextCursorUnderRedirectionL(TTestCursorType aCursorType)
-	{
-	/**
-	 @SYMTestCaseID				GRAPHICS-WSERV-0363
-	 @SYMTestCaseDesc			Text Cursor when drawing redirected
-	 @SYMTestPriority			Medium
-	 @SYMTestStatus				Implemented
-	 @SYMTestActions			Action steps:
-	 							- Draw the text cursor in the left side of the screen
-	 							- Re-direct the Front Buffer
-	 							- Move the text cursor to the right side of the screen
-	 							- Pause 0.5 seconds because this amount of time is needed
-								  to change from the flash ON phase to the flash OFF phase
-	 							- Stop re-directing
-	 							- See if when we exit re-direction in a different place in
-	 							  the phase of the text cursor flashing, whether we get
-	 							  non-text cursor drawing artefacts in the old location
-	 							  where the text cursor used to be
-	 @SYMTestExpectedResults	Left side of the screen does not show a Text Cursor
-	 */
-	
-	ASSERT(aCursorType == ETestStandardTextCursor || aCursorType == ETestCustomTextCursor);
-	
-	// Cursor Flash Period is 1 second (comprising two phases; ON and OFF)
-	const TInt KCursorFlashPeriod = 1000000;
-	const TInt KWaitForNextFlashPhase = KCursorFlashPeriod / 2;
-	
-	// Size of the cursor; it may be either a standard or custom text cursor
-	TSize cursorSize = (aCursorType == ETestStandardTextCursor) ? TSize(15, 20) : TSize(80, 80);
-		
-	// Original Text Cursor position in the left part of the screen
-	const TPoint originalCursorPos(45, 40);
-	
-	// New Text Cursor position in the right half of the screen
-	const TPoint newCursorPos((TheClient->iScreen->SizeInPixels().iWidth/2) + 45, 40);
-	
-	// Clean area of the screen which never had a text cursor
-	const TPoint cleanReferencePos(45, 40 + 80);
-	
-	/* Initial setup to get a window with a standard flashing text cursor */
-	if (iSubState == 0)
-		{
-		++iSubState;			
-		CreateWindowL(ETrue);
-		
-		if (aCursorType == ETestStandardTextCursor)
-			{
-			_LIT(KTestTextCursorUnderRedirection, "TestTextCursorUnderRedirection(Standard Cursor)");
-			INFO_PRINTF1(KTestTextCursorUnderRedirection);	
-			iTextCursor.iType=TTextCursor::ETypeRectangle;
-			iTextCursor.iHeight=cursorSize.iHeight;
-			iTextCursor.iAscent=0;
-			iTextCursor.iWidth=cursorSize.iWidth;
-			iTextCursor.iFlags=0; 			// means flash the cursor
-			iTextCursor.iColor=KRgbGreen;
-			iWin->SetTextCursor(originalCursorPos, iTextCursor);
-			}
-		else if (aCursorType == ETestCustomTextCursor)
-			{
-			_LIT(KTestTextCursorUnderRedirection, "TestTextCursorUnderRedirection(Custom Cursor)");
-			INFO_PRINTF1(KTestTextCursorUnderRedirection);	
-
-			TInt err = TheClient->iWs.SetCustomTextCursor(
-					KCustomTextCursorId,
-					iSpriteMemberArray.Array(),
-					ESpriteFlash,
-					RWsSession::ECustomTextCursorAlignTop
-					);
-			iTextCursor.iType=KCustomTextCursorId;
-			iTextCursor.iHeight=cursorSize.iHeight;
-			iTextCursor.iAscent=0;
-			iTextCursor.iWidth=cursorSize.iWidth;
-			iTextCursor.iFlags=TTextCursor::EFlagClipHorizontal; // means flash the cursor and clip the sprite
-			iTextCursor.iColor=KRgbCyan;
-			iWin->SetTextCursor(originalCursorPos, iTextCursor);
-			}
-		else
-			{
-			// unknown type of test being requested
-			ASSERT(0);
-			}
-		iWin->DrawFirstHalf();	
-		return EWait;
-		}
-	/*
-	 * Re-direct drawing to another Front Buffer.  Whilst re-directed, change the
-	 * position of the text cursor.  Then pause 0.5 seconds because this is how
-	 * long it will take to enter the next phase in the flashing cycle.  Finally
-	 * stop re-directing.  We exit the re-direction in a different point in the
-	 * phase of the text cursor from when we entered it.
-	 * This is key to testing for faulty behaviour.
-	 */
-	if (iSubState==1)
-		{
-		++iSubState;
-		User::After(KCursorFlashPeriod * 2);  // so its easy to visually review progress
-		iRedir->Redirect(CWsRedir::EFrontBuffer, ETrue);
-		iWin->SetTextCursor(newCursorPos, iTextCursor);
-		User::After(KWaitForNextFlashPhase);
-		iRedir->Redirect(CWsRedir::EFrontBuffer, EFalse);
-		return EWait;
-		}
-	/*
-	 * Paint the right hand side of the screen which should now have a text cursor.
-	 */
-	if (iSubState==2)
-		{
-		++iSubState;
-		iWin->DrawSecondHalf();
-		return EWait;
-		}
-	/*
-	 * Let the cursor flash a few times, as it assists manual viewing of the progress
-	 * of the test.
-	 */
-	if (iSubState==3)
-		{
-		++iSubState;
-		User::After(KCursorFlashPeriod * 3);
-		return EWait;
-		}
-	/*
-	 * Check to see if the text cursor did move to the right of the screen.
-	 */
-	if (iSubState==4)
-		{
-		++iSubState;
-		
-		/* When we do a screen comparison, we supply flag 0, which means
-		 * don't include the text cursor.  We do this because we are interested
-		 * in screen artefacts.
-		 */
-		TEST(TheClient->iScreen->RectCompare(
-				TRect(originalCursorPos, cursorSize),
-				TRect(cleanReferencePos, cursorSize),
-				0)); // must not supply CWsScreenDevice::EIncludeTextCursor
-		
-		return EWait;
-		}
-	/* Clean up */
-	if (iSubState==5)
-		{
-		++iSubState;
-		iWin->CancelTextCursor();
-		DestroyWindowL();
-		}
-	
-	iSubState = 0;
-
-	return ENext;
-	}
-
-/**
- @SYMTestCaseID				GRAPHICS-WSERV-0375
- @SYMREQ					GT247-CR0714
- @SYMTestCaseDesc			Redirect wserv flickerfree drawing to custom graphics context
- @SYMTestPriority			Medium
- @SYMTestStatus				Implemented
- @SYMTestActions			Redirect wserv flickerfree buffer drawing.
-							Action step:
-							-Draw opaque window (as background) and transparent window
-							-Save screen content to a bitmap
-							-Instruct plugin to redirect wserv flickerfree buffer drawing
-							-Draw the same opaque window and transparent window again
-							-Retrieve plugin bitmap and compare against the saved bitmap
- @SYMTestExpectedResults	Bitmap content match
-*/
-/**
- @SYMTestCaseID				GRAPHICS-WSERV-0376
- @SYMREQ					GT247-CR0714
- @SYMTestCaseDesc			Stop wserv flickerfree drawing redirection
- @SYMTestPriority			Medium
- @SYMTestStatus				Implemented
- @SYMTestActions			Stop wserv flickerfree buffer drawing redirection.
-							Action step:
-							-Instruct plugin to stop wserv filckerfree drawing redirection
-							-Draw the same opaque and transparent window
-							-Save screen content to another bitmap
-							-Compare saved bitmap against newly saved bitmap
- @SYMTestExpectedResults	Bitmap content match
-*/
-
-TestState CTWsGraphs::TestFlickerRedirectionL()
-	{
-	if (TransparencySupportedL()==KErrNotSupported)
-		{
-		++(iTest->iState);
-		return ENext;
-		}
-
-	// flush transparent window destruction created in TransparencySupportedL before
-	// proceeding with the test
-
-	TheClient->iWs.Flush();
-
-	if (iSubState==0)
-		{
-		_LIT(KTestFlickerRedirection, "TestFlickerRedirection");
-		INFO_PRINTF1(KTestFlickerRedirection);
-
-		++iSubState;
-
-		CreateWindowL();
-		CreateAlphaWindowL();
-		TheClient->iScreen->CopyScreenToBitmap(iBefore);
-		DestroyAlphaWindowL();
-		DestroyWindowL();
-		iRedir->Redirect(CWsRedir::EBackBuffer, ETrue);
-		return EWait;
-		}
-
-	if (iSubState==1)
-		{
-		++iSubState;
-		CreateWindowL();
-		CreateAlphaWindowL();
-		TSize sz = iBefore->SizeInPixels();
-		TInt bytes = sz.iWidth*sz.iHeight*2; // EColor64K
-		iBefore->LockHeap();
-		TInt ret=Mem::Compare((const TUint8*)iBackCopy->DataAddress(),bytes,(const TUint8*)iBefore->DataAddress(),bytes);
-		TEST(ret==0);
-		if (ret!=0)
-			{
-			_LIT(KLog,"The memory of two bitmaps doesn't match");
-			LOG_MESSAGE(KLog);
-			}
-		iBefore->UnlockHeap();
-		DestroyAlphaWindowL();
-		DestroyWindowL();
-		iRedir->Redirect(CWsRedir::EBackBuffer, EFalse);
-		return EWait;
-		}
-
-	CreateWindowL();
-	CreateAlphaWindowL();
-	TheClient->iScreen->CopyScreenToBitmap(iAfter);
-	TSize sz = iBefore->SizeInPixels();
-	TInt bytes = sz.iWidth*sz.iHeight*2; // EColor64K
-	iAfter->LockHeap();
-	TEST(Mem::Compare((const TUint8*)iAfter->DataAddress(),bytes,(const TUint8*)iBefore->DataAddress(),bytes)==0);
-	iAfter->UnlockHeap();
-	DestroyAlphaWindowL();
-	DestroyWindowL();
-
-	++(iTest->iState);
-	iSubState = 0;
-	return ENext;
-	}
-
-#endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-
-/**
- @SYMTestCaseID				GRAPHICS-WSERV-0377
- @SYMREQ					GT247-CR0714
- @SYMTestCaseDesc			Enable event notification
- @SYMTestPriority			Medium
- @SYMTestStatus				Implemented
- @SYMTestActions			Enable plugin to register to event notification.
-							Action step:
-							-Instruct plugin to register event handler
-							-Draw fullscreen window (plugin will receive window visibility changed event)
-							-Query visibility region from plugin side
-							-Compare window visible region against value obtained by plugin
- @SYMTestExpectedResults	Visible region match
-*/
-/**
- @SYMTestCaseID				GRAPHICS-WSERV-0378
- @SYMREQ					GT247-CR0714
- @SYMTestCaseDesc			Disable event notification
- @SYMTestPriority			Medium
- @SYMTestStatus				Implemented
- @SYMTestActions			Disable plugin to register to event notification.
-							Action step:
-							-Instruct plugin to unregister event handler
-							-Destroy fullscreen window (plugin will not receive window visibility changed event)
-							-Query visibility region from plugin side
-
- @SYMTestExpectedResults	Plugin does not receive events notification
-*/
-TestState CTWsGraphs::TestEventNotificationL()
-	{
-	if (iSubState==0)
-		{
-		_LIT(KTestEventNotification, "TestEventNotification");
-		INFO_PRINTF1(KTestEventNotification);
-
-		++iSubState;
-		iListen->Enable(ETrue);
-		CreateWindowL();
-		Mem::FillZ(&iListenInfo, sizeof(TListenerInfo));
-		TheClient->iWs.Finish();
-		TheClient->WaitForRedrawsToFinish();
-		iListen->QueryPlugin(iListenInfo);
-		return EWait;
-		}
-
-	if (iSubState==1)
-		{
-		++iSubState;
-		iListen->Enable(EFalse);
-		TEST(iListenInfo.iNumRect==1);
-		TEST(iListenInfo.iRect==TRect(TPoint(0,0),TheClient->iScreen->SizeInPixels()));
-		DestroyWindowL();
-		Mem::FillZ(&iListenInfo, sizeof(TListenerInfo));
-		iListen->QueryPlugin(iListenInfo);
-		iListen->Enable(EFalse);
-		DestroyWindowL();
-		return EWait;
-		}
-		
-	TEST(iListenInfo.iNumRect==0);
-	
-	++(iTest->iState);
-	iSubState = 0;
-	return ENext;
-	}
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-
-TestState CTWsGraphs::TestRedirectionUsingWsBackBufferL()
-	{
-	if (TransparencySupportedL()==KErrNotSupported)
-		{
-		++(iTest->iState);
-		return ENext;
-		}
-
-	// flush transparent window destruction created in TransparencySupportedL before
-	// proceeding with the test
-
-	TheClient->iWs.Flush();
-
-	if (iSubState==0)
-		{
-		_LIT(KTestRedirectionWsBack, "TestRedirectionUsingWsBackBuffer");
-		INFO_PRINTF1(KTestRedirectionWsBack);
-		
-		++iSubState;
-
-		/**
-		 @SYMTestCaseID				GRAPHICS-WSERV-0379
-		 @SYMTestCaseDesc			Redirect wserv flickerfree to MWsBackBuffer object
-		 @SYMTestPriority			Medium
-		 @SYMTestStatus				Implemented
-		 @SYMTestActions			-Draw opaque window (as background) and transparent window
-									-Save screen content to a bitmap
-									-Instruct plugin to redirect flickerfree buffer to MWsBackBuffer object
-									-Draw the same opaque window and transparent window again
-									-Retrieve plugin bitmap and compare against the saved bitmap
-		 @SYMTestExpectedResults	Bitmap content match
-		*/
-		((CTWsGraphsStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0379"));
-		CreateWindowL();
-		CreateAlphaWindowL();
-		TheClient->iScreen->CopyScreenToBitmap(iBefore);
-		DestroyAlphaWindowL();		
-		DestroyWindowL();		
-		iRedir->RedirectUsingWsBackBuffer(ETrue);
-		return EWait;
-		}
-
-	if (iSubState==1)
-		{
-		++iSubState;
-		CreateWindowL();
-		CreateAlphaWindowL();
-		TSize sz = iBefore->SizeInPixels();
-		TInt bytes = sz.iWidth*sz.iHeight*2; // EColor64K
-		iBefore->LockHeap();
-		TInt ret=Mem::Compare((const TUint8*)iBackCopy->DataAddress(),bytes,(const TUint8*)iBefore->DataAddress(),bytes);
-		TEST(ret==0);
-		if (ret!=0)
-			{
-			_LIT(KLog,"The memory of two bitmaps doesn't match");
-			LOG_MESSAGE(KLog);
-			}
-		iBefore->UnlockHeap();
-		DestroyAlphaWindowL();
-		DestroyWindowL();
-
-		/**
-		 @SYMTestCaseID				GRAPHICS-WSERV-0380
-		 @SYMTestCaseDesc			Restore wserv flickerfree redirection from MWsBackBuffer object
-		 @SYMTestPriority			Medium
-		 @SYMTestStatus				Implemented
-		 @SYMTestActions			-Instruct plugin to stop wserv filckerfree drawing redirection
-									-Draw the same opaque and transparent window
-									-Save screen content to another bitmap
-									-Compare saved bitmap against newly saved bitmap
-		 @SYMTestExpectedResults	Bitmap content match
-		*/
-		((CTWsGraphsStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0380"));
-		iRedir->RedirectUsingWsBackBuffer(EFalse);
-		return EWait;
-		}
-
-	CreateWindowL();
-	CreateAlphaWindowL();
-	TheClient->iScreen->CopyScreenToBitmap(iAfter);
-	TSize sz = iBefore->SizeInPixels();
-	TInt bytes = sz.iWidth*sz.iHeight*2; // EColor64K
-	iAfter->LockHeap();
-	TEST(Mem::Compare((const TUint8*)iAfter->DataAddress(),bytes,(const TUint8*)iBefore->DataAddress(),bytes)==0);
-	iAfter->UnlockHeap();
-	DestroyAlphaWindowL();
-	DestroyWindowL();
-/**
-	@SYMTestCaseID	GRAPHICS-WSERV-0527
-*/
-	((CTWsGraphsStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0527"));
-	++(iTest->iState);
-	iSubState = 0;
-	return ENext;
-	}
-
-#endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-
-//A call to do coverage through a plugin. 
-//This can serve as a basis for future coverage to objects exposed by the
-//plugin. For now a single simple test is implmeneted.
-TestState CTWsGraphs::TestGraphicDrawerCoverage()
-	{
-	__ASSERT_ALWAYS(iGdCoverage->RunTest(1)==KErrNone||KErrNotReady, User::Invariant());
-	return ENext;
-	}
-
-//Simplified non-functional class to create a few dummy CWsGraphicDrawer instances.
-//This code is intended to test the Array class, not the Drawer.
-//Note that this object is not at all functional! The only guaranteed method is Id().
-//WsGraphicDrawer is declared as a friend and is actually intended to be the factory class for CWsGraphicDrawer
-class WsGraphicDrawer:public CWsGraphicDrawer
-	{
-public:
-	WsGraphicDrawer()
-		{
-		}
-	//stub for virtual construction. Most members are ignored
-	virtual void ConstructL(MWsGraphicDrawerEnvironment& ,const TGraphicDrawerId& id,MWsClient& ,const TDesC8& )
-		{
-		ConstructL(id);
-		}
-	//simplified custom construction
-	void ConstructL(const TGraphicDrawerId& id)
-		{
-		MWsGraphicDrawerEnvironment* nullEnv=NULL;
-		MWsGraphicDrawerEnvironment& aEnv=*nullEnv;
-		MWsClient* nullClient=NULL;
-		MWsClient& aOwner=*nullClient;
-		this->BaseConstructL(aEnv,id,aOwner);
-		this->iDtor_ID_Key=TUid::Null();
-		
-		}
-	//stubs for pure virtual methods
-	virtual void HandleMessage(const TDesC8& )
-		{}
-	virtual void DoDraw(MWsGc& ,const TRect& ,const TDesC8& ) const
-		{}
-	
-	};
-//Class to allow me to pre-allocate the CWsGraphicDrawerArray so it doesn't pop up a false-positive memory allocation!
-class DummyCleanup:public TCleanupItem
-	{
-public:
-	static void CleanUp(TAny*)		{}
-	DummyCleanup(): TCleanupItem(CleanUp,this)	{}
-	operator DummyCleanup*()	{	return this;	}
-	
-	};
-
-//Helper function to explain test fails. Most other tests are against KErrNone
-void CTWsGraphs::ReportNegativeResultfail(TInt aLine,TInt aResult,TInt aExpectedResult)
-	{
-	testBooleanTrue((aResult==aExpectedResult), (TText8*)__FILE__, aLine);
-	if (aResult!=aExpectedResult)
-		{
-		INFO_PRINTF3(_L("Expected return code %i, got %i"),aExpectedResult,aResult);	
-		}
-	
-	}
-	
-//This is an attempt to use wserv test's pre-existing Panic handler to perform some negative tests.
-//At present this handler appears to be broken:
-// 1) It doesn't write to the correct html log file
-// 2) It no longer writes to the WSERV.LOG file it was writing to a few versions ago
-// 3) It doesn't close the panic window so subsequent tests that check the display output fail.
-//That was a waste of effort.
-struct CTWsGraphs::WrapTestCall
-	{
-	CTWsGraphs* thisThis;
-	TUint		testCount;
-	TBool		continueTests;
-	TUint 		testFailedLine;
-	//This field was intended to allow threaded panicing tests to report other errors
-	//As I can't get threaded panicing tests to operate correctly, I have not implemented support for the field.
-	//TBuf<1024>	errorMessages;	
-		
-	WrapTestCall (	CTWsGraphs* thisThis,	TUint		testCount):
-		thisThis(thisThis),	testCount(testCount)
-		{	continueTests=false;testFailedLine=0;	}
-	};
-	
-TInt	CTWsGraphs::DoNegTestCall(TInt /*aInt*/, TAny *aPtr)
-	{
-	CTWsGraphs::WrapTestCall* aWrap=static_cast<CTWsGraphs::WrapTestCall*>(aPtr);
-	aWrap->continueTests=aWrap->thisThis->NegTestAddSwapGDArrayL(aWrap->testCount,aWrap);	
-	return 0;
-	}
-	
-TBool	CTWsGraphs::LaunchNegTestCall(TUint		aTestCount,TUint PanicCode,const TDesC &aPanicCategory)
-	{
-	WrapTestCall wt(this,aTestCount);
-	(void)PanicCode;
-	(void)aPanicCategory;
-//I have disabled the panicing tests because they don't output diagnostics 
-//and the open panic window causes subsequent screen bitmap comparrisson tests to fail.
-//	iTest->TestPanicL(DoNegTestCall,aPanicCode,3,&wt,aPanicCategory);
-	return wt.continueTests;	
-	}
-
-/**
-	Loops through all the positive and negative tests associated with the  GraphicDrawerArray.
-	The aim is to perform isolated testing of these classes as some are not currently being used.
-	
-**/
-void CTWsGraphs::TestAddSwapGDArrayL()
-	{
-
-
-	INFO_PRINTF1(_L("Positive tests for GraphicDrawerArray"));
-	for (TInt i=0;PosTestAddSwapGDArrayL(i);i++)
-		{}
-
-
-
-	INFO_PRINTF1(_L("Verifying that negative tests for GraphicDrawerArray don't actually panic"));
-	for (TInt i=1;NegTestAddSwapGDArrayL(i);i++)
-		{}
-	}
-/**
-	Resets and deallocates the GDA withoud deleting the objects.
-	@param 	 testArray	the array to reset
-	@return true if the array was already empty.
-**/
-static bool	ResetArray(CWsGraphicDrawerArray& testArray)
-{
-	bool rv=(testArray.IsEmpty());
-	MWsClient* nullClient=NULL;
-	testArray.RemoveAll(*nullClient);
-	testArray.ResetAndDestroy();		
-	return rv;
-}
-/**
-   @SYMTestCaseID GRAPHICS-WSERV-AddSwapGDArray-0001
-   @SYMDEF			DEF093926  
-  
-   @SYMTestCaseDesc DEF093926: Check for stability of Add and Swap unwind methods in isolation.
-   		Note that this code is testing the functionality of a class internal to CWindowServer.
-   		At present CWindowServer presents just a simple shim on this class, 
-   		but if that implementation of  CWindowServer changes than this test will be redudant.
-   
-   @SYMTestPriority High
-   
-   @SYMTestStatus Implemented
-   
-   @SYMTestActions
-	The sequence for each of these positive test sections is pretty much the same:
-	Add one record with id 1234(test for errors)
-	Add one record with id Badf00d
-	Swap with another record with id Badf00d
-	Remove 2 records
-	result=no leaks
-	
-		Add/Swap: no Cleanup item - no leaks after Remove the added items
-   	    AddTLC/SwapTLC: Cleanup item requires Commit - check for no leaks after Remove.
-   	    AddTLC/SwapTLC: Cleanup item gets executed by forced Leave  - check for no leaks after.
-		AddTLC, SwapTLC in allocation failure scenarios. Add/Swap don't allocate anything!
-		obsoleted AddLC/SwapLC to ensure correct function when forced Leave - check for no leaks after
-		obsoleted AddLC/SwapLC to ensure correct function. These will always leak in good case.
-   @SYMTestExpectedResults 
-   		no exceptions or panics within this fn. 
-   		only the old AddLC and SwapLC should leak as indicated.
- */
-TBool CTWsGraphs::PosTestAddSwapGDArrayL(TInt testcase)
-	{
-	((CTWsGraphsStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-AddSwapGDArray-0001"));
-    CWsGraphicDrawerArray testArray;
-    //Represents the memory cached in the array once it has been used even when it is then resized to zero
-#if defined(_DEBUG)
-    const TInt KArrayMemUseBaseline=1;
-#endif
-    //Use testArray.IsEmpty() to prove the array is clear when it should be!
-    TGraphicDrawerId id1234=  	{  	1234,		EFalse    	};
-    TGraphicDrawerId idBADF00D=	{  	0xBADF00D,	EFalse    	};
-    WsGraphicDrawer dg1234;		
-    dg1234.ConstructL(id1234);
-    WsGraphicDrawer dgBADF00D;	
-    dgBADF00D.ConstructL(idBADF00D);
-    WsGraphicDrawer dgBADF00D_2;
-    dgBADF00D_2.ConstructL(idBADF00D);
-    CWsGraphicDrawerArray::XRollBackBase* rollBack1;
- 	TInt errCode=KErrAbort;
-	TInt leaveCode=KErrNone;
-	DummyCleanup markerCleanup;
-	CleanupStack::PushL(markerCleanup);	 //This allows me to check the stack is clear!
-	//expected result of this fn: no exceptions or panics. 
-	//Put as much as you like in here, so long as it shouldn't fail.
-	
-	__UHEAP_MARK;
-			__UHEAP_CHECK(0);
-	TUint expectedLeakCount=0;
-	TBool returnCode=ETrue;
-	switch (testcase)
-		{
-		case 0:
-
-			INFO_PRINTF1(_L("Sub test P0: AddL/Swap: no Cleanup item"));
-			TEST(testArray.IsEmpty());
-				TRAP(leaveCode,errCode=testArray.Add(&dg1234));
-			TEST(errCode==KErrNone);
-			TEST(leaveCode==KErrNone);
-			TEST(!testArray.IsEmpty());
-				TRAP(leaveCode,errCode=testArray.Add(&dgBADF00D));
-			TEST(errCode==KErrNone);
-			TEST(leaveCode==KErrNone);
-				TRAP(leaveCode,errCode=testArray.Swap(&dgBADF00D_2));
-			TEST(errCode==KErrNone);
-			TEST(leaveCode==KErrNone);
-				TRAP(leaveCode,errCode=testArray.Remove(dg1234.Id()));			
-			TEST(errCode==KErrNone);
-			TEST(leaveCode==KErrNone);
-				//Note that it is the ID that matters here... dgBADF00D & dgBADF00D_2 have same id.
-				TRAP(leaveCode,errCode=testArray.Remove(dgBADF00D_2.Id()));			
-			TEST(errCode==KErrNone);
-			TEST(leaveCode==KErrNone);
-			TEST(testArray.IsEmpty());
-		break;
-		//
-		case 1:
-			INFO_PRINTF1(_L("Sub test P1: AddTLC/SwapTLC: Cleanup item requires Commit."));
-			
-			rollBack1=NULL;
-			TEST(testArray.IsEmpty());
-			TRAP(leaveCode,
-				rollBack1=testArray.AddTLC(&dg1234);
-				CleanupStack::Check(rollBack1);
-				testArray.CommitP(rollBack1);	
-				)
-			TEST(rollBack1!=NULL);
-			TEST(leaveCode==KErrNone);
-			TEST(!testArray.IsEmpty());
-			rollBack1=NULL;
-			TRAP(leaveCode,
-				rollBack1=testArray.AddTLC(&dgBADF00D);
-				CleanupStack::Check(rollBack1);
-				testArray.CommitP(rollBack1);	
-				)
-			TEST(rollBack1!=NULL);
-			TEST(leaveCode==KErrNone);
-			rollBack1=NULL;
-			TRAP(leaveCode,
-				rollBack1=testArray.SwapTLC(&dgBADF00D_2);
-				CleanupStack::Check(rollBack1);
-				testArray.CommitP(rollBack1);	
-				)
-			TEST(rollBack1!=NULL);
-			TEST(leaveCode==KErrNone);
-			rollBack1=NULL;
-			TRAP(leaveCode,
-				rollBack1=testArray.RemoveTLC(dg1234.Id());
-				CleanupStack::Check(rollBack1);
-				testArray.CommitP(rollBack1);	
-				)
-			TEST(rollBack1!=NULL);
-			TEST(leaveCode==KErrNone);
-			rollBack1=NULL;
-				TRAP(leaveCode,
-				rollBack1=testArray.RemoveTLC(dgBADF00D_2.Id());			
-				CleanupStack::Check(rollBack1);
-				testArray.CommitP(rollBack1);	
-				)
-			TEST(rollBack1!=NULL);
-			TEST(leaveCode==KErrNone);
-			rollBack1=NULL;
-			TEST(testArray.IsEmpty());
-		break;
-		//
-		case 2:
-			INFO_PRINTF1(_L("Sub test P2: AddTLC/SwapTLC: Cleanup item gets executed."));
-			
-			rollBack1=NULL;
-			TEST(testArray.IsEmpty());
-			TRAP(leaveCode,
-				rollBack1=testArray.AddTLC(&dg1234);
-				User::Leave(1234);
-				);	
-			TEST(rollBack1!=NULL);
-			TEST(leaveCode==1234);
-			TEST(testArray.IsEmpty());
-			rollBack1=NULL;
-			CleanupStack::Check(markerCleanup);
-			__UHEAP_CHECK(KArrayMemUseBaseline);
-
-			TRAP(leaveCode,	errCode=testArray.Add(&dgBADF00D));
-			TEST(errCode==KErrNone);
-			TEST(leaveCode==KErrNone);
-			rollBack1=NULL;
-			TRAP(leaveCode,
-				rollBack1=testArray.SwapTLC(&dgBADF00D_2);
-				User::Leave(1234);
-				);	
-			TEST(rollBack1!=NULL);
-			TEST(leaveCode==1234);
-			TEST(!testArray.IsEmpty());
-			rollBack1=NULL;
-			TRAP(leaveCode,
-				rollBack1=testArray.RemoveTLC(dgBADF00D_2.Id());
-				TEST(testArray.IsEmpty());
-				User::Leave(1234);
-				);	
-			TEST(rollBack1!=NULL);
-			TEST(leaveCode==1234);
-			TEST(!testArray.IsEmpty());
-			
-			
-				TRAP(leaveCode,errCode=testArray.Remove(dgBADF00D_2.Id()));			
-			TEST(errCode==KErrNone);
-			TEST(leaveCode==KErrNone);
-			TEST(testArray.IsEmpty());
-			rollBack1=NULL;
-		break;
-		//
-		case 3:
-			INFO_PRINTF1(_L("Sub test P3: AddLC/SwapLC: Cleanup item gets executed - doesn't leak"));
-			TEST(testArray.IsEmpty());
-			TRAP(leaveCode,
-				testArray.AddLC(&dg1234);
-				User::Leave(1234);
-				);	
-			TEST(leaveCode==1234);
-			TEST(testArray.IsEmpty());
-			rollBack1=NULL;
-		__UHEAP_CHECK(KArrayMemUseBaseline);	  //because it threw it didn't leak
-			
-			//use my new method to add the object to be swapped out so no leak
-			TRAP(leaveCode,errCode=testArray.Add(&dgBADF00D));
-			TEST(errCode==KErrNone);
-			TEST(leaveCode==KErrNone);
-		__UHEAP_CHECK(KArrayMemUseBaseline);	  //new method doesn't leak.
-			rollBack1=NULL;
-			TRAP(leaveCode,
-				errCode=testArray.SwapLC(&dgBADF00D_2);
-				User::Leave(1234);
-				);	
-			TEST(errCode==KErrNone);
-			TEST(leaveCode==1234);
-			TEST(!testArray.IsEmpty());
-			
-				TRAP(leaveCode,errCode=testArray.Remove(dgBADF00D_2.Id()));			
-			TEST(errCode==KErrNone);
-			TEST(leaveCode==KErrNone);
-			TEST(testArray.IsEmpty());
-			rollBack1=NULL;
-		break;
-		//
-		case 4:
-	
-		//I don't really care whether the individual calls succeed or fail, 
-		//just whether it leaks overall, and that the error codes correspond to no-action
-		for (TInt faultRate=1;faultRate<5;faultRate++)
-			{
-			INFO_PRINTF2(_L("Sub test P4: Add/Swap: memory faulting %i"),faultRate);
-			__UHEAP_SETFAIL(RAllocator::EDeterministic,faultRate);
-			TInt err1=KErrNone;
-			rollBack1=NULL;
-			TRAP(leaveCode,
-				errCode=testArray.Add(&dg1234);
-				)
-			err1=errCode;
-			__UHEAP_SETFAIL(RAllocator::ENone,0);
-			TRAP(leaveCode,errCode=testArray.Add(&dgBADF00D));
-			__UHEAP_SETFAIL(RAllocator::EDeterministic,faultRate);
-			rollBack1=NULL;
-			TRAP(leaveCode,
-				errCode=testArray.Swap(&dgBADF00D_2);
-				)
-			__UHEAP_SETFAIL(RAllocator::ENone,0);
-			//If the first Add fails then the object should not be removed
-			if (!err1)
-				{
-				TRAP(leaveCode,errCode=testArray.Remove(dg1234.Id()));			
-				TEST(errCode==KErrNone);
-				TEST(leaveCode==KErrNone);
-				}
-			//If the swap fails, then the add still needs to be removed
-			//Note that it is the ID that matters here... dgBADF00D & dgBADF00D_2 have same id.
-			TRAP(leaveCode,errCode=testArray.Remove(dgBADF00D_2.Id()));			
-			TEST(errCode==KErrNone);
-			TEST(leaveCode==KErrNone);
-			TEST(testArray.IsEmpty());
-			ResetArray(testArray);
-			CleanupStack::Check(markerCleanup);
-			__UHEAP_CHECK(0);
-			}
-		break;
-		//
-		case 5:
-				
-		//I don't really care whether the individual calls succeed or fail, 
-		//just whether it leaks overall, and that the error codes correspond to no-action
-		for (TInt faultRate=1;faultRate<5;faultRate++)
-			{
-			INFO_PRINTF2(_L("Sub test P5: AddTLC/SwapTLC: memory faulting %i"),faultRate);
-			__UHEAP_SETFAIL(RAllocator::EDeterministic,faultRate);
-			TInt err1=KErrNone,err2=KErrNone,err3=KErrNone;
-			rollBack1=NULL;
-			TRAP(leaveCode,
-				rollBack1=testArray.AddTLC(&dg1234);
-				CleanupStack::Check(rollBack1);
-				testArray.CommitP(rollBack1);	
-				)
-			err1=leaveCode;
-			__UHEAP_SETFAIL(RAllocator::ENone,0);
-			TRAP(leaveCode,errCode=testArray.Add(&dgBADF00D));
-			__UHEAP_SETFAIL(RAllocator::EDeterministic,faultRate);
-			rollBack1=NULL;
-			TRAP(leaveCode,
-				rollBack1=testArray.SwapTLC(&dgBADF00D_2);
-				CleanupStack::Check(rollBack1);
-				testArray.CommitP(rollBack1);	
-				)
-			//If the first Add fails then the object should not be removed
-			if (!err1)
-				{
-				TRAP(leaveCode,
-					rollBack1=testArray.RemoveTLC(dg1234.Id());			
-					CleanupStack::Check(rollBack1);
-					testArray.CommitP(rollBack1);	
-					)
-				err2=leaveCode;
-				}
-			//If the swap fails, then the add still needs to be removed
-			//Note that it is the ID that matters here... dgBADF00D & dgBADF00D_2 have same id.
-			TRAP(leaveCode,
-					rollBack1=testArray.RemoveTLC(dgBADF00D_2.Id());
-					CleanupStack::Check(rollBack1);
-					testArray.CommitP(rollBack1);	
-					)
-			err3=leaveCode;
-			
-			
-			__UHEAP_SETFAIL(RAllocator::ENone,0);
-			//If the Removes failed then the object should be removed again
-			if (err2)
-				{
-				TRAP(leaveCode,errCode=testArray.Remove(dg1234.Id()));			
-				TEST(errCode==KErrNone);
-				TEST(leaveCode==KErrNone);
-				}
-			if (err3)
-				{
-				TRAP(leaveCode,errCode=testArray.Remove(dgBADF00D_2.Id()));			
-				TEST(errCode==KErrNone);
-				TEST(leaveCode==KErrNone);
-				}
-			TEST(testArray.IsEmpty());
-			ResetArray(testArray);
-			CleanupStack::Check(markerCleanup);
-			__UHEAP_CHECK(0);
-			}
-				
-		break;
-		//
-		case 6:
-	//this set does leak:
-	
-		INFO_PRINTF1(_L("Sub test P6: AddLC/SwapLC: Cleanup item gets popped - unfixable leaks"));
-			TEST(testArray.IsEmpty());
-			TRAP(leaveCode,
-				testArray.AddLC(&dg1234);
-				CleanupStack::Pop();
-				);	
-			TEST(leaveCode==KErrNone);
-			TEST(!testArray.IsEmpty());
-		
-		CleanupStack::Check(markerCleanup);
-		__UHEAP_CHECK(KArrayMemUseBaseline+1);	
-			
-			TRAP(leaveCode,
-				testArray.AddLC(&dgBADF00D);
-				CleanupStack::Pop();
-				)
-			TEST(leaveCode==KErrNone);
-		CleanupStack::Check(markerCleanup);
-		__UHEAP_CHECK(KArrayMemUseBaseline+2);	
-			rollBack1=NULL;
-			TRAP(leaveCode,
-				errCode=testArray.SwapLC(&dgBADF00D_2);
-				CleanupStack::Pop();
-				);	
-			TEST(errCode==KErrNone);
-			TEST(leaveCode==KErrNone);
-			TEST(!testArray.IsEmpty());
-				TRAP(leaveCode,errCode=testArray.Remove(dg1234.Id()));			
-			TEST(errCode==KErrNone);
-			TEST(leaveCode==KErrNone);
-				TRAP(leaveCode,errCode=testArray.Remove(dgBADF00D_2.Id()));			
-			TEST(errCode==KErrNone);
-			TEST(leaveCode==KErrNone);
-			TEST(testArray.IsEmpty());
-			rollBack1=NULL;
-			expectedLeakCount=3;
-		break;
-		//
-		case 7:
-			returnCode=EFalse;
-		break;
-		}
-	ResetArray(testArray);
-	CleanupStack::Check(markerCleanup);
-	__UHEAP_CHECK(expectedLeakCount);
-	__UHEAP_MARKENDC(expectedLeakCount);
-	if (expectedLeakCount!=0)
-		{	//Ensure that the leaked items are no longer associated with this debug level.
-			//Note that __DbgSetAllocFail(FALSE,RAllocator::EReset,1) resets the debug level to 0, 
-			//so levels can't be nested when using this call.
-		__UHEAP_MARK;			
-	    __UHEAP_TOTAL_RESET;	
-		INFO_PRINTF2(_L("Anticipated %i leaks declassified"),expectedLeakCount);	//can't get here if wrong
-		}
-			
-	CleanupStack::PopAndDestroy(markerCleanup);
-	((CTWsGraphsStep*)iStep)->RecordTestResultL();
-	return returnCode;
-	}
-
-/**
-	@param 	failcase		index to test to perform
-	@param	aWrappedParams  represents inter-thread information when test is run on a private thread
-				if aWrappedParams is NULL then the test is running on the main thread.
-	@return true if there are higher-numbered fail cases.
-
-   @SYMTestCaseID GRAPHICS-WSERV-NegAddSwapGDArray-0001
-   @SYMDEF			DEF093926  
-  
-   @SYMTestCaseDesc DEF093926: Check for stability of Add and Swap unwind methods in isolation,
-   					specifically checking that bad inputs are rejected gracefully.
-   		Note that this code is testing the functionality of a class internal to CWindowServer.
-   		At present CWindowServer presents just a simple shim on this class, 
-   		but if that implementation of  CWindowServer changes than this test will be redudant.
-   
-   @SYMTestPriority High
-   
-   @SYMTestStatus Implemented
-   
-   @SYMTestActions
-   
-		Add/Swap: no Cleanup item - no leaks after Remove the added items
-   	    AddTLC/SwapTLC: Cleanup item requires Commit - check for no leaks after Remove.
-   	    AddTLC/SwapTLC: Cleanup item gets executed by forced Leave  - check for no leaks after.
-		AddTLC, SwapTLC in allocation failure scenarios. Add/Swap don't allocate anything!
-		obsoleted AddLC/SwapLC to ensure correct function when forced Leave - check for no leaks after
-		obsoleted AddLC/SwapLC to ensure correct function. These will always leak in good case.
-	Calls NegTestAddSwapGDArrayL.	
-	case 1/2/3: Tests AddL, AddLC, AddTLC that a NULL input is rejected
-	case 4/5/6: Tests SwapL, SwapLC, SwapTLC that a NULL input is rejected
-	case 7/8/9: Tests AddL, AddLC, AddTLC that a repeat input is rejected
-	case 10/11/12: Tests SwapL, SwapLC, SwapTLC that a non-repeat input is rejected
-   @SYMTestExpectedResults 
- */
-TBool CTWsGraphs::NegTestAddSwapGDArrayL(TInt failcase,WrapTestCall*aWrappedParams)
-	{
-	((CTWsGraphsStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-NegAddSwapGDArray-0001"));
-	_LIT(KCategory,"WsGraphicDrawer");
-	if (!aWrappedParams)
-		{
-		INFO_PRINTF2(_L("NegTestAddSwapGDArrayL Negative sub test %i"),failcase);
-		};
-    CWsGraphicDrawerArray testArray;
-    TGraphicDrawerId id1234=  	{  	1234,		EFalse    	};
-    TGraphicDrawerId idBADF00D=	{  	0xBADF00D,	EFalse    	};
-    WsGraphicDrawer dg1234;		
-    dg1234.ConstructL(id1234);
-    WsGraphicDrawer dgBADF00D;	
-    dgBADF00D.ConstructL(idBADF00D);
-    WsGraphicDrawer dgBADF00D_2;
-    dgBADF00D_2.ConstructL(idBADF00D);
-    CWsGraphicDrawerArray::XRollBackBase* rollBack1=NULL;
- 	TInt errCode=KErrAbort;
-	TInt leaveCode=KErrNone;
-	TBool	returnMoreTests=ETrue;
-	DummyCleanup markerCleanup;
-	TBool mayPanic=EFalse;
-#ifdef __WINS__
-	mayPanic=ETrue;
-#endif
-
-	CleanupStack::PushL(markerCleanup);	 //This allows me to check the stack is clear!
-	__UHEAP_MARK;
-	
-	switch (failcase)
-		{
-		case 1:	//NULL arg: expected result:  returns KErrArgument
-	    	TRAP(leaveCode,
-	    		errCode=testArray.Add(NULL);
-	    		)
-			TEST(leaveCode==KErrNone);
-	    	ReportNegativeResultfail(__LINE__,errCode,KErrArgument);
-	    break;
-		case 2:	//NULL arg: expected result: throws KErrArgument
-			TRAP(leaveCode,	
-				rollBack1=testArray.AddTLC(NULL);
-				TEST(EFalse);	//Should never get here!
-				)
-			TEST(rollBack1==NULL);
-	    	ReportNegativeResultfail(__LINE__,leaveCode,KErrArgument);
-	    break;
-		case 3:	//NULL arg: expected result: debug: panic. In release doesn't return any information!
-			if (!aWrappedParams && mayPanic)
-				{
-			    LaunchNegTestCall(failcase,EWsGraphicDrawerPanicBadArgument,KCategory);
-				}
-			else
-				{
-				TRAP(leaveCode,
-					testArray.AddLC(NULL);
-					User::Leave(1234);  //Panics before here in debug. No leak if cleanup is taken.
-					);	
-				TEST(leaveCode==1234);	//Panics before here in debug
-				}
-	    break;
-		//
-		case 4:	//NULL arg: expected result: returns KErrArgument
-	    	TRAP(leaveCode,
-	    		errCode=testArray.Swap(NULL)
-	    		)
-			TEST(leaveCode==KErrNone);
-	    	ReportNegativeResultfail(__LINE__,errCode,KErrArgument);
-	    break;
-		case 5:	//expected result:  throws KErrArgument
-			TRAP(leaveCode,
-				rollBack1=testArray.SwapTLC(NULL);
-				testArray.CommitP(rollBack1);
-				)
-			TEST(rollBack1==NULL);
-	    	ReportNegativeResultfail(__LINE__,leaveCode,KErrArgument);
-	    break;
-		case 6:	//NULL arg: expected result: debug: panic. In release doesn't return any information!
-			if (!aWrappedParams && mayPanic)
-				{
-			    LaunchNegTestCall(failcase,EWsGraphicDrawerPanicBadArgument,KCategory);
-				}
-			else
-				{
-				TRAP(leaveCode,
-					errCode=testArray.SwapLC(NULL);
-					User::Leave(1234);  //Panics before here in debug. No leak if cleanup is taken.
-					);
-				TEST(leaveCode==1234);	//Panics before here in debug
-				TEST(errCode==KErrNotFound);
-				}
-		break;
-		//
-		case 7:	//Add overwrites: expected result: returns KErrAlreadyExists
-	    	TRAP(leaveCode,
-	    		errCode=testArray.Add(&dg1234);
-	    		)
-			TEST(errCode==KErrNone);
-			TEST(leaveCode==KErrNone);
-	    	TRAP(leaveCode,
-	    		errCode=testArray.Add(&dg1234);		//oops! Already added!
-	    		)
-			TEST(leaveCode==KErrNone);
-	    	ReportNegativeResultfail(__LINE__,errCode,KErrAlreadyExists);
-	    break;
-		case 8:	//Add overwrites: expected result:  throws KErrAlreadyExists
-	    	TRAP(leaveCode,
-	    		errCode=testArray.Add(&dg1234);
-	    		)
-			TEST(errCode==KErrNone);
-			TEST(leaveCode==KErrNone);
-			TRAP(leaveCode,	
-				rollBack1=testArray.AddTLC(&dg1234);		//oops! Already added!
-				testArray.CommitP(rollBack1);
-				)
-			TEST(rollBack1==NULL);
-	    	ReportNegativeResultfail(__LINE__,leaveCode,KErrAlreadyExists);
-	    break;
-		case 9:	//Add overwrites: expected result: debug: does not panic, but throws KErrAlreadyExists.
-	    	TRAP(leaveCode,
-	    		errCode=testArray.Add(&dg1234);
-	    		)
-			TEST(errCode==KErrNone);
-			TEST(leaveCode==KErrNone);
-			TRAP(leaveCode,
-					testArray.AddLC(&dg1234);		//oops! Already added! Should leave.
-					User::Leave(1234);  //Should leave before here! No leak if cleanup is taken.
-				);	
-	    	ReportNegativeResultfail(__LINE__,leaveCode,KErrAlreadyExists);
-	    break;
-		//
-		case 10:	//Swap empty slot: expected result:  returns KErrNotFound
-	    	TRAP(leaveCode,
-	    		errCode=testArray.Swap(&dg1234) 		//oops! Nothing to swap with!
-	    		)
-			TEST(leaveCode==KErrNone);
-	    	ReportNegativeResultfail(__LINE__,errCode,KErrNotFound);
-	    break;
-		case 11:	//Swap empty slot: expected result: throws KErrNotFound
-			TRAP(leaveCode,
-				rollBack1=testArray.SwapTLC(&dg1234);		//oops! Nothing to swap with!
-				testArray.CommitP(rollBack1);
-				)
-			TEST(rollBack1==NULL);
-	    	ReportNegativeResultfail(__LINE__,leaveCode,KErrNotFound);
-	    break;
-		case 12:	//Swap empty slot: expected result: debug: panic. In release doesn't return any information!
-			if (!aWrappedParams && mayPanic)
-				{
-			    LaunchNegTestCall(failcase,EWsGraphicDrawerPanicBadArgument,KCategory);
-				}
-			else
-				{
-				TRAP(leaveCode,
-					errCode=testArray.SwapLC(&dg1234);		//oops! Nothing to swap with!
-					User::Leave(1234);  //Panics before here in debug. No leak if cleanup is taken.
-					);	
-				TEST(leaveCode==1234);			//Panics before here in debug
-				TEST(errCode==KErrNotFound);	//Panics before here in debug
-				}
-	    break;
-	    
-		//
-		default:
-			returnMoreTests=EFalse;
-		}
-	ResetArray(testArray);
-	CleanupStack::Check(markerCleanup);
-	__UHEAP_CHECK(0);
-	__UHEAP_MARKENDC(0);
-    testArray.Close();
-//    CWsGraphicDrawerArray::testArrayValidator::ResetArray(&testArray);
-	CleanupStack::PopAndDestroy(markerCleanup);
-	return returnMoreTests;
-	}
-
-/**
-   @SYMTestCaseID 	GRAPHICS-WSERV-LeakInService-0001
-   @SYMDEF			DEF093926  
-   @SYMTestCaseDesc Check for leaks over repeated re-assignments.
-   
-   @SYMTestPriority High
-   
-   @SYMTestStatus Implemented
-   
-   @SYMTestActions 
-   Repeatedly create the same bitmap instance
-   After a few initial wobbles in the server-side HeapCount it should not increase
-   5 calls are made without checking the level, then 5 more check the level.
-   Note that as we are testing the main server heap, 
-   other threads may interrupt and perform operations that change the memory figures.
-   
-   @SYMTestExpectedResults The CWsGraphicBitmap objects are created and no leaks are reported.
- */	
-void CTWsGraphs::DoTestLeakInServiceL()
-	{
-		INFO_PRINTF1(_L("DoTestLeakInServiceL"));
-		const TInt prepCount=5;
-		const TInt testCount=5;
-		
-				
-		TUid uid1 = {0x10000001};
-		TUid uid2 = {0x10000002};
-		 
-		TWsGraphicId twsGraphicId1(uid1);
-		TEST(twsGraphicId1.Uid()==uid1);
-		
-		TWsGraphicId twsGraphicId2(uid2);
-		TEST(twsGraphicId2.Uid()==uid2);
-		
-		TWsGraphicId twsGraphicId3(twsGraphicId2);
-		TEST(twsGraphicId3.Uid()==uid2);
-		
-		TWsGraphicId twsGraphicId4(1);
-		twsGraphicId4.Set(uid1);
-		TEST(twsGraphicId4.Uid()==uid1);		
-
-		TSize screenSize = TheClient->iScreen->SizeInPixels();
-		
-		__UHEAP_RESET;
-		__UHEAP_MARK;
-		// Create local shared CWsGraphicBitmap	
-		// Repeat operation for any sign of memory leak...	
-		CFbsBitmap bitmap2;
-		CFbsBitmap mask2;		
-		
-		bitmap2.Create(screenSize,TheClient->iScreen->DisplayMode());
-		mask2.Create(bitmap2.SizeInPixels(),TheClient->iScreen->DisplayMode());
-			
-		TInt c0=TheClient->iWs.HeapCount();
-		CWsGraphicBitmap* bTestX = CWsGraphicBitmap::NewL(twsGraphicId2.Uid(), &bitmap2,&mask2);		
-		for (TInt i=0;i<prepCount;i++)
-			{
-			//TInt c2=TheClient->iWs.HeapCount();
-			delete bTestX; 								
-			//TInt c3=TheClient->iWs.HeapCount();
-			bTestX = CWsGraphicBitmap::NewL(twsGraphicId2.Uid(), &bitmap2,&mask2);		
-			//TInt c4=TheClient->iWs.HeapCount();
-			}
-		// Give WSERV a chance to settle.
-		TheClient->iWs.Finish();
-		User::After (1000000); //1s
-		
-		TInt c1=TheClient->iWs.HeapCount();
-		TInt failures=0;
-		for (TInt i=0;i<testCount;i++)
-			{
-			TInt c2=TheClient->iWs.HeapCount();
-			delete bTestX;
-			//TInt c3=TheClient->iWs.HeapCount();
-			//The heap count doesn't go down after delete operation
-			//because the delete message is buffered by the server, because it does not have a return value.
-			//Aparrently, although CWsGraphicBitmap and TheClient terminate at the same server,
-			//and use the same general heap (I have tested this under debug),
-			//they do not share the same session, so flushing TheClient does not effect CWsGraphicBitmap
-			bTestX = CWsGraphicBitmap::NewL(twsGraphicId2.Uid(), &bitmap2,&mask2);		
-			
-			// Give WSERV a chance to settle.
-			TheClient->iWs.Finish();
-			User::After (1000000); //1s
-
-			TInt c4=TheClient->iWs.HeapCount();   
-			//Can compare immediately after allocation as the server doesn't buffer the create command.
-			if (!(c2==c4))
-				{
-				if (c4 > c2) // only fail the test if the count has increased
-					{
-					failures++;
-					}
-				INFO_PRINTF2(_L("Server Heap count change accross delete/new = %i"),c4-c2);
-				}
-			}
-		// Outside of main loop to avoid client/wserv interaction during test.
-		TEST(failures==0);
-		TInt c5=TheClient->iWs.HeapCount();
-		TEST((c1-c5)/testCount==0);	   //If every call leaked.
-		if ((c1-c5)/testCount)
-			{
-			INFO_PRINTF3(_L("Server Heap count change accross %i delete/new cycles = %i"),testCount,c5-c1);
-			INFO_PRINTF3(_L("Before %i / After %i"),c1,c5);
-			}
-		
-		delete bTestX; 
-		
-		__UHEAP_CHECK(0);
-		__UHEAP_MARKEND;
-		
-	}
-/**
- @SYMTestCaseID				GRAPHICS-WSERV-0381 
- @SYMDEF					DEF095063
- @SYMTestCaseDesc			Test case for INC098114 CWsGraphicDrawer::SendMessage panics window server
- @SYMTestPriority			Medium
- @SYMTestStatus				Implemented
- @SYMTestActions			Enable the test flag and reproduce the defect
-							Action step:
-							-Instruct plugin to register event handler
-							-Draw fullscreen window (plugin will receive window visibility changed event)
-							-Set the test flag 
-							-Query visibility region from plugin side
-							-Instruct plugin to unregister event handler
-							-Destroy fullscreen window (plugin will not receive window visibility changed event)
-						
- @SYMTestExpectedResults	wserv should not panic with the fix
-*/	
-
-TestState CTWsGraphs::TestSuccessiveMessageL()
-	{
-	if (iSubState==0)
-		{
-		_LIT(KTestSuccessiveMessage, "TestSuccessiveMessage");
-		INFO_PRINTF1(KTestSuccessiveMessage);
-
-		++iSubState;
-		iListen->Enable(ETrue);
-		CreateWindowL();
-		Mem::FillZ(&iListenInfo, sizeof(TListenerInfo));
-		//Set the test flag to enable the reproduction of defect
-		iListen->SetTestFlag();
-		iListen->QueryPlugin(iListenInfo);
-		iListen->Enable(EFalse);
-		DestroyWindowL();
-		return EWait;
-		}
-
-	++(iTest->iState);
-	iSubState = 0;
-	return ENext;
-	}
-
-TestState CTWsGraphs::TestWindowGroupChangeL()
-	{
-	if (iSubState==0)
-		{
-		_LIT(KTestWindowGroupChange, "TestWindowGroupChange");
-		INFO_PRINTF1(KTestWindowGroupChange);
-
-		++iSubState;
-		iListen->Enable(ETrue);
-		CreateWindowL();
-		Mem::FillZ(&iListenInfo, sizeof(TListenerInfo));
-		iListen->QueryPlugin(iListenInfo);
-		return EWait;
-		}
-
-	if (iSubState==1)
-		{
-		++iSubState;
-		iOriginalWindowGroupId = iListenInfo.iWindowGroupId;
-		iNewWin = CCrWin::NewL(iTest->iScreenNumber, ETrue);
-		iListen->QueryPlugin(iListenInfo);
-		return EWait;
-		}
-
-	TEST(iListenInfo.iWindowGroupId != iOriginalWindowGroupId);
-	
-	delete iNewWin;
-	iNewWin = NULL;
-	iListen->Enable(EFalse);
-	DestroyWindowL();
-	++(iTest->iState);
-	iSubState = 0;
-	return ENext;
-	}
-
-/**
- @SYMTestCaseID				GRAPHICS-WSERV-0382
- @SYMDEF 					INC085451
- @SYMTestCaseDesc			Test Animation frame rate
- @SYMTestPriority			Medium
- @SYMTestStatus				Implemented
- @SYMTestActions			Simulate an Animation artwork by calling DrawWsGraphic and DoDraw.
-							Action step:
-							-Calls DrawWsGraphic for two different animations with different frame rates
-							-Retrieve the frame count for two differnt frames per seconds
-							-Test the two frame rate shouldn't be same.
-
- @SYMTestExpectedResults	Animation Frame rate should be different for different frames per second
-*/
-TestState CTWsGraphs::TestFrameRateL()
-	{
-	//Check for Transparency enabled in wsini.ini
-	if (TransparencySupportedL()==KErrNotSupported)
-		{
-		++(iTest->iState);
-		return ENext;
-		}
-
-	// flush transparent window destruction created in TransparencySupportedL before
-	// proceeding with the test
-	TheClient->iWs.Flush();
-
-	//Here 	iSubState is 0, when this functions executes first time 
-	//		iSubState is 1 means the call is from a callback function.
-	if(iSubState == 0)
-		{
-		_LIT(KTestFrameRate, "TestFrameRate");
-		INFO_PRINTF1(KTestFrameRate);
-
-		++iSubState;
-		iTestframerate = CGraphicTestFrameRate::NewL(iTest->iScreenNumber);
-
-		//Set the callback function
-		iTestframerate->SetCallBack(TCallBack(CTWsGraphs::PluginCallBack,this));
-
-		//Create the window and call the graphic animation
-		CreateWindowL(EFalse);
-		iWin->DrawGraphic(iTestframerate->Id().Id());
-		return EWait;
-		}
-
-	//PeterI wait a while for animations to redraw then query the plugin
-	User::After(2000000);
-	TheClient->iWs.Flush();
-	TheClient->WaitForRedrawsToFinish();
-	TheClient->iWs.Finish();
-
-	//Invoke the plug-in and get the counter value
-	Mem::FillZ(&iAnimCount, sizeof(TAnimRate));
-
-	iTestframerate->QueryPlugin(iAnimCount);
-	TheClient->iWs.Flush();
-	TheClient->WaitForRedrawsToFinish();
-	TheClient->iWs.Finish();
-
-	//Compare and test the total frame rate for two different frame counts....
-	TEST((iAnimCount.iAnim1>0 && iAnimCount.iAnim2>0) && iAnimCount.iAnim1 !=iAnimCount.iAnim2);
-	if(iSubState == 1)
-		{
-		DestroyWindowL();
-		delete iTestframerate;
-		}
-	++(iTest->iState);
-	iSubState = 0;
-	return ENext;
-	}
-
-/**
- @SYMTestCaseID				GRAPHICS-WSERV-0438 
- @SYMDEF					INC103472
- @SYMTestCaseDesc			CRedrawRegion::ContainsDrawers does not look for all drawers 
- @SYMTestPriority			Medium
- @SYMTestStatus				Implemented
- @SYMTestActions			Create ECom-plugins to enable the scenario, in which there is one simple and one container drawer. 
- 							In the container drawer, two other simple drawers are enabled. Each drawer draws a coloured ellipse.
- 							In this case, when the contained drawer is requested to change the colour of the ellipse, the screen will not be updated
- 							without the fix.  
- 							Action step:
-							-Create four CRP graphics.
-							-Call the simple drawer and container drawer to draw ellipses. The container drawer
-							 also enables two other simple drawers to draw ellipses in different colors.
-							-Update the color of each ellipse in turn. 
-							-Check that the screen display is as required.						
- @SYMTestExpectedResults	The colour of each ellipse residing in the drawers is successfully updated. Those for the contained drawers wont be updated without the fix. 
-*/	
-void CTWsGraphs::TestNestedDrawerCRP()
-	{
-	_LIT(KTestContainDrawer, "Test INC103472: A Contained Drawer");
-	INFO_PRINTF1(KTestContainDrawer);
-
-	RWindow window1(TheClient->iWs);
-	CleanupClosePushL(window1);
-	User::LeaveIfError(window1.Construct(*TheClient->iGroup->GroupWin(), ENullWsHandle));
-	
-	window1.EnableRedrawStore(ETrue);	// Force to enable the redraw storing
-	window1.SetRequiredDisplayMode(EColor256);	 // Do not set window size here to avoid hardware test failure
-	window1.SetBackgroundColor(KRgbDarkGreen);
-	window1.Activate();
-	
-	// A simple graphic
-	CWsSimpleGraphicBitmap* wsGraphic1 = CWsSimpleGraphicBitmap::NewL(KSimpleDrawerInterfaceId);
-	CleanupStack::PushL(wsGraphic1);
-	// A container graphic
-	CWsContainGraphicBitmap* wsGraphic2 = CWsContainGraphicBitmap::NewL(KContainDrawerInterfaceId);
-	CleanupStack::PushL(wsGraphic2);
-	// A contained graphic residing in the container graphic wsGraphic2 
- 	CWsSimpleGraphicBitmap* wsGraphic3 = CWsInvisibleGraphicBitmap1::NewL(KInvisibleDrawerInterfaceId1);
- 	CleanupStack::PushL(wsGraphic3);
-	// A contained graphic residing in the container graphic wsGraphic2
- 	CWsSimpleGraphicBitmap* wsGraphic4 = CWsInvisibleGraphicBitmap2::NewL(KInvisibleDrawerInterfaceId2);
- 	CleanupStack::PushL(wsGraphic4);
-
-    window1.Invalidate();
-	window1.BeginRedraw();
-	TheClient->iGc->Activate(window1);
-	TheClient->iGc->Clear();
-	// Call CRP drawer to draw the coloured ellipses	
-	TheClient->iGc->DrawWsGraphic(wsGraphic1->Id(),TRect(TPoint(20,20),TSize(300,100)));
-	TheClient->iGc->DrawWsGraphic(wsGraphic2->Id(),TRect(TPoint(20,100),TSize(300,100)));	
-
-    TheClient->iGc->Deactivate();
-	window1.EndRedraw();
-	TheClient->Flush();			   
-	
-	// Update the colour of four ellipses residing in four CRP drawers. 
-	TInt err = wsGraphic1->UpdateColor(KRgbRed);
-	TEST(KErrNone == err);
-	err = wsGraphic2->UpdateColor(KRgbDarkBlue);
-	TEST(KErrNone == err);
-	// If the fix is not inserted, the colour of the third and fourth ellipses residing in the contained drawers wont be updated
-	err = wsGraphic3->UpdateColor(KRgbDarkMagenta);
-	TEST(KErrNone == err);
-	err = wsGraphic4->UpdateColor(KRgbDarkCyan);	  //won't change the displayed color if there is a right place for flush()
-	TEST(KErrNone == err);
-	
-	TheClient->Flush();
- 	// Force some delays to wait until the color change
-    User::After(2000000);
-    // Test whether the screen content is changed as required
-    CheckResult();
-   	CleanupStack::PopAndDestroy(5,&window1);
-	}
-
-// Check the screen display with the reference bitmap to ensure the color to be updated correctly
-void CTWsGraphs::CheckResult()
-	{
-    TSize size = TSize(320,200);//The maximum size of the screen content we are looking at
-
-    // Create a reference bitmap
-    CFbsBitmap* bitmapRef = new(ELeave) CFbsBitmap;
-   	CleanupStack::PushL(bitmapRef);
-	User::LeaveIfError(bitmapRef->Create(size, EColor256));
-	CFbsBitGc* gc;
-	CFbsBitmapDevice* bitmapDev = CFbsBitmapDevice::NewL(bitmapRef);
-	TEST(bitmapDev!=NULL);
-   	CleanupStack::PushL(bitmapDev);
-	User::LeaveIfError(bitmapDev->CreateContext(gc));
-   	CleanupStack::PushL(gc);
-	gc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	gc->SetBrushColor(KRgbDarkGreen);
-	gc->Clear(TRect(TPoint(0,0), size));//background dark green
-	gc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-    gc->SetBrushColor(KRgbRed);
-	gc->DrawEllipse(TRect(TPoint(20,20),TSize(300,100)));  //map to the simple drawer
-	gc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	gc->SetBrushColor(KRgbDarkBlue);
-	gc->DrawEllipse(TRect(TPoint(20,100),TSize(300,100)));	//map to the container drawer
-	gc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	gc->SetBrushColor(KRgbDarkMagenta);
-	gc->DrawEllipse(TRect(TPoint(100,150),TSize(50,50)));	//map to the contained drawer
-	gc->SetBrushStyle(CGraphicsContext::ESolidBrush);
- 	gc->SetBrushColor(KRgbDarkCyan);
-	gc->DrawEllipse(TRect(TPoint(200,150),TSize(50,50)));	//map to the contained drawer
-    TInt bitmapHeight = bitmapRef->SizeInPixels().iHeight;
-	TInt bitmapWidth = bitmapRef->SizeInPixels().iWidth;
-  
-   	// Copy the screen content to bitmap
-	INFO_PRINTF1(_L("Capture screen content."));
-	CFbsBitmap* screenBitmap = new(ELeave) CFbsBitmap();
-	CleanupStack::PushL(screenBitmap);
-	User::LeaveIfError(screenBitmap->Create(size, TheClient->iScreen->DisplayMode()));
-	TRect rct = TRect(TPoint(0,0), size);
-	User::LeaveIfError(TheClient->iScreen->CopyScreenToBitmap(screenBitmap,rct));
-
-	// Compare the displayed bitmap against the reference one
-	INFO_PRINTF1(_L("Compare the displayed bitmap against the expected one."));
-	TInt lineLength=bitmapRef->ScanLineLength(bitmapWidth, EColor256);
-	HBufC8* compareLineBuf=HBufC8::NewLC(lineLength);
-	TPtr8 compareLinePtr(compareLineBuf->Des());
-	HBufC8* screenLineBuf=HBufC8::NewLC(lineLength);
-	TPtr8 screenLinePtr(screenLineBuf->Des());
-	for (TInt index=0; index<bitmapHeight; index++)
-		{
-		bitmapRef->GetScanLine(compareLinePtr, TPoint(0,index), bitmapWidth, EColor256);
-		screenBitmap->GetScanLine(screenLinePtr, TPoint(0,index),bitmapWidth, EColor256);
-		TInt compareResult=compareLinePtr.Compare(screenLinePtr);
-		if (compareResult!=0)
-			{
-			INFO_PRINTF2(_L("Scanline compare failed: %d"),index);
-			TEST(EFalse);
-			break;
-			}
-		}
-	CleanupStack::PopAndDestroy(6,bitmapRef);  
-
-	} 
-
-void ResetScreenMode(TAny* aAny)
-	{
-	CWsScreenDevice* screen=static_cast<CWsScreenDevice*>(aAny);
-	screen->SetScreenMode(0);
-	screen->SetAppScreenMode(0);
-	}
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-
-void CTWsGraphs::TestScreenModeChangeL()
-	{
-	_LIT(KLog,"Screen Doesn't match bitmap.  Size=(%d,%d) winSizeMode=%d redrawMode=%d modeIndex=%d");
-// A simple CRP graphic to draw in the test
-	CWsSimpleGraphicBitmap* wsGraphic1=CWsSimpleGraphicBitmap::NewL(KSimpleDrawerInterfaceId);
-	CleanupStack::PushL(wsGraphic1);
-	RWindow testWin(TheClient->iWs);
-	CleanupClosePushL(testWin);
-	User::LeaveIfError(testWin.Construct(*TheClient->iGroup->GroupWin(),0xbadbad));
-	testWin.SetRequiredDisplayMode(EColor64K);
-	testWin.Activate();
-// Cleanup display mode by setting back to 0 if we leave in the tests
-	CleanupStack::PushL(TCleanupItem(ResetScreenMode,TheClient->iScreen));
-	TInt numScreenModes=TheClient->iScreenModes.Count();
-	TBool match;
-
-	for(TInt winSizeMode=0;winSizeMode<2;winSizeMode++)
-		{ // Two size modes, fullScreen and non-full screen
-		for(TInt redrawMode=0;redrawMode<2;redrawMode++)
-			{ // Two redraw modes to test drawing inside and outside of a redraw.
-			const TBool drawInsideRedraw=(redrawMode==0);
-			for(TInt modeIndex=0;modeIndex<numScreenModes;modeIndex++)
-				{
-				const TInt screenMode=TheClient->iScreenModes[modeIndex];
-				const TPoint origin=TheClient->iScreen->GetScreenModeScaledOrigin(screenMode);
-				if (origin.iX!=0 || origin.iY!=0)
-					continue;
-				// Enable redirection before changing screen mode as this is what we are testing
-				iRedir->Redirect(CWsRedir::EFrontBuffer, ETrue);
-				TheClient->iScreen->SetAppScreenMode(screenMode);
-				TheClient->iScreen->SetScreenMode(screenMode);
-
-				TPixelsAndRotation sizeAndRotation;
-				TheClient->iScreen->GetDefaultScreenSizeAndRotation(sizeAndRotation);
-//
-				TSize screenSize(TheClient->iScreen->SizeInPixels());
-				if(sizeAndRotation.iRotation == CFbsBitGc::EGraphicsOrientationRotated90 || 
-						sizeAndRotation.iRotation == CFbsBitGc::EGraphicsOrientationRotated270)
-					{
-					screenSize.iWidth = Min(screenSize.iWidth, 240);//to make sure we won't exceed physical screen size
-					}
-				TSize winSize(screenSize);
-				TPoint winPos;
-				if (winSizeMode==1)
-					{
-					winSize.iWidth=winSize.iWidth*2/3;
-					winSize.iHeight=winSize.iHeight*3/4;
-					winPos.iX=(screenSize.iWidth-winSize.iWidth)/4;
-					winPos.iY=(screenSize.iHeight-winSize.iHeight)*3/4;
-					}
-				testWin.SetExtent(winPos,winSize);
-				TSize halfSize(winSize.iWidth/2,winSize.iHeight);
-				TRect leftHalf(halfSize);
-				TRect rightHalf(TPoint(halfSize.iWidth,0),halfSize);
-				TRect leftEllipse(leftHalf);
-				leftEllipse.Shrink(4,4);
-				TRect rightEllipse(rightHalf);
-				rightEllipse.Shrink(4,4);
-				// Draw half the screen with redirection on, should only go to redirection test bitmap
-				// Then draw again with redirection off, this time should go to the screen
-				// The two steps are drawn with the color of the left/right rectangles swapped.
-				for(TInt drawStep=0;drawStep<2;drawStep++)
-					{
-					TRgb leftColor;
-					TRgb rightColor;
-					if (drawStep==0)
-						{
-						leftColor=KRgbGreen;
-						rightColor=KRgbRed;
-						}
-					else
-						{ // Turn re-direction off for second time around loop
-						iRedir->Redirect(CWsRedir::EFrontBuffer, EFalse);
-						leftColor=KRgbRed;
-						rightColor=KRgbGreen;
-						}
-					testWin.Invalidate();
-					testWin.BeginRedraw();
-					if (!drawInsideRedraw)
-						testWin.EndRedraw();
-					CWindowGc* testWinGc=TheClient->iGc;
-					testWinGc->Activate(testWin);
-					testWinGc->SetBrushColor(leftColor);
-					testWinGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-					testWinGc->DrawRect(leftHalf);
-					// Call CRP drawer to draw the coloured ellipses
-					TheClient->iGc->DrawWsGraphic(wsGraphic1->Id(),leftEllipse);
-					testWinGc->SetBrushColor(rightColor);
-					testWinGc->DrawRect(rightHalf);
-					TheClient->iGc->DrawWsGraphic(wsGraphic1->Id(),rightEllipse);
-					testWinGc->Deactivate();
-					if (drawInsideRedraw)
-						testWin.EndRedraw();
-					TheClient->iWs.Flush();
-					}
-				// We now check that the left rect of the re-directed drawing matches the right half
-				// of the on-screen drawing
-				CFbsBitmap* screenCopy=new(ELeave) CFbsBitmap;
-				CleanupStack::PushL(screenCopy);
-				User::LeaveIfError(screenCopy->Create(screenSize, EColor64K));
-				TheClient->iScreen->CopyScreenToBitmap(screenCopy);
-				match=CompareBitmapArea16Bpp(iFrontCopy,winPos,screenCopy,TPoint(winPos.iX+rightHalf.iTl.iX,winPos.iY),halfSize);
-				TEST(match);
-				if (!match)
-					LOG_MESSAGE6(KLog,screenSize.iWidth,screenSize.iHeight,winSizeMode,redrawMode,modeIndex);
-				// As a double check also check the right half of the off-screen drawing matches the
-				// on-screen left half.
-				match=CompareBitmapArea16Bpp(iFrontCopy,TPoint(winPos.iX+rightHalf.iTl.iX,winPos.iY),screenCopy,winPos,halfSize);
-				TEST(match);
-				if (!match)
-					LOG_MESSAGE6(KLog,screenSize.iWidth,screenSize.iHeight,winSizeMode,redrawMode,modeIndex);
-				CleanupStack::PopAndDestroy(screenCopy);
-				}
-			}
-		}
- 	CleanupStack::PopAndDestroy(3,wsGraphic1);
- 	
-	TEST(iNotify1->iResult);
-	if(iNotify1->iResult==EFalse)
-		{
-		INFO_PRINTF1(iNotify1->iError);
-		}
-	TEST(iNotify2->iResult);
-	if(iNotify1->iResult==EFalse)
-		{
-		INFO_PRINTF1(iNotify2->iError);
-		}
-	}
-
-#endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-
-/**
-@SYMTestCaseID 		GRAPHICS-WSERV-0443
-
-@SYMDEF     		INC109263
-
-@SYMTestCaseDesc	TWindowServerEvent::NotifyDrawer can refer to a deleted array index causing a crash
-
-@SYMTestPriority 	High
-
-@SYMTestStatus		Implemented
-
-@SYMTestActions		Cause an event that will generate the following behaviour through TWindowServerEvent::NotifyDrawer()
-		
-					The for loop performs the following:
-					0) Drawer handler 1: Remove handle 1 ; 					Drawer handler 2: Do nothing
-					1) Drawer handler 1: Remove handle 1,Add handle 1 ;		Drawer handler 2: Do nothing
-					2) Drawer handler 1: Add handle 1 ; 					Drawer handler 2: Do nothing
-					3) Drawer handler 1: Remove handle 2 ; 					Drawer handler 2: Do nothing
-					4) Drawer handler 1: Remove handle 2,Add handle 2 ; 	Drawer handler 2: Do nothing
-					5) Drawer handler 1: Add handle 2 ; 					Drawer handler 2: Do nothing
-					6) Drawer handler 1: Remove handle 1,Remove handle 2 ; 	Drawer handler 2: Do nothing
-			
-					Repeat with handlers 1 and 2 swapped
-
-@SYMTestExpectedResults		Loops through TWindowServerEvent::NotifyDrawer() should complete without crashing wserv
-*/
-
-void CTWsGraphs::TestNotifyRemoval()
-	{
-	_LIT(KTestEventNotification, "TestDrawerEventHandler");
-	INFO_PRINTF1(KTestEventNotification);
-	++iSubState;
-
-	for (TInt ii = 0; ii<KNotifyDoNothing; ii++)
-		{
-		INFO_PRINTF2(_L("For loop %d"), ii);
-		iNotify1->SetBehaviour(ii);					//Enable this plugin and set it to an event handling method
-		iNotify2->SetBehaviour(KNotifyDoNothing);	//Add a second drawer handler which is enabled but does nothing
-		CreateWindowL();							//Change visibility activating the event handlers - Fails if wserv crashes!
-		iNotify1->SetBehaviour(KNotifyDisable);		//Disable plugin if still enabled
-		iNotify2->SetBehaviour(KNotifyDisable);		//Disable plugin if still enabled
-		DestroyWindowL();
-		}
-	INFO_PRINTF1(_L("Swap handlers"));
-	for (TInt ii = 0; ii<KNotifyDoNothing; ii++)
-		{
-		INFO_PRINTF2(_L("For loop %d"), ii);
-		iNotify2->SetBehaviour(KNotifyDoNothing);	//Add a first drawer handler which is enabled but does nothing
-		iNotify1->SetBehaviour(ii);					//Enable this plugin and set it to an event handling method
-		CreateWindowL();							//Change visibility activating the event handlers - Fails if wserv crashes!
-		iNotify2->SetBehaviour(KNotifyDisable);		//Disable plugin if still enabled
-		iNotify1->SetBehaviour(KNotifyDisable);		//Disable plugin if still enabled
-		DestroyWindowL();
-		}
-
-	TEST(ETrue);		// If the test has failed WServ will have paniced.
-	}
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-/**
-@SYMTestCaseID           GRAPHICS-WSERV-0491
-@SYMPREQ                 PREQ39
-@SYMTestPriority         High
-@SYMTestCaseDesc         Draw using a ECom-plugin which has direct access to the screen/OSB buffer 
-@SYMTestActions          Create the plugin
-						 Draw using the plugin
-						 Update the position of the white line to line 70 and test
-						 Update the position of the white line to line 80 and test
-@SYMTestExpectedResults  White lines are drawn on the correct positions.
-*/
-void CTWsGraphs::TestMWsUiBufferL()
-	{
-	const TInt KWhiteLinePos = 70;
-	const TRect KBlueRect(TPoint(50,50),TSize(100,100));
-		
-	// Construct and setup window to be drawn to
-	RWindow window1 = RWindow(TheClient->iWs);
-	CleanupClosePushL(window1);
-    User::LeaveIfError(window1.Construct(*TheClient->iGroup->GroupWin(),ENullWsHandle));
-    TSize winSize=TSize(TheClient->iScreen->SizeInPixels());
-    window1.SetExtent(TPoint(0,0),winSize);
-    window1.Activate();
-    
-	CWsBufferGraphic* graphic = CWsBufferGraphic::NewL();
-	CleanupStack::PushL(graphic);
-    
-	// Draw inital drawing with a Crp which is blue rect and a white line at line 0
-	TheGc->Activate(window1);
-	TheGc->Clear();
-	window1.BeginRedraw();
-	TheGc->DrawWsGraphic(graphic->Id(),KBlueRect);
-	window1.EndRedraw();
-	TheGc->Deactivate();
-	
-    TheClient->iWs.Finish();
-    User::After(2000000);
-	
-	// Update the position of the white line to line 70
-	INFO_PRINTF1(_L("Update position of white line to line 70"));
-	graphic->UpdateWhiteLinePos(KWhiteLinePos);
-	TheClient->iWs.Finish();
-	// Force some delays to wait until the line position changes
-    User::After(2000000);
-    //Test white line has been drawn and is in the correct postion
-    TBool res1 = IsWhiteLine(KWhiteLinePos);
-    TEST(res1);
-    
-	// Update the position of the white line to line 80
-    INFO_PRINTF1(_L("Update position of white line to line 80"));
-	graphic->UpdateWhiteLinePos(KWhiteLinePos+10);
-	TheClient->iWs.Finish();
-	// Force some delays to wait until the line position changes
-	User::After(2000000);
-	// Test white line has been drawn and is in the correct postion
-    TBool res2 = IsWhiteLine(KWhiteLinePos+10);
-    TEST(res2);
-   
-	graphic->Destroy();
-	CleanupStack::PopAndDestroy(2, &window1);
-	}
-
-// Test whether a line is completely white
-TBool CTWsGraphs::IsWhiteLine(TInt aWhiteLinePos)
-	{
-    TRgb color;
-    TPoint pixel;
-    
-    for(TInt xPos = 0; xPos < TheClient->iScreen->SizeInPixels().iWidth; xPos++)
-    	{
-    	pixel = TPoint(xPos,aWhiteLinePos);
-    	TheClient->iScreen->GetPixel(color,pixel);
-    	if(color.Red() != 255 && color.Blue() != 255 && color.Green() != 255)
-    		{
-    		return EFalse;
-    		}
-    	}
-    return ETrue;
-	}
-#endif //TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-
-/**
-	DoTestL() method, called by the WSERV Test Framework.
-*/
-void CTWsGraphs::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(KTest1,"DoTestWsGraphics");
-	_LIT(KTest2,"DoTestOOMWsGraphics");
-	_LIT(KTest3,"Interface Extension");
-	_LIT(KTest4,"Screen Redirection");
-	_LIT(KTest5,"TextCursor1");
-	_LIT(KTest6,"TextCursor2");
-	_LIT(KTest7,"Flicker Redirection");
-	_LIT(KTest8,"Event Notification");
-	_LIT(KTest9,"Successive Message");
-	_LIT(KTest10,"Redirection Using WsBackBuffer");
-	_LIT(KTest11,"Group Change");
-	_LIT(KTest12,"Frame Rate");
-	_LIT(KTest13,"Leak In Service");
-	_LIT(KTest14,"Add/Swap GDArray");
-	_LIT(KTest15,"Nested Drawer CRP");
-	_LIT(KTest16,"Notify Removal");
-	_LIT(KTest17,"Screen Mode Change");
-	_LIT(KTest18,"UI Buffer");
-	_LIT(KTest19,"Graphics Drawer Coverage");
-	CFbsBitmap bitmap1;
-	CFbsBitmap mask1;
-	CWsGraphicBitmap* bTest=NULL;
-	TSize screenSize=TheClient->iScreen->SizeInPixels();
-
-	bitmap1.Create(screenSize,TheClient->iScreen->DisplayMode());
-	mask1.Create(screenSize,TheClient->iScreen->DisplayMode());
-	((CTWsGraphsStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-
-	switch(++iTest->iState)
-		{
-	case 1:
-/**
-	@SYMTestCaseID	GRAPHICS-WSERV-0528
-*/
-		((CTWsGraphsStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0528"));
-		// Launch new process with PROTSERV capability to run CWSGraphics tests in
-		iTest->LogSubTest(KTest1);
-		// This process only launches succesfully when _DEBUG is defined for the build, because it depends
-		// on the existance of debug macros such as _UHEAP_MARK, _UHEAP_MARKEND, _UHEAP_FAILNEXT, ... etc
-		LaunchNewProcess(KTestExe);
-		break;
-	case 2:
-		{
-		/**
-   		@SYMTestCaseID GRAPHICS-WSERV-0017
-
-		@SYMPREQ	PREQ1246
-
-		@SYMDEF		DEF081259
-
-		@SYMTestCaseDesc Out of memery test when creating a CWsGraphic.
-
-		@SYMTestPriority High
-
-		@SYMTestStatus Implemented
-
-		@SYMTestActions Out of memory test when creating a CWsGraphic.
-
-		@SYMTestExpectedResults Whenever an API call fails, it should leave the number
-				of allocated heap cells unchanged.
-		*/
-		((CTWsGraphsStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0017"));
-
-		iTest->LogSubTest(KTest2);
-		TInt failRate;
-		for(failRate=1;;failRate++)
-			{
-			__UHEAP_RESET;
-			__UHEAP_SETFAIL(RHeap::EDeterministic,failRate);
-			__UHEAP_MARK;
-
-			TRAPD(ret,bTest=CWsGraphicBitmap::NewL(&bitmap1,&mask1));
-			TEST((ret==KErrNone || ret==KErrNoMemory));
-			if (ret!=KErrNone && ret!=KErrNoMemory)
-				{
-				_LIT(KLog,"Failed to create CWsGraphicBitmap  error=%d");
-				LOG_MESSAGE2(KLog,ret);
-				}
-			if (ret!=KErrNone)
-				{
-				__UHEAP_MARKEND;
-				}
-			else
-				{
-				TEST(bTest!=NULL);
-				if (bTest==NULL)
-					{
-					_LIT(KLog,"Object creation didn't leave but returned NULL");
-					LOG_MESSAGE(KLog);
-					}
-				delete bTest;
-				bTest=NULL;
-				__UHEAP_MARKEND;
-				TLogMessageText logMessageText;
-				_LIT(KSet,"OOM test succeds after %d allocations.");
-				logMessageText.Format(KSet,failRate);
-				LOG_MESSAGE(logMessageText);
-				break;
-				}
-			}
-		__UHEAP_RESET;
-		}
-		break;
-	case 3:
-		iTest->LogSubTest(KTest3);
-		((CTWsGraphsStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0371"));
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-			
-			if (TestInterfaceExtensionL()==EWait)
-				--iTest->iState;
-#endif
-		break;
-	case 4:
-		iTest->LogSubTest(KTest4);
-		((CTWsGraphsStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0372"));
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA			
-			if (TestScreenRedirectionL()==EWait)
-				--iTest->iState;
-#endif
-		break;
-	case 5:
-		iTest->LogSubTest(KTest5);
-		((CTWsGraphsStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0363"));
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA	
-			if (TestTextCursorUnderRedirectionL(ETestStandardTextCursor) == EWait)
-				--iTest->iState;
-#endif
-		break;
-	case 6:
-		iTest->LogSubTest(KTest6);
-		((CTWsGraphsStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0363"));
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA	
-			if (TestTextCursorUnderRedirectionL(ETestCustomTextCursor) == EWait)
-				--iTest->iState;
-#endif
-		break;
-	case 7:
-		iTest->LogSubTest(KTest7);
-		((CTWsGraphsStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0376"));
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA			
-			if (TestFlickerRedirectionL()==EWait)
-				--iTest->iState;
-#endif
-		break;
-	case 8:
-		((CTWsGraphsStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0378"));
-		iTest->LogSubTest(KTest8);
-		if (TestEventNotificationL()==EWait)
-			--iTest->iState;
-		break;
-	case 9:
-		((CTWsGraphsStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0381"));
-		iTest->LogSubTest(KTest9);
-		if (TestSuccessiveMessageL()==EWait)
-			--iTest->iState;
-		break;
-	case 10:
-		iTest->LogSubTest(KTest10);
-		((CTWsGraphsStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0527"));
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-		if(TestRedirectionUsingWsBackBufferL()==EWait)
-			--iTest->iState;
-#endif
-		break;
-	case 11:
-/**
-	@SYMTestCaseID	GRAPHICS-WSERV-0529
-*/
-		((CTWsGraphsStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0529"));
-		iTest->LogSubTest(KTest11);
-		if(TestWindowGroupChangeL()==EWait)
-			--iTest->iState;
-		break;
-	case 12:
-		((CTWsGraphsStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0382"));
-		iTest->LogSubTest(KTest12);
-		if(TestFrameRateL()==EWait)
-			--iTest->iState;
-		break;
-	case 13:
-		((CTWsGraphsStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-LeakInService-0001"));
-		iTest->LogSubTest(KTest13);
-		DoTestLeakInServiceL();
-		break;
-	case 14:
-		((CTWsGraphsStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-NegAddSwapGDArray-0001"));
-		iTest->LogSubTest(KTest14);
-		TestAddSwapGDArrayL();
-		break;
-	case 15:
-		((CTWsGraphsStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0438"));
-		iTest->LogSubTest(KTest15);
-		TestNestedDrawerCRP();
-		break;
-	case 16:
-		((CTWsGraphsStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0443"));
-		iTest->LogSubTest(KTest16);
-		TestNotifyRemoval();
-		break;
-	case 17:
-		iTest->LogSubTest(KTest17);
-		((CTWsGraphsStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0530"));
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-/**
-	@SYMTestCaseID	GRAPHICS-WSERV-0530
-*/
-			
-			TestScreenModeChangeL();
-#endif
-		break;
-	case 18:
-		iTest->LogSubTest(KTest18);
-		((CTWsGraphsStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0491"));
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-			
-			TestMWsUiBufferL();
-#endif
-			break;
-		case 19:
-			iTest->LogSubTest(KTest19);
-/**
-	@SYMTestCaseID	GRAPHICS-WSERV-0531
-*/
-			((CTWsGraphsStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0531"));
-			TestGraphicDrawerCoverage();
-			break;
-		default:
-			((CTWsGraphsStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTWsGraphsStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-			break;
-		}
-	((CTWsGraphsStep*)iStep)->RecordTestResultL();
-	}
-
-__WS_CONSTRUCT_STEP__(WsGraphs)
--- a/windowing/windowserver/tauto/TWSGRAPHS.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,172 +0,0 @@
-
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TWSGRAPHS_H__
-#define __TWSGRAPHS_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "W32STDGRAPHIC.H"
-#include "wsredir.h"
-#include "wslisten.h"
-#include "TGraphicsHarness.h"
-#include "wsframerate.h"
-#include "wscontaindrawer.h"
-#include "wssimpledrawer.h"
-#include "listener.h"
-#include "wsgdcov.h"
-
-//
-class CCrWin: public CBase
-	{
-public:
-	static CCrWin* NewL(TInt aScreenId,TBool aDraw=ETrue);
-	~CCrWin();
-	void DrawFirstHalf();
-	void DrawSecondHalf();
-	void DrawGraphic(TInt aWsId=0);
-	void SetTextCursor(const TPoint &aPos, const TTextCursor &aCursor);
-	void CancelTextCursor();
-private:
-	void ConstructL(TInt aScreenId,TBool aDraw);
-	void Draw();
-private:
-	RWsSession iWs;
-	CWsScreenDevice* iScr;
-	RWindowGroup iGroup;
-	RWindow iWin;
-	CWindowGc* iGc;
-	};
-
-class CCrAlphaWin: public CBase
-	{
-public:
-	static CCrAlphaWin* NewL(TInt aScreenId);
-	~CCrAlphaWin();
-private:
-	void ConstructL(TInt aScreenId);
-private:
-	RWsSession iWs;
-	CWsScreenDevice* iScr;
-	RWindowGroup iGroup;
-	RWindow iWin;
-	};
-
-class CTWsGraphs : public CTWsGraphicsBase
-	{
-public:
-	enum TTestCursorType
-		{
-		ETestStandardTextCursor,
-		ETestCustomTextCursor
-		};
-public:
-	CTWsGraphs(CTestStep* aStep);
-	~CTWsGraphs();
-	void ConstructL();
-public: // list of test cases
-	void LaunchNewProcess(const TDesC& aExecutable);
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-
-private:
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-	TestState TestInterfaceExtensionL();
-	TestState TestScreenRedirectionL();
-	TestState TestTextCursorUnderRedirectionL(TTestCursorType aCursorType);
-	TestState TestFlickerRedirectionL();
-	TestState TestRedirectionUsingWsBackBufferL();
-	void TestScreenModeChangeL();
-#endif
-	TestState TestEventNotificationL();
-	void TestAddSwapGDArrayL();
-	TestState TestSuccessiveMessageL();
-	void ReportNegativeResultfail(TInt aLine,TInt aResult,TInt aExpectedResult);
-	void DoTestLeakInServiceL();
-	void TestNestedDrawerCRP();
-	void CheckResult();
-	void TestNotifyRemoval();
-	TestState TestWindowGroupChangeL();
-	TestState TestFrameRateL();
-	static TInt PluginCallBack(TAny* aArg);
-	void CreateWindowL(TBool aDraw=ETrue);
-	void DestroyWindowL();
-	void CreateAlphaWindowL();
-	void DestroyAlphaWindowL();
-	TBool CompareBitmapArea16Bpp(CFbsBitmap* aBmp1, const TPoint& aPos1, CFbsBitmap* aBmp2, const TPoint& aPos2, const TSize& aSize);
-
-	TBool PosTestAddSwapGDArrayL(TInt testcase);
-	struct WrapTestCall;
-	TBool NegTestAddSwapGDArrayL(TInt failcase,WrapTestCall*aWrappedParams=NULL);
-	static TInt	DoNegTestCall(TInt /*aInt*/, TAny *aPtr);
-	TBool	LaunchNegTestCall(TUint		aTestCount,TUint aPanicCode,const TDesC &aPanicCategory);
-	TestState TestGraphicDrawerCoverage();
-	// For WsBuffer CRP tests
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-	void TestMWsUiBufferL();
-	TBool IsWhiteLine(TInt aWhiteLinePos);
-#endif
-	
-private:
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-	CWsRedir* iRedir;
-	CFbsBitmap* iFrontCopy;
-	CFbsBitmap* iBackCopy;
-	TRedirectorInfo iRedirInfo;
-	CFbsBitmap* iBefore;
-	CFbsBitmap* iAfter;
-	TTextCursor iTextCursor;
-	RArray<TSpriteMember> iSpriteMemberArray;
-#endif
-	CWsListen* iListen;
-	CWsNotify* iNotify1;
-	CWsNotify* iNotify2;
-	TListenerInfo iListenInfo;
-	TInt iSubState;
-	CCrWin* iWin;
-	CCrAlphaWin* iAlpha;
-	TInt iOriginalWindowGroupId;
-	CCrWin* iNewWin;
-	CGraphicTestFrameRate* iTestframerate;
-	TAnimRate iAnimCount;
-	CWsGdCoverage* iGdCoverage;
-	};
-
-class CTWsGraphsStep : public CTGraphicsStep
-	{
-public:
-	CTWsGraphsStep();
-
-protected:
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-
-
-_LIT(KTWsGraphsStep,"TWsGraphs");
-
-
-#endif
--- a/windowing/windowserver/tauto/colorblender.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include "colorblender.h"
-#include <fbs.h>
-#include <bitdev.h>
-#include <bitstd.h>
-
-CColorBlender* CColorBlender::NewLC(TDisplayMode aDisplayMode)
-	{
-	CColorBlender* self = new(ELeave) CColorBlender;
-	CleanupStack::PushL(self);
-	self->iBitmap = new(ELeave) CFbsBitmap;
-	User::LeaveIfError(self->iBitmap->Create(TSize(1, 1), aDisplayMode));
-	self->iDevice = CFbsBitmapDevice::NewL(self->iBitmap);
-	self->iGc = CFbsBitGc::NewL();
-	self->iGc->Activate(self->iDevice);
-	return self;
-	}
-
-CColorBlender::~CColorBlender()
-	{
-	delete iBitmap;
-	delete iDevice;
-	delete iGc;
-	}
-
-void CColorBlender::SetInitialColor(TRgb aColor)
-	{
-	iGc->SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
-	iGc->SetBrushColor(aColor);
-	iGc->Clear();
-	iGc->SetDrawMode(CGraphicsContext::EDrawModePEN);
-	}
-
-void CColorBlender::Blend(TRgb aColor)
-	{
-	iGc->SetBrushColor(aColor);
-	iGc->Clear();
-	}
-
-TRgb CColorBlender::Color() const
-	{
-	TRgb color;
-	iBitmap->GetPixel(color, TPoint(0, 0));
-	return color;
-	}
-
--- a/windowing/windowserver/tauto/colorblender.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef __COLORBLENDER_H__
-#define __COLORBLENDER_H__
-
-#include <gdi.h>
-
-class CFbsBitGc;
-class CFbsBitmap;
-class CFbsBitmapDevice;
-
-class CColorBlender : public CBase
-	{
-public:
-	static CColorBlender* NewLC(TDisplayMode aDisplayMode);
-	~CColorBlender();
-	void SetInitialColor(TRgb aColor);
-	void Blend(TRgb aColor);
-	TRgb Color() const;
-private:
-	CFbsBitmap* iBitmap;
-	CFbsBitmapDevice* iDevice;
-	CFbsBitGc* iGc;
-	};
-
-#endif //__COLORBLENDER_H__
--- a/windowing/windowserver/tauto/config/graphics-wserv-autotest.ini	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-//This ini file is used to set the screen number for the wserv autotests using a function called GetScreenFromIni().
-
-[useScreen]
-screen=1
\ No newline at end of file
--- a/windowing/windowserver/tauto/directgdigcwrapper.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,521 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include "directgdigcwrapper.h"
-#include "mwsgraphicscontexttodirectgdimappings.h"
-#include <s32mem.h>
-#include "stdpanic.h"
-#include <graphics/lookuptable.h>
-#include <graphics/directgdidriver.h>
-#include <graphics/directgdidrawablesource.h>
-
-void Panic(TStdPluginPanic aPanic)
-	{
-	_LIT(KStdPanicCategory, "WSERV-TEST-PLUGIN");
-	User::Panic(KStdPanicCategory, aPanic);
-	}
-
-CDirectGdiGcWrapper* CDirectGdiGcWrapper::NewL(RDirectGdiImageTarget& aTarget)
-	{
-	CDirectGdiGcWrapper* self = new(ELeave) CDirectGdiGcWrapper;
-	CleanupStack::PushL(self);
-	CDirectGdiDriver* driver = CDirectGdiDriver::Static();
-	User::LeaveIfNull(driver);
-	self->iContext = CDirectGdiContext::NewL(*driver);
-	TInt err = self->iContext->Activate(aTarget);
-	User::LeaveIfError(err);
-	self->iErrorCode = KErrNone;
-	self->iGcBuf = CBufSeg::NewL(512);
-	//MWsFader
-	//Default in BitGdi was 128 for the blackMap and 255 for the whiteMap
-	//SetFadingParameters shows how the fade color is computed
-	self->iFadeColor.SetInternal(0x80FFFFFF);
-	
-	self->iLut = PtrTo16BitNormalisationTable();
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-CDirectGdiGcWrapper::~CDirectGdiGcWrapper()
-	{
-	delete iContext;
-	delete iGcBuf;
-	iClippingRegion.Close();
-	}
-
-void CDirectGdiGcWrapper::BitBlt(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap)
-	{
-	iContext->BitBlt(aDestPos, aSourceBitmap);
-	}
-
-void CDirectGdiGcWrapper::BitBlt(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect)
-	{
-	iContext->BitBlt(aDestPos, aSourceBitmap, aSourceRect);
-	}
-
-void CDirectGdiGcWrapper::BitBltMasked(const TPoint& aDestPos,	const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect, const CFbsBitmap& aMaskBitmap, TBool aInvertMask)
-	{
-	iContext->BitBltMasked(aDestPos, aSourceBitmap, aSourceRect, aMaskBitmap, aInvertMask);
-	}
-
-void CDirectGdiGcWrapper::BitBltMasked(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect, const CFbsBitmap& aMaskBitmap, const TPoint& aMaskPos)
-	{
-	iContext->BitBltMasked(aDestPos, aSourceBitmap, aSourceRect, aMaskBitmap, aMaskPos);
-	}
-
-void CDirectGdiGcWrapper::ResetClippingRegion()
-	{
-	iContext->ResetClippingRegion();
-	}
-
-void CDirectGdiGcWrapper::Clear()
-	{
-	iContext->Clear();
-	}
-
-void CDirectGdiGcWrapper::Clear(const TRect& aRect)
-	{
-	iContext->Clear(aRect);
-	}
-
-void CDirectGdiGcWrapper::ResetBrushPattern()
-	{
-	iContext->ResetBrushPattern();
-	}
-
-void CDirectGdiGcWrapper::ResetFont()
-	{
-	iContext->ResetFont();
-	}
-
-void CDirectGdiGcWrapper::DrawArc(const TRect& aRect, const TPoint& aStart, const TPoint& aEnd)
-	{
-	iContext->DrawArc(aRect, aStart, aEnd);
-	}
-
-void CDirectGdiGcWrapper::DrawPie(const TRect& aRect, const TPoint& aStart, const TPoint& aEnd)
-	{
-	iContext->DrawPie(aRect, aStart, aEnd);
-	}
-
-void CDirectGdiGcWrapper::DrawBitmap(const TRect& aDestRect, const CFbsBitmap& aSourceBitmap)
-	{
-	iContext->DrawBitmap(aDestRect, aSourceBitmap);
-	}
-
-void CDirectGdiGcWrapper::DrawBitmap(const TRect& aDestRect, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect)
-	{
-	iContext->DrawBitmap(aDestRect,	aSourceBitmap, aSourceRect);
-	}
-
-void CDirectGdiGcWrapper::DrawBitmapMasked(const TRect& aDestRect, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect, const CFbsBitmap& aMaskBitmap, TBool aInvertMask)
-	{
-	iContext->DrawBitmapMasked(aDestRect, aSourceBitmap, aSourceRect, aMaskBitmap, aInvertMask);
-	}
-
-void CDirectGdiGcWrapper::DrawRoundRect(const TRect& aRect, const TSize& aEllipse)
-	{
-	iContext->DrawRoundRect(aRect, aEllipse);
-	}
-
-void CDirectGdiGcWrapper::DrawPolyLine(const TArray<TPoint>& aPointList)
-	{
-	iContext->DrawPolyLine(aPointList);
-	}
-
-void CDirectGdiGcWrapper::DrawPolyLineNoEndPoint(const TArray<TPoint>& aPointList)
-	{
-	iContext->DrawPolyLineNoEndPoint(aPointList);
-	}
-
-void CDirectGdiGcWrapper::DrawPolygon(const TArray<TPoint>& aPointList, TFillRule aFillRule)
-	{
-	iContext->DrawPolygon(aPointList, MWsGraphicsContextToDirectGdiMappings::Convert(aFillRule));
-	}
-
-void CDirectGdiGcWrapper::DrawEllipse(const TRect& aRect)
-	{
-	iContext->DrawEllipse(aRect);
-	}
-
-void CDirectGdiGcWrapper::DrawLine(const TPoint& aStart, const TPoint& aEnd)
-	{
-	iContext->DrawLine(aStart, aEnd);
-	}
-
-void CDirectGdiGcWrapper::DrawLineTo(const TPoint& aPoint)
-	{
-	iContext->DrawLineTo(aPoint);
-	}
-
-void CDirectGdiGcWrapper::DrawLineBy(const TPoint& aVector)
-	{
-	iContext->DrawLineBy(aVector);
-	}
-
-void CDirectGdiGcWrapper::DrawRect(const TRect& aRect)
-	{
-	iContext->DrawRect(aRect);
-	}
-
-void CDirectGdiGcWrapper::DrawText(const TDesC& aText,const TTextParameters* aParam)
-	{
-	iContext->DrawText(aText, MWsGraphicsContextToDirectGdiMappings::Convert(aParam));
-	}
-
-void CDirectGdiGcWrapper::DrawText(const TDesC& aText,const TTextParameters* aParam,const TPoint& aPosition)
-	{
-	iContext->DrawText(aText, MWsGraphicsContextToDirectGdiMappings::Convert(aParam), aPosition);
-	}
-
-void CDirectGdiGcWrapper::DrawText(const TDesC& aText,const TTextParameters* aParam,const TRect& aClipRect)
-	{
-	iContext->DrawText(aText, MWsGraphicsContextToDirectGdiMappings::Convert(aParam), aClipRect);
-	}
-
-void CDirectGdiGcWrapper::DrawText(const TDesC& aText,const TTextParameters* aParam,const TRect& aClipFillRect,TInt aBaselineOffset, TTextAlign aHrz,TInt aMargin)
-	{
-	iContext->DrawText(aText, MWsGraphicsContextToDirectGdiMappings::Convert(aParam), aClipFillRect, aBaselineOffset, MWsGraphicsContextToDirectGdiMappings::Convert(aHrz), aMargin);
-	}
-
-void CDirectGdiGcWrapper::DrawTextVertical(const TDesC& aText,const TTextParameters* aParam,TBool aUp)
-	{
-	iContext->DrawTextVertical(aText, MWsGraphicsContextToDirectGdiMappings::Convert(aParam), aUp);
-	}
-
-void CDirectGdiGcWrapper::DrawTextVertical(const TDesC& aText,const TTextParameters* aParam,const TPoint& aPosition,TBool aUp)
-	{
-	iContext->DrawTextVertical(aText, MWsGraphicsContextToDirectGdiMappings::Convert(aParam), aPosition, aUp);
-	}
-
-void CDirectGdiGcWrapper::DrawTextVertical(const TDesC& aText,const TTextParameters* aParam,const TRect& aClipRect,TBool aUp)
-	{
-	iContext->DrawTextVertical(aText, MWsGraphicsContextToDirectGdiMappings::Convert(aParam), aClipRect, aUp);
-	}
-
-void CDirectGdiGcWrapper::DrawTextVertical(const TDesC& aText,const TTextParameters* aParam,const TRect& aClipRect,TInt aBaselineOffset,TBool aUp,TTextAlign aVert,TInt aMargin)
-	{
-	iContext->DrawTextVertical(aText, MWsGraphicsContextToDirectGdiMappings::Convert(aParam), aClipRect, aBaselineOffset, aUp, MWsGraphicsContextToDirectGdiMappings::Convert(aVert), aMargin);
-	}
-
-void CDirectGdiGcWrapper::DrawTextVertical(const TDesC& aText,const TTextParameters* aParam,const TRect& aClipRect,TInt aBaselineOffset,TInt aTextWidth,TBool aUp,TTextAlign aVert,TInt aMargin)
-	{
-	iContext->DrawTextVertical(aText, MWsGraphicsContextToDirectGdiMappings::Convert(aParam), aClipRect, aBaselineOffset, aTextWidth, aUp, MWsGraphicsContextToDirectGdiMappings::Convert(aVert), aMargin);
-	}
-
-void CDirectGdiGcWrapper::MoveTo(const TPoint& aPoint)
-	{
-	iContext->MoveTo(aPoint);
-	}
-
-void CDirectGdiGcWrapper::MoveBy(const TPoint& aVector)
-	{
-	iContext->MoveBy(aVector);
-	}
-
-void CDirectGdiGcWrapper::Plot(const TPoint& aPoint)
-	{
-	iContext->Plot(aPoint);
-	}
-
-void CDirectGdiGcWrapper::Reset()
-	{
-	iContext->Reset();
-	}
-
-void CDirectGdiGcWrapper::SetBrushColor(const TRgb& aColor)
-	{
-	iContext->SetBrushColor(aColor);
-	}
-
-void CDirectGdiGcWrapper::SetBrushOrigin(const TPoint& aOrigin)
-	{
-	iContext->SetBrushOrigin(aOrigin);
-	}
-
-void CDirectGdiGcWrapper::SetBrushStyle(TBrushStyle aBrushStyle)
-	{
-	iContext->SetBrushStyle(MWsGraphicsContextToDirectGdiMappings::Convert(aBrushStyle));
-	}
-
-void CDirectGdiGcWrapper::SetClippingRegion(const TRegion& aRegion)
-	{
-	CDirectGdiDriver* driver = CDirectGdiDriver::Static();
-	driver->GetError(); //make sure that an error has been received 
-	iContext->SetClippingRegion(aRegion);
-	TInt err = driver->GetError();
-	SetError(err);
-	if(err == KErrNone)
-		{
-		iClippingRegion.Copy(aRegion);
-		}
-	}
-
-void CDirectGdiGcWrapper::SetDrawMode(TDrawMode aDrawMode)
-	{
-	iContext->SetDrawMode(MWsGraphicsContextToDirectGdiMappings::LossyConvert(aDrawMode));
-	}
-
-void CDirectGdiGcWrapper::SetOrigin(const TPoint& aPoint)
-	{
-	iContext->SetOrigin(aPoint);
-	iOrigin = aPoint;
-	}
-
-void CDirectGdiGcWrapper::SetPenColor(const TRgb& aColor)
-	{
-	iContext->SetPenColor(aColor);
-	}
-
-void CDirectGdiGcWrapper::SetPenStyle(TPenStyle aPenStyle)
-	{
-	iContext->SetPenStyle(MWsGraphicsContextToDirectGdiMappings::Convert(aPenStyle));
-	}
-
-void CDirectGdiGcWrapper::SetPenSize(const TSize& aSize)
-	{
-	iContext->SetPenSize(aSize);
-	}
-
-void CDirectGdiGcWrapper::SetTextShadowColor(const TRgb& aColor)
-	{
-	iContext->SetTextShadowColor(aColor);
-	}
-
-void CDirectGdiGcWrapper::SetCharJustification(TInt aExcessWidth, TInt aNumChars)
-	{
-	iContext->SetCharJustification(aExcessWidth, aNumChars);
-	}
-
-void CDirectGdiGcWrapper::SetWordJustification(TInt aExcessWidth, TInt aNumGaps)
-	{
-	iContext->SetWordJustification(aExcessWidth, aNumGaps);
-	}
-
-void CDirectGdiGcWrapper::SetUnderlineStyle(TFontUnderline aUnderlineStyle)
-	{
-	iContext->SetUnderlineStyle(MWsGraphicsContextToDirectGdiMappings::Convert(aUnderlineStyle));
-	}
-
-void CDirectGdiGcWrapper::SetStrikethroughStyle(TFontStrikethrough aStrikethroughStyle)
-	{
-	iContext->SetStrikethroughStyle(MWsGraphicsContextToDirectGdiMappings::Convert(aStrikethroughStyle));
-	}
-
-void CDirectGdiGcWrapper::SetBrushPattern(const CFbsBitmap& aBitmap)
-	{
-	iContext->SetBrushPattern(aBitmap);
-	}
-
-void CDirectGdiGcWrapper::SetBrushPattern(TInt aFbsBitmapHandle)
-	{
-	iContext->SetBrushPattern(aFbsBitmapHandle);
-	}
-
-void CDirectGdiGcWrapper::SetFont(const CFont* aFont)
-	{
-	iContext->SetFont(aFont);
-	}
-
-void CDirectGdiGcWrapper::CopyRect(const TPoint& aOffset, const TRect& aRect)
-	{
-	iContext->CopyRect(aOffset, aRect);
-	}
-
-void CDirectGdiGcWrapper::UpdateJustification(const TDesC& aText,const TTextParameters* aParam)
-	{
-	iContext->UpdateJustification(aText, MWsGraphicsContextToDirectGdiMappings::Convert(aParam));
-	}
-
-void CDirectGdiGcWrapper::UpdateJustificationVertical(const TDesC& aText,const TTextParameters* aParam,TBool aUp)
-	{
-	iContext->UpdateJustificationVertical(aText, MWsGraphicsContextToDirectGdiMappings::Convert(aParam), aUp);
-	}
-
-void CDirectGdiGcWrapper::SetFontNoDuplicate(const CFont* aFont)
-	{
-	iContext->SetFontNoDuplicate(static_cast<const CDirectGdiFont*>(aFont));
-	}
-
-TBool CDirectGdiGcWrapper::HasBrushPattern() const
-	{
-	return iContext->HasBrushPattern();
-	}
-
-TBool CDirectGdiGcWrapper::HasFont() const
-	{
-	return iContext->HasFont();
-	}
-
-TRgb CDirectGdiGcWrapper::BrushColor() const
-	{
-	return iContext->BrushColor();
-	}
-
-TRgb CDirectGdiGcWrapper::PenColor() const
-	{
-	return iContext->PenColor();
-	}
-
-TRgb CDirectGdiGcWrapper::TextShadowColor() const
-	{
-	return iContext->TextShadowColor();
-	}
-
-TAny* CDirectGdiGcWrapper::ResolveObjectInterface(TUint /*aTypeId*/)
-	{
-	return NULL;
-	}
-
-/**
-Sets the error code. If the error code is already set to a value other
-than KErrNone, the error code will not be modified.
-
-@param  aErr The error code to set.
-
-@post 	The error code has been set.
-*/
-void CDirectGdiGcWrapper::SetError(TInt aError)
-	{
-	if (aError != KErrNone && iErrorCode == KErrNone)
-		{
-		iErrorCode = aError;
-		}
-	}
-
-/**
-Returns the first error code (set as the result of calling some CDirectGdiGcWrapper API), if any,
-since the last call to this function or, if it has not previously been called, since
-the CDirectGdiGcWrapper was constructed. Calling this function clears the error code.
-
-@post 	The error code has been reset after being read.
-
-@return The first error code, if any, since the last call to this function or, 
-		if it has not previously been called, since the CDirectGdiGcWrapper was constructed. 
-		KErrNone will indicate that no such error has occurred.
-*/
-TInt CDirectGdiGcWrapper::GetError()
-	{
-	TInt err = iErrorCode;
-	iErrorCode = KErrNone;
-	return err;
-	}
-
-TPoint CDirectGdiGcWrapper::Origin() const
-	{
-	return iOrigin;
-	}
-
-const TRegion& CDirectGdiGcWrapper::ClippingRegion()
-	{
-	return iClippingRegion;
-	}
-
-TInt CDirectGdiGcWrapper::Push()
-	{
-	// the buf format is len+data where data is written by the GC's ExternalizeL()
-	iGcBuf->Reset();
-	CBufBase& buf = *iGcBuf;
-	const TInt start = buf.Size();
-	RBufWriteStream out(buf,start);
-	TRAPD(err,out.WriteInt32L(0));
-	if(!err)
-		{
-		TRAP(err,iContext->ExternalizeL(out));
-		}
-	if(err) //rollback addition
-		{
-		buf.Delete(start,buf.Size()-start);
-		}
-	else //fixup len
-		{
-		TRAP_IGNORE(out.CommitL();) // can't see this failing
-		TPckgBuf<TInt32> pckg(buf.Size()-sizeof(TInt32)-start);
-		buf.Write(start,pckg);
-		}
-	return err;
-	}
-
-void CDirectGdiGcWrapper::Pop()
-	{
-	CBufBase& buf = *iGcBuf;
-	TInt ofs = 0;
-	FOREVER
-		{
-		TInt chunk = 0;
-		RBufReadStream in(buf,ofs);
-		TRAPD(err,chunk = in.ReadInt32L());
-		if(err)
-			{
-			STD_ASSERT_DEBUG(err != 0, EStdPanicPopGcSettings);
-			return;
-			}
-		if(ofs+sizeof(TInt32)+chunk >= buf.Size()) // the last chunk?
-			{
-			TRAP_IGNORE(iContext->InternalizeL(in));
-			buf.Delete(ofs,buf.Size()-ofs);
-			return;
-			}
-		ofs += chunk + sizeof(TInt32);
-		}
-	}
-
-//Default method of fading simply uses bitgdi to perform fading
-void CDirectGdiGcWrapper::FadeArea(const TRegion& aRegion)
-	{
-	if (!&aRegion || aRegion.CheckError())
-		return;
-
-	iContext->Reset();
-	iContext->SetClippingRegion(aRegion);
-	iContext->SetPenStyle(DirectGdi::ENullPen);
-	iContext->SetBrushStyle(DirectGdi::ESolidBrush);
-	iContext->SetBrushColor(iFadeColor);
-	iContext->DrawRect(aRegion.BoundingRect());
-	}
-	
-//Default method of fading expects two TUint8's describing the black/white map 
-//as possible fading parameters
-void CDirectGdiGcWrapper::SetFadingParameters(const TDesC8& aData)
-  	{
-	TPckgBuf<TFadingParams> buf;
-	buf.Copy(aData);
-	TFadingParams parameters = buf();
-
-	//Situations where blackMap > whiteMap are NOT supported
-	if (parameters.blackMap > parameters.whiteMap)
-		{
-		TUint8 oldMap = parameters.blackMap;
-		parameters.blackMap = parameters.whiteMap;
-		parameters.whiteMap = oldMap;
-		}
-	
-	//CFbsBitGc::FadeArea() does the following per color component:
-	//   dst = dst * (whiteMap - blackMap) + blackMap;
-
-	//To achieve the same effect using MWsGraphicsContext we draw a rectangle
-	//with specific intensity and alpha values:
-	//   dst = dst * (1 - alpha) + intensity * alpha;
-	//Thus:
-	//   alpha = 1 - whiteMap + blackMap;
-	//   intensity = blackMap / alpha;
-
-	// alpha = 1 - whiteMap + blackMap;
-	TInt alpha = 255 - parameters.whiteMap + parameters.blackMap;
-	// intensity = blackMap / alpha;
-	TInt i = (parameters.blackMap * iLut[alpha]) >> 8;
-
-	iFadeColor.SetInternal(i << 16 | i << 8 | i | alpha << 24);
-  	}
--- a/windowing/windowserver/tauto/directgdigcwrapper.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,169 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef __DIRECTGDIGCWRAPPER_H__
-#define __DIRECTGDIGCWRAPPER_H__
-
-#include <graphics/wsgraphicscontext.h>
-#include <graphics/directgdiimagetarget.h>
-#include <graphics/directgdicontext.h>
-#include <graphics/wsdrawablesourceprovider.h>
-#include <graphics/sgimage.h>
-
-
-/* 
- * Required by MWsFader implementation
- */
-struct TFadingParams
-    {
-    TUint8 blackMap;
-    TUint8 whiteMap;
-    };
-
-/**
-The purpose of this class is to wrap a @c CDirectGdiContext whenever an
-@c MWsGraphicsContext is needed.
-
-The methods doesn't do anything other than calling the corresponding method
-in @c MWsGraphicsContext.
-
-@see MWsGraphicsContext
-@see MWsDrawableSourceProvider
-@see CDirectGdiContext;
-
-@internalComponent
-@prototype
-*/
-class CDirectGdiGcWrapper : public CBase, public MWsGraphicsContext, public MWsFader
-	{
-public:
-	static CDirectGdiGcWrapper* NewL(RDirectGdiImageTarget& aTarget);
-	~CDirectGdiGcWrapper();
-	inline CDirectGdiContext& DirectGdiGc();
-	TInt SetDrawDeviceOffset(TPoint& aOrigin);
-	
-public: //from MWsGraphicsContext
-	void BitBlt(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap);
-	void BitBlt(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect);
-	void BitBltMasked(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect, const CFbsBitmap& aMaskBitmap, TBool aInvertMask);
-	void BitBltMasked(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect, const CFbsBitmap& aMaskBitmap, const TPoint& aMaskPos);
-	void ResetClippingRegion();
-	void Clear();
-	void Clear(const TRect& aRect);
-	void ResetBrushPattern();
-	void ResetFont();
-	void DrawArc(const TRect& aRect, const TPoint& aStart, const TPoint& aEnd);
-	void DrawPie(const TRect& aRect, const TPoint& aStart, const TPoint& aEnd);
-	void DrawBitmap(const TRect& aDestRect, const CFbsBitmap& aSourceBitmap);
-	void DrawBitmap(const TRect& aDestRect,	const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect);
-	void DrawBitmapMasked(const TRect& aDestRect, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect, const CFbsBitmap& aMaskBitmap, TBool aInvertMask);
-	void DrawRoundRect(const TRect& aRect, const TSize& aEllipse);
-	void DrawPolyLine(const TArray<TPoint>& aPointList);
-	void DrawPolyLineNoEndPoint(const TArray<TPoint>& aPointList);
-	void DrawPolygon(const TArray<TPoint>& aPointList, TFillRule aFillRule=EAlternate);
-	void DrawEllipse(const TRect& aRect);
-	void DrawLine(const TPoint& aStart, const TPoint& aEnd);
-	void DrawLineTo(const TPoint& aPoint);
-	void DrawLineBy(const TPoint& aVector);
-	void DrawRect(const TRect& aRect);
-	void DrawText(const TDesC& aText,const TTextParameters* aParam);
-	void DrawText(const TDesC& aText,const TTextParameters* aParam,const TPoint& aPosition);
-	void DrawText(const TDesC& aText,const TTextParameters* aParam,const TRect& aClipRect);
-	void DrawText(const TDesC& aText,const TTextParameters* aParam,const TRect& aClipFillRect,TInt aBaselineOffset,TTextAlign aHrz=ELeft,TInt aMargin=0);
-	void DrawTextVertical(const TDesC& aText,const TTextParameters* aParam,TBool aUp);
-	void DrawTextVertical(const TDesC& aText,const TTextParameters* aParam,const TPoint& aPosition,TBool aUp);
-	void DrawTextVertical(const TDesC& aText,const TTextParameters* aParam,const TRect& aClipRect,TBool aUp);
-	void DrawTextVertical(const TDesC& aText,const TTextParameters* aParam,const TRect& aClipRect,TInt aBaselineOffset,TBool aUp,TTextAlign aVert=ELeft,TInt aMargin=0);
-	void DrawTextVertical(const TDesC& aText,const TTextParameters* aParam,const TRect& aClipRect,TInt aBaselineOffset,TInt aTextWidth,TBool aUp,TTextAlign aVert=ELeft,TInt aMargin=0);
-	void MoveTo(const TPoint& aPoint);
-	void MoveBy(const TPoint& aVector);
-	void Plot(const TPoint& aPoint);
-	void Reset();
-	void SetBrushColor(const TRgb& aColor);
-	void SetBrushOrigin(const TPoint& aOrigin);
-	void SetBrushStyle(TBrushStyle aBrushStyle);
-	void SetClippingRegion(const TRegion& aRegion);
-	void SetDrawMode(TDrawMode aDrawMode);
-	void SetOrigin(const TPoint& aPoint = TPoint(0, 0));
-	void SetPenColor(const TRgb& aColor);
-	void SetPenStyle(TPenStyle aPenStyle);
-	void SetPenSize(const TSize& aSize);
-	void SetTextShadowColor(const TRgb& aColor);
-	void SetCharJustification(TInt aExcessWidth, TInt aNumChars);
-	void SetWordJustification(TInt aExcessWidth, TInt aNumGaps);
-	void SetUnderlineStyle(TFontUnderline aUnderlineStyle);
-	void SetStrikethroughStyle(TFontStrikethrough aStrikethroughStyle);
-	void SetBrushPattern(const CFbsBitmap& aBitmap);
-	void SetBrushPattern(TInt aFbsBitmapHandle);
-	void SetFont(const CFont* aFont);
-	void CopyRect(const TPoint& aOffset, const TRect& aRect);
-	void UpdateJustification(const TDesC& aText,const TTextParameters* aParam);
-	void UpdateJustificationVertical(const TDesC& aText,const TTextParameters* aParam,TBool aUp);
-	void SetFontNoDuplicate(const CFont* aFont);
-	TBool HasBrushPattern() const;
-	TBool HasFont() const;
-	TRgb BrushColor() const;
-	TRgb PenColor() const;
-	TRgb TextShadowColor() const;
-	
-	// Return current error status of MWsGraphicsContext
-	TInt GetError();
-	// Getters
-	TPoint Origin() const;
-	const TRegion& ClippingRegion();
-	// Save and retrieve gc settings
-	TInt Push();
-	void Pop();
-
-public: // MWsFader
-	void SetFadingParameters(const TDesC8& aData);
-	void FadeArea(const TRegion& aRegion);
-
-	//from MWsObjectProvider
-	TAny* ResolveObjectInterface(TUint aTypeId);
-
-private:
-	const CArrayFix<TPoint>* DoCreateCArrayL(const TArray<TPoint>& aPointList);
-	const CArrayFix<TPoint>* CreateCArray(const TArray<TPoint>& aPointList);
-	void SetError(TInt aError);
-	
-private:
-	CDirectGdiContext* iContext;
-	TInt iErrorCode;
-	CBufBase* iGcBuf; // used for keeping state when drawing CWsGraphicDrawers
-	RRegionBuf<20> iClippingRegion; // Clipping region while doing drawing
-	TPoint iOrigin; // Window Origin + User defined gc origin
-	
-	//Required by MWsFader implmentation
-	TRgb			iFadeColor;
-	const TUint16*	iLut;
-	};
-
-struct RDirectGdiImageEntry 
-	{
-	RDirectGdiDrawableSource* iDrawableSource;  
-	RSgImage iImage;
-	};
-
-//
-// CDirectGdiGcWrapper
-//
-
-inline CDirectGdiContext& CDirectGdiGcWrapper::DirectGdiGc()
-	{return(*iContext);}
-
-
-
-#endif //__DIRECTGDIGCWRAPPER_H__
--- a/windowing/windowserver/tauto/eventdd.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include <kernel/kernel.h>
-#include "eventdd.h"
-
-/**
-  Logical Device (factory class) for 'EventDD'
-*/
-class DEventFactory : public DLogicalDevice
-	{
-public:
-	DEventFactory();
-	//Pure virtual funcitons from DLogicalDevice
-	TInt Install();
-	void GetCaps(TDes8& aDes) const;
-	TInt Create(DLogicalChannelBase*& aChannel);
-	};
-
-class DEventDD : public DLogicalChannelBase
-	{
-public:
-	//Pure virtual function from DLogicalChannelBase
-	TInt Request(TInt aReqNo,TAny* a1,TAny* a2);
-private:
-	TInt DoControl(TInt aFunction, TAny* a1, TAny* a2);
-	TInt SendEvent(TRawEvent* aEvent);
-	};
-
-
-/* DLL Factory Function */
-
-DECLARE_STANDARD_LDD()
-	{
-	return new DEventFactory;
-	}
-
-
-/* DEventFactory */
-
-DEventFactory::DEventFactory() :DLogicalDevice()
-	{
-	iVersion=REventDD::VersionRequired();	//Set version number for this device
-	}
-
-TInt DEventFactory::Install()
-	{
-	return SetName(&REventDD::DriverName());
-	}
-
-void DEventFactory::GetCaps(TDes8& aDes) const
-	{
-	Kern::InfoCopy(aDes,KNullDesC8);
-	}
-
-TInt DEventFactory::Create(DLogicalChannelBase*& aChannel)
-	{
-	aChannel=new DEventDD;
-	return aChannel?KErrNone:KErrNoMemory;
-	}
-
-
-/* DEventDD */	// Logical Channel
-
-TInt DEventDD::Request(TInt aReqNo,TAny* a1,TAny* a2)
-	{
-	// Decode the message type and dispatch it to the relevent handler function...
-	// only using synchronous control messages
-	if (static_cast<TUint>(aReqNo)<static_cast<TUint>(KMaxTInt))
-		return DoControl(aReqNo,a1,a2);
-	return KErrNotSupported;
-	}
-
-/**
-  Process synchronous 'control' requests
-*/
-TInt DEventDD::DoControl(TInt aFunction,TAny* a1,TAny* /*a2*/)
-	{
-	TInt ret=KErrNotSupported;
-
-	switch (aFunction)
-		{
-	case REventDD::ESendEvent:
-		ret=SendEvent(static_cast<TRawEvent*>(a1));
-		break;
-	default:;
-		}
-	return ret;
-	}
-
-TInt DEventDD::SendEvent(TRawEvent* aEvent)
-	{
-	TRawEvent event;
-	kumemget(&event,aEvent,sizeof(TRawEvent));	//fetch event from user memory
-	NKern::ThreadEnterCS();
-	TInt err=Kern::AddEvent(event);
-	NKern::ThreadLeaveCS();
-	return err;
-	}
--- a/windowing/windowserver/tauto/eventdd.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef __EVENTDD_H__
-#define __EVENTDD_H__
-
-#ifndef __E32cmn_H__
-#include <e32cmn.h>
-#endif
-
-_LIT(KName,"EventDD");
-
-
-class REventDD : public RBusLogicalChannel
-	{
-	friend class DEventDD;
-public:
-	/**
-	Structure for holding driver capabilities information
-	(Just a version number in this example.)
-	*/
-	class TCaps
-		{
-	public:
-		TVersion iVersion;
-		};
-
-public:
-	inline static const TDesC& BinaryName();
-	inline static const TDesC& DriverName();
-	inline static TVersion VersionRequired();
-	inline TInt Open();
-	inline TInt SendEvent(TRawEvent& aEvent);
-private:
-	enum TControl
-		{
-		ESendEvent
-		};
-	};
-
-
-inline const TDesC& REventDD::BinaryName()
-	{
-	return KName;
-	}
-inline const TDesC& REventDD::DriverName()
-	{
-	return KName;
-	}
-inline TVersion REventDD::VersionRequired()
-	{
-	return TVersion(1,0,0);
-	}
-inline TInt REventDD::Open()
-	{
-	return DoCreate(DriverName(),VersionRequired(),KNullUnit,NULL,NULL,EOwnerThread);
-	}
-inline TInt REventDD::SendEvent(TRawEvent& aEvent)
-	{
-	return DoControl(ESendEvent,static_cast<TAny*>(&aEvent));
-	}
-
-#endif	//__EVENTDD_H__
--- a/windowing/windowserver/tauto/mwsgraphicscontexttodirectgdimappings.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef __MWSGRAPHICSCONTEXTTODIRECTGDIMAPPINGS_H__
-#define __MWSGRAPHICSCONTEXTTODIRECTGDIMAPPINGS_H__
-
-#include <gdi.h>
-#include <graphics/wsgraphicscontext.h>
-#include <graphics/directgditypes.h>
-
-class MWsGraphicsContextToDirectGdiMappings
-	{
-public:
-	static DirectGdi::TFillRule Convert(MWsGraphicsContext::TFillRule aFillRule) { return (DirectGdi::TFillRule)aFillRule; }
-	static DirectGdi::TPenStyle Convert(MWsGraphicsContext::TPenStyle aPenStyle) { return (DirectGdi::TPenStyle)aPenStyle; }
-	static DirectGdi::TBrushStyle Convert(MWsGraphicsContext::TBrushStyle aBrushStyle) { return (DirectGdi::TBrushStyle)aBrushStyle; }
-	static DirectGdi::TTextAlign Convert(MWsGraphicsContext::TTextAlign aTextAlign) { return (DirectGdi::TTextAlign)aTextAlign; }
-	static DirectGdi::TFontUnderline Convert(MWsGraphicsContext::TFontUnderline aFontUnderline) { return (DirectGdi::TFontUnderline)aFontUnderline; }
-	static DirectGdi::TFontStrikethrough Convert(MWsGraphicsContext::TFontStrikethrough aFontStrikethrough) { return (DirectGdi::TFontStrikethrough)aFontStrikethrough; }
-	static const DirectGdi::TTextParameters* Convert(const MWsGraphicsContext::TTextParameters* aParam) { return reinterpret_cast<const DirectGdi::TTextParameters*>(aParam); }
-	static DirectGdi::TDrawMode LossyConvert(MWsGraphicsContext::TDrawMode aDrawMode)
-		{return (aDrawMode==MWsGraphicsContext::EDrawModeWriteAlpha ? DirectGdi::EDrawModeWriteAlpha : DirectGdi::EDrawModePEN);}
-	};
-
-
-template<class T>
-class TArrayWrapper : public TArray<T>
-	{
-public:
-	TArrayWrapper(const T* aArray, TInt aCount);
-private:
-	static TInt Count(const CBase* aPtr);
-	static const TAny* At(const CBase* aPtr, TInt aIndex);
-private:
-	const T* iArray;
-	const TInt iCount;
-	};
-
-template<class T>
-TArrayWrapper<T>::TArrayWrapper(const T* aArray, TInt aCount)
-	: TArray<T>(TArrayWrapper::Count, TArrayWrapper::At, reinterpret_cast<const CBase*>(this)), iArray(aArray), iCount(aCount)
-	{
-	//reinterpret_cast above since this class doesn't derive from CBase but TArray is
-	//only silly requiring CBase as opposed to TAny, so this is safe
-	ASSERT(iArray);
-	}
-
-template<class T>
-TInt TArrayWrapper<T>::Count(const CBase* aPtr)
-	{
-	//reinterpret_cast since this class doesn't derive from CBase but TArray is
-	//only silly requiring CBase as opposed to TAny, so this is safe
-	const TArrayWrapper* self = reinterpret_cast<const TArrayWrapper*>(aPtr);
-	return self->iCount;
-	}
-
-template<class T>
-const TAny* TArrayWrapper<T>::At(const CBase* aPtr, TInt aIndex)
-	{
-	//reinterpret_cast since this class doesn't derive from CBase but TArray is
-	//only silly requiring CBase as opposed to TAny, so this is safe
-	const TArrayWrapper* self = reinterpret_cast<const TArrayWrapper*>(aPtr);
-	if(!Rng(0, aIndex, self->iCount - 1))
-		User::Panic(_L("USER"), 130); //out of bounds (RArray/RPointerArray)
-	return self->iArray + aIndex;
-	}
-
-
-#endif	//__MWSGRAPHICSCONTEXTTODIRECTGDIMAPPINGS_H__
Binary file windowing/windowserver/tauto/mytest.mbm has changed
--- a/windowing/windowserver/tauto/openwfc/AUTO.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,669 +0,0 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Header for window server auto test code
-// 
-//
-
-
-#ifndef __AUTO_H__
-#define __AUTO_H__
-
-#include <e32std.h>
-#include <e32math.h>
-#include "../../SERVER/w32cmd.h"
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include <wsautotest.mbg>
-#include "TGraphicsHarness.h"
-#include "../../SERVER/openwfc/panics.h"
-
-#define DISABLE_FAIL_DIALOG
-
-#define TEST_BITMAP_NAME _L("Z:\\WSTEST\\WSAUTOTEST.MBM")
-
-#define SCREEN_MODE_TESTING
-
-#define LOG_MESSAGE(p) LogMessage(((TText8*)__FILE__), __LINE__,(p))
-#define LOG_MESSAGE2(p1,p2) LogMessage(((TText8*)__FILE__), __LINE__,(p1),(p2))
-#define LOG_MESSAGE3(p1,p2,p3) LogMessage(((TText8*)__FILE__), __LINE__,(p1),(p2),(p3))
-#define LOG_MESSAGE4(p1,p2,p3,p4) LogMessage(((TText8*)__FILE__), __LINE__,(p1),(p2),(p3),(p4))
-#define LOG_MESSAGE5(p1,p2,p3,p4,p5) LogMessage(((TText8*)__FILE__), __LINE__,(p1),(p2),(p3),(p4),(p5))
-#define LOG_MESSAGE6(p1,p2,p3,p4,p5,p6) LogMessage(((TText8*)__FILE__), __LINE__,(p1),(p2),(p3),(p4),(p5),(p6))
-#define LOG_MESSAGE7(p1,p2,p3,p4,p5,p6,p7) LogMessage(((TText8*)__FILE__), __LINE__,(p1),(p2),(p3),(p4),(p5),(p6),(p7))
-
-// MB 23\11\04 The heap size was only 4k which was causing DSA step 7 to fail on HW.
-// Increased heap size to 8k
-// 23/02/2009 Again failing with no memory due to COLOR16MAP used. 
-// Increased heap size to 16k
-LOCAL_D const TUint KOtherProcHeapSize=0x4000;
-LOCAL_D const TInt KAutoTestPriority=-20;
-
-TBool DoCheckRect(CTBaseWin *aWin1,CTBaseWin *aWin2,const TRect &aRect);
-TBool DoCheckRect(CTBaseWin *aWin1,CTBaseWin *aWin2,const TRect &aRect, TUint aFlags);
-TBool DoCheckRectRWin(RWindowBase &aWin1,RWindowBase &aWin2,const TRect &aRect);
-TBool DoCheckRectRWin(RWindowBase &aWin1,RWindowBase &aWin2,const TRect &aRect, TUint aFlags);
-TBool DoCheckRect(CTBaseWin *aWin1,CTBaseWin *aWin2);
-TBool DoCheckRect(TPoint aPos1,TPoint aPos2,TSize aSize);
-
-_LIT(KWSERV,"WSERV");
-_LIT(KW32,"W32");
-_LIT(KPlatsecBegin,"*PlatSec* ERROR - BEGIN NEGATIVE PLATSEC TESTING");
-_LIT(KPlatsecEnd,"*PlatSec* ERROR - END NEGATIVE PLATSEC TESTING");
-_LIT(KTestFontTypefaceName,"DejaVu Sans Condensed");
-
-class TestClient;
-class CMinWin;
-class CTWsGraphicsBase;
-
-enum TestState
-	{
-	EInvalid,
-	ENext,
-	EWait,
-	EFinished
-	};
-
-enum TAutoPanics
-	{
-	EAutoPanicTestFailed,
-	EAutoPanicPanicFailed,
-	EAutoPanicTestRectsIndex,
-	EAutoPanicTestRectsSection,
-	EAutoPanicUnexpectedLeave,
-	EAutoPanicTestBrushesIndex,
-	EAutoPanicWindowType,
-	EAutoPanicTooManyDownKeys,
-	EAutoPanicInvalidEvent,
-	EAutoFadeWindow,
-	EAutoPanicWrongTest,
-	EAutoPanicAnimError,
-	ETManPanicPcFailed,		              //Panic use in a test copied from TMan
-	EAutoPanicTestError,	              //Test returned bad return type
-	EAutoPanicDirect,		              //Direct Screen Access logic state error
-	EAutoPanicScanCapital,	              //Scan codes must not be lower case letters
-	EAutoPanicRedrawStoring,              //Inconsistent Redraw Storing Behaviour
- 	EAutoPanicRecalledCreateTestBaseL,    //Called CreateTestBaseL twice
- 	EAutoPanicHeartBeatCursorRect,        //Invalid size of rectangle in ChangeTransAndCheckHeartBeat
-	EAutoPanicGroupWinHasChild,           //Main test group window has child at start of test
-  	EAutoPanicPanicSetTrans,              //Error setting transparency during panic tests
-  	EAutoPanicNoDigitiser,                //Pointer event when the configuration has no digitiser
-	};
-
-enum TPanicExitReasons
-	{
-	EWsExitReasonBad,
-	EWsExitReasonFinished,
-	};
-
-enum TAutoLeaves
-	{
-	ETestPassed=0,
-	ETestFailed=1,
-	};
-
-typedef TInt (*TPanicFunction)(TInt aInt, TAny *aPtr);
-
-struct SPanicParams
-	{
-	TInt num;
-	TPanicFunction func;
-	TAny *ptr;
-	};
-
-class LogWindow : public CTWin
-	{
-	enum
-		{
-		EDummyValue=-9999
-		};
-public:
-	LogWindow();
-	void ConstructL(CTWinBase& aParent);
-	void Draw();
-	void DrawSubTitle();
-	void DrawMessage();
-	void LogTest(const TDesC &aTitle,TInt aNum);
-	const TDesC& LogSubTest(const TDesC &aTitle,TInt aNum);
-	const TDesC& LogMessage(TBool aLog,const TDesC& aText,TInt aNum=EDummyValue);
-private:
-	TBuf<0x40> iTestTitle;
-	TBuf<0x40> iSubTitle;
-	TBuf<0x40> iMessage;
-	TInt iTitleHeight;
-	};
-
-class CTestBase;
-
-/** 
-This class is a window that is used to fake a border around the TestWindow defined below.
-It simply draws an opaque black window on top of which the TestWindow will be drawn giving the illusion
-there is a border.
-
-@see TestWindow
-@internalComponent
-@released
-*/
-class CBorderWindow : public CTWin
-	{
-public:
-	CBorderWindow();
-	void ConstructL(CTWinBase& aParent);
-	void Draw();
-	};
-
-class TestWindow : public CTWin
-	{
-public:
-	TestWindow();
-	~TestWindow();
-	void Draw();
-	void SetUpL(TPoint aPos, TSize aSize, CTWinBase* aParent, CWindowGc& aGc);
-	void ClearWin();
-	void SetBorderExt(TPoint aPos, TSize aSize);
-	CBorderWindow* GetBorderWin();
-private:
-	CBorderWindow* iBorderWin;
-	};
-
-/**
-This class used to run each individual test before the migration to TEF.
-Now it doesn't do much and should probably be refactored.
-
-@internalComponent
-@released
-*/
-class CTestDriver : public CBase
-	{
-public:
-	/** Factory function that returns a class derived from CTestDriver */
-	static CTestDriver* CreateL(TInt aScreenNumber);
-	virtual ~CTestDriver();
-	
-protected:
-	CTestDriver(TInt aScreenNumber);
-	
-public:
-	virtual void DoDisplayDialog(TDesC& timeBuf,TDesC& testReport) = 0;
-
-	void TestComplete2();
-	void DestroyTest();
-
-	inline TInt ScreenNumber() {return iScreenNumber;}
-	inline TInt NumberOfScreens() {return iNumberOfScreens;}
-
-public:
-	CTestBase *iTest;
-	TInt iSubTestNum;
-	static TInt iTestNum;
-protected:
-	TTime iStartTime;
-	TInt iScreenNumber;
-	TInt iTestSize;
-	TInt iNumberOfScreens;
-	};
-
-/** Variant of CTestDriver used when the tests are run on the primary screen.
-
-@internalComponent
-@released
-*/
-class CTestDriverPrimary: public CTestDriver
-	{
-public:
-	CTestDriverPrimary(TInt aScreenNumber);
-	void DoDisplayDialog(TDesC& timeBuf,TDesC& testReport);
-	};
-
-/** Variant of CTestDriver used when the tests are run on a secondary screen.
-
-@internalComponent
-@released
-*/
-class CTestDriverSecondary : public CTestDriver
-	{
-public:
-	CTestDriverSecondary(TInt aScreenNumber);
-	void DoDisplayDialog(TDesC& timeBuf,TDesC& testReport);
-	};
-
-/** List of rectangles use by TGDI.CPP and TRECTLIST.CPP.
-
-Since only 2 tests make use of this shouldn't it be moved outside of the framework?
-
-@internalComponent
-@released
-*/
-class TTestRects
-	{
-private:
-	enum TRectListLimits
-		{
-		EMaxRectFromList=64,
-		EMaxRectZeroSize=73,
-		EMaxRectWide=83,
-		EMaxRectHigh=93
-		};
-		
-public:
-	void Construct(const RWindow &aWindow);
-	TInt Count1() const;
-	TInt Count2() const;
-	TInt Count3() const;
-	TRect operator[](TInt aIndex);
-	static void ResetSeed();
-private:
-	TInt Rnd(TInt aSize);
-	TInt RndMax(TInt aSize);
-	TInt RectCoord(TInt aSection,TInt aSize);
-	void RectCoordPair(TInt &aTl, TInt &aBr, TInt aSection, TInt aSize);
-	
-private:
-	TSize iSize;
-	static TRect iList[64];
-	static TInt64 iSeed;
-	};
-
-/**
-@internalComponent
-@released
-*/
-class CBitmap : public CBase
-	{
-public:
-	static CBitmap* NewLC(const TSize& aSizeInPixels,TDisplayMode aDispMode);
-	static CBitmap* NewL(const TSize& aSizeInPixels,TDisplayMode aDispMode);
-	static CBitmap* NewL(TInt aHandle);
-	static CBitmap* NewL(TDesC& aFileName);
-	~CBitmap();
-	inline CFbsBitmap& Bitmap() const {return *iBitmap;}
-	inline CFbsBitmapDevice& Device() const {return *iDevice;}
-	inline CFbsBitGc& Gc() const {return *iGc;}
-private:
-	static CBitmap* NewLC(TInt aHandle,const TSize& aSizeInPixels,TDisplayMode aDispMode);
-	void ConstructL(TInt aHandle,const TSize& aSizeInPixels,TDisplayMode aDispMode);
-private:
-	CFbsBitmap* iBitmap;
-	CFbsBitmapDevice* iDevice;
-	CFbsBitGc* iGc;
-	};
-
-/*TPartialRedrawType*/
-enum TPartialRedrawType
-	{
-	//redraw store type is not yet determined.
-	EPartialRedraw_Unknown,
-	//redraw store is discarded on invalidation and begin-redraw on a smaller rect.
-	EPartialRedraw_None,
-	// redraw store is preserved on invalidation and begin-redraw on a smaller rect.
-	EPartialRedraw_PreserveStoredCmds,
-	// redraw store is appended with partial redraw commands, and old redraw store is suitably modified.
-	EPartialRedraw_FullRedrawSupport
-	};
-
-class CTestBase : public CBase
-	{
-public:
-	enum TPriorites
-		{
-		EAutoTestPriority=KAutoTestPriority
-		};
-	enum TTestLevel
-		{
-		ELevelQuick,		// Quick check on main cases for each function
-		ELevelNormal,		// Suitable test level for internal release
-		ELevelRelease,		// Thorough test suitable for official releases
-		ELevelMega,			// Really OTT, takes forever to run, leave it going over the weekend sort of tests
-		};
-public:
-	CTestBase(const TDesC &aTitle,CTWsGraphicsBase* aTestBase);
-	~CTestBase();
-	void StartTestL(TInt aNum, CTestDriver* aDriver, TTestLevel aLevel);
-	void LogSubTest(const TDesC &aTitle);
-	void LogMessage(TInt aValue);
-	void LogSubState(TInt aSubState);
-	TInt LaunchPanicThread(RThread &aThread, SPanicParams *aPtr);
-	TInt TestPanicL(SPanicParams *aPtr, TInt aExitReason, const TDesC &aCategory, TBool* aTestFinished=NULL);
-	TInt TestPanicL(TPanicFunction aFunction, TInt aExitReason, TInt aInt, TAny *aPtr, const TDesC &aCategory, TBool* aTestFinished=NULL);
-	TInt TestWsPanicL(TPanicFunction aFunction, TClientPanic aExitReason, TInt aInt, TAny *aPtr=NULL, TBool* aTestFinished=NULL);
-	TInt TestW32PanicL(TPanicFunction aFunction, TW32Panic aExitReason, TInt aInt, TAny *aPtr, TBool* aTestFinished=NULL);
-	TInt TestWservPanicL(TPanicFunction aFunction, TWservPanic aExitReason, TInt aInt, TAny *aPtr);
-	void TriggerFail();
-	static void DrawTestBackground(TBool aInvertColours, const TSize &aSize, TInt aGrays=16);
-	inline CTestDriver* Driver();
-	void SimulatePointer(TRawEvent::TType aType, TInt aX, TInt aY);
-	TBool ConfigurationSupportsPointerEventTesting() const;
-	void SimulateEvent(TRawEvent::TType aType);
-	void LogColors(const CBitmapDevice& aDevice,TPoint aBasePoint, TPoint aStartPoint, TPoint aEndPoint);
-	void LogColors4(const CBitmapDevice& aDevice,TPoint aStartPoint,TInt aLen);
-	inline TInt ScreenNumber() {return iScreenNumber;}
-	TPartialRedrawType RedrawStoreTypeL();
-	TBool IsFullRomL();
-	void SimulateKeyDownUpWithModifiers(TInt aScanCode,TUint aModifiers);
-	void SimulatePointerDownUp(TInt aX, TInt aY);
-	void SimulateKeyDownUp(TInt aScanCode);
-	void SimulateKey(TRawEvent::TType aType, TInt aScanCode);
-	void DelayIfFullRomL();
-	void SetUpMember(TSpriteMember &aMember);
-	void AbortL();
-	void LogLeave(TInt aErr);
-	void CloseAllPanicWindows();
-	const TSize& StdTestWindowSize();
-	TInt MaxGrays() const;
-	TInt MaxColors() const;
-	TInt SaveScreen(const TDesC& aFileName);
-	TInt SaveScreen(const TDesC& aFileName,const TSize& aScreenSize,TDisplayMode aColorDepth);
-protected:
-	void UpdateTestResults(TInt aNoOfTest, TInt aNoOfTestPass);
-	void SaveScreenL(const TDesC& aFileName,const TSize& aScreenSize,TDisplayMode aColorDepth);
-public:
-	static TInt iNumberTestsPass;
-	static TInt iNumberTests;
-	TInt iState;
-	TInt iScreenNumber;
-	static TInt iScreenNo;
-	TTestRects iTestRects;
-	static TRect iNormalPointerCursorArea;
-	TBuf<0x40> iSubTitle;
-	TTestLevel iTestLevel;
-	static TInt iNumberOfGrpWndsOnPrimaryScreenWithZeroPriority; // Will be used in TGWHANDLE test.
-protected:
-	CTestDriver* iDriver;
-private:
-	TBuf<0x40> iTitle;
-	CTWsGraphicsBase* iTestBase;
-	/** 
-	Several tests use 3 windows : one is a log window, one is a reference window 
-	and one is the actual output of the test. All these windows have the same width which is roughly
-	1/3 of the screen. They also have the same height which is roughly equal to the screen height.
-	*/
-	TSize iStdTestWindowSize;
-	CMinWin* iMinWin;
-	TInt iTestNum;
-	TBool iFail;	// Used to trigger failures to test test code.
-	TInt iThreadNumber;
-	/** 
-	The type of redraw store in use. Static members so that	RedrawStoreTypeL computes
-	this value only once and then returns the cached result as this remains the same for
-	the entire test run.
-	*/
-	static TPartialRedrawType iRedrawType;
-	/** The number of greys available in the richest grey mode. */
-	static TInt iMaxGrays;
-	/** The number of colours available in the richest supported colour mode. */
-	static TInt iMaxColors;
-	};
-
-class CTWsGraphicsBase : public CTGraphicsBase
-	{
-public:
-	CTWsGraphicsBase(CTestStep* aStep);
-	~CTWsGraphicsBase();
-	void CreateTestBaseL(CTTMSGraphicsStep* aTmsStep);
-	inline CTestBase *TestBase() const {return(iTest);};
-	void TestComplete();
-	void LogMessage(const TText8* aFile,TInt aLine,TRefByValue<const TDesC> aFmt,...);
-	TInt GetScreenFromIni() const;
-protected:
-	void CheckRect(TPoint aPos1,TPoint aPos2,TSize aSize, const TDesC *aErrorMsg=NULL);
-	void CheckRect(TPoint aPos1,TPoint aPos2,TSize aSize, const TDesC &aErrorMsg);
-	void CheckRectNoMatch(TPoint aPos1,TPoint aPos2,TSize aSize, const TDesC *aErrorMsg=NULL);
-	void CheckRectNoMatch(TPoint aPos1,TPoint aPos2,TSize aSize, const TDesC &aErrorMsg);
-	void CheckRect(CTBaseWin *aWin1,CTBaseWin *aWin2, const TDesC *aErrorMsg=NULL);
-	void CheckRect(CTBaseWin *aWin1,CTBaseWin *aWin2, const TDesC &aErrorMsg);
-	void CheckRectNoMatch(CTBaseWin *aWin1,CTBaseWin *aWin2, const TDesC *aErrorMsg=NULL);
-	void CheckRectNoMatch(CTBaseWin *aWin1,CTBaseWin *aWin2, const TDesC &aErrorMsg);
-	TBool CheckRect(CTBaseWin *aWin1,CTBaseWin *aWin2,const TRect &aRect, const TDesC *aErrorMsg=NULL);
-	TBool CheckRect(CTBaseWin *aWin1,CTBaseWin *aWin2,const TRect &aRect, const TDesC &aErrorMsg);
-	void CheckRectNoMatch(CTBaseWin *aWin1,CTBaseWin *aWin2,const TRect &aRect, const TDesC *aErrorMsg=NULL);
-	void CheckRectNoMatch(CTBaseWin *aWin1,CTBaseWin *aWin2,const TRect &aRect, const TDesC &aErrorMsg);
-	TBool CompareWindows(const TDesC *aErrorMsg=NULL);
-	TBool CompareWindows(const TDesC &aErrorMsg);
-	void CompareWindows(const TRect &aRect, const TDesC *aErrorMsg=NULL);
-	void CompareWindows(const TRect &aRect, const TDesC &aErrorMsg);
-	void CompareWindowsSoftFailWinscw(const TText8* aFile, TInt aLine);
-	const TSize& StdTestWindowSize();
-	TInt MaxGrays() const;
-	TInt MaxColors() const;
-private:
-	TBool CheckRetValue(TBool aPass,const TDesC* aErrorMsg,const TDesC& aErrorFunction);
-protected:
-	CTestBase* iTest;
-	CTTMSGraphicsStep* iTmsStep;
-	};
-
-class TestWindowGroup : public CTWindowGroup
-	{
-public:
-	TestWindowGroup(CTClient *aClient);
-	void BecomeOwning();
-	void KeyL(const TKeyEvent &aKey,const TTime &aTime);
-	void KeyDownL(const TKeyEvent &aKey,const TTime &aTime);
-	void KeyUpL(const TKeyEvent &aKey,const TTime &aTime);
-	};
-
-class TestClient : public CTClient
-	{
-public:
-	TestClient();
-	~TestClient();
-	void ConstructL();	// virtual from CTClient
-	void KeyL(const TKeyEvent &aKey,const TTime &aTime);
-	void Shutdown();
-	inline CTestDriver* Driver();
-	TBool WaitForEvent();
-	TBool IsEventWaiting();
-	void LogAvailableScreenModeL();
-	void TestWsSetBufferSizeL();
-	void TestWsSetMaxBufferSizeL();
-	inline LogWindow& StdLogWindow() {return *iStdLogWindow;}
-	void SetTestClientScreenMode(TInt aMode);
-	void UpdateTestClientScreenMode();
-public:
-	RArray<TInt> iScreenModes;
-	
-private:
-	/**
-	Several tests use 3 windows : one is a log window, one is a reference window 
-	and one is the actual output of the test. This member is the log window.
-	*/
-	LogWindow* iStdLogWindow;
-	CTestDriver* iDriver;
-	};
-
-class TThreadStartUp
-	{
-public:
-	TThreadStartUp() :iInitFunction(0), iParam(0) {}
-	TThreadStartUp(TThreadFunction aInitFunction,TAny* aParam) :iInitFunction(aInitFunction), iParam(aParam) {}
-public:
-	TThreadFunction iInitFunction;	   //The call to this fn will prepare a cleanup stack, but this function should not leave.
-	TAny* iParam;
-	};
-
-#if defined(__WINS__)
-	const TOwnerType KOwnerType=EOwnerThread;
-#else
-	const TOwnerType KOwnerType=EOwnerProcess;
-#endif
-
-typedef TBuf<32> TBufArg;
-
-class CProcess : public CBase
-	{
-public:
-	enum
-		{
-		eProcessPriortyTest,
-		eProcessKeyTest,
-		eProcessDirectTest,
-		eProcessMultiDisplayTest,
-		eNumProcessCalls		//Must be last one
-		};
-	struct TInitialFunction
-		{
-		inline TInitialFunction(const TDesC& aParam,TThreadFunction aFunction) :iParam(aParam), iFunction(aFunction) {}
-		TBuf<16> iParam;
-		TThreadFunction iFunction;
-		};
-public:
-	static TInt Start(const TWinCommand& aParam);
-	static CProcess* NewL(TInt aFunctionNo,TInt aScreenNumber=KDefaultScreen);
-	static CProcess* NewTL(TInt aFunctionNo,TInt aScreenNumber=KDefaultScreen,TRequestStatus* aClientRequestStatus = NULL);
-	static CProcess* NewThreadL(const TDesC& aName,TThreadFunction aFunction,TThreadStartUp* aPtr
-																							,TRequestStatus* aStatus);
-	static CProcess* NewThreadL(const TDesC& aName,TThreadStartUp* aPtr);
-	static CProcess* NewThreadRendezvousL(const TDesC& aName,TThreadFunction aFunction,TThreadStartUp* aPtr,TRequestStatus* aLogonStatus,TRequestStatus& aRendezvousStatus);
-	static CProcess* NewThreadRendezvousL(const TDesC& aName,TThreadStartUp* aPtr,TRequestStatus& aRendezvousStatus);
-
-	static CProcess* NewSimpleThreadL(const TDesC& aName,TThreadStartUp* aPtr,TRequestStatus* aStatus=NULL);
-	void ConstructL(TInt aFunctionNo,TInt aScreenNumber=KDefaultScreen);
-	void ConstructTL(TInt aFunctionNo,TInt aScreenNumber=KDefaultScreen,TRequestStatus* aStatus=NULL);
-	void ConstructL(const TDesC& aName,TThreadFunction aFunction,TThreadStartUp* aPtr,TRequestStatus* aStatus);
-	void ConstructRendezvousL(const TDesC& aName,TThreadFunction aFunction,TThreadStartUp* aPtr,TRequestStatus* aLogonStatus,TRequestStatus& aRendezvousStatus);
-
-	~CProcess();
-	void Logon(TRequestStatus& aStatus) const;
-	void Terminate(TInt aReason);
-	TBool StillAlive();
-	void LeaveIfDied();
-	static TBool ProcessDied(TInt aScreenNo=KDefaultScreen);
-private:
-	enum
-		{
-		eOtherCreated=0x0001,
-		eThreadCreated=0x0002,
-		};
-private:
-	static TInt ThreadInit(TAny *aPtr);
-	static void InitialiseL(TThreadStartUp* aPtr);
-	static TInt SimpleThreadInit(TAny *aPtr);
-	void Close();
-	static void GetProcArg(const TWinCommand& aParam,TBufArg& aProcArg);
-	static void GetScreenArg(const TWinCommand& aParam, TInt& aScreenArg);
-
-private:
-	TUint iCreated;
-	RProcess iOther;
-	RThread iThread;
-	static TInitialFunction iFunctions[eNumProcessCalls];
-	};
-
-GLREF_D TestWindow* BaseWin;
-GLREF_D TestWindow* TestWin;
-GLREF_D TestClient* TheClient;
-GLREF_D CWindowGc* TheGc;
-
-GLREF_C void AutoPanic(TInt aPanic);
-GLREF_C void CleanUpWindow(TAny *aWindow);
-GLREF_C void PushWindowL(RWindowTreeNode *aWindow);
-GLREF_C TBool OpacityAndAlphaSupportedL();
-GLREF_C TInt TransparencySupportedL();
-GLREF_C TInt CheckScalingSupportedOrNot();
-GLREF_C TBool CheckNonZeroOriginsSupportedOrNot();
-GLREF_C TPoint PhysicalToLogical(TPoint aPhysicalPtMinusOrigin,TSize aScale);
-GLREF_C TPtrC DisplayModeAsString(TDisplayMode aMode);
-GLREF_C TBool LossyCheckBlankBitmap(const CFbsBitmap& aBitmap, const TRect aArea, const TRgb aCheckColor, TBool aLossyCompare=ETrue);
-GLREF_C TBool LossyCompareBitmap(const CFbsBitmap& aBitmap1, const CFbsBitmap& aBitmap2, const TRect aCompareRect, TBool aLossyCompare=ETrue);
-GLDEF_C TBool LossyCompareBitmapRecord(CFbsBitmap& aBitmap1, CFbsBitmap& aBitmap2, const TRect aCompareRect, TBool aLossyCompare, TInt& aPixelsDifferent, CTestExecuteLogger& aLogger);
-GLREF_C TBool LossyCheckBlankWindow(const CWsScreenDevice& aScreen, CFbsBitmap& aBitmap, const TRect aArea, const TRgb aCheckColor);
-GLREF_C TBool LossyCompareWindow(const CWsScreenDevice& aScreen, CFbsBitmap& aBitmap1, CFbsBitmap& aBitmap2, const TRect aCompareRect);
-
-#define LogText(S) {_LIT(String__LINE__,S); Logger.Log(String__LINE__);}
-#define LogFormat(S) {Logger.Log(S);}
-
-inline CTestDriver* CTestBase::Driver()
-	{
-	return iDriver;
-	}
-
-class CTransWindow : public CBlankWindow
-	{
-public:
-	static CTransWindow* NewL(RPointerArray<CTransWindow>& aWindows,TRgb aColor,TRect aPos);
-	static CTransWindow* NewL(CTWinBase* aParent,TRgb aColor,TRect aPos,TDisplayMode* aDisplayMode);
-	static CTransWindow* NewL(CTWinBase* aParent,TRgb aColor,TDisplayMode* aDisplayMode);
-	void ToggleVisibility();
-	static void SetOrdinal(RPointerArray<CTransWindow>& aWindows,TInt aOldPos,TInt aNewPos);
-	inline TRgb Color() {return iCol;}
-	inline TBool IsVisible() {return iVisible;}
-	void SetShadowDisabled(TBool aState);
-	inline TBool IsShadowing() {return iShadowing;}
-	inline TBool ShadowHeight() {return iShadowHight;}
-	inline void SetPosOffset(TPoint aOffset) {iPosOffset=aOffset;}
-	virtual void Draw();
-	void SetDrawOpaque(TBool aDrawOpaque) { iDrawOpaque = aDrawOpaque; }
-	TBool DrawOpaque() const { return iDrawOpaque; }
-	//Virtual functions from CTWinBase overridden in CTBaseWin
-	void AdjustShadow(TInt aAdjust);
-	TPoint Position() const;
-	inline TInt TransparentError() {return iError;}
-private:
-	CTransWindow(TRgb aColor) :CBlankWindow(aColor), iVisible(ETrue) {}
-	//Virtual function from CTBaseWin
-	void InitWin();
-private:
-	TBool iVisible;
-	TBool iShadowing;
-	TBool iDrawOpaque;
-	TInt iShadowHight;
-	TPoint iPosOffset;
-	TInt iError;
-	};
-
-class CMinWin : public CBase
-	{
-public:
-	CMinWin(TInt aScreenNo);
-	~CMinWin();
-	void ConstructL();
-	void Draw(const TRect& aRect);
-private:
-	RWsSession iWs;
-	RWindow iWin;
-	RWindowGroup iGroup;
-	CWsScreenDevice* iScr;
-	TInt iScreenNo;
-	TRect iRect;
-	CWindowGc* iGc;
-	};
-
-class CTimeOut : public CTimer
-	{
-public:
-	inline CTimeOut(): CTimer((EPriorityLow+EPriorityIdle)/2) {}
-	void ConstructL();
-	void Start(TTimeIntervalMicroSeconds32 aInterval,TCallBack aCallBack);
-	//Pure virtual from CActive
-	void RunL();
-private:
-	TCallBack iCallBack;
-	};
-
-#define COMPARE_WINDOWS_SOFTFAIL_WINSCW	CompareWindowsSoftFailWinscw((TText8*)__FILE__, __LINE__)
-
-#define __WS_CONSTRUCT_STEP__(a) \
-	CT##a##Step::CT##a##Step() \
-	{ \
-	SetTestStepName(KT##a##Step); \
-	SetLogHeapInfo(ETrue); \
-	} \
-	 \
-CTGraphicsBase* CT##a##Step::CreateTestL() \
-	{ \
-	CTWsGraphicsBase* test=new (ELeave) CT##a (this); \
- 	test->CreateTestBaseL(this);\
-	return test;\
-	} 
-
-#endif
--- a/windowing/windowserver/tauto/stdpanic.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef __STDPANIC_H__
-#define __STDPANIC_H__
-
-enum TStdPluginPanic
-{
-	EStdPanicTemp = 0,
-	EStdPanicNoDisplayModeFound = 1,
-	EStdPanicCreatedOffScreenBitmapInWrongDimensions = 2,
-	EStdPanicStdRenderStageMustBeFinal = 3,
-	EStdPanicFlickerBufferRenderStageMustNotBeFinal = 4,
-	EStdPanicIniFileMissing = 5,	// can't find an MWsIniFile instance
-	EStdPanicPreviousUiSurfaceUnregisterable = 6,
-	EStdPanicDuplicateUiLayer = 7,	// occurs when trying to add a UI layer when another UI layer is already part of the scene
-	EStdPanicNonMatchingRemovalOfUiLayer = 8, // occurs when removing a UI layer, when it's not the current UI layer
-	EStdPanicUiSurfaceIsNull = 9,	// occurs when the UI surface is NULL
-	EStdPanicScreenDeviceMissing = 10, // can't get MWsScreenDevice from the next render stage
-	EStdPanicCompositionContextMissing = 11, // can't get MWsCompositionContext from the next render stage
-	EStdPanicPopGcSettings = 12, // problem when popping gc settings, previously saved
-	EStdPanicDrawCommandsInvalidState = 13,	//The draw commands state doesn't match with the action that is occuring
-	EStdPanicInvalidCursorType = 14, // invalid cursor
-	EStdPanicRegionError = 15, //Region is not NULL and TRegion::CheckError() has returned ETrue, or validation of region state has failed
-	EStdPanicBadBeginEndSequence = 16, // End() has been called without corresponding Begin(), or Begin() has been called twice.
-	EStdPanicRedrawNotCompleted = 17, // A redraw has been requested before the previous redraw has completed.  
-	EStdPanicNoContext = 18, // Graphics context from the next rendering stage is not available
-};
-
-void Panic(TStdPluginPanic aPanic);
-
-#ifdef _DEBUG
-#define STD_ASSERT_DEBUG(c, p) \
-	do { \
-		if(!(c)) \
-			{ \
-			Panic(p); \
-			} \
-		} while (EFalse)
-#else
-#define STD_ASSERT_DEBUG(c, p)
-#endif //_DEBUG
-
-#define STD_ASSERT_ALWAYS(c, p) \
-	do { \
-		if(!(c)) \
-			{ \
-			Panic(p); \
-			} \
-		} while (EFalse)
-
-#endif //__STDPANIC_H__
Binary file windowing/windowserver/tauto/symball.gif has changed
--- a/windowing/windowserver/tauto/tadvancedpointerevent.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,411 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Advanced pointer event unit tests
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "tadvancedpointerevent.h"
-
-CTAdvancedPointerEvent::CTAdvancedPointerEvent(CTestStep* aStep)
-	: CTWsGraphicsBase(aStep)
-	{}
-
-CTAdvancedPointerEvent::~CTAdvancedPointerEvent()
-	{}
-
-void CTAdvancedPointerEvent::TestPointerEventInit()
-	{
-	// Test size of class with hard coded values to prevent regression failure 
-	TEST(sizeof(TPointerEvent) == 24);
-	
-	TPointerEvent ptrEvent1 = TPointerEvent();
-	ptrEvent1.iType = TPointerEvent::EButton1Down;
-	TPoint initCoords(10,10);
-	ptrEvent1.iPosition = initCoords;
-	ptrEvent1.iParentPosition = initCoords;
-	ptrEvent1.iModifiers = 0;
-	
-	// Construct two TPointerEvent objects. The first using default constructor, the second using the copy constructor. T
-		{		
-		TPointerEvent ptrEvent2 = TPointerEvent(ptrEvent1);
-		TEST(0==Mem::Compare(reinterpret_cast<TUint8*>(&ptrEvent1),sizeof(TPointerEvent),reinterpret_cast<TUint8*>(&ptrEvent2),sizeof(TPointerEvent)));		
-		}	
-	
-		{		
-		TPointerEvent ptrEvent2(TPointerEvent::EButton1Down, 0, initCoords, initCoords);
-		TEST(0==Mem::Compare(reinterpret_cast<TUint8*>(&ptrEvent1),sizeof(TPointerEvent),reinterpret_cast<TUint8*>(&ptrEvent2),sizeof(TPointerEvent)));		
-		}	
-	}
-
-void AdvancedPointerInit(TWsEvent& aEvent1, TWsEvent& aEvent2, const TPointerEvent::TType aType, const TPoint3D& aPoint3D, const TUint8 aPointerNumber)
-	{
-	// init first event
-	TAdvancedPointerEvent& ptrEvent = *aEvent1.Pointer();
-	ptrEvent.iType = aType;
-	ptrEvent.iModifiers = EModifierAdvancedPointerEvent; // done implicitly by TAdvancedPointerEvent::Init method
-	ptrEvent.iPosition.iX = aPoint3D.iX;
-	ptrEvent.iPosition.iY = aPoint3D.iY;
-	aEvent1.SetPointerNumber(aPointerNumber);
-	aEvent1.SetPointerZ(aPoint3D.iZ);
-	
-	// init 2nd event
-	aEvent2.InitAdvancedPointerEvent(aType,0,aPoint3D,aPointerNumber);
-	}
-
-void CTAdvancedPointerEvent::TestAdvancedPointerInit()
-	{
-	// Test size of class with hard coded values to prevent regression failure 
-	TEST(sizeof(TAdvancedPointerEvent) == 32);
-
-	TWsEvent event1;
-	TWsEvent event2;
-	
-	// low value coords, lowest value event type
-		{
-		TPoint3D point3D(1,2,3);	
-		AdvancedPointerInit(event1, event2, TPointerEvent::EButton1Down, point3D, 1);
-		}
-	TEST(0==Mem::Compare(reinterpret_cast<TUint8*>(&event1),sizeof(TWsEvent),reinterpret_cast<TUint8*>(&event2),sizeof(TWsEvent)));
-	
-	// high value coords, highest value event type and pointer number
-		{
-		TPoint3D point3D(KMaxTInt, KMaxTInt-1, KMaxTInt-3);
-		AdvancedPointerInit(event1, event2, TPointerEvent::EOutOfRange, point3D, KMaxTUint8);
-		}
-	TEST(0==Mem::Compare(reinterpret_cast<TUint8*>(&event1),sizeof(TWsEvent),reinterpret_cast<TUint8*>(&event2),sizeof(TWsEvent)));
-	
-	// high negative value coords, highest value event type and pointer number
-		{
-		TPoint3D point3D(KMinTInt, KMinTInt+1, KMinTInt+3);
-		AdvancedPointerInit(event1, event2, TPointerEvent::EOutOfRange, point3D, KMaxTUint8);
-		}
-	TEST(0==Mem::Compare(reinterpret_cast<TUint8*>(&event1),sizeof(TWsEvent),reinterpret_cast<TUint8*>(&event2),sizeof(TWsEvent)));		
-	}
-
-void CTAdvancedPointerEvent::TestAdvancedPointerGetPointerId()
-	{
-	TWsEvent event;
-	TAdvancedPointerEvent& ptrEvent = *event.Pointer();
-	const TPoint3D point3D(1,2,3);
-	const TUint8 MaxLikelyCommonPointerNumber = 10;
-	
-	// Likely Common Values
-	TUint8 pointerNumber = 0;
-	for(;pointerNumber<=MaxLikelyCommonPointerNumber;pointerNumber++)
-		{
-		event.InitAdvancedPointerEvent(TPointerEvent::EMove,0,point3D,pointerNumber);
-		TEST(ptrEvent.PointerNumber()==pointerNumber);
-		}
-
-	// mid-range value
-	pointerNumber = 127;	
-	event.InitAdvancedPointerEvent(TPointerEvent::EMove,0,point3D,pointerNumber);
-	TEST(ptrEvent.PointerNumber()==pointerNumber);	
-	
-	// highest value
-	pointerNumber = 255; // KMaxTUint8 is there was one defined.
-	event.InitAdvancedPointerEvent(TPointerEvent::EMove,0,point3D,pointerNumber);
-	TEST(ptrEvent.PointerNumber()==pointerNumber);	
-	}
-
-/** helper method for TestAdvancedPointerGetPressureAndProximity() */
-void CTAdvancedPointerEvent::TestAdvancedPointerGetPressureAndProximity(const TPoint3D aPoint3D)
-	{
-	TWsEvent event;
-	event.InitAdvancedPointerEvent(TPointerEvent::EMove, 0, aPoint3D, 0);
-	TAdvancedPointerEvent ptrEvent = *event.Pointer();
-	const TPoint3D positionAndPressure3D = ptrEvent.PositionAndPressure3D();
-	TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&aPoint3D),sizeof(TPoint3D),reinterpret_cast<TUint8 const*>(&positionAndPressure3D),sizeof(TPoint3D)));
-	TInt proximityAndPressure = ptrEvent.ProximityAndPressure();
-	TEST(aPoint3D.iZ==proximityAndPressure);	
-	}
-
-void CTAdvancedPointerEvent::TestAdvancedPointerGetPressureAndProximity()
-	{
-		{
-		// middle value
-		TPoint3D point3D(0,0,0);
-		TestAdvancedPointerGetPressureAndProximity(point3D);
-		}
-		{
-		// Typical value
-		TPoint3D point3D(10,9,8);
-		TestAdvancedPointerGetPressureAndProximity(point3D);
-		}
-		{
-		// Typical value
-		TPoint3D point3D(10,9,-8);
-		TestAdvancedPointerGetPressureAndProximity(point3D);
-		}
-		{
-		// max values
-		TPoint3D point3D(KMaxTInt-2,KMaxTInt-1,KMaxTInt);
-		TestAdvancedPointerGetPressureAndProximity(point3D);
-		}
-		{
-		// min values
-		TPoint3D point3D(KMinTInt+2,KMinTInt+1,KMinTInt);
-		TestAdvancedPointerGetPressureAndProximity(point3D);
-		}
-	}
-
-void CTAdvancedPointerEvent::TestAdvancedPointerGetPressure()
-	{
-		{
-		// middle value
-		const TPoint3D point3D(0,0,0);
-		TWsEvent event;
-		event.InitAdvancedPointerEvent(TPointerEvent::EMove, 0, point3D, 0);
-		TAdvancedPointerEvent ptrEvent = *event.Pointer();
-		const TPoint3D pressure3D = ptrEvent.Pressure3D();
-		TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&point3D),sizeof(TPoint3D),reinterpret_cast<TUint8 const*>(&pressure3D),sizeof(TPoint3D)));
-		TInt pressure = ptrEvent.Pressure();
-		TEST(point3D.iZ==pressure);
-		}
-		{
-		// Typical value
-		const TPoint3D point3D(10,9,8);
-		TWsEvent event;
-		event.InitAdvancedPointerEvent(TPointerEvent::EMove, 0, point3D, 0);
-		TAdvancedPointerEvent ptrEvent = *event.Pointer();
-		const TPoint3D pressure3D = ptrEvent.Pressure3D();
-		TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&point3D),sizeof(TPoint3D),reinterpret_cast<TUint8 const*>(&pressure3D),sizeof(TPoint3D)));
-		TInt pressure = ptrEvent.Pressure();
-		TEST(point3D.iZ==pressure);
-		}		
-		{
-		// max value
-		const TPoint3D point3D(KMaxTInt-2,KMaxTInt-1,KMaxTInt);
-		TWsEvent event;
-		event.InitAdvancedPointerEvent(TPointerEvent::EMove, 0, point3D, 0);
-		TAdvancedPointerEvent ptrEvent = *event.Pointer();
-		const TPoint3D pressure3D = ptrEvent.Pressure3D();
-		TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&point3D),sizeof(TPoint3D),reinterpret_cast<TUint8 const*>(&pressure3D),sizeof(TPoint3D)));
-		TInt pressure = ptrEvent.Pressure();
-		TEST(point3D.iZ==pressure);
-		}
-		{
-		// min value
-		TPoint3D point3D(KMinTInt+2,KMinTInt+1,KMinTInt);
-		TWsEvent event;
-		event.InitAdvancedPointerEvent(TPointerEvent::EMove, 0, point3D, 0);
-		TAdvancedPointerEvent ptrEvent = *event.Pointer();
-		const TPoint3D pressure3D = ptrEvent.Pressure3D();
-		point3D.iZ=0; // pressure can't be negative
-		TEST(0==Mem::Compare(reinterpret_cast<TUint8*>(&point3D),sizeof(TPoint3D),reinterpret_cast<TUint8 const*>(&pressure3D),sizeof(TPoint3D)));
-		TInt pressure = ptrEvent.Pressure();
-		TEST(0==pressure);
-		}
-	}
-
-void CTAdvancedPointerEvent::TestAdvancedPointerGetPosition()
-	{
-		{
-		// middle value
-		const TPoint3D point3D(0,0,0);
-		TWsEvent event;
-		event.InitAdvancedPointerEvent(TPointerEvent::EMove, 0, point3D, 0);
-		TAdvancedPointerEvent ptrEvent = *event.Pointer();
-		const TPoint3D position3D = ptrEvent.Position3D();
-		TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&point3D),sizeof(TPoint3D),reinterpret_cast<TUint8 const*>(&position3D),sizeof(TPoint3D)));
-		TInt proximity = ptrEvent.Proximity();
-		TEST(point3D.iZ==proximity);
-		}
-		{
-		// typical value
-		const TPoint3D point3D(10,9,-8);
-		TWsEvent event;
-		event.InitAdvancedPointerEvent(TPointerEvent::EMove, 0, point3D, 0);
-		TAdvancedPointerEvent ptrEvent = *event.Pointer();
-		const TPoint3D position3D = ptrEvent.Position3D();
-		TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&point3D),sizeof(TPoint3D),reinterpret_cast<TUint8 const*>(&position3D),sizeof(TPoint3D)));
-		TInt proximity = ptrEvent.Proximity();
-		TEST(point3D.iZ==proximity);
-		}
-		{
-		// highest value
-		TPoint3D point3D(KMaxTInt-2,KMaxTInt-1,KMaxTInt);
-		TWsEvent event;
-		event.InitAdvancedPointerEvent(TPointerEvent::EMove, 0, point3D, 0);
-		TAdvancedPointerEvent ptrEvent = *event.Pointer();
-		const TPoint3D position3D = ptrEvent.Position3D();
-		point3D.iZ=0; // proximity can't be positive
-		TEST(0==Mem::Compare(reinterpret_cast<TUint8*>(&point3D),sizeof(TPoint3D),reinterpret_cast<TUint8 const*>(&position3D),sizeof(TPoint3D)));
-		TInt proximity = ptrEvent.Proximity();
-		TEST(0==proximity);
-		}
-		{
-		// lowest value
-		const TPoint3D point3D(KMinTInt+2,KMinTInt+1,KMinTInt);
-		TWsEvent event;
-		event.InitAdvancedPointerEvent(TPointerEvent::EMove, 0, point3D, 0);
-		TAdvancedPointerEvent ptrEvent = *event.Pointer();
-		const TPoint3D position3D = ptrEvent.Position3D();
-		TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&point3D),sizeof(TPoint3D),reinterpret_cast<TUint8 const*>(&position3D),sizeof(TPoint3D)));
-		TInt proximity = ptrEvent.Proximity();
-		TEST(point3D.iZ==proximity);
-		}
-	}
-
-void CTAdvancedPointerEvent::TestPointerEventCopying()
-	{
-	TWsEvent event;
-	event.InitAdvancedPointerEvent(TPointerEvent::EMove, 0, TPoint3D(2,3,4),1);
-	TPointerEvent testPointerEvent;
-	testPointerEvent.iModifiers =0;
-	testPointerEvent.iParentPosition=TPoint(0,0);
-	testPointerEvent.iPosition = TPoint(2,3);
-	testPointerEvent.iType=TPointerEvent::EMove;
-
-	// TPointerEvent to TPointerEvent
-	// Copy Constructor
-		{
-		TPointerEvent* pointerEventPtr = event.Pointer(); 
-		TPointerEvent pointerEvent = *pointerEventPtr;
-		TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&pointerEvent),sizeof(TPointerEvent),reinterpret_cast<TUint8 const*>(&testPointerEvent),sizeof(TPointerEvent)));
-		}
-	// Assignment operator
-		{
-		TPointerEvent* pointerEventPtr = event.Pointer(); 
-		TPointerEvent pointerEvent;
-		pointerEvent = *pointerEventPtr;
-		TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&pointerEvent),sizeof(TPointerEvent),reinterpret_cast<TUint8 const*>(&testPointerEvent),sizeof(TPointerEvent)));
-		}		
-	// TAdvancedPointerEvent to TPointerEvent
-	// Copy Constructor
-		{
-		TAdvancedPointerEvent* advancedPointerEventPtr = event.Pointer();		
-		TPointerEvent pointerEvent = *advancedPointerEventPtr;
-		TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&pointerEvent),sizeof(TPointerEvent),reinterpret_cast<TUint8 const*>(&testPointerEvent),sizeof(TPointerEvent)));
-		}
-	// Assignment operator
-		{
-		TAdvancedPointerEvent* advancedPointerEventPtr = event.Pointer(); 
-		TPointerEvent pointerEvent;
-		pointerEvent = *advancedPointerEventPtr;
-		TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&pointerEvent),sizeof(TPointerEvent),reinterpret_cast<TUint8 const*>(&testPointerEvent),sizeof(TPointerEvent)));
-		}
-
-	// TPointerEvent to TPointerEvent
-	// Copy Method
-		{
-		TPointerEvent* pointerEventPtr = event.Pointer(); 
-		TPointerEvent pointerEvent;
-		pointerEvent.Copy(*pointerEventPtr);
-		TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&pointerEvent),sizeof(TPointerEvent),reinterpret_cast<TUint8 const*>(&testPointerEvent),sizeof(TPointerEvent)));
-		}
-		
-	// TAdvancedPointerEvent to TPointerEvent
-	// Copy Constructor
-		{
-		TAdvancedPointerEvent* advancedPointerEventPtr = event.Pointer();		
-		TPointerEvent pointerEvent;
-		pointerEvent.Copy(*advancedPointerEventPtr);
-		TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&pointerEvent),sizeof(TPointerEvent),reinterpret_cast<TUint8 const*>(&testPointerEvent),sizeof(TPointerEvent)));
-		}
-		
-	// Assignment operator
-		{
-		TAdvancedPointerEvent* advancedPointerEventPtr = event.Pointer(); 
-		TAdvancedPointerEvent advancedPointerEventPtr2;
-		advancedPointerEventPtr2 = *advancedPointerEventPtr;
-		TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&advancedPointerEventPtr2),sizeof(TAdvancedPointerEvent),reinterpret_cast<TUint8 const*>(event.Pointer()),sizeof(TAdvancedPointerEvent)));
-		}			
-	}
-
-void CTAdvancedPointerEvent::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(KTest1,"PointerEventInit");
-	_LIT(KTest2,"AdvancedPointerEventInit");
-	_LIT(KTest3,"PointerEventCopying");
-	_LIT(KTest4,"AdvancedPointerEventGetPointerId");
-	_LIT(KTest5,"AdvancedPointerEventGetPressureAndProximity");
-	_LIT(KTest6,"AdvancedPointerEventGetPressure");
-	_LIT(KTest7,"AdvancedPointerEventGetPosition");
-	
-	((CTAdvancedPointerEventStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(++iTest->iState)
-		{
-	case 1:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0542
-*/
-		((CTAdvancedPointerEventStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0542"));
-		iTest->LogSubTest(KTest1);
-		TestPointerEventInit();
-		break;	
-	case 2:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0543
-*/
-		((CTAdvancedPointerEventStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0543"));
-		iTest->LogSubTest(KTest2);
-		TestAdvancedPointerInit();
-		break;
-	case 3:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0544
-*/
-		((CTAdvancedPointerEventStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0544"));
-		iTest->LogSubTest(KTest3);			
-		TestPointerEventCopying();
-		break;
-	case 4:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0545
-*/
-		((CTAdvancedPointerEventStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0545"));
-		iTest->LogSubTest(KTest4);
-		TestAdvancedPointerGetPointerId();
-		break;		
-	case 5:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0546
-*/
-		((CTAdvancedPointerEventStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0546"));
-		iTest->LogSubTest(KTest5);
-		TestAdvancedPointerGetPressureAndProximity();
-		break;
-	case 6:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0547
-*/
-		((CTAdvancedPointerEventStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0547"));
-		iTest->LogSubTest(KTest6);
-		TestAdvancedPointerGetPressure();
-		break;
-	case 7:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0548
-*/
-		((CTAdvancedPointerEventStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0548"));
-		iTest->LogSubTest(KTest7);			
-		TestAdvancedPointerGetPosition();
-		break;
-	default:
-		((CTAdvancedPointerEventStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-		((CTAdvancedPointerEventStep*)iStep)->CloseTMSGraphicsStep();
-		TestComplete();
-		break;
-		}
-	((CTAdvancedPointerEventStep*)iStep)->RecordTestResultL();
-	}
-
-__WS_CONSTRUCT_STEP__(AdvancedPointerEvent)
--- a/windowing/windowserver/tauto/tadvancedpointerevent.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// tadvancedpionter.h
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef tadvancedpointerevent_h
-#define tadvancedpointerevent_h
-
-#include "w32std.h"
-#include "AUTO.H"
-#include "../tlib/testbase.h"
-#include "TGraphicsHarness.h"
-
-class CTAdvancedPointerEvent : public CTWsGraphicsBase
-	{
-public:
-	CTAdvancedPointerEvent(CTestStep* aStep);
-	virtual ~CTAdvancedPointerEvent();
-protected:
-	//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	void TestPointerEventInit();
-	void TestAdvancedPointerInit();
-	void TestAdvancedPointerGetPointerId();	
-	void TestAdvancedPointerGetPressureAndProximity();
-	void TestAdvancedPointerGetPressureAndProximity(const TPoint3D aPoint3D);
-	void TestAdvancedPointerGetPressure();
-	void TestAdvancedPointerGetPosition();	
-	void TestPointerEventCopying();
-	};
-
-class CTAdvancedPointerEventStep : public CTGraphicsStep
-	{
-public:
-	CTAdvancedPointerEventStep();
-protected:	
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTAdvancedPointerEventStep,"TAdvancedPointerEvent");
-
-#endif // tadvancedpointerevent_h
--- a/windowing/windowserver/tauto/talphawin.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1272 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test alpha channel transparent windows
-// Test that draw operations with non-opaque colours do alpha blending in EColor64K and EColor16MA display modes
-// Test that alpha channel transparent windows are drawn correctly when windows move, redraw, change visibility, etc.
-// In the draw operation tests, the left window draws opaque pink on white background, the right window blends semi-transparent red on white background,
-// and the results are compared.
-// In the transparent window tests, the right window contains several transparent windows, which are moved, redrawn, visibility changed, etc,
-// the left window contains a single window in which we draw what we expect the right window to look like. The results are compared.
-// In each case, the left and right windows should be identical
-// 
-//
-
-
-#include "TALPHAWIN.H"
-
-enum
-	{
-	EOpDrawRect,
-	EOpDrawLine,
-	EOpDrawEllipse,
-	EOpDrawText,
-	EOpDrawTextVertical,
-	EOpDrawTextAntiAliased,
-	EOpBitBlt,
-	EOpBitBltMasked,
-	ENumDrawOps
-	};
-
-
-enum
-	{
-	ERed = 0x1,
-	EGreen = 0x2,
-	EBlue = 0x4,
-
-	EAlphaTransparency = 0x8,
-	ETransparencyFactor = 0x10,
-	// defaults to non-transparent
-
-	EOpaque = 0x20,
-	ETransparent = 0x40,
-	// defaults to semi-transparent
-
-	EModeColor64K = 0x80,
-	EModeColor16MA = 0x100,
-	// defaults to 64k
-
-	EInvisible = 0x200,
-
-	EActive = 0xf000000
-	};
-
-
-TRgb ColourFromDrawState(TInt aDrawState)
-	{
-	TInt red = (aDrawState & ERed) ? 255 : 0;
-	TInt green = (aDrawState & EGreen) ? 255 : 0;
-	TInt blue = (aDrawState & EBlue) ? 255 : 0;
-	TInt alpha = 128;
-	if (aDrawState & EOpaque)
-		alpha = 255;
-	if (aDrawState & ETransparent)
-		alpha = 0;
-	return TRgb(red, green, blue, alpha);
-	}
-
-
-
-//
-// CTAlphaWinTest
-//
-
-CTAlphaWin::CTAlphaWin(CTestStep* aStep):
-	CTWsGraphicsBase(aStep)
-	{
-	}
-
-CTAlphaWin::~CTAlphaWin()
-	{
-	iTestWin.DeleteAll();
-	delete iRefWin;
-	}
-
-void CTAlphaWin::ConstructL()
-	{
-	if(TransparencySupportedL() == KErrNotSupported)
-			return;
-
-	TSize winSize = BaseWin->Size();
-
-	iTestWin[0] = CTAlphaWindow::NewL(this, TestWin, TPoint(0,0), winSize, ERed | EGreen | EBlue | EOpaque);
-	iTestWin[1] = CTAlphaWindow::NewL(this, TestWin, TPoint(0,0), TSize(winSize.iWidth/2, winSize.iHeight/2), ERed | EAlphaTransparency);
-	iTestWin[2] = CTAlphaWindow::NewL(this, TestWin, TPoint(winSize.iWidth/3,0), TSize(winSize.iWidth/2, winSize.iHeight/2), EGreen | EAlphaTransparency);
-	iTestWin[3] = CTAlphaWindow::NewL(this, TestWin, TPoint(winSize.iWidth/6, winSize.iHeight/3), TSize(winSize.iWidth/2, winSize.iHeight/2), EBlue | EAlphaTransparency);
-	iTestWin[4] = CTAlphaWindow::NewL(this, TestWin, TPoint(winSize.iWidth/4,winSize.iHeight/6), TSize(winSize.iWidth/3,winSize.iHeight/3), ERed | EGreen | EBlue | EAlphaTransparency | ETransparent);
-
-	iRefWin = CTAlphaRefWin::NewL(BaseWin, TPoint(0,0), winSize, iTestWin);
-	//Clearing the windows
-	BaseWin->ClearWin();
-	TestWin->ClearWin();
-	}
-
-void CTAlphaWin::ConfigureDisplayModes(TDisplayMode aRequiredMode = EColor16M)
-	{
-	TInt i;
-	for (i=0; i<5; i++)
-		{
-		iTestWin[i]->BaseWin()->SetRequiredDisplayMode(aRequiredMode);
-		}
-	iRefWin->BaseWin()->SetRequiredDisplayMode(aRequiredMode);
-	}
-
-
-void CTAlphaWin::TestSemiTransparentDrawingL()
-	{
-	TSize winSize = BaseWin->Size();
-
-	// In this window, we draw opaque pink
-	CTDrawOpWin* drawWin = CTDrawOpWin::NewL(this, BaseWin, TPoint(0,0), winSize, TRgb(255,127,127,255));
-
-	// In this window, we blend semi-transparent red
-	CTDrawOpWin* blendWin = CTDrawOpWin::NewL(this, TestWin, TPoint(0,0), winSize, TRgb(255,0,0,128));
-
-	const TInt tolerance = 9;//8 - wouldn't be enough!! The defect 	DEF112334 was raised
-	for (TInt i=EOpDrawRect; i<ENumDrawOps; i++)
-		{
-		
-	//	User::After(1000000);// helpful when debugging
-		drawWin->SetDrawOp(i);
-		blendWin->SetDrawOp(i);
-		drawWin->DrawNow();
-		blendWin->DrawNow();
-		TheClient->Flush();
-		TheClient->WaitForRedrawsToFinish();
-
-		if((i == EOpDrawTextAntiAliased) && (TheClient->iScreen->DisplayMode() == EColor16MA) || (TheClient->iScreen->DisplayMode() == EColor16MAP))
-			{		
-			TSize winSize=BaseWin->Size();
-			TRect rect1(BaseWin->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),winSize);
-			TRect rect2(TestWin->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),winSize);
-
-			CheckRectL(rect1, rect2, winSize, TheClient->iScreen->DisplayMode(), tolerance, _L("CTAlphaWin::TestSemiTransparentDrawingL()"));
-			}
-		else
-			{
-			CheckRect(BaseWin,TestWin,_L("CTAlphaWin::TestSemiTransparentDrawingL()"));
-			}	
-		}
-	delete drawWin;
-	delete blendWin;
-	}
-
-void CTAlphaWin::TestTransparentDrawingL()
-	{
-	TSize winSize = BaseWin->Size();
-
-	// In this window, we draw opaque white
-	CTDrawOpWin* drawWin = CTDrawOpWin::NewL(this, BaseWin, TPoint(0,0), winSize, TRgb(255,255,255,255));
-
-	// In this window, we blend transparent red
-	CTDrawOpWin* blendWin = CTDrawOpWin::NewL(this, TestWin, TPoint(0,0), winSize, TRgb(255,0,0,0));
-
-	for (TInt i=EOpDrawRect; i<ENumDrawOps; i++)
-		{
-		//User::After(1000000);// helpful when debugging
-		drawWin->SetDrawOp(i);
-		blendWin->SetDrawOp(i);
-		drawWin->DrawNow();
-		blendWin->DrawNow();
-		TheClient->Flush();
-		TheClient->WaitForRedrawsToFinish();
-		CheckRect(BaseWin,TestWin,_L("CTAlphaWin::TestTransparentDrawingL()"));
-		}
-	delete drawWin;
-	delete blendWin;
-	}
-
-void CTAlphaWin::CheckRectL(const TRect& aRect1, const TRect& aRect2, TSize aSize, TDisplayMode aRequiredMode, TInt aTolerance, const TDesC& aErrorMsg)
-	{
-	CFbsBitmap *bmp1 = new (ELeave) CFbsBitmap;
-	CleanupStack::PushL(bmp1);
-	User::LeaveIfError(bmp1->Create(aSize, aRequiredMode));
-
-	CFbsBitmap *bmp2 = new (ELeave) CFbsBitmap;
-	CleanupStack::PushL(bmp2);
-	User::LeaveIfError(bmp2->Create(aSize, aRequiredMode));
-	
-	User::LeaveIfError(TheClient->iScreen->CopyScreenToBitmap(bmp1, aRect1));	
-	User::LeaveIfError(TheClient->iScreen->CopyScreenToBitmap(bmp2, aRect2));	
-
-	TRgb *rgbBuf1=(TRgb *)User::AllocL(aSize.iWidth*sizeof(TRgb));	
-	TRgb *rgbBuf2=(TRgb *)User::Alloc(aSize.iWidth*sizeof(TRgb));	
-	if(!rgbBuf2)
-		{
-		User::Free(rgbBuf1);
-		User::Leave(KErrNoMemory);
-		}
-	TBool equal = ETrue;
-	TInt maxDeviation = 0;
-	for(TInt yy = 0; yy < aSize.iHeight && equal; yy++)
-		{
-		TPtr8 ptr1((TUint8 *)rgbBuf1,aSize.iWidth*sizeof(TRgb));
-		bmp1->GetScanLine(ptr1, TPoint(0, yy), aSize.iWidth, ERgb);
-		TPtr8 ptr2((TUint8 *)rgbBuf2,aSize.iWidth*sizeof(TRgb));
-		bmp2->GetScanLine(ptr2, TPoint(0, yy), aSize.iWidth, ERgb);
-		
-		TRgb *rgbBufCur1 = rgbBuf1;
-		TRgb *rgbBufCur2 = rgbBuf2;
-		for(TInt ii = 0; ii < aSize.iWidth; ii++)
-			{
-			TInt delta = Abs(rgbBufCur1->Red()-rgbBufCur2->Red());
-			TInt delta1 = Abs(rgbBufCur1->Green()-rgbBufCur2->Green());
-			TInt delta2 = Abs(rgbBufCur1->Blue()-rgbBufCur2->Blue());
-			
-			if((delta > aTolerance) || (delta1 > aTolerance) || (delta2 > aTolerance))
-				{
-				equal = EFalse;
-				}
-			TInt maxItermedia = Max(delta1, delta2);
-			maxItermedia = Max(maxItermedia, delta);
-			maxDeviation = Max(maxItermedia, maxDeviation);
-
-			rgbBufCur1++;	
-			rgbBufCur2++;	
-			}
-		}
-	
-	User::Free(rgbBuf1);
-	User::Free(rgbBuf2);
-
-	CleanupStack::PopAndDestroy(2,bmp1);
-
-	if (!equal)
-		{
-		INFO_PRINTF3(_L("%S CheckRectA failed, max deviation %d"), &aErrorMsg, maxDeviation);
-		}
-	else if(maxDeviation)
-		{
-		INFO_PRINTF4(_L("%S CheckRectA passed with tolerance %d, max deviation %d"), &aErrorMsg, aTolerance, maxDeviation);
-		}
-		
-	iStep->TEST(equal);
-	}
-
-void CTAlphaWin::TestCondition()
-	{
-	// User::After(1000000);// helpful when debugging
-	iRefWin->DrawNow();
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-	CheckRect(BaseWin,TestWin,_L("CTAlphaWin::TestCondition()"));
-	}
-
-void CTAlphaWin::TestConditionL()
-	{
-	iRefWin->DrawNow();
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-
-	const TInt tolerance = 9;
-	TSize winSize=BaseWin->Size();
-	TRect rect1(BaseWin->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),winSize);
-	TRect rect2(TestWin->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),winSize);
-	CheckRectL(rect1, rect2, winSize, TheClient->iScreen->DisplayMode(), tolerance, _L("CTAlphaWin::TestCondition()"));
-	}
-
-void CTAlphaWin::TestInitialConfiguration()
-	{
-	if(TheClient->iScreen->DisplayMode() == EColor64K)
-		{
-		TestConditionL();
-		}
-	else
-		{
-		TestCondition();
-		}
-	}
-
-void CTAlphaWin::TestMove()
-	{
-	// Test moving windows, both in front and behind
-	for (TInt i = 0; i<5; i++)
-		{
-		TPoint pos = iTestWin[i]->Position();
-		pos += TPoint(10,10);
-		iTestWin[i]->SetPos(pos);
-		TestCondition();
-		}
-	for (TInt j = 0; j<5; j++)
-		{
-		TPoint pos = iTestWin[j]->Position();
-		pos -= TPoint(10,10);
-		iTestWin[j]->SetPos(pos);
-		TestCondition();
-		}
-	}
-
-
-void CTAlphaWin::TestRedraw()
-	{
-	// Test redrawing windows, both in front and behind
-	for (TInt i=0; i<5; i++)
-		{
-		iTestWin[i]->DrawNow();
-		TestCondition();
-		}
-	}
-
-
-void CTAlphaWin::TestInvisible()
-	{
-	// Test making windows visible and invisible, both in front and behind
-	for (TInt i=0; i<5; i++)
-		{
-		iTestWin[i]->SetVisible(EFalse);
-		TestCondition();
-		iTestWin[i]->SetVisible(ETrue);
-		TestCondition();
-		}
-	}
-
-void CTAlphaWin::TestChildrenL()
-	{
-	struct CTAlphaWinChildren: public TCleanupItem
-		{
-			static void Destroy(TAny* trg)
-				{
-				static_cast<CTAlphaWindow*>(trg)->DestroyChildren();				
-				}
-			CTAlphaWinChildren(CTAlphaWindow*trg):	TCleanupItem(Destroy,trg)	
-				{}
-			
-		};
-	CleanupStack::PushL(CTAlphaWinChildren(iTestWin[2]));
-	iTestWin[2]->CreateChildrenL(3);
-	TestCondition();
-	TestMove();
-	CleanupStack::PopAndDestroy(iTestWin[2]);
-	}
-
-
-void CTAlphaWin::TestAntiAliasedTextTransparentL()
-	{
-
-	//Clear the screen
-	for (TInt i=0; i<5; i++)
-		{
-		iTestWin[i]->SetVisible(EFalse);
-		}
-	iRefWin->SetVisible(EFalse);
-	TheClient->iWs.Flush();
-
-	//Create a new test window on the left
-	//Create a transparent window:
-	TSize winSize = BaseWin->Size();
-
-	RWindow theWin(TestWin->Client()->iWs);
-	User::LeaveIfError(theWin.Construct(*(TestWin->WinTreeNode()),(TUint32)&theWin));
-
-	theWin.SetExtent(TPoint(0,0), winSize);
-	theWin.SetBackgroundColor(TRgb(127,0,255,127));
-	TInt mode=theWin.SetRequiredDisplayMode(EColor16MA);
-	theWin.SetVisible(ETrue);
-	theWin.SetTransparencyAlphaChannel();
-	theWin.Activate();
-	TheClient->iWs.Flush();
-	CleanupClosePushL(theWin);
-
-	//get windows screen device.
-	CWsScreenDevice *device;
-	device = new (ELeave)CWsScreenDevice(TestWin->Client()->iWs);//(TheClient->iWs);
-	User::LeaveIfError(device->Construct(iTest->ScreenNumber()));
-	CleanupStack::PushL(device);
-
-	TFontSpec fs1;
-	CFont *font1;
-	CFont *font2;
-	fs1.iTypeface.iName = KTestFontTypefaceName;
-	fs1.iHeight = 16;
-	fs1.iFontStyle.SetBitmapType(EDefaultGlyphBitmap);
-	int error = TheClient->iScreen->GetNearestFontToDesignHeightInPixels((CFont*&)font1,fs1);
-	if (error)
-		{
-		TheClient->iScreen->ReleaseFont(font1);
-		User::Panic(_L("font not created"),error);
-		}
-	fs1.iFontStyle.SetBitmapType(EAntiAliasedGlyphBitmap);
-	error = TheClient->iScreen->GetNearestFontToDesignHeightInPixels((CFont*&)font2,fs1);
-	if (error)
-		{
-		TheClient->iScreen->ReleaseFont(font1);
-		TheClient->iScreen->ReleaseFont(font2);
-		User::Panic(_L("font not created"),error);
-		}
-
-	CWindowGc *gc;
-	device->CreateContext(gc);
-	CleanupStack::PushL(gc);
-
-	theWin.Invalidate();
-	theWin.BeginRedraw();
-	gc->Activate(theWin);
-
-	gc->SetPenStyle( CGraphicsContext::ESolidPen );
-	gc->SetPenColor( TRgb( 0, 0, 0, 127 ) );
-
-	//draw text for anti-aliasing needs an open font (scalable).
-	int typefaces = TheClient->iScreen->NumTypefaces();
-
-	gc->UseFont(font1);
-	gc->SetBrushStyle( CGraphicsContext::ENullBrush );
-	gc->DrawText(_L("Test"),TPoint(10,20));
-	gc->DiscardFont();
-	gc->UseFont(font2);
-	gc->DrawText(_L("Test"),TPoint(10,60));
-	gc->DiscardFont();
-
-	//destruction and tidying up
-	gc->Deactivate();
-	theWin.EndRedraw();
-	TheClient->iWs.Flush();
-
-	TheClient->iScreen->ReleaseFont(font1);
-	TheClient->iScreen->ReleaseFont(font2);
-	CleanupStack::PopAndDestroy(gc);//gc
-	CleanupStack::PopAndDestroy(device);//device
-
-	//do not close the test window yet since there is a comparison
-	//required
-
-	//now do the same on an off screen bitmap.  Then create a window
-	//and put the bitmap onto it.
-	//create a colour bitmap
-	//
-	CFbsBitmap *bitmapOne;
-	bitmapOne = new (ELeave)CFbsBitmap();
-	CleanupStack::PushL(bitmapOne);
-	User::LeaveIfError(bitmapOne->Create(winSize,static_cast<TDisplayMode>(mode)));
-
-	CFbsBitmapDevice *deviceOne=CFbsBitmapDevice::NewL(bitmapOne);
-	CleanupStack::PushL(deviceOne);
-
-	CFont *font3;
-	CFont *font4;
-	fs1.iFontStyle.SetBitmapType(EDefaultGlyphBitmap);
-	error = TheClient->iScreen->GetNearestFontToDesignHeightInPixels((CFont*&)font3,fs1);
-	if (error)
-		{
-		TheClient->iScreen->ReleaseFont(font3);
-		User::Panic(_L("font not created"),error);
-		}
-	fs1.iFontStyle.SetBitmapType(EAntiAliasedGlyphBitmap);
-	error = TheClient->iScreen->GetNearestFontToDesignHeightInPixels((CFont*&)font4,fs1);
-	if (error)
-		{
-		TheClient->iScreen->ReleaseFont(font3);
-		TheClient->iScreen->ReleaseFont(font4);
-		User::Panic(_L("font not created"),error);
-		}
-	CFbsBitGc *bGcOne = CFbsBitGc::NewL();
-	CleanupStack::PushL(bGcOne);
-
-	bGcOne->Activate(deviceOne);
-
-	bGcOne->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	bGcOne->SetBrushColor(TRgb(127,0,255,127));
-	bGcOne->DrawRect(TRect(0,0,winSize.iWidth,winSize.iHeight));
-
-	bGcOne->SetPenStyle(CGraphicsContext::ESolidPen);
-	bGcOne->SetPenColor(TRgb(0,0,0,127));
-
-	bGcOne->UseFont(font3);
-	bGcOne->SetBrushStyle( CGraphicsContext::ENullBrush );
-	bGcOne->DrawText(_L("Test"),TPoint(10,20));
-	bGcOne->DiscardFont();
-	bGcOne->UseFont(font4);
-	bGcOne->DrawText(_L("Test"),TPoint(10,60));
-	bGcOne->DiscardFont();
-	//destruction and tidying up
-	//measure the text
-	CFont::TMeasureTextOutput textSize;
-	font4->MeasureText(_L("Test"),NULL,&textSize);
-
-	TheClient->iScreen->ReleaseFont(font3);
-	TheClient->iScreen->ReleaseFont(font4);
-
-	//display at the left
-	RWindow refWin(BaseWin->Client()->iWs);
-	CleanupClosePushL(refWin);
-	User::LeaveIfError(refWin.Construct(*(BaseWin->WinTreeNode()),(TUint32)&refWin));
-
-	refWin.SetExtent(TPoint(0,0), winSize);
-	refWin.SetRequiredDisplayMode(static_cast<TDisplayMode>(mode));
-	refWin.SetVisible(ETrue);
-	refWin.SetTransparencyAlphaChannel();
-	refWin.Activate();
-	TheClient->iWs.Flush();
-
-	//a gc for the ref win
-	CWsScreenDevice *refDevice;
-	refDevice = new (ELeave)CWsScreenDevice(BaseWin->Client()->iWs);
-	User::LeaveIfError(refDevice->Construct(iTest->ScreenNumber()));
-	CleanupStack::PushL(refDevice);
-	CWindowGc *gcRef;
-	refDevice->CreateContext(gcRef);
-	CleanupStack::PushL(gcRef);
-
-	refWin.Invalidate();
-	refWin.BeginRedraw();
-	gcRef->Activate(refWin);
-	gcRef->BitBlt(TPoint(0,0), bitmapOne);
-	gcRef->Deactivate();
-	refWin.EndRedraw();
-	TheClient->iWs.Flush();
-
-	TPoint refPos = refWin.AbsPosition();
-	TPoint winPos = theWin.AbsPosition();
-
-	//Compare the anti-aliased text areas
-	TInt textLength=textSize.iBounds.iBr.iX;
-	TInt textHeight=Abs(textSize.iBounds.iTl.iY);
-
-	TRect rect1(refPos.iX+10,refPos.iY+60-textHeight,
-			refPos.iX+10+textLength,refPos.iY+60);
-	TRect rect2(winPos.iX+10,winPos.iY+60-textHeight,
-			winPos.iX+10+textLength,winPos.iY+60);
-
-	TBool match = refDevice->RectCompare(rect1,rect2);
-	TEST(match);
-
-	CleanupStack::PopAndDestroy(gcRef);
-	CleanupStack::PopAndDestroy(refDevice);
-	CleanupStack::PopAndDestroy(&refWin);
-
-	CleanupStack::PopAndDestroy(bGcOne);
-	CleanupStack::PopAndDestroy(deviceOne);
-	CleanupStack::PopAndDestroy(bitmapOne);
-	CleanupStack::PopAndDestroy(&theWin);//theWin
-
-	}
-//
-// CTDrawOpWin
-//
-
-CTDrawOpWin* CTDrawOpWin::NewL(CTAlphaWin* aTest, CTWinBase* aParent, TPoint aPos, TSize aSize, TRgb aDrawColour)
-	{
-	CTDrawOpWin* theWin = new(ELeave) CTDrawOpWin(aTest,aDrawColour);
-
-	theWin->ConstructL(*aParent);
-	theWin->SetExtL(aPos, aSize);
-	theWin->AssignGC(*TheClient->iGc);
-	if (TheClient->iScreen->DisplayMode() == EColor16MA)
-		{
-		theWin->BaseWin()->SetRequiredDisplayMode(EColor16MA);
-		}
-	else
-		{
-		theWin->BaseWin()->SetRequiredDisplayMode(EColor64K);
-		}
-		
-	theWin->Activate();
-	theWin->DrawNow();
-
-	return theWin;
-	}
-
-CTDrawOpWin::CTDrawOpWin(CTAlphaWin* aTest, TRgb aDrawColour)
-: iTest(aTest), iDrawColour(aDrawColour)
-	{}
-
-
-void CTDrawOpWin::SetDrawOp(TInt aDrawOp)
-	{
-	iDrawOp = aDrawOp;
-	}
-
-
-void CTDrawOpWin::Draw()
-	{
-	_LIT(KText,"Text test");
-
-	iGc->SetPenColor(iDrawColour);
-	iGc->SetBrushColor(iDrawColour);
-	TSize size = Size();
-	TInt top = 5;
-	TInt left = 5;
-	TInt bottom = size.iHeight - 5;
-	TInt right = size.iWidth - 5;
-	TInt square = Min(bottom-top,right-left);
-
-	switch (iDrawOp)
-		{
-	case EOpDrawRect:
-		iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-		iGc->SetPenStyle(CGraphicsContext::ENullPen);
-		iGc->DrawRect(TRect(left,top,right,bottom));
-		break;
-	case EOpDrawLine:
-		//!! FAILS
-		//!! The endpoint of the line is drawn twice, with the result that it is darker when we do blending
-		//!! Not intending to fix at the moment
-		/*
-		iGc->SetPenStyle(CGraphicsContext::ESolidPen);
-		iGc->SetPenSize(TSize(4,4));
-		// The lines must not overlap, otherwise the blended lines will be darker at the overlap
-		iGc->DrawLine(TPoint(left+5,top), TPoint(left+square,top));
-		iGc->DrawLine(TPoint(left+5,top+5), TPoint(left+square,top+square));
-		iGc->DrawLine(TPoint(left,top+5), TPoint(left,top+square));
-		*/
-		break;
-	case EOpDrawEllipse:
-		iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-		iGc->SetPenStyle(CGraphicsContext::ENullPen);
-		iGc->DrawEllipse(TRect(left,top,right,bottom));
-		break;
-	case EOpDrawText:
-	case EOpDrawTextVertical:
-		{
-		iGc->SetBrushStyle(CGraphicsContext::ENullBrush);
-		iGc->SetPenStyle(CGraphicsContext::ESolidPen);
-		CFont* font;
-		TFontSpec fontSpec(KTestFontTypefaceName,200);
-		User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInTwips(font, fontSpec));
-		iGc->UseFont(font);
-		if (iDrawOp==EOpDrawText)
-			iGc->DrawText(KText(), TPoint(5,30));
-		else
-			iGc->DrawTextVertical(KText(), TPoint(5,30), EFalse);
-		iGc->DiscardFont();
-		TheClient->iScreen->ReleaseFont(font);
-		}
-		break;
-	case EOpDrawTextAntiAliased:
-		{
-		iGc->SetBrushStyle(CGraphicsContext::ENullBrush);
-		iGc->SetPenStyle(CGraphicsContext::ESolidPen);
-		CFont* font;
-		TFontSpec fontSpec(KTestFontTypefaceName,600);
-		fontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightBold);
-		fontSpec.iFontStyle.SetBitmapType(EAntiAliasedGlyphBitmap);
-
-		User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInTwips(font, fontSpec));
-		iGc->UseFont(font);
-		iGc->DrawText(KText(), TPoint(5,30));
-		iGc->DiscardFont();
-		TheClient->iScreen->ReleaseFont(font);
-		}
-		break;
-	case EOpBitBlt:
-		break;
-	case EOpBitBltMasked:
-		break;
-	default:
-		break;
-		};
-	}
-
-
-
-//
-// CTAlphaWindow
-//
-
-CTAlphaWindow::~CTAlphaWindow()
-	{
-	DestroyChildren();
-	}
-
-CTAlphaWindow* CTAlphaWindow::NewL(CTAlphaWin* aTest, CTWinBase* aParent, TPoint aPos, TSize aSize, TInt aDrawState)
-	{
-	CTAlphaWindow* theWin = new (ELeave) CTAlphaWindow(aTest);
-
-	theWin->ConstructL(*aParent);
-	theWin->SetExtL(aPos, aSize);
-	theWin->SetDrawState(aDrawState);
-
-	theWin->AssignGC(*TheClient->iGc);
-
-	theWin->Activate();
-	theWin->iDrawState |= EActive;
-	theWin->DrawNow();
-
-	return theWin;
-	}
-
-void CTAlphaWindow::SetDrawState(TInt aDrawState)
-	{
-	TBool active = iDrawState & EActive;
-	iDrawState = aDrawState & 0x7fffffff;
-
-	TRgb colour = ColourFromDrawState(iDrawState);
-	((RWindow*) DrawableWin())->SetBackgroundColor(colour);
-
-	if (iDrawState & EModeColor16MA)
-		BaseWin()->SetRequiredDisplayMode(EColor16MA);
-	else
-		BaseWin()->SetRequiredDisplayMode(EColor64K);
-
-	BaseWin()->SetVisible(! (iDrawState & EInvisible));
-
-	if (!active)
-		{
-		if (iDrawState & EAlphaTransparency)
-			((RWindow*) DrawableWin())->SetTransparencyAlphaChannel();
-		else if (iDrawState & ETransparencyFactor)
-			((RWindow*) DrawableWin())->SetTransparencyFactor(TRgb(128,128,128));
-		}
-
-	if (active)
-		iDrawState |= EActive;
-	}
-
-void CTAlphaWindow::SetVisible(TBool aVisible)
-	{
-	if (aVisible)
-		iDrawState &= ~EInvisible;
-	else
-		iDrawState |= EInvisible;
-	BaseWin()->SetVisible(aVisible);
-	}
-
-void CTAlphaWindow::CreateChildrenL(TInt aDepth)
-	{
-	DestroyChildren();
-	if (aDepth>0)
-		{
-		TSize size = Size();
-		iChild1 = CTAlphaWindow::NewL(iTest, this, TPoint(size.iWidth/3,0), TSize(2*size.iWidth/3, 2*size.iHeight/3), ERed | EGreen | EBlue | EOpaque);
-		iChild2 = CTAlphaWindow::NewL(iTest, this, TPoint(0,size.iHeight/3), TSize(2*size.iWidth/3, 2*size.iHeight/3), ERed | EGreen | EBlue | EAlphaTransparency);
-		iChild2->CreateChildrenL(aDepth-1);
-		}
-	}
-
-void CTAlphaWindow::DestroyChildren()
-	{
-	if (iChild1)
-		{
-		iChild1->DestroyChildren();
-		delete iChild1;
-		iChild1 = NULL;
-		}
-	if (iChild2)
-		{
-		iChild2->DestroyChildren();
-		delete iChild2;
-		iChild2 = NULL;
-		}
-	}
-
-TInt CTAlphaWindow::DrawState()
-	{
-	return iDrawState;
-	}
-
-void CTAlphaWindow::Draw()
-	{
-	// we draw a diagonal line from top left to bottom right
-	// we use the complementary colour to the window background colour
-	TInt red = (iDrawState & ERed) ? 0 : 255;
-	TInt green = (iDrawState & EGreen) ? 0 : 255;
-	TInt blue = (iDrawState & EBlue) ? 0 : 255;
-	TRgb color(red,green,blue);
-
-	TSize size = Size();
-	iGc->SetPenColor(color);
-	iGc->SetPenSize(TSize(4,4));
-	iGc->DrawLine(TPoint(0,0), TPoint(size.iWidth, size.iHeight));
-	}
-
-
-//
-// CTAlphaRefWin
-//
-
-CTAlphaRefWin::CTAlphaRefWin(TFixedArray<CTAlphaWindow*,5>& aAlphaWin)
-: iAlphaWin(aAlphaWin)
-	{}
-
-CTAlphaRefWin* CTAlphaRefWin::NewL(CTWinBase* aParent, TPoint aPos, TSize aSize, TFixedArray<CTAlphaWindow*,5>& aAlphaWin)
-	{
-	CTAlphaRefWin* theWin = new(ELeave) CTAlphaRefWin(aAlphaWin);
-
-	theWin->ConstructL(*aParent);
-	theWin->SetExtL(aPos, aSize);
-	theWin->AssignGC(*TheClient->iGc);
-	theWin->BaseWin()->SetRequiredDisplayMode(EColor64K);
-
-	theWin->Activate();
-	theWin->DrawNow();
-
-	return theWin;
-	}
-
-void CTAlphaRefWin::Draw()
-	{
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	iGc->SetBrushColor(KRgbWhite);
-	iGc->Clear();
-
-	// Note, the order of the windows in the array must correspond to their z-order
-	for (TInt i=0; i<5; i++)
-		DrawWindow(iAlphaWin[i], iAlphaWin[i]->Position());
-	}
-
-void CTAlphaRefWin::DrawWindow(CTAlphaWindow* aWindow, TPoint aPos)
-	{
-	TInt drawState = aWindow->DrawState();
-	if ( (drawState & EInvisible) || ! (drawState & EActive) )
-		return;
-
-	TRgb colour = ColourFromDrawState(drawState);
-	if (drawState & EOpaque)
-		colour.SetAlpha(255);
-	if (drawState & ETransparent)
-		colour.SetAlpha(0);
-	iGc->SetBrushColor(colour);
-
-	TPoint tl = aPos;
-	TPoint br = tl + aWindow->Size();
-	TRect rect(tl,br);
-	iGc->Clear(rect);
-
-	TInt red = (drawState & ERed) ? 0 : 255;
-	TInt green = (drawState & EGreen) ? 0 : 255;
-	TInt blue = (drawState & EBlue) ? 0 : 255;
-	colour = TRgb(red,green,blue);
-
-	iGc->SetClippingRect(rect);
-
-	TSize size = Size();
-	iGc->SetPenColor(colour);
-	iGc->SetPenSize(TSize(4,4));
-	iGc->DrawLine(tl, br);
-
-	iGc->CancelClippingRect();
-
-	if (aWindow->iChild1)
-		DrawWindow(aWindow->iChild1, aPos + aWindow->iChild1->Position() );
-	if (aWindow->iChild2)
-		DrawWindow(aWindow->iChild2, aPos + aWindow->iChild2->Position() );
-	}
-
-
-//
-// Main test loop
-//
-void CTAlphaWin::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	//User::After(TTimeIntervalMicroSeconds32(1000 * 1000));
-	((CTAlphaWinStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch (++iTest->iState)
-		{
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0278
-
-  @SYMDEF             DEF081259
-
-  @SYMPREQ 915
-
-  @SYMTestCaseDesc Semi-transparent drawing
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Use draw operations with semi-transparent pen or brush colours
-
-  @SYMTestExpectedResults Draw operations must do alpha blending
-
-*/
-	case 1:
-		{
-		((CTAlphaWinStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0278"));
-		if(TransparencySupportedL() == KErrNotSupported)
-			{
-			LOG_MESSAGE(_L("Test(1) complete - Transparency not supported\n"));
-			TestComplete();
-			break;
-			}
-		TDisplayMode mode = TheClient->iScreen->DisplayMode();
-		if (mode < EColor64K)
-			{
-			LOG_MESSAGE(_L("Test(1) complete - Display mode < EColor64K\n"));
-			TestComplete();
-			break;
-			}
-		_LIT(KSemiTrans64K,"(1) Semi transparent drawing Color64K");
-		iTest->LogSubTest(KSemiTrans64K);
-		TestSemiTransparentDrawingL();
-		break;
-		}
-		
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0287
-
-  @SYMDEF             DEF081259
-
-  @SYMPREQ 915
-
-  @SYMTestCaseDesc Invisible. All windows are in EColor16MA display mode.
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Transparent alpha channel windows are made invisible and visible both in front and behind one another
-
-  @SYMTestExpectedResults The windows are redrawn correctly, as compared to a reference drawing
-
-*/
-	case 2:
-		((CTAlphaWinStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0287"));
-		ConfigureDisplayModes(EColor16MA);
-		if(TransparencySupportedL()==KErrNone)
-			{
-			_LIT(KInvisible16MA,"(2) Invisible Color16MA");
-			iTest->LogSubTest(KInvisible16MA);
-			TestInvisible();
-			}
-		break;
-
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0280
-
-  @SYMDEF             DEF081259
-
-  @SYMPREQ 915
-
-  @SYMTestCaseDesc Initial Configuration. All windows are in EColor64K display mode.
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Several windows are set to be transparent alpha channel, and given semi-transparent or transparent background colours
-
-  @SYMTestExpectedResults The transparent window configuration matches a reference drawing created using only alpha blending
-
-*/
-	//Test 3 to 6 can't be run without transparency support
-	case 3:
-		((CTAlphaWinStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0280"));
-		ConfigureDisplayModes(EColor64K);
-		if(TransparencySupportedL()==KErrNone)
-			{
-			_LIT(KInitialConfiguration64K,"(3) Initial configuration Color64K");
-			iTest->LogSubTest(KInitialConfiguration64K);
-			TestInitialConfiguration();
-			}
-		break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0281
-
-  @SYMDEF             DEF081259
-
-  @SYMPREQ 915
-
-  @SYMTestCaseDesc Move. All windows are in EColor64K display mode.
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Transparent alpha channel windows are moved both in front and behind one another
-
-  @SYMTestExpectedResults The windows are redrawn correctly, as compared to a reference drawing
-
-*/
-	case 4:
-		((CTAlphaWinStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0281"));
-		if(TransparencySupportedL()==KErrNone)
-			{
-			_LIT(KMove64K,"(4) Move Color64K");
-			iTest->LogSubTest(KMove64K);
-			TestMove();
-			}
-		break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0282
-
-  @SYMDEF             DEF081259
-
-  @SYMPREQ 915
-
-  @SYMTestCaseDesc Redraw. All windows are in EColor64K display mode.
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Transparent alpha channel windows are redrawn both in front and behind one another
-
-  @SYMTestExpectedResults The windows are redrawn correctly, as compared to a reference drawing
-
-*/
-	case 5:
-		((CTAlphaWinStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0282"));
-		if(TransparencySupportedL()==KErrNone)
-			{
-			_LIT(KRedraw64K,"(5) Redraw Color64K");
-			iTest->LogSubTest(KRedraw64K);
-			TestRedraw();
-			}
-		break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0283-0001
-
-  @SYMDEF             DEF081259
-
-  @SYMPREQ 915
-
-  @SYMTestCaseDesc Invisible. All windows are in EColor64K display mode.
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Transparent alpha channel windows are made invisible and visible both in front and behind one another
-
-  @SYMTestExpectedResults The windows are redrawn correctly, as compared to a reference drawing
-
-*/
-	case 6:
-		((CTAlphaWinStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0283-0001"));
-		if(TransparencySupportedL()==KErrNone)
-			{
-			_LIT(KInvisible64K,"(6) Invisible Color64K");
-			iTest->LogSubTest(KInvisible64K);
-			TestInvisible();
-			}
-		break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0283-0002
-
-  @SYMDEF             DEF081259
-
-  @SYMPREQ 915
-
-  @SYMTestCaseDesc Children. All windows are in EColor64K display mode.
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Transparent alpha channel windows are given child windows, both transparent and non-transparent,
- 			    	and are then moved, redrawn, set visible or invisible both in front and behind one another
-
-  @SYMTestExpectedResults The windows are redrawn correctly, as compared to a reference drawing
-
-*/
-	case 7:
-		((CTAlphaWinStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0283-0002"));
-		_LIT(KChildren64K,"(7)Children Color64K");
-		iTest->LogSubTest(KChildren64K);
-		TestChildrenL();
-		break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0356
-
-  @SYMDEF             DEF081259
-
-  @SYMPREQ 915
-
-  @SYMTestCaseDesc Initial Configuration. All windows are in EColor64k Dispaly Mode
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Tests Anti-aliasing of text
-
-  @SYMTestExpectedResults Anti-alisaing should behave correctly
-
-*/
-	case 8:
-		((CTAlphaWinStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0356"));
-		_LIT(KAntiAliasedText64K,"(8) AntiAliasedText DEF082251 Color64K");
-		iTest->LogSubTest(KAntiAliasedText64K);
-		TestAntiAliasedTextTransparentL();
-		break;
-
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0284
-
-  @SYMDEF             DEF081259
-
-  @SYMPREQ 915
-
-  @SYMTestCaseDesc Initial Configuration. All windows are in EColor16MA display mode.
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Several windows are set to be transparent alpha channel, and given semi-transparent or transparent background colours
-
-  @SYMTestExpectedResults The transparent window configuration matches a reference drawing created using only alpha blending
-
-*/
-	case 9:
-		{ 
-		((CTAlphaWinStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0284"));
-		ConfigureDisplayModes(EColor16MA);
-		TDisplayMode mode1 = TheClient->iScreen->DisplayMode();
-	 	_LIT(KInitialConfiguration16MA,"(9)Initial configuration Color16MA");
-		iTest->LogSubTest(KInitialConfiguration16MA);
-		TestInitialConfiguration();
-		break;
-		}
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0285
-
-  @SYMDEF             DEF081259
-
-  @SYMPREQ 915
-
-  @SYMTestCaseDesc Move. All windows are in EColor16MA display mode.
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Transparent alpha channel windows are moved both in front and behind one another
-
-  @SYMTestExpectedResults The windows are redrawn correctly, as compared to a reference drawing
-
-*/
-	case 10:
-		((CTAlphaWinStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0285"));
-		_LIT(KMove16MA,"(10)Move Color16MA");
-		iTest->LogSubTest(KMove16MA);
-		TestMove();
-		break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0286
-
-  @SYMDEF             DEF081259
-
-  @SYMPREQ 915
-
-  @SYMTestCaseDesc Redraw. All windows are in EColor16MA display mode.
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Transparent alpha channel windows are redrawn both in front and behind one another
-
-  @SYMTestExpectedResults The windows are redrawn correctly, as compared to a reference drawing
-
-*/
-	case 11:
-		((CTAlphaWinStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0286"));
-		_LIT(KRedraw16MA,"(11)Redraw Color16MA");
-		iTest->LogSubTest(KRedraw16MA);
-		TestRedraw();
-		break;
-		
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0279
-
-  @SYMDEF             DEF081259
-
-  @SYMPREQ 915
-
-  @SYMTestCaseDesc Transparent drawing
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Use draw operations with transparent pen or brush colours
-
-  @SYMTestExpectedResults Draw operations with transparent pen or brush colours should leave the destination unchanged
-
-*/
-
-	case 12:
-		((CTAlphaWinStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0279"));
-		ConfigureDisplayModes(EColor64K);
-		_LIT(KTrans64K,"(12) Transparent drawing Color64K");
-		iTest->LogSubTest(KTrans64K);
-		TestTransparentDrawingL();
-		break;
-
-
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0288
-
-  @SYMDEF             DEF081259
-
-  @SYMPREQ 915
-
-  @SYMTestCaseDesc Children. All windows are in EColor16MA display mode.
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Transparent alpha channel windows are given child windows, both transparent and non-transparent,
- 			    	and are then moved, redrawn, set visible or invisible both in front and behind one another
-
-  @SYMTestExpectedResults The windows are redrawn correctly, as compared to a reference drawing
-
-*/
-	case 13:
-		((CTAlphaWinStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0288"));
-		_LIT(KChildren16MA,"(13) Children Color16MA");
-		iTest->LogSubTest(KChildren16MA);
-		TestChildrenL();
-		break;
-/**
-
-  @SYMTestCaseID GRAPHICS-WSERV-0357
-
-  @SYMDEF             DEF081259
-
-  @SYMPREQ 915
-
-  @SYMTestCaseDesc Initial Configuration. All windows are in EColor16MA Dispaly Mode
-
-  @SYMTestPriority High
-
-  @SYMTestStatus Implemented
-
-  @SYMTestActions Tests Anti-aliasing of text
-
-  @SYMTestExpectedResults Anti-alisaing should behave correctly
-
-*/
-	case 14:
-		((CTAlphaWinStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0357"));
-		_LIT(KAntiAliasedText16MA,"(14) AntiAliasedText DEF082251 Color16MA");
-		iTest->LogSubTest(KAntiAliasedText16MA);
-		TestAntiAliasedTextTransparentL();
-		break;
-	default:
-		((CTAlphaWinStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-		((CTAlphaWinStep*)iStep)->CloseTMSGraphicsStep();
-		TestComplete();
-		break;
-		}
-	((CTAlphaWinStep*)iStep)->RecordTestResultL();
-	}
-
-__WS_CONSTRUCT_STEP__(AlphaWin)
-
Binary file windowing/windowserver/tauto/tauto.mbm has changed
--- a/windowing/windowserver/tauto/tclosepanicwindowprocess.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// The process to close all the panic window.
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include <e32base.h>
-#include <e32cons.h>
-#include <e32test.h>
-#include <e32std.h>
-#include <e32debug.h>
-#include <w32debug.h>
-#include <w32std.h>
-
-// Simulate 50 escape-keys down to close all the panic window
-static TInt CloseAllPanicWindows(RWsSession& aWs) 
-	{
-	TInt idFocus = aWs.GetFocusWindowGroup();
-	TWsEvent event;
-	event.SetType(EEventKey); 
-	TKeyEvent* keyEvent = event.Key();
-	keyEvent->iCode = EKeyEscape;
-	keyEvent->iScanCode = EStdKeyEscape;
-	keyEvent->iModifiers = 0;
-	TInt theLimit = 50;
-	TInt err = KErrNone;
-	while(idFocus != NULL && (theLimit-- > 0))
-		{
-		err = aWs.SendEventToAllWindowGroups(event);
-		if (err != KErrNone && err != KErrNoMemory)
-			{
-			return err;
-			}
-		User::After(1000);	//give it time to process
-		idFocus = aWs.GetFocusWindowGroup();
-		}
-	return KErrNone;
-	}
-
-
-// Real main function
-void MainL()
-	{
-	// Open wserv session
-	RWsSession ws;
-	TInt err = ws.Connect();
-	if (err != KErrNone)
-		{
-		User::Leave(err);
-		}	
-
-	CleanupClosePushL(ws);
-	
-	User::LeaveIfError(CloseAllPanicWindows(ws));
-			
-	CleanupStack::PopAndDestroy(&ws);
-	}
-
-// Cleanup stack harness
-GLDEF_C TInt E32Main()
-	{
-	__UHEAP_MARK;
-	CTrapCleanup* cleanupStack = CTrapCleanup::New();
-	TRAPD(error, MainL());
-	_LIT(KTCloseAllPanicWindowPanic,"tcloseallpanicwindow");
-	// Panic the current process
-	__ASSERT_ALWAYS(!error, User::Panic(KTCloseAllPanicWindowPanic, error));
-	delete cleanupStack;
-	__UHEAP_MARKEND;
-	return KErrNone;
-	}
--- a/windowing/windowserver/tauto/tcrpanim.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1464 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Implements  CTCrpAnim
-// Test CRP animations & their interaction with overlapping transparent/non-transparent windows 
-// & wserv's underlying redraw-store strategies
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include <w32stdgraphic.h>
-#include "tcrpanim.h"
-
-// RUN_SAMPLE_ON_LEFT allows the demo animation to run in the left-hand window during testing. 
-// Used for demonstration purposes only
-#define RUN_SAMPLE_ON_LEFT
-
-namespace	//anonymous local scope
-	{
-	const TInt KAnimationFrameDelayTime = 50000; 				// delay in microseconds between frames
-	const TInt KShortDelayLoop = 2*KAnimationFrameDelayTime; 	// delay time in microseconds used in test cases
-	const TInt KAnimationTotalFrames = 40;						// total number of frames in a CWsGraphicBitmapAnimation
-	const TInt KAnimDimension = 40;								// animation width/height. We're enforcing a square animation here
-	const TInt KFrameMissedAnimationsThreshold = 10;			// maximum number of missed frame steps allowed
-	const TInt KAnimationTearWidthThreshold = 4; 				// maximum columns permitted between a tear
-	const TInt KMinGoodFrameThreshold = 30; 					// percentage threshold for number of good frames detected in a test
-	const TInt KMaxXY = 200;									// arbitrary maximum size of square used to invalidate a window
-	const TInt KMaxRepeatDraw = 2;								// arbitrary value for DrawLine calls during a Draw
-	TUid  KUidTestAnimation2 = {0xBAADF00D};					// unique id. for CWsGraphicBitmapAnimation object
-	const TUint32 KWhitePixels = 0xFFFFFFFF;					// 32-bit mask value for rgb white
-	const TUint32 KBlackPixels = 0x00000000;					// 32-bit value for rgb black
-	const TPoint KPointZero(0,0);								// initial point used for animation creation & manipulation (currently 0,0)
-	const TPoint KPointOffsite(1000,1000);						// point used to draw off-screen
-	const TDisplayMode KTestDisplayMode = EColor16MU;			// display mode used for testing
-	const TInt KFrameStepCalculation = Max(1, KAnimDimension/Max(1, KAnimationTotalFrames)); // determine framestep size in columns
-	
-	enum TColorDetected
-		{
-		ECantTell=0,
-		EDetRed=1,
-		EDetGreen=2,
-		EDetBlue=4,
-		EDetBlack=0x10,
-		EDetGrey=0x20,
-		EDetWhite=0x40
-		};
-
-	class CCrpAnim;		
-	class CAnimRedrawWindow : public CTWin
-		{
-	public:
-		CAnimRedrawWindow(CCrpAnim *aAnimWindow, TBool aIsBase);
-		~CAnimRedrawWindow();
-		void Draw();
-	private:
-		CCrpAnim *iAnimWindow;
-		TBool iIsBase;
-		};
-		
-	class CCrpAnim : public CBase
-		{
-		friend class CAnimRedrawWindow;
-	public:
-		enum TWinType
-			{
-			ERedraw,
-			EBlank,		// note: not currently used in tcrpanim tests
-			EBackedUp	// note: not currently used in tcrpanim tests
-			};
-	public:
-		CCrpAnim(TBool aIsBase, TWinType aWinType);
-		~CCrpAnim();
-		enum 
-			{
-			ENoTransparency=0x100
-			};
-		void ConstructL(const TPoint &aPos, const TSize &aSize,const TInt aAlphaValue=ENoTransparency);
-		void DoDraw(TBool aBlankIt);
-		inline void DoDraw();
-		void DoDrawEllipse();
-		inline TSize Size() {return iCtWin->Size();};
-		inline RWindowBase* BaseWin() const {return iCtWin->BaseWin();};
-		inline RWindow* Window() const {return STATIC_CAST(RWindow*, iCtWin->BaseWin());};
-		inline CTBaseWin* CtBaseWin() {return iCtWin;};
-		inline void Invalidate() {CTUser::Splat(TheClient, TRect(iCtWin->Position(), iCtWin->Size()), KRgbGray);};
-		void Invalidate(const TRect &aRect);
-		static void SetEllipseDrawMode(CGraphicsContext::TDrawMode aEllipseDrawMode);
-		void InvalidateAndRedraw(TBool aUseBlankItMember,TBool aBlankIt,TBool aUseRWindowInvalidate,TRect* aRect=NULL);
-
-		//A bit of an animation interface...
-		//I have written this interface to be amenable to playing multiple animations,
-		//which I think needs testing,
-		//but the underlying implementation assumes one animation at present.
-		//Your mission, should you choose to accept it, ....
-		
-		void SetPosAnimation(const TUid& aUid, const TRect& aRect);
-		TRect* GetPosAnimation(const TUid& aUid);
-		TWsGraphicAnimation* SetAnimation(TUid);	
-		TWsGraphicAnimation* GetAnimation(TUid);	
-		TBool RemoveAnimation(TUid);	
-		inline void	SetBlankIt(TBool aNewVal) {iBlankIt = aNewVal;};
-		inline void SetRepeatDrawMax(TInt aVal) {iRepeatDrawMax = aVal;};
-	protected:
-		static void Draw(CBitmapContext *aGc, const TSize &aSize, TBool aIsBase,const TRect &aRect, TBool aBlankIt,TInt aRepeat, TInt aAlphaValue);
-		static void DrawEllipse(CBitmapContext *aGc, const TRect &aRect, TInt aAlphaValue);
-		CTBaseWin *iCtWin;
-		TWinType iWinType;
-		TBool iIsBase;
-		TBool iBlankIt;
-		TRect iRect;
-		TInt  iRepeatDrawMax;
-		static CGraphicsContext::TDrawMode iEllipseDrawMode;
-		TUid  iAnimUid;
-		TWsGraphicAnimation iAnimData;
-		TRect iAnimPos;
-		TInt iAlphaValue;
-		};
-
-/*	    Using this time delay class in order to allow animations to play in our draw.
-		User::Wait does not allow the draw to occur (aparrently)
-		Note when using this time-delay class: because other active objects can perform part of their
-	    processing whilst we wait, wrapping calls to this in __UHEAP_MARK / __UHEAP_MARKEND
-	    is likely to fail.  The data providers and animators are a major cause of this. 
-*/
-	class CActiveWait : public CActive
-		{
-	public:
-		static CActiveWait* NewL();
-		~CActiveWait();
-		void Wait(TInt aDelay);
-		// From CActive:
-		void RunL();
-		void DoCancel();
-		TInt RunError(TInt aError);
-	protected:
-		CActiveWait();
-		void ConstructL();
-	protected:
-		RTimer iTimer;
-		TTime iFromTime;
-		};
-
-	CActiveWait* CActiveWait::NewL()
-		{
-		CActiveWait* self = new (ELeave) CActiveWait;
-		CleanupStack::PushL(self);
-		self->ConstructL();
-		CleanupStack::Pop(self);
-		return self;
-		}
-		
-	void CActiveWait::ConstructL()
-		{
-		User::LeaveIfError(iTimer.CreateLocal());
-		CActiveScheduler::Add(this);
-		}
-		
-	CActiveWait::CActiveWait() : CActive(EPriorityNormal)
-		{
-		iFromTime.HomeTime();
-		}
-
-	CActiveWait::~CActiveWait()
-		{
-		Cancel();
-		iTimer.Close();
-		}
-
-	void CActiveWait::DoCancel()
-		{
-		iTimer.Cancel();
-		CActiveScheduler::Stop();
-		}
-
-	void CActiveWait::RunL()
-		{
-		CActiveScheduler::Stop();
-		}
-		
-	TInt CActiveWait::RunError(TInt aError)
-		{
-		return aError; // exists so a break point can be placed on it.
-		}
-
-/*	    Note when using this : because other active objects can perform part of their
-	    processing whilst we wait, wrapping calls to this in __UHEAP_MARK / __UHEAP_MARKEND
-	    is likely to fail.  The data providers and animators are a major cause of this. 
-*/
-	void CActiveWait::Wait(TInt aDelay)
-		{
-		iTimer.After(iStatus, aDelay);
-		SetActive();
-		CActiveScheduler::Start();
-		}
-	CGraphicsContext::TDrawMode CCrpAnim::iEllipseDrawMode;
-
-//
-	}	//end anonymous local scope
-//
-
-/** This fn allocates an animation frame of the specified dimensions.
-	Not tested outside the current limited parameter set (16/2/2007).
-	Note the use of 32-bit integers for pixel/colour values. Using display mode lower than 24bpp may not produce correct results
-	My attempt to write animation generating code that avoids CIclLoader and Decoder class.
-	@param aDelayUs	 	the display time for the frame
-	@param aImageType	Colour format for colour plane. 24MA currently not flagged correctly I expect.
-	@param aMaskType	Format for mask. ENone for no mask.
-	@param aImageSize	Width/height of bitmap area
-	@param aImageOffset	Optional offset for bitmap area
-	@param aTotalSize	Optional width/height of whole animation (I think)
-	@return CFrame		filled in with allocated bitmaps. The get methods for the bitmaps return const type.
-**/
-static CWsGraphicBitmapAnimation::CFrame* NewFrameLC(TInt aDelayUs,TDisplayMode aImageType,TDisplayMode aMaskType,const TSize& aImageSize,const TPoint& aImageOffset=KPointZero,const TSize& aTotalSize=TSize(0,0))
-	{
-	TFrameInfo info;
-	info.iFrameCoordsInPixels = TRect(aImageOffset,aImageSize);
-	info.iFrameSizeInTwips = aImageSize;	  //this is zero in the gif loader
-	info.iDelay = TTimeIntervalMicroSeconds(aDelayUs);
-	info.iFlags = TFrameInfo::EColor|TFrameInfo::ELeaveInPlace|TFrameInfo::EUsesFrameSizeInPixels;
-	if (aMaskType != ENone)
-		{
-		info.iFlags|=TFrameInfo::ETransparencyPossible;
-		}
-	if ((aTotalSize.iHeight > 0) && (aTotalSize.iWidth > 0))
-		{
-		// restrict the size of the frame to specified size of the animation
-		info.iOverallSizeInPixels = aTotalSize;
-		}
-	else
-		{
-		// assign the size of the frame to the size of the entire bitmap area
-		info.iOverallSizeInPixels = info.iFrameCoordsInPixels.iBr.AsSize();
-		}
-	info.iFrameDisplayMode = aImageType;
-	info.iBackgroundColor = KRgbGreen;
-
-	CWsGraphicBitmapAnimation::CFrame* frame = CWsGraphicBitmapAnimation::CFrame::NewL();
-	CleanupStack::PushL(frame);
-	frame->SetFrameInfo(info);
-	CFbsBitmap* bitmap = new(ELeave) CFbsBitmap;
-	frame->SetBitmap(bitmap); //takes ownership
-	TSize frameInfoSize = info.iFrameCoordsInPixels.Size();
-	User::LeaveIfError(bitmap->Create(frameInfoSize, aImageType));
-	if((TFrameInfo::EAlphaChannel|TFrameInfo::ETransparencyPossible) & info.iFlags)
-		{
-		CFbsBitmap* mask = new(ELeave) CFbsBitmap;
-		frame->SetMask(mask); //takes ownership
-		User::LeaveIfError(mask->Create(frameInfoSize, aMaskType));
-		}
-	return frame;
-	}
-
-//
-// function called back by TCleanupItem frameListCleanup from within CreateAnimFramesL(..) method
-//
-void CleanupFrameList(TAny* aPtr)
-	{
-	RPointerArray<CWsGraphicBitmapAnimation::CFrame>* ptrArray = STATIC_CAST(RPointerArray<CWsGraphicBitmapAnimation::CFrame>*, aPtr);
-	ptrArray->ResetAndDestroy();
-	ptrArray->Close();
-	}
-
-/** Helper function for making animation frames.
-	//Called from CreateAnimL(...)
-	@param aDelayUs		the delay between frames
-	@param aNumFrames	number of frames (approx - image width is a factor)
-	@param aImageType	colour format of colour data. This may not work properly for non-32-bit, but I haven't fully understood TBitmapUtil documentation.
-	@param aMaskType	format for mask - ENone for no mask.
-	@param aImageSize	width/height of animation
-	@param aBgCol		background colour for image non-masked areas. Masked areas are black.
-	@param aFgCol		foreground colour of animating area
-	@param aFrames		frames that the animation is constructed from
-**/
-static void CreateAnimFramesL(TInt aDelayUs,TInt aNumFrames,TDisplayMode aImageType,TDisplayMode aMaskType,TSize aImageSize,TRgb aBgCol,TRgb aFgCol, RPointerArray<CWsGraphicBitmapAnimation::CFrame>& aFrames)
-	{
-	const TInt 	animWH = aImageSize.iWidth;
-	const TInt	animStep = Max(1,animWH/Max(1,aNumFrames));	//note this intentionally rounds down to avoid overflows
-	for (TInt ii = 0 ; ii < animWH ; ii += animStep)
-		{
-		CWsGraphicBitmapAnimation::CFrame* frame = NewFrameLC(aDelayUs,aImageType,aMaskType,aImageSize,KPointZero,aImageSize);
-		aFrames.AppendL(frame);
-		CleanupStack::Pop(frame);
-		TBitmapUtil utilMask(CONST_CAST(CFbsBitmap*, frame->Mask()));
-		TBitmapUtil utilCol(CONST_CAST(CFbsBitmap*, frame->Bitmap()));
-		utilCol.Begin(KPointZero);
-		
-		// cycle through the frame's actual bitmap & assign each pixel a value identical to the specified colours
-		TUint32 colback=aBgCol.Internal();
-		TUint32 colfront=aFgCol.Internal();
-		TInt row = KErrNone;
-		TInt col = KErrNone;
-		for (row = 0 ; row < aImageSize.iHeight ; row++)
-			{
-			utilCol.SetPos(TPoint(0, row));
-			for (col = 0 ; col < aImageSize.iWidth ; col++)
-				{
-				utilCol.SetPixel(colback);	
-				utilCol.IncXPos();
-				}
-			utilCol.SetPos(TPoint(ii, row));
-			for (col = 0 ; col < animStep ; col++)	  //Note I rely on intentional rounding down here!
-				{
-				utilCol.SetPixel(colfront);	
-				utilCol.IncXPos();
-				}			
-			}
-		
-		if (aMaskType)
-			{
-			// cycle through each pixel of the frame's mask & assign a default pixel a colour value
-			utilMask.Begin(KPointZero);
-			for (row = 0 ; row < aImageSize.iHeight ; row++)
-				{
-				utilMask.SetPos(TPoint(0,row));
-				for (col = 0 ; col < aImageSize.iWidth ; col++)
-					{
-					utilMask.SetPixel(KWhitePixels);
-					utilMask.IncXPos();
-					}
-				}
-			
-			const TInt maxmaskWidth = Min(8,Max(animWH/3,2));
-
-			//cut the corners off the mask
-			for (row = 0 ; row < maxmaskWidth ; row++)
-				{
-				TInt currentX = maxmaskWidth - row;
-				TInt xPos = KErrNone;
-
-				utilCol.SetPos(TPoint(0,row));
-				utilMask.SetPos(TPoint(0,row));
-				for(xPos = currentX ; xPos >= 0 ; xPos--)
-					{
-					utilCol.SetPixel(KBlackPixels);	
-					utilCol.IncXPos();
-					utilMask.SetPixel(KBlackPixels);	
-					utilMask.IncXPos();
-					}
-
-				utilCol.SetPos(TPoint(animWH - 1, row));
-				utilMask.SetPos(TPoint(animWH - 1, row));
-				for(xPos = currentX ; xPos >= 0 ; xPos--)
-					{
-					utilCol.SetPixel(KBlackPixels);	
-					utilCol.DecXPos();
-					utilMask.SetPixel(KBlackPixels);	
-					utilMask.DecXPos();
-					}
-
-				utilCol.SetPos(TPoint(0, animWH - 1 - row));
-				utilMask.SetPos(TPoint(0, animWH - 1 - row));
-				for(xPos = currentX ; xPos >= 0 ; xPos--)
-					{
-					utilCol.SetPixel(KBlackPixels);	
-					utilCol.IncXPos();
-					utilMask.SetPixel(KBlackPixels);	
-					utilMask.IncXPos();
-					}
-
-				utilCol.SetPos(TPoint(animWH - 1, animWH - 1 - row));
-				utilMask.SetPos(TPoint(animWH - 1, animWH - 1 - row));
-				for(xPos = currentX ; xPos >= 0 ; xPos--)
-					{
-					utilCol.SetPixel(KBlackPixels);	
-					utilCol.DecXPos();
-					utilMask.SetPixel(KBlackPixels);	
-					utilMask.DecXPos();
-					}
-				}
-			utilMask.End();
-			}
-		utilCol.End();
-		}
-	}
-
-/** My attempt to write animation generating code that avoids CIclLoader and Decoder class.
-	//It is better if this test class used it's own generated animation
-	//rather than relying on the GIF loader in order to reduce the cross-dependencies.
-	//The animation generated is a simple vertical line moving from left to right.
-	//To prove the masking, I cut the corners off.
-	@param aDelayUs		the delay between frames
-	@param aNumFrames	number of frames (approx - image width is a factor)
-	@param aImageType	colour format of colour data. This may not work properly for non-32-bit, but I haven't fully understood TBitmapUtil documentation.
-	@param aMaskType	format for mask - ENone for no mask.
-	@param aImageSize	width/height of animation
-	@param aBgCol		background colour for image non-masked areas. Masked areas are black.
-	@param aFgCol		foreground colour of animating area
-	@param aTUid		TUid assigned to animation
-	@return CWsGraphicBitmapAnimation allocated to represent the final animation	
-**/
-static CWsGraphicBitmapAnimation* CreateAnimL(TInt aDelayUs,TInt aNumFrames,TDisplayMode aImageType,TDisplayMode aMaskType,TSize aImageSize,TRgb aBgCol,TRgb aFgCol,TUid& aTUid)
-	{
-	RPointerArray<CWsGraphicBitmapAnimation::CFrame> frames;
-	TCleanupItem frameListCleanup(CleanupFrameList, &frames);
-	CleanupStack::PushL(frameListCleanup);
-	
-	CreateAnimFramesL(aDelayUs, aNumFrames, aImageType, aMaskType, aImageSize,aBgCol, aFgCol, frames);
-	
-	CWsGraphicBitmapAnimation* anim = CWsGraphicBitmapAnimation::NewL(aTUid,frames.Array());
-	CleanupStack::PopAndDestroy(&frames);
-	return anim;
-	}
-
-//
-// Describes the pure colour of the RGB value. yellow/magenta/cyan set 2 bits. White/grey is seperately flagged.
-// This method attempts to determine the strongest primary colour present in any given pixel. 
-// Note: The algorithm used is known to work for the current test cases only but requires careful review
-// for anyone making additional changes to tcrpanim. Given time, improved algorithm should be developed
-// to replace the current one
-//
-TUint PredominantColour(TUint aCol)
-	{	 //I don't like all these ifs, but I don't see an easy alternative
-		 //Possibly a bit look-up of the deltas from average would work 
-		 //(ignoring the bottom 5 bits =32, not 0x30=48. Ignore bottom 4 bits and accept 3-same answers, or divide by delta?)
-		 //
-	const TInt Kdelta=0x30;
-	TInt red=(aCol&0x00ff0000)>>16;
-	TInt green=(aCol&0x0000ff00)>>8;
-	TInt blue=(aCol&0x000000ff);
-	TInt ave=((red+green+blue)*(65536/3))>>16;
-	TBool rOverA=(red>ave);
-	TBool gOverA=(green>ave);
-	TBool bOverA=(blue>ave);
-	TInt numOverAve=(rOverA?1:0)+(gOverA?1:0)+(bOverA?1:0);
-
-	if (numOverAve==1)
-		{
-		if (rOverA)
-			{
-			if (red>ave+Kdelta)
-				{
-				if ((green-blue)>-Kdelta && (green-blue)<Kdelta)
-					return  EDetRed;
-				}
-			else
-				{
-				if (ave<Kdelta)
-					return EDetBlack;
-				else
-					{
-					if (green>ave-Kdelta && blue>ave-Kdelta)
-						{
-						if (ave>256-Kdelta)
-							return EDetWhite;
-						else
-							return EDetGrey;
-						}
-					}
-				}
-			}
-				
-		if (gOverA)
-			{
-			if (green>ave+Kdelta)
-				{
-				if ((blue-red)>-Kdelta && (blue-red)<Kdelta)
-					return  EDetGreen;
-				}
-			else
-				{
-				if (ave<Kdelta)
-					return EDetBlack;
-				else
-					{
-					if (red>ave-Kdelta && blue>ave-Kdelta)
-						if (ave>256-Kdelta)
-							return EDetWhite;
-						else
-							return EDetGrey;
-					}
-				}
-			}
-
-		if (bOverA)
-			{
-			if (blue>ave+Kdelta)
-				{
-				if ((green-red)>-Kdelta && (green-red)<Kdelta)
-					return  EDetBlue;
-				}
-			else
-				{
-				if (ave<Kdelta)
-					return EDetBlack;
-				else
-					{
-					if (red>ave-Kdelta && green>ave-Kdelta)
-						if (ave>256-Kdelta)
-							return EDetWhite;
-						else
-							return EDetGrey;
-					}
-				}
-			}
-		}
-	else	
-		{
-		if (!rOverA)
-			 if (red<ave-Kdelta)
-			 	{
-			 	if ((green-blue)>-Kdelta && (green-blue)<Kdelta)
-			 		return EDetGreen|EDetBlue;
-			 	}
-			 else
-				{
-				if (ave>256-Kdelta)
-					return EDetWhite;
-				else
-					{
-					if (blue<ave+Kdelta && green<ave+Kdelta)
-						{
-						if (ave<Kdelta)
-							return EDetBlack;
-						else
-							return EDetGrey;
-						}
-					}
-				}
-
-		if (!gOverA)
-			{
-			if (green<ave-Kdelta)
-				{
-				if ((blue-red)>-Kdelta && (blue-red)<Kdelta)
-					return  EDetRed|EDetBlue;
-				}
-			 else
-				{
-				if (ave>256-Kdelta)
-					return EDetWhite;
-				else
-					{
-					if (blue<ave+Kdelta && red<ave+Kdelta)
-						if (ave<Kdelta)
-							return EDetBlack;
-						else
-							return EDetGrey;
-					}
-				}
-			}
-
-		if (!bOverA)
-			{
-			if (blue<ave-Kdelta)
-				{
-				if ((green-red)>-Kdelta && (green-red)<Kdelta)
-					return  EDetGreen|EDetRed;
-				}
-			 else
-				{
-				if (ave>256-Kdelta)
-					return EDetWhite;
-				else
-					{
-					if (red<ave+Kdelta && green<ave+Kdelta)
-						if (ave<Kdelta)
-							return EDetBlack;
-						else
-							return EDetGrey;
-					}
-				}
-			}
-		}
-	return ECantTell;
-	}
-
-/**
-	Helper fn to ensure I put the anims in the same place each time...
-**/
-void CalcCentredAnimPosition(TRect& aRect,const TSize& aWinSize)
-	{
-	aRect.Shrink(aWinSize.iWidth*3/8,aWinSize.iHeight*4/10);
-	}
-
-CTCrpAnim::CTCrpAnim(CTestStep* aStep) : 
-	CTWsGraphicsBase(aStep)
-	{
-	}
-
-void CTCrpAnim::ConstructL()
-	{
-	TheClient->iGroup->WinTreeNode()->SetOrdinalPosition(0);
-	iRedrawWin=new(ELeave) CCrpAnim(EFalse, CCrpAnim::ERedraw);
-	iBaseWin=new(ELeave) CCrpAnim(EFalse, CCrpAnim::ERedraw);
-	iOverWin=new(ELeave) CCrpAnim(EFalse, CCrpAnim::ERedraw);
-
-	TSize screenSize=TheClient->iGroup->Size();
-	TInt winWidth=(screenSize.iWidth/3)-10;
-	TInt winHeight=screenSize.iHeight-10;
-	TSize windowSize(winWidth,winHeight);
-
-	iRedrawWin->ConstructL(TPoint(screenSize.iWidth/3*2+5,5), windowSize);
-	iBaseWin->ConstructL(TPoint(screenSize.iWidth/3+5,5), windowSize);
-	
-	//Create a transparent window that exactly overlaps the test window
-	//If transparency is not supported the leave causes the window to be destroyed and set to NULL.
-	//There is a test for transparency supported, but that simply creates a temp window to test anyway... 
-	
-	//Note that when I originally wrote this test to fix PDEF101991, it generated white areas that I detected.
-	//However, if this transparent window used for extended tests is created over the test window,
-	//that somehow stops the white fill from occurring.
-	//The fault still occurs, but the previous screen contents are left behind.
-	//So now this window is created at an off-screen location.
-	TRAPD(err, iOverWin->ConstructL(KPointOffsite, windowSize, 0x80); iOverWin->SetBlankIt(ETrue); iOverWin->SetRepeatDrawMax(KMaxRepeatDraw););
-	if (err)
-		{
-		delete iOverWin;
-		iOverWin = NULL;
-		}
-	
-	iTestWin = iRedrawWin;
-	iTestWin->SetRepeatDrawMax(KMaxRepeatDraw);
-	iBaseWin->SetRepeatDrawMax(KMaxRepeatDraw);
-
-	// create animation object & share it with everyone
-	iAnim = CreateAnimL(KAnimationFrameDelayTime,KAnimationTotalFrames,KTestDisplayMode,EGray256,TSize(KAnimDimension, KAnimDimension),KRgbBlue,KRgbRed,KUidTestAnimation2);
-	if (!iAnim)
-		{
-		User::Leave(KErrNoMemory);
-		}
-	iAnim->ShareGlobally();
-	
-	// calculate minimum length of the red line
-	const TInt maxmaskHeight = Min(8, Max(KAnimDimension/3,2)); // note this calculation mimics that for the size of the corners cut from the mask in CreateAnimL above
-	iMinimumCalcRedLine = KAnimDimension - maxmaskHeight*2; // the height of the image minus the two cut corners
-
-	// create the timer object
-	iWaiter = CActiveWait::NewL();
-
-	// create screen bitmap object & scanline buffer
-	iScreenBitmap = new (ELeave) CFbsBitmap;
-	User::LeaveIfError(iScreenBitmap->Create(TSize(KAnimDimension, KAnimDimension), KTestDisplayMode));
-	TInt bufLength = iScreenBitmap->ScanLineLength(windowSize.iHeight, KTestDisplayMode);
-	iScanlineBuf = HBufC8::NewL(bufLength);
-	
-	#ifdef RUN_SAMPLE_ON_LEFT
-    	{
-		// play animation on iBaseWin window
-		iBaseWin->SetAnimation(KUidTestAnimation2)->Play(ETrue);
-		TSize subsize1 = iTestWin->BaseWin()->Size();
-		TRect subposition1(subsize1);
-		CalcCentredAnimPosition(subposition1, subsize1);
-		iBaseWin->SetPosAnimation(KUidTestAnimation2, subposition1);
-		iBaseWin->InvalidateAndRedraw(ETrue,EFalse,ETrue);
-    	}
-	#endif
-	}
-
-CTCrpAnim::~CTCrpAnim()
-	{
-	delete iRedrawWin;
-	delete iBaseWin;
-	delete iOverWin;
-	if (iAnim)
-		{
-		// destroy the animation object
-		iAnim->UnShareGlobally();
-		iAnim->Destroy();
-		delete iAnim;				
-		iAnim = NULL;
-		}
-	if (iWaiter)
-		{
-		// destroy the timer object
-		delete iWaiter;
-		iWaiter = NULL;
-		}
-	if (iScreenBitmap)
-		{
-		// destroy the screen capture of the animation
-		delete iScreenBitmap;
-		iScreenBitmap = NULL;
-		}
-	if (iScanlineBuf)
-		{
-		// destroy the scanline buffer
-		delete iScanlineBuf;
-		iScanlineBuf = NULL;
-		}
-	User::After(200000);
-	}
-
-//
-// This method checks the animation contained in the aAnimWin window has progressed. That is 
-// that it's drawn a sufficient number of concurrent frames to screen & the animation is 
-// drawn properly to screen
-// returns a Bool identifying whether the animation is considered 'good' or not
-//  
-void CTCrpAnim::CheckAnimProgressedL(CAnonAnimWindow* aAnimWin, TInt aAdditionalFrameCount, TBool aCaptureFrameResult)
-	{
-	TBool goodAnimation = ETrue;
-
-	// retrieve the rect from the screen's bitmap that contains the animation
-	CWsScreenDevice* screen = TheClient->iScreen;
-	TRect animPos = *aAnimWin->GetPosAnimation(KUidTestAnimation2);
-	CTBaseWin* bWin = aAnimWin->CtBaseWin();
-	animPos.Move(bWin->Position());
-	User::LeaveIfError(screen->CopyScreenToBitmap(iScreenBitmap, animPos));
-	
-	TInt frameNum = DetermineApproxFrameNum(iScreenBitmap, aCaptureFrameResult); // determines the frame Number & checks quality of animation (no tearing, etc)
-	TBool frameIdentified=(frameNum>=0);
-	
-	if (aCaptureFrameResult)
-		{
-		if (frameIdentified)
-			{
-			if (iPreviousFrameNum != KErrNotFound)
-			 	{
-				if (iPreviousFrameNum < frameNum)
-					{
-					TInt frameStep = KFrameStepCalculation * aAdditionalFrameCount;
-					iPreviousFrameNum += frameStep; // move to our *expected* framenumber
-					if (frameNum > iPreviousFrameNum)
-						{
-						// the frame number is ahead of it's expected position
-						// This suggests we've possibly missed animating a frame in wserv
-						// or test code isn't getting a chance to execute as crp animations taking all cpu cycles
-						// If its significantly outside norms, we log the fact (as a performance metric)
-						TInt performance = ((frameNum - iPreviousFrameNum) / frameStep);
-						if (performance > KFrameMissedAnimationsThreshold)
-							{
-							iFrameStatus.iFrameSkipped++;
-							goodAnimation = EFalse;	
-							}	
-						}
-					// else we're animating above an acceptable threshold
-					}
-				else if (iPreviousFrameNum == frameNum) // potentially not animating anymore
-					{
-					iFrameStatus.iFrameIdentical++;
-					goodAnimation = EFalse;
-					}
-				// else animation is progressing fine
-				}
-			// ignore iPreviousFrameNum == KErrNotFound
-			}
-		else
-			{
-			goodAnimation = EFalse; // couldn't id the red line	
-			}
-
-		if (goodAnimation)
-			{
-			iFrameStatus.iFrameOK++;
-			}
-		}
-	// else we were only interested in calculating the frameNum
-	iPreviousFrameNum = frameNum;
-	}
-
-//
-// method to estimate the framenumber based on the location of the thin, red line. 
-// Also checks whether tearing of the animation has occured or the animation
-// is only partially drawn. 
-// These are known issues with wserv animation performance & so we give some allowance for error
-// 
-TInt CTCrpAnim::DetermineApproxFrameNum(CFbsBitmap* aBitmap, TBool aCaptureFrameResult)
-	{
-	TInt colFirstTear = KErrNotFound; 	// column id'ing the first tear in the vertical line
-	TPtr8 des = iScanlineBuf->Des();	// ptr to the scanline buffer
-
-	// locate the thin, red line in the bitmap
-	for (TInt xPos = 0 ; xPos < aBitmap->SizeInPixels().iWidth ; xPos++)
-		{
-		aBitmap->GetVerticalScanLine(des, xPos, EColor16MA);
-		TUint32* pixel = (TUint32*) des.Ptr();
-		TInt colour = KErrNone;
-		
-		for (TInt ii = 0 ; ii < aBitmap->SizeInPixels().iHeight ; ii++)
-			{
-			colour = PredominantColour(*pixel);
-			if (colour & EDetRed)
-				{
-				if (colFirstTear < 0)
-					{
-					// check the length of the red line is a good length
-					pixel += (iMinimumCalcRedLine - 1); // minus the one pixel to position on last pixel in red line
-					colour = PredominantColour(*pixel);
-					if (colour & EDetRed)
-						{
-						// good line
-						return xPos;
-						}
-					else // we've detected first part of a torn line
-						{
-						colFirstTear = xPos; 
-						}
-					}
-				else
-					{
-					// located second part of torn line
-					if ((xPos - colFirstTear) > KAnimationTearWidthThreshold)
-						{
-						if (aCaptureFrameResult)
-							{
-							iFrameStatus.iFrameTearing++;	
-							}
-						xPos = KErrNotFound;
-						}
-					return xPos;
-					}	
-				break;
-				}
-			pixel++;
-			}
-		}
-	if (aCaptureFrameResult)
-		{
-		if (colFirstTear < 0)
-			{
-			iFrameStatus.iFrameEmpty++; // we never located any red line at all
-			}
-		else
-			{
-			iFrameStatus.iFramePartial++; // we only located a single, small part of the red line
-			}
-		}
-	return KErrNotFound;
-	}
-
-/**	This internal loop tests that the animation and the foreground interact correctly
-	The primary test is that the outline of the animation 
-	intersects the lines drawn on the foreground correctly, compared to a reference version.
-	The iBaseWin is already showing this reference anim.
-	If the animation is not drawn, or the foreground is wiped, then this test will fail.
-**/
-void CTCrpAnim::TestSpriteLoopL(TBool aAnimForeground,TBool aDrawForeground)
-	{
-	_LIT(KForegroundInfo,"TestSpriteLoop animForeground [%d] drawForeground [%d]");
-	INFO_PRINTF3(KForegroundInfo, aAnimForeground, aDrawForeground);
-	
-	if (!iOverWin && (aAnimForeground || aDrawForeground))
-		{
-		User::Leave(KErrGeneral); // unable to run this test without iOverWin
-		}
-
-	ResetFrameCounters();
-	iTestWin->RemoveAnimation(KUidTestAnimation2);
-	iTestWin->SetBlankIt(ETrue);		
-	if (iOverWin)
-		{
-		iOverWin->RemoveAnimation(KUidTestAnimation2);
-		iOverWin->SetBlankIt(ETrue);
-		}
-
-	// determine which window holds the animation, & which will be invalidated with progressively larger rects
-	CCrpAnim* animWin=aAnimForeground?iOverWin:iTestWin;
-	CCrpAnim* paintWin=aDrawForeground?iOverWin:iTestWin;
-	paintWin->SetBlankIt(EFalse);
-	
-	// set & play the animation on the specified window (animWin)
-	animWin->SetAnimation(KUidTestAnimation2)->Play(ETrue);
-	TSize subsize1 = paintWin->BaseWin()->Size();
-	TRect subposition1(subsize1);
-	CalcCentredAnimPosition(subposition1, subsize1);
-	animWin->SetPosAnimation(KUidTestAnimation2, subposition1);
-	
-	#ifdef RUN_SAMPLE_ON_LEFT
-		// play the demo animation in the left-hand window also
-		iBaseWin->InvalidateAndRedraw(ETrue, EFalse, ETrue);
-	#endif
-
-	iTestWin->InvalidateAndRedraw(ETrue,EFalse,ETrue);
-	if (iOverWin)
-		{
-		iOverWin->InvalidateAndRedraw(ETrue,EFalse,ETrue);
-		}
-	
-	// invalidate increasingly larger squares on paintWin 
-	// note, some fully overlap the animation, some partially overlap, and some don't overlap at all
-	TInt invalidateWaitTime=KAnimationFrameDelayTime*3/4; // microseconds
-	TInt temp = KErrNotFound;
-	for (TInt step=30;step<KMaxXY;step+=30)
-		{
-		for (TInt xx=0;xx<KMaxXY;xx+=step)
-			{
-			for (TInt yy=10;yy<KMaxXY;yy+=step)
-	    		{
-				// calculate rectangle & invalidate paintWin with it
-	    		TRect invalidRect(xx,yy,xx+step,yy+step);
-	    		paintWin->InvalidateAndRedraw(ETrue,EFalse,ETrue,&invalidRect);
-				
-				// calculate any additional frames that may be drawn by above. Note intentionally ignore frame result
-				temp = iPreviousFrameNum;	
-				CheckAnimProgressedL(animWin, 1, EFalse);
-				
-				//new defect DEF101896: Test runs faster with this line removed, but there is evident tearing
-				iWaiter->Wait(invalidateWaitTime);			//DEF101896 search string: //interrupt_foreground_draw
-				
-				if (temp == iPreviousFrameNum)
-					{
-					// give wserv more time to animate the frame
-					iWaiter->Wait(invalidateWaitTime);
-					}
-				CheckAnimProgressedL(animWin, 1); // calculate the frame drawn. Capture frame result
-				}
-			}
-		}
-
-	// determine whether the animation was successful (ie: enough Good frames were detected) or not
-	// Note KMinGoodFrameThreshold is essentially an arbitrary number. This can be adjusted to accommodate
-	// performance requirements as needed
-	temp = LogResults();
-	TInt quality = 100*iFrameStatus.iFrameOK/temp;
-	TEST(quality > KMinGoodFrameThreshold);
-	
-	ResetFrameCounters();
-	iWaiter->Cancel();
-	iTestWin->RemoveAnimation(KUidTestAnimation2);
-	iTestWin->SetBlankIt(ETrue);		
-	if (iOverWin)
-		{
-		iOverWin->RemoveAnimation(KUidTestAnimation2);
-		iOverWin->SetBlankIt(ETrue);
-		}
-	}
-
-//
-// resets the frame trackers to intial values
-//
-void CTCrpAnim::ResetFrameCounters()
-	{
-	iPreviousFrameNum = KErrNotFound;
-	iFrameStatus.iFrameOK = 0;
-	iFrameStatus.iFramePartial = 0;
-	iFrameStatus.iFrameIdentical = 0;
-	iFrameStatus.iFrameEmpty = 0;
-	iFrameStatus.iFrameTearing = 0;
-	iFrameStatus.iFrameSkipped = 0;
-	}
-
-//
-// Log the current frame results & return the total number of frame calculations
-//
-// Calculated : the total number of frame-checks run
-// Good: 		the frame was successfully drawn to screen & within specified tolerances for tearing, expected position & colour
-// Partial: 	the frame was only partially drawn to screen. Specifcally the animated red line was only partially drawn
-// Identical: 	the frame was in the same position as the last frame
-// Empty: 		no redline was detected at all in the frame
-// Skipped: 	the position of the frame was beyond the expected position
-//
-// There is a dependency on the timing as to when the frame is animated hence tolerances are used to allow
-// for this. 
-// 
-TInt CTCrpAnim::LogResults()
-	{
-	TInt result = iFrameStatus.iFrameOK + iFrameStatus.iFramePartial + iFrameStatus.iFrameIdentical + 
-				iFrameStatus.iFrameEmpty + iFrameStatus.iFrameTearing + iFrameStatus.iFrameSkipped;
-	INFO_PRINTF4(_L("\tAnimation results:  Calculated[%d], Good[%d], Partial[%d]"), result, iFrameStatus.iFrameOK, iFrameStatus.iFramePartial);
-	INFO_PRINTF5(_L("\tAnimation results:  Identical[%d], Empty[%d], Tearing[%d], Skipped[%d]"), iFrameStatus.iFrameIdentical, iFrameStatus.iFrameEmpty, iFrameStatus.iFrameTearing, iFrameStatus.iFrameSkipped);
-	return result;
-	}
-
-/** This test tests the result of drawing an animation and main draw to two windows that overlap.
-	The two windows are placed in exactly the same location, so the result of splitting the drawing across them should be "identical".
-	Note that when the anim and the draw are on different screens the lines are seen merged over the anim.
-**/
-void CTCrpAnim::TestOverlappingWindowsL()
-	{
-	if (!iOverWin)
-		{
-		INFO_PRINTF1(_L("- Test skipped - transparency not supported"));
-		return;
-		}
-		
-	// setup necessary params
-	// Note we place the overlapping transparent window (iOverWin) directly on top of the test window (iTestWin)
-	iOverWin->BaseWin()->SetPosition(iTestWin->BaseWin()->Position());
-		
-	enum 
-		{
-		 EAllBackground=0,
-		 EForegroundDraw=1,
-		 EForegroundAnim=2,
-		 EAllForeGround=3,
-		 ECountModes,
-		 EFirstMode=EAllBackground,
-		};
-	
-	// test the various permutations of overlapping vs animated windows
-	for (TInt mode = EFirstMode ; mode < ECountModes ; mode++)	    
-		{
-		INFO_PRINTF2(_L("TestOverlappingWindowsL [%d]"), mode);
-		TestSpriteLoopL((mode&EForegroundAnim)!=0,(mode&EForegroundDraw)!=0);
-		}
-	}
-	
-/**
-	This method demonstrates clipping of an animation running behind a transparent window.
-	No main window redraw takes place here.
-**/	
-void CTCrpAnim::DemoClippingWindowsL()
-	{
-	if (!iOverWin)
-		{
-		INFO_PRINTF1(_L("- Test skipped - transparency not supported"));
-		return;
-		}
-
-	// setup test case params. Note we calculate three different positions for the overlapping window
-	RWindow* win = iTestWin->Window();
-	
-	TPoint	screenPos= win->Position();
-	TSize screenSize = win->Size();	
-	TRect subposition1(screenSize);
-	CalcCentredAnimPosition(subposition1, screenSize);
-
-	TPoint testPositions[]=
-		{	
-		//first test: window clips corner of anim
-			TPoint(screenPos.iX+screenSize.iWidth/2-10,screenPos.iY+screenSize.iHeight/2-10),
-		//test: window clips all of anim
-			TPoint(screenPos.iX+screenSize.iWidth/3,screenPos.iY+screenSize.iHeight/3),
-		//test: window clips none of anim
-			TPoint(screenPos.iX+screenSize.iWidth*2/3,screenPos.iY+screenSize.iHeight*2/3),
-		};
-
-	// calculate roughly number of frames we expect to have drawn
-	TInt loopWaitTime = KShortDelayLoop; // time given to allow animation to progress (arbitrary number)
-	float expectedFrameCount = 1;
-	if (loopWaitTime > KAnimationFrameDelayTime)
-		{
-		expectedFrameCount = loopWaitTime/KAnimationFrameDelayTime;
-		}
-
-	for (TInt ii = 0; ii < ((sizeof testPositions)/(sizeof testPositions[0])) ; ii++)
-		{
-		// initialise test windows to known state with no active animations
-		ResetFrameCounters();
-		iTestWin->RemoveAnimation(KUidTestAnimation2);
-		iTestWin->SetBlankIt(EFalse);		
-		iOverWin->SetBlankIt(ETrue);		
-		iOverWin->RemoveAnimation(KUidTestAnimation2);
-
-		// position animation windows
-		iTestWin->SetAnimation(KUidTestAnimation2)->Play(ETrue);
-		iTestWin->SetPosAnimation(KUidTestAnimation2, subposition1);
-		iOverWin->BaseWin()->SetPosition(testPositions[ii]); // positions the transparent overlapping window
-
-		// redraw both test windows
-		iTestWin->InvalidateAndRedraw(ETrue,EFalse,ETrue);
-		iOverWin->InvalidateAndRedraw(ETrue,EFalse,ETrue);
-
-		// run the animation for an arbitrary period
-		for (TInt loopit = 0 ; loopit < 20 ; loopit++)
-			{
-			iWaiter->Wait(loopWaitTime);	
-			CheckAnimProgressedL(iTestWin,static_cast<TInt>(expectedFrameCount)); // log the frame result
-			}
-
-		// calculate & log frame results. Test an acceptable number of frames were successfully animated
-		TInt total = LogResults();
-		TInt qA = 100*iFrameStatus.iFrameOK/total;
-		TEST(qA > KMinGoodFrameThreshold);
-		}
-	}
-
-/**	In this version, the background window is updated in patches. 
-	If the animation intersects the transparent window then the whole transparent window is redrawn.
-**/	
-void CTCrpAnim::TestClippingWindowsL()
-	{
-	if (!iOverWin)
-		{
-		INFO_PRINTF1(_L("- Test skipped - transparency not supported"));
-		return;
-		}
-	// setup test case params. Note we calculate three different positions for the overlapping window
-	RWindow* win = iTestWin->Window();
-	TPoint screenPos= win->Position();
-	TSize screenSize = win->Size();	
-	
-	TPoint testPositions[]=
-		{	
-		//first test: window clips corner of anim
-			TPoint(screenPos.iX+screenSize.iWidth/2-10,screenPos.iY+screenSize.iHeight/2-10),
-		//test: window clips all of anim
-			TPoint(screenPos.iX+screenSize.iWidth/3,screenPos.iY+screenSize.iHeight/3),
-		//test: window clips none of anim
-			TPoint(screenPos.iX+screenSize.iWidth*2/3,screenPos.iY+screenSize.iHeight*2/3),
-		};
-
-	for (TInt loopIt = 0; loopIt < ((sizeof testPositions)/(sizeof testPositions[0])) ; loopIt++)
-		{
-	    iOverWin->BaseWin()->SetPosition(testPositions[loopIt]); // position the overlapping window
-	    TestSpriteLoopL(EFalse,EFalse);
-		}
-	}
-
-/**	This just demonstrates that an animation plays - for about 1 second.
-**/
-void CTCrpAnim::BasicCRPDemo()
-	{
-	// draw the animation in two positions
-	TSize subsize1 = iTestWin->BaseWin()->Size();
-	TRect subposition1(subsize1);
-	CalcCentredAnimPosition(subposition1, subsize1);
-	
-	if (iOverWin)
-		{
-		iOverWin->BaseWin()->SetPosition(KPointOffsite);	//way away!
-		iOverWin->InvalidateAndRedraw(EFalse,EFalse,ETrue);
-		}
-		
-	CCrpAnim *animWin= iTestWin;
-	animWin->SetAnimation(KUidTestAnimation2)->Play(ETrue);
-	animWin->SetPosAnimation(KUidTestAnimation2, subposition1);
-	iTestWin->InvalidateAndRedraw(ETrue,EFalse,ETrue);
-	iBaseWin->InvalidateAndRedraw(ETrue,EFalse,ETrue);
-
-	// allow the animation to play for ~1 second. Purpose is to demonstrate animation to an observer	
-	iWaiter->Wait(KShortDelayLoop);
-	
-	ResetFrameCounters();
-	iWaiter->Cancel();
-	iTestWin->RemoveAnimation(KUidTestAnimation2);
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-CRP01-0001
-
-@SYMDEF             DEF100356
-
-@SYMTestCaseDesc    CRP animation test for redraw storing interrupting main draw
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates a CRP animation and runs it on the server scheduler 
-					while also running redraws of the window.
-					
-					With Redraw storing this has been known to cause problems 
-					sharing and resetting the window iDisplayRegion.
-					This is evidenced by white areas.
-
-
-@SYMTestExpectedResults 
-					The LHS window shows what the animation should look like just animating,
-					while the RHS window demonstrates the simultanious animation and redraw.
-					No White patches should be in evidence, and no missing fragments of animation.
-					The TEST should detect white patches.
-*/
-void CTCrpAnim::TestSpriteInterruptsForegroundL()
-	{	
-	// setup test params
-	TSize subsize1(iTestWin->BaseWin()->Size());
-	TRect subposition1(subsize1);
-	CalcCentredAnimPosition(subposition1, subsize1);
-	if (iOverWin)
-		{
-		iOverWin->BaseWin()->SetPosition(KPointOffsite);	// ensure overlapping transparent window DOESN'T overlap the test window
-		}
-
-	// execute test loop
-	TestSpriteLoopL(EFalse,EFalse);
-	}
-
-void CTCrpAnim::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(KTest1,"1: Basic CRP demo");
-	_LIT(KTest2,"2: sprite anim interrupts foreground");
-	_LIT(KTest3,"3: translucent windows");
-	_LIT(KTest4,"4: CRP clipping windows");
-	_LIT(KTest5,"5: CRP & redraw clipping windows");
-	_LIT(KTest6,"6: CRP Invalidation");
-
-	((CTCrpAnimStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(++iTest->iState)
-		{
-		case 1:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-CRP01-0002
-*/
-			((CTCrpAnimStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-CRP01-0002"));
-			iTest->LogSubTest(KTest1);
-			BasicCRPDemo();
-			break;
-		case 2:
-			((CTCrpAnimStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-CRP01-0001"));
-			iTest->LogSubTest(KTest2);
-			TestSpriteInterruptsForegroundL();
-			break;
-		case 3:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-CRP01-0003
-*/
-			((CTCrpAnimStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-CRP01-0003"));
-			iTest->LogSubTest(KTest3);
-			TestOverlappingWindowsL();
-			break;
-		case 4:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-CRP01-0004
-*/
-			((CTCrpAnimStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-CRP01-0004"));
-			iTest->LogSubTest(KTest4);
-			DemoClippingWindowsL();
-			break;
-		case 5:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-CRP01-0005
-*/
-			((CTCrpAnimStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-CRP01-0005"));
-			iTest->LogSubTest(KTest5);
-			TestClippingWindowsL();
-			break;
-		case 6:
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-CRP01-0006
-*/
-			((CTCrpAnimStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-CRP01-0006"));
-			iTest->LogSubTest(KTest6);
-			//this testcase is removed, because invalidation is removed from CWsGraphicDrawer destructor (due to flickering)
-			break;
-		default:
-			((CTCrpAnimStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTCrpAnimStep*)iStep)->CloseTMSGraphicsStep();
-			TestComplete();
-		}
-	((CTCrpAnimStep*)iStep)->RecordTestResultL();
-	}
-
-//
-namespace	//anonymous namespace
-	{
-//
-	CAnimRedrawWindow::CAnimRedrawWindow(CCrpAnim *aAnimWindow, TBool aIsBase) : CTWin(),
-		iAnimWindow(aAnimWindow),
-		iIsBase(aIsBase)
-		{
-		}
-
-	CAnimRedrawWindow::~CAnimRedrawWindow()
-		{
-		}
-
-	void CAnimRedrawWindow::Draw()
-		{
-		CCrpAnim::Draw(Gc(),Size(),iIsBase,iAnimWindow->iRect,iAnimWindow->iBlankIt,iAnimWindow->iRepeatDrawMax,iAnimWindow->iAlphaValue);
-		if (iAnimWindow->iAnimUid!=TUid::Null())
-			{
-			TheClient->Flush();
-			Gc()->DrawWsGraphic(iAnimWindow->iAnimUid,iAnimWindow->iAnimPos,iAnimWindow->iAnimData.Pckg());
-			TheClient->Flush();
-			}
-		}
-
-	//
-
-	CCrpAnim::CCrpAnim(TBool aIsBase, TWinType aWinType) 
-	:	iWinType(aWinType), 
-		iIsBase(aIsBase),
-		iBlankIt(EFalse),
-		iRepeatDrawMax(1),
-		iAnimUid(TUid::Null()),
-		iAlphaValue(ENoTransparency)
-		{
-		}
-
-	CCrpAnim::~CCrpAnim()
-		{
-		delete iCtWin;
-		}
-
-	void CCrpAnim::ConstructL(const TPoint &aPos, const TSize &aSize, TInt aAlphaValue)
-		{
-		TDisplayMode reqMode = EColor16MA; //for transparency we need 16ma or 16map mode
-		TDisplayMode *pReqMode=&reqMode;	
-		switch(iWinType)
-			{
-			case ERedraw:
-				iCtWin = new(ELeave) CAnimRedrawWindow(this, iIsBase);
-				break;
-			case EBlank:
-				iCtWin = new(ELeave) CTBlankWindow();
-				break;
-			case EBackedUp:
-				iCtWin = new(ELeave) CTBackedUpWin(EColor64K);
-				pReqMode = NULL;
-				break;
-			}
-		iCtWin->SetUpL(aPos, aSize, TheClient->iGroup, *TheClient->iGc, pReqMode, ETrue);
-		if (aAlphaValue != ENoTransparency)
-			{
-			User::LeaveIfError(Window()->SetTransparencyAlphaChannel());
-			//the window itself should be completely transparent, the draw commands will use the alpha value
-			Window()->SetBackgroundColor(TRgb(0, 0, 0, 0));
-			iAlphaValue = aAlphaValue;
-			}
-		}
-
-	void CCrpAnim::SetEllipseDrawMode(CGraphicsContext::TDrawMode aEllipseDrawMode)
-		{
-		iEllipseDrawMode = aEllipseDrawMode;
-		}
-
-	void CCrpAnim::DrawEllipse(CBitmapContext *aGc, const TRect &aRect, TInt aAlphaValue)
-		{
-		if(aAlphaValue != ENoTransparency)
-			{
-			aGc->SetBrushColor(TRgb(85,85,85, aAlphaValue));
-			aGc->SetPenColor(TRgb(170,170,170, aAlphaValue));
-			}
-		else
-			{
-			aGc->SetBrushColor(TRgb(85,85,85));
-			aGc->SetPenColor(TRgb(170,170,170));
-			}
-		aGc->SetDrawMode(iEllipseDrawMode);
-		aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-		aGc->DrawEllipse(aRect);
-		}
-
-	void CCrpAnim::Draw(CBitmapContext *aGc, const TSize &aSize, TBool aIsBase, const TRect &aRect, TBool aBlankIt,TInt aRepeat, TInt aAlphaValue)
-		{
-		static TInt sGrey=0;
-		sGrey+=3;
-		if (sGrey>0x40)
-			sGrey-=0x40;		
-		sGrey=sGrey^0x20;
-		if(aAlphaValue != ENoTransparency)
-			{
-			aGc->SetBrushColor(TRgb(sGrey, sGrey, sGrey, aAlphaValue));
-		    aGc->SetPenColor(TRgb(KRgbGreen.Value(), aAlphaValue));
-			}
-		else
-			{		
-			aGc->SetBrushColor(TRgb::Gray256(sGrey));
-		    aGc->SetPenColor(KRgbGreen);
-			}
-		aGc->Clear();
-	    TInt xPos=aSize.iHeight,yPos=aSize.iWidth;
-	    
-	    // The test windows are created relative to screen size. The
-	    // number of green lines generated needs to be tied into the
-	    // window size to prevent green becoming the dominant colour
-	    // when blended with the second animation, which would
-	    // prevent the PredominantColour() algorithm from discovering
-	    // the red line.
-	    TInt yStep = aSize.iHeight/14;
-	    TInt xStep = aSize.iWidth/6;
-	    
-	    //This paint is intentionally complex and slow so that the animation timer is likely to interrupt it.
-		if (!aBlankIt)
-		 for (TInt nn = 0 ; nn < aRepeat ; nn++)
-			for(yPos=0 ; yPos < aSize.iHeight ; yPos += yStep)
-				for(xPos=0 ; xPos < aSize.iWidth ; xPos += xStep)
-					aGc->DrawLine(aRect.Center(),TPoint(xPos,yPos));
-		if (aIsBase)
-			DrawEllipse(aGc, aRect, aAlphaValue);			
-		}
-
-	//This simple API may need replacing by a list and search if multiple anims are played together
-	TWsGraphicAnimation* CCrpAnim::SetAnimation(TUid aUid)
-		{	//currently only have 1 animation - it gets replaced. It could get refiused
-		iAnimUid=aUid;
-		return &iAnimData;	
-		}
-
-	TWsGraphicAnimation* CCrpAnim::GetAnimation(TUid aUid)
-		{   //currently only have 1 animation
-		if (iAnimUid==aUid)
-			return &iAnimData;	
-		else
-			return NULL;
-		}
-		
-	void CCrpAnim::SetPosAnimation(const TUid& aUid, const TRect& aRect)
-		{   //currently only have 1 animation
-		if (iAnimUid==aUid)
-			iAnimPos = aRect;
-		}
-	
-	TRect* CCrpAnim::GetPosAnimation(const TUid& aUid)
-		{   //currently only have 1 animation
-		if (iAnimUid==aUid)
-			return &iAnimPos;	
-		else
-			return NULL;
-		}
-	
-	TBool CCrpAnim::RemoveAnimation(TUid)
-		{
-		iAnimUid=TUid::Null();
-		iAnimData.Stop(EFalse);		
-		return ETrue;
-		}	
-
-	void CCrpAnim::DoDraw()
-		{
-		DoDraw(iBlankIt);
-		}
-
-	inline void CCrpAnim::DoDraw(TBool aBlankIt)
-		{
-		__ASSERT_ALWAYS(iWinType!=EBlank,AutoPanic(EAutoPanicWindowType));
-		iCtWin->Gc()->Activate(*Window());
-		Draw(iCtWin->Gc(),Size(),iIsBase,iRect,aBlankIt,iRepeatDrawMax,iAlphaValue);
-		if (iAnimUid!=TUid::Null())
-			iCtWin->Gc()->DrawWsGraphic(iAnimUid,iAnimPos,iAnimData.Pckg());
-		iCtWin->Gc()->Deactivate();
-		}
-		
-	void CCrpAnim::DoDrawEllipse()
-		{
-		__ASSERT_ALWAYS(iWinType!=EBlank,AutoPanic(EAutoPanicWindowType));
-		iCtWin->Gc()->Activate(*Window());
-		DrawEllipse(iCtWin->Gc(),iRect,iAlphaValue);
-		iCtWin->Gc()->Deactivate();
-		}
-
-	void CCrpAnim::InvalidateAndRedraw(TBool /*aUseBlankItMember*/,TBool /*aBlankIt*/,TBool aUseRWindowInvalidate,TRect* aRect)
-		{
-		RWindow& win = *Window();
-		if (aRect)
-			{
-			if (aUseRWindowInvalidate)
-				win.Invalidate(*aRect);
-			else
-				Invalidate(*aRect);
-			}
-		else
-			{
-			if (aUseRWindowInvalidate)
-				win.Invalidate();
-			else
-				Invalidate();
-			}
-		if (aRect)
-			win.BeginRedraw(*aRect);
-		else
-			win.BeginRedraw();
-		DoDraw();
-		win.EndRedraw();
-		TheClient->Flush();
-		}
-		
-	void CCrpAnim::Invalidate(const TRect &aRect)
-		{
-		TRect rect(aRect);
-		rect.Move(iCtWin->Position());
-		CTUser::Splat(TheClient,rect,TRgb::Gray256(0));
-		}
-
-//
-	}	//end anonymous namespace
-//
-__WS_CONSTRUCT_STEP__(CrpAnim)
--- a/windowing/windowserver/tauto/tcrpanim.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// TCrpAnim.H Defines class CTCrpAnim
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TCRPANIM_H__
-#define __TCRPANIM_H__
-
-#include "AUTO.H"
-
-_LIT(KTCrpAnimStep,"TCrpAnim");
-
-namespace	//anonymous local scope
-	{
-	class CCrpAnim;
-	typedef  CCrpAnim CAnonAnimWindow;
-	class CActiveWait;
-	typedef  CActiveWait CAnonActiveWait;
-	}
-	
-class CTCrpAnim : public CTWsGraphicsBase
-	{
-public:
-	CTCrpAnim(CTestStep* aStep);
-	~CTCrpAnim();
-	void ConstructL();
-protected:
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	// TAnimFrameResult is a struct designed to track the various frame results
-	// as the animation progresses. Once the animation is complete, TAnimFrameResult
-	// provides an easy to read indication as to the animation's performance
-	struct TAnimFrameResult
-		{
-		TInt iFrameOK;
-		TInt iFramePartial;
-		TInt iFrameIdentical;
-		TInt iFrameEmpty;
-		TInt iFrameTearing;
-		TInt iFrameSkipped;
-		};
-	void InvalidatePauseAndRedraw(const TRect &aRect,TTimeIntervalMicroSeconds32 aInterval);
-	void RedrawAndCheckWindows(TBool aBlankIt=EFalse);
-	void TestSpriteLoopL(TBool aAnimForeground,TBool aDrawForeground);
-    void CheckAnimProgressedL(CAnonAnimWindow* aAnimWin, TInt aAdditionalFrameCount, TBool aCaptureFrameResult = ETrue);
-	TInt DetermineApproxFrameNum(CFbsBitmap* aBitmap, TBool aCaptureFrameResult);
-	void ResetFrameCounters();
-	TInt LogResults();
-// The tests
-    void	TestSpriteInterruptsForegroundL();
-    void	TestSpriteRestartInterruptsForegroundL();
-	void	BasicCRPDemo();
-	void	TestOverlappingWindowsL();
-	void	TestClippingWindowsL();
-	void	DemoClippingWindowsL();
-	void	TestInvalidateL();
-private:
-	CAnonAnimWindow *iTestWin;
-	CAnonAnimWindow *iOverWin;
-	CAnonAnimWindow *iRedrawWin;
-	CAnonAnimWindow *iBaseWin;
-	TInt iPreviousFrameNum;				// identifies the last successfully drawn frame number calculated
-	TInt iMinimumCalcRedLine;			// the calculated minimum length of the red line in the animation
-	TAnimFrameResult iFrameStatus;		// tracker for the performance of each animated frame
-	CActiveWait* iWaiter;				// active object with configurable timer
-	CWsGraphicBitmapAnimation* iAnim; 	// ptr to server-side animation object
-	CFbsBitmap* iScreenBitmap;			// bitmap holding screen snap-shot
-	HBufC8* iScanlineBuf;				// buffer holding pixel data on a single vertical scan line
-	};
-
-class CTCrpAnimStep : public CTGraphicsStep
-	{
-public:
-	CTCrpAnimStep();
-protected:
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-#endif  //__TCRPANIM_H__
--- a/windowing/windowserver/tauto/tdirecta.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,522 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TDIRECTA_H__
-#define __TDIRECTA_H__
-
-#include "AUTO.H"
-#include <e32msgqueue.h>
-#include <time.h>
-#include "TGraphicsHarness.h"
-
-//#define LOGGING
-
-class CColorAnimation;
-class CScrollText;
-class CScrollingTextDrawer;
-class CDirectScreenAccessOld;
-
-
-struct TDirectThreadParam
-	{
-	TRect iRect;
-	TInt iScreenNumber;
-	TBool iIsInFront;
-	};
-
-class MAnimCallBacks
-	{
-public:
-	virtual void LogLeave(TInt aErr)=0;
-	virtual void Fail()=0;
-	virtual void Finished(TInt aId)=0;
-	virtual TDisplayMode DisplayMode(TInt aId)=0;
-	virtual TRgb BrushColorL(TInt aId,TInt& aColor,TBool& aFinished)=0;
-	virtual TInt TimerInterval(TInt aId)=0;
-	virtual void FailedReStart(TInt aId,TInt aReason)=0;
-	virtual TInt SlowStopping(TInt aId,TInt aCount)=0;
-	virtual void Log(const TText8* aFile, TInt aLine, TInt aSeverity,const TDesC& aString)=0;
-public:
-	CTBlankWindow* iCallBackWin;
-	};
-
-class CTDirect : public CTWsGraphicsBase, public MAbortDirectScreenAccess, public MAnimCallBacks
-	{
-public:
-	enum
-		{
-		eDirectNumFrames=10
-		};
-	enum
-		{
-		eDirectControlSem=0x01,
-		eDirectWindowSem=0x02,
-		eFontSet=0x04,
-		eMultiAnim=0x08,
-		};
-public:
-	CTDirect(CTestStep* aStep);
-	~CTDirect();
-	void ConstructL();
-	TBool DrawFrame();
-	TBool Restart();
-	void ChangeToNextScreenModeL();
-	void ChangeScreenScale();
-	//The Tests
-	TestState AnimateWindowL();
-	TestState AnimationDiesL();
-	TestState PackagingClassL();
-	TestState MultipleL();
-	TestState FailCodesL();
-	TestState ScrolingText1L();
-	TestState RClassL();
-	TestState ScrolingText2L();
-	TestState ScrolingText3L();
-	TestState ScrolingText4L();
-	TestState DefectFix_KAA_5J3BLW_L();
-	TestState KillAnimationL();
-	TestState DSAWithScreenModeOffset1L();
-	TestState DSAWithScreenModeOffset2L();
-	TestState WindowPoistionRelativeToScreenL();
-	TestState ScreenModeScalingTestL();
-	TestState ScreenModeTestForScalingL();
-	TestState MultipleDSAsOnSameWindowL();
-	TestState TemporaryDeadlockL();
-	TestState RegionTrackingOnlyNotificationsL(TUint aId);
-	TestState MixDsaAndRegionTrackingOnlyL(TBool aWhoExitsLast);
-	TestState TryDifferentSupportedModesL();
-protected:
-//from 	CTGraphicsStep
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	void ConstrucBlankWindowL();
-	void ScanTypeFacesL();
-	void InitialiseAnimationL();
-	void DestroyAnimation();
-	void ResetScreenSizeMode();
-	void StartDirect();
-	void SignalWindow();
-	void ModeSwitch();
-	void ScrolingTextL(TInt aId,TRect aWinRect,TBool aStartThread,TInt aScreenMode=0);
-	void AnimTestL(TInt aId,TRect aWinRect,CTWinBase& aParent);
-	//Pure virtual function from MAbortDirectScreenAccess
-	void AbortNow(RDirectScreenAccess::TTerminationReasons aReason);
-	//Pure virtual functions from MAnimCallBacks
-	void LogLeave(TInt aErr);
-	void Fail();
-	void Finished(TInt aId);
-	void DeleteMoveWindow();
-	void DeleteScroll();
-	TDisplayMode DisplayMode(TInt aId);
-	TRgb BrushColorL(TInt aId,TInt& aColor,TBool& aFinished);
-	TInt TimerInterval(TInt aId);
-	void FailedReStart(TInt aId,TInt aReason);
-	TInt SlowStopping(TInt aId,TInt aCount);
-	void Log(const TText8* aFile, TInt aLine, TInt aSeverity,const TDesC& aString);
-	void SetScreenMode(TInt aMode,TPixelsAndRotation& aPixelsAndRotation);
-	void CreateAnimForScreenModeL(TInt aAnimIndex,CTWinBase& aParent,TRect aRect,TInt aId);
-	void BlankTopClientWindowL(CTBlankWindow& aBlankWindow,TRect aRect);
-	void TestDifferentOriginAndScaleL(TSizeMode &aMode,TPoint aOrigin);
-	void CheckForTemporaryDeadlock();
-private:
-	CProcess* iProcess;
-	CProcess* iMoveWin;
-	RSemaphore iControlSem;
-	RMsgQueueBase iControlQueue;
-	RSemaphore iWinSem;
-	TRequestStatus iThreadStatus;
-	TUint iFlags;
-	CTBlankWindow* iWin;
-	CTBlankWindow* iWin2;
-	CFbsScreenDevice* iScrDev;
-	CFbsBitGc* iGc;
-	CFont* iFont;
-	CPeriodic* iTimer;
-	CIdle* iRestart;
-	CDirectScreenAccessOld* iDirect;
-	RRegion* iDrawingRegion;
-	TSize iScrSize;
-	TRect iDrawRect;
-	TInt iDrawHeight;
-	TInt iFrameNo;
-	TInt iLastTextWidth;
-	TInt iLastMaxTextWidth;
-	TInt iFrameToSignalAfter;
-	TBool iDelay;
-	TBool iCancelNext;
-	TBool iWindowDead;
-	CColorAnimation* iAnim;
-	CColorAnimation* iAnims[13];
-	TInt iCount;
-	CScrollText* iScroll;
-	TInt iCycles;
-	TScreenModeEnforcement iModeBackup;
-	TThreadStartUp iFirstFunction;
-	TInt iNumThreadHandles;
-	CTBlankWindow* iBlankTopClientWin1;
-	CTBlankWindow* iBlankTopClientWin2;
-	CPeriodic* iChangeScreenModeTimer;
-	TInt iCurrentMode;
-	TInt iNumOfModes;
-	TPoint iCurrentScreenModeOrigin;
-	TSize iCurrentScreenModeScale;
-	TInt iNumAnimation;
-	TSizeMode iModeData;
-	CPeriodic* iScreenModeTimer;
-	TInt iIsScalingSupported;
-	TInt iNumOfCallBack;
-	TBool iTestJustFailed;
-	TBool iTestJustCompleted;
-	TInt iState;
-	TBool iNextFrameFinished;
-	TBool iPackagingFinished;
-	TBool iTimerRunning;
-	};
-
-class CDirectScreenAccessOld : public CActive
-	{
-public:
-	static CDirectScreenAccessOld* NewL(RWsSession& aWs,MAbortDirectScreenAccess& aAborter);
-	~CDirectScreenAccessOld();
-	TInt Request(RRegion*& aRegion, RWindowBase& aWindow);
-private:
-	inline CDirectScreenAccessOld(RWsSession& aWs,MAbortDirectScreenAccess& aAborter)
-		: CActive(RDirectScreenAccess::EPriorityVeryHigh), iDirectAccess(aWs), iAborter(aAborter) {}
-	void ConstructL();
-	//Pure virtual functions from CActive
-	void DoCancel();
-	void RunL();
-private:
-	RDirectScreenAccess iDirectAccess;
-	MAbortDirectScreenAccess& iAborter;
-	TBool iAborting;
-	};
-
-class CColorAnimation : public CBase, public MDirectScreenAccess
-	{
-public:
-	enum
-		{
-		eStopNow=EFalse,
-		eStopDelayed=ETrue,
-		eAbort=2,
-		eAbortAll,
-		};
-public:
-	static TInt DrawColorL(TAny* aAnimation);
-	static TInt IdlingL(TAny* aAnimation);
-	static CColorAnimation* NewL(TInt aScreenNumber,TInt aId,MAnimCallBacks& aCallBack,CTWinBase& aParent,TRect aExtent,TBool aStart,TBool aRegionTrackingOnly = EFalse);
-	inline CColorAnimation(TInt aScreenNumber,TInt aId,MAnimCallBacks& aCallBack) :iId(aId), iCallBack(aCallBack), iScreenNumber(aScreenNumber) {}
-	~CColorAnimation();
-	void ConstructL(CTWinBase& aParent,TRect aExtent,TBool aRegionTrackingOnly,TInt aTypeWindow=0,TInt aSingleWinForMultipleDSA=0);
-	void StartL(TBool aChildWindow=EFalse);
-	void StartOrPanic();
-	void Stop();
-	void BringWindowToFront();
-	void ChangeModeL(TDisplayMode aMode);
-	TBool inline IsTimerActive() {return iTimer->IsActive();}
-	inline MAnimCallBacks& CallBack() { return iCallBack; }
-	TPoint AbsoluteWindowPosition(TInt aWindowId=0);
-	inline CDirectScreenAccess* GetDrawer();
-	void FinishTest();
-	TBool TestGcAndScreenDeviceValues();
-	//inline TBool IsReadyToAbort(){return (iDrawer->iStatus!=KRequestPending);}
-protected:
-	void DrawColorL();
-	void IdlingL();
-	/*pure virtual function from MAbortDirectScreenAccess*/
-	void AbortNow(RDirectScreenAccess::TTerminationReasons aReason);
-	/*pure virtual function from MDirectScreenAccess*/
-	void Restart(RDirectScreenAccess::TTerminationReasons aReason);
-private:
-	TInt iId;
-	CTBlankWindow* iWindow;
-	CTBlankWindow* iWindow2;
-	TSize iWinSize;
-	CDirectScreenAccess* iDrawer;
-	CPeriodic* iTimer;
-	MAnimCallBacks& iCallBack;
-	TInt iColor;
-	TInt iCount;
-	TUint iIdling;
-	TInt iScreenNumber;
-	TInt iSingleWinForMultipleDSA;
-	TBool iRegionTrackingOnly;
-	};
-
-class CScrollingTextDrawer : public CBase
-	{
-public:
-	static CScrollingTextDrawer* NewL(TInt aScreenNumber,CFbsScreenDevice*& aDevice,CFbsBitGc& aGc);
-	~CScrollingTextDrawer();
-	inline void SetScrollJump(TInt aJump) {iJump=aJump;}
-	void SetBottomOfTest(TInt aBottom);
-	void Scroll();
-private:
-	inline CScrollingTextDrawer(CFbsScreenDevice*& aDevice,CFbsBitGc& aGc) : iDevice(aDevice), iGc(&aGc) {}
-	void ConstructL(TInt aScreenNumber);
-	void CreateFontL();
-private:
-	CFbsScreenDevice*& iDevice;
-	CFbsScreenDevice* iFontDevice;
-	CFbsBitGc* iGc;
-	CFont* iFont;
-	TBuf<32> iText;
-	TRect iDrawRect;
-	TInt iDrawHeight;
-	TInt iCharWidth;
-	TInt iFirstChar;
-	TInt iJump;
-#if defined(LOGGING)
-	RWsSession iWs;
-#endif
-	};
-
-class CScrollText : public CBase, public MDirectScreenAccess
-	{
-public:
-	static TInt DrawText(TAny* aAnimation);
-	static CScrollText* NewL(TInt aScreenNumber,TInt aId,CTWindowGroup& aParent,TInt aScrollJump,TBool aStart=EFalse);
-	inline CScrollText(TInt aId,TInt aScrollJump,TInt aScreenNumber) :iId(aId), iScrollJump(aScrollJump), iScreenNumber(aScreenNumber) {}
-	~CScrollText();
-	void ConstructL(CTWindowGroup& aParent);
-	void StartL();
-	void Stop();
-	void ContinueL();
-	inline TBool IsRunning() {return iTimer->IsActive();}
-	inline void SetCountDown(TInt aCountDown) {iAbortCountDown=aCountDown; iCounting=ETrue;}
-	inline void SetBottomOfTest(TInt aBottom) {iTextDraw->SetBottomOfTest(aBottom);}
-private:
-	void ScrollText();
-	void DoContinueL();
-	/*pure virtual function from MAbortDirectScreenAccess*/
-	void AbortNow(RDirectScreenAccess::TTerminationReasons aReason);
-	/*pure virtual function from MDirectScreenAccess*/
-	void Restart(RDirectScreenAccess::TTerminationReasons aReason);
-private:
-	TInt iId;
-	CTBlankWindow* iWindow;
-	TSize iWinSize;
-	CDirectScreenAccess* iDrawer;
-	CScrollingTextDrawer* iTextDraw;
-	CPeriodic* iTimer;
-	TInt iScrollJump;
-	TBool iCounting;
-	TInt iAbortCountDown;
-	TInt iScreenNumber;
-	};
-
-	
-/**
- A simple class based on CScrollText constructs a blank window that has
- a blank window child, used for functional coverage testing of CWsClientWindow
- */
-class CWindowWithChild : public CBase, public MDirectScreenAccess
-	{
-public:
-	static CWindowWithChild* NewL(TInt aScreenNumber, CTWindowGroup& aParent,TBool aStart=EFalse);
-	inline CWindowWithChild(TInt aScreenNumber) : iScreenNumber(aScreenNumber) {}
-	~CWindowWithChild();
-	void ConstructL(CTWindowGroup& aParent);
-	void StartL();
-	void Stop();
-	void ContinueL();
-	inline TBool IsRunning() {return iRunning;}
-	void PerformCoverageCalls();
-	RWindow *ChildWindow()    {return iChildWindow->Win();}
-private:
-	void DoContinueL();
-	/*pure virtual function from MAbortDirectScreenAccess*/
-	void AbortNow(RDirectScreenAccess::TTerminationReasons aReason);
-	/*pure virtual function from MDirectScreenAccess*/
-	void Restart(RDirectScreenAccess::TTerminationReasons aReason);
-private:
-	CTBlankWindow* iWindow;
-	CTWin * iChildWindow;
-	TSize iWinSize;
-	CDirectScreenAccess* iDrawer;
-	TInt iScreenNumber;
-	TBool iRunning;
-	};
-	
-	
-class CWsBase : public CBase
-	{
-public:
-protected:
-	~CWsBase();
-	void ConstructL(TInt aScreenNumber,TInt aHandle);
-	void CreateBlankWindowL(RBlankWindow& iWin,TInt aHandle);
-protected:
-	RWsSession iWs;
-	CWsScreenDevice *iScrDev;
-	RWindowGroup iGroup;
-	};
-
-class CAnimating : public CWsBase, public MAbortDirectScreenAccess
-	{
-public:
-	static TInt StartLC(TAny* aScreenNumber);
-	//static CAnimating* NewLC();
-	void DrawFrame();
-	/*pure virtual function from MAbortDirectScreenAccess*/
-	void AbortNow(RDirectScreenAccess::TTerminationReasons aReason);
-private:
-	void ConstructL(TInt aScreenNumber);
-	~CAnimating();
-	void StartAnimatingL();
-private:
-	RSemaphore iControlSem;
-	RMsgQueueBase iControlQueue;
-	TBool iSemCreated;
-	RBlankWindow iWindow;
-	CFbsScreenDevice* iScrDev;
-	CFbsBitGc* iGc;
-	TSize iScrSize;
-	CDirectScreenAccessOld* iDirect;
-	RRegion* iDrawingRegion;
-	CPeriodic* iTimer;
-	TInt iColor;
-	};
-
-class CMoveWindow : public CWsBase
-	{
-public:
-	static TInt StartLC(TAny* aScreenNumber);
-	static TInt StateChange(TAny* aMoveWin);
-	static TInt FlipChange(TAny*);
-	//Call Backs
-	void MoveWindow();
-private:
-	inline static CMoveWindow* Cast(TAny* aMoveWin) {return STATIC_CAST(CMoveWindow*,aMoveWin);}
-	~CMoveWindow();
-	void ConstructL(TInt aScreenNumber);
-	void CreateTimerL();
-	void StateChange();
-	void ToggleDisplayMode();
-	void FlipChange();
-private:
-	CPeriodic* iFlipTimer;
-	CPeriodic* iStateTimer;
-	CPeriodic* iTimer;
-	CWsScreenDevice* iDevice;
-	RBlankWindow iWindow;
-	TDisplayMode iDisplayMode;
-	RBackedUpWindow iBackUpWin;
-	CWindowGc* iGc;
-	TRect iBounceArea;
-	TSize iScrSize;
-	TPoint iTl;
-	TSize iSize;
-	TSize iDelta;
-	TInt iStateCountDown;
-	TInt iNumOfModes;
-	TInt iCurrentMode;
-	};
-
-class CBugFixColorAnimation : public CColorAnimation
-	{
-public:
-	static CBugFixColorAnimation* NewL(TInt aScreenNumber,TInt aId,MAnimCallBacks& aCallBack,CTWindowGroup& aParent,TRect aExtent,TBool aStart=EFalse);
-	~CBugFixColorAnimation();
-	inline void Started() { iSem.Signal(); }
-private:
-	CBugFixColorAnimation(TInt aScreenNumber,TInt aId,MAnimCallBacks& aCallBack);
-	void ConstructL(CTWindowGroup& aParent,TRect aExtent);
-private:
-	/*pure virtual function from MAbortDirectScreenAccess*/
-	void AbortNow(RDirectScreenAccess::TTerminationReasons aReason);
-	/*pure virtual function from MDirectScreenAccess*/
-	void Restart(RDirectScreenAccess::TTerminationReasons aReason);
-private:
-	CProcess* iThread;
-	CIdle* iTestFailed;
-	TRect iAnimRect;
-	TDirectThreadParam iThreadParam;
-	RSemaphore iSem;
-	};
-
-class CRegionTrackingOnly : public CColorAnimation
-	{
-public:
-	static CRegionTrackingOnly* NewL(TInt aScreenNumber,TInt aId,MAnimCallBacks& aCallBack,CTWindowGroup& aParent,TRect aExtent,TBool aStart,TBool aOpenWindowInFrontDsa);
-	void ConstructL(CTWindowGroup& aParent,TRect aExtent,TBool aOpenWindowInFrontDsa);
-	~CRegionTrackingOnly();
-	inline void Started() { iSem.Signal(); }
-private:
-	CRegionTrackingOnly(TInt aScreenNumber,TInt aId,MAnimCallBacks& aCallBack);
-	/*Overriding of bases class virtual functions*/
-	void AbortNow(RDirectScreenAccess::TTerminationReasons aReason);
-	void Restart(RDirectScreenAccess::TTerminationReasons aReason);
-private:
-	CProcess* iThread;
-	TRect iAnimRect;
-	TBool iExpectedToAbort;	
-	TDirectThreadParam iThreadParam;
-	RSemaphore iSem;
-	};
-
-/*CPanicDirect*/
- class CPanicDirect : public CBase
- 	{
- public:
-	static TInt DoTestOnNewScheduler(TInt aInt, TAny* aPtr);
-	static TInt DoTestOnNewSchedulerL(TInt aInt, TAny* aPtr);
- private:
- 	inline CPanicDirect() {}
- 	~CPanicDirect();
- 	void ConstructL(TInt aScreenNumber, TInt aInt);
-	static void DoTestNowL(TInt aInt, TAny* aPtr);
- 	void TestL();
- 	void DoDrawingL();
-private:
-	TInt iTestNo;
-	RWsSession iWs;
-	CWsScreenDevice* iWsScrDev;
-	RWindowGroup iGroup;
-	RBlankWindow iBlankWin;
-	RDirectScreenAccess iDirect;
-	TRequestStatus iDirectStatus;
-	RRegion* iRegion;
-	RTimer iTimer;
-	TRequestStatus iTimerStatus;
-	TBool iDrawingAllowed;
-	CFbsScreenDevice* iScreenDevice;
-	CFbsBitGc* iGc;
-	TDisplayMode iDisplayMode;
-	CScrollingTextDrawer* iTextDraw;
-	TInt iCount;
-	TInt iScreenNumber;
-	};
-
-class CTDirectStep : public CTGraphicsStep
-	{
-public:
-	CTDirectStep();
-protected:
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTDirectStep,"TDirect");
-
-
-#endif
--- a/windowing/windowserver/tauto/tdirecta2.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,185 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test Direct Screen Access on a screen that supports transparency
-// 
-//
-
-#include "tdirecta2.h"
-
-const TInt KMainTestOrdinalPriority=65535;
-const TInt KOntopOfAllOthersTestOrdinalPriority=65537;
-
-CTDirect2::CTDirect2(CTestStep* aStep):
-	CTWsGraphicsBase(aStep)
-	{
-	}
-
-CTDirect2::~CTDirect2()
-	{
-	delete iDsa;
-	delete iUnderWindow;
-	delete iOverWindow;
-	delete iScreenDevice;
-	delete iWindowGroup;
-	delete iTimer;
-
-	// put focus back to current screen as this test changed the focus screen to primary screen
-	TheClient->iWs.SetFocusScreen(iTest->iScreenNumber);
-	}
-
-void CTDirect2::ConstructL()
-	{
-	// the following line makes sure that a console object hidden outside of
-	// screens range doesn't affect test results being on top of tested objects
-	TheClient->iGroup->GroupWin()->SetOrdinalPosition(0, KMainTestOrdinalPriority);
-	}
-
-TInt CTDirect2::Timeout(TAny* aDirect2)
-	{
-	static_cast<CTDirect2*>(aDirect2)->HandleTimeout();
-	return KErrNone;
-	}
-
-void CTDirect2::HandleTimeout()
-	{
-	// Send window group to back to avoid possibility of it
-	// interfering with other parts of this test
-	iWindowGroup->GroupWin()->SetOrdinalPosition(0, -1);
-
-	iTimer->Cancel(); // Don't call back again
-	TEST(EFalse); // Fail the test, as we didn't get a DSA abort within timeout period
-	iTestCaseComplete = ETrue; // Move to next test case
-	}
-
-void CTDirect2::AbortNow(RDirectScreenAccess::TTerminationReasons /*aReason*/)
-	{
-	iTimer->Cancel(); // As soon as abort is received, we don't need the timer anymore
-	}
-
-void CTDirect2::Restart(RDirectScreenAccess::TTerminationReasons /*aReason*/)
-	{
-	// Send window group to back to avoid possibility of it
-	// interfering with other tests
-	iWindowGroup->GroupWin()->SetOrdinalPosition(0, -1);
-
-	iTestCaseComplete = ETrue; // Move to next test case
-
-	// Don't bother restarting DSA, we were only interested in making sure the abort was sent by wserv
-	}
-
-// Starts DSA on a topmost window, then puts a translucent window ontop of it
-// to make sure wserv sends a DSA Abort even though the translucent window
-// hasn't changed the visible area of the DSA window
-void CTDirect2::StartTranslucentWindowOverDsaL()
-	{
-	// Use a new window group so we can put windows ontop of all others
-	iWindowGroup = new(ELeave) CTWindowGroup(TheClient);
-	iWindowGroup->ConstructL();
-
-	// Create new blank window
-	iUnderWindow = new(ELeave) CTBlankWindow();
-	iUnderWindow->SetUpL(TPoint(10,10), TSize(100,100), iWindowGroup, *TheClient->iGc);
-	iUnderWindow->SetColor(TRgb(0,192,0));
-
-	// Make window group visible ontop of all others
-	User::LeaveIfError(iWindowGroup->GroupWin()->SetOrdinalPositionErr(0, KOntopOfAllOthersTestOrdinalPriority));
-	TheClient->Flush();
-
-	// Call Finish() to wait until under window has been rendered.
-	// Once window has been rendered, we can be sure window server has
-	// calculated the "top visible" region of the window.
-	TheClient->iWs.Finish();
-
-	// Start DSA on under window
-	iScreenDevice = new(ELeave) CWsScreenDevice(TheClient->iWs);
-	User::LeaveIfError(iScreenDevice->Construct(iTest->iScreenNumber));
-	iDsa = CDirectScreenAccess::NewL(TheClient->iWs, *iScreenDevice, *iUnderWindow->BaseWin(), *this);
-	iDsa->StartL();
-	
-	// Put translucent window ontop so as to reduce the top visible area, but leave the
-	// visible area unchanged (as the translucent window doesn't change the visible area
-	// of the window underneath it).
-	iOverWindow = new(ELeave) CTTitledWindow();
-	_LIT(KTranslucentWindowTitle, "Translucent window");
-	iOverWindow->SetUpL(TPoint(60,60), TSize(150,100), iWindowGroup, *TheClient->iGc, NULL, ETrue);
-	TWindowTitle windowTitle(KTranslucentWindowTitle);
-	iOverWindow->SetTitle(windowTitle);
-	iOverWindow->SetColor(TRgb(192, 0, 0, 128));
-	TheClient->Flush();
-
-	// Start a timer, if the timeout triggers, fail the test, as we should get
-	// an abort DSA from wserv within the timeout
-	iTimer = CPeriodic::NewL(CActive::EPriorityStandard);
-	const TInt KTimeoutPeriod = 5000000; // 5 seconds should give the client plenty of time to respond to the abort
-	iTimer->Start(KTimeoutPeriod, 0, TCallBack(CTDirect2::Timeout, this));
-
-	// Do nothing more here, once over win is rendered, wserv should cause CAbortTest::AbortNow
-	// to be called
-	}
-
-void CTDirect2::RunTestCaseL(TInt aCurTestCase)
-	{
-	((CTDirect2Step*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(aCurTestCase)
-		{
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0176
-
-@SYMDEF             PDEF116863
-
-@SYMTestCaseDesc    Overlapping a translucent window ontop of a DSA window should abort DSA 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Start DSA on a blank window.
-					Then place a translucent window so that it partially overlaps the DSA window.
-
-@SYMTestExpectedResults Wserv should send a DSA abort when the translucent window is placed ontop of the DSA window.
-*/
-	case 1:
-		((CTDirect2Step*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0176"));
-		if (!iOnceOnly)
-			{
-			_LIT(DSA1,"Translucent window overlaping DSA window");
-			INFO_PRINTF1(DSA1);
-			StartTranslucentWindowOverDsaL(); // call this only once
-			iOnceOnly = ETrue;
-			}
-		if (!iTestCaseComplete)
-			{
-			// Keep calling this test case until iTestCaseComplete is true
-			ResetCounter(aCurTestCase-1);
-			}
-		else
-			{
-			iOnceOnly = EFalse;
-			// Move to next test case in sequence
-			iTestCaseComplete = EFalse;
-			}	
-		break;
-
-	default:
-		INFO_PRINTF1(_L("Test complete\n"));
-		((CTDirect2Step*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-		((CTDirect2Step*)iStep)->CloseTMSGraphicsStep();
-		TestComplete();
-		break;
-		}
-	((CTDirect2Step*)iStep)->RecordTestResultL();
-	}
-
-__WS_CONSTRUCT_STEP__(Direct2)
-
--- a/windowing/windowserver/tauto/tdirecta2.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TDIRECTA2_H__
-#define __TDIRECTA2_H__
-
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-// This DSA test code only works when run using a screen that supports transparency.
-class CTDirect2 : public CTWsGraphicsBase, public MDirectScreenAccess
-	{
-public:
-	CTDirect2(CTestStep* aStep);
-	~CTDirect2();
-	void ConstructL();
-
-	static TInt Timeout(TAny* aAbortTest);
-
-	// from MAbortDirectScreenAccess
-	void AbortNow(RDirectScreenAccess::TTerminationReasons aReason);
-	// from MDirectScreenAccess
-	void Restart(RDirectScreenAccess::TTerminationReasons aReason);
-
-protected:
-	//from CTGraphicsStep
-	void RunTestCaseL(TInt aCurTestCase);
-
-private:
-	void StartTranslucentWindowOverDsaL();
-	void HandleTimeout();
-
-private:
-	CWsScreenDevice* iScreenDevice;
-	CTWindowGroup* iWindowGroup;
-	CTBlankWindow* iUnderWindow; // window to perform DSA on
-	CTTitledWindow* iOverWindow; // translucent window to overlap DSA window
-	CDirectScreenAccess* iDsa;
-	CPeriodic* iTimer;
-	TBool iTestCaseComplete;
-	TBool iOnceOnly;
-	};
-
-class CTDirect2Step : public CTGraphicsStep
-	{
-public:
-	CTDirect2Step();
-protected:
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTDirect2Step,"TDirect2");
-
-#endif
--- a/windowing/windowserver/tauto/tdrawresource.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1144 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "tdrawresource.h"
-#include <graphics/sgimage.h>
-#include <graphics/sgutils.h>
-#include <graphics/directgdidrawablesource.h>
-#include <graphics/sgresourceinternal.h>
-#include <graphics/wsdrawresource.h>
-
-
-__WS_CONSTRUCT_STEP__(DrawResource);
-
-
-#if defined(__X86GCC__)
-extern "C" TInt atexit(void (*function)(void))
-	{
-	return KErrNone;
-	}
-#endif
-
-//
-// class CTestWsGraphicsContext
-//
-CTestWsGraphicsContext* CTestWsGraphicsContext::NewL(RDirectGdiImageTarget& aTarget)
-	{
-	CTestWsGraphicsContext* self = new(ELeave) CTestWsGraphicsContext;
-	CleanupStack::PushL(self);
-	self->ConstructL(aTarget);
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-void CTestWsGraphicsContext::ConstructL(RDirectGdiImageTarget& aTarget)
-	{
-	CDirectGdiDriver* driver = CDirectGdiDriver::Static();
-	User::LeaveIfNull(driver);
-	iContext = CDirectGdiContext::NewL(*driver);
-	TInt err = iContext->Activate(aTarget);
-	User::LeaveIfError(err);
-	}
-
-CTestWsGraphicsContext::~CTestWsGraphicsContext()
-	{
-	delete iContext;
-	}
-
-TAny* CTestWsGraphicsContext::ResolveObjectInterface(TUint aTypeId)
-	{
-	switch(aTypeId)
-		{
-	case MWsDrawableSourceProvider::EWsObjectInterfaceId:
-		return static_cast<MWsDrawableSourceProvider*>(this);
-		}
-	return NULL;
-
-	}
-	
-TInt CTestWsGraphicsContext::CreateDrawableSource(const TSgDrawableId& aDrawableId, TAny*& aSource)
-	{
-	TRAPD(err, DoCreateDrawableSourceL(aDrawableId, aSource));
-	return err;
-	}
-
-void CTestWsGraphicsContext::DoCreateDrawableSourceL(const TSgDrawableId& aDrawableId, TAny*& aSource)
-	{
-	CDirectGdiDriver* driver = CDirectGdiDriver::Static();
-	if (!driver)
-		{
-		User::Leave(KErrNotReady);
-		}
-	RDirectGdiDrawableSource* drawableSource = new(ELeave) RDirectGdiDrawableSource(*driver);
-	CleanupStack::PushL(drawableSource);
-	RSgDrawable drawable;
-	User::LeaveIfError(drawable.Open(aDrawableId, ESgDoNotRestrictUsage));
-	CleanupClosePushL(drawable);
-	User::LeaveIfError(drawableSource->Create(drawable));
-	CleanupStack::PopAndDestroy();
-	CleanupStack::Pop(drawableSource);
-	aSource = drawableSource;
-	}
-
-void CTestWsGraphicsContext::CloseDrawableSource(TAny* aSource)
-	{
-	RDirectGdiDrawableSource* drawableSource = static_cast<RDirectGdiDrawableSource*>(aSource);
-	drawableSource->Close();
-	delete drawableSource;
-	}
-
-void CTestWsGraphicsContext::DrawResource(const TAny* aSource, const TPoint& aPos, CWindowGc::TGraphicsRotation aRotation)
-	{
-	const RDirectGdiDrawableSource* drawableSource = static_cast<const RDirectGdiDrawableSource*>(aSource);
-	iContext->DrawResource(aPos, *drawableSource, (DirectGdi::TGraphicsRotation)aRotation);
-	iPos = aPos;
-	iRotation = (DirectGdi::TGraphicsRotation)aRotation;
-	}
-
-void CTestWsGraphicsContext::DrawResource(const TAny* aSource, const TRect& aRect, CWindowGc::TGraphicsRotation aRotation)
-	{
-	const RDirectGdiDrawableSource* drawableSource = static_cast<const RDirectGdiDrawableSource*>(aSource);
-	iContext->DrawResource(aRect, *drawableSource, (DirectGdi::TGraphicsRotation)aRotation);
-	iDestRect = aRect;
-	iRotation = (DirectGdi::TGraphicsRotation)aRotation;
-	}
-
-void CTestWsGraphicsContext::DrawResource(const TAny* aSource, const TRect& aRectDest, const TRect& aRectSrc, CWindowGc::TGraphicsRotation aRotation)
-	{
-	const RDirectGdiDrawableSource* drawableSource = static_cast<const RDirectGdiDrawableSource*>(aSource);
-	iContext->DrawResource(aRectDest, *drawableSource, aRectSrc, (DirectGdi::TGraphicsRotation)aRotation);
-	iDestRect = aRectDest;
-	iSrcRect = aRectSrc;
-	iRotation = (DirectGdi::TGraphicsRotation)aRotation;
-	}
-
-void CTestWsGraphicsContext::DrawResource(const TAny* aSource, const TRect& aRect, const TDesC8& aParam)
-	{
-	const RDirectGdiDrawableSource* drawableSource = static_cast<const RDirectGdiDrawableSource*>(aSource);
-	iContext->DrawResource(aRect, *drawableSource, aParam);
-	iDestRect = aRect;
-	}
-
-
-void CTestWsGraphicsContext::Clear()
-	{
-	iContext->Clear();
-	}
-
-//
-// class CTDrawResource
-//
-
-CTDrawResource::CTDrawResource(CTestStep* aStep)
-	: CTWsGraphicsBase(aStep)
-	{
-	}
-
-CTDrawResource::~CTDrawResource()
-	{
-	iWindow.Close();
-	delete iRefBitmap;
-	delete iRotatedRefBitmap;
-	delete iScaledBitmap;
-	delete iScaledCroppedBitmap;
-	delete iCopyBitmap;
-	delete iBitmapWrongScreenNumber;
-
-	delete iWsGrapicResolver;
-	delete iGraphicsCon;
-
-	iWsDrawableSource.Close();
-	iImage.Close();
-	iImageTarget.Close();
-	iImageCollection.Close();
-
-	CDirectGdiDriver* dGdiDriver = CDirectGdiDriver::Static();
-	if(dGdiDriver)
-		{
-		dGdiDriver->Close();
-		}
-	SgDriver::Close();
-	}
-
-void CTDrawResource::ConstructL()
-	{
-	//Constrcut and setup window to be drawn to
-	iWindow = RWindow(TheClient->iWs);
-    User::LeaveIfError(iWindow.Construct(*TheClient->iGroup->GroupWin(),ENullWsHandle));
-    TSize iWinSize=TSize(TheClient->iScreen->SizeInPixels());
-    iWindow.SetExtent(TPoint(0,0),iWinSize);
-	iWindow.Activate();
-	iWindow.BeginRedraw();
-	iWindow.EndRedraw();
-	
-	//Creates all reference and copy bitmaps required for all tests
-	CreateReferenceAndCopyBitmapsL();
-
-	TInt err = CDirectGdiDriver::Open();
-	User::LeaveIfError(err);
-	err = SgDriver::Open();
-	User::LeaveIfError(err);
-	
-	//create image target
-	CDirectGdiDriver* theDGdiDriver = CDirectGdiDriver::Static();
-	if(!theDGdiDriver)
-		{
-		User::Leave(KErrNotReady);
-		}
-	TSgImageInfo info;
-	info.iUsage = ESgUsageDirectGdiTarget | ESgUsageDirectGdiSource | ESgUsageCompositionSource;
-	info.iPixelFormat = EUidPixelFormatRGB_565;
-	info.iSizeInPixels = TSize(200, 200);
-	info.iShareable = ETrue;
-	const TInt KImageCount = 1;
-	err = iImageCollection.Create(info, KImageCount);
-	User::LeaveIfError(err);
-	
-	err = iImageCollection.OpenImage(0, iImage);
-	User::LeaveIfError(err);
-	iImageTarget = RDirectGdiImageTarget(*theDGdiDriver);
-	err = iImageTarget.Create(iImage);
-	User::LeaveIfError(err);
-	
-	// construction of image source
-	RSgImage sgImage;
-	CreateSgImageFromBitmapL(sgImage);
-	CleanupClosePushL(sgImage);
-	iWsDrawableSource = RWsDrawableSource(TheClient->iWs);
-	User::LeaveIfError(iWsDrawableSource.Create(sgImage, TheClient->iScreen->GetScreenNumber()));
-	
-    //Create dummy MWsGraphicResolver - required RemoteGc testing
-	iWsGrapicResolver = new (ELeave) CWSGraphicsRes();
-	
-	//Create dummy MWsGraphicsContext - required RemoteGc testing
-	iGraphicsCon =  CTestWsGraphicsContext::NewL(iImageTarget);
-	
-	CleanupStack::PopAndDestroy(&sgImage);
-	}
-
-void CTDrawResource::RunTestCaseL(TInt aCurTestCase)
-	{	
-	((CTDrawResourceStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(aCurTestCase)
-		{
-	case 1:		
-		((CTDrawResourceStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-DRAWRESOURCE-0001"));
-		INFO_PRINTF1(_L("DrawResourcePos Test"));		
-		TestDrawResourcePos();
-		break;
-	case 2:
-		((CTDrawResourceStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-DRAWRESOURCE-0002"));
-		INFO_PRINTF1(_L("DrawResourceRect Test"));	
-		TestDrawResourceRect();
-		break;
-	case 3:
-		((CTDrawResourceStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-DRAWRESOURCE-0003"));
-		INFO_PRINTF1(_L("DrawResourceScale Test"));		
-		TestDrawResourceScale();
-		break;
-	case 4:
-		((CTDrawResourceStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-DRAWRESOURCE-0004"));
-		INFO_PRINTF1(_L("RWsDrawableSource Reference Counting Test"));		
-		TestRWsDrawableSourceReferenceCountingL();
-		break;	
-	case 5:
-		((CTDrawResourceStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-DRAWRESOURCE-0005"));
-		INFO_PRINTF1(_L("RemoteGcDrawResourcePos Test"));	
-		TestRemoteGcDrawResourcePosL();
-		break;
-	case 6:
-		((CTDrawResourceStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-DRAWRESOURCE-0006"));
-		INFO_PRINTF1(_L("RemoteGcDrawResourceRect Test"));	
-		TestRemoteGcDrawResourceRectL();
-		break;
-	case 7:
-		((CTDrawResourceStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-DRAWRESOURCE-0007"));
-		INFO_PRINTF1(_L("RemoteGcDrawResourceScale Test"));	
-		TestRemoteGcDrawResourceScaleL();
-		break;
-	case 8:
-		((CTDrawResourceStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-DRAWRESOURCE-0008"));
-		INFO_PRINTF1(_L("DrawResourceScreens Test"));	
-		TestDrawResourceScreensL();
-		break;
-	case 9:
-		((CTDrawResourceStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-TestCopyScreenToBitmapWithDifferentDisplayModes-0001"));
-		INFO_PRINTF1(_L("CopyScreenToBitmapWithDifferentDisplayModes Test\n"));
-		TestCopyScreenToBitmapWithDifferentDisplayModesL();
-		break;
-	case 10:
-		((CTDrawResourceStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-		((CTDrawResourceStep*)iStep)->CloseTMSGraphicsStep();
-		INFO_PRINTF1(_L("Test complete\n"));
-		TestComplete();
-		break;
-		}
-	((CTDrawResourceStep*)iStep)->RecordTestResultL();
-	}
-
-/**
-@SYMTestCaseID           GRAPHICS-WSERV-DRAWRESOURCE-0001
-@SYMPREQ                 PREQ2095
-@SYMTestPriority         High
-@SYMTestCaseDesc         Draw RSgImage using DrawResource(const TPoint&, const RWsDrawableSource&, TGraphicsRotation)
-@SYMTestActions          Draw to position (0,0) with default rotation (none)
-						 Draw to position (10,10) with 90 degrees rotation 
-@SYMTestExpectedResults  Drawn images should match reference CFbsBitmap
-*/
-void CTDrawResource::TestDrawResourcePos()
-	{
-	// Draw to TPoint(0,0) with EGraphicsRotationNone
-	iWindow.BeginRedraw();
-	TheGc->Activate(iWindow);
-	TheGc->Clear();
-	MWsDrawResource* dr = static_cast<MWsDrawResource*>(TheGc->Interface(KMWsDrawResourceInterfaceUid));
-	TEST(dr != NULL);
-	dr->DrawResource(KDestPoint, iWsDrawableSource, CWindowGc::EGraphicsRotationNone);
-	TheGc->Deactivate();
-	iWindow.EndRedraw();
-	TheClient->iWs.Finish();  
-	TheClient->WaitForRedrawsToFinish();
-
-	//Copy the screen to the copy bitmap
-	TheClient->iScreen->CopyScreenToBitmap(iCopyBitmap, KCopyTestRect);
-
-	//Compare the bitmaps
-	INFO_PRINTF1(_L("Draw to TPoint(0,0) with EGraphicsRotationNone"));
-	TBool compRes = CompareBitmapsByPixel(iCopyBitmap, iRefBitmap);
-	TEST(compRes);
-
-	/*** Draw to position (10,10) with 90 degrees rotation ***/
-	TPoint const KDestPoint2(10,10);
-	iWindow.BeginRedraw();
-	TheGc->Activate(iWindow);
-    TheGc->Clear();
-	dr->DrawResource(KDestPoint2, iWsDrawableSource, KTestRotation);
-    TheGc->Deactivate();
-	iWindow.EndRedraw();
-	TheClient->iWs.Finish(); 
-	TheClient->WaitForRedrawsToFinish();
-
-	//Copy the screen to the copy bitmap
-	TheClient->iScreen->CopyScreenToBitmap(iCopyBitmap, TRect(KDestPoint2, KSourceSize));
-
-	//Compare the bitmaps
-	INFO_PRINTF1(_L("Draw to position (10,10) with 90 degrees rotation"));
-	compRes = CompareBitmapsByPixel(iCopyBitmap, iRotatedRefBitmap);
-	TEST(compRes);
-	}
-
-/**
-@SYMTestCaseID           GRAPHICS-WSERV-DRAWRESOURCE-0002
-@SYMPREQ                 PREQ2095
-@SYMTestPriority         High
-@SYMTestCaseDesc         Draw RSgImage using DrawResource(const TRect& , const RWsDrawableSource&, TGraphicsRotation aRotation)
-@SYMTestActions          Draw to rect pos (10,10), rect size (60,60) with 90 degrees rotation
-@SYMTestExpectedResults  Drawn images should match the reference CFbsBitmap
-*/
-void CTDrawResource::TestDrawResourceRect()
-	{
-	//Use DrawResource
-	iWindow.BeginRedraw();
-	TheGc->Activate(iWindow);
-	TheGc->Clear();
-	MWsDrawResource* dr = static_cast<MWsDrawResource*>(TheGc->Interface(KMWsDrawResourceInterfaceUid));
-	TEST(dr != NULL);
-	dr->DrawResource(KDestRect, iWsDrawableSource, KTestRotation);
-	TheGc->Deactivate();
-	iWindow.EndRedraw();
-	TheClient->iWs.Finish();  
-	TheClient->WaitForRedrawsToFinish();
-
-	//Copy the screen to the copy bitmap
-	TheClient->iScreen->CopyScreenToBitmap(iCopyBitmap, KCopyTestRect);
-
-	//Compare the bitmaps
-	INFO_PRINTF1(_L("Draw to rect pos (10,10), rect size (60,60) with 90 degrees rotation"));
-	TInt compRes = CompareBitmapsByPixel(iCopyBitmap, iScaledBitmap);
-	TEST(compRes);
-	}
-
-/**
-@SYMTestCaseID           GRAPHICS-WSERV-DRAWRESOURCE-0003
-@SYMPREQ                 PREQ2095
-@SYMTestPriority         High
-@SYMTestCaseDesc         Draw RSgImage using DrawResource(const TRect& , const RWsDrawableSource&, const TRect&, TGraphicsRotation aRotation)
-@SYMTestActions          Draw the part of the source image (rect Pos (0,0), rect size(50,50))
-						 to rect pos(10,10), rect size(60,60) and and 90 degrees rotation
-@SYMTestExpectedResults  Drawn images should match the reference CFbsBitmap
-*/
-void CTDrawResource::TestDrawResourceScale()
-	{
-	//Use DrawResource
-	iWindow.BeginRedraw();
-	TheGc->Activate(iWindow);
-	TheGc->Clear();
-	MWsDrawResource* dr = static_cast<MWsDrawResource*>(TheGc->Interface(KMWsDrawResourceInterfaceUid));
-	TEST(dr != NULL);
-	dr->DrawResource(KDestRect, iWsDrawableSource, KSourceRect, KTestRotation);
-	TheGc->Deactivate();
-	iWindow.EndRedraw();
-	TheClient->iWs.Finish();  
-	TheClient->WaitForRedrawsToFinish();
-
-	//Copy the screen to the copy bitmap
-	TheClient->iScreen->CopyScreenToBitmap(iCopyBitmap, KCopyTestRect);
-
-	//Compare the bitmaps
-	INFO_PRINTF1(_L("Draw the part of the source image to rect pos(10,10), rect size(60,60) and and 90 degrees rotation"));
-	TInt compRes = CompareBitmapsByPixel(iCopyBitmap, iScaledCroppedBitmap);
-	TEST(compRes);
-	}
-
-/**
-@SYMTestCaseID           GRAPHICS-WSERV-DRAWRESOURCE-0004
-@SYMPREQ                 PREQ2095
-@SYMTestPriority         High
-@SYMTestCaseDesc         Draw RSgImage using DrawResource(const TPoint&, const RWsDrawableSource&, TGraphicsRotation) after closing the image source
-@SYMTestActions          Draw to position (0,0) with default rotation (none) after closing the image source
-@SYMTestExpectedResults  Drawn image should match reference CFbsBitmap
-*/
-void CTDrawResource::TestRWsDrawableSourceReferenceCountingL()
-	{	
-	// construction of image source
-	RSgImage sgImage;
-	CreateSgImageFromBitmapL(sgImage);
-	CleanupClosePushL(sgImage);
-	RWsDrawableSource drawableSource(TheClient->iWs);
-	CleanupClosePushL(drawableSource);
-	User::LeaveIfError(drawableSource.Create(sgImage, TheClient->iScreen->GetScreenNumber())); 
-
-	//Draw using DrawResource
-	iWindow.BeginRedraw();
-	TheGc->Activate(iWindow);
-	TheGc->Clear();
-	MWsDrawResource* dr = static_cast<MWsDrawResource*>(TheGc->Interface(KMWsDrawResourceInterfaceUid));
-	TEST(dr != NULL);
-	dr->DrawResource(KDestPoint, drawableSource, CWindowGc::EGraphicsRotationNone);
-	TheGc->Deactivate();
-	iWindow.EndRedraw();
-
-	//Close the image source but this should not stop the source from being drawn 
-	drawableSource.Close();
-	TheClient->iWs.Finish();
-	TheClient->WaitForRedrawsToFinish();
-
-	//Copy the screen to the copy bitmap
-	TheClient->iScreen->CopyScreenToBitmap(iCopyBitmap, KCopyTestRect);
-
-	//Compare the bitmaps
-	INFO_PRINTF1(_L("Draw to TPoint(0,0) with EGraphicsRotationNone"));
-	TBool compRes = CompareBitmapsByPixel(iCopyBitmap, iRefBitmap);
-	TEST(compRes);
-
-	CleanupStack::PopAndDestroy(2, &sgImage);
-	}
-
-/**
-@SYMTestCaseID           GRAPHICS-WSERV-DRAWRESOURCE-0005
-@SYMPREQ                 PREQ2095
-@SYMTestPriority         High
-@SYMTestCaseDesc         Draw RSgImage using RemotGc->DrawResource(const TPoint&, const RWsDrawableSource&, TGraphicsRotation)
-@SYMTestActions          Record the draw resource commands using CRemoteGc and play the recorded commands on a window using
- 						 Play(const TPoint&, const TRect&, RWsSession&, CWindowGc&) and then play the recorded commands using . 
-						 Play(const TPoint&, const TRect&, const MWsGraphicResolver&, MWsGraphicsContext&).
-@SYMTestExpectedResults  Drawn images should match reference CFbsBitmap and also values received by MWsGraphicsContext should 
- 						 match what was originally sent to DrawResource.
-*/
-void CTDrawResource::TestRemoteGcDrawResourcePosL()
-	{
-	const TRect KRemotGcSourceRect(0, 0, iWindow.Size().iWidth, iWindow.Size().iHeight);
-	const TRegionFix<1> KClippingRegion(KRemotGcSourceRect);
-	CWindowGc::TGraphicsRotation testRotation= CWindowGc::EGraphicsRotationNone;
-	
-	//Create remote gc - required RemoteGc testing
-	CRemoteGc* remoteGc = CRemoteGc::NewL(TheClient->iScreen);
-	CleanupStack::PushL(remoteGc);
-
-	//Record draw messages
-	remoteGc->ResetCommandBuffer();
-	remoteGc->BeginDraw(KRemotGcSourceRect);
-	MWsDrawResource* dr = static_cast<MWsDrawResource*>(remoteGc->Interface(KMWsDrawResourceInterfaceUid));
-	TEST(dr != NULL);
-	dr->DrawResource(KDestPoint, iWsDrawableSource, CWindowGc::EGraphicsRotationNone);
-	remoteGc->EndDraw();
-	
-	RWsGraphicMsgBuf msgBuf;
-	CleanupClosePushL(msgBuf);
-	//Externalize the captured commands from remote gc in to a buffer
-	remoteGc->ExternalizeL(msgBuf, ETrue);
-	//Create command buffer - required RemoteGc testing
-	CCommandBuffer* cmdBuffer = CCommandBuffer::NewL();
-	CleanupStack::PushL(cmdBuffer);
-	//Internalize the buffer with captured commands (from CRemoteGC) in to CCommandBuffer
-	cmdBuffer->InternalizeL(msgBuf.Pckg());
-
-	// Play stored commands using Play(const TPoint&, const TRect&, RWsSession&, CWindowGc&) 
-	remoteGc->ResetCommandBuffer();
-	iWindow.Invalidate();
-	iWindow.BeginRedraw();
-	TheGc->Activate(iWindow);
-	TheGc->Clear();
-	cmdBuffer->Play(KPlayOffset, &KClippingRegion, KRemotGcSourceRect, TheClient->iWs, *TheGc);
-	TheGc->Deactivate();
-	iWindow.EndRedraw();
-	TheClient->iWs.Finish();
-	TheClient->WaitForRedrawsToFinish();
-
-	//Copy the screen to the copy bitmap
-	TheClient->iScreen->CopyScreenToBitmap(iCopyBitmap, KCopyTestRect);
-
-	//Compare the bitmaps
-	INFO_PRINTF1(_L("Using Play(const TPoint&, const TRect&, RWsSession&, CWindowGc&)"));
-	TBool compRes = CompareBitmapsByPixel(iCopyBitmap, iRefBitmap);
-	TEST(compRes);
-
-	// Play stored commands using Play(const TPoint&, const TRect&, const MWsGraphicResolver&, MWsGraphicsContext&) 
-	remoteGc->ResetCommandBuffer();
-	iWindow.Invalidate();
-	iWindow.BeginRedraw();
-	TheGc->Activate(iWindow);
-	TheGc->Clear();
-	cmdBuffer->Play(KPlayOffset,&KClippingRegion,KRemotGcSourceRect,*iWsGrapicResolver,*iGraphicsCon);
-	TheGc->Deactivate();
-	iWindow.EndRedraw();
-	TheClient->iWs.Finish();
-
-	//Compare the values received by CTestWsGraphicsContext and the values sent to it
-	INFO_PRINTF1(_L("Using Play(const TPoint&, const TRect&, const MWsGraphicResolver&, MWsGraphicsContext&)"));
-	TBool valuesSame = EFalse;
-	CFbsBitmap* bmp;
-	BitmapLC(bmp);
-	compRes = CompareBitmapsByPixel(bmp, iRefBitmap);
-	CleanupStack::PopAndDestroy(bmp);
-
-	if((iGraphicsCon->iPos == KDestPoint) && (compRes)
-									&& (reinterpret_cast<TInt&>(iGraphicsCon->iRotation)==reinterpret_cast<TInt&>(testRotation)))
-		valuesSame = ETrue;
-	TEST(valuesSame);
-	CleanupStack::PopAndDestroy(3, remoteGc);
-	}
-
-/**
-@SYMTestCaseID           GRAPHICS-WSERV-DRAWRESOURCE-0006
-@SYMPREQ                 PREQ2095
-@SYMTestPriority         High
-@SYMTestCaseDesc         Draw RSgImage using RemotGc->DrawResource(const TRect&, const RWsDrawableSource&, TGraphicsRotation)
-@SYMTestActions          Record the draw resource commands using CRemoteGc and play the recorded commands on a window using
- 						 Play(const TPoint&, const TRect&, RWsSession&, CWindowGc&) and then play the recorded commands using . 
-						 Play(const TPoint&, const TRect&, const MWsGraphicResolver&, MWsGraphicsContext&).
-@SYMTestExpectedResults  Drawn images should match reference CFbsBitmap and also values received by MWsGraphicsContext should 
- 						 match what was originally sent to DrawResource.
-*/
-void CTDrawResource::TestRemoteGcDrawResourceRectL()
-	{
-	const TRect KRemotGcSourceRect(0, 0, iWindow.Size().iWidth, iWindow.Size().iHeight);
-	const TRegionFix<1> KClippingRegion(KRemotGcSourceRect);
-	
-	//Create remote gc - required RemoteGc testing
-	CRemoteGc* remoteGc = CRemoteGc::NewL(TheClient->iScreen);
-	CleanupStack::PushL(remoteGc);
-
-	//Record draw messages
-	remoteGc->BeginDraw(KRemotGcSourceRect);
-	MWsDrawResource* dr = static_cast<MWsDrawResource*>(remoteGc->Interface(KMWsDrawResourceInterfaceUid));
-	TEST(dr != NULL);
-	dr->DrawResource(KDestRect, iWsDrawableSource, KTestRotation);
-	remoteGc->EndDraw();
-	
-	RWsGraphicMsgBuf msgBuf;
-	CleanupClosePushL(msgBuf);
-	//Externalize the captured commands from remote gc in to a buffer
-	remoteGc->ExternalizeL(msgBuf, ETrue);
-
-	//Create command buffer - required RemoteGc testing
-	CCommandBuffer* cmdBuffer = CCommandBuffer::NewL();
-	CleanupStack::PushL(cmdBuffer);
-	//Internalize the buffer with captured commands (from CRemoteGC) in to CCommandBuffer
-	cmdBuffer->InternalizeL(msgBuf.Pckg());
-
-	// Play stored commands using Play(const TRect&, const TRect&, RWsSession&, CWindowGc&)
-	iWindow.Invalidate();
-	iWindow.BeginRedraw();
-	TheGc->Activate(iWindow);
-	TheGc->Clear();
-	cmdBuffer->Play(KPlayOffset, &KClippingRegion, KRemotGcSourceRect, TheClient->iWs, *TheGc);
-	TheGc->Deactivate();
-	iWindow.EndRedraw();
-	TheClient->iWs.Finish();
-	TheClient->WaitForRedrawsToFinish();
-
-	//Copy the screen to the copy bitmap
-	TheClient->iScreen->CopyScreenToBitmap(iCopyBitmap, KCopyTestRect);
-
-	//Compare the bitmaps
-	INFO_PRINTF1(_L("Using Play(const TPoint&, const TRect&, RWsSession&, CWindowGc&)"));
-	TBool compRes = CompareBitmapsByPixel(iCopyBitmap, iScaledBitmap);
-	TEST(compRes);
-
-	// Play stored commands using Play(const TPoint&, const TRect&, const MWsGraphicResolver&, MWsGraphicsContext&) 
-	iWindow.Invalidate();
-	iWindow.BeginRedraw();
-	TheGc->Activate(iWindow);
-	TheGc->Clear();
-	iGraphicsCon->Clear();
-	cmdBuffer->Play(KPlayOffset,&KClippingRegion,KRemotGcSourceRect,*iWsGrapicResolver,*iGraphicsCon);
-	TheGc->Deactivate();
-	iWindow.EndRedraw();
-	TheClient->iWs.Finish();
-	TheClient->WaitForRedrawsToFinish();
-
-	//Compare the values received by CTestWsGraphicsContext and the values sent to it
-	INFO_PRINTF1(_L("Using Play(const TPoint&, const TRect&, const MWsGraphicResolver&, MWsGraphicsContext&)"));
-	TBool valuesSame = EFalse;
-
-	CFbsBitmap* bmp;
-	BitmapLC(bmp);
-	compRes = CompareBitmapsByPixel(bmp, iScaledBitmap);
-	CleanupStack::PopAndDestroy(bmp);
-
-	if((iGraphicsCon->iDestRect == KDestRect) && (compRes)
-								&& (reinterpret_cast<TInt&>(iGraphicsCon->iRotation)==reinterpret_cast<const TInt&>(KTestRotation)))
-		valuesSame = ETrue;
-	TEST(valuesSame);
-	CleanupStack::PopAndDestroy(3, remoteGc);
-	}
-
-/**
-@SYMTestCaseID           GRAPHICS-WSERV-DRAWRESOURCE-0007
-@SYMPREQ                 PREQ2095
-@SYMTestPriority         High
-@SYMTestCaseDesc         Draw RSgImage using RemotGc->DrawResource(const TRect&, const RWsDrawableSource&, const TRect&, TGraphicsRotation)
-@SYMTestActions          Record the draw resource commands using CRemoteGc and play the recorded commands on a window using
- 						 Play(const TPoint&, const TRect&, RWsSession&, CWindowGc&) and then play the recorded commands using . 
-						 Play(const TPoint&, const TRect&, const MWsGraphicResolver&, MWsGraphicsContext&).
-@SYMTestExpectedResults  Drawn images should match reference CFbsBitmap and also values received by MWsGraphicsContext should 
- 						 match what was originally sent to DrawResource.
-*/
-void CTDrawResource::TestRemoteGcDrawResourceScaleL()
-	{
-	const TRect KRemotGcSourceRect(0, 0, iWindow.Size().iWidth, iWindow.Size().iHeight);
-	const TRegionFix<1> KClippingRegion(KRemotGcSourceRect);
-	
-	//Create remote gc - required RemoteGc testing
-	CRemoteGc* remoteGc = CRemoteGc::NewL(TheClient->iScreen);
-	CleanupStack::PushL(remoteGc);
-
-	//Record draw messages
-	remoteGc->BeginDraw(KRemotGcSourceRect);
-	MWsDrawResource* dr = static_cast<MWsDrawResource*>(remoteGc->Interface(KMWsDrawResourceInterfaceUid));
-	TEST(dr != NULL);
-	dr->DrawResource(KDestRect, iWsDrawableSource, KSourceRect, KTestRotation);
-	remoteGc->EndDraw();
-	
-	RWsGraphicMsgBuf msgBuf;
-	CleanupClosePushL(msgBuf);
-	//Externalize the captured commands from remote gc in to a buffer
-	remoteGc->ExternalizeL(msgBuf, ETrue);
-
-	//Create command buffer - required RemoteGc testing
-	CCommandBuffer* cmdBuffer = CCommandBuffer::NewL();
-	CleanupStack::PushL(cmdBuffer);
-	//Internalize the buffer with captured commands (from CRemoteGC) in to CCommandBuffer
-	cmdBuffer->InternalizeL(msgBuf.Pckg());
-
-	// Play the stored commands using Play(const TRect&, const TRect&, RWsSession&, CWindowGc&)
-	remoteGc->ResetCommandBuffer();
-	iWindow.Invalidate();
-	iWindow.BeginRedraw();
-	TheGc->Activate(iWindow);
-	TheGc->Clear();
-	cmdBuffer->Play(KPlayOffset, &KClippingRegion, KRemotGcSourceRect, TheClient->iWs, *TheGc);
-	TheGc->Deactivate();
-	iWindow.EndRedraw();
-	TheClient->iWs.Finish();
-	TheClient->WaitForRedrawsToFinish();
-	//Copy the screen to the copy bitmap
-	TheClient->iScreen->CopyScreenToBitmap(iCopyBitmap, KCopyTestRect);
-
-	//Compare the bitmaps
-	INFO_PRINTF1(_L("Using Play(const TPoint&, const TRect&, RWsSession&, CWindowGc&)"));
-	TBool compRes = CompareBitmapsByPixel(iCopyBitmap, iScaledCroppedBitmap);
-	TEST(compRes);
-
-	// Play the stored commands using Play(const TPoint&, const TRect&, const MWsGraphicResolver&, MWsGraphicsContext&) 	
-	iWindow.Invalidate();
-	iWindow.BeginRedraw();
-	TheGc->Activate(iWindow);
-	TheGc->Clear();
-	iGraphicsCon->Clear();
-	cmdBuffer->Play(KPlayOffset,&KClippingRegion,KRemotGcSourceRect,*iWsGrapicResolver,*iGraphicsCon);
-	TheGc->Deactivate();
-	iWindow.EndRedraw();
-	TheClient->iWs.Finish();
-	TheClient->WaitForRedrawsToFinish();
-
-	//Compare the values received by CTestWsGraphicsContext and the values sent to it
-	INFO_PRINTF1(_L("Using Play(const TPoint&, const TRect&, const MWsGraphicResolver&, MWsGraphicsContext&)"));
-	TBool valuesSame = EFalse;
-
-	CFbsBitmap* bmp;
-	BitmapLC(bmp);
-	compRes = CompareBitmapsByPixel(bmp, iScaledCroppedBitmap);
-	CleanupStack::PopAndDestroy(bmp);
-
-	if((iGraphicsCon->iDestRect == KDestRect) && (compRes) && (iGraphicsCon->iSrcRect == KSourceRect)
-								&& (reinterpret_cast<TInt&>(iGraphicsCon->iRotation)==reinterpret_cast<const TInt&>(KTestRotation)))
-		valuesSame = ETrue;
-	TEST(valuesSame);
-	CleanupStack::PopAndDestroy(3, remoteGc);
-	}
-
-/**
-@SYMTestCaseID          GRAPHICS-WSERV-DRAWRESOURCE-0008
-@SYMPREQ                PREQ2095
-@SYMTestPriority        High
-@SYMTestCaseDesc        Negative testing. Draw graphics recourses which associated with different screens.
-@SYMTestActions         Open RWsDrawableSource associated with the screen which doesn’ exist.  
-						Open RWsDrawableSource associated with the screen which exists but differes from drawing target.
-						Draw Rectangle and Resource to the screen via CWindowGc
-						Draw Rectangle and Resource to the screen via CRemoteGc
-@SYMTestExpectedResults  Opening drawable resource on the screen which doesn’t exist must fail with error code KErrArgument 
-						Drawing primitives will result only rectangles be drawn as drawable recourses get associated with different screen
-*/
-void CTDrawResource::TestDrawResourceScreensL()
-	{
-	TInt numOfScreens = TheClient->iWs.NumberOfScreens();
-	if(numOfScreens < 2)
-		{
-		INFO_PRINTF2(_L("This test case will be running if the number of available screens more than 1, current number is %d"), numOfScreens);
-		return;
-		}
-	TInt screenNumber = TheClient->iScreen->GetScreenNumber();
-	TInt differentScreen = (screenNumber == 0) ? 1 : 0;
-
-	RSgImage sgImage;
-	CreateSgImageFromBitmapL(sgImage);
-	CleanupClosePushL(sgImage);
-
-	RWsDrawableSource drawableSource(TheClient->iWs);
-	TInt res = drawableSource.Create(sgImage, differentScreen + 200); //wrong screen number
-	TEST(res == KErrArgument);
-
-	res = drawableSource.Create(iImage, differentScreen);
-	TEST(res == KErrNotSupported); //in order to succeed the image must be created with flag usage ESgUsageWindowGcSource
-	
-	TSgImageInfo info; 
-	User::LeaveIfError(sgImage.GetInfo(info));
-
-	res = drawableSource.Create(sgImage, differentScreen);
-	if(res == KErrNotSupported)
-		{
-		INFO_PRINTF1(_L("The second screen is not supports drawable source. This test case terminates now."));
-		CleanupStack::PopAndDestroy(&sgImage);
-		return;
-		}
-	TEST(res == KErrNone);
-	User::LeaveIfError(res);
-	CleanupClosePushL(drawableSource);
-	
-	iWindow.BeginRedraw();
-	TheGc->Activate(iWindow);
-	TheGc->Clear();
-	TheGc->SetBrushStyle(CFbsBitGc::ESolidBrush);
-	TheGc->SetPenStyle(CFbsBitGc::ENullPen);
-	TheGc->SetBrushColor(KRgbGreen);
-	TheGc->DrawRect(TRect(KDestPoint, info.iSizeInPixels));
-	// Draw to TPoint(0,0) with EGraphicsRotationNone but to the different screen
-	MWsDrawResource* winDr = static_cast<MWsDrawResource*>(TheGc->Interface(KMWsDrawResourceInterfaceUid));
-	TEST(winDr != NULL);
-	winDr->DrawResource(KDestPoint, drawableSource, CWindowGc::EGraphicsRotationNone);
-	TheGc->Deactivate();
-	iWindow.EndRedraw();
-	TheClient->iWs.Finish();  
-	TheClient->WaitForRedrawsToFinish();
-
-	//Copy the screen to the copy bitmap
-	TheClient->iScreen->CopyScreenToBitmap(iCopyBitmap, KCopyTestRect);
-
-	//Compare the bitmaps
-	INFO_PRINTF1(_L("Draw to TPoint(0,0) with EGraphicsRotationNone but to different screen"));
-	TBool compRes = CompareBitmapsByPixel(iCopyBitmap, iBitmapWrongScreenNumber);
-	TEST(compRes);
-
-	//--------------------------- remoteGc 
-	const TRect KRemotGcSourceRect(0, 0, iWindow.Size().iWidth, iWindow.Size().iHeight);
-	const TRegionFix<1> KClippingRegion(KRemotGcSourceRect);
-	
-	//Create remote gc - required RemoteGc testing
-	CRemoteGc* remoteGc = CRemoteGc::NewL(TheClient->iScreen);
-	CleanupStack::PushL(remoteGc);
-
-	//Record draw messages
-	remoteGc->BeginDraw(KRemotGcSourceRect);
-	remoteGc->SetBrushStyle(CFbsBitGc::ESolidBrush);
-	remoteGc->SetPenStyle(CFbsBitGc::ENullPen);
-	remoteGc->SetBrushColor(KRgbGreen);
-	remoteGc->DrawRect(TRect(KDestPoint, info.iSizeInPixels));
-	MWsDrawResource* remDr = static_cast<MWsDrawResource*>(remoteGc->Interface(KMWsDrawResourceInterfaceUid));
-	TEST(remDr != NULL);
-	remDr->DrawResource(KDestRect, drawableSource, CWindowGc::EGraphicsRotationNone);
-	remoteGc->EndDraw();
-	
-	RWsGraphicMsgBuf msgBuf;
-	CleanupClosePushL(msgBuf);
-	//Externalize the captured commands from remote gc in to a buffer
-	remoteGc->ExternalizeL(msgBuf, ETrue);
-
-	//Create command buffer - required RemoteGc testing
-	CCommandBuffer* cmdBuffer = CCommandBuffer::NewL();
-	CleanupStack::PushL(cmdBuffer);
-	//Internalize the buffer with captured commands (from CRemoteGC) in to CCommandBuffer
-	cmdBuffer->InternalizeL(msgBuf.Pckg());
-	
-	// Play stored commands using Play(const TRect&, const TRect&, RWsSession&, CWindowGc&)
-	iWindow.Invalidate();
-	iWindow.BeginRedraw();
-	TheGc->Activate(iWindow);
-	TheGc->Clear();
-	cmdBuffer->Play(KPlayOffset, &KClippingRegion, KRemotGcSourceRect, TheClient->iWs, *TheGc);
-	TheGc->Deactivate();
-	iWindow.EndRedraw();
-	TheClient->iWs.Finish();
-	TheClient->WaitForRedrawsToFinish();
-
-	//Copy the screen to the copy bitmap
-	TheClient->iScreen->CopyScreenToBitmap(iCopyBitmap, KCopyTestRect);
-
-	INFO_PRINTF1(_L("Draw to TPoint(0,0) with EGraphicsRotationNone but to different screen"));
-	TBool compRes1 = CompareBitmapsByPixel(iCopyBitmap, iBitmapWrongScreenNumber);
-	TEST(compRes1);
-
-	CleanupStack::PopAndDestroy(5, &sgImage);
-	}
-
-/**
-@SYMTestCaseID          GRAPHICS-WSERV-TestCopyScreenToBitmapWithDifferentDisplayModes-0001
-@SYMPREQ                PREQ2095
-@SYMTestPriority        High
-@SYMTestCaseDesc        Get bitmap and scanline from the screen.  
-@SYMTestActions         Draw bitmap in various display modes to the screen. 
-						Retrieve scan line and bitmap from the screen using standard WSERV API.  
-
-@SYMTestExpectedResults Checks that obtained bitmap matches with the reference bitmap.
-*/
-void CTDrawResource::TestCopyScreenToBitmapWithDifferentDisplayModesL()
-	{
-	TDisplayMode mode = TheClient->iScreen->DisplayMode();
-    INFO_PRINTF2(_L("Screen display mode %d"), mode);
-	CFbsBitmap* bitmap = NULL;
-	
-	TSize bitmapSize(163, 120);
-	CreateBitmapLC(bitmap, bitmapSize, mode);
-	
-	iWindow.BeginRedraw();
-	TheGc->Activate(iWindow);
-	TheGc->SetBrushStyle(CWindowGc::ESolidBrush);
-	TheGc->SetBrushColor(KRgbYellow);
-	TheGc->Clear();
-	const TPoint ptOffset(10, 15);
-	TheGc->BitBlt(KDestPoint + ptOffset, bitmap);
-
-	TheGc->Deactivate();
-	iWindow.EndRedraw();
-	TheClient->iWs.Finish();
-	TheClient->WaitForRedrawsToFinish();
-
-	const TInt length = bitmapSize.iWidth;
-	const TInt height = bitmapSize.iHeight;
-	const TInt buffersSize = length * 4;
-	TUint8 *screenData = (TUint8*) User::AllocL(buffersSize);
-	CleanupStack::PushL(screenData);
-	TUint8 *bitmapData = (TUint8*) User::AllocL(buffersSize);
-	CleanupStack::PushL(bitmapData);
-	TPtr8 ptrScreen (screenData, buffersSize, buffersSize);
-	TPtr8 ptrBitmap (bitmapData, buffersSize, buffersSize);
-	
-	//EGray mode uses dithering in BitGdi, wserv doesnt support this, thus skipping the first mode 
-	for(TInt ii =2; ; ii++)
-		{
-		TDisplayMode dispMode = (TDisplayMode)ii; 
-		if(dispMode >= EColorLast)
-			break;
-		if(dispMode == ERgb)
-			continue;
-
-	    INFO_PRINTF2(_L("Copy Screen to bitmap, destination mode %d"), dispMode);
-		
-		CFbsBitmap *bmp = new (ELeave) CFbsBitmap;
-		CleanupStack::PushL(bmp);
-		User::LeaveIfError(bmp->Create(bitmapSize, dispMode));
-		TUidPixelFormat pixelFormat = SgUtils::DisplayModeToPixelFormat(dispMode);
-    	const TInt minStride = SgUtils::MinDataStride(length, pixelFormat);
-    	const TInt bitmapStride = bmp->DataStride();
-    	TEST(minStride <= bitmapStride);
-	
-	//Copy the screen to the copy bitmap
-		TRect rc = bitmapSize;
-		rc.Move(ptOffset);
-		TheClient->iScreen->CopyScreenToBitmap(bmp, rc);
-		CFbsBitmap *bmpRef = NULL;
-		CreateReferenceBitmapLC(bmpRef, bitmap, dispMode);
-		TEST(bmpRef->DisplayMode() == dispMode);
-		
-		//Compare the bitmaps
-	    TBool compRes = CompareBitmapsByPixel(bmp, bmpRef);
-	    TEST(compRes);
-	    
-	    for(TInt jj = 0; jj < height; jj++)
-	    	{
-	    	TPoint pt(0, jj);
-	    	TPoint ptScreen = pt + ptOffset;
-	    	
-	    	Mem::Fill(screenData, bitmapStride, 0xff);
-	    	Mem::Fill(bitmapData, bitmapStride, 0xff);
-	    	
-	    	TheClient->iScreen->GetScanLine(ptrScreen, ptScreen, length, dispMode);
-	    	bitmap->GetScanLine(ptrBitmap, pt, length, dispMode);
-	    	TInt length1 = ptrScreen.Length();
-	    	
-	    	TInt res = Mem::Compare(screenData, length1, bitmapData, length1);
-	    	TEST(res == 0);
-	    	}
-	    CleanupStack::PopAndDestroy(2, bmp);
-		}//screen modes;
-		
-	CleanupStack::PopAndDestroy(3, bitmap);
-	}
-
-//Helper function: Creates reference bitmap with specified display mode
-void CTDrawResource::CreateReferenceBitmapLC(CFbsBitmap*& aBmpTarget, CFbsBitmap* aBmpSrc, TDisplayMode aDestMode) 
-	{
-	TSize size = aBmpSrc->SizeInPixels();
-	aBmpTarget = new (ELeave) CFbsBitmap;
-	CleanupStack::PushL(aBmpTarget);
-	User::LeaveIfError(aBmpTarget->Create(size, aDestMode));
-    CFbsBitmapDevice *refBitmapDev = CFbsBitmapDevice::NewL(aBmpTarget);
-    CleanupStack::PushL(refBitmapDev);
-    CFbsBitGc *originalBitGc;
-	User::LeaveIfError(refBitmapDev->CreateContext(originalBitGc));
-	CleanupStack::PushL(originalBitGc);
-	originalBitGc->BitBlt(TPoint(0,0), aBmpSrc);
-	CleanupStack::PopAndDestroy(2, refBitmapDev);
-	}
-
-//Helper function: Creates reference bitmap with specified display mode
-void CTDrawResource::CreateBitmapLC(CFbsBitmap*& aBmpTarget, const TSize& aSize, TDisplayMode aDispMode) const
-	{
-	aBmpTarget = new (ELeave) CFbsBitmap;
-	CleanupStack::PushL(aBmpTarget);
-	User::LeaveIfError(aBmpTarget->Create(aSize, aDispMode));
-    CFbsBitmapDevice *refBitmapDev = CFbsBitmapDevice::NewL(aBmpTarget);
-    CleanupStack::PushL(refBitmapDev);
-    CFbsBitGc *originalBitGc;
-	User::LeaveIfError(refBitmapDev->CreateContext(originalBitGc));
-	CleanupStack::PushL(originalBitGc);
-	
-	TRect rect = TRect(aSize); 
-	rect.Shrink(21, 15);
-	
-	originalBitGc->SetBrushStyle(CFbsBitGc::ESolidBrush);
-	originalBitGc->SetBrushColor(TRgb(0,150,150));
-	originalBitGc->DrawRect(TRect(TPoint(0,0), TSize(aSize.iWidth, aSize.iHeight / 2)));
-	originalBitGc->SetBrushColor(TRgb(150,100,150));
-	originalBitGc->DrawRect(TRect(TPoint(0,aSize.iHeight / 2), TSize(aSize.iWidth, aSize.iHeight)));
-
-	originalBitGc->SetBrushColor(TRgb(0,0,128));
-	originalBitGc->DrawRect(rect);
-	
-	
-	CleanupStack::PopAndDestroy(2, refBitmapDev);
-	}
-
-//Helper function: Creates a RSgImage from a bitmap
-void CTDrawResource::CreateSgImageFromBitmapL(RSgImage& aSgImage)
-	{
-	TUint32* data = iRefBitmap->DataAddress();
-	TInt stride = iRefBitmap->DataStride();
-	TSize size = iRefBitmap->SizeInPixels();
-
-	TSgImageInfo info;
-	info.iSizeInPixels = size;
-	info.iScreenId = TheClient->iScreen->CurrentScreenMode();
-	info.iShareable = ETrue; //must be shareable since wserv is in other process
-	info.iUsage = ESgUsageWindowGcSource;
-	info.iPixelFormat = SgUtils::DisplayModeToPixelFormat(iRefBitmap->DisplayMode());
-
-	User::LeaveIfError(aSgImage.Create(info, data, stride));
-	}
-
-//Helper function: Creates all reference bitmaps required for all tests
-void CTDrawResource::CreateReferenceAndCopyBitmapsL()
-	{
-	//Create reference bitmap
-	iRefBitmap = new (ELeave) CFbsBitmap();
-	User::LeaveIfError(iRefBitmap->Create(TSize(160,120),EColor64K));
-	
-	//Setup to draw to original reference bitmap
-    CFbsBitmapDevice *refBitmapDev = CFbsBitmapDevice::NewL(iRefBitmap);
-    CleanupStack::PushL(refBitmapDev);
-    CFbsBitGc *originalBitGc;
-	User::LeaveIfError(refBitmapDev->CreateContext(originalBitGc));
-	CleanupStack::PushL(originalBitGc);
-	
-	//Draw to reference bitmap
-	originalBitGc->SetBrushStyle(CFbsBitGc::ESolidBrush);
-	originalBitGc->SetBrushColor(TRgb(0,150,150));
-	originalBitGc->DrawRect(TRect(TPoint(0,0), TSize(160,60)));
-	originalBitGc->SetBrushColor(TRgb(150,100,150));
-	originalBitGc->DrawRect(TRect(TPoint(0,60), TSize(160,60)));
-	
-	//create a rotated version of the reference bitmap
-	iRotatedRefBitmap = new (ELeave) CFbsBitmap();
-	User::LeaveIfError(iRotatedRefBitmap->Create(TSize(120,160),EColor64K));
-	
-	//Setup to draw to rotated reference bitmap
-    CFbsBitmapDevice *rotRefBitmapDev = CFbsBitmapDevice::NewL(iRotatedRefBitmap);
-    CleanupStack::PushL(rotRefBitmapDev);
-    CFbsBitGc *rotatedBitGc;
-	User::LeaveIfError(rotRefBitmapDev->CreateContext(rotatedBitGc));
-	CleanupStack::PushL(rotatedBitGc);
-	
-	//Draw to rotated reference bitmap
-	rotatedBitGc->SetBrushStyle(CFbsBitGc::ESolidBrush);
-	rotatedBitGc->SetBrushColor(TRgb(0,150,150));
-	rotatedBitGc->DrawRect(TRect(TPoint(60,0), TSize(60,160)));
-	rotatedBitGc->SetBrushColor(TRgb(150,100,150));
-	rotatedBitGc->DrawRect(TRect(TPoint(0,0), TSize(60,160)));
-	
-	//Prepare a scaled version of the rotated reference bitmap to later compare against
-    iScaledBitmap = new (ELeave) CFbsBitmap();
-    User::LeaveIfError(iScaledBitmap->Create(TSize(160,120),EColor64K));
-	//Setup to draw to bitmap
-    CFbsBitmapDevice *scaledBitDev = CFbsBitmapDevice::NewL(iScaledBitmap);
-    CleanupStack::PushL(scaledBitDev);
-    CFbsBitGc *scaledBitGc;
-	User::LeaveIfError(scaledBitDev->CreateContext(scaledBitGc));
-	CleanupStack::PushL(scaledBitGc);
-	//Draw the rotated reference bitmap scaled
-	scaledBitGc->DrawBitmap(KDestRect, iRotatedRefBitmap); 
-	
-	//Prepare a scaled version of the rotated reference bitmap to later compare against
-	iScaledCroppedBitmap = new (ELeave) CFbsBitmap();
-	User::LeaveIfError(iScaledCroppedBitmap->Create(TSize(160,120),EColor64K));
-    
-	//Setup to draw to bitmap
-    CFbsBitmapDevice *scaledCroppedBitDev = CFbsBitmapDevice::NewL(iScaledCroppedBitmap);
-    CleanupStack::PushL(scaledCroppedBitDev);
-    CFbsBitGc *scaledCroppedBitGc;
-	User::LeaveIfError(scaledCroppedBitDev->CreateContext(scaledCroppedBitGc));
-	CleanupStack::PushL(scaledCroppedBitGc);
-	
-	//Draw the rotated reference bitmap scaled
-	TInt width = iRotatedRefBitmap->SizeInPixels().iWidth;
-	TInt height = iRotatedRefBitmap->SizeInPixels().iHeight; 
-	
-	TRect rectSrc;
-	rectSrc.iTl.iX= width - KSourceRect.Height();
-	rectSrc.iTl.iY= 0;
-	rectSrc.iBr.iX= width;
-	rectSrc.iBr.iY= KSourceRect.Width();
-
-	scaledCroppedBitGc->DrawBitmap(KDestRect, iRotatedRefBitmap, rectSrc); 
-	
-	//Prepare bitmap for testing drawable which opened with different screen number
-	iBitmapWrongScreenNumber = new (ELeave) CFbsBitmap();
-    User::LeaveIfError(iBitmapWrongScreenNumber->Create(TSize(160,120),EColor64K));
-	//Setup to draw to bitmap
-    CFbsBitmapDevice *wrongScreenNumberBitDev = CFbsBitmapDevice::NewL(iBitmapWrongScreenNumber);
-    CleanupStack::PushL(wrongScreenNumberBitDev);
-    CFbsBitGc *wrongScreenNumberBitGc;
-	User::LeaveIfError(wrongScreenNumberBitDev->CreateContext(wrongScreenNumberBitGc));
-	CleanupStack::PushL(wrongScreenNumberBitGc);
-	//Draw the rotated reference bitmap scaled
-	wrongScreenNumberBitGc->SetBrushColor(KRgbGreen);
-	wrongScreenNumberBitGc->SetBrushStyle(CFbsBitGc::ESolidBrush);
-	wrongScreenNumberBitGc->SetPenStyle(CFbsBitGc::ENullPen);
-	wrongScreenNumberBitGc->DrawRect(TRect(0, 0, 160, 120)); //
-	
-	//Create a bitmap  to copy to with the same display mode as the reference bitmap
-	iCopyBitmap = new (ELeave) CFbsBitmap();
-	User::LeaveIfError(iCopyBitmap->Create(TSize(640,240),EColor64K));
-	
-	CleanupStack::PopAndDestroy(10, refBitmapDev);
-	}
-
-//Helper function: This function compares two bitmaps on a pixel by pixel basis */
-TBool CTDrawResource::CompareBitmapsByPixel(CFbsBitmap* aCandidateBitmap, CFbsBitmap* aReferenceBitmap)
-	{
-	TBool result = ETrue;
-
-	TSize candidateSize = aCandidateBitmap->SizeInPixels();
-	TSize referenceSize = aReferenceBitmap->SizeInPixels();
-
-	TInt mismatchedPixels = 0;
-	
-	TRgb nativePixel;
-	TRgb referencePixel;
-	for (TInt x = 0; x < referenceSize.iWidth; x++)
-		{
-		for (TInt y = 0; y < referenceSize.iHeight; y++)
-			{
-			TPoint point(x,y);
-			nativePixel = TRgb(0,0,0,0);
-			referencePixel = TRgb(0,0,0,0);
-			aCandidateBitmap->GetPixel(nativePixel, point);
-			aReferenceBitmap->GetPixel(referencePixel, point);
-
-			if (nativePixel != referencePixel)
-				{
-				mismatchedPixels++;
-				result = EFalse;
-				}
-			}
-		}
-	
-	INFO_PRINTF2(_L("Number of different pixels: %i"), mismatchedPixels);
-	return result;
-	}
-//Helper function: This function extracts content of the image associated with the image target and copies it into bitmap
-void CTDrawResource::BitmapLC(CFbsBitmap*& aBmp)
-	{
-	aBmp = new(ELeave) CFbsBitmap;
-    CleanupStack::PushL(aBmp);
-	
-	TSgImageInfo info;
-	TInt res = iImage.GetInfo(info);
-	User::LeaveIfError(res);
-	
-	res = aBmp ->Create(info.iSizeInPixels, SgUtils::PixelFormatToDisplayMode(info.iPixelFormat));
-	User::LeaveIfError(res);
-	TUint32* dataAddressDest = aBmp->DataAddress();
-	
-	RSgImage image;
-	info.iUsage = ESgUsageNone;
-	info.iCpuAccess = ESgCpuAccessReadOnly;
-	res = image.Create(info, iImage);
-	User::LeaveIfError(res);
-	CleanupClosePushL(image);
-	const TAny* dataAddress = NULL; 
-	TInt dataStride;
-	res = image.MapReadOnly(dataAddress, dataStride);
-	User::LeaveIfError(res);
-	Mem::Copy(dataAddressDest, dataAddress, dataStride * info.iSizeInPixels.iHeight);
-	image.Unmap();
-	CleanupStack::PopAndDestroy(&image);
-	}
--- a/windowing/windowserver/tauto/tdrawresource.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,221 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef TDRAWRESOURCE_H_
-#define TDRAWRESOURCE_H_
-
-#include "AUTO.H"
-#include <graphics/directgdidriver.h>
-#include <graphics/wsgraphicscontext.h>
-#include <graphics/directgdicontext.h>
-#include <graphics/wsdrawablesourceprovider.h>
-#include <graphics/sgimagecollection.h>
-#include <graphics/directgdiimagetarget.h>
-#include <graphics/wsdrawresource.h>
-#include "RemoteGc.h"
-#include "CommandBuffer.h"
-
-class TSgImageInfo;
-
-_LIT(KTDrawResourceStep, "TDrawResource");
-
-const TSize KSourceSize(200,200); //The size of the rect to copy from the screen
-const TPoint KDestPoint(0,0);
-const TRect KCopyTestRect(TPoint(0,0), TSize(200,200)); //The test rect to copy from the screen
-const TRect KSourceRect(TPoint(0,0), TSize(50,50));//Rect of the source image to be drawn
-const TRect KDestRect(TPoint(10,10), TSize(60,60));//Rect of the destination to draw to
-const CWindowGc::TGraphicsRotation KTestRotation= CWindowGc::EGraphicsRotation90;
-const TPoint KPlayOffset(0,0);
-
-
-/**
- * Dummy class used to check the values received by MWsGraphicsContext.
- * The only funtions overridden with some functionality are the DrawResource functions.
- * These simply receive the values and then store them in public member variables.
- */
-class CTestWsGraphicsContext : public CBase, public MWsGraphicsContext, public MWsDrawableSourceProvider
-	{
-public:
-	static CTestWsGraphicsContext* NewL(RDirectGdiImageTarget& aTarget);
-	~CTestWsGraphicsContext();
-	
-public: //from MWsGraphicsContext
-	void BitBlt(const TPoint&, const CFbsBitmap&){}
-	void BitBlt(const TPoint&, const CFbsBitmap&, const TRect&){}
-	void BitBltMasked(const TPoint&, const CFbsBitmap&, const TRect&, const CFbsBitmap&, TBool){}
-	void BitBltMasked(const TPoint&, const CFbsBitmap&, const TRect&, const CFbsBitmap&, const TPoint&){}
-	void ResetClippingRegion(){}
-	void Clear();
-	void Clear(const TRect&){}
-	void ResetBrushPattern(){}
-	void ResetFont(){}
-	void DrawArc(const TRect&, const TPoint&, const TPoint&){}
-	void DrawPie(const TRect&, const TPoint&, const TPoint&){}
-	void DrawBitmap(const TRect&, const CFbsBitmap&){}
-	void DrawBitmap(const TRect&,	const CFbsBitmap&, const TRect&){}
-	void DrawBitmapMasked(const TRect&, const CFbsBitmap&,const TRect&, const CFbsBitmap&, TBool){}
-	void DrawRoundRect(const TRect&, const TSize&){}
-	void DrawPolyLine(const TArray<TPoint>&){}
-	void DrawPolyLineNoEndPoint(const TArray<TPoint>&){}
-	void DrawPolygon(const TArray<TPoint>& , TFillRule ){}
-	void DrawEllipse(const TRect&){}
-	void DrawLine(const TPoint&, const TPoint&){}
-	void DrawLineTo(const TPoint&){}
-	void DrawLineBy(const TPoint&){}
-	void DrawRect(const TRect&){}
-	void DrawText(const TDesC& ,const TTextParameters* ){}
-	void DrawText(const TDesC& ,const TTextParameters* ,const TPoint& ){}
-	void DrawText(const TDesC& ,const TTextParameters* ,const TRect& ){}
-	void DrawText(const TDesC& ,const TTextParameters* ,const TRect& ,TInt ,TTextAlign ,TInt ){}
-	void DrawTextVertical(const TDesC& ,const TTextParameters* ,TBool ) {}
-	void DrawTextVertical(const TDesC& ,const TTextParameters* ,const TPoint& ,TBool ){}
-	void DrawTextVertical(const TDesC& ,const TTextParameters* ,const TRect& ,TBool ){}
-	void DrawTextVertical(const TDesC& ,const TTextParameters* ,const TRect& ,TInt ,TBool ,TTextAlign ,TInt ){}
-	void DrawTextVertical(const TDesC& ,const TTextParameters* ,const TRect& ,TInt ,TInt ,TBool ,TTextAlign ,TInt ){}
-	void MoveTo(const TPoint&){}
-	void MoveBy(const TPoint&){}
-	TPoint Origin() const {return TPoint(0,0);}
-	void Plot(const TPoint&){}
-	void Reset(){}
-	void SetBrushColor(const TRgb&){}
-	void SetBrushOrigin(const TPoint&){}
-	void SetBrushStyle(TBrushStyle ){}
-	void SetClippingRegion(const TRegion&){}
-	void SetDrawMode(TDrawMode){}
-	void SetOrigin(const TPoint&){}
-	void SetPenColor(const TRgb&){}
-	void SetPenStyle(TPenStyle){}
-	void SetPenSize(const TSize& ){}
-	void SetTextShadowColor(const TRgb&){}
-	void SetCharJustification(TInt, TInt){}
-	void SetWordJustification(TInt, TInt){}
-	void SetUnderlineStyle(TFontUnderline){}
-	void SetStrikethroughStyle(TFontStrikethrough){}
-	void SetBrushPattern(const CFbsBitmap&){}
-	void SetBrushPattern(TInt){}
-	void SetFont(const CFont*){}
-	void CopyRect(const TPoint&, const TRect&){}
-	void RectDrawnTo(TRect&){}
-	void UpdateJustification(const TDesC& ,const TTextParameters* ){}
-	void UpdateJustificationVertical(const TDesC& ,const TTextParameters* ,TBool ){}
-	void SetFontNoDuplicate(const CFont* ){}
-	TBool HasBrushPattern() const{return EFalse;}
-	TBool HasFont() const{return EFalse;}
-	void InternalizeL(RReadStream&){}
-	void ExternalizeL(RWriteStream&){}
-	TRgb BrushColor() const {return iContext->BrushColor();}
-	TRgb PenColor() const {return iContext->PenColor();}
-	TRgb TextShadowColor() const {return iContext->TextShadowColor ();}
-	
-	const TRegion& ClippingRegion(){return iRegion;}
-	TInt GetError(){return KErrNone;}
-	TInt Push(){return KErrNone;}
-	void Pop(){}
-	//from MWsObjectProvider
-	TAny* ResolveObjectInterface(TUint aTypeId);
-	
-	//from MWsDrawableSourceProvider
-	TInt CreateDrawableSource(const TSgDrawableId& aDrawableId, TAny*& aSource);
-	void CloseDrawableSource(TAny* aSource);
-	void DrawResource(const TAny* aSource, const TPoint& aPos, CWindowGc::TGraphicsRotation aRotation = CWindowGc::EGraphicsRotationNone);
-	void DrawResource(const TAny* aSource, const TRect& aRect, CWindowGc::TGraphicsRotation aRotation = CWindowGc::EGraphicsRotationNone);
-	void DrawResource(const TAny* aSource, const TRect& aRectDest, const TRect& aRectSrc, CWindowGc::TGraphicsRotation aRotation = CWindowGc::EGraphicsRotationNone);
-	void DrawResource(const TAny* aSource, const TRect& aRect, const TDesC8& aParam);
-	
-private:
-	void ConstructL(RDirectGdiImageTarget& aTarget);
-	void DoCreateDrawableSourceL(const TSgDrawableId& aDrawableId, TAny*& aSource);
-public:
-	TPoint iPos;
-	TRect iDestRect;
-	TRect iSrcRect;
-	DirectGdi::TGraphicsRotation iRotation;
-	RRegion iRegion;
-private:
-	CDirectGdiContext* iContext;
-	};
-
-/**
- * Class derived from MWsGraphicResolver.  This a dummy implmentation which has no functionality.
- * An instance of it is passed to CCommandBuffer::Play to make it a valid call.  
- */
-class CWSGraphicsRes: public CBase, public MWsGraphicResolver
-	{
-public:
-	void DrawWsGraphic(TInt, TBool, const TRect&, const TDesC8&) const{}
-	};
-	
-class CTDrawResource : public CTWsGraphicsBase
-	{
-public:
-	CTDrawResource(CTestStep* aStep);
-	~CTDrawResource();
-	void ConstructL();
-protected:
-	//from 	CTGraphicsStep
-	void RunTestCaseL(TInt aCurTestCase);
-private:
-	void TestDrawResourcePos();
-	void TestDrawResourceRect();
-	void TestDrawResourceScale();
-	void TestRWsDrawableSourceReferenceCountingL();
-	void TestRemoteGcDrawResourcePosL();
-	void TestRemoteGcDrawResourceRectL();
-	void TestRemoteGcDrawResourceScaleL();
-	void TestDrawResourceScreensL();
-	void TestCopyScreenToBitmapWithDifferentDisplayModesL();
-	//Helper functions
-	TBool CompareBitmapsByPixel(CFbsBitmap* aCandidateBitmap, CFbsBitmap* aReferenceBitmap);
-	void CreateReferenceAndCopyBitmapsL();
-	void CreateSgImageFromBitmapL(RSgImage& aImage);
-	void BitmapLC(CFbsBitmap*& aBmp); //helper function to extract bitmap from the image
-	void CreateReferenceBitmapLC(CFbsBitmap*& aBmpTarget, CFbsBitmap* aBmpSrc, TDisplayMode aDestMode); 
-	void CreateBitmapLC(CFbsBitmap*& aBmpTarget, const TSize& aSize, TDisplayMode aDispMode) const;
-private:
-	RWindow iWindow;
-	CFbsBitmap* iRefBitmap;
-	CFbsBitmap* iRotatedRefBitmap;
-	CFbsBitmap* iScaledBitmap;
-	CFbsBitmap *iScaledCroppedBitmap;
-	CFbsBitmap* iCopyBitmap;
-	CFbsBitmap* iBitmapWrongScreenNumber;
-	CDirectGdiDriver* iDGdiDriver;
-	
-	//Required for RemoteGc testing
-	RSgImageCollection iImageCollection;
-	RSgImage iImage;
-	RDirectGdiImageTarget iImageTarget;
-	RWsDrawableSource iWsDrawableSource;
-	CTestWsGraphicsContext* iGraphicsCon;
-	CWSGraphicsRes* iWsGrapicResolver;
-	};
-
-class CTDrawResourceStep : public CTGraphicsStep
-	{
-public:
-	CTDrawResourceStep();
-protected:	
-	//from CTGraphicsStep
-	CTGraphicsBase* CreateTestL();
-	};
-
-
-#endif /*TDRAWRESOURCE_H_*/
--- a/windowing/windowserver/tauto/tgc.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1864 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-#include "tgc.h"
-#include "RemoteGc.h"
-#include "CommandBuffer.h"
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-#include "directgdigcwrapper.h"
-#include <graphics/directgdidriver.h>
-#include <graphics/sgutils.h>
-#include <graphics/wsdrawresource.h>
-#endif
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-GLDEF_C void CopyImageToBitmapL(CFbsBitmap* aBitmap, const RSgImage& aImage, const TRect& aRect);
-GLDEF_C void CopyImageToDestination(TAny* aDataAddressDest, TInt aDataStrideDest, TDisplayMode aDisplayModeDest, 
-				TAny* aDataAddressSrc, TInt aDataStrideSrc, TDisplayMode aDisplayModeSrc, const TRect& aRect);
-GLDEF_C void CopyImageToDestination64K(TAny* aDataAddressDest, TInt aDataStrideDest, TDisplayMode aDisplayModeDest, 
-		TUint16* aDataAddressSrc, TInt aDataStrideSrc, const TRect& aRect);
-
-GLDEF_C void CopyImageToBitmapL(CFbsBitmap* aBitmap, const RSgImage& aImage, const TRect& aRect)
-	{
-	TSgImageInfo info;
-	TInt res = aImage.GetInfo(info);
-	if(res == KErrNone)
-		{
-		info.iUsage = ESgUsageNone;
-		info.iCpuAccess = ESgCpuAccessReadOnly;
-		RSgImage image;
-		res = image.Create(info, aImage);
-		if(res == KErrNone)
-			{	
-			const TAny* dataAddressSrc = NULL; 
-			TInt dataStrideSrc = 0;
-			res = image.MapReadOnly(dataAddressSrc, dataStrideSrc);
-			if(res == KErrNone)
-				{
-				const TDisplayMode displayModeDest = aBitmap->DisplayMode();
-				const TDisplayMode displayModeSrc = SgUtils::PixelFormatToDisplayMode(info.iPixelFormat);
-				TUint32* dataAddressDest = aBitmap->DataAddress();
-				const TInt dataStrideDest = aBitmap -> DataStride();
-				TSize bitmapSize = aBitmap->SizeInPixels();
-				TRect rect = aRect;
-				TRect rectDest = info.iSizeInPixels;
-				rect.Intersection(rectDest);
-				if(rect.Height() > bitmapSize.iHeight)
-					{
-					rect.SetHeight(bitmapSize.iHeight);
-					}
-				if(rect.Width() > bitmapSize.iWidth)
-					{
-					rect.SetWidth(bitmapSize.iWidth);
-					}
-				CopyImageToDestination((TAny*)dataAddressDest, dataStrideDest, displayModeDest, (TAny*)dataAddressSrc, 
-								dataStrideSrc, displayModeSrc, rect);
-
-				image.Unmap();
-				}
-			image.Close();
-			}
-		}
-	}
-
-GLDEF_C void CopyImageToDestination(TAny* aDataAddressDest, TInt aDataStrideDest, TDisplayMode aDisplayModeDest, 
-				TAny* aDataAddressSrc, TInt aDataStrideSrc, TDisplayMode aDisplayModeSrc, const TRect& aRect) 
-	{
-	if(aRect.IsEmpty())
-		return;
-	
-	if((aDisplayModeDest == aDisplayModeSrc) && (aDataStrideSrc == aDataStrideDest))
-		{
-		Mem::Copy(aDataAddressDest, aDataAddressSrc, aDataStrideDest * aRect.Height());
-		return;
-		}
-	
-	switch(aDisplayModeSrc)
-		{
-	case EColor64K:
-		{
-		CopyImageToDestination64K(aDataAddressDest, aDataStrideDest, aDisplayModeDest, 
-						(TUint16*)aDataAddressSrc, aDataStrideSrc, aRect);
-		break;
-		}
-	default:
-		break;
-		}
-	}
-
-GLDEF_C void CopyImageToDestination64K(TAny* aDataAddressDest, TInt aDataStrideDest, TDisplayMode aDisplayModeDest, 
-		TUint16* aDataAddressSrc, TInt aDataStrideSrc, const TRect& aRect) 
-	{
-	const TInt bppSrc = 2;
-	const TInt width = aRect.Width();
-	const TInt height = aRect.Height();
-	const TInt dataStrideLengthSrc = aDataStrideSrc / bppSrc;
-	TUint16* dataAddressSrc =  aDataAddressSrc + aRect.iTl.iY * dataStrideLengthSrc + aRect.iTl.iX; 
-	const TUint16* dataAddressSrcEnd = dataAddressSrc + dataStrideLengthSrc *  height;  
-
-	switch(aDisplayModeDest)
-		{
-	case EColor64K:
-		{
-		TUint16* dataAddressDest = static_cast<TUint16*> (aDataAddressDest); 
-		const TInt dataStrideLengthDest = aDataStrideDest / bppSrc;
-		while(dataAddressSrcEnd > dataAddressSrc)
-			{
-			Mem::Copy(dataAddressDest, dataAddressSrc, width * bppSrc);
-			dataAddressSrc += dataStrideLengthSrc;
-			dataAddressDest += dataStrideLengthDest;
-			}
-		break;
-		}
-	case EColor16MU:
-		{
-		const TInt bppDest = 4;
-		TUint32* dataAddressDest = static_cast<TUint32*> (aDataAddressDest); 
-		const TInt dataStrideLengthDest = aDataStrideDest / bppDest;
-		
-		while(dataAddressSrcEnd > dataAddressSrc)
-			{
-			const TUint16* dataAddressSrcLineEnd = dataAddressSrc + width;
-			TUint32* dataAddressDestCur = dataAddressDest;
-			TUint16* dataAddressSrcCur = dataAddressSrc;
-
-			while(dataAddressSrcLineEnd > dataAddressSrcCur)
-				{
-				*dataAddressDestCur = TRgb::Color64K(*dataAddressSrcCur).Color16MU();
-				dataAddressDestCur++;
-				dataAddressSrcCur++;
-				}
-			dataAddressSrc += dataStrideLengthSrc;
-			dataAddressDest += dataStrideLengthDest;
-			}
-		break;
-		}
-	case EGray4:
-		{
-		TUint8* dataAddressDest = static_cast<TUint8*> (aDataAddressDest);
-		const TInt dataStrideLengthDest = aDataStrideDest;
-		
-		while(dataAddressSrcEnd > dataAddressSrc)
-			{
-			const TUint8* dataAddressDstLineEnd = dataAddressDest + aDataStrideDest;
-			TUint8* dataAddressDestCur = dataAddressDest;
-			TUint16* dataAddressSrcCur = dataAddressSrc;
-
-			while(dataAddressDstLineEnd > dataAddressDestCur)
-				{
-				*dataAddressDestCur = 0;
-				for(TInt index = 0; index < 8; index +=2)
-					{
-					TInt col = TRgb::Color64K(*dataAddressSrcCur).Gray4();
-					col <<= index;
-					*dataAddressDestCur |= col;
-					dataAddressSrcCur++;
-					}
-				dataAddressDestCur++;
-				}
-			dataAddressSrc += dataStrideLengthSrc;
-			dataAddressDest += dataStrideLengthDest;
-			}
-		break;
-		}
-	case EColor256:
-		{
-		TUint8* dataAddressDest = static_cast<TUint8*> (aDataAddressDest);
-		const TInt dataStrideLengthDest = aDataStrideDest;
-		
-		while(dataAddressSrcEnd > dataAddressSrc)
-			{
-			const TUint8* dataAddressDstLineEnd = dataAddressDest + aDataStrideDest;
-			TUint8* dataAddressDestCur = dataAddressDest;
-			TUint16* dataAddressSrcCur = dataAddressSrc;
-
-			while(dataAddressDstLineEnd > dataAddressDestCur)
-				{
-				*dataAddressDestCur = TRgb::Color64K(*dataAddressSrcCur).Color256();
-				dataAddressSrcCur++;
-				dataAddressDestCur++;
-				}
-			dataAddressSrc += dataStrideLengthSrc;
-			dataAddressDest += dataStrideLengthDest;
-			}
-		break;
-		}
-	default:
-		break;
-		}
-	}
-
-TDisplayMode DisplayModeFromPixelFormat(TUidPixelFormat aPixelFormat)
-	{
-	switch(aPixelFormat)
-		{
-	case EUidPixelFormatARGB_8888_PRE:
-		return EColor16MAP;
-	case EUidPixelFormatARGB_8888:
-		return EColor16MA;
-	case EUidPixelFormatRGB_565:
-		return EColor64K;
-	default:
-		break;
-		}
-	return ENone;
-	}
-
-TUidPixelFormat PixelFormatFromDisplayMode(TDisplayMode aDisplayMode)
-	{
-	switch (aDisplayMode)
-		{
-		case EGray2:
-		case EGray4:
-		case EGray16:
-		case EGray256:
-		case EColor16:
-		case EColor256:
-		case EColor16M:
-		case EColor16MU:
-			{
-			return EUidPixelFormatXRGB_8888;
-			}
-		case EColor4K:
-			{
-			return EUidPixelFormatXRGB_4444;
-			}
-		case EColor64K:
-			{
-			return EUidPixelFormatRGB_565;
-			}
-		case EColor16MA:
-			{
-			return EUidPixelFormatARGB_8888;
-			}
-		case EColor16MAP:
-			{
-			return EUidPixelFormatARGB_8888_PRE;
-			}
-		default:
-			{
-			return EUidPixelFormatUnknown;
-			}
-		}
-	}
-#endif
-
-CTGc::CTGc(CTestStep* aStep) : CTWsGraphicsBase(aStep)
-	{
-	}
-
-CTGc::~CTGc()
-	{
-	delete iTest;
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-	SgDriver::Close();
-	CDirectGdiDriver *directGdiDriver = CDirectGdiDriver::Static();
-	if(directGdiDriver)
-		{
-		directGdiDriver->Close();
-		}
-#endif
-	}
-
-void CTGc::ConstructL()
-	{
-	_LIT(KTestName,"GC Test");
-	iTest=new(ELeave) CTestBase(KTestName,this);
-	
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-	TInt err = CDirectGdiDriver::Open();
-	User::LeaveIfError(err);
-	err = SgDriver::Open();
-	if(err != KErrNone)
-		{
-		CDirectGdiDriver *directGdiDriver = CDirectGdiDriver::Static();
-		if(directGdiDriver)
-			{
-			directGdiDriver->Close();
-			}
-		User::Leave(err);
-		}
-#endif
-	}
-
-//Class derived from MWsGraphicResolver. Used for playing the commands from command buffer
-class CWSGraphicsRes: public CBase, public MWsGraphicResolver
-	{
-public:
-	void DrawWsGraphic(TInt /*aId*/, TBool /*aIsUid*/, const TRect& /*aRect*/, const TDesC8& /*aData*/) const
-		{
-		//Orveriding by giving empty implemention
-		}
-	};
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-//
-//Class CDrawTextInContextTest
-//
-
-CDrawTextInContextTest::CDrawTextInContextTest(){}
-
-CDrawTextInContextTest::~CDrawTextInContextTest()
-	{
-	delete iRefBitmap;
-	delete iRefDevice;
-	delete iRefBitGc;
-	delete iRemoteGc;
-	iMsgBuf.Close();
-	delete iCommandBuffer;
-	delete iWsGraphicRes;
-	
-	TheClient->iScreen->ReleaseFont(iFont);
-
-	delete iDirectGdiGcWrapper;
-	if(iWrapperImageTarget)
-		{
-		iWrapperImageTarget->Close();
-		}
-	delete iWrapperImageTarget;
-	iWrapperImage.Close();
-	iWrapperImageCollection.Close();
-	}
-
-void CDrawTextInContextTest::BaseConstructL()
-	{
-	//Initialise font settings
-	TFontSpec fsp;
-	fsp.iTypeface.iName=_L("Series 60 Sans");
-	fsp.iHeight=430;
-	User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInTwips((CFont*&)iFont,fsp));
-	
-	//Initialise TTextParameter
-	iParam.iStart = 27;
-	iParam.iEnd = 60;
-	
-	//Text to draw
-	iText.Set(_L("This text will not be drawnK.,!\"\x00A3$%^&*()_+-=;'#:@~/<>? Latin This text will not be drawn"));
-	
-	//For reference bitmap
-	iRefBitmap = new(ELeave) CFbsBitmap();
-	User::LeaveIfError(iRefBitmap->Create(KBitmapSize, EColor64K));
-	iRefDevice = CFbsBitmapDevice::NewL(iRefBitmap);
-	User::LeaveIfError(iRefDevice->CreateContext(iRefBitGc));
-	
-	CDirectGdiDriver* theDGdiDriver = CDirectGdiDriver::Static();
-	User::LeaveIfNull(theDGdiDriver);
-	
-	TSgImageInfo info;
-	info.iUsage = ESgUsageDirectGdiTarget | ESgUsageDirectGdiSource | ESgUsageCompositionSource;
-	info.iSizeInPixels = KBitmapSize;
-	info.iPixelFormat = EUidPixelFormatRGB_565;
-	
-	TInt res = iWrapperImageCollection.Create(info, 1);
-	User::LeaveIfError(res);
-	res = iWrapperImageCollection.OpenImage(0, iWrapperImage);
-	User::LeaveIfError(res);
-	iWrapperImageTarget = new (ELeave) RDirectGdiImageTarget(*theDGdiDriver);
-	res = iWrapperImageTarget->Create(iWrapperImage);
-	User::LeaveIfError(res);
-	iDirectGdiGcWrapper = CDirectGdiGcWrapper::NewL(*iWrapperImageTarget);
-
-	//clean image-----------------
-	CDirectGdiGcWrapper* directGdiGcWrapper = CDirectGdiGcWrapper::NewL(*iWrapperImageTarget);
-	CleanupStack::PushL(directGdiGcWrapper);
-
-	directGdiGcWrapper->SetDrawMode(MWsGraphicsContext::EDrawModeWriteAlpha);
-	directGdiGcWrapper->SetBrushColor(KRgbWhite);
-	directGdiGcWrapper->Clear();
-
-	CleanupStack::PopAndDestroy(1, directGdiGcWrapper);
-	//------------------
-	
-	//Used to record draw commands
-	iRemoteGc = CRemoteGc::NewL(TheClient->iScreen);
-	
-	//Used to play recorded draw commands
-	iCommandBuffer = CCommandBuffer::NewL();
-	
-	//Dummy class created required for CCommandBuffer::Play
-	iWsGraphicRes = new (ELeave) CWSGraphicsRes();
-	
-	//Offset for CCommandBuffer::Play
-	iOffset = TPoint(0,0);
-	
-	//Result of doing the test
-	iHasPassedTest = EFalse;
-	}
-
-void CDrawTextInContextTest::Test()
-	{	
-	/* Create reference bitmap by drawing using bitgc */
-	iRefBitGc->UseFont(iFont);
-	DoDrawTextBitGc();
-	iRefBitGc->DiscardFont();
-	
-	/* Drawing using CBitGcWrapper via CRemotGc*/
-	
-	//Capturing the commands in remote gc
-	iRemoteGc->BeginDraw(KBitmapRect);
-	iRemoteGc->UseFont(iFont);
-	DoDrawTextRemoteGc();
-	iRemoteGc->DiscardFont();
-	iRemoteGc->EndDraw();
-		
-	//Externalize the captured commands from remote gc in to a buffer
-	iRemoteGc->ExternalizeL(iMsgBuf, ETrue);
-
-	//Internalize the buffer with captured commands (from CRemoteGC) in to CCommandBuffer
-	iCommandBuffer->InternalizeL(iMsgBuf.Pckg());
-	
-	//Play the commands on test window using command buffer
-	iCommandBuffer->Play(iOffset,&KBitmapRegion,KBitmapRect,*iWsGraphicRes,*iDirectGdiGcWrapper);
-	
-	//Test to see if the bitmap drawn to using CRemoteGc is the same as the reference bitmap
-	CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
-	CleanupStack::PushL(bitmap);
-	
-	TSgImageInfo info;
-	iWrapperImage.GetInfo(info);
-	TDisplayMode displayMode = DisplayModeFromPixelFormat(info.iPixelFormat);
-	bitmap->Create(info.iSizeInPixels, displayMode);
-	TRect rect(info.iSizeInPixels);
-	CopyImageToBitmapL(bitmap, iWrapperImage, rect);
-	
-	iHasPassedTest = LossyCompareBitmap(*iRefBitmap, *bitmap, KBitmapRect, EFalse);
-
-	CleanupStack::PopAndDestroy(bitmap);
-	}
-
-TBool CDrawTextInContextTest::HasPassedTest()
-	{
-	return iHasPassedTest;
-	}
-
-//
-// Class DrawTextInContextTestPoint
-//
-
-CDrawTextInContextTestPoint::CDrawTextInContextTestPoint(){}
-
-CDrawTextInContextTestPoint::~CDrawTextInContextTestPoint(){}
-
-CDrawTextInContextTestPoint* CDrawTextInContextTestPoint::NewL()
-	{
-	CDrawTextInContextTestPoint* self = new(ELeave) CDrawTextInContextTestPoint;
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-void CDrawTextInContextTestPoint::ConstructL()
-	{
-	BaseConstructL();
-	iPosition = TPoint(0,0);
-	}
-
-void CDrawTextInContextTestPoint::DoDrawTextBitGc()
-	{
-	iRefBitGc->DrawText(iText,&iParam,iPosition);
-	}
-
-void CDrawTextInContextTestPoint::DoDrawTextRemoteGc()
-	{
-	iRemoteGc->DrawText(iText,&iParam,iPosition);
-	}
-
-//
-// Class DrawTextInContextTestBox
-//
-
-CDrawTextInContextTestBox::CDrawTextInContextTestBox(){}
-
-CDrawTextInContextTestBox::~CDrawTextInContextTestBox(){}
-
-CDrawTextInContextTestBox* CDrawTextInContextTestBox::NewL()
-	{
-	CDrawTextInContextTestBox* self = new(ELeave) CDrawTextInContextTestBox;
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-void CDrawTextInContextTestBox::ConstructL()
-	{
-	BaseConstructL();
-	iClipFillRect = TRect(10,50,640,120);
-	iBaselineOffset = 40;
-	iTTextAlign = CGraphicsContext::ELeft;
-	}
-
-void CDrawTextInContextTestBox::DoDrawTextBitGc()
-	{
-	iRefBitGc->DrawText(iText,&iParam,iClipFillRect,iBaselineOffset,iTTextAlign);
-	}
-
-void CDrawTextInContextTestBox::DoDrawTextRemoteGc()
-	{
-	iRemoteGc->DrawText(iText,&iParam,iClipFillRect,iBaselineOffset,iTTextAlign);
-	}
-
-//
-// Class CDrawTextInContextTestPointVertical
-//
-
-CDrawTextInContextTestPointVertical::CDrawTextInContextTestPointVertical(){}
-
-CDrawTextInContextTestPointVertical::~CDrawTextInContextTestPointVertical(){}
-
-CDrawTextInContextTestPointVertical* CDrawTextInContextTestPointVertical::NewL()
-	{
-	CDrawTextInContextTestPointVertical* self = new(ELeave) CDrawTextInContextTestPointVertical;
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-void CDrawTextInContextTestPointVertical::ConstructL()
-	{
-	BaseConstructL();
-	iPosition = TPoint(0,0);
-	iUp = EFalse;
-	}
-
-void CDrawTextInContextTestPointVertical::DoDrawTextBitGc()
-	{
-	iRefBitGc->DrawTextVertical(iText,&iParam,iPosition,iUp);
-	}
-
-void CDrawTextInContextTestPointVertical::DoDrawTextRemoteGc()
-	{
-	iRemoteGc->DrawTextVertical(iText,&iParam,iPosition,iUp);
-	}
-
-//
-// Class CDrawTextInContextTestBoxVertical
-//
-
-CDrawTextInContextTestBoxVertical::CDrawTextInContextTestBoxVertical(){}
-
-CDrawTextInContextTestBoxVertical::~CDrawTextInContextTestBoxVertical(){}
-
-CDrawTextInContextTestBoxVertical* CDrawTextInContextTestBoxVertical::NewL()
-	{
-	CDrawTextInContextTestBoxVertical* self = new(ELeave) CDrawTextInContextTestBoxVertical;
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-void CDrawTextInContextTestBoxVertical::ConstructL()
-	{
-	BaseConstructL();
-	iClipFillRect = TRect(10,50,640,120);
-	iBaselineOffset = 40;
-	iUp = EFalse;
-	iTTextAlign = CGraphicsContext::ELeft;
-	}
-
-void CDrawTextInContextTestBoxVertical::DoDrawTextBitGc()
-	{
-	iRefBitGc->DrawTextVertical(iText,&iParam,iClipFillRect,iBaselineOffset,iUp,iTTextAlign);
-	}
-
-void CDrawTextInContextTestBoxVertical::DoDrawTextRemoteGc()
-	{
-	iRemoteGc->DrawTextVertical(iText,&iParam,iClipFillRect,iBaselineOffset,iUp,iTTextAlign);
-	}
-#endif //TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-
-void CleanUpFont(TAny* aFont)
-	{
-	//Will be called in case of a leave to release the font
-	CFont* font= static_cast<CFont*>(aFont);
-	TheClient->iScreen->ReleaseFont(font);
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0437
-@SYMPREQ            PREQ1543
-@SYMTestCaseDesc    Draw text using CWindowGc and CRemoteGc with both outline and shadow
-effect on.
-@SYMTestPriority    High
-@SYMTestStatus      Implemented
-@SYMTestActions     Create a font with both outline and shadow effects. Record the commands 
-(like setting colours,drawing text etc) using CRemoteGc and play the recorded commands on a window. Use the same
-commands in CWindowGc and draw text on a different window
-@SYMTestExpectedResults Text drawn using CWindowGc and CRemoteGc should be same
-*/
-void CTGc::TestOutlineAndShadowL()
-	{
-	TRect sourceRect(0, 0, TestWin->Size().iWidth, TestWin->Size().iHeight);
-	TRegionFix<1> clippingRegion(sourceRect);
-	
-	CWsScreenDevice* device = TheClient->iScreen;
-
-	_LIT(KText,"Outline and shadow");
-	TFontSpec fSpec(KTestFontTypefaceName,23);
-	fSpec.iFontStyle.SetBitmapType(EAntiAliasedGlyphBitmap);
-	fSpec.iFontStyle.SetEffects(FontEffect::EDropShadow, ETrue);
-	fSpec.iFontStyle.SetEffects(FontEffect::EOutline, ETrue);
-	
-	CFont *font;
-	User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInPixels((CFont *&)font, fSpec));
-	CleanupStack::PushL(TCleanupItem(CleanUpFont, font));
-	
-	CRemoteGc* remoteGc = CRemoteGc::NewL(device);
-	CleanupStack::PushL(remoteGc);
-	remoteGc->BeginDraw(sourceRect);
-	//Capturing the commands in remote gc
-	remoteGc->SetBrushColor(KRgbGreen);
-	remoteGc->SetShadowColor(KRgbDarkRed);
-	remoteGc->SetPenColor(KRgbBlack);
-	remoteGc->UseFont(font);
-	remoteGc->DrawText(KText, TPoint(2,40));
-	remoteGc->DiscardFont();
-	remoteGc->EndDraw();
-
-	RWsGraphicMsgBuf msgBuf;
-	CleanupClosePushL(msgBuf);
-	//Externalize the captured commands from remote gc in to a buffer
-	remoteGc->ExternalizeL(msgBuf, ETrue);
-
-	CWSGraphicsRes* wsGrap = new (ELeave) CWSGraphicsRes();
-	CleanupStack::PushL(wsGrap);
-	
-	CCommandBuffer* cmdBuf = CCommandBuffer::NewL();
-	CleanupStack::PushL(cmdBuf);
-	//Internalize the buffer with captured commands (from CRemoteGC) 
-	//in to CCommandBuffer
-	cmdBuf->InternalizeL(msgBuf.Pckg());
-	
-	TestWin->Win()->Invalidate();
-	TestWin->Win()->BeginRedraw();
-	TheGc->Activate(*TestWin->Win());
-	TheGc->Clear();
-	//Play the commands on test window using command buffer
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-	cmdBuf->Play(TPoint(0, 0), &clippingRegion, sourceRect, TheClient->iWs, *TheGc);
-#else
-	cmdBuf->Play(TPoint(),TRect(TestWin->Size()),*wsGrap,*TheGc);
-#endif
-	TheGc->Deactivate();
-	TestWin->Win()->EndRedraw();
-	
-	BaseWin->Win()->Invalidate();
-	BaseWin->Win()->BeginRedraw();
-	TheGc->Activate(*BaseWin->Win());
-	TheGc->Clear();
-	TheGc->SetBrushColor(KRgbGreen);
-	TheGc->SetShadowColor(KRgbDarkRed);
-	TheGc->SetPenColor(KRgbBlack);
-	TheGc->UseFont(font);
-	//Draw the text on base window using CWindowGC
-	TheGc->DrawText(KText, TPoint(2, 40));
-	TheGc->DiscardFont();
-	TheGc->Deactivate();
-	BaseWin->Win()->EndRedraw();
-	TheClient->iWs.Finish();
-	TheClient->WaitForRedrawsToFinish();
-
-	//Check the text drawn on base and test windows.
-	CheckRect(BaseWin, TestWin, TRect(0, 0, BaseWin->Size().iWidth, BaseWin->Size().iHeight), _L("CTGc::TestOutlineAndShadowL()"));
-
-	CleanupStack::PopAndDestroy(4, remoteGc); //cmdBuf, wsGrap, msgBuf and remoteGc
-	CleanupStack::Pop();//font
-	TheClient->iScreen->ReleaseFont(font);
-	}
-
-void CTGc::TestGcClipRectOrigin_DrawContent(TestWindow& aWindow, TBool bActivateBeforeRedraw /*= ETrue*/)
-	{
-	TSize winSize = aWindow.Size();
-	TPoint gcOrigin(winSize.iWidth >> 3, winSize.iWidth >> 3);
-	TRect gcClipRect(0, 0, (winSize.iWidth * 3) >> 2, (winSize.iHeight * 3) >> 2);
-	TRect ellipseRect(gcClipRect);
-	// Shrink the ellipse for better visibility and to fit well within the clip area.
-	ellipseRect.Shrink(3, 3);
-	TSize penSize(1, 1);
-
-	aWindow.Win()->SetBackgroundColor(KRgbGreen);
-	aWindow.ClearWin();
-	aWindow.Win()->Invalidate();
-
-	if(!bActivateBeforeRedraw)
-		{
-		aWindow.Win()->BeginRedraw();
-		}
-
-	TheGc->Activate(*(aWindow.Win()));
-	TheGc->SetOrigin(gcOrigin);
-	TheGc->SetClippingRect(gcClipRect);
-
-	if(bActivateBeforeRedraw)
-		{
-		aWindow.Win()->BeginRedraw();
-		}
-
-	TheGc->SetBrushColor(KRgbDarkRed);
-	TheGc->SetPenColor(KRgbDarkRed);
-	TheGc->SetPenSize(penSize);
-	TheGc->SetPenStyle(CGraphicsContext::ESolidPen);
-	TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TheGc->DrawEllipse(ellipseRect);
-	TheGc->SetBrushStyle(CGraphicsContext::ENullBrush);
-	TheGc->SetPenColor(KRgbYellow);
-	TheGc->SetPenStyle(CGraphicsContext::EDashedPen);
-	TheGc->DrawRect(gcClipRect);
-
-	aWindow.Win()->EndRedraw();
-	TheGc->Deactivate();
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0471
-@SYMTestCaseDesc    This test is to verify that the GC correctly applies the clip rect and
-					origin attributes irrespective of whether the GC is activated on the
-					window before or after the BeginRedraw.
-@SYMDEF				PDEF120091
-@SYMTestPriority    High
-@SYMTestStatus      Implemented
-@SYMTestActions     The test has following steps:
-	1. For the Test window follow the steps:
-		A. Activate the GC on Test window.
-		B. Set the Origin of the GC to centre of the window.
-		C. Set the Clipping rectangle of the GC to half the size of the window.
-		D. In the BeginDraw and EndDraw call bracket perform the following:
-			a. Draw an ellipse with the rectangle smaller by 5 pixels than the clip rectangle.
-			b. Draw a rectangle that is size of the clip rectangle.
-		E. Deactivate the GC. 
-	2. For the Base window follow the steps:
-		A. In the BeginDraw and EndDraw call bracket perform the following:
-			a. Activate the GC on Base window.
-			b. Set the Origin of the GC to centre of the window.
-			c. Set the Clipping rectangle of the GC to half the size of the window.
-			d. Draw an ellipse with the rectangle smaller by 5 pixels than the clip rectangle.
-			e. Draw a rectangle that is size of the clip rectangle.
-			f. Deactivate the GC. 
-	3. Compare Test and Base window.
-@SYMTestExpectedResults Both the Test and Base window should have the complete
-						non-clipped ellipse completely encapsulated within the rectangle. 
-*/
-void CTGc::TestGcClipRectOrigin()
-	{
-	TestGcClipRectOrigin_DrawContent(*BaseWin, EFalse);
-	TestGcClipRectOrigin_DrawContent(*TestWin, ETrue);
-	
-	TheClient->Flush();
-	
-	CheckRect(BaseWin, TestWin, TRect(0, 0, BaseWin->Size().iWidth, BaseWin->Size().iHeight), _L("CTGc::TestGcClipRectOriginL()"));
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0469
-@SYMDEF             INC116406
-@SYMTestCaseDesc    Try playback on MWsGraphicsContext and CWindowGc to check that the background colour is
-set correctly.
-@SYMTestPriority    High
-@SYMTestStatus      Implemented
-@SYMTestActions
-@SYMTestExpectedResults Text drawn using CWindowGc should use the background colour of
-the window, and MWsGraphicsContext should use transparent white.
-*/
-void CTGc::TestResetWithBackgroundColorL()
-	{
-	const TRect KSourceRect(0, 0, TestWin->Size().iWidth, TestWin->Size().iHeight);
-	const TRegionFix<1> KClippingRegion(KSourceRect);
-	
-	CWsScreenDevice* device = TheClient->iScreen;
-
-	CRemoteGc* remoteGc = CRemoteGc::NewL(device);
-	CleanupStack::PushL(remoteGc);
-	
-	//note this remote GC has not been activated on any window
-	remoteGc->BeginDraw(KSourceRect);
-
-	//Draw the commands in remote gc
-	remoteGc->SetBrushColor(KRgbGreen);  //nothing green is seen in this test
-
-	remoteGc->Reset(); //This resets the brush colour to the background colour of the window
-					   //where playback is, in the case of playing back to a window
-					   //however with a CFbsBitGc the color is transparent white, as there is no window.
-	remoteGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	remoteGc->SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
-	remoteGc->DrawRect(KSourceRect);
-	remoteGc->EndDraw();
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-	CDirectGdiDriver* theDGdiDriver = CDirectGdiDriver::Static();
-	User::LeaveIfNull(theDGdiDriver);
-	
-	TSgImageInfo info;
-	info.iUsage = ESgUsageDirectGdiTarget | ESgUsageCompositionSource;
-	info.iSizeInPixels = TSize(TestWin->Size().iWidth, TestWin->Size().iHeight);
-	info.iPixelFormat = EUidPixelFormatXRGB_8888;//among display modes with alpha channel only pre-multiply alpha is supported in directGDI currently
-	
-	RSgImageCollection imageCollection;
-	CleanupClosePushL(imageCollection);
-	TInt res = imageCollection.Create(info, 1);
-	User::LeaveIfError(res);
-	RSgImage image;
-	CleanupClosePushL(image);
-	res = imageCollection.OpenImage(0, image);
-	User::LeaveIfError(res);
-	RDirectGdiImageTarget imageTarget(*theDGdiDriver);
-	CleanupClosePushL(imageTarget);
-	res = imageTarget.Create(image);
-	User::LeaveIfError(res);
-#endif
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-	//create a bitmap
-	CFbsBitmap *bitmap = new (ELeave) CFbsBitmap();
-	User::LeaveIfError(bitmap->Create(TSize(TestWin->Size().iWidth, TestWin->Size().iHeight), EColor16MA));
-	CleanupStack::PushL(bitmap);
-
-	CFbsBitmapDevice  *fbsDevice = CFbsBitmapDevice::NewL(bitmap);
-	CleanupStack::PushL(fbsDevice);
-#endif
-
-	//prepare the command buffer for playback
-	RWsGraphicMsgBuf msgBuf;
-	CleanupClosePushL(msgBuf);
-
-	//Externalize the captured commands from remote gc in to a buffer
-	remoteGc->ExternalizeL(msgBuf, ETrue);
-
-	CWSGraphicsRes* wsGrap = new (ELeave) CWSGraphicsRes();
-	CleanupStack::PushL(wsGrap);
-
-	CCommandBuffer* cmdBuf = CCommandBuffer::NewL();
-	CleanupStack::PushL(cmdBuf);
-	cmdBuf->InternalizeL(msgBuf.Pckg());
-
-	TRgb color;
-	TRgb testColor(KRgbWhite);
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-	CDirectGdiGcWrapper* directGdiGcWrapper=CDirectGdiGcWrapper::NewL(imageTarget);
-	CleanupStack::PushL(directGdiGcWrapper);
-	cmdBuf->Play(TPoint(),&KClippingRegion,KSourceRect,*wsGrap,*directGdiGcWrapper);
-
-	//check that the background has been cleared to transparent white.
-	image.GetInfo(info);
-	info.iUsage = ESgUsageNone;
-	info.iCpuAccess = ESgCpuAccessReadOnly;
-	RSgImage image1;
-	CleanupClosePushL(image1);
-	res = image1.Create(info, image);
-	const TAny* data;
-	TInt stride = 0;
-	res = image1.MapReadOnly(data, stride);
-	User::LeaveIfError(res);
-	TPoint pixel(10,10);
-	TInt offset = pixel.iY * stride + pixel.iX * 4;
-	TAny* non_const_data = const_cast <TAny*> (data);
-	TUint8* pointData = static_cast <TUint8*> (non_const_data) + offset;
-	color = *(reinterpret_cast <TRgb*> (pointData));
-	image1.Unmap();
-#endif
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-	CFbsBitGc* fbsBitGc=NULL;
-	User::LeaveIfError(fbsDevice->CreateContext(fbsBitGc));
-	CleanupStack::PushL(fbsBitGc);
-	fbsBitGc->Activate(fbsDevice);
-	cmdBuf->Play(TPoint(0, 0), KSourceRect, *wsGrap, *fbsBitGc);
-	bitmap->GetPixel(color, TPoint(10,10));
-	testColor.SetAlpha(0);
-#endif
-	iStep->TEST(color==testColor);
-
-	//now test drawing to a window to ensure that the brush colour is
-	//the window background colour
-
-	//display a blue window
-	BaseWin->Win()->SetBackgroundColor(KRgbBlue);
-	BaseWin->Win()->Invalidate();
-	BaseWin->Win()->BeginRedraw();
-	TheGc->Activate(*BaseWin->Win());
-	TheGc->Clear();
-	TheGc->Deactivate();
-	BaseWin->Win()->EndRedraw();
-	TheClient->iWs.Finish();
-	TheClient->WaitForRedrawsToFinish();
-
-	//start drawing the display commands with a green background
-	
-	BaseWin->Win()->SetBackgroundColor(KRgbYellow);
-	BaseWin->Win()->Invalidate();
-	BaseWin->Win()->BeginRedraw();
-	TheGc->Activate(*BaseWin->Win());
-
-	//Play the commands on test window using command buffer
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-	cmdBuf->Play(TPoint(0, 0), &KClippingRegion, KSourceRect, TheClient->iWs, *TheGc);
-#else
-	cmdBuf->Play(TPoint(0, 0), KSourceRect, *wsGrap, *TheGc);
-#endif
-
-	TheGc->Deactivate();
-	BaseWin->Win()->EndRedraw();
-	TheClient->iWs.Finish();
-	TheClient->WaitForRedrawsToFinish();
-
-	//check that the background has been cleared to yellow, using brush colour
-	TPoint position = BaseWin->Win()->InquireOffset(*TheClient->iGroup->WinTreeNode());
-	position.iX+=10;
-	position.iY+=10;
-	TheClient->iScreen->GetPixel(color, position);
-	iStep->TEST(color==KRgbYellow);
-
-	BaseWin->Win()->SetBackgroundColor(KRgbGreen); //set back to original backgroundcolor
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-	CleanupStack::PopAndDestroy(9, remoteGc);
-#else
-	CleanupStack::PopAndDestroy(7, remoteGc);
-#endif
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0481
-@SYMPREQ            1841
-@SYMTestCaseDesc    Create font and graphics with various effect effects. Record the commands 
-(like setting colours,drawing text etc) using CRemoteGc and play the recorded commands on a window. Use the same
-commands in CWindowGc and draw text on a different window
-@SYMTestPriority    Medium
-@SYMTestStatus      Implemented
-@SYMTestActions
-@SYMTestExpectedResults Text/graphics drawn using CWindowGc and CRemoteGc should be same
-*/
-void CTGc::TestCommandBufferL()
-	{	
-	CWsScreenDevice* device = TheClient->iScreen;
-
-	_LIT(KBuffText,"Command Buffer");
-	TFontSpec fSpec(KTestFontTypefaceName,23);
-	fSpec.iFontStyle.SetBitmapType(EAntiAliasedGlyphBitmap);
-	fSpec.iFontStyle.SetEffects(FontEffect::EDropShadow, ETrue);
-	fSpec.iFontStyle.SetEffects(FontEffect::EOutline, ETrue);
-	
-	CFont *font;
-	User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInPixels((CFont *&)font, fSpec));
-	CleanupStack::PushL(TCleanupItem(CleanUpFont, font));
-	
-	CRemoteGc* remoteGc = CRemoteGc::NewL(device);
-	CleanupStack::PushL(remoteGc);	
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-	//-------create image---------
-	CDirectGdiDriver* theDGdiDriver = CDirectGdiDriver::Static();
-	User::LeaveIfNull(theDGdiDriver);
-	const TSize KImageSize = TSize(2, 2);
-	TSgImageInfo info;
-	info.iUsage = ESgUsageWindowGcSource;
-	info.iSizeInPixels = KImageSize;
-	info.iPixelFormat = EUidPixelFormatRGB_565;
-	info.iShareable = ETrue;
-	const TInt stride = KImageSize.iWidth * 2;
-	TUint8* buf = (TUint8*) (User::AllocL(KImageSize.iHeight * stride));
-	CleanupStack::PushL(buf);
-	TUint16* bufCur = ((TUint16*)buf);
-	*bufCur = KRgbRed.Color64K();
-	*(bufCur + 1) = KRgbRed.Color64K();
-	*(bufCur + 2) = KRgbRed.Color64K();
-	*(bufCur + 3) = KRgbRed.Color64K();
-
-	RSgImage image;
-	TInt res = image.Create(info, buf, stride);
-	User::LeaveIfError(res);
-	CleanupClosePushL(image);	
-	RWsDrawableSource drawableSource(TheClient->iWs);
-	res = drawableSource.Create(image, TheClient->iScreen->GetScreenNumber());
-	if(res == KErrNotSupported)
-		{
-		INFO_PRINTF1(_L("The current screen is not supports drawable source. This test case terminates now."));
-		CleanupStack::PopAndDestroy(3, remoteGc);
-		CleanupStack::Pop();//font
-		TheClient->iScreen->ReleaseFont(font);
-		return;
-		}
-	User::LeaveIfError(res);
-	CleanupClosePushL(drawableSource);	
-	//-------end create image---------
-#endif	
-	remoteGc->ResetCommandBuffer();
-	remoteGc->BeginDraw(TRect(0, 0, TestWin->Size().iWidth, TestWin->Size().iHeight));
-	//Capturing the commands in remote gc
-	remoteGc->Clear();
-	remoteGc->DrawRect(TRect(10,10,30,30));
-	remoteGc->Clear(TRect(10,10,11,11));
-	remoteGc->CopyRect(TPoint(5,5), TRect(25,25,30,30));
-	CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
-	CFbsBitmap* bitmapMask = new (ELeave) CFbsBitmap;
-	User::LeaveIfError(bitmap->Load(_L("Z:\\WSTEST\\WSAUTOTEST.MBM"), EMbmWsautotestCircles24b));
-	User::LeaveIfError(bitmapMask->Load(_L("Z:\\WSTEST\\WSAUTOTEST.MBM"), EMbmWsautotestCircles_mask2b));
-	remoteGc->BitBlt(TPoint(100,100), bitmap);
-	remoteGc->BitBlt(TPoint(0,0), bitmap, TRect(0,0,1,1));	
-	remoteGc->BitBltMasked(TPoint(0,5), bitmap, TRect(0,0,1,1), bitmapMask, EFalse);
-	CWsBitmap* bitmapWs = new (ELeave) CWsBitmap(TheClient->iWs);
-	CWsBitmap* bitmapWsMask = new (ELeave) CWsBitmap(TheClient->iWs);
-	User::LeaveIfError(bitmapWs->Load(_L("Z:\\WSTEST\\TEST.MBM"), 0));
-	remoteGc->BitBlt(TPoint(110,110), bitmapWs);
-	remoteGc->BitBlt(TPoint(5,0), bitmapWs, TRect(0,0,1,1));
-	remoteGc->BitBltMasked(TPoint(10,0), bitmap, TRect(0,0,1,1), bitmapWsMask, EFalse);
-	remoteGc->SetFadingParameters(128,128);
-	remoteGc->SetFaded(EFalse);	
-	remoteGc->AlphaBlendBitmaps(TPoint(2,2), bitmap, TRect(0,0,1,1), bitmapMask, TPoint(2,2));
-	remoteGc->AlphaBlendBitmaps(TPoint(3,3), bitmapWs, TRect(0,0,1,1), bitmapWsMask, TPoint(2,2));
-	remoteGc->SetOrigin(TPoint(0,30));
-	remoteGc->SetDrawMode(CGraphicsContext::EDrawModePEN);
-	remoteGc->SetClippingRect(TRect(0,0,10,10));
-	remoteGc->SetPenStyle(CGraphicsContext::ESolidPen);
-	remoteGc->SetPenSize(TSize(1,2));
-	remoteGc->UseBrushPattern(bitmap);
-	remoteGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	remoteGc->SetBrushOrigin(TPoint(0,0));
-	remoteGc->DrawPie(TRect(0,0,15,15),TPoint(0,8),TPoint(15,8));
-	remoteGc->CancelClippingRect();
-	remoteGc->DiscardBrushPattern();
-	remoteGc->CancelClippingRegion();
-	remoteGc->Reset();
-	remoteGc->SetOrigin(TPoint(0,0));
-	remoteGc->SetUnderlineStyle(EUnderlineOff);
-	remoteGc->SetStrikethroughStyle(EStrikethroughOff);
-	remoteGc->SetWordJustification(1,2);
-	remoteGc->SetCharJustification(1,2);
-	remoteGc->UseFont(font);
-	remoteGc->DrawText(KBuffText,TRect(50,0,100,50),10,CGraphicsContext::ELeft,0);
-	remoteGc->DrawTextVertical(KBuffText,TPoint(170,20),EFalse);
-	remoteGc->DrawTextVertical(KBuffText,TRect(120,20,150,100),5,EFalse,CGraphicsContext::ELeft,0);	
-	remoteGc->MoveTo(TPoint(25,150));
-	remoteGc->MoveBy(TPoint(5,5));
-	remoteGc->DrawLineTo(TPoint(35,160));
-	remoteGc->DrawLine(TPoint(35,160),TPoint(25,150));
-	remoteGc->DrawLineBy(TPoint(15,6));	
-	remoteGc->Plot(TPoint(5,5));	
-	remoteGc->DrawArc(TRect(0,80,10,90),TPoint(0,85),TPoint(10,85));
-	remoteGc->DrawEllipse(TRect(0,90,10,100));	
-	remoteGc->DrawRoundRect(TRect(30,80,50,100),TSize(5,5));	
-	remoteGc->DrawBitmap(TPoint(150,150),bitmap);	
-	remoteGc->DrawBitmap(TRect(160,160,170,170), bitmap);	
-	remoteGc->DrawBitmap(TRect(175,175,180,180), bitmap, TRect(0,5,5,10));	
-	remoteGc->DrawBitmapMasked(TRect(185,185,190,190), bitmap, TRect(0,50,5,55),bitmapMask,EFalse);
-	remoteGc->DrawBitmapMasked(TRect(195,195,200,200), bitmapWs, TRect(0,50,5,55),bitmapWsMask,EFalse);		
-	CArrayFixFlat<TPoint>* polyPoints = new(ELeave) CArrayFixFlat<TPoint>(3); //CArrayFixFlat
-	CleanupStack::PushL(polyPoints);
-	TRect rect (200,0,200,100);
-	polyPoints->AppendL(rect.iTl);
-	polyPoints->AppendL(rect.Center());
-	polyPoints->AppendL(TPoint(rect.iBr.iX, rect.iTl.iY));	
-	remoteGc->DrawPolyLine(polyPoints);
-	remoteGc->DrawPolyLine(&polyPoints->At(0), 3);
-	remoteGc->DrawPolygon(polyPoints, CGraphicsContext::EWinding);
-	remoteGc->DrawPolygon(&polyPoints->At(0), 3, CGraphicsContext::EAlternate);
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-	MWsDrawResource* dr = static_cast<MWsDrawResource*>(remoteGc->Interface(KMWsDrawResourceInterfaceUid));
-	if(dr)
-		dr->DrawResource(TPoint(30, 40), drawableSource);
-#endif
-	RRegion region;
-	remoteGc->SetClippingRegion(region);
-	remoteGc->DiscardFont();
-	remoteGc->EndDraw();
-
-	RWsGraphicMsgBuf msgBuf;
-	CleanupClosePushL(msgBuf);
-	//Externalize the captured commands from remote gc in to a buffer
-	remoteGc->ExternalizeL(msgBuf, EFalse);
-	
-	CCommandBuffer* cmdBuf = CCommandBuffer::NewL();
-	CleanupStack::PushL(cmdBuf);
-	const CCommandBuffer* testCmdBuf = CCommandBuffer::NewL();
-	if(cmdBuf->IsIdentical(*testCmdBuf)==EFalse)
-		{
-		User::Panic(_L("TestCommandBufferL"), KErrGeneral);
-		}
-	delete testCmdBuf;
-	//Internalize the buffer with captured commands (from CRemoteGC) 
-	//in to CCommandBuffer
-	cmdBuf->InternalizeL(msgBuf.Pckg());
-	
-	TheGc->Activate(*TestWin->Win());
-	TestWin->Win()->Invalidate();
-	
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-	/*
-	 * Make sure anything that can leave is done outside the
-	 * BeginRedraw/EndRedraw bracket.
-	 */
-	CWSGraphicsRes* wsGrap=new(ELeave) CWSGraphicsRes();
-	CleanupStack::PushL(wsGrap);
-#endif
-	/*
-	 * Note we need to still do BeginRedraw/EndRedraw for the TestWin Window
-	 * even though the CRemoteGc we are going to Play into TestWin already has
-	 * BeginRedraw/EndRedraw commands issued into it.  Those commands just allow
-	 * for replacement of draw ops already in the CRemoteGc to be replaced by
-	 * new draw ops covering the same area.  The BeginRedraw/EndRedraws never 
-	 * get Play()'ed into TestWin.
-	 */
-	TestWin->Win()->BeginRedraw();
-	TheGc->Clear();
-	//Play the commands on test window using command buffer
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-	cmdBuf->Play(TPoint(), NULL, TRect(TestWin->Size()), TheClient->iWs, *TheGc);
-#endif
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-	cmdBuf->Play(TPoint(),TRect(TestWin->Size()),*wsGrap,*TheGc);
-	CleanupStack::PopAndDestroy(wsGrap);
-#endif
-	TheGc->Deactivate();
-	TestWin->Win()->EndRedraw();
-	remoteGc->ResetCommandBuffer();
-	BaseWin->Win()->Invalidate();
-	BaseWin->Win()->BeginRedraw();
-	TheGc->Activate(*BaseWin->Win());
-	TheGc->Clear();
-	TheGc->DrawRect(TRect(10,10,30,30));
-	TheGc->Clear(TRect(10,10,11,11));
-	TheGc->CopyRect(TPoint(5,5), TRect(25,25,30,30));
-	TheGc->BitBlt(TPoint(100,100), bitmap);
-	TheGc->BitBlt(TPoint(0,0), bitmap, TRect(0,0,1,1));	
-	TheGc->BitBltMasked(TPoint(0,5), bitmap, TRect(0,0,1,1), bitmapMask, EFalse);
-	TheGc->BitBlt(TPoint(110,110), bitmapWs);
-	TheGc->BitBlt(TPoint(5,0), bitmapWs, TRect(0,0,1,1));
-	TheGc->BitBltMasked(TPoint(10,0), bitmap, TRect(0,0,1,1), bitmapWsMask, EFalse);
-	TheGc->SetFadingParameters(128,128);
-	TheGc->SetFaded(EFalse);	
-	TheGc->AlphaBlendBitmaps(TPoint(2,2), bitmap, TRect(0,0,1,1), bitmapMask, TPoint(2,2));
-	TheGc->AlphaBlendBitmaps(TPoint(3,3), bitmapWs, TRect(0,0,1,1), bitmapWsMask, TPoint(2,2));
-	TheGc->SetOrigin(TPoint(0,30));
-	TheGc->SetDrawMode(CGraphicsContext::EDrawModePEN);
-	TheGc->SetClippingRect(TRect(0,0,10,10));
-	TheGc->SetPenStyle(CGraphicsContext::ESolidPen);
-	TheGc->SetPenSize(TSize(1,2));
-	TheGc->UseBrushPattern(bitmap);
-	TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TheGc->SetBrushOrigin(TPoint(0,0));
-	TheGc->DrawPie(TRect(0,0,15,15),TPoint(0,8),TPoint(15,8));
-	TheGc->CancelClippingRect();
-	TheGc->DiscardBrushPattern();
-	TheGc->CancelClippingRegion();
-	TheGc->Reset();
-	TheGc->SetOrigin(TPoint(0,0));
-	TheGc->SetUnderlineStyle(EUnderlineOff);
-	TheGc->SetStrikethroughStyle(EStrikethroughOff);
-	TheGc->SetWordJustification(1,2);
-	TheGc->SetCharJustification(1,2);
-	TheGc->UseFont(font);
-	TheGc->DrawText(KBuffText,TRect(50,0,100,50),10,CGraphicsContext::ELeft,0);
-	TheGc->DrawTextVertical(KBuffText,TPoint(170,20),EFalse);
-	TheGc->DrawTextVertical(KBuffText,TRect(120,20,150,100),5,EFalse,CGraphicsContext::ELeft,0);	
-	TheGc->MoveTo(TPoint(25,150));
-	TheGc->MoveBy(TPoint(5,5));
-	TheGc->DrawLineTo(TPoint(35,160));
-	TheGc->DrawLine(TPoint(35,160),TPoint(25,150));
-	TheGc->DrawLineBy(TPoint(15,6));	
-	TheGc->Plot(TPoint(5,5));	
-	TheGc->DrawArc(TRect(0,80,10,90),TPoint(0,85),TPoint(10,85));
-	TheGc->DrawEllipse(TRect(0,90,10,100));	
-	TheGc->DrawRoundRect(TRect(30,80,50,100),TSize(5,5));	
-	TheGc->DrawBitmap(TPoint(150,150),bitmap);	
-	TheGc->DrawBitmap(TRect(160,160,170,170), bitmap);	
-	TheGc->DrawBitmap(TRect(175,175,180,180), bitmap, TRect(0,5,5,10));	
-	TheGc->DrawBitmapMasked(TRect(185,185,190,190), bitmap, TRect(0,50,5,55),bitmapMask,EFalse);
-	TheGc->DrawBitmapMasked(TRect(195,195,200,200), bitmapWs, TRect(0,50,5,55),bitmapWsMask,EFalse);
-	TheGc->DrawPolyLine(polyPoints);
-	TheGc->DrawPolyLine(&polyPoints->At(0), 3);
-	TheGc->DrawPolygon(polyPoints, CGraphicsContext::EWinding);
-	TheGc->DrawPolygon(&polyPoints->At(0), 3, CGraphicsContext::EAlternate);
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-	TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TheGc->SetBrushColor(KRgbRed);
-	TheGc->SetPenColor(KRgbRed);
-	TheGc->DrawRect(TRect(30, 40, 32, 42));
-#endif
-	TheGc->DiscardFont();
-	TheGc->Deactivate();
-	BaseWin->Win()->EndRedraw();
-	TheClient->Flush();
-	TheClient->WaitForRedrawsToFinish();
-
-	//Check the text drawn on base and test windows.
-	TBool err = CheckRect(BaseWin, TestWin, TRect(0, 0, BaseWin->Size().iWidth, BaseWin->Size().iHeight), _L("CTGc::TestCommandBufferL()"));
-	if (err)
-	    {
-	    INFO_PRINTF1(_L("The CheckRect function returned error."));
-	    }
-	delete bitmap;
-	INFO_PRINTF1(_L("bitmap deleted."));
-	delete bitmapMask;
-	INFO_PRINTF1(_L("bitmapMask deleted."));
-	delete bitmapWs;
-	INFO_PRINTF1(_L("bitmapWs deleted."));
-	delete bitmapWsMask;
-	INFO_PRINTF1(_L("bitmapWsMask deleted."));
-	
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-	CleanupStack::PopAndDestroy(7, remoteGc);
-#else
-	CleanupStack::PopAndDestroy(4, remoteGc);
-#endif	
-	CleanupStack::Pop();//font
-	INFO_PRINTF1(_L("CleanupStack popped."));
-	TheClient->iScreen->ReleaseFont(font);
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0482
-@SYMPREQ            1841
-@SYMTestCaseDesc    Play empty command buffer.
-@SYMTestPriority    Medium
-@SYMTestStatus      Implemented
-@SYMTestActions
-@SYMTestExpectedResults return KErrEof error
-*/
-void CTGc::TestEmptyCommandBufferL()
-	{
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-	CWSGraphicsRes* wsGrap = new (ELeave) CWSGraphicsRes();
-	CleanupStack::PushL(wsGrap);
-#endif
-
-	CCommandBuffer* cmdBuf = CCommandBuffer::NewL();
-	CleanupStack::PushL(cmdBuf);
-
-	TheGc->Activate(*TestWin->Win());
-	TheGc->Clear();
-	//Play the commands on test window using command buffer
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-	TInt err = cmdBuf->Play(TPoint(),TRect(TestWin->Size()),*wsGrap,*TheGc);
-#else
-	TInt err = cmdBuf->Play(TPoint(),NULL,TRect(TestWin->Size()),TheClient->iWs,*TheGc);
-#endif
-	if(err!=KErrEof)
-		{
-		User::Panic(_L("TestEmptyCommandBufferL"), KErrGeneral);
-		}
-	TheGc->Deactivate();
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-	CleanupStack::PopAndDestroy(2, wsGrap); //cmdBuf, wsGrap, msgBuf and remoteGc
-#else
-	CleanupStack::PopAndDestroy(cmdBuf);
-#endif
-	}
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0486
-@SYMPREQ            PREQ2095
-@SYMTestCaseDesc    Draw text using CWindowGc and CRemoteGc with both outline and shadow
-effect on.
-@SYMTestPriority    High
-@SYMTestStatus      Implemented
-@SYMTestActions     Create a font with both outline and shadow effects, also use ClippingRect 
-and ClippingRegion. Record the commands using CRemoteGc and play the recorded commands on a 
-bitmap using MWsGraphicsContext. Use the same commands in CWindowGc and draw text on a 
-different window
-@SYMTestExpectedResults Text drawn using CWindowGc and CRemoteGc(MWsGraphicsContext) should be same
-*/
-void CTGc::TestCRemoteGcAndMWsGraphicsContextClippingRectL()
-	{
-	const TRect KTestRect(0, 0, TestWin->Size().iWidth, TestWin->Size().iHeight);
-	const TRegionFix<1> KTestRegion(KTestRect);
-	const TRect KClippingRect1(5, 5, TestWin->Size().iWidth-10, 90);
-	const TRegionFix<1> KClippingRegion(KClippingRect1);
-	const TRect KClippingRect2(15, 15, TestWin->Size().iWidth-10, TestWin->Size().iHeight-10);
-	
-	CWsScreenDevice* device = TheClient->iScreen;
-	/*
-	 * On hardware, the first screen runs in 64K colors, but the second screen (TV OUT)
-	 * cannot run in this mode, it instead falls back to 16M colors.  We need to ensure
-	 * that we use matching color depths for our off-screen bitmaps so that accuracy is
-	 * not lost since we compare bitmaps from the screen versus off-screen.
-	 */
-	const TDisplayMode displayMode = device->DisplayMode();
-		
-	_LIT(KText,"RemoteGc & MWsGraphicsContext");
-	TFontSpec fSpec(KTestFontTypefaceName,23);
-	fSpec.iFontStyle.SetBitmapType(EAntiAliasedGlyphBitmap);
-	fSpec.iFontStyle.SetEffects(FontEffect::EDropShadow, ETrue);
-	fSpec.iFontStyle.SetEffects(FontEffect::EOutline, ETrue);
-	
-	CFont *font;
-	User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInPixels((CFont *&)font, fSpec));
-	CleanupStack::PushL(TCleanupItem(CleanUpFont, font));
-
-	//Record the commands using CRemoteGc
-	CRemoteGc* remoteGc = CRemoteGc::NewL(device);
-	CleanupStack::PushL(remoteGc);
-	remoteGc->BeginDraw(KTestRect);
-	//fill background with white
-	remoteGc->SetPenStyle(CFbsBitGc::ENullPen);
-	remoteGc->SetBrushStyle(CFbsBitGc::ESolidBrush);
-	remoteGc->SetBrushColor(KRgbWhite);
-	remoteGc->DrawRect(TRect(TPoint(0,0), TestWin->Size()));
-	remoteGc->SetPenStyle(CFbsBitGc::ESolidPen);
-	//Capturing the commands in remote gc
-	remoteGc->SetClippingRect(KClippingRect2);
-	remoteGc->SetClippingRegion(KClippingRegion);
-	remoteGc->SetBrushStyle(CFbsBitGc::ESolidBrush);
-	remoteGc->SetBrushColor(TRgb(0,150,150));
-	remoteGc->DrawRect(TRect(TPoint(0,0), TSize(160,60)));
-	remoteGc->SetBrushColor(TRgb(150,100,150));
-	remoteGc->DrawRect(TRect(TPoint(0,60), TSize(160,60)));
-	remoteGc->SetBrushColor(KRgbGreen);
-	remoteGc->SetShadowColor(KRgbDarkRed);
-	remoteGc->SetPenColor(KRgbBlack);
-	remoteGc->UseFont(font);
-	remoteGc->DrawText(KText, TPoint(2,40));
-	remoteGc->DiscardFont();
-	remoteGc->EndDraw();
-
-	RWsGraphicMsgBuf msgBuf;
-	CleanupClosePushL(msgBuf);
-	//Externalize the captured commands from remote gc in to a buffer
-	remoteGc->ExternalizeL(msgBuf, ETrue);
-	
-	CCommandBuffer* cmdBuf = CCommandBuffer::NewL();
-	CleanupStack::PushL(cmdBuf);
-	//Internalize the buffer with captured commands (from CRemoteGC) 
-	//in to CCommandBuffer
-	cmdBuf->InternalizeL(msgBuf.Pckg());
-	
-	CDirectGdiDriver* theDGdiDriver = CDirectGdiDriver::Static();
-	User::LeaveIfNull(theDGdiDriver);
-	
-	TSgImageInfo info;
-	info.iUsage = ESgUsageDirectGdiTarget | ESgUsageDirectGdiSource | ESgUsageCompositionSource;
-	info.iSizeInPixels = TestWin->Size();
-	info.iPixelFormat = PixelFormatFromDisplayMode(displayMode);
-	
-	RSgImageCollection imageCollection;
-	CleanupClosePushL(imageCollection);
-	TInt res = imageCollection.Create(info, 1);
-	User::LeaveIfError(res);
-	RSgImage image;
-	CleanupClosePushL(image);
-	res = imageCollection.OpenImage(0, image);
-	User::LeaveIfError(res);
-	RDirectGdiImageTarget imageTarget(*theDGdiDriver);
-	CleanupClosePushL(imageTarget);
-	
-	res = imageTarget.Create(image);
-	User::LeaveIfError(res);
-	
-	CDirectGdiGcWrapper* directGdiGcWrapper = CDirectGdiGcWrapper::NewL(imageTarget);
-	CleanupStack::PushL(directGdiGcWrapper);
-	
-	//Dummy class created
-	CWSGraphicsRes* wsGrap = new (ELeave) CWSGraphicsRes();
-	CleanupStack::PushL(wsGrap);
-
-	//Play the commands on test window using command buffer
-	cmdBuf->Play(TPoint(),&KTestRegion,KTestRect,*wsGrap,*directGdiGcWrapper);
-
-	//Set window back to same as test bitmap background
-	BaseWin->Win()->SetBackgroundColor(KRgbWhite);
-
-	BaseWin->Win()->Invalidate();
-	BaseWin->Win()->BeginRedraw();
-	TheGc->Activate(*BaseWin->Win());
-	TheGc->Clear();
-	TheGc->SetClippingRect(KClippingRect2);
-	TheGc->SetClippingRegion(KClippingRegion);
-	TheGc->SetBrushStyle(CFbsBitGc::ESolidBrush);
-	TheGc->SetBrushColor(TRgb(0,150,150));
-	TheGc->DrawRect(TRect(TPoint(0,0), TSize(160,60)));
-	TheGc->SetBrushColor(TRgb(150,100,150));
-	TheGc->DrawRect(TRect(TPoint(0,60), TSize(160,60)));
-	TheGc->SetBrushColor(KRgbGreen);
-	TheGc->SetShadowColor(KRgbDarkRed);
-	TheGc->SetPenColor(KRgbBlack);
-	TheGc->UseFont(font);
-	//Draw the text on base window using CWindowGC
-	TheGc->DrawText(KText, TPoint(2, 40));
-	TheGc->DiscardFont();
-	TheGc->Deactivate();
-	BaseWin->Win()->EndRedraw();
-	TheClient->iWs.Finish();
-	TheClient->WaitForRedrawsToFinish();
-
-	//Create a bitmap and then copy the screen to it
-	TRect rc(TRect(BaseWin->Win()->AbsPosition(), BaseWin->Win()->Size()));
-	CFbsBitmap *screenBitmap = new (ELeave) CFbsBitmap();
-	User::LeaveIfError(screenBitmap->Create(rc.Size(), displayMode));
-	CleanupStack::PushL(screenBitmap);
-	TheClient->iScreen->CopyScreenToBitmap(screenBitmap, rc);
-
-	CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
-	CleanupStack::PushL(bitmap);
-
-	image.GetInfo(info);
-	bitmap->Create(info.iSizeInPixels, displayMode);
-	TRect rect(info.iSizeInPixels);
-	CopyImageToBitmapL(bitmap, image, rect);
-
-	//Test to see if the bitmap drawn to using CRemoteGc is the same as the screen copy bitmap
-	TInt differentPixels = 0;
-	res = LossyCompareBitmapRecord(*bitmap, *screenBitmap, KTestRect, EFalse, differentPixels, Logger());
-	if (differentPixels != 0)
-		{
-		INFO_PRINTF2(_L(" Pixels different %d"), differentPixels);
-		}
-	TEST(res);
-	CleanupStack::PopAndDestroy(10, remoteGc); //screenBitmap, imageCollection, image, imageTarget, directGdiGcWrapper, cmdBuf, wsGrap, msgBuf, remoteGc, bitmap
-	CleanupStack::Pop();//font
-	TheClient->iScreen->ReleaseFont(font);
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0487
-@SYMPREQ            PREQ2095
-@SYMTestCaseDesc    Draw text using CRemoteGc and DrawText(const TDesC&,const TTextParameters*,const TPoint&)
-@SYMTestPriority    High
-@SYMTestStatus      Implemented
-@SYMTestActions     Create a font.  Draw text to a bitmap with the font using CFbsBitGc::DrawText. Draw text with the font using CFbsBitGc::DrawText.
-Record the same DrawText commands using CRemoteGc and play the recorded commands on a 
-bitmap using MWsGraphicsContext. Compare the two bitmaps.
-@SYMTestExpectedResults Text drawn using CFbsBitGc and CRemoteGc(MWsGraphicsContext) should be the same
-*/
-void CTGc::TestCRemoteGcDrawTextInContextPointL()
-	{
-	CDrawTextInContextTestPoint* test = CDrawTextInContextTestPoint::NewL();
-	CleanupStack::PushL(test);
-	test->Test();
-	TEST(test->HasPassedTest());
-	CleanupStack::PopAndDestroy(); //test
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0488
-@SYMPREQ            PREQ2095
-@SYMTestCaseDesc    Draw text using CRemoteGc and DrawText(const TDesC&,const TTextParameters*,const TRect&,TInt,TTextAlign,TInt)
-@SYMTestPriority    High
-@SYMTestStatus      Implemented
-@SYMTestActions     Create a font.  Draw text to a bitmap with the font using CFbsBitGc::DrawText. Draw text with the font using CFbsBitGc::DrawText.
-Record the same DrawText commands using CRemoteGc and play the recorded commands on a 
-bitmap using MWsGraphicsContext. Compare the two bitmaps.
-@SYMTestExpectedResults Text drawn using CFbsBitGc and CRemoteGc(MWsGraphicsContext) should be the same
-*/
-void CTGc::TestCRemoteGcDrawTextInContextBoxL()
-	{
-	CDrawTextInContextTestBox* test = CDrawTextInContextTestBox::NewL();
-	CleanupStack::PushL(test);
-	test->Test();
-	TEST(test->HasPassedTest());
-	CleanupStack::PopAndDestroy(); //test
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0489
-@SYMPREQ            PREQ2095
-@SYMTestCaseDesc    Draw text using CRemoteGc and DrawTextVertical(const TDesC&,const TTextParameters*,const TPoint&)
-@SYMTestPriority    High
-@SYMTestStatus      Implemented
-@SYMTestActions     Create a font.  Draw text to a bitmap with the font using CFbsBitGc::DrawTextVertical. Draw text with the font using CFbsBitGc::DrawText.
-Record the same DrawText commands using CRemoteGc and play the recorded commands on a 
-bitmap using MWsGraphicsContext. Compare the two bitmaps.
-@SYMTestExpectedResults Text drawn using CFbsBitGc and CRemoteGc(MWsGraphicsContext) should be the same
-*/
-void CTGc::TestCRemoteGcDrawTextInContextPointVerticalL()
-	{
-	CDrawTextInContextTestPointVertical* test = CDrawTextInContextTestPointVertical::NewL();
-	CleanupStack::PushL(test);
-	test->Test();
-	TEST(test->HasPassedTest());
-	CleanupStack::PopAndDestroy(); //test
-	}
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0490
-@SYMPREQ            PREQ2095
-@SYMTestCaseDesc    Draw text using CRemoteGc and DrawTextVertical(const TDesC&,const TTextParameters*,const TRect&,TInt,TTextAlign,TInt)
-@SYMTestPriority    High
-@SYMTestStatus      Implemented
-@SYMTestActions     Create a font.  Draw text to a bitmap with the font using CFbsBitGc::DrawTextVertical. Draw text with the font using CFbsBitGc::DrawText.
-Record the same DrawText commands using CRemoteGc and play the recorded commands on a 
-bitmap using MWsGraphicsContext. Compare the two bitmaps.
-@SYMTestExpectedResults Text drawn using CFbsBitGc and CRemoteGc(MWsGraphicsContext) should be the same
-*/
-void CTGc::TestCRemoteGcDrawTextInContextBoxVerticalL()
-	{
-	CDrawTextInContextTestBoxVertical* test = CDrawTextInContextTestBoxVertical::NewL();
-	CleanupStack::PushL(test);
-	test->Test();
-	TEST(test->HasPassedTest());
-	CleanupStack::PopAndDestroy(); //test
-	}
-#endif //TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-
-/**
-@SYMTestCaseID		GRAPHICS-WSERV-0494
-@SYMDEF				DEF131255
-@SYMTestCaseDesc    Negative test to show that using SetBrushStyle() will not panic WServ with different
-					brush bitmaps.
-@SYMTestPriority    High
-@SYMTestStatus      Implemented
-@SYMTestActions		Four seperate panic situations are tested:
-					1)
-                    Create a regular CFbsBitmap, set as brush pattern, and set brush style to EPatternedBrush.
-                    Draw a line to force the playback to occur.
-                    Call Finish on the GC.
-                    Destroy the brush bitmap.
-                    2)
-                    Create a regular CFbsBitmap, set as brush pattern, and set brush style to EPatternedBrush.
-                    Draw a line to force the playback to occur.
-                    Destroy the brush bitmap. 
-                    Call Finish on the GC.
-                    3+4)
-                    Create an extended bitmap, set as the brush pattern, and set the brush style to EPatternedBrush.
-                    Draw a line to force the playback to occur.
-                    Set the brush bitmap and style again.
-                    Call Finish on the GC.
-                    Destroy the brush bitmap. 
-@SYMTestExpectedResults The calls to SetBrushStyle() should not cause WServ to panic when Finish() is called.
-*/
-void CTGc::TestGcSetBrushPatternL()
-	{
-	// Extended bitmap test data.
-	const TUint8 KTestData[] = "TEST DATA";
-	const TInt KTestDataSize = sizeof(KTestData);
-	const TUid KTestExtendedBitmapUid = TUid::Uid(0xFFFFFFFF);
-	
-	// First try using a regular bitmap as the brush pattern.
-	BaseWin->Win()->Invalidate();
-	BaseWin->Win()->BeginRedraw();
-	TheGc->Activate(*BaseWin->Win());	
-	CFbsBitmap* bitmapRegular = new (ELeave) CFbsBitmap;
-	CleanupStack::PushL(bitmapRegular);
-	TInt res = bitmapRegular->Create(TSize(10,10), EColor64K);
-	TEST(res == KErrNone);
-	//Record the commands using CWindowGc.
-	TheGc->UseBrushPattern(bitmapRegular);
-	TheGc->SetBrushStyle(CGraphicsContext::EPatternedBrush);
-	// DrawLine() is only used here to force playback of the commands.
-	TheGc->DrawLine(TPoint(0,0), TPoint(1,1));	
-	TheGc->Deactivate();
-	BaseWin->Win()->EndRedraw();
-	TheClient->iWs.Finish();
-	CleanupStack::PopAndDestroy(1, bitmapRegular);
-	
-	// Secondly, try using a regular bitmap as the brush pattern, but deleting the bitmap
-	// before calling Finish().
-	BaseWin->Win()->Invalidate();
-	BaseWin->Win()->BeginRedraw();
-	TheGc->Activate(*BaseWin->Win());		
-	bitmapRegular = new (ELeave) CFbsBitmap;
-	CleanupStack::PushL(bitmapRegular);
-	res = bitmapRegular->Create(TSize(10,10), EColor64K);		
-	TEST(res == KErrNone);
-	//Record the commands using CWindowGc.
-	TheGc->UseBrushPattern(bitmapRegular);
-	TheGc->SetBrushStyle(CGraphicsContext::EPatternedBrush);
-	TheGc->DrawLine(TPoint(0,0), TPoint(1,1));
-	CleanupStack::PopAndDestroy(1, bitmapRegular);	
-	TheGc->Deactivate();
-	BaseWin->Win()->EndRedraw();
-	TheClient->iWs.Finish();
-	
-	// Thirdly, try using an extended bitmap (which is unsupported by DirectGDI) as 
-	// the brush pattern.
-	BaseWin->Win()->Invalidate();
-	BaseWin->Win()->BeginRedraw();
-	TheGc->Activate(*BaseWin->Win());
-	// Create a dummy extended bitmap to use as a brush bitmap.
-	// This is unsupported by the default implementation of DirectGDI.
-	CFbsBitmap* bitmapExtended = new (ELeave) CFbsBitmap;
-	CleanupStack::PushL(bitmapExtended);
-	res = bitmapExtended->CreateExtendedBitmap(TSize(10,10), EColor64K, KTestExtendedBitmapUid, KTestData, KTestDataSize);
-	TEST(res == KErrNone);	
-	//Record the commands using CWindowGc.
-	TheGc->UseBrushPattern(bitmapExtended);
-	TheGc->SetBrushStyle(CGraphicsContext::EPatternedBrush);
-	TheGc->DrawLine(TPoint(0,0), TPoint(100,100));
-	TheGc->UseBrushPattern(bitmapExtended);
-	// Forth, do it twice so that we test the state commands and the drawops commands.
-	TheGc->SetBrushStyle(CGraphicsContext::EPatternedBrush);
-	TheGc->DrawLine(TPoint(0,0), TPoint(100,100));
-	TheGc->Deactivate();
-	BaseWin->Win()->EndRedraw();
-	TheClient->iWs.Finish();
-	CleanupStack::PopAndDestroy(1, bitmapExtended);	
-	}
-
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0576
-@SYMDEF             
-@SYMTestCaseDesc    Checks window server is still able to draw a bitmap, even after the client has released its handle to the bitmap.
-@SYMTestPriority    High
-@SYMTestStatus      Implemented
-@SYMTestActions     - Draw the bitmap to TestWin (keeping the window hidden)
-                    - Delete the bitmap
-                    - Show TestWin to cause it to be drawn on screen (after the bitmap has been deleted)
-                    - Draw the same bitmap (same image, different bitmap object instance) to BaseWin
-                    - Compare contents of TestWin with BaseWin
-@SYMTestExpectedResults TestWin and BaseWin should both show the bitmap.
-*/
-void CTGc::TestGcDeleteBitmap1L()
-    {
-    CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
-    CleanupStack::PushL(bitmap);
-    TInt ret = bitmap->Load(TEST_BITMAP_NAME,0);
-    TEST(ret == KErrNone);
-
-    // send drawing to hidden window
-    TestWin->SetVisible(EFalse);
-    TestWin->Win()->Invalidate();
-    TestWin->Win()->BeginRedraw();
-    TheGc->Activate(*TestWin->Win());
-    TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-    TheGc->SetDrawMode(CGraphicsContext::EDrawModePEN);
-    TheGc->SetBrushColor(TRgb(255, 0, 0));
-    TheGc->Clear();
-    TheGc->BitBlt(TPoint(0,0), bitmap);
-    CleanupStack::PopAndDestroy(bitmap); // before the bitmap is actually deleted, WsFbsDestroyCallBack flushes the command buffer to ensure the bitmap is duplicated in the window server thread
-    bitmap = NULL;
-    TheGc->Deactivate();
-    TestWin->Win()->EndRedraw();
-    TheClient->iWs.Flush(); // calling Flush rather than Finish, as we don't need to wait for any drawing to happen (as the window is currently hidden)
-
-    // make window visible (forcing it to draw)
-    TestWin->SetVisible(ETrue);
-    TheClient->iWs.Finish(); // ensure the bitmap has been drawn on test win
-
-    // window server should have duplicated the bitmap when the BitBlt was added to the redraw store, so drawing
-    // the window now (by making it visible above) should display the bitmap on screen, even
-    // though we've deleted it in this thread
-
-    // now create the bitmap again, and draw it to the base win (for comparison with test win)
-    bitmap = new (ELeave) CFbsBitmap;
-    CleanupStack::PushL(bitmap);
-    ret = bitmap->Load(TEST_BITMAP_NAME,0);
-    TEST(ret == KErrNone);
-    BaseWin->SetVisible(ETrue);
-    BaseWin->Win()->Invalidate();
-    BaseWin->Win()->BeginRedraw();
-    TheGc->Activate(*BaseWin->Win());   
-    TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-    TheGc->SetDrawMode(CGraphicsContext::EDrawModePEN);
-    TheGc->SetBrushColor(TRgb(255, 0, 0));
-    TheGc->Clear();
-    TheGc->BitBlt(TPoint(0,0), bitmap);
-    TheGc->Deactivate();
-    BaseWin->Win()->EndRedraw();
-    TheClient->iWs.Finish(); // ensure the bitmap has been drawn on base win
-    
-    CleanupStack::PopAndDestroy(bitmap);
-
-    // the test bitmap should be shown in both base win and test win, so we now check that the
-    // contents of base win and test win are the same
-    CheckRect(BaseWin, TestWin, TRect(0, 0, BaseWin->Size().iWidth, BaseWin->Size().iHeight), _L("CTGc::TestGcDeleteBitmap1L()"));
-    }
-
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0577
-@SYMDEF             
-@SYMTestCaseDesc    Check window server is still able to use a bitmap required by window drawing, even
-                    after the client has released its handle to the bitmap. Also check window server 
-                    releases the bitmap, when it's no longer used by window drawing.
-@SYMTestPriority    High
-@SYMTestStatus      Implemented
-@SYMTestActions     - Clean BaseWin and TestWin from content that has been left over from previous test
-                    - Draw test bitmap to TestWin
-                    - Delete the bitmap
-                    - Using a different bitmap object instance, duplicate bitmap (the bitmap is still used by window drawing)
-                    - Delete the bitmap
-                    - Draw new content to TestWin, so that previously drawn bitmap is covered
-                    - Duplicate bitmap (the bitmap is no longer used by window drawing)
-@SYMTestExpectedResults Bitmap duplication succeeds, when the bitmap used by window drawing, whereas
-                        bitmap duplication fails, when the bitmap is no longer used by window drawing.
-*/
-void CTGc::TestGcDeleteBitmap2L()
-    {
-    //send new drawing to test and base windows, in order to cover 
-    //any content has been left on them (through previous test)
-    BaseWin->SetVisible(ETrue);
-    BaseWin->Win()->Invalidate();
-    BaseWin->Win()->BeginRedraw();
-    TheGc->Activate(*BaseWin->Win());   
-    TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-    TheGc->SetDrawMode(CGraphicsContext::EDrawModePEN);
-    TheGc->SetBrushColor(TRgb(0, 0, 255));
-    TheGc->Clear();
-    TheGc->Deactivate();
-    BaseWin->Win()->EndRedraw();
-    
-    TestWin->SetVisible(ETrue);
-    TestWin->Win()->Invalidate();
-    TestWin->Win()->BeginRedraw();
-    TheGc->Activate(*TestWin->Win());   
-    TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-    TheGc->SetDrawMode(CGraphicsContext::EDrawModePEN);
-    TheGc->SetBrushColor(TRgb(0, 0, 255));
-    TheGc->Clear();
-    TheGc->Deactivate();
-    TestWin->Win()->EndRedraw();
-    
-    TheClient->iWs.Flush(); 
-    TheClient->iWs.Finish();
-        
-    //load test bitmap
-    CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
-    CleanupStack::PushL(bitmap);
-    TInt ret = bitmap->Load(_L("Z:\\WSTEST\\TESTCIRCLES.MBM"),0);
-    TEST(ret == KErrNone);
-    TInt bitmapHandle = bitmap->Handle();
-    
-    //send bitmap drawing to test window
-    TestWin->Win()->Invalidate();
-    TestWin->Win()->BeginRedraw();
-    TheGc->Activate(*TestWin->Win());
-    TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-    TheGc->SetDrawMode(CGraphicsContext::EDrawModePEN);
-    TheGc->SetBrushColor(TRgb(0, 255, 0));
-    TheGc->Clear();
-    TheGc->BitBlt(TPoint(0,0), bitmap);
-    TheGc->Deactivate();
-    TestWin->Win()->EndRedraw();
-    
-    CleanupStack::PopAndDestroy(bitmap);
-
-    TheClient->iWs.Flush(); 
-    TheClient->iWs.Finish();
-    
-    //using a new bitmap object instance check that wserv can still duplicate test bitmap (even though
-    //the initial bitmap object is deleted) , since there is a window segment using it
-    bitmap = new (ELeave) CFbsBitmap;
-    CleanupStack::PushL(bitmap);
-    ret = bitmap->Duplicate(bitmapHandle);
-    TEST(ret == KErrNone);
-    CleanupStack::PopAndDestroy(bitmap);
-
-    //send new drawing to test window, in order to cover the bitmap that was previously drawn
-    TestWin->Win()->Invalidate();
-    TestWin->Win()->BeginRedraw();
-    TheGc->Activate(*TestWin->Win());
-    TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-    TheGc->SetDrawMode(CGraphicsContext::EDrawModePEN);
-    TheGc->SetBrushColor(TRgb(0, 0, 255));
-    TheGc->Clear();
-    TheGc->Deactivate();
-    TestWin->Win()->EndRedraw();
-    
-    TheClient->iWs.Flush(); 
-    TheClient->iWs.Finish();
-    
-    //check that wserv can't duplicate test bitmap, since no window segment uses it any more
-    bitmap = new (ELeave) CFbsBitmap;
-    CleanupStack::PushL(bitmap);
-    ret = bitmap->Duplicate(bitmapHandle);
-    TEST(ret != KErrNone);
-    CleanupStack::PopAndDestroy(bitmap);
-    }
-
-void CTGc::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	((CTGcStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(++iTest->iState)
-		{
-	case 1:
-		((CTGcStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0437"));
-		iTest->LogSubTest(_L("CRemoteGc&CWindowGc, outline and shadow text"));
-		TestOutlineAndShadowL();		
-		break;	
-	case 2:
-		((CTGcStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0471"));
-		iTest->LogSubTest(_L("Test GC clip rect and origin attributes."));		 
-		TestGcClipRectOrigin();
-		break;
-	case 3:
-		((CTGcStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0469"));
-		iTest->LogSubTest(_L("CRemoteGc&CWindowGc, reset with background colour"));		
-		TestResetWithBackgroundColorL();
-		break;
-	case 4:
-		((CTGcStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0481"));
-		iTest->LogSubTest(_L("CRemoteGc&CCommandBuffer, coverage tests"));
-		TestCommandBufferL();
-		break;			
-	case 5:
-		((CTGcStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0482"));
-		iTest->LogSubTest(_L("CCommandBuffer, coverage tests"));
-		TestEmptyCommandBufferL();
-		break;
-	case 6:
-		((CTGcStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0494"));
-		iTest->LogSubTest(_L("CWindowGc, Brush Pattern test"));
-		TestGcSetBrushPatternL();
-		break;
-    case 7:
-        ((CTGcStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0576"));
-        iTest->LogSubTest(_L("CWindowGc, delete bitmap 1"));
-        TestGcDeleteBitmap1L();
-        break;
-    case 8:
-        ((CTGcStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0577"));
-        iTest->LogSubTest(_L("CWindowGc, delete bitmap 2"));
-        TestGcDeleteBitmap2L();
-        break;
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-	case 9:
-		 ((CTGcStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0471"));
-		 iTest->LogSubTest(_L("Test GC clip rect and origin attributes."));
-		 TestGcClipRectOrigin();
-		 break;
-	case 10:
-		((CTGcStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0469"));
-		iTest->LogSubTest(_L("CRemoteGc&CWindowGc, reset with background colour"));
-		TestResetWithBackgroundColorL();
-		break;
-	case 11:
-		((CTGcStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0486"));
-		iTest->LogSubTest(_L("CRemoteGc&MWsGraphicsContext, clipping rect test"));
-		TestCRemoteGcAndMWsGraphicsContextClippingRectL();
-		break;
-	case 12:
-		((CTGcStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0487"));
-		iTest->LogSubTest(_L("CRemoteGc, DrawTextInContext Position test"));
-		TestCRemoteGcDrawTextInContextPointL();
-		break;
-	case 13:
-		((CTGcStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0488"));
-		iTest->LogSubTest(_L("CRemoteGc, DrawTextInContext ClipRect test"));
-		TestCRemoteGcDrawTextInContextBoxL();
-		break;
-	case 14:
-		((CTGcStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0489"));
-		iTest->LogSubTest(_L("CRemoteGc, DrawTextInContext Pos Vertical  test"));
-		TestCRemoteGcDrawTextInContextPointVerticalL();
-		break;
-	case 15:
-		((CTGcStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0490"));
-		iTest->LogSubTest(_L("CRemoteGc, DrawTextInContext ClipRect Vert  test"));
-		TestCRemoteGcDrawTextInContextBoxVerticalL();
-		break;
-#endif //TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-	default:
-		((CTGcStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-		((CTGcStep*)iStep)->CloseTMSGraphicsStep();
-		TestComplete();
-		break;
-		}
-	((CTGcStep*)iStep)->RecordTestResultL();
-	}
-
-__CONSTRUCT_STEP__(Gc)
--- a/windowing/windowserver/tauto/tgc.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,199 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TGC_H__
-#define __TGC_H__
-
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-#include <graphics/sgimage.h>
-#include <graphics/sgimagecollection.h>
-
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-/*
- * The following classes are only required for the RemoteGc DrawText tests: .
- * CDrawTextInContextTest : is the Abstract base class
- * CDrawTextInContextTestPoint : Test DrawText(const TDesC&,const TTextParameters*,const TPoint&)
- * CDrawTextInContextTestBox : Test DrawText(const TDesC&,const TTextParameters*,const TRect&,TInt,TTextAlign,TInt)
- * CDrawTextInContextTestPointVertical : Test DrawTextVertical(const TDesC&,const TTextParameters*,const TPoint&)
- * CDrawTextInContextTestBoxVertical : Test DrawTextVertical(const TDesC&,const TTextParameters*,const TRect&,TInt,TTextAlign,TInt)
- */
-class CDirectGdiGcWrapper;
-class CRemoteGc;
-class CCommandBuffer;
-class CWSGraphicsRes;
-class RDirectGdiImageTarget;
-
-const TSize KBitmapSize(620, 240);
-const TRect KBitmapRect(TPoint(0,0),TSize(620, 240));
-const TRegionFix<1> KBitmapRegion(KBitmapRect);
-
-//CDrawTextInContextTest
-class CDrawTextInContextTest : public CBase
-	{
-public:
-	void Test();
-	TBool HasPassedTest();
-protected:
-	CDrawTextInContextTest();
-	~CDrawTextInContextTest();
-	void BaseConstructL();
-	virtual void DoDrawTextBitGc() = 0;
-	virtual void DoDrawTextRemoteGc() = 0;
-protected:
-	CFont *iFont;
-	CGraphicsContext::TTextParameters iParam;
-	TPtrC iText;
-	
-	//For reference bitmap
-	CFbsBitmap* iRefBitmap;
-	CFbsBitmapDevice* iRefDevice;
-	CFbsBitGc* iRefBitGc;
-	
-	//For CDirectGdiGcWrapper
-	RSgImage iWrapperImage;
-	RDirectGdiImageTarget* iWrapperImageTarget;
-	RSgImageCollection iWrapperImageCollection;
-	CDirectGdiGcWrapper* iDirectGdiGcWrapper;
-	
-	
-	//For CRemoteGc
-	CRemoteGc* iRemoteGc;
-	RWsGraphicMsgBuf iMsgBuf;
-	CCommandBuffer* iCommandBuffer;
-	CWSGraphicsRes* iWsGraphicRes;
-	TPoint iOffset;
-	
-	//Test result
-	TBool iHasPassedTest;
-	};
-
-//CDrawTextInContextTestPoint
-class CDrawTextInContextTestPoint : public CDrawTextInContextTest
-	{
-public:
-	static CDrawTextInContextTestPoint* NewL();
-	~CDrawTextInContextTestPoint();
-	void DoDrawTextBitGc();
-	void DoDrawTextRemoteGc();
-private:
-	CDrawTextInContextTestPoint();
-	void ConstructL();
-private:
-	TPoint iPosition;
-	};
-
-//CDrawTextInContextTestBox
-class CDrawTextInContextTestBox : public CDrawTextInContextTest
-	{
-public:
-	static CDrawTextInContextTestBox* NewL();
-	~CDrawTextInContextTestBox();
-	void DoDrawTextBitGc();
-	void DoDrawTextRemoteGc();
-private:
-	CDrawTextInContextTestBox();
-	void ConstructL();
-private:
-	TRect iClipFillRect;
-	TInt iBaselineOffset;
-	CGraphicsContext::TTextAlign iTTextAlign;
-	};
-
-//CDrawTextInContextTestPointVertical
-class CDrawTextInContextTestPointVertical : public CDrawTextInContextTest
-	{
-public:
-	static CDrawTextInContextTestPointVertical* NewL();
-	~CDrawTextInContextTestPointVertical();
-	void DoDrawTextBitGc();
-	void DoDrawTextRemoteGc();
-private:
-	CDrawTextInContextTestPointVertical();
-	void ConstructL();
-private:
-	TPoint iPosition;
-	TBool iUp;
-	};
-
-//CDrawTextInContextTestBoxVertical
-class CDrawTextInContextTestBoxVertical : public CDrawTextInContextTest
-	{
-public:
-	static CDrawTextInContextTestBoxVertical* NewL();
-	~CDrawTextInContextTestBoxVertical();
-	void DoDrawTextBitGc();
-	void DoDrawTextRemoteGc();
-private:
-	CDrawTextInContextTestBoxVertical();
-	void ConstructL();
-private:
-	TRect iClipFillRect;
-	TInt iBaselineOffset;
-	TBool iUp;
-	CGraphicsContext::TTextAlign iTTextAlign;
-	};
-
-#endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-
-class CTGc : public CTWsGraphicsBase
-	{
-public:
-	CTGc(CTestStep* aStep);
-	~CTGc();
-	void ConstructL();
-	void TestOutlineAndShadowL();
-	void TestGcClipRectOrigin();
-	void TestResetWithBackgroundColorL();
-	void TestCommandBufferL();
-	void TestEmptyCommandBufferL();
-	void TestGcSetBrushPatternL();
-	void TestGcDeleteBitmap1L();
-	void TestGcDeleteBitmap2L();
-#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
-	void TestCRemoteGcAndMWsGraphicsContextClippingRectL();
-	void TestCRemoteGcDrawTextInContextPointL();
-	void TestCRemoteGcDrawTextInContextBoxL();
-	void TestCRemoteGcDrawTextInContextPointVerticalL();
-	void TestCRemoteGcDrawTextInContextBoxVerticalL();
-#endif
-
-protected:
-	void TestGcClipRectOrigin_DrawContent(TestWindow& aWindow, TBool bActivateBeforeRedraw = ETrue);
-	
-//from 	CTWsGraphicsBase
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	CTestBase *iTest;
-	};
-
-class CTGcStep : public CTGraphicsStep
-	{
-public:
-	CTGcStep();
-protected:
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTGcStep,"TGc");
-
-#endif
--- a/windowing/windowserver/tauto/tmultiptrevent.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4842 +0,0 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Multi pointer and Z-coordinate test code
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code 
-*/
-
-#ifndef __INIPARSER_H__
-#define __INIPARSER_H__
-#endif // __INIPARSER_H__
-
-#include "PARSEINIDATA.H"
-#include "tmultiptrevent.h"
-#include <e32cmn.h>
-#include <hal.h>
-
-//#define FAILLOG 1			// Uncomment this code to get detailed log
-#define TESTMULTIPOINTER 1	// Comment this line to get detailed log without testing
-
-_LIT(KMultiPtrPluginDll, "multiptrclick.dll");
-
-const TInt KErrDescSize = 128;
-const TInt KMaxQueueSize = 32;	// Queue size of wserv. In any test we cannot test more than MaxQueueSize events. 
-
-LOCAL_C void DestroyAnim(TAny* aAnim)
-	{
-	(static_cast<RMultiPointerAnim*>(aAnim))->Destroy();
-	}
-
-
-//CTMultiPtrEventBuffer
-CTMultiPtrEventBuffer::CTMultiPtrEventBuffer(RWsSession *aWs, CTMultiPtrEventTest *aTest, CTMultiPtrEventClient* aClient) 
-	: CTEvent(aWs), iTest(aTest), iClient(aClient)
-	{
-	}
-
-void CTMultiPtrEventBuffer::ConstructL()
-	{
-	CTEventBase::Construct();
-	iEventBuffer.SetLengthL(EEventBufferSize);
-	iMovePtsBuffer.SetLengthL(EMovePtsBuffer);
-	}
-
-void CTMultiPtrEventBuffer::AddExpectedEvent(TWsEvent &aEvent)
-	{
-	iEventBuffer.Add(&aEvent);
-	}
-
-void CTMultiPtrEventBuffer::AddExpectedMovePtEvent(TPoint &aMovePt)
-	{
-	iMovePtsBuffer.Add(&aMovePt);
-	}
-
-TInt CTMultiPtrEventBuffer::EventsRemaining()
-	{
-	return iEventBuffer.Count();
-	}
-
-void CTMultiPtrEventBuffer::GetMoveBufferAndCompareL()
-	{
-	TBuf8<EMovePtsBuffer*sizeof(TPoint)> buf;
-	iClient->ParentWin()->BaseWin()->RetrievePointerMoveBuffer(buf);
-	
-	TUint bufferSize = buf.Length();
-	TUint numLoop = bufferSize/sizeof(TPoint);
-	
-	if (iMovePtsBuffer.Count() != numLoop)
-		{
-#if defined(FAILLOG)
-		TLogMessageText logText;
-		_LIT(KPointerNumber, "Actual number of move/drag buffer points from Wserv = %d Expected number of move/drag buffer points = %d ");
-		logText.Format(KPointerNumber, numLoop, iMovePtsBuffer.Count());
-		iTest->LOG_MESSAGE(logText);
-#endif
-		TestL(EFalse);
-		}
-	
-	TPoint wsPoint;
-	TPoint expPoint;
-	TUint8* BasePtr = const_cast<TUint8*>(buf.Ptr());
-	for (TUint count = 0; count < numLoop; count++)
-		{
-		wsPoint = *(reinterpret_cast<TPoint*>(BasePtr));
-		iMovePtsBuffer.Remove(&expPoint);
-		if (wsPoint != expPoint)
-			{
-#if defined(FAILLOG)
-			TLogMessageText logText;
-			_LIT(KMoveBufferPoint, "Actual move/drag buffer point from Wserv = ([%d], [%d]) Expected move/drag buffer point = ([%d], [%d])");
-			logText.Format(KMoveBufferPoint, wsPoint.iX, wsPoint.iY, expPoint.iX, expPoint.iY);
-			iTest->LOG_MESSAGE(logText);
-#endif
-			TestL(EFalse);
-			}
-		BasePtr = BasePtr + sizeof(TPoint);
-		}
-	}
-
-
-#define TESTXL(expr1, oper, expr2, event, expected) \
-    TestL(expr1 oper expr2, expr1, expr2, #oper, #expr1 ## #oper ## #expr2, \
-            event, expected, __FILE__, __LINE__);
-
-// Main function which gets the event, checks with the event in buffer
-// Then calls function NextSetOfEventsL for running other tests of a particualar test case
-void CTMultiPtrEventBuffer::doRunL()
-	{
-	// Get the event from wserv
-	TWsEvent wsEvent;
-	iWs->GetEvent(wsEvent);
-
-	TWsEvent expectedEvent;
-	TInt wsType=wsEvent.Type();
-	if (wsEvent.Type()==EEventNull)
-		{
-		TESTXL(wsEvent.Handle(), ==, 0, &wsEvent, NULL);
-		goto End;
-		}
-	// This code is for running successive anim test code 
-	if (wsEvent.Type()==EEventPointer && wsEvent.Pointer()->iType==TPointerEvent::ESwitchOn)
-		goto End;
-	// if this is called accidentally
-	if (iEventBuffer.Count()==0 && wsType==EEventFocusGained)
-		goto End;
-
-	iEventBuffer.Remove(&expectedEvent);
-	iEventCount++;
-
-	if (wsEvent.Type() == EEventPointerBufferReady)
-		{
-		GetMoveBufferAndCompareL();
-#if defined(FAILLOG)
-		TLogMessageText logText;
-		_LIT(KEventHandle, "Actual Window Handle from Wserv = %d Expected Window Handle = %d ");
-		logText.Format(KEventHandle, wsEvent.Handle(), expectedEvent.Handle());
-		iTest->LOG_MESSAGE(logText);
-#endif
-#if defined(TESTMULTIPOINTER)
-		TESTXL(wsEvent.Handle(), ==, expectedEvent.Handle(), &wsEvent, &expectedEvent);
-#endif
-		goto End;
-		}
-
-	// Test wsEvent and expected event have same handle, position and type.
-#if defined(FAILLOG)
-	{
-	TLogMessageText logText;
-	_LIT(KEventCountCheck, "Checking event number = %d");
-	logText.Format(KEventCountCheck, iEventCount);
-	iTest->LOG_MESSAGE(logText);
-	_LIT(KEventType, "Actual Event type from Wserv = %d Expected Event Type = %d ");
-	logText.Format(KEventType, wsEvent.Type(), expectedEvent.Type());
-	iTest->LOG_MESSAGE(logText);
-	}
-#endif
-
-#if defined(TESTMULTIPOINTER)
-	TESTXL(wsEvent.Type(), ==, expectedEvent.Type(), &wsEvent, &expectedEvent);
-#endif
-	// Test pointer number for Enter/Exit events
-	if (wsType == EEventPointerEnter || wsType == EEventPointerExit)
-		{
-#if defined(FAILLOG)
-		TLogMessageText logText;
-		_LIT(KPointerNumber, "Actual PointerNumber for Enter/Exit event from Wserv = %d Expected PointerNumber for Enter/Exit event = %d ");
-		logText.Format(KPointerNumber, *wsEvent.Int(), *expectedEvent.Int());
-		iTest->LOG_MESSAGE(logText);
-#endif
-#if defined(TESTMULTIPOINTER)
-		TESTXL(*wsEvent.Int(), ==, *expectedEvent.Int(), &wsEvent, &expectedEvent);
-#endif
-		}
-
-	// Test only if it is a Pointer event
-	if (wsType==EEventPointer)
-		{
-		TAdvancedPointerEvent* expectedPointerEvent=expectedEvent.Pointer();
-		TAdvancedPointerEvent* actualPointerEvent=wsEvent.Pointer();
-#if defined(FAILLOG)
-		TLogMessageText logText;
-		_LIT(KEventHandle, "Actual Window Handle from Wserv = %d Expected Window Handle = %d ");
-		logText.Format(KEventHandle, wsEvent.Handle(), expectedEvent.Handle());
-		iTest->LOG_MESSAGE(logText);
-#endif
-#if defined(TESTMULTIPOINTER)
-		TESTXL(wsEvent.Handle(), ==, expectedEvent.Handle(), &wsEvent, &expectedEvent);
-#endif
-#if defined(FAILLOG)
-		_LIT(KPointerType, "Actual PointerType from Wserv = %d Expected PointerType = %d ");
-		logText.Format(KPointerType, actualPointerEvent->iType, expectedPointerEvent->iType);
-		iTest->LOG_MESSAGE(logText);
-#endif
-#if defined(TESTMULTIPOINTER)
-		TESTXL(actualPointerEvent->iType, ==, expectedPointerEvent->iType, &wsEvent, &expectedEvent);
-#endif
-#if defined(FAILLOG)
-		_LIT(KPointerPosition, "Actual PointerPosition from Wserv = (%d, %d) Expected PointerPosition = (%d, %d) ");
-		logText.Format(KPointerPosition, actualPointerEvent->iPosition.iX, actualPointerEvent->iPosition.iY, expectedPointerEvent->iPosition.iX, expectedPointerEvent->iPosition.iY);
-		iTest->LOG_MESSAGE(logText);
-#endif
-#if defined(TESTMULTIPOINTER)		
-		TESTXL(actualPointerEvent->iPosition, ==, expectedPointerEvent->iPosition, &wsEvent, &expectedEvent);
-#endif		
-#if defined(FAILLOG)
-		_LIT(KPointerNumber, "Actual PointerNumber from Wserv = %d Expected PointerNumber = %d ");
-		logText.Format(KPointerNumber, actualPointerEvent->PointerNumber(), expectedPointerEvent->PointerNumber());
-		iTest->LOG_MESSAGE(logText);
-#endif
-#if defined(TESTMULTIPOINTER)		
-		TESTXL(actualPointerEvent->PointerNumber(), ==, expectedPointerEvent->PointerNumber(), &wsEvent, &expectedEvent);
-#endif
-#if defined(FAILLOG)
-		_LIT(KPointerProximity, "Actual PointerProximity from Wserv = %d Expected PointerProximity = %d ");
-		logText.Format(KPointerProximity, actualPointerEvent->Proximity(), expectedPointerEvent->Proximity());
-		iTest->LOG_MESSAGE(logText);
-#endif
-#if defined(TESTMULTIPOINTER)		
-		TESTXL(actualPointerEvent->Proximity(), ==, expectedPointerEvent->Proximity(), &wsEvent, &expectedEvent);
-#endif		
-#if defined(FAILLOG)
-		_LIT(KPointerPressure, "Actual PointerPressure from Wserv = %d Expected PointerPressure = %d ");
-		logText.Format(KPointerPressure, actualPointerEvent->Pressure(), expectedPointerEvent->Pressure());
-		iTest->LOG_MESSAGE(logText);
-#endif
-#if defined(TESTMULTIPOINTER)		
-		TESTXL(actualPointerEvent->Pressure(), ==, expectedPointerEvent->Pressure(), &wsEvent, &expectedEvent);
-#endif
-#if defined(FAILLOG)
-		_LIT(KPointerModifier, "Actual Modifier value from Wserv = 0x%08x Expected Modfier value = 0x%08x ");
-		logText.Format(KPointerModifier, actualPointerEvent->iModifiers, expectedPointerEvent->iModifiers);
-		iTest->LOG_MESSAGE(logText);
-#endif
-#if defined(TESTMULTIPOINTER)		
-		TESTXL((actualPointerEvent->iModifiers&expectedPointerEvent->iModifiers), ==, expectedPointerEvent->iModifiers, &wsEvent, &expectedEvent);
-#endif		
-		}
-End:
-	// Call NextSetOfEvents() only for primary client
-	if (iEventBuffer.Count()==0 && !iClient->IsSecondaryClient())	
-		{
-		iTest->NextSetOfEventsL();		// Cannot Leave
-		}
-	
-	// If this is for secondary client and active scheduler(nested loop) has started, this code stops that scheduler
-	if (iEventBuffer.Count()==0 && iClient->IsSecondaryClient() && iNestedLoopStarted)
-		{
-		iNestedLoopStarted = EFalse;
-		CActiveScheduler::Stop();
-		}
-	}
-
-void CTMultiPtrEventBuffer::TestL(TInt aTest)
-	{
-	if (!aTest)
-		{
-		iTest->Failed();
-		User::Leave(ETestFailed);
-		}
-	}
-
-static void DumpEvent(const char *aName, const TWsEvent *aEvent)
-    {
-    // aEvent may be NULL - if it isn't NULL, we print it's data.
-    if (aEvent)
-        {
-        RDebug::Printf("%s:", aName);
-        RDebug::Printf("handle = %u", aEvent->Handle());
-        RDebug::Printf("type() = %d", aEvent->Type());
-        if (aEvent->Type() == EEventPointer)
-            {
-            TAdvancedPointerEvent *pointer = aEvent->Pointer();
-            RDebug::Printf("pointer type = %d, position = (%d, %d)", 
-                    pointer->iType, pointer->iPosition.iX, pointer->iPosition.iY);
-            RDebug::Printf("PointerNumber() = %d, proximity=%d, pressure=%d", 
-                    pointer->PointerNumber(), pointer->Proximity(), pointer->Pressure());
-            RDebug::Printf("modifiers = 0x%08x", pointer->iModifiers);
-            }
-        else
-            {
-            RDebug::Printf("Not a pointer event, event type");
-            }
-        }
-    else
-        {
-        // aEvent is NULL, just let us know it is. 
-        RDebug::Printf("%s: is NULL which means not applicapable");
-        }
-    }
-
-void CTMultiPtrEventBuffer::TestL(TInt aTest, TInt aVal1, TInt aVal2, const char *aOper, const char *aTestStr, 
-        const TWsEvent *aEvent, const TWsEvent *aExpected, const char *aFile, TUint aLine)
-    {
-    if (!aTest)
-        {
-        RDebug::Printf("Expression %d %s %d [%s] (=%d) failed [call from %s:%d]", aVal1, aOper, aVal2, aTestStr, aTest, aFile, aLine);
-        DumpEvent("actual", aEvent);
-        DumpEvent("expected", aExpected);
-        iTest->Failed();
-        User::Leave(ETestFailed);
-        }
-    }
-
-
-void CTMultiPtrEventBuffer::TestL(TInt aTest, TPoint aVal1, TPoint aVal2, const char *oper, const char *aTestStr, 
-        const TWsEvent *aEvent, const TWsEvent *aExpected, const char *aFile, TUint aLine)
-    {
-    if (!aTest)
-        {
-        RDebug::Printf("Expression (%d, %d) %s (%d, %d) [%s] (=%d) failed [call from %s:%d]", 
-                aVal1.iX, aVal1.iY, oper, aVal2.iX, aVal2.iY, aTestStr, aTest, aFile, aLine);
-        DumpEvent("actual", aEvent);
-        DumpEvent("expected", aExpected);
-        iTest->Failed();
-        User::Leave(ETestFailed);
-        }
-    }
-
-//CTMultiPtrEventClient
-CTMultiPtrEventClient::CTMultiPtrEventClient(CTMultiPtrEventTest *aTest, TBool aSecondaryClient) 
-	: iTest(aTest), iSecondaryClient(aSecondaryClient)
-	{
-	}
-
-CTMultiPtrEventClient::~CTMultiPtrEventClient()
-	{
-	if (iWinAutoFocus1 || iWinAutoFocus2 || iGroupWinAutoFocus2 || iGroupWinAutoFocus1)
-		{
-		DeleteGroupBlankWin();
-		}
-	delete iChildWin;
-	delete iParentWin;
-	}
-
-void CTMultiPtrEventClient::ConstructL()
-	{
-	CTClient::ConstructL();
-	
-	// Create a group window and assign it iGroup
-	iGroup = new(ELeave) CTWindowGroup(this);
-	iGroup->ConstructL();
-	
-	iParentWinSize = iScreen->SizeInPixels();
-	iParentWinPos = TPoint();
-	
-	// Change the parent window size and position for secondary client
-	if (iSecondaryClient)
-		{
-		iParentWinSize.iWidth /= 2; 
-		iParentWinPos.iX = iParentWinSize.iWidth;
-		}
-	
-	// Create window/s for this client so that events can come to this client
-	iParentWin=new(ELeave) CTBlankWindow();
-	iParentWin->ConstructL(*iGroup);
-	iParentWin->SetExt(iParentWinPos, iParentWinSize);
-	iParentWin->SetColor(KRgbRed);
-	if (iTest->TestBase()->iState != 12)
-		{
-		iParentWin->BaseWin()->EnableAdvancedPointers();
-		}
-	iParentWin->Activate();
-	
-	// Don't create child window for secodary client
-	if (!iSecondaryClient)
-		{
-		iChildWinSize = TSize(iParentWinSize.iWidth/2, iParentWinSize.iHeight);
-		iChildWinPos = TPoint(iParentWinSize.iWidth/2,0);
-		
-		iChildWin=new(ELeave) CTBlankWindow();
-		iChildWin->ConstructL(*iGroup);
-		iChildWin->SetExt(iChildWinPos, iChildWinSize);
-		iChildWin->SetColor(KRgbRed);
-		iChildWin->BaseWin()->EnableAdvancedPointers();
-		iChildWin->Activate();
-		}
-	}
-
-void CTMultiPtrEventClient::CalculatePtrPosAndSet3Ddata(TWsEvent& aEvent, TPointerEvent::TType aType, TPoint aPos, TUint aModifiers, TInt aZ, TUint8 aPointerNumber, TUint aHandle)
-	{
-	// If in future you need to change parent position then put this in corresponding if statements
-	aEvent.Pointer()->iParentPosition = aPos;
-	
-	// This is for Auto foreground test
-	if (iTest->TestBase()->iState == 11)
-		{
-		if (TRect(iWinPosAutoFocus1, iWinSizeAutoFocus1).Contains(aPos))
-			{
-			aPos -= iWinPosAutoFocus1;
-			aEvent.SetHandle((TUint)iWinAutoFocus1);
-			}
-		else if (TRect(iWinPosAutoFocus2, iWinSizeAutoFocus2).Contains(aPos))
-			{
-			aPos -= iWinPosAutoFocus2;
-			aEvent.SetHandle((TUint)iWinAutoFocus2);
-			}
-		goto SETOTHERDATA;
-		}
-
-	// Here simulated pointer position is w.r.t to 0,0
-	// Actual pointer position is w.r.t windowPosition
-	if (iSecondaryClient)
-		{
-		if (TRect(iParentWinPos, TSize(iParentWinSize.iWidth, iParentWinSize.iHeight)).Contains(aPos))
-			{
-			// Since for secondary client parent window is at half of screensize
-			aPos -= iParentWinPos;
-			aEvent.SetHandle((aHandle == 0) ? (TUint)iParentWin : aHandle);
-			}
-		}
-	else
-		{
-		// If sent position is on blankWindow then
-		if (TRect(iParentWinPos, TSize(iParentWinSize.iWidth/2, iParentWinSize.iHeight)).Contains(aPos))
-			{
-			aEvent.SetHandle((aHandle == 0) ? (TUint)iParentWin : aHandle);
-			}
-		else // else the pointer event occured on child window
-			{
-			// if aPos < 0 then position has been generated in test code and should not be adjusted
-			if (aPos.iX >= 0)
-				{
-				aPos -= iChildWinPos;	
-				}
-			aEvent.SetHandle((aHandle == 0) ? (TUint)iChildWin : aHandle);
-			}
-		}
-	
-SETOTHERDATA:	
-	aEvent.Pointer()->iType = aType;
-	aEvent.Pointer()->iPosition = aPos;
-	if(iExpectNonAdvancedPointerEvents)
-		{
-		aEvent.Pointer()->iModifiers = aModifiers;		
-		}
-	else
-		{
-		aEvent.Pointer()->iModifiers = aModifiers|EModifierAdvancedPointerEvent;
-		aEvent.SetPointerNumber(aPointerNumber);
-		aEvent.SetPointerZ(aZ);
-		}
-	}
-
-void CTMultiPtrEventClient::AddExpectedPointerEvent(TPointerEvent::TType aType, TPoint aPos, TUint8 aPointerNumber, TUint aHandle)
-	{
-	AddExpectedPointerEvent(aType, aPos, 0, 0, aPointerNumber, aHandle);
-	}
-
-void CTMultiPtrEventClient::AddExpectedPointerEvent(TPointerEvent::TType aType, TPoint aPos, TInt aZ, TUint aModifier, TUint8 aPointerNumber, TUint aHandle)
-	{
-	TWsEvent ptrEvent;
-	ptrEvent.SetType(EEventPointer);
-	if (aType != TPointerEvent::ESwitchOn)
-		{
-		CalculatePtrPosAndSet3Ddata(ptrEvent, aType, aPos, aModifier, aZ, aPointerNumber, aHandle);
-		}
-	static_cast<CTMultiPtrEventBuffer*>(iEventHandler)->AddExpectedEvent(ptrEvent);
-	}
-
-void CTMultiPtrEventClient::AddExpectedWsEvent(TEventCode aType, TInt aPointerNumber, TUint aHandle)
-	{
-	TWsEvent ptrEvent;
-	ptrEvent.SetType(aType);
-	if (aType == EEventPointerEnter || aType == EEventPointerExit)
-		{
-		*ptrEvent.Int() = aPointerNumber;
-		}
-	if (aType == EEventPointerBufferReady)
-		{
-		ptrEvent.SetHandle(aHandle);
-		}
-	static_cast<CTMultiPtrEventBuffer*>(iEventHandler)->AddExpectedEvent(ptrEvent);
-	}
-
-void CTMultiPtrEventClient::AddExpectedMovePoint(TPoint aPos)
-	{
-	static_cast<CTMultiPtrEventBuffer*>(iEventHandler)->AddExpectedMovePtEvent(aPos);
-	}
-
-// Create and store CTMultiPtrEventBuffer in iEventHandler
-void CTMultiPtrEventClient::ConstructEventHandlerL()
-	{
-	CTMultiPtrEventBuffer* eventBufferAndHandler = new(ELeave) CTMultiPtrEventBuffer(&iWs, iTest, this);
-	eventBufferAndHandler->ConstructL();
-	iEventHandler = eventBufferAndHandler;
-	}
-
-// Create groupwindow and blank window for AutoFocus tests
-void CTMultiPtrEventClient::ConstructGroupBlankWinL()
-	{
-	iWinPosAutoFocus1 = TPoint(10,10);
-	iWinSizeAutoFocus1 = TSize(40,40);
-	
-	iWinPosAutoFocus2 = TPoint(50,50);
-	iWinSizeAutoFocus2 = TSize(80,80);
-	
-	iGroupWinAutoFocus1 = new(ELeave) CTWindowGroup(this);
-	iGroupWinAutoFocus1->ConstructL();
-	iGroupWinAutoFocus1->GroupWin()->AutoForeground(ETrue);
-	iGroupWinAutoFocus1->GroupWin()->EnableFocusChangeEvents();
-	
-	iGroupWinAutoFocus2 = new(ELeave) CTWindowGroup(this);
-	iGroupWinAutoFocus2->ConstructL();
-	iGroupWinAutoFocus2->GroupWin()->AutoForeground(ETrue);
-	iGroupWinAutoFocus2->GroupWin()->EnableFocusChangeEvents();
-	
-	iWinAutoFocus1=new(ELeave) CTBlankWindow();
-	iWinAutoFocus1->ConstructL(*iGroupWinAutoFocus1);
-	iWinAutoFocus1->SetExt(iWinPosAutoFocus1, iWinSizeAutoFocus1);
-	iWinAutoFocus1->SetColor(KRgbDarkYellow);
-	iWinAutoFocus1->BaseWin()->EnableAdvancedPointers();
-	iWinAutoFocus1->Activate();
-	
-	iWinAutoFocus2=new(ELeave) CTBlankWindow();
-	iWinAutoFocus2->ConstructL(*iGroupWinAutoFocus2);
-	iWinAutoFocus2->SetExt(iWinPosAutoFocus2, iWinSizeAutoFocus2);
-	iWinAutoFocus2->SetColor(KRgbDarkCyan);
-	iWinAutoFocus2->BaseWin()->EnableAdvancedPointers();
-	iWinAutoFocus2->Activate();
-	}
-
-void CTMultiPtrEventClient::DeleteGroupBlankWin()
-	{
-	delete iWinAutoFocus2;
-	iWinAutoFocus2 = NULL;
-	delete iGroupWinAutoFocus2;
-	iGroupWinAutoFocus2 = NULL;
-	delete iWinAutoFocus1;
-	iWinAutoFocus1 = NULL;
-	delete iGroupWinAutoFocus1;
-	iGroupWinAutoFocus1 = NULL;
-	}
-
-TBool CTMultiPtrEventClient::CheckOrdinalPosition(TInt aAutoFocusWin)
-	{
-	if (aAutoFocusWin == 1)
-		{
-		return iWinAutoFocus1->BaseWin()->OrdinalPosition() == 0;
-		}
-	else
-		{
-		return iWinAutoFocus2->BaseWin()->OrdinalPosition() == 0;
-		}
-	}
-
-//CTMultiPtrEventTest
-CTMultiPtrEventTest::CTMultiPtrEventTest(CTestStep* aStep)
-	: CTWsGraphicsBase(aStep)
-	{
-	}
-
-CTMultiPtrEventTest::~CTMultiPtrEventTest()
-	{
-	((CTMultiPtrEventTestStep*)iStep)->CloseTMSGraphicsStep();
-	delete iMultiPtrEventClient;
-	DestroyAnimDllAndAnim();	
-	if (iPtrPluginLoaded)
-		{
-		iClick.Unload();
-		}
-	iClick.Close();
-	if (iHeap)
-		{
-		iHeap->Close();
-		iChunk.Close();
-		}
-	DeleteGroupWin();
-	}
-
-void CTMultiPtrEventTest::ConstructL()
-	{
-	// Here check if the HAL configuration are correct if not then finish the test case
-	TInt ret = HAL::Get(HALData::EPointerMaxPointers, iMaxDevPointers);
-	if (ret != KErrNone || iMaxDevPointers < 2 || iMaxDevPointers > 8)
-		{
-		TLogMessageText logText1;
-		_LIT(KWrongHALConfig, "HAL configuration are incorrect. \n");
-		logText1.Append(KWrongHALConfig);
-		LOG_MESSAGE(logText1);
-		TEST(EFalse);
-		User::Leave(ret);
-		}
-	
-	// Get the data by using HAL api
-  	User::LeaveIfError(HAL::Get(HALData::EPointerMaxPointers,iMaxDevPointers));
-  	User::LeaveIfError(HAL::Get(HALData::EPointerNumberOfPointers,iMaxUiPointers));
-  	User::LeaveIfError(HAL::Get(HALData::EPointer3DMaxPressure, iMaxPressure));
-  	User::LeaveIfError(HAL::Get(HALData::EPointer3DPressureStep, iPressureStep));
-  	User::LeaveIfError(HAL::Get(HALData::EPointer3DMaxProximity, iMaxProximity));
-  	User::LeaveIfError(HAL::Get(HALData::EPointer3DProximityStep, iProximityStep));
-	
-    _LIT(KWsIniFile, "z:\\system\\data\\wsini.ini");
-    CIniData* iniData = CIniData::NewL(KWsIniFile, ' ');
-    _LIT( KWsiniYShifting, "YSHIFTING");
-    iniData->FindVar(KWsiniYShifting, iYOffset);
-    delete iniData;
-	TheClient->iScreen->SetAppScreenMode(0);
-	TheClient->iScreen->SetScreenMode(0);
-	iPhysicalScreenSize = TheClient->iScreen->SizeInPixels();
-	
-	TheGc->Activate(*BaseWin->Win());
-	TheGc->SetBrushColor(TRgb::Gray16(12));
-	TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TheGc->SetPenStyle(CGraphicsContext::ENullPen);
-	TheGc->DrawRect(TRect(BaseWin->Win()->Size()));
-	TheGc->Deactivate();
-	
-	TheGc->Activate(*TestWin->Win());
-	TheGc->SetBrushColor(TRgb::Gray16(4));
-	TheGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TheGc->SetPenStyle(CGraphicsContext::ENullPen);
-	TheGc->DrawRect(TRect(TestWin->Win()->Size()));
-	TheGc->Deactivate();
-	
-	TheClient->iWs.Flush();
-	}
-
-// Create raw event setting type, X, Y, Z and pointernumber for rawevent
-// use UserSvr for simulating the event
-void CTMultiPtrEventTest::SimulatePointerEvent(TRawEvent::TType aType, TInt aX, TInt aY, TUint8 aPointerNumber)
-	{
-	TRawEvent rawEvent;
-	rawEvent.Set(aType, aX, aY+iYOffset, aPointerNumber);
-	UserSvr::AddEvent(rawEvent);
-	}
-
-void CTMultiPtrEventTest::SimulatePointerEvent(TRawEvent::TType aType, TInt aX, TInt aY, TInt aZ, TUint8 aPointerNumber)
-	{
-	TRawEvent rawEvent;
-	rawEvent.Set(aType, aX, aY+iYOffset, aZ, aPointerNumber);
-	UserSvr::AddEvent(rawEvent);
-	}
-
-// Simulate multipointer down and up event
-void CTMultiPtrEventTest::SimulatePointerDownUp(TInt aX, TInt aY, TInt aZ, TUint8 aPointerNumber)
-	{
-	SimulatePointerEvent(TRawEvent::EButton1Down, aX, aY, aZ, aPointerNumber);
-	SimulatePointerEvent(TRawEvent::EButton1Up, aX, aY, aZ, aPointerNumber);
-	}
-
-void CTMultiPtrEventTest::AddExpectedKey(TInt aEventCode, TInt aScanCode, TInt aCode/*=0*/, TInt aRepeats/*=0*/, TUint aModifiers/*=0*/)
-	{
-	TPckgBuf<TWsEvent> evtPkg;
-	TWsEvent& event=evtPkg();
-	if (aEventCode==EEventKey && aCode==0)
-		aCode=aScanCode;
-	event.SetType(aEventCode);
-	event.SetHandle((TUint)iMultiPtrEventClient->iGroup);
-	event.Key()->iCode=aCode;
-	event.Key()->iScanCode=aScanCode;
-	event.Key()->iModifiers=aModifiers;
-	event.Key()->iRepeats=aRepeats;
-	iMultiPtrEventClient->EventBuffer()->AddExpectedEvent(event);
-	}
-
-void CTMultiPtrEventTest::AddExpectedKeyDownUp(TInt aScanCode, TInt aCode/*=0*/, TInt aRepeats/*=0*/, TUint aModifiers/*=0*/)
-	{
-	__ASSERT_DEBUG(aScanCode<'a' || aScanCode>'z',AutoPanic(EAutoPanicScanCapital));
-	AddExpectedKey(EEventKeyDown,aScanCode,0,aRepeats,aModifiers);
-	AddExpectedKey(EEventKey,aScanCode,aCode,aRepeats,aModifiers);
-	AddExpectedKey(EEventKeyUp,aScanCode,0,aRepeats,aModifiers);
-	}
-
-void CTMultiPtrEventTest::AddExpectedPointerEvent(TPointerEvent::TType aType, TPoint aPos, TUint8 aPointerNumber, TUint aHandle)
-	{
-	AddExpectedPointerEvent(aType, aPos, 0, 0, aPointerNumber, aHandle);
-	}
-
-void CTMultiPtrEventTest::AddExpectedPointerEvent(TPointerEvent::TType aType, TPoint aPos, TInt aZ, TUint aModifier, TUint8 aPointerNumber, TUint aHandle, TBool aSecondaryClient)
-	{
-	if (aSecondaryClient)
-		{
-		iSecMultiPtrEventClient->AddExpectedPointerEvent(aType, aPos, aZ, aModifier, aPointerNumber, aHandle);
-		}
-	else
-		{
-		iMultiPtrEventClient->AddExpectedPointerEvent(aType, aPos, aZ, aModifier, aPointerNumber, aHandle);
-		}
-	}
-
-void CTMultiPtrEventTest::SetExpectNonAdvancedPointerEvents(TBool aSecondaryClient)
-	{
-	if (aSecondaryClient)
-		{
-		iSecMultiPtrEventClient->SetExpectNonAdvancedPointerEvents();
-		}
-	else
-		{
-		iMultiPtrEventClient->SetExpectNonAdvancedPointerEvents();
-		}
-	}
-
-void CTMultiPtrEventTest::ClearExpectNonAdvancedPointerEvents(TBool aSecondaryClient)
-	{
-	if (aSecondaryClient)
-		{
-		iSecMultiPtrEventClient->ClearExpectNonAdvancedPointerEvents();
-		}
-	else
-		{
-		iMultiPtrEventClient->ClearExpectNonAdvancedPointerEvents();
-		}
-	}
-
-void CTMultiPtrEventTest::AddExpectedPointerDownUp(TPoint aPos, TInt aZ, TUint8 aPointerNumber)
-	{
-	AddExpectedPointerEvent(TPointerEvent::EButton1Down, aPos, aZ, 0, aPointerNumber);
-	AddExpectedPointerEvent(TPointerEvent::EButton1Up, aPos, aZ, 0, aPointerNumber);
-	}
-
-void CTMultiPtrEventTest::AddExpectedWsEvent(TEventCode aType, TBool aSecondaryClient, TInt aPointerNumber, TUint aHandle)
-	{
-	if (aSecondaryClient)
-		{
-		iSecMultiPtrEventClient->AddExpectedWsEvent(aType);
-		}
-	else
-		{
-		iMultiPtrEventClient->AddExpectedWsEvent(aType, aPointerNumber, aHandle);
-		}
-	}
-
-void CTMultiPtrEventTest::TestDragForMultiPointer(TPoint aPtrPos, TInt aPrValue, TUint8 aPointerNumber)
-	{
-	SimulatePointerEvent(TRawEvent::EButton1Down, aPtrPos.iX, aPtrPos.iY, aPrValue, aPointerNumber);
-	SimulatePointerEvent(TRawEvent::EPointerMove, aPtrPos.iX+2, aPtrPos.iY+1, aPrValue, aPointerNumber);
-	SimulatePointerEvent(TRawEvent::EButton1Up, aPtrPos.iX+2, aPtrPos.iY+1, 0, aPointerNumber);
-	AddExpectedPointerEvent(TPointerEvent::EButton1Down, aPtrPos, aPrValue, 0, aPointerNumber);
-	aPtrPos.iX += 2; aPtrPos.iY += 1;
-	AddExpectedPointerEvent(TPointerEvent::EDrag, aPtrPos, aPrValue, 0, aPointerNumber);
-	AddExpectedPointerEvent(TPointerEvent::EButton1Up, aPtrPos, 0, 0, aPointerNumber);
-	}
-
-void CTMultiPtrEventTest::SimulateAndAddLoneUpEvents(TInt aNumSimulation, TInt aNumAddition, TPoint aPos)
-	{
-	for (TInt count = 0; count < aNumSimulation; count++)
-		{
-		SimulatePointerEvent(TRawEvent::EButton1Up, aPos.iX, aPos.iY, 0, 0);
-		}
-	for (TInt count = 0; count < aNumAddition; count++)
-		{
-		AddExpectedPointerEvent(TPointerEvent::EButton1Up, aPos, 0, 0, 0);
-		}
-	}
-
-void CTMultiPtrEventTest::TestFilteringForMultiPointer(TBool aFiltering)
-	{
-	TPoint ptrPos;
-	TInt ptrNum;
-	TInt xInc = iPhysicalScreenSize.iWidth/iMaxDevPointers;
-	TInt yInc = iPhysicalScreenSize.iHeight/iMaxDevPointers;
-	
-	for (ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-		{
-		SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-		SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-		if(!aFiltering)
-			{
-			AddExpectedPointerEvent(TPointerEvent::EMove, ptrPos, ptrNum);
-			}
-		AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, ptrNum);
-		ptrPos.iX += xInc/2;
-		ptrPos.iY += yInc/2;
-		}
-	
-	ptrPos.SetXY(0,0);
-	TPoint interPt = ptrPos;
-	for (ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-		{
-		SimulatePointerEvent(TRawEvent::EPointerMove, interPt.iX+2, interPt.iY+1, 0, ptrNum);
-		SimulatePointerEvent(TRawEvent::EPointerMove, interPt.iX+4, interPt.iY+2, 0, ptrNum);
-		SimulatePointerEvent(TRawEvent::EPointerMove, interPt.iX+6, interPt.iY+3, 0, ptrNum);
-		if(!aFiltering)
-			{
-			interPt.iX += 6; interPt.iY += 3;
-			AddExpectedPointerEvent(TPointerEvent::EDrag, interPt, ptrNum);
-			}
-		ptrPos.iX += xInc/2;
-		ptrPos.iY += yInc/2;
-		interPt = ptrPos; 
-		}
-
-	ptrPos.SetXY(0,0);
-	interPt = ptrPos;
-	for (ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-		{
-		interPt.iX += 6;
-		interPt.iY += 3;
-		SimulatePointerEvent(TRawEvent::EButton1Up, interPt.iX, interPt.iY, 0, ptrNum);
-		AddExpectedPointerEvent(TPointerEvent::EButton1Up, interPt, ptrNum);
-		ptrPos.iX += xInc/2;
-		ptrPos.iY += yInc/2;
-		interPt = ptrPos; 
-		}
-	}
-
-void CTMultiPtrEventTest::TestGrabbingForMultiPointer(TBool aGrabbing)
-	{
-	TPoint ptrPos;
-	TInt ptrNum;
-	TInt xInc = iPhysicalScreenSize.iWidth/iMaxDevPointers;
-	TInt yInc = iPhysicalScreenSize.iHeight/iMaxDevPointers;
-	
-	for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-		{
-		SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-		AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, ptrNum);
-		ptrPos.iX += xInc/3;	// Ensure all Button1Down events are on iParentWin
-		ptrPos.iY += yInc/3;
-		}
-	
-	ptrPos.SetXY(0,0);
-	ptrPos.iX += iPhysicalScreenSize.iWidth/2;		// Ensure all Drag and Button1Up events are on iChildWin
-	ptrPos.iY += iPhysicalScreenSize.iHeight/2;
-	for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-		{
-		SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-		if(aGrabbing)
-			{
-			// CalculatePtrPosAndSet3Ddata will subtract iChildWinPos from ptrPos if pointer event occured on child window. Thus we add iChildWinPos here.
-			AddExpectedPointerEvent(TPointerEvent::EDrag, ptrPos+iMultiPtrEventClient->ChildWin()->Position(), ptrNum, (TUint)iMultiPtrEventClient->ParentWin());	
-			}
-		else
-			{
-			AddExpectedPointerEvent(TPointerEvent::EDrag, ptrPos, ptrNum);
-			}
-		ptrPos.iX += xInc/3;
-		ptrPos.iY += yInc/3; 
-		}
-
-	ptrPos.SetXY(0,0);
-	ptrPos.iX += iPhysicalScreenSize.iWidth/2;
-	ptrPos.iY += iPhysicalScreenSize.iHeight/2;
-	for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-		{
-		SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-		if(aGrabbing)
-			{
-			AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos+iMultiPtrEventClient->ChildWin()->Position(), ptrNum, (TUint)iMultiPtrEventClient->ParentWin());
-			}
-		else
-			{
-			AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, ptrNum);
-			}
-		ptrPos.iX += xInc/3;
-		ptrPos.iY += yInc/3;
-		}
-	}
-
-void CTMultiPtrEventTest::TestCapturingForMultiPointer(TBool aAllWinGroups)
-	{
-	TPoint ptrPos;
-	TInt ptrNum = 0;
-	TInt xInc = iPhysicalScreenSize.iWidth/iMaxDevPointers;
-	TInt yInc = iPhysicalScreenSize.iHeight/iMaxDevPointers;
-	
-	// These are some typical values which are used only for testing purposes.
-	// 20mm to screen
-	// 50mm to screen
-	// 4N of pressure
-	// 2N of pressure
-	SetThresholdValues(-20,-50,4000,2000);
-	
-	iMultiPtrEventClient->ChildWin()->BaseWin()->PointerFilter(EPointerMoveEvents, 0);
-	
-	if(!aAllWinGroups)
-		{
-		for (ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-			{
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, -30, ptrNum);
-			AddExpectedPointerEvent(TPointerEvent::EMove, ptrPos-iMultiPtrEventClient->ChildWin()->Position(), -30, 0, ptrNum, (TInt)iMultiPtrEventClient->ChildWin());
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, -10, ptrNum);
-			AddExpectedPointerEvent(TPointerEvent::EEnterCloseProximity, ptrPos-iMultiPtrEventClient->ChildWin()->Position(), -10, 0, ptrNum, (TInt)iMultiPtrEventClient->ChildWin());
-			SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos-iMultiPtrEventClient->ChildWin()->Position(), 0, 0, ptrNum, (TInt)iMultiPtrEventClient->ChildWin());
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX+=2, ptrPos.iY+=2, 5000, ptrNum);
-			AddExpectedPointerEvent(TPointerEvent::EEnterHighPressure, ptrPos-iMultiPtrEventClient->ChildWin()->Position(), 5000, 0, ptrNum, (TInt)iMultiPtrEventClient->ChildWin());
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX-=2, ptrPos.iY-=2, 1000, ptrNum);
-			AddExpectedPointerEvent(TPointerEvent::EExitHighPressure, ptrPos-iMultiPtrEventClient->ChildWin()->Position(), 1000, 0, ptrNum, (TInt)iMultiPtrEventClient->ChildWin());
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX+=2, ptrPos.iY+=2, 1000, ptrNum);
-			AddExpectedPointerEvent(TPointerEvent::EDrag, ptrPos-iMultiPtrEventClient->ChildWin()->Position(), 1000, 0, ptrNum, (TInt)iMultiPtrEventClient->ChildWin());
-			SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos-iMultiPtrEventClient->ChildWin()->Position(), 0, 0, ptrNum, (TInt)iMultiPtrEventClient->ChildWin());
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX-=2, ptrPos.iY-=2, -60, ptrNum);
-			AddExpectedPointerEvent(TPointerEvent::EExitCloseProximity, ptrPos-iMultiPtrEventClient->ChildWin()->Position(), -60, 0, ptrNum, (TInt)iMultiPtrEventClient->ChildWin());
-			ptrPos.iX += xInc/3;	// Ensure all Pointer events are on iParentWin
-			ptrPos.iY += yInc/3;
-			}		
-		}
-	else
-		{
-		ptrPos.iX = iPhysicalScreenSize.iWidth/2 + xInc/3;
-		ptrPos.iY = 0;
-		 		
-		for (ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-			{
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, -10, ptrNum);
-			AddExpectedPointerEvent(TPointerEvent::EEnterCloseProximity, TPoint(ptrPos.iX+iPhysicalScreenSize.iWidth/2, ptrPos.iY), -10, 0, ptrNum, (TInt)iWinForCapturing);
-			SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Down, TPoint(ptrPos.iX+iPhysicalScreenSize.iWidth/2, ptrPos.iY), 0, 0, ptrNum, (TInt)iWinForCapturing);		
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX+=2, ptrPos.iY+=2, 5000, ptrNum);
-			AddExpectedPointerEvent(TPointerEvent::EEnterHighPressure, TPoint(ptrPos.iX+iPhysicalScreenSize.iWidth/2, ptrPos.iY), 5000, 0, ptrNum, (TInt)iWinForCapturing);			
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX-=2, ptrPos.iY-=2, 1000, ptrNum);
-			AddExpectedPointerEvent(TPointerEvent::EExitHighPressure, TPoint(ptrPos.iX+iPhysicalScreenSize.iWidth/2, ptrPos.iY), 1000, 0, ptrNum, (TInt)iWinForCapturing);
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX+=2, ptrPos.iY+=2, 1000, ptrNum);
-			AddExpectedPointerEvent(TPointerEvent::EDrag, TPoint(ptrPos.iX+iPhysicalScreenSize.iWidth/2, ptrPos.iY), 1000, 0, ptrNum, (TInt)iWinForCapturing);
-			SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Up, TPoint(ptrPos.iX+iPhysicalScreenSize.iWidth/2, ptrPos.iY), 0, 0, ptrNum, (TInt)iWinForCapturing);
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, ptrNum);
-			AddExpectedPointerEvent(TPointerEvent::EOutOfRange, TPoint(ptrPos.iX+iPhysicalScreenSize.iWidth/2, ptrPos.iY), 0, 0, ptrNum, (TInt)iWinForCapturing);
-			ptrPos.iX += xInc/3;	
-			ptrPos.iY += yInc/3;
-			}
-		}
-	}
-
-void CTMultiPtrEventTest::SetAutoFlush()
-	{
-	iTheClientFlush = TheClient->iWs.SetAutoFlush(ETrue);
-	iClientFlush = iMultiPtrEventClient->iWs.SetAutoFlush(ETrue);
-	}
-
-void CTMultiPtrEventTest::ResetFlushStopAS()
-	{
-	if (iActiveSchedulerStarted)
-		{
-		iActiveSchedulerStarted = EFalse;
-		CActiveScheduler::Stop();
-		}
-	TheClient->iWs.SetAutoFlush(iTheClientFlush);
-	iMultiPtrEventClient->iWs.SetAutoFlush(iClientFlush);
-	}
-
-// Common function for all test cases
-void CTMultiPtrEventTest::RunTestsL()
-	{
-	// Create CTMultiPtrEventClient for each test case and call NextSetOfEventsL()
-	iMultiPtrEventClient = new(ELeave) CTMultiPtrEventClient(this);
-	iMultiPtrEventClient->SetScreenNumber(iTest->iScreenNumber);
-	iMultiPtrEventClient->ConstructL();
-	
-	iEventSet=0;
-
-	// Create secondary client for test case number 3
-	if (iTest->iState == 3)
-		{
-		iSecMultiPtrEventClient = new(ELeave) CTMultiPtrEventClient(this, 1);
-		iSecMultiPtrEventClient->SetScreenNumber(iTest->iScreenNumber);
-		iSecMultiPtrEventClient->ConstructL(); 
-		}
-	
-	TRAPD(err, NextSetOfEventsL());
-	if (err != KErrNone)
-		{
-		iFailed = ETrue;
-		}
-
-	// Start nested activescheduler if it is not failed for the first attempt
-	if (!iFailed)
-		{
-		iActiveSchedulerStarted = ETrue;
-		CActiveScheduler::Start();
-		}
-
-	//
-	TInt eventsRem = iMultiPtrEventClient->EventBuffer()->EventsRemaining();
-	if (eventsRem > 0)
-		{
-		iFailed=ETrue;
-		}
-
-	// Delete secondary client for test case number 3
-	if (iTest->iState == 3)
-		{
-		delete iSecMultiPtrEventClient;
-		iSecMultiPtrEventClient = NULL;
-		}
-	
-	delete iMultiPtrEventClient;
-	iMultiPtrEventClient = NULL;
-	}
-
-// Common function for all tests
-// Important point to remember is that this function should not leave when running tests
-void CTMultiPtrEventTest::NextSetOfEventsL()
-	{
-	// For each test case calls its respective tests
-		
-	((CTMultiPtrEventTestStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch (iTest->iState)
-		{
-	case 0:
-/**
-@SYMTestCaseID			GRAPHICS-WSERV-ADVANCEDPOINTER-0036
-*/
-		((CTMultiPtrEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-ADVANCEDPOINTER-0036"));
-		MultiPointerEvents();
-		break;
-	case 1:
-		((CTMultiPtrEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-ADVANCEDPOINTER-0014"));
-		PurgingMultiPointerEvents();
-		break;
-	case 2:
-		((CTMultiPtrEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-ADVANCEDPOINTER-0013"));
-		MultiPointerEventsForAnimsL();
-		break;
-	case 3:
-		((CTMultiPtrEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-ADVANCEDPOINTER-0011"));
-		GetRemainingEventsFromSecondaryClient();	// Does nothing for first time
-		MultiClientMultiPointerEvents();
-		break;
-	case 4:
-		((CTMultiPtrEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-ADVANCEDPOINTER-0027"));
-		MultiPointerEventsForPointerClickL();
-		break;
-	case 5:
-		((CTMultiPtrEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-ADVANCEDPOINTER-0028"));
-		MultiPointerEventsInDiffScreenModes();
-		break;
-	case 6:
-		((CTMultiPtrEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-ADVANCEDPOINTER-0025"));
-		FilteringMultiPointerEvents();
-		break;
-	case 7:
-		((CTMultiPtrEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-ADVANCEDPOINTER-0021"));
-		GrabbingMultiPointerEvents();
-		break;
-	case 8:
-		((CTMultiPtrEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-ADVANCEDPOINTER-0031"));
-		VirtualKeyBoardForMultiplePointers();
-		break;
-	case 9:
-		((CTMultiPtrEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-ADVANCEDPOINTER-0032"));
-		DoubleClickForMultiplePointers();
-		break;
-	case 10:
-		((CTMultiPtrEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-ADVANCEDPOINTER-0015"));
-		MultiPointerOutOfRangeEvents();
-		break;
-	case 11:
-		((CTMultiPtrEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-ADVANCEDPOINTER-0026"));
-		AutoForeGroundForMultiplePointersL();
-		break;
-	case 12:
-		((CTMultiPtrEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-ADVANCEDPOINTER-0029"));
-		EmulationRulesForMultiplePointers();
-		break;
-	case 13:
-		((CTMultiPtrEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-ADVANCEDPOINTER-0034"));
-		CloseProximityAndHighPressureEventsL();
-		break;
-	case 14:
-		((CTMultiPtrEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-ADVANCEDPOINTER-0017"));
-		OutOfBoundValueTesting();
-		break;	
-	case 15:
-		((CTMultiPtrEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-ADVANCEDPOINTER-0019"));
-		CapturingMultiPointerEvents();
-		break;
-	case 16:
-		((CTMultiPtrEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-ADVANCEDPOINTER-0035"));
-		NegativeTestsForProximityPressureEventsL();
-		break;
-	case 17:
-		((CTMultiPtrEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-ADVANCEDPOINTER-0034"));
-		PointerRepeatEventForMultiplePointers();
-		break;
-	// Any new test case should be added here.
-	// because some of the above tests use testcase number for certain checks
-	default:
-		((CTMultiPtrEventTestStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-		AutoPanic(EAutoPanicWrongTest);
-		}
-	((CTMultiPtrEventTestStep*)iStep)->RecordTestResultL();
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS-WSERV-ADVANCEDPOINTER-0033
-@SYMPREQ				PREQ1226
-@SYMREQ					REQ9677
-@SYMTestPriority		High
-@SYMTestCaseDesc		To check Wserv sends Pointer Repeat Events for all pointers. 
-@SYMTestStatus			Implemented
-
-@SYMTestActions			Simulate events being passed to the client by implementing each discrete test 
-						over 4 seperate test cases. 
-						In the first test case simulate EButton1Down and add event to a TWsEvent buffer. 
-						In the second test case call RequestPointerRepeatEvent on the base window passing 
-						in a time interval,	a rectangle (the 'hitbox') and pointer number. 
-						Add EButtonRepeat to TWsEvent buffer.  
-						In the third test case simulate EPointerMove event within the hitbox, then simulate 
-						an elapsed period of time longer that specified interval. Add only a EButtonRepeat
-						to TWsEvent buffer.
-						In the final test case simulate EButton1Up and add event to TWsEvent buffer.
-						
-						Repeat steps for the second discrete test, however, in the third test case simulate 
-						EPointerMove event outside the hitbox. In addition add EDrag to TWsEvent buffer 
-						instead of EButtonRepeat. 
-						
-						A third discrete test will be executed over two test cases and will test
-						CancelPointerRepeatEventRequest API.
-						
-@SYMTestExpectedResults The received events must match the events added to the buffer except where EPointerMove
- 						events should be filtered out. In addition, EButtonRepeat will be generated by wserv
- 						after calling RequestPointerRepeatEvent and time interval specified has elapsed.
-						
-*/
-void CTMultiPtrEventTest::PointerRepeatEventForMultiplePointers()
-	{
-	// Test PointerRepeatEvent for Multiple Pointers 
-	TLogMessageText logText;
-	_LIT(KSet, "PointerRepeatEventForMultiplePointers SetOfEvents: %d of 10");
-	logText.AppendFormat(KSet, iEventSet);
-	LOG_MESSAGE(logText);
-	
-	if (!iEventSet)
-		{
-		SetAutoFlush();
-		AddExpectedWsEvent(EEventFocusGained);
-		}
-	iMultiPtrEventClient->EventBuffer()->SetEventCount(0);
-	
-	TPoint ptrPos;
-	TInt ptrNum;
-	// Ensure all pointers are on iParentWin
-	TInt xInc = iPhysicalScreenSize.iWidth/iMaxDevPointers/3;
-	TInt yInc = iPhysicalScreenSize.iHeight/iMaxDevPointers/3;
-		
-	switch(iEventSet++)
-		{
-		// Test cases 0 - 3 represent first discrete test for PointerRepeatEvents
-		case 0:
-			// Simulate EButton1Down events only. This is in order to simulate the event being passed to the client. 
-			// If the event remained in the window queue the PointerRepeatEvent request would be cancelled when PointerRepeatPurgeCheck is performed.
-			INFO_PRINTF1(_L("Simulate EButton1Down event for all pointers."));
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, ptrNum);			
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, ptrNum);
-				ptrPos.iX+=xInc;
-				ptrPos.iY+=yInc;
-				}	
-			break;
-		case 1:
-			// Simulate client calling RequestPointerRepeatEvent in response to EButton1Down event being within a 'hitbox'.
-			INFO_PRINTF1(_L("Simulate PointerRepeatEvent request for all pointers."));
-			ptrPos.SetXY(0,0);
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				iMultiPtrEventClient->ParentWin()->BaseWin()->RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32(100000),TRect(TPoint(0,0), TSize(iPhysicalScreenSize.iWidth/2,iPhysicalScreenSize.iHeight)),ptrNum);				
-				User::After(200000);	
-				AddExpectedPointerEvent(TPointerEvent::EButtonRepeat, ptrPos, ptrNum);			
-				ptrPos.iX+=xInc;
-				ptrPos.iY+=yInc;
-				}
-			break;
-		case 2:
-			// Simulate client calling RequestPointerRepeatEvent in response to EButtonRepeat and pointer remaining within the 'hitbox'.
-			INFO_PRINTF1(_L("Simulate additional PointerRepeatEvent request for all pointers."));
-			// New coordinates will be used for a simulated EPointerMove. This event will be filtered out, however, EButtonRepeat will occur at new coordinates
-			ptrPos.iX = xInc;
-			ptrPos.iY = yInc;
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				iMultiPtrEventClient->ParentWin()->BaseWin()->RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32(100000),TRect(TPoint(0,0), TSize(iPhysicalScreenSize.iWidth/2,iPhysicalScreenSize.iHeight)),ptrNum);				
-				// EPointerMove event is filtered out by TWsPointer::PointerRepeatPurgeCheck
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				User::After(200000);
-				AddExpectedPointerEvent(TPointerEvent::EButtonRepeat, ptrPos, ptrNum);
-				ptrPos.iX+=xInc;
-				ptrPos.iY+=yInc;
-				}
-			break;		
-		case 3:
-			INFO_PRINTF1(_L("Simulate EButton1Up for all pointers."));
-			ptrPos.iX = xInc;
-			ptrPos.iY = yInc;
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, ptrNum);
-				ptrPos.iX+=xInc;
-				ptrPos.iY+=yInc;
-				}
-			break; 			
-		// Test cases 4 - 7 represent second second discrete test for PointerRepeatEvents	
-		case 4:
-			// Simulate EButton1Down events only. This is in order to simulate the event being passed to the client. 
-			// If the event remained in the window queue the PointerRepeatEvent request would be cancelled when PointerRepeatPurgeCheck is performed.
-			INFO_PRINTF1(_L("Simulate EButton1Down event for all pointers.")); 
-			ptrPos.SetXY(0,0);
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, ptrNum);			
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, ptrNum);
-				ptrPos.iX+=xInc;
-				ptrPos.iY+=yInc;
-				}	
-			break;
-		case 5:
-			// Simulate client calling RequestPointerRepeatEvent in response to EButton1Down event being within a 'hitbox'.
-			INFO_PRINTF1(_L("Call RequestPointerRepeatEvent for all pointers."));
-			ptrPos.SetXY(0,0);
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				iMultiPtrEventClient->ParentWin()->BaseWin()->RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32(100000),TRect(TPoint(0,0), TSize(iPhysicalScreenSize.iWidth/3,iPhysicalScreenSize.iHeight)),ptrNum); // hitbox size reduced 				
-				User::After(200000);	
-				AddExpectedPointerEvent(TPointerEvent::EButtonRepeat, ptrPos, ptrNum);			
-				ptrPos.iX+=xInc;
-				ptrPos.iY+=yInc;
-				}
-			break;
-		case 6:
-			// Simulate client calling RequestPointerRepeatEvent in response to EButtonRepeat and event remaining within the 'hitbox' rect.
-			// EPointerMove will take pointer out of the hitbox so should not be filtered. PointerRepeatEvent should be cancelled.
-			INFO_PRINTF1(_L("Simulate a PointerMove event for all pointers to a coordinate outside the hitbox."));
-			// New coordinates will be used for a simulated EPointerMove outisde the hitbox. 
-			ptrPos.iX = iPhysicalScreenSize.iWidth/3 + xInc;
-			ptrPos.iY = 0;
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				iMultiPtrEventClient->ParentWin()->BaseWin()->RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32(100000),TRect(TPoint(0,0), TSize(iPhysicalScreenSize.iWidth/3,iPhysicalScreenSize.iHeight)),ptrNum);				
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				User::After(200000);
-				AddExpectedPointerEvent(TPointerEvent::EDrag, ptrPos, ptrNum);
-				}
-			break;		
-		case 7:
-			INFO_PRINTF1(_L("Simulate EButton1Up for all pointers."));
-			ptrNum = 0;
-			ptrPos.iX = iPhysicalScreenSize.iWidth/3 + xInc;
-			ptrPos.iY = 0;
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, ptrNum);
-				}
-			break;
-		// Test cases 8 and 9 represent third discrete test for PointerRepeatEvents
-		case 8:
-			// Simulate EButton1Down events only. This is in order to simulate the event being passed to the client. 
-			// If the event remained in the window queue the PointerRepeatEvent request would be cancelled when PointerRepeatPurgeCheck is performed.
-			INFO_PRINTF1(_L("Simulate EButton1Down event for all pointers.")); 
-			ptrPos.SetXY(0,0);
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, ptrNum);			
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, ptrNum);
-				ptrPos.iX+=xInc;
-				ptrPos.iY+=yInc;
-				}	
-			break;	
-		case 9:
-			// No simulated events. This test case is to explicity call RWindowBase::CancelPointerRepeatEventRequest(const TUint8 aPointerNumber)
-			INFO_PRINTF1(_L("Call RequestPointerRepeatEvent and CancelPointerRepeatEventRequest for all pointers."));
-			ptrPos.SetXY(0,0);
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				iMultiPtrEventClient->ParentWin()->BaseWin()->RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32(100000),TRect(TPoint(0,0), TSize(iPhysicalScreenSize.iWidth/3,iPhysicalScreenSize.iHeight)),ptrNum); 				
-				iMultiPtrEventClient->ParentWin()->BaseWin()->CancelPointerRepeatEventRequest(ptrNum); 
-				ptrPos.iX+=xInc;
-				ptrPos.iY+=yInc;
-				}
-			INFO_PRINTF1(_L("Simulate EButton1Up for all pointers."));
-			ptrPos.iX = xInc;
-			ptrPos.iY = yInc;
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, ptrNum);
-				ptrPos.iX+=xInc;
-				ptrPos.iY+=yInc;
-				}
-			break;	
-		default:
-			ResetFlushStopAS();
-			break;
-		}
-	LogEventsAdded();
-	}
-
-void CTMultiPtrEventTest::TestErrorCodeL(TInt aExpErrCode, TInt aActualErrCode)
-	{
-	if (aExpErrCode != aActualErrCode)
-		{
-		TLogMessageText logText;
-		_LIT(KError, "Expected Error code = %d Actual Actual Error code %d");
-		logText.AppendFormat(KError, aExpErrCode, aActualErrCode);
-		LOG_MESSAGE(logText);
-		User::Leave(ETestFailed);
-		}
-	}
-
-void CTMultiPtrEventTest::NegativeTestingOfProximityPressureAPIsL()
-	{
-	// First send -10 for EnterCloseProximity and -5 for ExitCLoseProximity, it should return KErrArgument
-	// Then send 20 and 10 which should return KErrNone
-	// Then sent 10 and 20 which should return KErrArgument
-	TInt retVal;
-	retVal = iMultiPtrEventClient->iWs.SetCloseProximityThresholds(-10, -5);
-	TestErrorCodeL(KErrArgument, retVal);
-	
-	retVal = iMultiPtrEventClient->iWs.SetCloseProximityThresholds(20, 10);
-	TestErrorCodeL(KErrNone, retVal);
-	
-	retVal = iMultiPtrEventClient->iWs.SetCloseProximityThresholds(10, 20);
-	TestErrorCodeL(KErrArgument, retVal);
-	
-	// Repeat the above for EnterHighPressure and ExitHighPressure with these values
-	// -10 and -5 it should return KErrArgument
-	// -5 and -10 it should return KErrNone
-	retVal = iMultiPtrEventClient->iWs.SetHighPressureThresholds(-10, -5);
-	TestErrorCodeL(KErrArgument, retVal);
-	
-	retVal = iMultiPtrEventClient->iWs.SetHighPressureThresholds(-5, -10);
-	TestErrorCodeL(KErrNone, retVal);
-	}
-
-void CTMultiPtrEventTest::SimulateProximityAndPressureEvents(TInt aCloseProxEnterValue, TInt aCloseProxExitValue, TInt aHighPresEnterValue, TInt aHighPresExitValue)
-	{
-	TPoint ptrPos(10,10);
-	// Simulate EPointerMove with proximity value > EnterCloseProximity threshold 
-	for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-		{
-		SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, aCloseProxEnterValue, ptrNum);
-		AddExpectedPointerEvent(TPointerEvent::EEnterCloseProximity, ptrPos, aCloseProxEnterValue, 0, ptrNum);
-		}
-	
-	// Simulate EPointerMove with proximity value < ExitCloseProximity threshold
-	for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-		{
-		SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, aCloseProxExitValue, ptrNum);
-		AddExpectedPointerEvent(TPointerEvent::EExitCloseProximity, ptrPos, aCloseProxExitValue, 0, ptrNum);
-		}
-	
-	// Simulate EBUtton1Down with presure value > EnterHighPressure threshold
-	for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-		{
-		SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, aHighPresEnterValue, ptrNum);
-		AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, aHighPresEnterValue, 0, ptrNum);
-		AddExpectedPointerEvent(TPointerEvent::EEnterHighPressure, ptrPos, aHighPresEnterValue, 0, ptrNum);
-		}
-	
-	// Simulate EPointerMove with presure value < ExitHighPressure threshold
-	for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-		{
-		SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, aHighPresExitValue, ptrNum);
-		AddExpectedPointerEvent(TPointerEvent::EExitHighPressure, ptrPos, aHighPresExitValue, 0, ptrNum);
-		}
-	
-	// Finally simulate Ebutton1Up with proximity value < ExitCloseProximity
-	for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-		{
-		SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, aCloseProxExitValue, ptrNum);
-		AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, aCloseProxExitValue, 0, ptrNum);
-		AddExpectedPointerEvent(TPointerEvent::EExitCloseProximity, ptrPos, aCloseProxExitValue, 0, ptrNum);
-		}
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS-WSERV-ADVANCEDPOINTER-0035
-@SYMPREQ				PREQ1226
-@SYMREQ					REQ10887, REQ10886
-@SYMTestPriority		High
-@SYMTestCaseDesc		Negative tests for close Proximity and high Pressure events. 
-@SYMTestStatus			Implemented
-
-@SYMTestActions			Set CloseProximity and HighPressure thresholds with positive and negative values.
-  						Simulate Enter/ExitCloseProximity and Enter/ExitHighPressure events.
-@SYMTestExpectedResults The received events must match the simulated pointer events
-*/
-void CTMultiPtrEventTest::NegativeTestsForProximityPressureEventsL()
-	{
-	TLogMessageText logText;
-	_LIT(KSet, "Negative tests for pressure and proximity events: %d of 3");
-	logText.AppendFormat(KSet, iEventSet);
-	LOG_MESSAGE(logText);
-	
-	if (!iEventSet)
-		{
-		SetAutoFlush();
-		NegativeTestingOfProximityPressureAPIsL();
-		AddExpectedWsEvent(EEventFocusGained);
-		}
-	iMultiPtrEventClient->EventBuffer()->SetEventCount(0);
-	switch(iEventSet++)
-		{
-		case 0:
-			// This is to check close proximity threshold API can be given +ve values
-			// and high pressure threshold API can begiven -ve values
-			iMultiPtrEventClient->iWs.SetCloseProximityThresholds(50, 20);
-			iMultiPtrEventClient->iWs.SetHighPressureThresholds(-20, -50);
-			SimulateProximityAndPressureEvents(60, 10, -10, -60);
-			break;
-		case 1:
-			// Repeat the above with +ve values
-			iMultiPtrEventClient->iWs.SetCloseProximityThresholds(50, 20);
-			iMultiPtrEventClient->iWs.SetHighPressureThresholds(50, 20);
-			SimulateProximityAndPressureEvents(60, 10, 60, 10);
-			break;
-		case 2:
-			// Repeat the above -ve values
-			iMultiPtrEventClient->iWs.SetCloseProximityThresholds(-20, -50);
-			iMultiPtrEventClient->iWs.SetHighPressureThresholds(-20, -50);
-			SimulateProximityAndPressureEvents(-10, -60, -10, -60);
-			break;
-		default:
-			SetThresholdValues(KMaxTInt, KMinTInt, KMaxTInt, KMinTInt);
-			ResetFlushStopAS();
-			break;
-		}
-
-	LogEventsAdded();
-	}
-
-
-void CTMultiPtrEventTest::CreateGroupWinForCapturingL()
-	{
-	iGroupWinForCapturing = new(ELeave) CTWindowGroup(iMultiPtrEventClient);
-	iGroupWinForCapturing->ConstructL();
-	iGroupWinForCapturing->GroupWin()->AutoForeground(ETrue);
-	iGroupWinForCapturing->GroupWin()->EnableFocusChangeEvents();
-				
-	iWinForCapturing = new(ELeave) CTBlankWindow();
-	iWinForCapturing->ConstructL(*iGroupWinForCapturing);
-	iWinForCapturing->SetExt(TPoint(), TSize(iPhysicalScreenSize.iWidth/2, iPhysicalScreenSize.iHeight));
-	iWinForCapturing->SetColor(KRgbBlue);
-	iWinForCapturing->BaseWin()->EnableAdvancedPointers();
-	iWinForCapturing->Activate();
-	}
-
-void CTMultiPtrEventTest::DeleteGroupWinForCapturing()
-	{
-	if (iWinForCapturing)
-		{
-		delete iWinForCapturing;
-		iWinForCapturing = NULL;
-		}
-	if (iGroupWinForCapturing)
-		{
-		delete iGroupWinForCapturing;
-		iGroupWinForCapturing = NULL;
-		}
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS-WSERV-ADVANCEDPOINTER-0019
-@SYMPREQ				PREQ1226
-@SYMREQ					REQ9677,REQ9683,
-@SYMTestPriority		High
-@SYMTestCaseDesc		Checks Wserv supports Capturing in case of multi pointer events.
-@SYMTestStatus			Implemented
-
-@SYMTestActions			Create a window with group window as its parent. 
-						Create another window with same parent and partially overlapping the first one. 
-						SetPointerCapture for second window with TCaptureEnabled flag. 
-						Simulate TRawEvent::EButton1Down from each pointer the device supports
-						
-						Repeat the above with TCaptureFlagAllGroups flag for SetPointerCapture 
-						and creating windows from different window group
-   						
-@SYMTestExpectedResults Even if events were simulated on first window events are delivered to 
-						second window as it is capturing. 
-						With TCaptureFlagAllGroups flag set	events are delivered to window which is
-						capturing even if events were simulated on a window from different group
-						
-*/
-void CTMultiPtrEventTest::CapturingMultiPointerEvents()
-	{
-	// Test Capturing of multi pointer events
-	// 1. Test Wserv supports Capturing in case of multi-pointer events
-	// 2. Test pointer events are delivered correctly when Capturing is disabled.
-	TLogMessageText logText;
-	_LIT(KSet, "CapturingMultiPtrEvents SetOfEvents: %d of 3");
-	logText.AppendFormat(KSet, iEventSet);
-	LOG_MESSAGE(logText);
-	
-	if (!iEventSet)
-		{
-		SetAutoFlush();
-		}
-	iMultiPtrEventClient->EventBuffer()->SetEventCount(0);
-
-	TPoint ptrPos;
-	TInt ptrNum;
-		
-	switch(iEventSet++)
-		{
-		case 0:
-			INFO_PRINTF1(_L("Ensure pointer state is Out of Range"));
-			AddExpectedWsEvent(EEventFocusGained);
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, ptrNum);
-				SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, ptrNum);
-				}
-			break;			
-		case 1:
-			INFO_PRINTF1(_L("Check Wserv supports Capturing in case of multi-pointer events, within window group"));
-			iMultiPtrEventClient->ChildWin()->BaseWin()->SetPointerCapture(RWindowBase::TCaptureEnabled);
-			TestCapturingForMultiPointer(EFalse);
-			break;	
-		case 2:
-			INFO_PRINTF1(_L("Check Wserv supports Capturing in case of multi-pointer events, from different window groups"));
-			TRAPD(err, CreateGroupWinForCapturingL());	// it cannot leave so trap and fail
-			if (err != KErrNone)
-				{
-				Failed();
-				}			
-			AddExpectedWsEvent(EEventFocusLost);		// First group window losing focus because of second group creation
-			AddExpectedWsEvent(EEventFocusGained);		// Second group window creation
-			
-			iWinForCapturing->BaseWin()->SetPointerCapture(RWindowBase::TCaptureEnabled|RWindowBase::TCaptureFlagAllGroups);
-			TestCapturingForMultiPointer(ETrue);
-			break;
-		default:
-			DeleteGroupWinForCapturing();
-			ResetFlushStopAS();
-			break;
-		}
-	LogEventsAdded();
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS-WSERV-ADVANCEDPOINTER-0017
-@SYMPREQ				PREQ1226
-@SYMREQ					Negative Testing
-@SYMTestPriority		High
-@SYMTestCaseDesc		Out of bound value testing
-@SYMTestStatus			Implemented
-
-@SYMTestActions			Simulate raw events of TRawEvent with pointer number greater than EPointerMaxPointers
-						 						
-@SYMTestExpectedResults The received events must match the events added to the buffer and check that out of bound events are ignored.
- 
-*/
-void CTMultiPtrEventTest::OutOfBoundValueTesting()
-	{
-	// Test Wserv ignores pointer events which have a pointer number greater than EPointerMaxPointers. 	 
-	TLogMessageText logText;
-	_LIT(KSet, "OutOfBoundValueTesting SetOfEvents: %d of 1");
-	logText.AppendFormat(KSet, iEventSet);
-	LOG_MESSAGE(logText);
-	
-	if (!iEventSet)
-		{
-		SetAutoFlush();
-		AddExpectedWsEvent(EEventFocusGained);
-		}
-	iMultiPtrEventClient->EventBuffer()->SetEventCount(0);
-
-	TPoint ptrPos;
-	TInt ptrNum;
-	TInt ptrNumOutOfBounds;
-			
-	switch(iEventSet++)
-		{
-		case 0:
-			INFO_PRINTF1(_L("Checks Wserv ignores pointer events which have a pointer number greater than EPointerMaxPointers."));
-			ptrPos.SetXY(0,0);
-			ptrNum = iMaxDevPointers-1;				// Max value for ptrNum
-			ptrNumOutOfBounds = iMaxDevPointers;	// Invalid ptrNum as pointer numbers are zero indexed
-			
-			SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-			SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, ptrNumOutOfBounds);
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX+10, ptrPos.iY+10, 0, ptrNum);
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX+10, ptrPos.iY+10, 0, ptrNumOutOfBounds);
-			SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX+10, ptrPos.iY+10, 0, ptrNum);
-			SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX+10, ptrPos.iY+10, 0, ptrNumOutOfBounds);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, ptrNum);
-			ptrPos.iX += 10; ptrPos.iY += 10;
-			AddExpectedPointerEvent(TPointerEvent::EDrag, ptrPos, ptrNum);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, ptrNum);
-			break;	 
-		default:
-			ResetFlushStopAS();
-			break;
-		}
-	LogEventsAdded();
-	}
-
-void CTMultiPtrEventTest::SetThresholdValues(TInt aEnterCloseProx, TInt aExitCloseProx, TInt aEnterHighPres, TInt aExitHighPres)
-	{
-	iEnterCloseProximityThreshold = aEnterCloseProx;
-	iExitCloseProximityThreshold = aExitCloseProx;
-	iEnterHighPressureThreshold = aEnterHighPres;
-	iExitHighPressureThreshold  = aExitHighPres;
-	
-	iMultiPtrEventClient->iWs.SetCloseProximityThresholds(iEnterCloseProximityThreshold,iExitCloseProximityThreshold);
-	iMultiPtrEventClient->iWs.SetHighPressureThresholds(iEnterHighPressureThreshold,iExitHighPressureThreshold);
-	}
-
-void CTMultiPtrEventTest::TestCloseProximityHighPressureAPIsL()
-	{
-	// These are some typical values which are used only for testing purposes.
-	// 20mm to screen
-	// 50mm to screen
-	// 4N of pressure
-	// 2N of pressure
-	SetThresholdValues(-20,-50,4000,2000);
-	
-	if (iMultiPtrEventClient->iWs.GetEnterCloseProximityThreshold() != iEnterCloseProximityThreshold)
-		{
-		TLogMessageText logText;
-		_LIT(KError, "Expected EnterCloseProximityThreshold = %d Actual EnterCloseProximityThreshold %d");
-		logText.AppendFormat(KError, iEnterCloseProximityThreshold, iMultiPtrEventClient->iWs.GetEnterCloseProximityThreshold());
-		LOG_MESSAGE(logText);
-		User::Leave(ETestFailed);
-		}
-	
-	if (iMultiPtrEventClient->iWs.GetExitCloseProximityThreshold() != iExitCloseProximityThreshold)
-		{
-		TLogMessageText logText;
-		_LIT(KError, "Expected ExitCloseProximityThreshold = %d Actual ExitCloseProximityThreshold %d");
-		logText.AppendFormat(KError, iExitCloseProximityThreshold, iMultiPtrEventClient->iWs.GetExitCloseProximityThreshold());
-		LOG_MESSAGE(logText);		
-		User::Leave(ETestFailed);
-		}
-	
-	if (iMultiPtrEventClient->iWs.GetEnterHighPressureThreshold() != iEnterHighPressureThreshold)
-		{
-		TLogMessageText logText;
-		_LIT(KError, "Expected EnterHighPressureThreshold = %d Actual EnterHighPressureThreshold %d");
-		logText.AppendFormat(KError, iEnterHighPressureThreshold, iMultiPtrEventClient->iWs.GetEnterHighPressureThreshold());
-		LOG_MESSAGE(logText);
-		User::Leave(ETestFailed);
-		}
-	
-	if (iMultiPtrEventClient->iWs.GetExitHighPressureThreshold() != iExitHighPressureThreshold)
-		{
-		TLogMessageText logText;
-		_LIT(KError, "Expected ExitHighPressureThreshold = %d Actual ExitHighPressureThreshold %d");
-		logText.AppendFormat(KError, iExitHighPressureThreshold, iMultiPtrEventClient->iWs.GetExitHighPressureThreshold());
-		LOG_MESSAGE(logText);
-		User::Leave(ETestFailed);
-		}
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS-WSERV-ADVANCEDPOINTER-0034
-@SYMPREQ				PREQ1226
-@SYMREQ					REQ10887,REQ10886
-@SYMTestPriority		High
-@SYMTestCaseDesc		Tests close Proximity and high Pressure event types. 
-@SYMTestStatus			Implemented
-
-@SYMTestActions			Set CloseProximity and HighPressure thresholds and simulate events with different Z values  
-@SYMTestExpectedResults The received events must match the simulated pointer events
-*/
-void CTMultiPtrEventTest::CloseProximityAndHighPressureEventsL()
-	{
-	TLogMessageText logText;
-	_LIT(KSet, "Close Proximity and High Pressure events: %d of 11");
-	logText.AppendFormat(KSet, iEventSet);
-	LOG_MESSAGE(logText);
-	
-	if (!iEventSet)
-		{
-		SetAutoFlush();
-		TestCloseProximityHighPressureAPIsL();
-		AddExpectedWsEvent(EEventFocusGained);
-		}
-	iMultiPtrEventClient->EventBuffer()->SetEventCount(0);
-
-	TPoint ptrPos(10,10);
-	TInt proxValue;
-	TInt prValue;
-	TInt tempCount; 
-	switch(iEventSet++)
-		{
-		case 0:
-			iMultiPtrEventClient->ParentWin()->BaseWin()->PointerFilter(EPointerFilterMove, 0);
-			// One whole cycle of events
-			// Simulate out-of-range from all pointers and don't expect out-of-range events
-			// since all the pointers are already in same state
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, ptrNum);
-				}
-			
-			// Simulate moves with proximity value < EEnterCloseProximity
-			proxValue = -30;
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EMove, ptrPos, proxValue, 0, ptrNum);
-				}
-
-			// Simulate moves with proximity value > EEnterCloseProximity
-			proxValue = -10;
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EEnterCloseProximity, ptrPos, proxValue, 0, ptrNum);
-				}
-			
-			// Simulate EButton1Down with pressure value < EEnterHighPressure
-			prValue = 1000;
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, prValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, prValue, 0, ptrNum);
-				}
-			
-			// Simulate moves with pressure value > EEnterHighPressure
-			prValue = 5000;
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, prValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EEnterHighPressure, ptrPos, prValue, 0, ptrNum);
-				}
-			
-			// Simulate moves with pressure value < EExitHighPressure
-			prValue = 1000;
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, prValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EExitHighPressure, ptrPos, prValue, 0, ptrNum);
-				}
-			
-			// Simulate EButton1Up with proximity value > EEnterCloseProximity
-			proxValue = -10;
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, proxValue, 0, ptrNum);
-				}
-			
-			// Simulate moves with proximity value < EExitCloseProximity
-			proxValue = -60;
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EExitCloseProximity, ptrPos, proxValue, 0, ptrNum);
-				}
-			break;
-		case 1:
-			// Simulate events to meet all scenarios 
-			// Simulate EButton1Down with pressure value < EEnterHighPressure
-			prValue = 1000;
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, prValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, prValue, 0, ptrNum);
-				}
-			
-			// Simulate EButton1Up with proximity value < EExitCloseProximity
-			proxValue = -60;
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, proxValue, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EExitCloseProximity, ptrPos, proxValue, 0, ptrNum);
-				}
-			
-			// Simulate EButton1Down with pressure value > EEnterHighPressure
-			prValue = 5000;
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, prValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, prValue, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EEnterHighPressure, ptrPos, prValue, 0, ptrNum);
-				}
-			
-			// Simulate EButton1Up with proximity value < EExitCloseProximity
-			proxValue = -60;
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, proxValue, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EExitCloseProximity, ptrPos, proxValue, 0, ptrNum);
-				}
-			break;
-		case 2:
-			// Simulate moves with proximity value > EEnterCloseProximity
-			proxValue = -10;
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EEnterCloseProximity, ptrPos, proxValue, 0, ptrNum);
-				}
-			
-			// Simulate EButton1Down with pressure value > EEnterHighPressure
-			prValue = 5000;
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, prValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, prValue, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EEnterHighPressure, ptrPos, prValue, 0, ptrNum);
-				}
-			
-			// Simulate EButton1Up with proximity value > EExitCloseProximity
-			proxValue = -40;		// When you coming up, EEnterCloseProximity is of no use
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, proxValue, 0, ptrNum);
-				}
-			
-			// Simulate out-of-range events
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, proxValue, 0, ptrNum);
-				}
-			break;
-		case 3:
-			// From out-of-range state to EButton1Down
-			// Simulate EButton1Down with pressure value < EEnterHighPressure
-			prValue = 1000;
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, prValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, prValue, 0, ptrNum);
-				}
-			
-			// Simulate EButton1Up with proximity value > EExitCloseProximity
-			proxValue = -40;
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, proxValue, 0, ptrNum);
-				}
-			
-			// Simulate out-of-range events
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, proxValue, 0, ptrNum);
-				}
-			
-			// Simulate EButton1Down with pressure value > EEnterHighPressure
-			prValue = 5000;
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, prValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, prValue, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EEnterHighPressure, ptrPos, prValue, 0, ptrNum);
-				}
-			
-			// Simulate EButton1Up with proximity value > EExitCloseProximity
-			proxValue = -40;
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, proxValue, 0, ptrNum);
-				}
-			
-			// Simulate out-of-range events
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, proxValue, 0, ptrNum);
-				}
-			break;
-		case 4:
-			// Simulate EButton1Dowm with pressure value < EEnterHighPressure
-			prValue = 1000;
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, prValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, prValue, 0, ptrNum);
-				}
-			
-			// Simulate EButton1Up with proximity value < EExitCloseProximity
-			proxValue = -60;
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, proxValue, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EExitCloseProximity, ptrPos, proxValue, 0, ptrNum);
-				}
-			
-			// Simulate out-of-range from Up/OutOfCloseProximity
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, proxValue, 0, ptrNum);
-				}
-			break;
-		case 5:
-			// Purging of proximity and pressure events
-			// Simulate EnterCloseProximity and ExitCloseProximity events which will be purged
-			// when you send Button1Up events for KMaxQueueSize
-			proxValue = -10;
-			for (TInt ptrNum = 0; (ptrNum < iMaxDevPointers && ptrNum < 4); ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				}
-			proxValue = -60;
-			for (TInt ptrNum = 0; (ptrNum < iMaxDevPointers && ptrNum < 4); ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				}
-			for (TInt count = 0; count < KMaxQueueSize; count++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, proxValue, 0);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, proxValue, 0, 0);
-				}
-			break;
-		case 6:
-			// Simulate EnterCloseProximity for 4 pointers. 
-			// As we cannot create lone ExitCloseProximity events, so create just moves from next 4 pointers
-			// Simulate out-of-range for these events on thier respective pointers
-			// Then simulate EButton1Up events which will purge EnterCloseProximity and move events
-			// which checks that lone EnterCloseProximity and lone move events will be purged
-			proxValue = -10;
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, proxValue, 0, ptrNum);
-				}
-			proxValue = -60;
-			for (TInt ptrNum = iMaxDevPointers/2; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, proxValue, 0, ptrNum);
-				}
-			for (TInt count = 0; count < KMaxQueueSize-iMaxDevPointers; count++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, proxValue, 0);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, proxValue, 0, 0);
-				}
-			break;
-		case 7:
-			// Bring all other pointers to Up state, becasue of previous test
-			// Then simulate out-of-range twice for all the pointers
-			// Then simulate Button1Up which will cause purging of successive out-of-range events
-			proxValue = -60;
-			tempCount = 0;
-			for (TInt ptrNum = 1; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				tempCount++;
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, proxValue, 0, ptrNum);
-				}
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				tempCount++;
-				// Wserv does nothing if current state is outofrange and if receives again EOutOfRange event which is practically not possible
-				SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, ptrNum);
-				SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, proxValue, 0, ptrNum);
-				}
-			for (TInt count = 0; count < KMaxQueueSize-tempCount; count++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, proxValue, 0);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, proxValue, 0, 0);
-				}
-			break;
-		case 8:
-			// Simulate EButton1Down with pressure value > EnterHIghPressure threshold
-			// which will cause EButton1Down and EnterHighPressure to be filled in queue
-			// Simulate ExitHighPressure and EButton1Up events for 2 pointers
-			// Then simulate EButton1Up events from pointer0 so that all of the above events are purged
-			prValue = 5000;
-			for (TInt ptrNum = 0; (ptrNum < iMaxDevPointers && ptrNum < 2); ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, prValue, ptrNum);
-				}
-			prValue = 1000;
-			for (TInt ptrNum = 0; (ptrNum < iMaxDevPointers && ptrNum < 2); ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, prValue, ptrNum);
-				// Here these events are purged becasue their correpsonding  down event would have been purged
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, ptrNum);	
-				}
-			// All the above events get purged by this
-			for (TInt count = 0; count < KMaxQueueSize; count++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, 0);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, 0, 0, 0);
-				}
-			break;
-		case 9:
-			// Simulate EButton1Down for 2 pointers, which will generate Button1Down and EnterHighPressure
-			// Simulate Ebutton1Up events for MaxQueueSize from last pointer so that all the above events are purged  
-			prValue = 5000;
-			for (TInt ptrNum = 0; (ptrNum < iMaxDevPointers/2 && ptrNum < 2); ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, prValue, ptrNum);
-				}
-			
-			// This will cause above down and enterhighpressure events to be purged
-			// When pointer is in outofrange state and when EButton1Up event is sent Wserv sends EnterCloseProximity 
-			// EnterCloseProximity cannot be purged unless the next event is EExitCloseProximity or EOutOfRange
-			for (TInt count = 0; count < KMaxQueueSize; count++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, iMaxDevPointers-1);
-				AddExpectedPointerEvent((count ? TPointerEvent::EButton1Up : TPointerEvent::EEnterCloseProximity), ptrPos, 0, 0, iMaxDevPointers-1);
-				}
-
-			// As the first 2 pointers are in down state, and if we send the move events with prValue = 1000
-			// This will generate the exithigh pressure events, which will be ignored
-			// This will also generate the Ebutton1Up event which will also be ignored
-			prValue = 1000;
-			for (TInt ptrNum = 0; (ptrNum < iMaxDevPointers/2  && ptrNum < 2); ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, prValue, ptrNum);
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				}
-			break;
-		case 10:
-			// This is to just bring all the pointers to out-of-range state
-			// to make all pointers in valid state for other test to run
-			// Wserv processes EOutOfRange events only when its current state is not in outofrange. 
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers && ptrNum < 2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, 0, 0, ptrNum);
-				}
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, iMaxDevPointers-1);
-			AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, 0, 0, iMaxDevPointers-1);
-			break;
-		default:
-			SetThresholdValues(KMaxTInt, KMinTInt, KMaxTInt, KMinTInt);
-			ResetFlushStopAS();
-			break;
-		}
-
-	LogEventsAdded();
-	}
-
-void CTMultiPtrEventTest::CreateAnimDllAndAnimL()
-	{
-	iAnimDll = new(ELeave) RAnimDll(iMultiPtrEventClient->iWs);
-	User::LeaveIfError(iAnimDll->Load(KAnimDLLName));
-	iAnim = RMultiPointerAnim::NewL(iMultiPtrEventClient->ParentWin()->BaseWin(), iAnimDll);
-	}
-
-void CTMultiPtrEventTest::DestroyAnimDllAndAnim()
-	{
-	if (iAnim)
-		{
-		iAnim->Destroy();
-		iAnim = NULL;
-		}
-	if (iAnimDll)
-		{
-		iAnimDll->Destroy();
-		iAnimDll = NULL;
-		}
-	}
-
-void CTMultiPtrEventTest::CreateGroupWinL()
-	{
-	iGroupWinForEmul = new(ELeave) CTWindowGroup(iMultiPtrEventClient);
-	iGroupWinForEmul->ConstructL();
-	iGroupWinForEmul->GroupWin()->AutoForeground(ETrue);
-	iGroupWinForEmul->GroupWin()->EnableFocusChangeEvents();
-
-	iWinForEmul = new(ELeave) CTBlankWindow();
-	iWinForEmul->ConstructL(*iGroupWinForEmul);
-	iWinForEmul->SetExt(TPoint(50,50), TSize(80,80));
-	iWinForEmul->SetColor(KRgbDarkYellow);
-	iWinForEmul->Activate();	
-	}
-
-void CTMultiPtrEventTest::DeleteGroupWin()
-	{
-	if (iWinForEmul)
-		{
-		delete iWinForEmul;
-		iWinForEmul = NULL;
-		}
-	if (iGroupWinForEmul)
-		{
-		delete iGroupWinForEmul;
-		iGroupWinForEmul = NULL;
-		}
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS-WSERV-ADVANCEDPOINTER-0029
-@SYMPREQ				PREQ1226
-@SYMREQ					REQ9688
-@SYMTestPriority		High
-@SYMTestCaseDesc		Tests the emulation rules for Apps, Anims, Autofocus and Buffered delivery
-@SYMTestStatus			Implemented
-
-@SYMTestActions			Simulate event to make a pointer primary. EnableAdvancedPointers API is not called. And then simulate events from other pointers  
-@SYMTestExpectedResults The events from other pointer are not received
-*/
-void CTMultiPtrEventTest::EmulationRulesForMultiplePointers()
-	{
-	TLogMessageText logText;
-	_LIT(KSet, "Emulation rules set of events: %d of 15");
-	logText.AppendFormat(KSet, iEventSet);
-	LOG_MESSAGE(logText);
-	
-	if (!iEventSet)
-		{
-		SetExpectNonAdvancedPointerEvents();
-		SetAutoFlush();
-		AddExpectedWsEvent(EEventFocusGained);
-		}
-	iMultiPtrEventClient->EventBuffer()->SetEventCount(0);
-	
-	TPoint ptrPos(10,10);
-	TInt proxValue = -iProximityStep;
-	TInt prValue = iPressureStep;
-	TInt ptrNum = 0;
-	switch(iEventSet++)
-		{
-		case 0:
-			// This event is for simulated/primary pointer
-			iMultiPtrEventClient->ParentWin()->BaseWin()->PointerFilter(EPointerFilterMove, 0);
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, 0);
-			AddExpectedPointerEvent(TPointerEvent::EMove, ptrPos, proxValue, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			
-			// Parent window has not called EnableAdvancedPointers API
-			// So even if we simulate moves and out-of-range these are not delivered to client
-			for (ptrNum = 1; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, ptrNum);
-				}
-			break;
-		case 1:
-			// Since the primary pointer is 0, simulate EButton1Down for making pointer 1 as primary 
-			SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, 1);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			
-			// Simulate move or Ebutton1Down from pointer0 they are NOT sent back to client
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, 0);
-			SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, 0);
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 0);
-			
-			SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, 1);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 1);
-			AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			break;
-		case 2:
-			// Simulate EButton1Down from pointer0 to make it primary
-			SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, 0, 0, 0);
-			
-			// Move from pointer1
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, 1);
-			
-			// Take the zero pointer out-of-range, this will not result in Pointer 1 becoming primary
-			// and out-of-range event is sent to client
-			SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, 0, 0, 0);
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, 0, 0, 0);
-			
-			// Send moves from pointer1, but these are not sent to the Client.
-			ptrPos.iX += 10;
-			ptrPos.iY += 10;
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, 1);
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 1);
-			
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, 1);
-			AddExpectedPointerEvent(TPointerEvent::EMove, ptrPos, proxValue, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 1);
-			AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, proxValue, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			break;
-		case 3:
-			// Simulate EButton1Down from pointer0 to make it primary
-			SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			
-			// Simulate EButton1Down from pointer1, which is not sent to client 
-			SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, 1);
-			
-			SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			
-			// Drag events are not sent becasue pointer1 has NOT become primary
-			ptrPos.iX += 10;
-			ptrPos.iY += 10;
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, 0, 1);
-			
-			// Simulate up from pointer1, still not primary, so event is not sent
-			SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, 1);
-			
-			// Simulate out-of-range from pointer1, still not primary, so event is not sent
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 1);
-			
-			// Now moves from out-of-range to move state 
-			ptrPos.iX += 10;
-			ptrPos.iY += 10;
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, 0, 1);
-			AddExpectedPointerEvent(TPointerEvent::EMove, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 1);
-			AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			break;
-		case 4:
-			// pointer0 sends move (becomes primary)
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EMove, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			
-			// pointer0 sends down
-			SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			
-			// pointer1 sends down, doesn't become primary
-			SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, 1);
-
-			// pointer0 sends up, stays primary
-			SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-
-			// pointer2, pointer3 and pointer4 sends move with proximity -5, -10, -15
-			for (ptrNum = 2; ptrNum < iMaxDevPointers; ptrNum++, proxValue -= iProximityStep)
-				{
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				}
-			
-			// pointer0 sends out-of-range, loses primary pointer, But NO events are sent
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			
-			// Send moves for pointer2, pointer3 and pointer4.
-			// None of the evnst are sent
-			ptrPos.SetXY(0,0);
-			for (ptrNum = 2; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				ptrPos.iX += 10;
-				ptrPos.iY += 5;
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				}
-			
-			// Drag from pointer1, NOT sent, since it is not primary
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, prValue, 1);
-
-			// Send out-of-range from all pointers
-			for (ptrNum = 2; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, ptrNum);
-				}
-			
-			// As the pointer1 is down, this will not become primary even if EButton1Up is called
-			SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, 1);
-			
-			// And now sending out-of-range will also not send the event to client as it is not primary
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 1);
-			break;
-		case 5:
-			// Test cases 5 - 7 represent one discrete test for PointerRepeatEvents
-			// Case 5 simulates EButton1Down events only. This is to ensure the event is delivered to the client. 
-			// If the event remained in the window queue the PointerRepeatEvent request would be cancelled when PointerRepeatPurgeCheck is performed.
-			ptrPos.SetXY(0,0);
-			
-			// pointer0 sends down (become primary)
-			SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			
-			// pointer1 sends down, doesn't become primary
-			SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, 1);
-			
-			// pointer4 sends down
-			if (4 < iMaxDevPointers)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, 4);
-				}
-			break;
-		case 6:
-			ptrPos.SetXY(0,0);
-			// Simulate client calling RequestPointerRepeatEvent in response to EButton1Down event being within a 'hitbox'.
-			// Legacy API called which does not specify a pointer number. EButtonRepeat should be generated for primary pointer only.
-			iMultiPtrEventClient->ParentWin()->BaseWin()->RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32(100000),TRect(TPoint(0,0), TSize(20,20)));				
-			User::After(200000);	
-			AddExpectedPointerEvent(TPointerEvent::EButtonRepeat, ptrPos, TAdvancedPointerEvent::EDefaultPointerNumber);			
-			break;
-		case 7:
-			// pointer0 sends up 
-			SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, TAdvancedPointerEvent::EDefaultPointerNumber);
-			
-			// pointer2 sends out-of-range
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, ptrPos.iX, ptrPos.iY, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, TAdvancedPointerEvent::EDefaultPointerNumber);
-			
-			// Send up and out-of-range for pointer1 and 4
-			SimulatePointerEvent(TRawEvent::EButton1Up, 0, 0, 0, 1);
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 1);
-			
-			if (4 < iMaxDevPointers)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Up, 0, 0, 0, 4);
-				SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 4);
-				}
-			break;
-		case 8:
-			// Autofocus does not work for other than primary pointers
-			// Create group window which will send focus lost and gained
-			TRAPD(err, CreateGroupWinL());	// it cannot leave so trap and fail
-			if (err != KErrNone)
-				{
-				Failed();
-				}
-			AddExpectedWsEvent(EEventFocusLost);
-			AddExpectedWsEvent(EEventFocusGained);
-			
-			// Simulate Epointer down which will send focuslost, focusgained and focusgroupchanged events 
-			SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, 0);
-			AddExpectedWsEvent(EEventFocusLost); 
-			AddExpectedWsEvent(EEventFocusGained);
-			AddExpectedWsEvent(EEventFocusGroupChanged);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			
-			// Now simulate EButton1Down from first or second pointer on second group
-			// This should not reflect the autofocus
-			ptrPos.iX = 60;
-			ptrPos.iY = 60;
-			SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, 1);
-			if (2 < iMaxDevPointers)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, 2);
-				}
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 1);
-			if (2 < iMaxDevPointers)
-				{
-				SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 2);
-				}
-			SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			break;
-		case 9:
-			// First thing to do in this case is to delete the group window created
-			DeleteGroupWin();
-			
-			TRAP(err, CreateAnimDllAndAnimL());	// it cannot leave so trap and fail
-			if (err != KErrNone)
-				{
-				Failed();
-				}
-
-			// This is the first event which makes first pointer as primary
-			// When the last argument is EFalse, it means that the event is not consumed by Anim
-			iAnim->AddExpectedAnimPointerEvent(TRawEvent::EPointerMove, ptrPos, 0, 0, 0, EFalse);
-			AddExpectedPointerEvent(TPointerEvent::EMove, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, 0, 0);
-			
-			// Now simulate moves from other pointers and these events are not sent to anim
-			for (ptrNum = 1; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, ptrNum);
-				}
-
-			// This is to reset the primary pointer 
-			iAnim->AddExpectedAnimPointerEvent(TRawEvent::EPointer3DOutOfRange, ptrPos, 0, 0, 0, EFalse);
-			AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 0);
-	
-			// Now simulate EButton1Down, which will make it as primary
-			iAnim->AddExpectedAnimPointerEvent(TRawEvent::EButton1Down, ptrPos, 0, 0, 1, EFalse);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, 1);
-			
-			// Simulate move or Ebutton1Down from any other prointer they are not sent back to client
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, 0);
-			SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, 0);
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 0);
-			
-			iAnim->AddExpectedAnimPointerEvent(TRawEvent::EButton1Up, ptrPos, 0, 0, 1, EFalse);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, 1);
-			
-			iAnim->AddExpectedAnimPointerEvent(TRawEvent::EPointer3DOutOfRange, ptrPos, 0, 0, 1, EFalse);
-			AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 1);
-
-			// Set the primary pointer to Zero			
-			iAnim->AddExpectedAnimPointerEvent(TRawEvent::EButton1Down, ptrPos, 0, 0, 0, EFalse);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, 0);
-			
-			// Move from second pointer
-			// As EnableMultiPointer is not called and this is not a primary pointer so this event
-			// will cause the pointer 1 into move state
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, 1);
-			
-			// Take the zero pointer out-of-range 
-			iAnim->AddExpectedAnimPointerEvent(TRawEvent::EButton1Up, ptrPos, 0, 0, 0, EFalse);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, 0);
-			
-			iAnim->AddExpectedAnimPointerEvent(TRawEvent::EPointer3DOutOfRange, ptrPos, 0, 0, 0, EFalse);
-			AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 0);
-			
-			// These moves will not be sent
-			ptrPos.iX += 10;
-			ptrPos.iY += 10;
-			
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, 1);
-			SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, 1);
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 1);		
-
-			TestAndDisplayAnimError();
-			
-			_LIT(KEventsChecked, "Events checked at server side = %d");
-			logText.Format(KEventsChecked, 10);
-			LOG_MESSAGE(logText);
-			break;
-		case 10:
-			DestroyAnimDllAndAnim();
-			
-			// Test for PointerMove buffers
-			// AllocPointerMoveBuffer, EnablePointerMoveBuffer and then simulate few moves
-			// Add these moves to another points buffer for testing
-			// Simulate moves from other pointers, these should not be delivered to clients.
-			iMultiPtrEventClient->ParentWin()->BaseWin()->AllocPointerMoveBuffer(10, 0);
-			iMultiPtrEventClient->ParentWin()->BaseWin()->EnablePointerMoveBuffer();
-			
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, 0, 0);
-			AddExpectedWsEvent(EEventPointerBufferReady, EFalse, TAdvancedPointerEvent::EDefaultPointerNumber, (TUint)iMultiPtrEventClient->ParentWin());
-			iMultiPtrEventClient->AddExpectedMovePoint(ptrPos);   // If this position is above some other window then we need to consider its window postion also
-			ptrPos.iX += 10;
-			ptrPos.iY += 10;
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, 0, 0);
-			iMultiPtrEventClient->AddExpectedMovePoint(ptrPos);
-			ptrPos.iX += 10;
-			ptrPos.iY += 10;
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, 0, 0);
-			iMultiPtrEventClient->AddExpectedMovePoint(ptrPos);
-			
-			// These events should not be added to buffer
-			for (ptrNum = 1; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				ptrPos.iX += 10;
-				ptrPos.iY += 10;
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, ptrNum);
-				}
-			break;
-		case 11:
-			// Repeat the above for drag events
-			SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, 0, 0);
-			AddExpectedWsEvent(EEventPointerBufferReady, EFalse, TAdvancedPointerEvent::EDefaultPointerNumber, (TUint)iMultiPtrEventClient->ParentWin());
-			iMultiPtrEventClient->AddExpectedMovePoint(ptrPos);
-			ptrPos.iX += 10;
-			ptrPos.iY += 10;
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, 0, 0);
-			iMultiPtrEventClient->AddExpectedMovePoint(ptrPos);
-			ptrPos.iX += 10;
-			ptrPos.iY += 10;
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, 0, 0);
-			iMultiPtrEventClient->AddExpectedMovePoint(ptrPos);
-			
-			// These events should not be added to buffer
-			for (ptrNum = 1; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				ptrPos.iX += 10;
-				ptrPos.iY += 10;
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, ptrNum);
-				}
-			
-			SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			break;
-		case 12:
-			iMultiPtrEventClient->ParentWin()->BaseWin()->FreePointerMoveBuffer();
-			iMultiPtrEventClient->ParentWin()->BaseWin()->DisablePointerMoveBuffer();
-			
-			// Pointer Cursor Position test 
-			// This event is for simulating primary pointer
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, 0);
-			// Here I am not adding the event because this event is deleted by another move of same pointer
-			if (ptrPos != iMultiPtrEventClient->iWs.PointerCursorPosition())
-				{
-				TEST(EFalse);
-				Failed();
-				}
-			
-			iMultiPtrEventClient->iWs.SetPointerCursorPosition(TPoint(20,20));
-			if (TPoint(20,20) != iMultiPtrEventClient->iWs.PointerCursorPosition())
-				{
-				TEST(EFalse);
-				Failed();
-				}
-			
-			// Now simulate moves from other pointer, this should not have any effect on pointer cursor position
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, 1);
-
-			// Now move the primary pointer, and check the pointer cursor position which should be same as position used for move
-			ptrPos.iX = 30;
-			ptrPos.iY = 30;
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, 0);
-			AddExpectedPointerEvent(TPointerEvent::EMove, ptrPos, proxValue, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			if (ptrPos != iMultiPtrEventClient->iWs.PointerCursorPosition())
-				{
-				TEST(EFalse);
-				Failed();
-				}
-			
-			// Send out-of-range event which will not lead to pointer 1 becoming primary
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, proxValue, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			
-			// Now check the pointer cursor position, which should be same
-			// as primary even if there is other pointer in up state, but that is not primary
-			if (ptrPos != iMultiPtrEventClient->iWs.PointerCursorPosition())
-				{
-				TEST(EFalse);
-				Failed();
-				}
-			
-			// This is to bring the pointer1 to out-of-range state
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 1);
-			
-			// then send move event and then again check the pointer cursor position
-			ptrPos.iX = 20;
-			ptrPos.iY = 20;
-			SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, 1);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			if (ptrPos != iMultiPtrEventClient->iWs.PointerCursorPosition())
-				{
-				TEST(EFalse);
-				Failed();
-				}
-			
-			SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, 1);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 1);
-			AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			break;
-		case 13:
-			{
-			// Pointer Cursor Area test-1
-			iOrigPtrCursorArea = iMultiPtrEventClient->iWs.PointerCursorArea();
-			TRect ptrCurArea(0,0,40,40);
-			iMultiPtrEventClient->iWs.SetPointerCursorArea(ptrCurArea);
-			
-			// Simulate move from pointer0 in PointerCursorArea
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, 0);
-			AddExpectedPointerEvent(TPointerEvent::EMove, ptrPos, proxValue, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			
-			// Simulate move from other pointer, This should have no effect
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, 1);
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 1);
-			
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, proxValue, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-
-			// Repeat the above with moves outside pointer cursor area 
-			ptrPos.iX = 50;
-			ptrPos.iY = 50;
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, 0);
-			TPoint pointInCurArea(39, 39);
-			AddExpectedPointerEvent(TPointerEvent::EMove, pointInCurArea, proxValue, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			
-			// Simulate move from other pointer, This should have no effect			
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, 1);
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 1);
-						
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EOutOfRange, pointInCurArea, proxValue, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			}
-			break;
-		case 14:
-			{
-			// Pointer Cursor Area test-2
-			// repeat the above test with button1 down
-			SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			
-			// Simulate move from other pointer, This should have no effect
-			SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, 1);
-			SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, 1);
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 1);
-			
-			SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			
-			// Repeat the above with moves outside pointer cursor area 
-			ptrPos.iX = 50;
-			ptrPos.iY = 50;
-			TPoint pointInCurArea(39, 39);
-			SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Down, pointInCurArea, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			
-			// Simulate move from other pointer, This should have no effect
-			SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, 1);
-			SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, 1);
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 1);
-			
-			SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Up, pointInCurArea, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			
-			SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EOutOfRange, pointInCurArea, 0, 0, TAdvancedPointerEvent::EDefaultPointerNumber);
-			}
-			break;
-		default:
-			ClearExpectNonAdvancedPointerEvents();
-			iMultiPtrEventClient->iWs.SetPointerCursorArea(iOrigPtrCursorArea);
-			ResetFlushStopAS();
-			break;
-		}
-	LogEventsAdded();
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS-WSERV-ADVANCEDPOINTER-0026
-@SYMPREQ				PREQ1226
-@SYMREQ					REQ9677, REQ9683
-@SYMTestPriority		High
-@SYMTestCaseDesc		Checks Wserv supports Autofocus for multiple pointers
-@SYMTestStatus			Implemented
-
-@SYMTestActions			Create 2 group window and respective client windows for it. And simulate EButton1Down on each window consecutively 
-@SYMTestExpectedResults The received events must match the simulated pointer events
-*/
-void CTMultiPtrEventTest::AutoForeGroundForMultiplePointersL()
-	{
-	TLogMessageText logText;
-	_LIT(KSet, "Multiple pointer Auto foreground events: %d of 2");
-	logText.AppendFormat(KSet, iEventSet);
-	LOG_MESSAGE(logText);
-	
-	if (!iEventSet)
-		{
-		SetAutoFlush();
-		AddExpectedWsEvent(EEventFocusGained);			// This if for the main groupwindow
-		iMultiPtrEventClient->ConstructGroupBlankWinL();
-		
-		// These are for child group window creation
-		AddExpectedWsEvent(EEventFocusLost);			// This if for the main groupwindow losing focus
-		AddExpectedWsEvent(EEventFocusGained);			// First group window of this test creation
-		
-		AddExpectedWsEvent(EEventFocusLost);			// First group window losing focus because of second group creation
-		AddExpectedWsEvent(EEventFocusGained);			// Second group window creation
-		AddExpectedWsEvent(EEventFocusGroupChanged);	// First group window's Enable Focus changed flag is set
-		}
-	iMultiPtrEventClient->EventBuffer()->SetEventCount(0);
-	
-	TPoint win1PtrPos(20,20);
-	TPoint win2PtrPos(60,60);
-	TPoint ptrPos;
-	TInt autoFocusWin;
-	switch(iEventSet++)
-		{
-		case 0:
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				if ((ptrNum & 1) == 0)
-					{
-					ptrPos = win1PtrPos;
-					autoFocusWin = 1;
-					}
-				else
-					{
-					ptrPos = win2PtrPos;
-					autoFocusWin = 0;
-					}
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				AddExpectedWsEvent(EEventFocusLost);				// Second group window losing focus 
-				AddExpectedWsEvent(EEventFocusGained);				// First group window gaining focus
-				if (ptrNum == 0)
-					{												// First group window has already received EEventFocusGroupChanged
-					AddExpectedWsEvent(EEventFocusGroupChanged);	// Second group window's Enable Focus changed flag is set
-					}
-				// In the queue only once EEventFocusGroupChanged is sent
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, 0, 0, ptrNum);
-				
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, 0, 0, ptrNum);
-				
-				// These events are to clear out the pointer state
-				SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, 0, 0, ptrNum);
-				
-				if (!iMultiPtrEventClient->CheckOrdinalPosition(autoFocusWin))
-					{
-					TEST(EFalse);
-					Failed();
-					}
-				}
-			break;
-		case 1:
-			for (TInt ptrNum = iMaxDevPointers/2; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				if ((ptrNum & 1) == 0)
-					{
-					ptrPos = win1PtrPos;
-					autoFocusWin = 1;
-					}
-				else
-					{
-					ptrPos = win2PtrPos;
-					autoFocusWin = 0;
-					}
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				AddExpectedWsEvent(EEventFocusLost);				// Second group window losing focus 
-				AddExpectedWsEvent(EEventFocusGained);				// First group window gaining focus
-				if (ptrNum == iMaxDevPointers/2) // first loop
-					{												
-					// When ever a group window changes focus, For all the group/client windows which have 
-					// registered for receiving group window changes recive EEventFocusGroupChanged
-					// EEventFocusGroupChanged is sent only once in one queue
-					AddExpectedWsEvent(EEventFocusGroupChanged);
-					AddExpectedWsEvent(EEventFocusGroupChanged);
-					}
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, 0, 0, ptrNum);
-
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, 0, 0, ptrNum);
-				
-				// These events are to clear out the pointer state
-				SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, 0, 0, ptrNum);
-				if (!iMultiPtrEventClient->CheckOrdinalPosition(autoFocusWin))
-					{
-					TEST(EFalse);
-					Failed();
-					}
-				}
-			break;
-		default:
-			iMultiPtrEventClient->DeleteGroupBlankWin();
-			ResetFlushStopAS();
-			break;
-		}
-	
-	LogEventsAdded();
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS-WSERV-ADVANCEDPOINTER-0015
-@SYMPREQ				PREQ1226
-@SYMREQ					REQ9684
-@SYMTestPriority		High
-@SYMTestCaseDesc		Checks Wserv supports out-of-range and pointer Enter/Exit events.
-@SYMTestStatus			Implemented
-
-@SYMTestActions			Simulate moves and EPointer3DOutOfRange from different pointers
-@SYMTestExpectedResults The received events must match the simulated pointer events
-*/
-void CTMultiPtrEventTest::MultiPointerOutOfRangeEvents()
-	{
-	TLogMessageText logText;
-	_LIT(KSet, "OutOfRange & Enter/Exit events: %d of 4");
-	logText.AppendFormat(KSet, iEventSet);
-	LOG_MESSAGE(logText);
-	
-	if (!iEventSet)
-		{
-		SetAutoFlush();
-		AddExpectedWsEvent(EEventFocusGained);
-		}
-	iMultiPtrEventClient->EventBuffer()->SetEventCount(0);
-	
-	TPoint ptrPos(10,10);
-	TInt proxValue = -iProximityStep; 
-	switch(iEventSet++)
-		{
-		case 0:
-			// Simulate moves and EPointer3DOutOfRange from all pointers
-			iMultiPtrEventClient->ParentWin()->BaseWin()->PointerFilter(EPointerFilterMove, 0);
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EMove, ptrPos, proxValue, 0, ptrNum);
-				
-				SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, proxValue, 0, ptrNum);
-				// Here I am not enabling the enter/exit events filter so not getting those 
-				}
-			break;
-		case 1:
-			// Repeat the above by enabling the enter/exit events
-			iMultiPtrEventClient->ParentWin()->BaseWin()->PointerFilter(EPointerFilterEnterExit, 0);
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum = ptrNum+2)
-				{
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				AddExpectedWsEvent(EEventPointerEnter, EFalse, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EMove, ptrPos, proxValue, 0, ptrNum);
-				
-				SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, ptrNum);
-				AddExpectedWsEvent(EEventPointerExit, EFalse, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, proxValue, 0, ptrNum);
-				}
-			break;
-		case 2:
-			// Check the moves from one window to other
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum = ptrNum+2)
-				{
-				ptrPos.iX = 10;
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				AddExpectedWsEvent(EEventPointerEnter, EFalse, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EMove, ptrPos, proxValue, 0, ptrNum);
-				
-				ptrPos.iX = (iMultiPtrEventClient->ParentWin()->Size().iWidth)/2 + 10;
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				AddExpectedWsEvent(EEventPointerExit, EFalse, ptrNum); // move and enter of child window is filtered out
-				}
-			break;
-		case 3:
-			// Since all the pointers are now on child and when we change the pointer filter
-			// wserv sends enter event to all pointers
-			iMultiPtrEventClient->ChildWin()->BaseWin()->PointerFilter(EPointerFilterEnterExit, 0);
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum = ptrNum+2)
-				{
-				AddExpectedWsEvent(EEventPointerEnter, EFalse, ptrNum);
-				}
-			for (TInt ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum = ptrNum+2)
-				{
-				ptrPos.iX = ptrPos.iY =10;
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				AddExpectedWsEvent(EEventPointerExit, EFalse, ptrNum);
-				AddExpectedWsEvent(EEventPointerEnter, EFalse, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EMove, ptrPos, proxValue, 0, ptrNum);
-				
-				SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, 0, 0, 0, ptrNum);
-				AddExpectedWsEvent(EEventPointerExit, EFalse, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EOutOfRange, ptrPos, proxValue, 0, ptrNum);
-				}
-			break;			
-		default:
-			ResetFlushStopAS();
-			break;
-		}
-	
-	LogEventsAdded();
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS-WSERV-ADVANCEDPOINTER-0032
-@SYMPREQ				PREQ1226
-@SYMREQ					REQ9677
-@SYMTestPriority		High
-@SYMTestCaseDesc		Checks Wserv supports Double click events for multi pointer events.
-@SYMTestStatus			Implemented
-
-@SYMTestActions			Simulate double click events from different pointers 			
-@SYMTestExpectedResults The received events must match the simulated pointer events
-*/
-void CTMultiPtrEventTest::DoubleClickForMultiplePointers()
-	{
-	// Logic involved, double click settings are global no need to test them
-	// Check that double click events are sent by wserv for all pointers
-	TLogMessageText logText;
-	_LIT(KSet, "Double click settings and events: %d of 1");
-	logText.AppendFormat(KSet, iEventSet);
-	LOG_MESSAGE(logText);
-	
-	if (!iEventSet)
-		{
-		SetAutoFlush();
-		AddExpectedWsEvent(EEventFocusGained);
-		}
-	iMultiPtrEventClient->EventBuffer()->SetEventCount(0);
-	
-	TPoint ptrPos(10,10);
-	switch(iEventSet++)
-		{
-		case 0:
-			for (TInt ptrNum = 0; ptrNum < Min(iMaxDevPointers, 7); ptrNum++)
-				{
-				SimulatePointerDownUp(ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				SimulatePointerDownUp(ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				AddExpectedPointerDownUp(ptrPos, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, 0, EModifierDoubleClick, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, 0, 0, ptrNum);
-				}
-			break;
-		default:
-			ResetFlushStopAS();
-			break;
-		}
-	
-	LogEventsAdded();
-	}
-
-
-/**
-@SYMTestCaseID			GRAPHICS-WSERV-ADVANCEDPOINTER-0031
-@SYMPREQ				PREQ1226
-@SYMREQ					REQ9677
-@SYMTestPriority		High
-@SYMTestCaseDesc		Checks Wserv supports Virtual keyboard for multi pointer events.
-@SYMTestStatus			Implemented
-
-@SYMTestActions			Create virtual keyboard by AddKeyRect() to a window and simulate pointer events from all pointers			
-@SYMTestExpectedResults The received events must match the simulated Key events
-*/
-void CTMultiPtrEventTest::VirtualKeyBoardForMultiplePointers()
-	{
-	TLogMessageText logText;
-	_LIT(KSet, "VirtualKeyboard SetOfEvents: %d of 8");
-	logText.AppendFormat(KSet, iEventSet);
-	LOG_MESSAGE(logText);
-
-	// Create virtual keyboard for 8 keys on parent window
-	// give a 5 pixel spacing at start/end and in between keys
-	const TInt noVirtualKeys = iMaxDevPointers;
-	const TInt keySpacing = 5;
-	const TInt keyWidth = ((iPhysicalScreenSize.iWidth/2) - ((noVirtualKeys+1)*keySpacing))/noVirtualKeys;
-	const TInt keyHeight = keyWidth/2; 
-	TInt startX = keySpacing;
-	const TInt baseChar ='A';
-	
-	if (!iEventSet)
-		{
-		SetAutoFlush();
-		for (TInt count=0; count < noVirtualKeys; count++)
-			{
-			iMultiPtrEventClient->ParentWin()->BaseWin()->AddKeyRect(TRect(startX, keySpacing, startX+keyWidth, keySpacing+keyHeight), baseChar+count,EFalse);
-			startX+=(keyWidth+keySpacing);
-			}
-		AddExpectedWsEvent(EEventFocusGained);
-		}
-	
-	iMultiPtrEventClient->EventBuffer()->SetEventCount(0);
-	TPoint ptrPos(keySpacing+(keyWidth/2), keySpacing+(keyHeight/2));
-
-	TInt count = 0;
-	if (iEventSet < iMaxDevPointers)
-		{
-		for (; ptrPos.iX < (iPhysicalScreenSize.iWidth/2)-5; ptrPos.iX += (keySpacing+keyWidth), count++)
-			{
-			SimulatePointerDownUp(ptrPos.iX, ptrPos.iY, 0, iEventSet);
-			AddExpectedKeyDownUp(baseChar+count);
-			}
-		}
-	else
-		{
-		ResetFlushStopAS();
-		}
-	iEventSet++;
-
-	LogEventsAdded();
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS-WSERV-ADVANCEDPOINTER-0021
-@SYMPREQ				PREQ1226
-@SYMREQ					REQ9677,REQ9683,
-@SYMTestPriority		High
-@SYMTestCaseDesc		Checks Wserv supports Grabbing in case of multi pointer events.
-@SYMTestStatus			Implemented
-
-@SYMTestActions			Simulate EButton1Down events on iParentWin. Simulate Drag and Button1Up events on iChildWin.
- 						SetPointerGrab is called on iParentWin for first test and disabled for the second. 
-@SYMTestExpectedResults The Drag and Button1Up events contain a handle to iParentWin when Grabbing active. 
-						The Drag and Button1Up events contain a handle to iChildWin when Grabbing disabled.
-*/
-void CTMultiPtrEventTest::GrabbingMultiPointerEvents()
-	{
-	// Test Grabbing of multi pointer events
-	// 1. Test Wserv supports Grabbing in case of multi-pointer events
-	// 2. Test pointer events are delivered correctly when Grabbing is disabled.
-	TLogMessageText logText;
-	_LIT(KSet, "GrabbingMultiPtrEvents SetOfEvents: %d of 2");
-	logText.AppendFormat(KSet, iEventSet);
-	LOG_MESSAGE(logText);
-	
-	if (!iEventSet)
-		{
-		SetAutoFlush();
-		}
-	
-	iMultiPtrEventClient->EventBuffer()->SetEventCount(0);
-
-	TPoint ptrPos;
-		
-	switch(iEventSet++)
-		{
-		case 0:
-			INFO_PRINTF1(_L("Check Wserv supports Grabbing in case of multi-pointer events"));
-			// Check pointer events are delivered to the window where the EButton1Down event occured, 
-			// even if subsequent events are simulated outside this window.
-			AddExpectedWsEvent(EEventFocusGained);
-			iMultiPtrEventClient->ParentWin()->BaseWin()->PointerFilter(EPointerFilterDrag, 0);
-			iMultiPtrEventClient->ParentWin()->BaseWin()->SetPointerGrab(ETrue);
-			TestGrabbingForMultiPointer(ETrue);
-			break;	
-		case 1:
-			INFO_PRINTF1(_L("Check pointer events are delivered correctly when Grabbing is disabled."));
-			// Check pointer events are delivered to the window on which they occured.					
-			iMultiPtrEventClient->ParentWin()->BaseWin()->SetPointerGrab(EFalse);
-			TestGrabbingForMultiPointer(EFalse);
-			break;	
-		default:
-			ResetFlushStopAS();
-			break;
-		}
-	LogEventsAdded();
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS-WSERV-ADVANCEDPOINTER-0025
-@SYMPREQ				PREQ1226
-@SYMREQ					REQ9677,REQ9683,
-@SYMTestPriority		High
-@SYMTestCaseDesc		Checks Wserv supports Filtering in case of multi pointer events.
-@SYMTestStatus			Implemented
-
-@SYMTestActions			Simulate Move and Drag events. Add only Button1Up and Button1Down to TWsEvent buffer.
-   						Disable Filtering and repeat test with the addition of Move and Drag events to TWsEvent buffer. 
-@SYMTestExpectedResults The received events must match the expected simulated raw events
-						The received events must match the simulated raw events
-*/
-void CTMultiPtrEventTest::FilteringMultiPointerEvents()
-	{
-	// Test Filtering of multi pointer events
-	// 1. Test pointer move and drag events are filtered correctly by Wserv
-	// 2. Test pointer events are delivered correctly when Filtered is disabled.
-	TLogMessageText logText;
-	_LIT(KSet, "FilteringMultiPtrEvents SetOfEvents: %d of 2");
-	logText.AppendFormat(KSet, iEventSet);
-	LOG_MESSAGE(logText);
-	
-	if (!iEventSet)
-		{
-		SetAutoFlush();
-		}
-	
-	iMultiPtrEventClient->EventBuffer()->SetEventCount(0);
-
-	TPoint ptrPos;
-		
-	switch(iEventSet++)
-		{
-		case 0:
-			INFO_PRINTF1(_L("Check pointer move and drag events are filtered with multi-pointer events"));
-			// Check pointer move and drag events are filtered by Wserv
-			AddExpectedWsEvent(EEventFocusGained);
-			
-			// Ensure default values are set i.e. Drag and Move events are filtered out and not delivered to the client.
-			iMultiPtrEventClient->ParentWin()->BaseWin()->PointerFilter(EPointerFilterDrag|EPointerFilterMove,
-																		EPointerFilterDrag|EPointerFilterMove);
-			TestFilteringForMultiPointer(ETrue);
-			break;	
-		case 1:
-			INFO_PRINTF1(_L("Check pointer move and drag events are not filtered, with multi-pointer events, when filtering is disabled"));
-			// Check move and drag events are not filtered by Wserv when filtering is disabled					
-
-			// Enable Drag and Move events
-			iMultiPtrEventClient->ParentWin()->BaseWin()->PointerFilter(EPointerFilterDrag|EPointerFilterMove, 0);
-			TestFilteringForMultiPointer(EFalse);
-			break;				
-		default:
-			ResetFlushStopAS();
-			break;
-		}
-	LogEventsAdded();
-	}
-
-void CTMultiPtrEventTest::SetDefaultScreenMode()
-	{
-	iMultiPtrEventClient->iScreen->SetAppScreenMode(0);
-	TheClient->iScreen->SetAppScreenMode(0);
-	iMultiPtrEventClient->iScreen->SetScreenMode(0);
-	iMultiPtrEventClient->iScreen->SetCurrentRotations(0, CFbsBitGc::EGraphicsOrientationNormal);
-	}
-
-TPoint PhysicalToLogical(TPoint aPhysicalPt, TPoint aOrigin, TSize aSize)
-	{
-	return PhysicalToLogical(aPhysicalPt-aOrigin, aSize);
-	}
-
-TPoint CTMultiPtrEventTest::GetPointerPostionOnRotatedMode(TPoint aPointerPos, CFbsBitGc::TGraphicsOrientation aRotation)
-	{
-	if (aRotation == CFbsBitGc::EGraphicsOrientationNormal)
-		{
-		return aPointerPos;
-		}
-	else if (aRotation == CFbsBitGc::EGraphicsOrientationRotated90)
-		{
-		// here width is actually height in rotated mode
-		return TPoint(iPhysicalScreenSize.iWidth - aPointerPos.iY - 1, aPointerPos.iX);
-		}
-	else if (aRotation == CFbsBitGc::EGraphicsOrientationRotated180)
-		{
-		return TPoint(iPhysicalScreenSize.iWidth - aPointerPos.iX - 1, iPhysicalScreenSize.iHeight - aPointerPos.iY - 1);
-		}
-	else if (aRotation == CFbsBitGc::EGraphicsOrientationRotated270)
-		{
-		// here width is actually height in rotated mode
-		return TPoint(aPointerPos.iY, iPhysicalScreenSize.iHeight - aPointerPos.iX -1);
-		}
-	return TPoint(0,0);
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS-WSERV-ADVANCEDPOINTER-0028
-@SYMPREQ				PREQ1226
-@SYMREQ					REQ9677, REQ9683
-@SYMTestPriority		High 
-@SYMTestCaseDesc		To check Wserv sends multi pointer events in Different screen modes
-@SYMTestStatus			Implemented
-
-@SYMTestActions			Simulate multi pointer events in Different screenmodes
-@SYMTestExpectedResults The received events must match the simulated raw events  
-*/
-void CTMultiPtrEventTest::MultiPointerEventsInDiffScreenModes()
-	{
-	// Logic inloved, For a particular screen mode check pointer down/up, moves and drags
-	// for different pointers and for different co-ordinates.
-	// For each screen mode check these events on diffferent rotation that screen mode supports
-	// During the last switch case increment the screenmode
-	TLogMessageText logText;
-	_LIT(KSet, "Multi pointer events in screenmode(%d): %d of 2");
-	logText.AppendFormat(KSet, iCurrentScreenMode+1, iEventSet);
-	LOG_MESSAGE(logText);
-	
-	TInt numScrMode = iMultiPtrEventClient->iScreen->NumScreenModes();
-	iMultiPtrEventClient->EventBuffer()->SetEventCount(0);
-	
-	if (!iEventSet && !iChangeScreenMode)
-		{
-		SetAutoFlush();
-		iChangeScreenMode = ETrue;
-		AddExpectedWsEvent(EEventFocusGained);
-		}
-	else
-		{
-		if (iChangeScreenMode)
-			{
-			if (iCurrentScreenMode >= numScrMode)
-				{
-EndFun:
-				SetDefaultScreenMode();
-				ResetFlushStopAS();
-				return;
-				}
-			}
-		}
-
-	if (iChangeScreenMode)
-		{
-		iMultiPtrEventClient->iScreen->SetAppScreenMode(iCurrentScreenMode);
-		TheClient->iScreen->SetAppScreenMode(iCurrentScreenMode);
-		iMultiPtrEventClient->iScreen->SetScreenMode(iCurrentScreenMode);
-		iChangeScreenMode = EFalse;
-		}
-	
-	CArrayFixFlat<TInt>* rotations = NULL;
-	TRAPD(err, 
-			rotations = new(ELeave) CArrayFixFlat<TInt>(1);
-			iMultiPtrEventClient->iScreen->GetRotationsList(iCurrentScreenMode, rotations));
-	if (err != KErrNone)
-		{
-		if (iEventSet)
-			{
-			goto EndFun;
-			}
-		else
-			{
-			return;
-			}
-		}
-
-#if !defined(__WINS__)	
-	TPoint ptrRotatedPos;
-	TPoint ptrNormalPos;
-#else
-	TPoint ptrPhyPos;
-#endif
-	TPoint ptrLogPos;	
-	
-	TInt ptrNum = 0;
-	TInt proxValue = 0;
-	// Since screenmode positioning and screenmode scaling is not supported in NGA wserv2
-	// but it is supported in Non NGA. But for NGA it will return (0,0) as origin and (1,1) as scale.
-	TPoint screenOrigin(iMultiPtrEventClient->iScreen->GetDefaultScreenModeOrigin());
-	TPoint scaledScreenOrigin(iMultiPtrEventClient->iScreen->GetCurrentScreenModeScaledOrigin());
-	TSize scale(iMultiPtrEventClient->iScreen->GetCurrentScreenModeScale());
-	
-	switch(iEventSet++)
-		{
-		case 0:
-			// Simulate Pointer down/up for different rotations of a screenmode
-			for (TInt rotCou = 0; rotCou < rotations->Count(); rotCou++)
-				{
-				CFbsBitGc::TGraphicsOrientation newOrientation = static_cast<CFbsBitGc::TGraphicsOrientation>(rotations[0][rotCou]);
-				iMultiPtrEventClient->iScreen->SetCurrentRotations(iCurrentScreenMode, newOrientation);
-				
-#if !defined(__WINS__)
-				ptrNormalPos = screenOrigin;
-				ptrRotatedPos = GetPointerPostionOnRotatedMode(ptrNormalPos, newOrientation);
-				SimulatePointerDownUp(ptrRotatedPos.iX, ptrRotatedPos.iY, 0, ptrNum);
-				ptrLogPos = PhysicalToLogical(ptrNormalPos, screenOrigin, scale);				
-				AddExpectedPointerDownUp(ptrLogPos, 0, ptrNum);
-				
-				ptrNormalPos.iX += 10;
-				ptrNormalPos.iY += 5;
-				ptrNum = iMaxDevPointers/2;
-				ptrRotatedPos = GetPointerPostionOnRotatedMode(ptrNormalPos, newOrientation);
-				SimulatePointerDownUp(ptrRotatedPos.iX, ptrRotatedPos.iY, 0, ptrNum);
-				ptrLogPos = PhysicalToLogical(ptrNormalPos, screenOrigin, scale);				
-				AddExpectedPointerDownUp(ptrLogPos, 0, ptrNum);
-				
-				ptrNormalPos.iX += 5;
-				ptrNormalPos.iY += 10;
-				ptrNum = iMaxDevPointers-1;
-				ptrRotatedPos = GetPointerPostionOnRotatedMode(ptrNormalPos, newOrientation);
-				SimulatePointerDownUp(ptrRotatedPos.iX, ptrRotatedPos.iY, 0, ptrNum);
-				ptrLogPos = PhysicalToLogical(ptrNormalPos, screenOrigin, scale);				
-				AddExpectedPointerDownUp(ptrLogPos, 0, ptrNum);
-				ptrNum = 0;
-#else
-				// This is not needed for NGA, becasue NGA wserv does not support positioning and scaling 
-				// but for early access we are deliverying for NonNGA so we need it. 
-				ptrPhyPos = screenOrigin;
-				ptrLogPos = PhysicalToLogical(ptrPhyPos, screenOrigin, scale);
-				SimulatePointerDownUp(ptrPhyPos.iX, ptrPhyPos.iY, 0, ptrNum);
-				AddExpectedPointerDownUp(ptrLogPos, 0, ptrNum);
-				ptrPhyPos.iX += 10;
-				ptrPhyPos.iY += 5;
-				ptrNum = iMaxDevPointers/2;
-				ptrLogPos = PhysicalToLogical(ptrPhyPos, screenOrigin, scale);
-				SimulatePointerDownUp(ptrPhyPos.iX, ptrPhyPos.iY, 0, ptrNum);
-				AddExpectedPointerDownUp(ptrLogPos, 0, ptrNum);
-				ptrPhyPos.iX += 5;
-				ptrPhyPos.iY += 10;
-				ptrNum = iMaxDevPointers-1;
-				ptrLogPos = PhysicalToLogical(ptrPhyPos, screenOrigin, scale);
-				SimulatePointerDownUp(ptrPhyPos.iX, ptrPhyPos.iY, 0, ptrNum);
-				AddExpectedPointerDownUp(ptrLogPos, 0, ptrNum);
-				ptrNum = 0;
-#endif
-				}
-			break;
-		case 1:
-			// Simulate moves for different rotations of a screenmode with different Proximity
-			iMultiPtrEventClient->ParentWin()->BaseWin()->PointerFilter(EPointerFilterMove,0);
-			for (TInt rotCou = 0; rotCou < rotations->Count(); rotCou++)
-				{
-				CFbsBitGc::TGraphicsOrientation newOrientation = static_cast<CFbsBitGc::TGraphicsOrientation>(rotations[0][rotCou]);
-				iMultiPtrEventClient->iScreen->SetCurrentRotations(iCurrentScreenMode, newOrientation);
-				
-#if !defined(__WINS__)				
-				ptrNormalPos = screenOrigin;
-				ptrRotatedPos = GetPointerPostionOnRotatedMode(ptrNormalPos, newOrientation);
-				proxValue = -iProximityStep;
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrRotatedPos.iX, ptrRotatedPos.iY, proxValue, ptrNum);
-				ptrLogPos = PhysicalToLogical(ptrNormalPos, screenOrigin, scale);			
-				AddExpectedPointerEvent(TPointerEvent::EMove, ptrLogPos, proxValue, 0, ptrNum);
-				SimulatePointerDownUp(ptrRotatedPos.iX, ptrRotatedPos.iY, 0, ptrNum);
-				AddExpectedPointerDownUp(ptrLogPos, 0, ptrNum);
-				
-				ptrNormalPos.iX += 10;
-				ptrNormalPos.iY += 5;
-				ptrNum = iMaxDevPointers/2;
-				if (proxValue-iProximityStep > iMaxProximity)
-					{
-					proxValue -= iProximityStep;
-					}
-				ptrRotatedPos = GetPointerPostionOnRotatedMode(ptrNormalPos, newOrientation);
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrRotatedPos.iX, ptrRotatedPos.iY, proxValue, ptrNum);
-				ptrLogPos = PhysicalToLogical(ptrNormalPos, screenOrigin, scale);								
-				AddExpectedPointerEvent(TPointerEvent::EMove, ptrLogPos, proxValue, 0, ptrNum);
-				SimulatePointerDownUp(ptrRotatedPos.iX, ptrRotatedPos.iY, 0, ptrNum);
-				AddExpectedPointerDownUp(ptrLogPos, 0, ptrNum);
-				ptrNum = 0;
-#else
-				ptrPhyPos = screenOrigin;
-				proxValue = -iProximityStep;
-				ptrLogPos = PhysicalToLogical(ptrPhyPos, screenOrigin, scale);
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPhyPos.iX, ptrPhyPos.iY, proxValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EMove, ptrLogPos, proxValue, 0, ptrNum);
-				SimulatePointerDownUp(ptrPhyPos.iX, ptrPhyPos.iY, 0, ptrNum);
-				AddExpectedPointerDownUp(ptrLogPos, 0, ptrNum);
-				
-				ptrPhyPos.iX += 10;
-				ptrPhyPos.iY += 5;
-				ptrNum = iMaxDevPointers/2;
-				if (proxValue-iProximityStep > iMaxProximity)
-					{
-					proxValue -= iProximityStep;
-					}
-				ptrLogPos = PhysicalToLogical(ptrPhyPos, screenOrigin, scale);
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPhyPos.iX, ptrPhyPos.iY, proxValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EMove, ptrLogPos, proxValue, 0, ptrNum);
-				SimulatePointerDownUp(ptrPhyPos.iX, ptrPhyPos.iY, 0, ptrNum);
-				AddExpectedPointerDownUp(ptrLogPos, 0, ptrNum);
-				ptrNum = 0;
-#endif
-				}
-			break;
-		case 2:
-			{
-			// Simulate drags for different rotations of a screenmode
-#if !defined(__WINS__)
-			TPoint intNormalPt;
-			TPoint intRotatedPt;
-#else
-			TPoint interPhyPt;
-			TPoint interLogPt;
-#endif			
-			iMultiPtrEventClient->ParentWin()->BaseWin()->PointerFilter(EPointerFilterDrag,0);
-			for (TInt rotCou = 0; rotCou < rotations->Count(); rotCou++)
-				{
-				CFbsBitGc::TGraphicsOrientation newOrientation = static_cast<CFbsBitGc::TGraphicsOrientation>(rotations[0][rotCou]);
-				iMultiPtrEventClient->iScreen->SetCurrentRotations(iCurrentScreenMode, newOrientation);
-#if !defined(__WINS__)				
-				ptrNormalPos = screenOrigin;
-				intNormalPt.iX = ptrNormalPos.iX+4;
-				intNormalPt.iY = ptrNormalPos.iY+5;
-				ptrRotatedPos = GetPointerPostionOnRotatedMode(ptrNormalPos, newOrientation);
-				intRotatedPt = GetPointerPostionOnRotatedMode(intNormalPt, newOrientation);				
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrRotatedPos.iX, ptrRotatedPos.iY, 0, ptrNum);
-				SimulatePointerEvent(TRawEvent::EPointerMove, intRotatedPt.iX, intRotatedPt.iY, 0, ptrNum);
-				SimulatePointerEvent(TRawEvent::EButton1Up, intRotatedPt.iX, intRotatedPt.iY, 0, ptrNum);
-				ptrLogPos = PhysicalToLogical(ptrNormalPos, screenOrigin, scale);				
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrLogPos, 0, 0, ptrNum);
-				TPoint intLogPt = PhysicalToLogical(intNormalPt, screenOrigin, scale);				
-				AddExpectedPointerEvent(TPointerEvent::EDrag, intLogPt, 0, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, intLogPt, 0, 0, ptrNum);
-				
-				ptrNormalPos.iX += 10;
-				ptrNormalPos.iY += 5;
-				ptrNum = iMaxDevPointers-1;
-				intNormalPt.iX = ptrNormalPos.iX+5;
-				intNormalPt.iY = ptrNormalPos.iY+4;
-				ptrRotatedPos = GetPointerPostionOnRotatedMode(ptrNormalPos, newOrientation);
-				intRotatedPt = GetPointerPostionOnRotatedMode(intNormalPt, newOrientation);
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrRotatedPos.iX, ptrRotatedPos.iY, 0, ptrNum);
-				SimulatePointerEvent(TRawEvent::EPointerMove, intRotatedPt.iX, intRotatedPt.iY, 0, ptrNum);
-				SimulatePointerEvent(TRawEvent::EButton1Up, intRotatedPt.iX, intRotatedPt.iY, 0, ptrNum);
-				ptrLogPos = PhysicalToLogical(ptrNormalPos, screenOrigin, scale);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrLogPos, 0, 0, ptrNum);
-				intLogPt = PhysicalToLogical(intNormalPt, screenOrigin, scale);
-				AddExpectedPointerEvent(TPointerEvent::EDrag, intLogPt, 0, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, intLogPt, 0, 0, ptrNum);
-
-				ptrNum = 0;
-#else
-				ptrPhyPos = screenOrigin;
-				interPhyPt.iX = ptrPhyPos.iX+4;
-				interPhyPt.iY = ptrPhyPos.iY+5;
-				ptrLogPos = PhysicalToLogical(ptrPhyPos, screenOrigin, scale);
-				interLogPt = PhysicalToLogical(interPhyPt, screenOrigin, scale);
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPhyPos.iX, ptrPhyPos.iY, 0, ptrNum);
-				SimulatePointerEvent(TRawEvent::EPointerMove, interPhyPt.iX, interPhyPt.iY, 0, ptrNum);
-				SimulatePointerEvent(TRawEvent::EButton1Up, interPhyPt.iX, interPhyPt.iY, 0, ptrNum);
-				interLogPt = PhysicalToLogical(interPhyPt, screenOrigin, scale);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrLogPos, 0, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EDrag, interLogPt, 0, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, interLogPt, 0, 0, ptrNum);
-				
-				ptrPhyPos.iX += 10;
-				ptrPhyPos.iY += 5;
-				ptrNum = iMaxDevPointers-1;
-				interPhyPt.iX = ptrPhyPos.iX+5;
-				interPhyPt.iY = ptrPhyPos.iY+4;
-				
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPhyPos.iX, ptrPhyPos.iY, 0, ptrNum);
-				SimulatePointerEvent(TRawEvent::EPointerMove, interPhyPt.iX, interPhyPt.iY, 0, ptrNum);
-				SimulatePointerEvent(TRawEvent::EButton1Up, interPhyPt.iX, interPhyPt.iY, 0, ptrNum);
-				
-				ptrLogPos = PhysicalToLogical(ptrPhyPos, screenOrigin, scale);
-				interLogPt = PhysicalToLogical(interPhyPt, screenOrigin, scale);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrLogPos, 0, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EDrag, interLogPt, 0, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, interLogPt, 0, 0, ptrNum);
-				ptrNum = 0;
-#endif
-				}
-			}
-			iChangeScreenMode = ETrue;
-			iEventSet = 0;
-			iCurrentScreenMode++;
-			break;
-		default:
-			break;
-		}
-	
-	delete rotations;
-	
-	LogEventsAdded();
-	}
-
-/* 
- Checks if pointer click plugin has an error when testing its events
- If so then it gets the error deescription and displays the same
- */
-void CTMultiPtrEventTest::TestAndDisplayPtrClickError()
-	{
-	TPckgBuf<TInt> intPkg;
-	TInt retErr = iClick.CommandReply(EMultiPtrClickEventError, intPkg);
-	if (retErr != KErrNone)
-		{
-		_LIT(KError, "Failed in Pointer click plugin");
-		LOG_MESSAGE(KError);
-		// Error is ignored here, becasue this function should not leave
-		TRAPD(errMem, iErrDesc = iHeap->AllocL(KErrDescSize));
-		if (errMem == KErrNone)
-			{
-			intPkg() = reinterpret_cast<TUint8*>(iErrDesc) - iChunk.Base() ;
-			
-			// get the error desccription, print it out and stop the tests
-			TInt retVal = iClick.CommandReply(EADllMultiPtrEventErrorDesc, intPkg);
-			if (retVal > KErrNone)
-				{
-				TPtr8 memPtr2(reinterpret_cast<TUint8*>(iErrDesc), retVal, retVal);
-				HBufC16* buf16 = NULL;
-				TRAPD(err, buf16 = HBufC16::NewL(retVal));		// Error is ignored here
-				if (err == KErrNone)
-					{
-					buf16->Des().Copy(memPtr2);
-					LOG_MESSAGE(buf16->Des());
-					delete buf16;
-					}
-				}
-			iHeap->Free(iErrDesc);
-			}
-		Failed();
-		}
-	iClick.CommandReply(EMultiPtrClickEventReset, intPkg);
-	}
-
-void CTMultiPtrEventTest::AddExpectedMultiPtrClickEvent(TPointerEvent::TType aType, TPoint aPos, TInt aZ, TUint aModifier, TUint8 aPointerNumber, TUint aHandle)
-	{
-	TPckgBuf<TWsEvent> evtPkg;
-	TWsEvent& event=evtPkg();
-	event.SetType(EEventPointer);
-	iMultiPtrEventClient->CalculatePtrPosAndSet3Ddata(event, aType, aPos, aModifier, aZ, aPointerNumber, aHandle);
-	
-	// change the parent position here as they r with respect to screen corodinates.
-	event.Pointer()->iParentPosition = aPos;
-	
-	iClick.CommandReply(EMultiPtrClickEventAdd, evtPkg);
-	AddExpectedMultiPtrClickOtherEvent(aType, aPos, aZ, aModifier, aPointerNumber, aHandle);
-	}
-
-void CTMultiPtrEventTest::AddExpectedMultiPtrClickOtherEvent(TPointerEvent::TType aType, TPoint aPos, TInt aZ, TUint aModifier, TUint8 aPointerNumber, TUint aHandle)
-	{
-	TWsEvent event;
-	event.SetType(EEventPointer);
-	iMultiPtrEventClient->CalculatePtrPosAndSet3Ddata(event, aType, aPos, aModifier, aZ, aPointerNumber, aHandle);
-
-	TPointerEventData otherEvent;
-	otherEvent.iClientHandle = event.Handle();
-	otherEvent.iCurrentPos = aPos;
-	otherEvent.iPointerEvent = *event.Pointer();
-	
-	TPckgBuf<TPointerEventData> evtPkg(otherEvent);
-	iClick.CommandReply(EMultiPtrOtherEventAdd, evtPkg);
-	}
-
-/* 
- Function of creating 
- 1. Pointer click plugin
- 2. RChunk for transfering error description from pointer click plugin to current test
- 3. RHeap for allocating memory in RChunk
-*/
-void CTMultiPtrEventTest::CreatePointerClickPluginL()
-	{
-	// tranfer this to another function
-	iClick=RSoundPlugIn(TheClient->iWs);
-	User::LeaveIfError(iClick.Construct(TUid::Uid(MULTIPTR_CLICK_THIRD_UID)));
-	TBool ptrPluginLoadable = EFalse;
-	iClick.IsLoaded(ptrPluginLoadable);
-	if (ptrPluginLoadable)
-		{
-		User::LeaveIfError(iClick.Load(KMultiPtrPluginDll));
-		iPtrPluginLoaded = ETrue;
-		}
-	iClick.SetPenClick(ETrue);
-	iHeap = UserHeap::ChunkHeap(&KMultiPtrClickChunk, 128, 256, 10);
-	if (iHeap == NULL)
-		{
-		User::LeaveNoMemory();
-		}
-	User::LeaveIfError(iChunk.OpenGlobal(KMultiPtrClickChunk, ETrue));
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS-WSERV-ADVANCEDPOINTER-0027
-@SYMPREQ				PREQ1226
-@SYMREQ					REQ9677, REQ9683
-@SYMTestPriority		High 
-@SYMTestCaseDesc		To check Wserv sends multi pointer events to PointerClickPlugin
-@SYMTestStatus			Implemented
-
-@SYMTestActions			Simulate multi pointer events for PointerClickPlugin
-@SYMTestExpectedResults The received events must match the simulated raw events  
-*/
-void CTMultiPtrEventTest::MultiPointerEventsForPointerClickL()
-	{
-	TLogMessageText logText;
-	_LIT(KSet, "Multi pointer events for PointerClickPlugin: %d of 4");
-	logText.AppendFormat(KSet, iEventSet);
-	LOG_MESSAGE(logText);
-	
-	iMultiPtrEventClient->EventBuffer()->SetEventCount(0);
-	if (!iEventSet)
-		{
-		SetAutoFlush();
-		}
-	
-	TPoint ptrPos;
-	TInt ptrNum = 0;
-	TInt prValue = 0;
-	TInt proxValue = 0;
-	TInt xInc = iPhysicalScreenSize.iWidth/iMaxDevPointers;
-	TInt yInc = iPhysicalScreenSize.iHeight/iMaxDevPointers;
- 	
-	switch(iEventSet++)
-		{
-		case 0:
-			// Creates RSoundPlugin, loads the plugin DLL, create RChunk and RHeap
-			CreatePointerClickPluginL();
-			AddExpectedWsEvent(EEventFocusGained);
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				AddExpectedMultiPtrClickEvent(TPointerEvent::EButton1Down, ptrPos, 0, 0, ptrNum);
-				AddExpectedMultiPtrClickEvent(TPointerEvent::EButton1Up, ptrPos, 0, 0, ptrNum);
-				AddExpectedPointerDownUp(ptrPos, 0, ptrNum);
-				SimulatePointerDownUp(ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				ptrPos.iX += xInc;
-				ptrPos.iY += yInc;
-				}
-			TestAndDisplayPtrClickError();
-			break;
-		case 1:
-			// Simulate moves from different pointer with different pressure
-			iMultiPtrEventClient->ParentWin()->BaseWin()->PointerFilter(EPointerFilterMove,0);
-			iMultiPtrEventClient->ChildWin()->BaseWin()->PointerFilter(EPointerFilterMove,0);
-			ptrPos.SetXY(0,0);
-			prValue = iPressureStep;
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				AddExpectedMultiPtrClickEvent(TPointerEvent::EMove, ptrPos, prValue, 0, ptrNum);
-				AddExpectedMultiPtrClickEvent(TPointerEvent::EButton1Down,ptrPos,0,0,ptrNum);
-				AddExpectedMultiPtrClickEvent(TPointerEvent::EButton1Up,ptrPos,0,0,ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EMove, ptrPos, prValue, 0, ptrNum);
-				AddExpectedPointerDownUp(ptrPos, 0, ptrNum);
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, prValue, ptrNum);
-				SimulatePointerDownUp(ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				ptrPos.iX += xInc;
-				ptrPos.iY += yInc;
-				}
-			TestAndDisplayPtrClickError();
-			break;
-		case 2:
-			// Simulate moves from different pointer with different proximity
-			ptrPos.SetXY(0,0);
-			proxValue = -iProximityStep;
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				AddExpectedMultiPtrClickEvent(TPointerEvent::EMove, ptrPos, proxValue, 0, ptrNum);
-				AddExpectedMultiPtrClickEvent(TPointerEvent::EButton1Down,ptrPos,0,0,ptrNum);
-				AddExpectedMultiPtrClickEvent(TPointerEvent::EButton1Up,ptrPos,0,0,ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EMove, ptrPos, proxValue, 0, ptrNum);
-				AddExpectedPointerDownUp(ptrPos, 0, ptrNum);
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				SimulatePointerDownUp(ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				ptrPos.iX += xInc;
-				ptrPos.iY += yInc;
-				}
-			TestAndDisplayPtrClickError();
-			break;
-		case 3:
-			{
-			// Simulate drags from all pointers
-			iMultiPtrEventClient->ParentWin()->BaseWin()->PointerFilter(EPointerFilterDrag,0);
-			iMultiPtrEventClient->ChildWin()->BaseWin()->PointerFilter(EPointerFilterDrag,0);
-			ptrPos.SetXY(0,0);
-			TPoint interPt;
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				AddExpectedMultiPtrClickEvent(TPointerEvent::EButton1Down, ptrPos, 0, 0, ptrNum);
-				interPt.iX = ptrPos.iX+1;
-				interPt.iY = ptrPos.iY+2;
-				AddExpectedMultiPtrClickEvent(TPointerEvent::EDrag, interPt, 0, 0, ptrNum);
-				AddExpectedMultiPtrClickEvent(TPointerEvent::EButton1Up, interPt, 0, 0, ptrNum);
-				
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, 0, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EDrag, interPt, 0, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, interPt, 0, 0, ptrNum);
-				
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				SimulatePointerEvent(TRawEvent::EPointerMove, interPt.iX, interPt.iY, 0, ptrNum);
-				SimulatePointerEvent(TRawEvent::EButton1Up, interPt.iX, interPt.iY, 0, ptrNum);
-				
-				ptrPos.iX += xInc;
-				ptrPos.iY += yInc;
-				}
-			TestAndDisplayPtrClickError();
-			}
-			break;
-		default:
-			iClick.Unload();
-			iClick.Close();
-			iPtrPluginLoaded = EFalse;
-			iHeap->Close();
-			iHeap = NULL;
-			iChunk.Close();
-			ResetFlushStopAS();
-			break;
-		}
-
-	LogEventsAdded();
-	}
-
-void CTMultiPtrEventTest::GetRemainingEventsFromSecondaryClient()
-	{
-	if (iSecMultiPtrEventClient->EventBuffer()->EventsRemaining() != 0)
-		{
-		iSecMultiPtrEventClient->EventBuffer()->SetNestedLoopState(ETrue);
-		CActiveScheduler::Start();
-		}	
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS-WSERV-ADVANCEDPOINTER-0011
-@SYMPREQ				PREQ1226
-@SYMREQ					REQ9677,REQ9674,
-@SYMTestPriority		High 
-@SYMTestCaseDesc		To check Wserv sends Multi Pointer events to correct clients
-@SYMTestStatus			Implemented
-
-@SYMTestActions			Simulate multi pointer events on windows from different client.
-@SYMTestExpectedResults The received events must match the simulated raw events 
-*/
-void CTMultiPtrEventTest::MultiClientMultiPointerEvents()
-	{
-	// Logic for this test code
-	// Create a secondary client when running this test
-	// Simulate events for both main client and secondary simulataneously
-	// Get events from DoRunL() of event buffer class
-	// Before running next set of events, get all the events from secondary client
-	// If test fails on any client make sure both active scheduler are stopped
-	TLogMessageText logText;
-	_LIT(KSet, "Multi pointer events for Multi client: %d of 5");
-	logText.AppendFormat(KSet, iEventSet);
-	LOG_MESSAGE(logText);
-	
-	iMultiPtrEventClient->EventBuffer()->SetEventCount(0);
-	iSecMultiPtrEventClient->EventBuffer()->SetEventCount(0);
-	if (!iEventSet)
-		{
-		SetAutoFlush();
-		iSecClientFlush = iSecMultiPtrEventClient->iWs.SetAutoFlush(ETrue);
-		}
-	
-	TPoint ptrPos;
-	TInt ptrNum = 0;
-	TInt prValue = 0;
-	TInt proxValue = 0;
-	TInt xInc = (iPhysicalScreenSize.iWidth/2)/iMaxDevPointers;
-	TInt yInc = iPhysicalScreenSize.iHeight/iMaxDevPointers;
-	TPoint secPt(iPhysicalScreenSize.iWidth/2,0);
-	TInt ptrSecNum = iMaxDevPointers-1;
- 	
-	switch(iEventSet++)
-		{
-		case 0:
-			ptrPos.SetXY(0,0);
-			
-			// These events are generated when primary client is created and its group 
-			// window constructed and then when button down for primary client is called
-			AddExpectedWsEvent(EEventFocusGained);
-			AddExpectedWsEvent(EEventFocusLost);
-			AddExpectedWsEvent(EEventFocusGained);
-			
-			// Simulate pointer down/up events for primary client from 0,1,3... pointers and 6,5,4... pointers for secondary client
-			for (ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, 0, 0, ptrNum);
-							
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, 0, 0, ptrNum);
-				
-				ptrPos.iX += xInc;
-				ptrPos.iY += yInc;
-				}
-			
-			ptrPos.iX = iPhysicalScreenSize.iWidth/2;
-			ptrPos.iY = 0;
-			
-			// These events are generated when secondary cleint is created and then when
-			// button down for primary client is called, then when SetOrdinalPosition is 
-			// called on secondary cleint's group window
-			AddExpectedWsEvent(EEventFocusGained, ETrue);
-			AddExpectedWsEvent(EEventFocusLost, ETrue);
-			iSecMultiPtrEventClient->iGroup->GroupWin()->SetOrdinalPosition(0, 1);
-			AddExpectedWsEvent(EEventFocusGained, ETrue);
-
-			AddExpectedWsEvent(EEventFocusLost);
-			
-			for (ptrNum = iMaxDevPointers/2; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, 0, 0, ptrNum, (TUint)iSecMultiPtrEventClient->ParentWin(), ETrue);
-							
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, 0, 0, ptrNum, (TUint)iSecMultiPtrEventClient->ParentWin(), ETrue);
-				
-				ptrPos.iX += xInc;
-				ptrPos.iY += yInc;
-				}
-			break;
-		case 1:
-			// Simulate move events from primary and secondary client simultaneously with pressure
-			iMultiPtrEventClient->ParentWin()->BaseWin()->PointerFilter(EPointerFilterMove, 0);
-			iSecMultiPtrEventClient->ParentWin()->BaseWin()->PointerFilter(EPointerFilterMove, 0);
-			
-			ptrPos.SetXY(0,0);
-			prValue = iPressureStep;
-				
-			for (ptrNum = 0; (ptrNum < iMaxDevPointers/2 && ptrSecNum >= iMaxDevPointers/2); ptrNum++, ptrSecNum--)
-				{
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, prValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EMove, ptrPos, prValue, 0, ptrNum);
-				ptrPos.iX += xInc;
-				ptrPos.iY += yInc;
-				
-				SimulatePointerEvent(TRawEvent::EPointerMove, secPt.iX, secPt.iY, prValue, ptrSecNum);
-				AddExpectedPointerEvent(TPointerEvent::EMove, secPt, prValue, 0, ptrSecNum, (TUint)iSecMultiPtrEventClient->ParentWin(), ETrue);
-				secPt.iX += xInc;
-				secPt.iY += yInc;
-				}
-			break;
-		case 2:
-			// Simulate move events from primary and secondary client simultaneously with proximity
-			ptrPos.SetXY(0,0);
-			proxValue = -iProximityStep;
-			
-			for (ptrNum = 0; (ptrNum < iMaxDevPointers/2 && ptrSecNum >= iMaxDevPointers/2); ptrNum++, ptrSecNum--)
-				{
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EMove, ptrPos, proxValue, 0, ptrNum);
-				ptrPos.iX += xInc;
-				ptrPos.iY += yInc;
-				
-				SimulatePointerEvent(TRawEvent::EPointerMove, secPt.iX, secPt.iY, proxValue, ptrSecNum);
-				AddExpectedPointerEvent(TPointerEvent::EMove, secPt, proxValue, 0, ptrSecNum, (TUint)iSecMultiPtrEventClient->ParentWin(), ETrue);
-				secPt.iX += xInc;
-				secPt.iY += yInc;
-				}
-			break;
-		case 3:
-			{
-			// Simulate drag events on different clients window one after the other 
-			iMultiPtrEventClient->ParentWin()->BaseWin()->PointerFilter(EPointerFilterDrag, 0);
-			iSecMultiPtrEventClient->ParentWin()->BaseWin()->PointerFilter(EPointerFilterDrag, 0);
-			
-			ptrPos.SetXY(0,0);
-			secPt.iX = iPhysicalScreenSize.iWidth/2;
-			secPt.iY = 0; 
-			ptrSecNum = iMaxDevPointers-1;
-			TPoint interPt;
-			for (ptrNum = 0; (ptrNum < iMaxDevPointers/2 && ptrSecNum >= iMaxDevPointers/2); ptrNum++, ptrSecNum--)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, 0, 0, ptrNum);
-				interPt.iX = ptrPos.iX+2;
-				interPt.iY = ptrPos.iY+1;
-				SimulatePointerEvent(TRawEvent::EPointerMove, interPt.iX, interPt.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EDrag, interPt, 0, 0, ptrNum);
-				SimulatePointerEvent(TRawEvent::EButton1Up, interPt.iX, interPt.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, interPt, 0, 0, ptrNum);
-				ptrPos.iX += xInc;
-				ptrPos.iY += yInc;
-				
-				SimulatePointerEvent(TRawEvent::EButton1Down, secPt.iX, secPt.iY, 0, ptrSecNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, secPt, 0, 0, ptrSecNum, (TUint)iSecMultiPtrEventClient->ParentWin(), ETrue);
-				interPt.iX = secPt.iX+2;
-				interPt.iY = secPt.iY+1;
-				SimulatePointerEvent(TRawEvent::EPointerMove, interPt.iX, interPt.iY, 0, ptrSecNum);
-				AddExpectedPointerEvent(TPointerEvent::EDrag, interPt, 0, 0, ptrSecNum, (TUint)iSecMultiPtrEventClient->ParentWin(), ETrue);
-				SimulatePointerEvent(TRawEvent::EButton1Up, interPt.iX, interPt.iY, 0, ptrSecNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, interPt, 0, 0, ptrSecNum, (TUint)iSecMultiPtrEventClient->ParentWin(), ETrue);
-				secPt.iX += xInc;
-				secPt.iY += yInc;
-				}
-			}
-			break;
-		case 4:
-			{
-			// Simulate drag events on different clients, but interleaved each other 
-			ptrPos.SetXY(0,0);
-			secPt.iX = iPhysicalScreenSize.iWidth/2;
-			secPt.iY = 0; 
-			ptrSecNum = iMaxDevPointers-1;
-			TPoint interPt;
-			
-			for (ptrNum = 0; (ptrNum < iMaxDevPointers/2 && ptrSecNum >= iMaxDevPointers/2); ptrNum++, ptrSecNum--)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, 0, 0, ptrNum);
-				ptrPos.iX += xInc;
-				ptrPos.iY += yInc;
-				
-				SimulatePointerEvent(TRawEvent::EButton1Down, secPt.iX, secPt.iY, 0, ptrSecNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, secPt, 0, 0, ptrSecNum, (TUint)iSecMultiPtrEventClient->ParentWin(), ETrue);
-				secPt.iX += xInc;
-				secPt.iY += yInc;
-				}
-			
-			ptrPos.SetXY(0,0);
-			secPt.iX = iPhysicalScreenSize.iWidth/2;
-			secPt.iY = 0;
-			ptrSecNum = iMaxDevPointers-1;
-			for (ptrNum = 0; (ptrNum < iMaxDevPointers/2 && ptrSecNum >= iMaxDevPointers/2); ptrNum++, ptrSecNum--)
-				{
-				interPt.iX = ptrPos.iX+2;
-				interPt.iY = ptrPos.iY+1;
-				SimulatePointerEvent(TRawEvent::EPointerMove, interPt.iX, interPt.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EDrag, interPt, 0, 0, ptrNum);
-				ptrPos.iX += xInc;
-				ptrPos.iY += yInc;
-				
-
-				interPt.iX = secPt.iX+2;
-				interPt.iY = secPt.iY+1;
-				SimulatePointerEvent(TRawEvent::EPointerMove, interPt.iX, interPt.iY, 0, ptrSecNum);
-				AddExpectedPointerEvent(TPointerEvent::EDrag, interPt, 0, 0, ptrSecNum, (TUint)iSecMultiPtrEventClient->ParentWin(), ETrue);
-				secPt.iX += xInc;
-				secPt.iY += yInc;
-				}
-
-			ptrPos.SetXY(0,0);
-			secPt.iX = iPhysicalScreenSize.iWidth/2;
-			secPt.iY = 0;
-			ptrSecNum = iMaxDevPointers-1;
-			for (ptrNum = 0; (ptrNum < iMaxDevPointers/2 && ptrSecNum >= iMaxDevPointers/2); ptrNum++, ptrSecNum--)
-				{
-				interPt.iX = ptrPos.iX+2;
-				interPt.iY = ptrPos.iY+1;
-				SimulatePointerEvent(TRawEvent::EButton1Up, interPt.iX, interPt.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, interPt, 0, 0, ptrNum);
-				ptrPos.iX += xInc;
-				ptrPos.iY += yInc;
-				
-				interPt.iX = secPt.iX+2;
-				interPt.iY = secPt.iY+1;
-				SimulatePointerEvent(TRawEvent::EButton1Up, interPt.iX, interPt.iY, 0, ptrSecNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, interPt, 0, 0, ptrSecNum, (TUint)iSecMultiPtrEventClient->ParentWin(), ETrue);
-				secPt.iX += xInc;
-				secPt.iY += yInc;
-				}
-			}
-			break;
-		default:
-			ResetFlushStopAS();
-			iSecMultiPtrEventClient->iWs.SetAutoFlush(iSecClientFlush);
-			break;
-		}
-	
-	_LIT(KEventsAdded, "Events added to Primary client's buffer = %d");
-	logText.Format(KEventsAdded, iMultiPtrEventClient->EventBuffer()->EventsRemaining());
-	LOG_MESSAGE(logText);
-	_LIT(KEventsAdded1, "Events added to Secondary client's buffer = %d");
-	logText.Format(KEventsAdded1, iSecMultiPtrEventClient->EventBuffer()->EventsRemaining());
-	LOG_MESSAGE(logText);
-	}
-
-
-// RMultiPointerAnim
-RMultiPointerAnim* RMultiPointerAnim::NewL(RWindowBase* aWin, RAnimDll* aDll)
-	{
-	RMultiPointerAnim* self=new(ELeave) RMultiPointerAnim(aDll);
-	CleanupStack::PushL(TCleanupItem(DestroyAnim,self));
-	User::LeaveIfError(self->Construct(*aWin, EAnimTypeMultiPointer, TPtrC8()));
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-TInt RMultiPointerAnim::AddExpectedAnimPointerEvent(TRawEvent::TType aType, TPoint aPos, TInt aZ, TUint /*aModifier*/, TUint8 aPointerNumber, TBool aEat /*= ETrue*/)
-	{
-	TRawEvent rawEvent;
-	rawEvent.Set(aType, aPos.iX, aPos.iY, aZ, aPointerNumber);
-	TAnimRawEvent animEvent;
-	animEvent.iRawEvent = rawEvent;
-	animEvent.iEat = aEat;
-	TPckgBuf<TAnimRawEvent> param;
-	param()=animEvent;
-	return CommandReply(EADllAddExpectedMultiPtrEvent, param);
-	}
-
-void CTMultiPtrEventTest::TestAndDisplayAnimError()
-	{
-	TInt err = iAnim->CommandReply(EADllMultiPtrEventError);
-	if (err != KErrNone)
-		{
-		_LIT(KError, "Failed in Anim dll");
-		LOG_MESSAGE(KError);
-		TBuf<255> errDesc;
-		errDesc.SetMax();
-		TIpcArgs ipcArgs;
-		ipcArgs.Set(KIpcSlot,&errDesc);
-		// get the error desccription, print it out and stop the tests
-		TInt retVal = iAnim->CommandReply(EADllMultiPtrEventErrorDesc, KNullDesC8, ipcArgs);
-		if (retVal == KErrNone)
-			{
-			LOG_MESSAGE(errDesc);
-			}
-		Failed();
-		}
-	iAnim->CommandReply(EADllMultiPtrEventReset);
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS-WSERV-ADVANCEDPOINTER-0013
-@SYMPREQ				PREQ1226
-@SYMREQ					REQ9677,REQ9683,
-@SYMTestPriority		High 
-@SYMTestCaseDesc		To check Wserv sends Multi Pointer events to Anims
-@SYMTestStatus			Implemented
-
-@SYMTestActions			Simulate multi pointer events for anims
-@SYMTestExpectedResults The received events must match the simulated raw events 
-*/
-void CTMultiPtrEventTest::MultiPointerEventsForAnimsL()
-	{
-	// The logic behind these tests is
-	// Create an anim, which creates animation at server side(which swicthes raw event handling on)
-	// Add the required events to the animtaion at server side buffer
-	// Simulate those events and check simulated events are same as required at server side
-	// If any test fail, error description is got from server and displayed in the log file
-	TLogMessageText logText;
-	_LIT(KSet, "Multi pointer events for Anims: %d of 3");
-	logText.AppendFormat(KSet, iEventSet);
-	LOG_MESSAGE(logText);
-	_LIT(KEventsChecked, "Events checked at server side = %d");
-	
-	iMultiPtrEventClient->EventBuffer()->SetEventCount(0);
-	if (!iEventSet)
-		{
-		SetAutoFlush();
-		iAnimDll = new(ELeave) RAnimDll(iMultiPtrEventClient->iWs);
-		User::LeaveIfError(iAnimDll->Load(KAnimDLLName));
-		}
-	
-	TPoint ptrPos;
-	TInt ptrNum = 0;
-	TInt prValue = 0;
-	TInt proxValue = 0;
-	TInt xInc = iPhysicalScreenSize.iWidth/iMaxDevPointers;
-	TInt yInc = iPhysicalScreenSize.iHeight/iMaxDevPointers;
- 	
-	switch(iEventSet++)
-		{
-		case 0:
-			// Simulate downup events for all pointers
-			iAnim = RMultiPointerAnim::NewL(iMultiPtrEventClient->ParentWin()->BaseWin(), iAnimDll);
-			AddExpectedWsEvent(EEventFocusGained);
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				iAnim->AddExpectedAnimPointerEvent(TRawEvent::EButton1Down,ptrPos,0,0,ptrNum);
-				iAnim->AddExpectedAnimPointerEvent(TRawEvent::EButton1Up,ptrPos,0,0,ptrNum);
-				SimulatePointerDownUp(ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				ptrPos.iX += xInc;
-				ptrPos.iY += yInc;
-				}
-			TestAndDisplayAnimError();
-			logText.Format(KEventsChecked, iMaxDevPointers*2);
-			LOG_MESSAGE(logText);
-			break;
-		case 1:
-			// Simulate moves from different pointer with different pressure
-			// Here there is no need for events to be exaclty on the anim window. 
-			// becasue when the animtaions ask for events it will be delivered all the events
-			// irrespective of where they occured.
-			ptrPos.SetXY(0,0);
-			prValue = iPressureStep;
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				iAnim->AddExpectedAnimPointerEvent(TRawEvent::EPointerMove, ptrPos, prValue, 0, ptrNum);
-				iAnim->AddExpectedAnimPointerEvent(TRawEvent::EButton1Down,ptrPos,0,0,ptrNum);
-				iAnim->AddExpectedAnimPointerEvent(TRawEvent::EButton1Up,ptrPos,0,0,ptrNum);
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, prValue, ptrNum);
-				SimulatePointerDownUp(ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				ptrPos.iX += xInc;
-				ptrPos.iY += yInc;
-				}
-			TestAndDisplayAnimError();
-			
-			// This is for just to add run the next test
-			SimulatePointerEvent(TRawEvent::EPointerSwitchOn, 0, 0, 0, 0);
-			
-			logText.Format(KEventsChecked, iMaxDevPointers*3);
-			LOG_MESSAGE(logText);
-			break;
-		case 2:
-			// Simulate moves from different pointer with different proximity
-			ptrPos.SetXY(0,0);
-			proxValue = -iProximityStep;
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				iAnim->AddExpectedAnimPointerEvent(TRawEvent::EPointerMove, ptrPos, proxValue, 0, ptrNum);
-				iAnim->AddExpectedAnimPointerEvent(TRawEvent::EButton1Down,ptrPos,0,0,ptrNum);
-				iAnim->AddExpectedAnimPointerEvent(TRawEvent::EButton1Up,ptrPos,0,0,ptrNum);
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				SimulatePointerDownUp(ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				ptrPos.iX += xInc;
-				ptrPos.iY += yInc;
-				}
-			TestAndDisplayAnimError();
-			
-			// This is for just to add run the next test
-			SimulatePointerEvent(TRawEvent::EPointerSwitchOn, 0, 0, 0, 0);
-			
-			logText.Format(KEventsChecked, iMaxDevPointers*3);
-			LOG_MESSAGE(logText);
-			break;
-		default:
-			DestroyAnimDllAndAnim();
-			ResetFlushStopAS();
-			break;
-		}
-
-	LogEventsAdded();
-	}
-
-
-/**
-@SYMTestCaseID			GRAPHICS-WSERV-ADVANCEDPOINTER-0014
-@SYMPREQ				PREQ1226
-@SYMREQ					REQ9677,REQ9683,
-@SYMTestPriority		High 
-@SYMTestCaseDesc		To check Wserv purges multi pointer events with standard rules
-@SYMTestStatus			Implemented
-
-@SYMTestActions			Simulate raw events to be purged  
-@SYMTestExpectedResults The purged events should not be delivered to client 
-*/
-void CTMultiPtrEventTest::PurgingMultiPointerEvents()
-	{
-	// Test purging of multi pointer events
-	// 1. Test down/up pairs are purged
-	// 2. Test moves events are purged
-	// 3. Test drag events are purged
-	// 4. Test lone down events are purged
-	// 5. And finally test lone up events are also purged 
-	TLogMessageText logText;
-	_LIT(KSet, "Purging of multi pointer events: %d of 6");
-	logText.AppendFormat(KSet, iEventSet);
-	LOG_MESSAGE(logText);
-	
-	iMultiPtrEventClient->EventBuffer()->SetEventCount(0);
-	TInt xInc = iPhysicalScreenSize.iWidth/KMaxQueueSize;
-	TInt yInc = iPhysicalScreenSize.iHeight/KMaxQueueSize;
-	TPoint ptrPos(xInc,yInc);
-	TInt ptrNum = 0;
-	TInt prValue = 0;
-	TInt proxValue = 0;
-	
-	if (!iEventSet)
-		{
-		SetAutoFlush();
-		}
-	
-	// Point to note is that Kernel has an event queue size of 40
-	// So make sure that you don't send more than 40 events
-	switch(iEventSet++)
-		{
-		case 0:
-			// Simulate pointer down/up events for all pointers
-			// Simulate many up events from any pointer which will purge down/up events
-			AddExpectedWsEvent(EEventFocusGained);
-			for (ptrNum = 0; (ptrNum < iMaxDevPointers && ptrNum < 4); ptrNum++)
-				{
-				SimulatePointerDownUp(ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				}
-			SimulateAndAddLoneUpEvents(KMaxQueueSize, KMaxQueueSize-1, ptrPos);
-			break;
-		case 1:
-			// Repeat the same for Move events
-			// Simulate moves for all pointers with different pressure and proximity value
-			iMultiPtrEventClient->ParentWin()->BaseWin()->PointerFilter(EPointerFilterMove, 0);
-			iMultiPtrEventClient->ChildWin()->BaseWin()->PointerFilter(EPointerFilterMove, 0);
-			prValue = iPressureStep;
-			for (ptrNum = 0; (ptrNum < iMaxDevPointers && prValue < iMaxPressure && ptrNum < 4); ptrNum++,prValue+=iPressureStep)
-				{
-				ptrPos.iX += xInc/2;
-				ptrPos.iY += yInc/2;
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, prValue, ptrNum);
-				}
-			ptrPos.iX = xInc;
-			ptrPos.iY = yInc;
-			proxValue = -iProximityStep;
-			for (ptrNum = 0; (ptrNum < iMaxDevPointers && proxValue > iMaxProximity && ptrNum < 4); ptrNum++,proxValue-=iProximityStep)
-				{
-				ptrPos.iX += xInc/2;
-				ptrPos.iY += yInc/2;
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				}
-			SimulateAndAddLoneUpEvents(KMaxQueueSize, KMaxQueueSize, ptrPos);
-			break;
-		case 2:
-			{
-			// Repeat the same for drag events
-			iMultiPtrEventClient->ParentWin()->BaseWin()->PointerFilter(EPointerFilterDrag, 0);
-			iMultiPtrEventClient->ChildWin()->BaseWin()->PointerFilter(EPointerFilterDrag, 0);
-			ptrPos.iX = xInc;
-			ptrPos.iY = yInc;
-			for (ptrNum = 0; (ptrNum < iMaxDevPointers && ptrNum < 2); ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				ptrPos.iX += xInc/2;
-				ptrPos.iY += yInc/2;
-				}
-			ptrPos.iX = xInc;
-			ptrPos.iY = yInc;
-			TPoint interPt = ptrPos;
-			for (ptrNum = 0; (ptrNum < iMaxDevPointers && ptrNum < 2); ptrNum++)
-				{	
-				interPt.iX += 2;
-				interPt.iY += 1;
-				SimulatePointerEvent(TRawEvent::EPointerMove, interPt.iX, interPt.iY, 0, ptrNum);
-				ptrPos.iX += xInc/2;
-				ptrPos.iY += yInc/2;
-				interPt = ptrPos; 
-				}
-			ptrPos.iX = xInc;
-			ptrPos.iY = yInc;
-			interPt = ptrPos;
-			for (ptrNum = 0; (ptrNum < iMaxDevPointers && ptrNum < 2); ptrNum++)
-				{
-				interPt.iX += 2;
-				interPt.iY += 1;
-				SimulatePointerEvent(TRawEvent::EButton1Up, interPt.iX, interPt.iY, 0, ptrNum);
-				ptrPos.iX += xInc/2;
-				ptrPos.iY += yInc/2;
-				interPt = ptrPos; 
-				}
-			SimulateAndAddLoneUpEvents(KMaxQueueSize, KMaxQueueSize, ptrPos);
-			}
-			break;
-		case 3:
-			// Repeat the same for lone down events
-			ptrPos.iX = xInc;
-			ptrPos.iY = yInc;
-			for (ptrNum = 0; (ptrNum < iMaxDevPointers && ptrNum < 3); ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				ptrPos.iX += xInc/2;
-				ptrPos.iY += yInc/2;
-				}
-			SimulateAndAddLoneUpEvents(KMaxQueueSize+1, KMaxQueueSize, ptrPos);
-
-			// Before this we had to send dummy 7 EButton1Up events from 1 to 7 pointers so that iLastUnmatchedDown1
-			// variable to be reset and that consecutive events was not sent to client. But now EPointer3DOutOfRange
-			// resets all the variables.
-			for (ptrNum = 1; (ptrNum < iMaxDevPointers && ptrNum < 3); ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EPointer3DOutOfRange, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				}
-			break;
-		case 4:
-			// Finally for even lone up events, check that when you send events more then the queuesize
-			// the events are not sent back and they are ignored in wserv
-			ptrPos.iX = xInc;
-			ptrPos.iY = yInc;
-			for (ptrNum = 0; (ptrNum < iMaxDevPointers && ptrNum < 4); ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, 0, 0, ptrNum);
-				ptrPos.iX += xInc/2;
-				ptrPos.iY += yInc/2;
-				}
-			ptrPos.iX = xInc;
-			ptrPos.iY = yInc;
-			for (TInt count = 0; count < KMaxQueueSize; count++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, 0);
-				// For all up events more then KMaxQueueSize, wserv igoners then as the queue if full
-				if (count < (KMaxQueueSize - iMaxDevPointers))
-					{
-					AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, 0, 0, 0);
-					}
-				}
-			break;
-		case 5:
-			// Check PurgePointerEvents works with multi pointer events
-			ptrPos.iX = xInc;
-			ptrPos.iY = yInc;
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				ptrPos.iX += xInc/2;
-				ptrPos.iY += yInc/2;
-				}
-			ptrPos.iX = xInc;
-			ptrPos.iY = yInc;
-			iMultiPtrEventClient->iWs.PurgePointerEvents();
-			SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, 0, 0, 0);
-			break;
-		default:
-			ResetFlushStopAS();
-			break;
-		}
-	LogEventsAdded();
-	}
-
-void CTMultiPtrEventTest::MultiPointerEvents()
-	{
-	TLogMessageText logText;
-	_LIT(KSet, "MultiPtrEvents SetOfEvents: %d of 9");
-	logText.AppendFormat(KSet, iEventSet);
-	LOG_MESSAGE(logText);
-
-	if (!iEventSet)
-		{
-		SetAutoFlush();
-		}
-	iMultiPtrEventClient->EventBuffer()->SetEventCount(0);
-
-	TPoint ptrPos;
-	TInt ptrNum = 0;
-	TInt prValue = 0;
-	TInt proxValue = 0;
-	TInt xInc = iPhysicalScreenSize.iWidth/iMaxDevPointers;
-	TInt yInc = iPhysicalScreenSize.iHeight/iMaxDevPointers;
-	
-	switch(iEventSet++)
-		{
-		case 0:
-			/**
-			@SYMTestCaseID			GRAPHICS-WSERV-ADVANCEDPOINTER-0001
-			@SYMPREQ				PREQ1226
-			@SYMREQ					REQ9674,REQ9687,
-			@SYMTestPriority		High 
-			@SYMTestCaseDesc		Checks Wserv sends multi touch pointer events received by it
-			@SYMTestStatus			Implemented
-
-			@SYMTestActions			Simulate raw events from different pointers 
-			@SYMTestExpectedResults The received events must match the simulated raw events
-			*/
-			INFO_PRINTF1(_L("Simulate pointer events from all pointers"));
-			INFO_PRINTF1(_L("Test pattern is PointerDown0/PointerUp0, PointerDown1/PointerUp1, PointerDown2/PointerUp2..."));
-			// Test pattern is down0/up0, down1/up1, down2/up2, down3/up3....
-			AddExpectedWsEvent(EEventFocusGained);
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				SimulatePointerDownUp(ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				AddExpectedPointerDownUp(ptrPos, 0, ptrNum);
-				ptrPos.iX += xInc;
-				ptrPos.iY += yInc;
-				}
-			break;
-		case 1:
-			/**
-			@SYMTestCaseID			GRAPHICS-WSERV-ADVANCEDPOINTER-0003
-			@SYMPREQ				PREQ1226
-			@SYMREQ					REQ9674,REQ9687,
-			@SYMTestPriority		High 
-			@SYMTestCaseDesc		To check Wserv sends simultaneous multi touch pointer events 
-			@SYMTestStatus			Implemented
-
-			@SYMTestActions			Simulate simultaneous raw events from different pointers 
-			@SYMTestExpectedResults The received events must match the simulated raw events
-			*/
-			INFO_PRINTF1(_L("Test pattern PointerDown0/PointerDown1/PointerDown2/... PointerUp0/PointerUp1/PointerUp2..."));
-			// Test pattern is pointer0Down/pointer1Down/pointer2Down/pointer3Down.... pointer0Up/pointer1Up/pointer2Up/pointer3Up.... 
-			ptrPos.SetXY(0,0);
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, 0, 0, ptrNum);
-				ptrPos.iX += xInc;
-				ptrPos.iY += yInc;
-				}
-
-			ptrPos.SetXY(0,0);
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, 0, 0, ptrNum);
-				ptrPos.iX += xInc;
-				ptrPos.iY += yInc;				
-				}
-			break;
-		case 2:
-			/**
-			@SYMTestCaseID			GRAPHICS-WSERV-ADVANCEDPOINTER-0005
-			@SYMPREQ				PREQ1226
-			@SYMREQ					REQ9676
-			@SYMTestPriority		High 
-			@SYMTestCaseDesc		To check Wserv sends the multi touch pointer events received 
-									by it along with the Pressure or Proximity 
-			@SYMTestStatus			Implemented
-
-			@SYMTestActions			Simulate raw events with pressure and proximity from different pointers  
-			@SYMTestExpectedResults The received events must match the simulated raw events
-			*/
-			// Simulate Button1Down with differet pressure
-			// Simulate Button1Up with zero pressure
-			INFO_PRINTF1(_L("Simulate pointer events with different pressure values"));
-			ptrPos.SetXY(0,0);
-			prValue = iPressureStep;
-			for (; (prValue <= iMaxPressure && ptrPos.iX < iPhysicalScreenSize.iWidth && ptrPos.iY < iPhysicalScreenSize.iHeight); prValue+=iPressureStep)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, prValue, 0);
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, 0);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, prValue, 0, 0);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, 0, 0, 0);
-				ptrPos.iX += xInc;
-				ptrPos.iY += yInc;
-				}
-			
-			// Test with max pressure it might be that the width may cross the physical screen size
-			ptrPos.SetXY(0,0);
-			prValue = iMaxPressure;
-			SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, prValue, 0);
-			SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, prValue, 0, 0);
-			AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, 0, 0, 0);
-			break;
-		case 3:
-			// Simulate EPointerMove with different pressure values and for differernt pointers
-			INFO_PRINTF1(_L("Simulate pointer events with different pressure values and from different pointers"));
-			ptrPos.SetXY(0,0);
-			prValue = iPressureStep;
-			
-			// Enable move events 
-			iMultiPtrEventClient->ParentWin()->BaseWin()->PointerFilter(EPointerFilterMove, 0);
-			iMultiPtrEventClient->ChildWin()->BaseWin()->PointerFilter(EPointerFilterMove, 0);
-			
-			// Right now when 2 or more moves occur, wserv deletes all the moves except the last one.
-			// So test only one move per Pointer and then one set of button down and button up
-			// Then repeat the same for different pressure values
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, prValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EMove, ptrPos, prValue, 0, ptrNum);
-				ptrPos.iX += xInc;
-				ptrPos.iY += yInc;
-				}
-			
-			ptrPos.SetXY(0,0);
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				SimulatePointerDownUp(ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				AddExpectedPointerDownUp(ptrPos, 0, ptrNum);
-				ptrPos.iX += xInc;
-				ptrPos.iY += yInc;
-				}
-			
-			// Test moves with different pressure 
-			ptrPos.SetXY(0,0);
-			if ((prValue+iPressureStep) <= iMaxPressure)
-				{
-				prValue += iPressureStep;
-				}
-			ptrNum = 0;
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, prValue, ptrNum);
-			AddExpectedPointerEvent(TPointerEvent::EMove, ptrPos, prValue, 0, ptrNum);
-			break;
-		case 4:
-			INFO_PRINTF1(_L("Simulate pointer events with different proximity values"));
-			// Repeat the same test of case 3 for different proximity values
-			ptrPos.SetXY(0,0);
-			
-			proxValue = -iProximityStep;
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EMove, ptrPos, proxValue, 0, ptrNum);
-				ptrPos.iX += xInc;
-				ptrPos.iY += yInc;
-				}
-			
-			ptrPos.SetXY(0,0);
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				SimulatePointerDownUp(ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				AddExpectedPointerDownUp(ptrPos, 0, ptrNum);
-				ptrPos.iX += xInc;
-				ptrPos.iY += yInc;
-				}
-
-			ptrPos.SetXY(0,0);
-			if ((proxValue-iProximityStep) > iMaxProximity)
-				{
-				proxValue -= iProximityStep;
-				}
-			ptrNum = 0;
-			SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-			AddExpectedPointerEvent(TPointerEvent::EMove, ptrPos, proxValue, 0, ptrNum);
-			break;
-		case 5:
-			/**
-			@SYMTestCaseID			GRAPHICS-WSERV-ADVANCEDPOINTER-0007
-			@SYMPREQ				PREQ1226
-			@SYMREQ					REQ9677
-			@SYMTestPriority		High 
-			@SYMTestCaseDesc		To check Wserv sends move/drags of different pointers  
-			@SYMTestStatus			Implemented
-
-			@SYMTestActions			Simulate raw move and drag events from different pointers  
-			@SYMTestExpectedResults The received events must match the simulated raw events
-			*/
-			INFO_PRINTF1(_L("Simulate pointer drag events"));
-			ptrPos.SetXY(0,0);
-			iMultiPtrEventClient->ParentWin()->BaseWin()->PointerFilter(EPointerFilterDrag, 0);
-			
-			// Simulate EButton1Down and then one move and then EButton1Up event  
-			// which will lead to corresponding drag, do it for all the pointers
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				TestDragForMultiPointer(ptrPos, 0, ptrNum);
-				ptrPos.iX += xInc/2;
-				ptrPos.iY += yInc/2;
-				}
-
-			// Check the drag with different pressure value with different pointer
-			prValue = iPressureStep;
-			ptrPos.iX = xInc;
-			ptrPos.iY = yInc;
-			if ((prValue+iPressureStep) <= iMaxPressure)
-				{
-				prValue += iPressureStep;
-				}
-			ptrNum = 0;
-			TestDragForMultiPointer(ptrPos, prValue, ptrNum);
-			break;
-		case 6:
-			{
-			/**
-			@SYMTestCaseID			GRAPHICS-WSERV-ADVANCEDPOINTER-0009
-			@SYMPREQ				PREQ1226
-			@SYMREQ					REQ9677, REQ9674
-			@SYMTestPriority		High 
-			@SYMTestCaseDesc		To check Wserv sends simultaneous move/drags of different pointers  
-			@SYMTestStatus			Implemented
-
-			@SYMTestActions			Simulate simulatneous raw move and drag events from different pointers  
-			@SYMTestExpectedResults The received events must match the simulated raw events
-			*/
-			INFO_PRINTF1(_L("Simulate pointer drag events in different pattern"));
-			// Dragging done in this pattern
-			// pointer0Down/pointer1Down/pointer2Down/pointer3Down... pointer0Up/pointer1Up/pointer2Up/pointer3Up....
-			
-			ptrPos.SetXY(0,0);
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, 0, 0, ptrNum);
-				ptrPos.iX += xInc/2;
-				ptrPos.iY += yInc/2;
-				}
-			
-			ptrPos.SetXY(0,0);
-			TPoint interPt = ptrPos;
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				interPt.iX += 2;
-				interPt.iY += 1;
-				SimulatePointerEvent(TRawEvent::EPointerMove, interPt.iX, interPt.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EDrag, interPt, 0, 0, ptrNum);
-				ptrPos.iX += xInc/2;
-				ptrPos.iY += yInc/2;
-				interPt = ptrPos; 
-				}
-		
-			ptrPos.SetXY(0,0);
-			interPt = ptrPos;
-			for (ptrNum = 0; ptrNum < iMaxDevPointers; ptrNum++)
-				{
-				interPt.iX += 2;
-				interPt.iY += 1;
-				SimulatePointerEvent(TRawEvent::EButton1Up, interPt.iX, interPt.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, interPt, 0, 0, ptrNum);
-				ptrPos.iX += xInc/2;
-				ptrPos.iY += yInc/2;
-				interPt = ptrPos; 
-				}
-			break;
-			}
-		case 7:
-			{
-			// Mixing of drag and moves of different pointers
-			ptrPos.SetXY(0,0);
-			for (ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, 0, 0, ptrNum);
-				ptrPos.iX += xInc/2;
-				ptrPos.iY += yInc/2;
-				}
-			ptrPos.SetXY(0,0);
-			TPoint interPt = ptrPos;
-			for (ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				interPt.iX += 2;
-				interPt.iY += 1;
-				SimulatePointerEvent(TRawEvent::EPointerMove, interPt.iX, interPt.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EDrag, interPt, 0, 0, ptrNum);
-				ptrPos.iX += xInc/2;
-				ptrPos.iY += yInc/2;
-				interPt = ptrPos; 
-				}
-		
-			ptrPos.SetXY(0,0);
-			interPt = ptrPos;
-			for (ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				interPt.iX += 2;
-				interPt.iY += 1;
-				SimulatePointerEvent(TRawEvent::EButton1Up, interPt.iX, interPt.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, interPt, 0, 0, ptrNum);
-				ptrPos.iX += xInc/2;
-				ptrPos.iY += yInc/2;
-				interPt = ptrPos; 
-				}
-			
-			ptrPos.SetXY(0,0);
-			prValue = iPressureStep;
-			for (ptrNum = 0; ptrNum < iMaxDevPointers/2 && prValue < iMaxPressure; ptrNum++, prValue+=iPressureStep)
-				{
-				SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, prValue, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EMove, ptrPos, prValue, 0, ptrNum);
-				ptrPos.iX += xInc;
-				ptrPos.iY += yInc;
-				}
-			}
-			break;
-		case 8:
-			{
-			INFO_PRINTF1(_L("Check intermediate Moves and Drags are deleted except last event"));
-			// Check if intermediate move and drag events are deleted
-			// The deletion is done with respect to same pointer and same window
-			xInc = iPhysicalScreenSize.iWidth/KMaxQueueSize;
-			yInc = iPhysicalScreenSize.iHeight/KMaxQueueSize;
-			ptrPos.iX = xInc;
-			ptrPos.iY = yInc;
-			TInt count = 0;
-			
-			for (ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				// Make sure that ptrPos does not go out of screen area, i,e the loop count should not exceed 4
-				for (count = proxValue = 0; proxValue > iMaxProximity && count < 4; proxValue=proxValue-(4*iProximityStep), count++)
-					{
-					ptrPos.iX += xInc/2;
-					ptrPos.iY += yInc/2;
-					SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, proxValue, ptrNum);
-					}
-				// Since the for loop increments the variables at the end
-				proxValue = proxValue + (4*iProximityStep);
-				AddExpectedPointerEvent(TPointerEvent::EMove, ptrPos, proxValue, 0, ptrNum);
-				}
-			
-			ptrPos.iX = xInc;
-			ptrPos.iY = yInc;
-			for (ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				ptrPos.iX += xInc/2;
-				ptrPos.iY += yInc/2;
-				SimulatePointerEvent(TRawEvent::EButton1Down, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Down, ptrPos, 0, 0, ptrNum);
-				}
-
-			ptrPos.iX = xInc;
-			ptrPos.iY = yInc;
-			for (ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				// Make sure that ptrPos does not go out of screen area, i,e the loop count shuld not exceed 4
-				for (count = prValue = 0; prValue < iMaxPressure && count < 4; prValue=prValue+(4*iPressureStep), count++)
-					{
-					ptrPos.iX += xInc/2;
-					ptrPos.iY += yInc/2;
-					SimulatePointerEvent(TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, prValue, ptrNum);
-					}
-				prValue = prValue-(4*iPressureStep);
-				AddExpectedPointerEvent(TPointerEvent::EDrag, ptrPos, prValue, 0, ptrNum);
-				}
-			
-			ptrPos.iX = xInc;
-			ptrPos.iY = yInc;
-			for (ptrNum = 0; ptrNum < iMaxDevPointers/2; ptrNum++)
-				{
-				ptrPos.iX += xInc/2;
-				ptrPos.iY += yInc/2;
-				SimulatePointerEvent(TRawEvent::EButton1Up, ptrPos.iX, ptrPos.iY, 0, ptrNum);
-				AddExpectedPointerEvent(TPointerEvent::EButton1Up, ptrPos, 0, 0, ptrNum);
-				}
-			}
-			break;
-		default:
-			ResetFlushStopAS();
-			break;
-		}
-	
-	LogEventsAdded();
-	}
-
-// Logs number of events added to test buffer for comaparison
-void CTMultiPtrEventTest::LogEventsAdded()
-	{
-	TLogMessageText logText1;
-	_LIT(KEventsAdded, "Events added to buffer = %d");
-	logText1.AppendFormat(KEventsAdded, iMultiPtrEventClient->EventBuffer()->EventsRemaining());
-	LOG_MESSAGE(logText1);	
-	}
-
-// If any of the Tests fails, bring the wserv in a consistent state for other test to run, 
-// stop ActiveScheduler and display some logs where the fail occured.
-void CTMultiPtrEventTest::Failed()
-	{
-	switch (iTest->iState)
-		{
-		case 2:		// Anim tests
-			DestroyAnimDllAndAnim();
-			break;
-		case 3:		// MultiClient tests
-			if (iMultiPtrEventClient->EventBuffer()->NestedLoopState())
-				{
-				iSecMultiPtrEventClient->EventBuffer()->SetNestedLoopState(EFalse);
-				CActiveScheduler::Stop();
-				}
-			break;
-		case 4:		//PtrClick tests
-			if (iPtrPluginLoaded)
-				{
-				iPtrPluginLoaded = EFalse;
-				iClick.Unload();
-				iClick.Close();
-				}
-			if (iHeap)
-				{
-				iHeap->Close();
-				iHeap = NULL;
-				iChunk.Close();
-				}
-			break;
-		case 5:		//Screen mode tests
-			SetDefaultScreenMode();
-			break;
-		case 11:
-			iMultiPtrEventClient->DeleteGroupBlankWin();
-			break;
-		case 12:	//Emulation tests, iEventSet is incremented in main switch case.
-			switch (iEventSet)
-				{
-				case 9:
-					DeleteGroupWin();
-					break;
-				case 10:
-					DestroyAnimDllAndAnim();
-					break;
-				case 11:
-				case 12:
-					iMultiPtrEventClient->ParentWin()->BaseWin()->FreePointerMoveBuffer();
-					iMultiPtrEventClient->ParentWin()->BaseWin()->DisablePointerMoveBuffer();
-					break;
-				case 14:
-				case 15:
-					iMultiPtrEventClient->iWs.SetPointerCursorArea(iOrigPtrCursorArea);
-					break;
-				default:
-					break;
-				}
-			break;
-		case 15:
-			if (iEventSet > 1)
-				{
-				DeleteGroupWinForCapturing();
-				}
-			break;
-		case 13:
-		case 16:
-			SetThresholdValues(KMaxTInt, KMinTInt, KMaxTInt, KMinTInt);
-			break;
-		default:
-			break;
-		}
-	
-	if (iActiveSchedulerStarted)
-		{
-		iActiveSchedulerStarted = EFalse;
-		CActiveScheduler::Stop();
-		}
-	
-	// Display the test case number, subtest case number and number of events left in the buffer which can be used to
-	// find out which event actually caused the failure when any test fails
-	TLogMessageText logText1;
-	_LIT(KEventsAdded, "Test case number %d Sub test case number %d Events remaining in the buffer %d \n");
-	logText1.AppendFormat(KEventsAdded, iTest->iState, iEventSet, iMultiPtrEventClient->EventBuffer()->EventsRemaining());
-	LOG_MESSAGE(logText1);
-	RDebug::Printf("Test case number %d Sub test case number %d Events remaining in the buffer %d \n", iTest->iState, iEventSet, iMultiPtrEventClient->EventBuffer()->EventsRemaining());
-	
-	iFailed=ETrue;
-	}
-
-// This function is called by TestExecute Framework, through which all the testcases are run
-void CTMultiPtrEventTest::RunTestCaseL(TInt /*aCurTestCase*/)
-	{
-	_LIT(KTest0, "MultiPointerEvents with Pressure and Proximity");
-	_LIT(KTest1, "Purging Of MultiPointerEvents");
-	_LIT(KTest2, "MultiPointerEvents for Anims");
-	_LIT(KTest3, "MultiPointerEvents from multi client");
-	_LIT(KTest4, "MultiPointerEvents for pointer click plugin");
-	_LIT(KTest5, "MultiPointerEvents In Different ScreenModes");
-	_LIT(KTest6, "Filtering Of MultiPointerEvents");
-	_LIT(KTest7, "Grabbing Of MultiPointerEvents");
-	_LIT(KTest8, "VirtualKeyboard for Multiple Pointers");
-	_LIT(KTest9, "DoubleClick events for Multiple Pointer");
-	_LIT(KTest10, "OutOfRange & EnterExit for Multiple Pointer");
-	_LIT(KTest11, "Auto foreground for Multiple Pointer");
-	_LIT(KTest12, "Emulation rules for Mulitple Pointers");
-	_LIT(KTest13, "Close proximity and High Pressure events");
-	_LIT(KTest14, "Out of bound value testing");
-	_LIT(KTest15, "Capturing Of MultiPointerEvents");
-	_LIT(KTest16, "Negative testing for Proximity and Pressure events");
-	_LIT(KTest17, "PointerRepeatEvent for Multiple Pointers");
-	
-	if (!TestBase()->ConfigurationSupportsPointerEventTesting())
-	    {
-	    INFO_PRINTF1(_L("Test skipped because config does not support pointer event testing"));
-	    TestComplete();
-	    return;
-	    }
-	
-	switch(iTest->iState)
-		{
-	case 0:
-		iTest->LogSubTest(KTest0);
-		RunTestsL();
-		break;
-	case 1:
-		iTest->LogSubTest(KTest1);
-		RunTestsL();
-		break;
-	case 2:
-		iTest->LogSubTest(KTest2);
-		RunTestsL();
-		break;
-	case 3:
-		iTest->LogSubTest(KTest3);
-		RunTestsL();
-		break;
-	case 4:
-		iTest->LogSubTest(KTest4);
-		RunTestsL();
-		break;
-	case 5:
-		iTest->LogSubTest(KTest5);
-		RunTestsL();
-		break;
-	case 6:
-		iTest->LogSubTest(KTest6);
-		RunTestsL();
-		break;	
-	case 7:
-		iTest->LogSubTest(KTest7);
-		RunTestsL();
-		break;	
-	case 8:
-		iTest->LogSubTest(KTest8);
-		RunTestsL();
-		break;
-	case 9:
-		iTest->LogSubTest(KTest9);
-		RunTestsL();
-		break;
-	case 10:
-		iTest->LogSubTest(KTest10);
-		RunTestsL();
-		break;
-	case 11:
-		iTest->LogSubTest(KTest11);
-		RunTestsL();
-		break;
-	case 12:
-		iTest->LogSubTest(KTest12);
-		RunTestsL();
-		break;
-	case 13:
-		iTest->LogSubTest(KTest13);
-		RunTestsL();
-		break;
-	case 14:
-		iTest->LogSubTest(KTest14);
-		RunTestsL();
-		break;
-	case 15:
-		iTest->LogSubTest(KTest15);
-		RunTestsL();
-		break;
-	case 16:
-		iTest->LogSubTest(KTest16);
-		RunTestsL();
-		break;	
-	case 17:
-		iTest->LogSubTest(KTest17);
-		RunTestsL();
-		break;	
-	case 18:
-		// Keep this code in last case statement for main test completion 
-		TestComplete();
-		break;
-	default:
-		AutoPanic(EAutoPanicWrongTest);
-		}
-
-	// 
-	if (iFailed)
-		{
-		TEST(EFalse);
-		iFailed=EFalse;
-		}
-	++iTest->iState;
-	}
-
-// Macro which is used for construction of CTMultiPtrEventTestStep object
-// and also used to call CreateTestL() which creates CTMultiPtrEventTest and CTestBase objects
-__WS_CONSTRUCT_STEP__(MultiPtrEventTest)
--- a/windowing/windowserver/tauto/tmultiptrevent.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,283 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code 
-*/
-
-#ifndef TMULTIPTREVENT_H_
-#define TMULTIPTREVENT_H_
-
-#include <e32std.h>
-#include <e32cmn.h>
-#include "w32std.h"
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "AUTODLL.H"
-#include "../TClick/multiptrclick.h"
-#include "TGraphicsHarness.h"
-
-class CTMultiPtrEventTest;
-class CTMultiPtrEventClient;
-
-/*
- * CTEvent derived class which acts as eventhandler and eventbuffer 
- * Stores the events in buffer, which is used for comparing events received from wserv.
- */ 
-class CTMultiPtrEventBuffer : public CTEvent
-	{
-	enum {EEventBufferSize=40, EMovePtsBuffer=10};
-public:
-	CTMultiPtrEventBuffer(RWsSession *aWs, CTMultiPtrEventTest *aTest, CTMultiPtrEventClient* aClient);
-	void ConstructL();
-	void AddExpectedEvent(TWsEvent &aEvent);
-	void AddExpectedMovePtEvent(TPoint &aMovePt);
-	TInt EventsRemaining();
-	void SetEventCount(TInt aCount) {iEventCount = aCount;}
-	void SetNestedLoopState(TBool aLoopStart) {iNestedLoopStarted = aLoopStart;}
-	TBool NestedLoopState() {return iNestedLoopStarted;}
-	void GetMoveBufferAndCompareL();
-protected:
-	// Pure virtual from CTEventBase
-	void doRunL();
-private:
-	void TestL(TInt aTest);
-	void TestL(TInt aTest, TInt aVal1, TInt aVal2,const char *oper, const char *aTestStr, 
-	           const TWsEvent *aEvent, const TWsEvent *aExpected, const char *aFile, TUint aLine);
-    void TestL(TInt aTest, TPoint aVal1, TPoint aVal2,const char *oper, const char *aTestStr, 
-               const TWsEvent *aEvent, const TWsEvent *aExpected, const char *aFile, TUint aLine);
-private:
-	CCirBuf<TWsEvent> iEventBuffer;
-	CCirBuf<TPoint> iMovePtsBuffer;
-	CTMultiPtrEventTest* iTest;
-	TInt iEventCount;
-	CTMultiPtrEventClient* iClient;
-	TBool iNestedLoopStarted;
-	};
-
-
-/* 
- * CTClient derived class which gives Wserv client environment 
- * i,e iWs, iScreen, iGc, iGroup, iEventHandler etc...
- * Owns CTMultiPtrEventBuffer and stores in iEventhandler of its base class
- * Accepts the event from test class and passes them on to buffer class
- */ 
-class CTMultiPtrEventClient : public CTClient
-	{
-public:
-	CTMultiPtrEventClient(CTMultiPtrEventTest *aTest, TBool aSecondaryClient = EFalse);
-	~CTMultiPtrEventClient();
-	void ConstructL();
-	
-	inline CTBlankWindow* ParentWin() { return iParentWin; }
-	inline CTBlankWindow* ChildWin() { return iChildWin; }
-	inline CTMultiPtrEventBuffer* EventBuffer() {return static_cast<CTMultiPtrEventBuffer*>(iEventHandler);}
-	inline void SetExpectNonAdvancedPointerEvents() {iExpectNonAdvancedPointerEvents=ETrue;};
-	inline void ClearExpectNonAdvancedPointerEvents() {iExpectNonAdvancedPointerEvents=EFalse;};
-
-	TBool IsSecondaryClient() {return iSecondaryClient;}
-	
-	void AddExpectedPointerEvent(TPointerEvent::TType aType, TPoint aPos, TUint8 aPointerNumber, TUint aHandle = 0);
-	void AddExpectedPointerEvent(TPointerEvent::TType aType, TPoint aPos, TInt aZ, TUint aModifier, TUint8 aPointerNumber, TUint aHandle = 0);
-	void AddExpectedWsEvent(TEventCode aType, TInt aPointerNumber = 0, TUint aHandle = 0);
-	void AddExpectedMovePoint(TPoint aPos);
-	void CalculatePtrPosAndSet3Ddata(TWsEvent& aEvent, TPointerEvent::TType aType, TPoint aPos, TUint aModifiers, TInt aZ, TUint8 aPointerNumber, TUint aHandle);
-	void ConstructGroupBlankWinL();
-	void DeleteGroupBlankWin();
-	TBool CheckOrdinalPosition(TInt aWinAutoFocus1);
-	
-	// Virtual from CTClient
-	void ConstructEventHandlerL();
-	
-private:
-	CTMultiPtrEventTest* iTest;
-	TSize iParentWinSize;
-	TPoint iParentWinPos;
-	TSize iChildWinSize;
-	TPoint iChildWinPos;
-	CTBlankWindow* iParentWin;
-	CTBlankWindow* iChildWin;
-
-	TBool iSecondaryClient;
-	
-	// For AutoFocus test
-	CTWindowGroup* iGroupWinAutoFocus1;
-	CTWindowGroup* iGroupWinAutoFocus2;
-	CTBlankWindow* iWinAutoFocus1;
-	CTBlankWindow* iWinAutoFocus2;
-	
-	TSize iWinSizeAutoFocus1;
-	TPoint iWinPosAutoFocus1;
-	TSize iWinSizeAutoFocus2;
-	TPoint iWinPosAutoFocus2;
-	TBool iExpectNonAdvancedPointerEvents;
-	};
-
-class RMultiPointerAnim : public RTestAnim
-	{
-public:
-	static RMultiPointerAnim* NewL(RWindowBase* aWin, RAnimDll* aDll);
-	RMultiPointerAnim(RAnimDll* aDll) :RTestAnim(*aDll) {}
-	TInt AddExpectedAnimPointerEvent(TRawEvent::TType aType, TPoint aPos, TInt aZ, TUint aModifier, TUint8 aPointerNumber, TBool aEat = ETrue);
-	};
-
-/*
- * CTWsGraphicsBase derived class which implements RunTestCaseL pure virtual.
- * Runs all the testcases for multi poniter events.
- * For each test case it creates CTMultiPtrEventClient object and creates a nested activescheduler
- * Calls NextSetOfEventsL() which in turn calls respective tests depending upong the testcase number
- * For each test simulates the events and adds the same event to CTMultiPtrEventBuffer
- * When all the tests for a particular testcase completes stops activescheduler
- * Repeats the same for all testcases
- */ 
-class CTMultiPtrEventTest : public CTWsGraphicsBase
-	{
-public:
-	CTMultiPtrEventTest(CTestStep* aStep);
-	~CTMultiPtrEventTest();
-	void ConstructL();
-	void NextSetOfEventsL();
-	void Failed();
-	
-	// Functions for simulating events, which use UserSvr::AddEvent
-	void SimulatePointerEvent(TRawEvent::TType aType, TInt aX, TInt aY, TUint8 aPointerNumber);
-	void SimulatePointerEvent(TRawEvent::TType aType, TInt aX, TInt aY, TInt aZ, TUint8 aPointerNumber);
-	void SimulatePointerDownUp(TInt aX, TInt aY, TInt aZ, TUint8 aPointerNumber);
-	
-	// Functions for adding event, calls the client's AddExpectedPointer
-	void AddExpectedPointerEvent(TPointerEvent::TType aType, TPoint aPos, TUint8 aPointerNumber, TUint aHandle = 0);
-	void AddExpectedPointerEvent(TPointerEvent::TType aType, TPoint aPos, TInt aZ, TUint aModifier, TUint8 aPointerNumber, TUint aHandle = 0, TBool aSecondaryClient = EFalse);
-	void AddExpectedPointerDownUp(TPoint aPos, TInt aZ, TUint8 aPointerNumber);
-	void AddExpectedWsEvent(TEventCode aType, TBool aSecondaryClient = EFalse, TInt aPointerNumber = 0, TUint aHandle = 0);
-	void AddExpectedMultiPtrClickEvent(TPointerEvent::TType aType, TPoint aPos, TInt aZ, TUint aModifier, TUint8 aPointerNumber, TUint aHandle = 0);
-	void AddExpectedMultiPtrClickOtherEvent(TPointerEvent::TType aType, TPoint aPos, TInt aZ, TUint aModifier, TUint8 aPointerNumber, TUint aHandle);
-	
-	void AddExpectedKey(TInt aEventCode, TInt aScanCode, TInt aCode/*=0*/, TInt aRepeats/*=0*/, TUint aModifiers/*=0*/);
-	void AddExpectedKeyDownUp(TInt aScanCode, TInt aCode=0, TInt aRepeats=0, TUint aModifiers=0);	
-	
-	// Supplementary function for tests
-	void TestDragForMultiPointer(TPoint aPtrPos, TInt aPrValue, TUint8 aPointerNumber);
-	void SimulateAndAddLoneUpEvents(TInt aNumSimulation, TInt aNumAddition, TPoint aPos);
-	void TestAndDisplayAnimError();
-	void GetRemainingEventsFromSecondaryClient();
-	void TestAndDisplayPtrClickError();
-	void CreatePointerClickPluginL();
-	void SetAutoFlush();
-	void ResetFlushStopAS();
-	void TestFilteringForMultiPointer(TBool aFiltering);
-	void TestGrabbingForMultiPointer(TBool aGrabbing);
-	void CreateGroupWinL();
-	void DeleteGroupWin();
-	void CreateGroupWinForCapturingL();
-	void DeleteGroupWinForCapturing();
-	void CreateAnimDllAndAnimL();
-	void DestroyAnimDllAndAnim();
-	void TestCloseProximityHighPressureAPIsL();
-	void TestCapturingForMultiPointer(TBool aAllGroups);
-	void SetThresholdValues(TInt aEnterCloseProx, TInt aExitCloseProx, TInt aEnterHighPres, TInt aExitHighPres);
-	void NegativeTestingOfProximityPressureAPIsL();
-	void TestErrorCodeL(TInt aExpErrCode, TInt aActualErrCode);
-	void SimulateProximityAndPressureEvents(TInt aCloseProxEnterValue, TInt aCloseProxExitValue, TInt aHighPresEnterValue, TInt aHighPresExitValue);
-	void SetDefaultScreenMode();
-	TPoint GetPointerPostionOnRotatedMode(TPoint aPointerPos, CFbsBitGc::TGraphicsOrientation aRotation);
-	void LogEventsAdded();
-	
-	// All tests
-	void MultiPointerEvents();
-	void PurgingMultiPointerEvents();
-	void MultiPointerEventsForAnimsL();
-	void MultiClientMultiPointerEvents();
-	void MultiPointerEventsForPointerClickL();
-	void MultiPointerEventsInDiffScreenModes();
-	void FilteringMultiPointerEvents();
-	void GrabbingMultiPointerEvents();
-	void VirtualKeyBoardForMultiplePointers();
-	void DoubleClickForMultiplePointers();
-	void MultiPointerOutOfRangeEvents();
-	void AutoForeGroundForMultiplePointersL();
-	void EmulationRulesForMultiplePointers();
-    void CloseProximityAndHighPressureEventsL();
-	void OutOfBoundValueTesting();
-	void CapturingMultiPointerEvents();
-	void NegativeTestsForProximityPressureEventsL();
-	void PointerRepeatEventForMultiplePointers();
-	void SetExpectNonAdvancedPointerEvents(TBool aSecondaryClient=EFalse);
-	void ClearExpectNonAdvancedPointerEvents(TBool aSecondaryClient=EFalse);
-	
-protected:
-	void RunTestCaseL(TInt aCurTestCase);
-private:
-	void RunTestsL();
-private:
-	TInt iEventSet;			// Set of events for one particular test case
-	TBool iFailed;
-	TBool iActiveSchedulerStarted;
-	TBool iTheClientFlush;
-	TBool iClientFlush;
-	TBool iSecClientFlush;
-	TSize iPhysicalScreenSize;
-	TRect iOrigPtrCursorArea;
-	
-	TUint iPointerNumber;
-	TInt iMaxDevPointers;
-	TInt iMaxUiPointers;
-	TInt iMaxPressure;
-	TInt iPressureStep;
-	TInt iMaxProximity;
-	TInt iProximityStep;
-
-	TInt iEnterCloseProximityThreshold;
-	TInt iExitCloseProximityThreshold;
-	TInt iEnterHighPressureThreshold;
-	TInt iExitHighPressureThreshold;	
-	 
-	CTMultiPtrEventClient *iMultiPtrEventClient;
-	CTMultiPtrEventClient *iSecMultiPtrEventClient;
-	
-	RAnimDll* iAnimDll;
-	RMultiPointerAnim* iAnim;
-	
-	RSoundPlugIn iClick;
-	TBool iPtrPluginLoaded;
-	RChunk iChunk;
-	RHeap* iHeap;
-	TAny* iErrDesc;
-	
-	TInt iCurrentScreenMode;
-	TBool iChangeScreenMode;
-	
-	CTWindowGroup* iGroupWinForEmul;
-	CTBlankWindow* iWinForEmul;
-	
-	CTWindowGroup* iGroupWinForCapturing;
-	CTBlankWindow* iWinForCapturing;
-	
-	TInt iYOffset;
-	};
-
-class CTMultiPtrEventTestStep : public CTGraphicsStep
-	{
-public:
-	CTMultiPtrEventTestStep();
-protected:
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTMultiPtrEventTestStep, "TMultiPtrEventTest");
-
-#endif /*TMULTIPTREVENT_H_*/
--- a/windowing/windowserver/tauto/topaquechild.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,167 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// This file is part of manual test (group\inc113743.mmp) to check Wserv behaviour when
-// exposing a transparent window that is obscured by some opaque child window above it.
-// Without the fix, that transparent window will be drawn as opaque window
-// because its transparent regions is null (not re-created due to its update flag is not
-// set as it is not traceable via transparent regions linked list of windows above it.
-// Some illustration when the situation will trigger the defect (side view),
-// ----       Child (opaque)
-// ---------- Parent (transparent)
-// ----       Other transparent window obscured by opaque child
-// This defect is only reproducable when window shadowing is not used, so it cannot be 
-// tested from standard Wserv test framework.
-// @SYMTestCaseID		GRAPHICS-WSERV-0450
-// @SYMDEF  			INC113743
-// @SYMTestCaseDesc    Perform test on Wserv behaviour in exposing transparent windows which is obscured indirectly by opaque child window
-// @SYMTestPriority    High
-// @SYMTestStatus      Implemented
-// @SYMTestActions     Create opaque and transparent windows in the following dimension and z-order
-// ----       opaque child
-// ---------- transparent parent
-// ----       other transparent underneath obscured and non traceable via transparent parent iTransparentRegions
-// and then make transparent parent window invisible
-// @SYMTestExpectedResults The expected result are: other transparent window underneath is exposed and redrawn properly not becoming opaque
-// 
-//
-
-#include <e32std.h>
-#include <w32std.h>
-#include <fbs.h>
-
-#define ENullWsHandle 0xffffffff
-
-void MainL()
-	{
-	const TSize KTestSize(320,240);
-	const TSize KHalfSize(160,240);
-	const TInt KScreenNo = 1;
-
-	RRegion shape;
-	shape.AddRect(TRect(0,0,160,120));
-	shape.AddRect(TRect(160,120,320,240));
-	CleanupClosePushL(shape);
-
-	RWsSession ws;
-	User::LeaveIfError(ws.Connect());
-	CleanupClosePushL(ws);
-
-	CWsScreenDevice* scr = new(ELeave) CWsScreenDevice(ws);
-	CleanupStack::PushL(scr);
-	User::LeaveIfError(scr->Construct(KScreenNo));
-	TDisplayMode displayMode = scr->DisplayMode();
-
-	CWindowGc* gc = NULL;
-	User::LeaveIfError(scr->CreateContext(gc));
-	CleanupStack::PushL(gc);
-
-	RWindowGroup group(ws);
-	User::LeaveIfError(group.Construct(0x0badface, ETrue));
-	CleanupClosePushL(group);
-
-	// create transparent window underneath that will be obscured by some opaque child window above it
-	RWindow transWinUnderneath(ws);
-	User::LeaveIfError(transWinUnderneath.Construct(group, ENullWsHandle));
-	CleanupClosePushL(transWinUnderneath);
-	transWinUnderneath.SetShadowDisabled(ETrue);
-	transWinUnderneath.SetExtent(TPoint(0,0),KTestSize/*KHalfSize*/);
-	transWinUnderneath.SetTransparencyAlphaChannel();
-	transWinUnderneath.SetRequiredDisplayMode(EColor64K);
-	transWinUnderneath.SetBackgroundColor(TRgb(255,0,0,128));
-	transWinUnderneath.SetShape(shape);
-	transWinUnderneath.Activate();
-	transWinUnderneath.Invalidate();
-	transWinUnderneath.BeginRedraw();
-	transWinUnderneath.EndRedraw();
-	ws.Flush();
-
-	User::After(1*1000*1000);
-
-	// save the reference image (semi-transparent red window)
-	CFbsBitmap* refImage = new(ELeave) CFbsBitmap;
-	CleanupStack::PushL(refImage);
-	User::LeaveIfError(refImage->Create(KTestSize, displayMode));
-	scr->CopyScreenToBitmap(refImage);
-
-	// create transparent window parent which will have opaque child
-	RWindow transWinParent(ws);
-	User::LeaveIfError(transWinParent.Construct(group, ENullWsHandle));
-	CleanupClosePushL(transWinParent);
-	transWinParent.SetShadowDisabled(ETrue);
-	transWinParent.SetExtent(TPoint(0,0),KTestSize);
-	transWinParent.SetTransparencyAlphaChannel();
-	transWinParent.SetRequiredDisplayMode(EColor64K);
-	transWinParent.SetBackgroundColor(TRgb(255,255,255,0));
-	transWinParent.Activate();
-
-	transWinParent.Invalidate();
-	transWinParent.BeginRedraw();
-	transWinParent.EndRedraw();
-	ws.Flush();
-		
-	// create opaque child window that obscure transparent window underneath (not its parent)
-	RWindow opaqueWinChild(ws);
-	User::LeaveIfError(opaqueWinChild.Construct(transWinParent, ENullWsHandle));
-	CleanupClosePushL(opaqueWinChild);
-	opaqueWinChild.SetExtent(TPoint(0,0),KTestSize/*KHalfSize*/);
-	opaqueWinChild.SetRequiredDisplayMode(EColor64K);
-	opaqueWinChild.SetShape(shape);
-	opaqueWinChild.Activate();
-	
-	opaqueWinChild.Invalidate();
-	opaqueWinChild.BeginRedraw();
-	gc->Activate(opaqueWinChild);
-	gc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	gc->SetPenStyle(CGraphicsContext::ENullPen);
-	gc->SetBrushColor(KRgbGreen);
-	gc->Clear();
-	gc->SetBrushColor(KRgbBlue);
-	gc->DrawEllipse(KTestSize/*KHalfSize*/);
-	gc->Deactivate();
-	opaqueWinChild.EndRedraw();
-	ws.Flush();
-
-	User::After(1*1000*1000);
-
-	// preform the test by making transparent window parent invisible
-	transWinParent.SetVisible(EFalse);
-	ws.Flush();
-
-	User::After(2*1000*1000);
-
-	// save the test image (without the fix this would be an opaque red window)
-	CFbsBitmap* testImage = new(ELeave) CFbsBitmap;
-	CleanupStack::PushL(testImage);
-	User::LeaveIfError(testImage->Create(KTestSize, displayMode));
-	scr->CopyScreenToBitmap(testImage);
-
-	_LIT(KPanicMsg, "Test Failed");
-	TInt nbytes = CFbsBitmap::ScanLineLength(KTestSize.iWidth, displayMode)*KTestSize.iHeight;
-	if (Mem::Compare((TUint8*)testImage->DataAddress(), nbytes, (TUint8*)refImage->DataAddress(), nbytes)!=0)
-		User::Panic(KPanicMsg, 0);
-
-	CleanupStack::PopAndDestroy(10, &shape);
-	}
-
-GLDEF_C TInt E32Main()
-	{
-	CTrapCleanup* cs = CTrapCleanup::New();
-	if (!cs)
-		return KErrNoMemory;
-		
-	TRAPD(err,MainL());
-
-	delete cs;
-	return err;
-	}
--- a/windowing/windowserver/tauto/tw32cmdbuf.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,283 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// The fix solves the problem of bitmap drawing command being added to the window server
-// command buffer without the bitmap handle(s) being added to the command buffer bitmap array.
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "tw32cmdbuf.h"
-
-const TInt KMaxTestIterations = 300;
-const TInt KMinTestIterations = 100;
-
-CTW32CmdBuf::CTW32CmdBuf(CTestStep* aStep):
-	CTGraphicsBase(aStep)
-	{
-	}
-
-CTW32CmdBuf::~CTW32CmdBuf()
-	{
-	}
-
-void CTW32CmdBuf::ConstructL()
-	{
-	}
-
-void CTW32CmdBuf::RunTestCaseL(TInt aCurTestCase)
-	{
-	((CTW32CmdBufStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
-	switch(aCurTestCase)
-		{
-		case 1:
-			((CTW32CmdBufStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0452"));
-			INFO_PRINTF1(_L("Test all the drawing commands involving a CFbsBitmap\n"));
-			DoCmdBufTestsL();
-			break;
-		default:
-			((CTW32CmdBufStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-			((CTW32CmdBufStep*)iStep)->CloseTMSGraphicsStep();
-			INFO_PRINTF1(_L("Test complete\n"));
-			TestComplete();
-		}
-	((CTW32CmdBufStep*)iStep)->RecordTestResultL();
-	}
-
-/**
-* TTestFunctionPtr pointer-to-function type definition
-*/
-typedef	void (*TTestFunctionPtr)(CWindowGc* aGc, CFbsBitmap* aBitmap, CFbsBitmap* aMask);
-
-
-/**
-* Calls CWindowGc::DrawBitmap(const TPoint &aTopLeft, const CFbsBitmap *aDevice)
-*/
-void CallDrawBitmap1(CWindowGc* aGc, CFbsBitmap* aBitmap, CFbsBitmap* /*aMask*/)
-	{
-	aGc->DrawBitmap(TPoint(0, 0), aBitmap);
-	}
-
-/**
-* Calls CWindowGc::DrawBitmap(const TRect &aDestRect, const CFbsBitmap *aDevice)
-*/
-void CallDrawBitmap2(CWindowGc* aGc, CFbsBitmap* aBitmap, CFbsBitmap* /*aMask*/)
-	{
-	aGc->DrawBitmap(TRect(0, 0, 100, 100), aBitmap);
-	}
-	
-/**
-* Calls CWindowGc::DrawBitmap(const TRect &aDestRect, const CFbsBitmap *aDevice, const TRect &aSourceRect)
-*/
-void CallDrawBitmap3(CWindowGc* aGc, CFbsBitmap* aBitmap, CFbsBitmap* /*aMask*/)
-	{
-	aGc->DrawBitmap(TRect(0, 0, 100, 100), aBitmap, TRect(0, 0, 100, 100));
-	}
-	
-/**
-* Calls CWindowGc::DrawBitmapMasked(const TRect& aDestRect, const CFbsBitmap* aBitmap, const TRect& aSourceRect, const CFbsBitmap* aMaskBitmap, TBool aInvertMask)
-*/
-void CallDrawBitmapMasked(CWindowGc* aGc, CFbsBitmap* aBitmap, CFbsBitmap* aMask)
-	{
-	aGc->DrawBitmapMasked(TRect(0, 0, 100, 100), aBitmap, TRect(0, 0, 100, 100), aMask, EFalse);
-	}
-
-/**
-* Calls CWindowGc::UseBrushPattern(const CFbsBitmap *aDevice)
-*/	
-void CallUseBrushPattern(CWindowGc* aGc, CFbsBitmap* aBitmap, CFbsBitmap* /*aMask*/)
-	{
-	aGc->UseBrushPattern(aBitmap);
-	}
-
-/**
-* Calls CWindowGc::BitBlt(const TPoint &aPos, const CFbsBitmap *aBitmap)
-*/
-void CallBitBlt1(CWindowGc* aGc, CFbsBitmap* aBitmap, CFbsBitmap* /*aMask*/)
-	{
-	aGc->BitBlt(TPoint(0, 0), aBitmap);
-	}
-
-/**
-* Calls CWindowGc::BitBlt(const TPoint &aDestination, const CFbsBitmap *aBitmap, const TRect &aSource)
-*/
-void CallBitBlt2(CWindowGc* aGc, CFbsBitmap* aBitmap, CFbsBitmap* /*aMask*/)
-	{
-	aGc->BitBlt(TPoint(0, 0), aBitmap, TRect(0, 0, 100, 100));
-	}
-
-/**
-* Calls CWindowGc::BitBltMasked(const TPoint& aPoint,const CFbsBitmap* aBitmap,const TRect& aSourceRect,const CFbsBitmap* aMaskBitmap,TBool aInvertMask)
-*/
-void CallBitBltMasked(CWindowGc* aGc, CFbsBitmap* aBitmap, CFbsBitmap* aMask)
-	{
-	aGc->BitBltMasked(TPoint(0, 0), aBitmap, TRect(0, 0, 100, 100), aMask, EFalse);
-	}
-
-/**
-* Calls CWindowGc::AlphaBlendBitmaps(const TPoint& aDestPt, const CFbsBitmap* aSrcBmp, const TRect& aSrcRect, const CFbsBitmap* aAlphaBmp, const TPoint& aAlphaPt)
-*/	
-void CallAlphaBlendBitmaps(CWindowGc* aGc, CFbsBitmap* aBitmap, CFbsBitmap* aMask)
-	{
-	aGc->AlphaBlendBitmaps(TPoint(0, 0), aBitmap, TRect(0, 0, 100, 100), aMask, TPoint(0, 0));
-	}
-
-/**
-* Drawing command function array.
-*/	
-const TTestFunctionPtr KTestFunctions[] =
-		{
-		CallDrawBitmap1,
-		CallDrawBitmap2,
-		CallDrawBitmap3,
-		CallDrawBitmapMasked,
-		CallUseBrushPattern,
-		CallBitBlt1,
-		CallBitBlt2,
-		CallBitBltMasked,
-		CallAlphaBlendBitmaps,
-		};
-
-/**
- * @SYMTestCaseID			GRAPHICS-WSERV-0452
- * @SYMTestCaseDesc			Tests drawing commands with bitmap handles.
- * @SYMDEF					INC111655
- * @SYMFssID				CWindowGc::DrawBitmap() \n 
- * 							CWindowGc::DrawBitmapMasked()\n 
- * 							CWindowGc::UseBrushPattern()\n 
- * 							CWindowGc::BitBlt()\n 
- * 							CWindowGc::AlphaBlendBitmaps()
- * @SYMTestPriority			Critical
- * @SYMTestType				Unit Test
- * @SYMTestPurpose			To ensure drawing commands with bitmap handles are added to the
- 							command buffer successfully when the buffer is full.
- * @SYMTestActions			Fill the command buffer with CWindowGc::Clear() commands in a loop until
- 							the buffer is full, create bitmap(s), then call the draw command and then 
- 							delete the bitmap handle(s). All tests are done in a second thread.
- * @SYMTestExpectedResults	The function should not panic. Without the fix the functions will panic
- 							with WSERV 7. 
- * @SYMTestStatus			Implemented 
- */	
-void CTW32CmdBuf::DoCmdBufTestsL()
-	{
-	CreateSecondThreadAndDoTestL(ECallDrawBitmap1);
-	CreateSecondThreadAndDoTestL(ECallDrawBitmap2);
-	CreateSecondThreadAndDoTestL(ECallDrawBitmap3);
-	CreateSecondThreadAndDoTestL(ECallDrawBitmapMasked);
-	CreateSecondThreadAndDoTestL(ECallUseBrushPattern);	
-	CreateSecondThreadAndDoTestL(ECallBitBlt1);
-	CreateSecondThreadAndDoTestL(ECallBitBlt2);
-	CreateSecondThreadAndDoTestL(ECallBitBltMasked);
-	CreateSecondThreadAndDoTestL(ECallAlphaBlendBitmaps);
-	}
-
-/**
-* Creates a second thread to run the test.
-* 
-* @param aFunctionIndex The drawing function command to be executed. All commands are defined in TestFunctionIndex.
-*/
-void CTW32CmdBuf::CreateSecondThreadAndDoTestL(TTestFunctionIndex aFunctionIndex)
-	{	
-	RThread thread;
-	TBuf<30> threadName(KTW32CmdBufSecondThread);
-	static TInt threadSerialNumber = 0;
-	threadName.AppendNum(++threadSerialNumber);
-	User::LeaveIfError(thread.Create(threadName, TestCmdBufFunction, KDefaultStackSize, KMinHeapSize, 0x4000, &aFunctionIndex));
-	TRequestStatus status;
-	thread.Logon(status);
-	thread.Resume();
-	User::WaitForRequest(status);
-	TEST(thread.ExitType()==EExitKill);
-	TEST(thread.ExitReason() == KErrNone);
-	thread.Close();	
-	}
-
-/**
-* Runs the test in a second thread.
-*
-* @param aFunctionIndex The drawing function command to be executed. All commands are defined in TestFunctionIndex.
-*/
-TInt CTW32CmdBuf::DoTestCmdBufFunctionL(TTestFunctionIndex aFunctionIndex)
-	{
-	RWsSession session;
-	User::LeaveIfError(session.Connect());
-	CleanupClosePushL(session);
-	CWsScreenDevice *device = new(ELeave) CWsScreenDevice(session);
-	CleanupStack::PushL(device);
-	User::LeaveIfError(device->Construct(CTestBase::iScreenNo));
-	CWindowGc* gc;
-	User::LeaveIfError(device->CreateContext(gc));
-	CleanupStack::PushL(gc);
-	RWindowGroup group(session);
-	User::LeaveIfError(group.Construct(1, EFalse));
-	CleanupClosePushL(group);
-	RWindow window(session);
-	User::LeaveIfError(window.Construct(group, 2));
-	CleanupClosePushL(window);
-	window.SetExtent(TPoint(0,0), TSize(200, 200));
-	User::LeaveIfError(window.SetRequiredDisplayMode(EColor64K));
-	window.Activate();	
-	gc->Activate(window);
-	session.SetAutoFlush(EFalse);
-	window.Invalidate();
-	window.BeginRedraw();
-	for(TInt i=KMinTestIterations; i<KMaxTestIterations; ++i)
-		{
-		for(TInt j=0; j<i; ++j)
-			{
-			gc->Clear();
-			}
-
-		CFbsBitmap* bitmap = new(ELeave) CFbsBitmap;
-		CleanupStack::PushL(bitmap);
-		User::LeaveIfError(bitmap->Create(TSize(100, 100), EColor64K));
-		CFbsBitmap* mask = new(ELeave) CFbsBitmap;
-		CleanupStack::PushL(mask);
-		User::LeaveIfError(mask->Create(TSize(100, 100), EColor64K));
-		KTestFunctions[aFunctionIndex](gc, bitmap, mask);
-		CleanupStack::PopAndDestroy(2);
-		session.Flush();	
-		}	
-	window.EndRedraw();	
-	gc->Deactivate();
-	CleanupStack::PopAndDestroy(5);
-	return KErrNone;
-	}
-
-/**
-* Second thread entry function.
-*
-* @param aInfo The parameter(s) passed to the second thread in this case the function index.
-*/
-TInt CTW32CmdBuf::TestCmdBufFunction(TAny* aInfo)
-	{	
-	if(!aInfo)
-		{
-		return KErrArgument;
-		}
-	TTestFunctionIndex functionIndex = *(TTestFunctionIndex*)aInfo;
-	CTrapCleanup *trap = CTrapCleanup::New();
-	__ASSERT_ALWAYS(trap, User::Invariant());
-	
-	TRAPD(err, DoTestCmdBufFunctionL(functionIndex));	
-	
-	delete trap;
-	return err;
-	}
-
-__CONSTRUCT_STEP__(W32CmdBuf)
--- a/windowing/windowserver/tauto/tw32cmdbuf.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef TW32CMDBUF_H
-#define TW32CMDBUF_H
-
-#include <e32std.h>
-#include <w32std.h>
-#include "../tlib/testbase.h"
-#include "AUTO.H"
-#include "TGraphicsHarness.h"
-
-_LIT(KTW32CmdBufSecondThread, "TW32CmdBufSecondThread");
-
-enum TTestFunctionIndex
-	{
-	ECallDrawBitmap1,
-	ECallDrawBitmap2,
-	ECallDrawBitmap3,
-	ECallDrawBitmapMasked,
-	ECallUseBrushPattern,
-	ECallBitBlt1,
-	ECallBitBlt2,
-	ECallBitBltMasked,
-	ECallAlphaBlendBitmaps,
-	};
-
-class CTW32CmdBuf : public CTGraphicsBase
-	{
-public:
-	CTW32CmdBuf(CTestStep* aStep);
-	~CTW32CmdBuf();
-	void ConstructL();
-
-protected:
-	virtual void RunTestCaseL(TInt aCurTestCase);
-private:
-	void DoCmdBufTestsL();
-	void CreateSecondThreadAndDoTestL(TTestFunctionIndex aFunctionIndex);
-	static TInt TestCmdBufFunction(TAny* aInfo);
-	static TInt DoTestCmdBufFunctionL(TTestFunctionIndex aFunctionIndex);
-	};
-
-class CTW32CmdBufStep : public CTGraphicsStep
-	{
-public:
-	CTW32CmdBufStep();
-protected:
-	//from CTGraphicsStep
-	virtual CTGraphicsBase* CreateTestL();
-	};
-
-_LIT(KTW32CmdBufStep,"TW32CmdBuf");
-
-#endif
--- a/windowing/windowserver/tauto/twindowsizecache.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2940 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// General window tests
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "twindowsizecache.h"
-
-CTWindowSizeCacheTest::CTWindowSizeCacheTest(CTestStep* aStep) : CTWsGraphicsBase(aStep)
-    {}
-
-CTWindowSizeCacheTest::~CTWindowSizeCacheTest()
-    {
-    }
-
-void CTWindowSizeCacheTest::ConstructL()
-    {}
-
-
-void CTWindowSizeCacheTest::TestCreateRWindowL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(KErrNone == err);
-
-    if (ETestSizeCacheEnabled == aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-    
-    RWindowGroup wg(rws);
-    err = wg.Construct(0);
-    CleanupClosePushL(wg);
-    TEST(KErrNone == err);
-
-    // w1 State 0
-    RWindow w1(rws);
-    err = w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-    TEST(KErrNone == err);
-
-    // w2 State 0
-    RWindow w2(rws);
-    err = w2.Construct(wg,2);
-    CleanupClosePushL(w2);
-    TEST(KErrNone == err);
-
-    CleanupStack::Pop(2);
-    
-    // w1 State Final
-    w1.Close();
-    // w2 State Final
-    w2.Close();
-    
-    RWindow w3(rws);
-    // w3 State 0
-    err = w3.Construct(wg,1);
-    CleanupClosePushL(w3);
-    TEST(KErrNone == err);
-    
-    CleanupStack::Pop(2);
-
-    // w3 State Final
-    w3.Close();
-    
-    wg.Close();
-
-    RWindowGroup wg2(rws);
-    err = wg2.Construct(0);
-    CleanupClosePushL(wg2);
-    TEST(KErrNone == err);
-    
-    RWindowGroup wg3(rws);
-    err = wg3.Construct(1);
-    CleanupClosePushL(wg3);    
-    TEST(KErrNone == err);
-
-    // w4 State 0
-    RWindow w4(rws);
-    err = w4.Construct(wg2,2);
-    CleanupClosePushL(w4);    
-    TEST(KErrNone == err);
-    
-    // w5 State 0
-    RWindow w5(rws);
-    err = w5.Construct(wg3,3);
-    CleanupClosePushL(w5);    
-    TEST(KErrNone == err);
-    
-    CleanupStack::Pop(5);
-
-    // w4 State Final
-    w4.Close();
-    
-    // w5 State Final
-    // Check nothing bad happens when calling Close more than once on RWindow
-    w5.Close();
-    w5.Close();
-
-    // Check nothing bad happens when calling Close more than once on RWindowGroup
-    wg2.Close();
-    wg2.Close();
-    
-    wg3.Close();
-    
-    // Check nothing bad happens when calling Close more than once on RWsSession
-    rws.Close();
-    rws.Close();
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestCreateRBlankWindowL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(KErrNone == err);
-
-    if (ETestSizeCacheEnabled == aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-    
-    RWindowGroup wg(rws);
-    err = wg.Construct(0);
-    CleanupClosePushL(wg);
-    TEST(KErrNone == err);
-
-    // w1 State 0
-    RBlankWindow w1(rws);
-    err = w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-    TEST(KErrNone == err);
-
-    // w2 State 0
-    RBlankWindow w2(rws);
-    err = w2.Construct(wg,2);
-    CleanupClosePushL(w2);
-    TEST(KErrNone == err);
-
-    CleanupStack::Pop(2);
-
-    // w1 State Final
-    w1.Close();
-    // w2 State Final
-    w2.Close();
-    
-    RBlankWindow w3(rws);
-    // w3 State 0
-    err = w3.Construct(wg,1);
-    CleanupClosePushL(w3);
-    TEST(KErrNone == err);
-    
-    CleanupStack::Pop(2);
-    
-    // w3 State Final
-    w3.Close();
-    
-    wg.Close();
-
-    RWindowGroup wg2(rws);
-    err = wg2.Construct(0);
-    CleanupClosePushL(wg2);
-    TEST(KErrNone == err);
-    
-    RWindowGroup wg3(rws);
-    err = wg3.Construct(1);
-    CleanupClosePushL(wg3);    
-    TEST(KErrNone == err);
-
-    // w4 State 0
-    RBlankWindow w4(rws);
-    err = w4.Construct(wg2,2);
-    CleanupClosePushL(w4);    
-    TEST(KErrNone == err);
-    
-    // w5 State 0
-    RBlankWindow w5(rws);
-    err = w5.Construct(wg3,3);
-    CleanupClosePushL(w5);    
-    TEST(KErrNone == err);
-    
-    CleanupStack::Pop(5);
-
-    // w4 State Final
-    w4.Close();
-    
-    // w5 State Final
-    // Check nothing bad happens when calling Close more than once on RBlankWindow
-    w5.Close();
-    w5.Close();
-
-    wg2.Close();
-    wg3.Close();
-    rws.Close();
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestCreateRBackedUpWindowL(TSizeCacheStatus aEnableWindowSizeCache, TDisplayMode aDisplayMode)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(KErrNone == err);
-
-    if (ETestSizeCacheEnabled == aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-    
-    RWindowGroup wg(rws);
-    err = wg.Construct(0);
-    CleanupClosePushL(wg);
-    TEST(KErrNone == err);
-
-    // w1 State 0
-    RBackedUpWindow w1(rws);
-    err = w1.Construct(wg,aDisplayMode,1);
-    CleanupClosePushL(w1);
-    TEST(KErrNone == err);
-
-    // w2 State 0
-    RBackedUpWindow w2(rws);
-    err = w2.Construct(wg,aDisplayMode,2);
-    CleanupClosePushL(w2);
-    TEST(KErrNone == err);
-
-    CleanupStack::Pop(2);
-
-    // w1 State Final
-    w1.Close();
-    
-    // w2 State Final
-    w2.Close();
-    
-    RBackedUpWindow w3(rws);
-    // w3 State 0
-    err = w3.Construct(wg,aDisplayMode,1);
-    CleanupClosePushL(w3);
-    TEST(KErrNone == err);
-    
-    CleanupStack::Pop(2);
-
-    // w3 State Final
-    w3.Close();
-    
-    wg.Close();
-
-    RWindowGroup wg2(rws);
-    CleanupClosePushL(wg2);
-    err = wg2.Construct(0);
-    TEST(KErrNone == err);
-    
-    RWindowGroup wg3(rws);
-    err = wg3.Construct(1);
-    CleanupClosePushL(wg3);    
-    TEST(KErrNone == err);
-
-    // w4 State 0
-    RBackedUpWindow w4(rws);
-    err = w4.Construct(wg2,aDisplayMode,2);
-    CleanupClosePushL(w4);    
-    TEST(KErrNone == err);
-    
-    // w5 State 0
-    RBackedUpWindow w5(rws);
-    err = w5.Construct(wg3,aDisplayMode,3);
-    CleanupClosePushL(w5);    
-    TEST(KErrNone == err);
-    
-    CleanupStack::Pop(5);
-
-    // w4 State Final
-    w4.Close();
-    
-    // w5 State Final
-    // Check nothing bad happens when calling Close more than once on RBackedUpWindow
-    w5.Close();
-    w5.Close();
-
-    wg2.Close();
-    wg3.Close();
-    rws.Close();
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowNoCacheEntryL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-    
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowNoCacheEntrySetExtentErrL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    TPoint point1 (10101,897);
-    TSize size1 (10001,123);
-    err = w1.SetExtentErr(point1, size1);
-    TEST(KErrNone == err);
-    
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowNoCacheEntrySetSizeErrL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    TSize size1 (10001,123);
-    err = w1.SetSizeErr(size1);
-    TEST(KErrNone == err);
-    
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowNoCacheEntrySetExtentL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    TPoint point1 (10101,897);
-    TSize size1 (10001,123);
-    w1.SetExtent(point1, size1);
-    rws.Flush();
-    
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowNoCacheEntrySetSizeL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-    rws.Flush();
-    
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowNoCacheEntryEnableWindowSizeCacheL()
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    rws.EnableWindowSizeCacheL();
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    // Only the first call to EnableWindowSizeCacheL() should have an effect
-    // All subsequent calls to EnableWindowSizeCacheL() should have no effect
-    rws.EnableWindowSizeCacheL();
-    
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowCacheEntryExistsCacheCleanL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-    rws.Flush();
-    
-    // w1 State 1
-    TSize retSize1 = w1.Size();
-    TEST(retSize1 == size1);
-    
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowCacheEntryExistsCacheCleanSizeL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-    rws.Flush();
-    
-    // w1 State 1
-    TSize retSize1 = w1.Size();
-    TEST(retSize1 == size1);
-    
-    // w1 State 1
-    TSize retSize2 = w1.Size();
-    TEST(retSize2 == size1);
-
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowCacheEntryExistsCacheCleanEnableWindowSizeCacheL()
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    rws.EnableWindowSizeCacheL();
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-    rws.Flush();
-    
-    // w1 State 1
-    TSize retSize1 = w1.Size();
-    TEST(retSize1 == size1);
-    
-    // w1 State 1
-    // Only the first call to EnableWindowSizeCacheL() should have an effect
-    // All subsequent calls to EnableWindowSizeCacheL() should have no effect
-    rws.EnableWindowSizeCacheL();
-
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowCacheEntryExistsCacheCleanEnableWindowSizeCacheLSizeL()
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    rws.EnableWindowSizeCacheL();
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-    rws.Flush();
-    
-    // w1 State 1
-    TSize retSize1 = w1.Size();
-    TEST(retSize1 == size1);
-    
-    // w1 State 1
-    // Only the first call to EnableWindowSizeCacheL() should have an effect
-    // All subsequent calls to EnableWindowSizeCacheL() should have no effect
-    rws.EnableWindowSizeCacheL();
-
-    // w1 State 1
-    TSize retSize2 = w1.Size();
-    TEST(retSize2 == size1);
-
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowCacheEntryExistsCacheDirtySetSizeL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-    rws.Flush();
-    
-    // w1 State 1
-    TSize retSize1 = w1.Size();
-    TEST(retSize1 == size1);
-    
-    // w1 State 2
-    TSize size2 (20002,223);
-    w1.SetSize(size2); 
-    rws.Flush();
-
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowCacheEntryExistsCacheDirtySetExtentL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-    rws.Flush();
-    
-    // w1 State 1
-    TSize retSize1 = w1.Size();
-    TEST(retSize1 == size1);
-    
-    // w1 State 2
-    TPoint point2 (20202,223);
-    TSize size2 (20002,223);
-    w1.SetExtent(point2, size2); 
-    rws.Flush();
-
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowCacheEntryExistsCacheDirtySetSizeErrL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-    rws.Flush();
-    
-    // w1 State 1
-    TSize retSize1 = w1.Size();
-    TEST(retSize1 == size1);
-    
-    // w1 State 2
-    TSize size2 (20002,223);
-    err = w1.SetSizeErr(size2); 
-    TEST(KErrNone == err);
-
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowCacheEntryExistsCacheDirtySetExtentErrL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-    rws.Flush();
-    
-    // w1 State 1
-    TSize retSize1 = w1.Size();
-    TEST(retSize1 == size1);
-    
-    // w1 State 2
-    TPoint point2 (20202,223);
-    TSize size2 (20002,223);
-    err = w1.SetExtentErr(point2, size2); 
-    TEST(KErrNone == err);
-
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowCacheEntryExistsCacheDirtySetSizeTwiceL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-    rws.Flush();
-    
-    // w1 State 1
-    TSize retSize1 = w1.Size();
-    TEST(retSize1 == size1);
-    
-    // w1 State 2
-    TSize size2 (20002,223);
-    w1.SetSize(size2); 
-
-    TSize size3 (30003,323);
-    // w1 State 2
-    w1.SetSize(size3); 
-    rws.Flush();
-
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowCacheEntryExistsCacheDirtySetSizeSetExtentL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-    rws.Flush();
-    
-    // w1 State 1
-    TSize retSize1 = w1.Size();
-    TEST(retSize1 == size1);
-    
-    // w1 State 2
-    TSize size2 (20002,223);
-    w1.SetSize(size2); 
-
-    // w1 State 2
-    TPoint point3 (30303,232);
-    TSize size3 (30003,323);
-    w1.SetExtent(point3, size3); 
-    rws.Flush();
-
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowCacheEntryExistsCacheDirtySetSizeSetSizeErrL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-    rws.Flush();
-    
-    // w1 State 1
-    TSize retSize1 = w1.Size();
-    TEST(retSize1 == size1);
-    
-    // w1 State 2
-    TSize size2 (20002,223);
-    w1.SetSize(size2); 
-
-    // w1 State 2
-    TSize size3 (30003,323);
-    err = w1.SetSizeErr(size3);
-    TEST(KErrNone == err);
-
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowCacheEntryExistsCacheDirtySetSizeSetExtentErrL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-    rws.Flush();
-    
-    // w1 State 1
-    TSize retSize1 = w1.Size();
-    TEST(retSize1 == size1);
-    
-    // w1 State 2
-    TSize size2 (20002,223);
-    w1.SetSize(size2); 
-
-    // w1 State 2
-    TPoint point3 (30303,232);
-    TSize size3 (30003,323);
-    err = w1.SetExtentErr(point3, size3); 
-    TEST(KErrNone == err);
-
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowCacheEntryExistsCacheDirtySetSizeEnableWindowSizeCacheL()
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    rws.EnableWindowSizeCacheL();
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-    rws.Flush();
-    
-    // w1 State 1
-    TSize retSize1 = w1.Size();
-    TEST(retSize1 == size1);
-    
-    // w1 State 2
-    TSize size2 (20002,223);
-    w1.SetSize(size2); 
-
-    // Only the first call to EnableWindowSizeCacheL() should have an effect
-    // All subsequent calls to EnableWindowSizeCacheL() should have no effect
-    rws.EnableWindowSizeCacheL();
-
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-//-------------------------------------------------------------------------------------------
-void CTWindowSizeCacheTest::TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-    rws.Flush();
-    
-    // w1 State 1
-    TSize retSize1 = w1.Size();
-    TEST(retSize1 == size1);
-    
-    // w1 State 2
-    TSize size2 (20002,223);
-    w1.SetSize(size2); 
-    rws.Flush();
-
-    // w1 State 1
-    TSize retSize2 = w1.Size();
-    TEST(retSize2 == size2);
-
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowCacheEntryExistsCacheDirtyToCleanSetExtentL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-    rws.Flush();
-    
-    // w1 State 1
-    TSize retSize1 = w1.Size();
-    TEST(retSize1 == size1);
-    
-    // w1 State 2
-    TPoint point2 (20202,223);
-    TSize size2 (20002,223);
-    w1.SetExtent(point2, size2); 
-    rws.Flush();
-
-    // w1 State 1
-    TSize retSize2 = w1.Size();
-    TEST(retSize2 == size2);
-
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeErrL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-    rws.Flush();
-    
-    // w1 State 1
-    TSize retSize1 = w1.Size();
-    TEST(retSize1 == size1);
-    
-    // w1 State 2
-    TSize size2 (20002,223);
-    err = w1.SetSizeErr(size2); 
-    TEST(KErrNone == err);
-
-    // w1 State 1
-    TSize retSize2 = w1.Size();
-    TEST(retSize2 == size2);
-
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowCacheEntryExistsCacheDirtyToCleanSetExtentErrL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-    rws.Flush();
-    
-    // w1 State 1
-    TSize retSize1 = w1.Size();
-    TEST(retSize1 == size1);
-    
-    // w1 State 2
-    TPoint point2 (20202,223);
-    TSize size2 (20002,223);
-    err = w1.SetExtentErr(point2, size2); 
-    TEST(KErrNone == err);
-
-    // w1 State 1
-    TSize retSize2 = w1.Size();
-    TEST(retSize2 == size2);
-
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeTwiceL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-    rws.Flush();
-    
-    // w1 State 1
-    TSize retSize1 = w1.Size();
-    TEST(retSize1 == size1);
-    
-    // w1 State 2
-    TSize size2 (20002,223);
-    w1.SetSize(size2); 
-
-    TSize size3 (30003,323);
-    // w1 State 2
-    w1.SetSize(size3); 
-    rws.Flush();
-
-    // w1 State 1
-    TSize retSize2 = w1.Size();
-    TEST(retSize2 == size3);
-
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeSetExtentL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-    rws.Flush();
-    
-    // w1 State 1
-    TSize retSize1 = w1.Size();
-    TEST(retSize1 == size1);
-    
-    // w1 State 2
-    TSize size2 (20002,223);
-    w1.SetSize(size2); 
-
-    // w1 State 2
-    TPoint point3 (30303,232);
-    TSize size3 (30003,323);
-    w1.SetExtent(point3, size3); 
-    rws.Flush();
-
-    // w1 State 1
-    TSize retSize2 = w1.Size();
-    TEST(retSize2 == size3);
-
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeSetSizeErrL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-    rws.Flush();
-    
-    // w1 State 1
-    TSize retSize1 = w1.Size();
-    TEST(retSize1 == size1);
-    
-    // w1 State 2
-    TSize size2 (20002,223);
-    w1.SetSize(size2); 
-
-    // w1 State 2
-    TSize size3 (30003,323);
-    err = w1.SetSizeErr(size3);
-    TEST(KErrNone == err);
-
-    // w1 State 1
-    TSize retSize2 = w1.Size();
-    TEST(retSize2 == size3);
-
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeSetExtentErrL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-    rws.Flush();
-    
-    // w1 State 1
-    TSize retSize1 = w1.Size();
-    TEST(retSize1 == size1);
-    
-    // w1 State 2
-    TSize size2 (20002,223);
-    w1.SetSize(size2); 
-
-    // w1 State 2
-    TPoint point3 (30303,232);
-    TSize size3 (30003,323);
-    err = w1.SetExtentErr(point3, size3); 
-    TEST(KErrNone == err);
-
-    // w1 State 1
-    TSize retSize2 = w1.Size();
-    TEST(retSize2 == size3);
-
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-void CTWindowSizeCacheTest::TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeEnableWindowSizeCacheL()
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    rws.EnableWindowSizeCacheL();
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-
-    // w1 State 0
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-    rws.Flush();
-    
-    // w1 State 1
-    TSize retSize1 = w1.Size();
-    TEST(retSize1 == size1);
-    
-    // w1 State 2
-    TSize size2 (20002,223);
-    w1.SetSize(size2); 
-
-    // Only the first call to EnableWindowSizeCacheL() should have an effect
-    // All subsequent calls to EnableWindowSizeCacheL() should have no effect
-    rws.EnableWindowSizeCacheL();
-
-    // w1 State 1
-    TSize retSize2 = w1.Size();
-    TEST(retSize2 == size2);
-
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-//------------------------------------------------------------------------------------------
-
-void CTWindowSizeCacheTest::TestRBlankWindowSetSizeSetExtentL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    err = wg.Construct(0);
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    // w1 State 0
-    RBlankWindow w1(rws);
-    err = w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-    TEST(err==KErrNone);
-
-    // w1 State 0
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-    rws.Flush();
-    
-    // w1 State 1
-    TSize retSize1 = w1.Size();
-    TEST(retSize1 == size1);
-    
-    // w1 State 2
-    TSize size2 (20002,223);
-    w1.SetSize(size2); 
-
-    // w1 State 2
-    TPoint point3 (30303,232);
-    TSize size3 (30003,323);
-    w1.SetExtent(point3, size3);
-    rws.Flush();
-
-    // w1 State 1
-    TSize retSize2 = w1.Size();
-    TEST(retSize2 == size3);
-
-    // w1 State 2
-    TSize size4 (40004,423);
-    w1.SetSize(size4);
-    
-    // w1 State 1
-    TSize retSize3 = w1.Size();
-    TEST(retSize3 == size4);
-
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-//------------------------------------------------------------------------------------------
-
-void CTWindowSizeCacheTest::TestRBackedUpWindowSetSizeErrSetExtentErrL(TSizeCacheStatus aEnableWindowSizeCache)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    err = wg.Construct(0);
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    // w1 State 0
-    RBlankWindow w1(rws);
-    err = w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-    TEST(err==KErrNone);
-
-    // w1 State 0
-    TSize size1 (10001,123);
-    err = w1.SetSizeErr(size1);
-    TEST(err==KErrNone);
-    
-    // w1 State 1
-    TSize retSize1 = w1.Size();
-    TEST(retSize1 == size1);
-    
-    // w1 State 2
-    TSize size2 (20002,223);
-    err = w1.SetSizeErr(size2); 
-    TEST(err==KErrNone);
-
-    // w1 State 2
-    TPoint point3 (30303,232);
-    TSize size3 (30003,323);
-    err = w1.SetExtentErr(point3, size3);
-    TEST(err==KErrNone);
-
-    // w1 State 1
-    TSize retSize2 = w1.Size();
-    TEST(retSize2 == size3);
-
-    // w1 State 2
-    TSize size4 (40004,423);
-    err = w1.SetSizeErr(size4);
-    TEST(err==KErrNone);
-    
-    // w1 State 1
-    TSize retSize3 = w1.Size();
-    TEST(retSize3 == size4);
-
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-//------------------------------------------------------------------------------------------
-
-TUint64 CTWindowSizeCacheTest::TestRWindowSizePerformanceL(TSizeCacheStatus aEnableWindowSizeCache, TUint aIterations)
-    {
-    TUint64 timeDeltaMicroSeconds = 0;
-    
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    TEST(KErrNone == err);
-    CleanupClosePushL(rws);
-
-    if (ETestSizeCacheEnabled == aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    err = wg.Construct(0);
-    TEST(KErrNone == err);
-    CleanupClosePushL(wg);
-
-    // w1 State 0
-    RWindow w1(rws);
-    err = w1.Construct(wg,1);
-    TEST(KErrNone == err);
-    CleanupClosePushL(w1);
-    
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-
-    TTime start;
-    TTime end;
-    start.UniversalTime();
-    for (TUint iter = 0; iter < aIterations; ++iter)
-        {
-        // w1 State 1
-        TSize retSize1 = w1.Size();
-        TEST(retSize1 == size1);
-        }
-    end.UniversalTime();
-
-    TTimeIntervalMicroSeconds delta = end.MicroSecondsFrom(start);
-    timeDeltaMicroSeconds = delta.Int64();
-    INFO_PRINTF4(_L("TestRWindowSizePerformanceL - WindowSizeCacheEnabled %d, Iterations %d, Microseconds %Ld"), aEnableWindowSizeCache, aIterations, timeDeltaMicroSeconds);
-    
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-
-    CleanupStack::Pop();
-    wg.Close();
-
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    return timeDeltaMicroSeconds;
-    }
-
-
-//------------------------------------------------------------------------------------------
-/*
-Sets the random seed used by CTWindowSizeCacheTest::NextRandom.
- */
-void CTWindowSizeCacheTest::SetRandomSeed(TInt64 aSeed)
-    {
-    INFO_PRINTF2(_L("Random Seed - %d"), aSeed);
-    iSeed = aSeed;
-    }
-
-/*
-Performs an action on RWindow or RWsSession as specified by TRWindowAction aAction.
-When the size of the window is changed, aExpectedSize is changed to the size we expect the window to be the next time RWindow::Size is called.
-When RWindow::Size is called, we check the size returned matches aExpectedSize.
-If aAction requests RWsSession::EnableWindowSizeCache, we call this if TSizeCacheStatus allows this.
-
-This function was designed for use with random stress tests, with a pseudo-random sequence driving TRWindowAction.  
- */
-void CTWindowSizeCacheTest::RWindowPerformAction(TRWindowAction aAction, TSizeCacheStatus aEnableWindowSizeCache, RWsSession& aWs, RWindow& aWindow, TSize& aExpectedSize)
-    {
-    switch (aAction)
-        {
-        case ESetExtent :
-            {
-            TPoint point(NextRandom(), NextRandom());
-            aExpectedSize.iHeight = NextRandom();
-            aExpectedSize.iWidth = NextRandom();
-            aWindow.SetExtent(point, aExpectedSize);
-            aExpectedSize.iHeight = (aExpectedSize.iHeight < 0) ? 0 : aExpectedSize.iHeight;
-            aExpectedSize.iWidth = (aExpectedSize.iWidth < 0) ? 0 : aExpectedSize.iWidth;
-            }
-            break;
-        case ESetExtentErr :
-            {
-            TPoint point(NextRandom(), NextRandom());
-            aExpectedSize.iHeight = NextRandom();
-            aExpectedSize.iWidth = NextRandom();
-            TInt err = aWindow.SetExtentErr(point, aExpectedSize);
-            TEST(KErrNone == err);
-            aExpectedSize.iHeight = (aExpectedSize.iHeight < 0) ? 0 : aExpectedSize.iHeight;
-            aExpectedSize.iWidth = (aExpectedSize.iWidth < 0) ? 0 : aExpectedSize.iWidth;
-            }
-            break;
-        case ESetSize :
-            {
-            aExpectedSize.iHeight = NextRandom();
-            aExpectedSize.iWidth = NextRandom();
-            aWindow.SetSize(aExpectedSize);
-            aExpectedSize.iHeight = (aExpectedSize.iHeight < 0) ? 0 : aExpectedSize.iHeight;
-            aExpectedSize.iWidth = (aExpectedSize.iWidth < 0) ? 0 : aExpectedSize.iWidth;
-            }
-            break;
-        case ESetSizeErr :
-            {
-            aExpectedSize.iHeight = NextRandom();
-            aExpectedSize.iWidth = NextRandom();
-            TInt err = aWindow.SetSizeErr(aExpectedSize);
-            TEST(KErrNone == err);
-            aExpectedSize.iHeight = (aExpectedSize.iHeight < 0) ? 0 : aExpectedSize.iHeight;
-            aExpectedSize.iWidth = (aExpectedSize.iWidth < 0) ? 0 : aExpectedSize.iWidth;
-            }
-            break;
-        case ECheckSize :
-            {
-            TSize retSize1 = aWindow.Size();
-            TEST(retSize1 == aExpectedSize);
-            }
-            break;
-        case EFlushSession :
-            {
-            aWs.Flush();
-            }
-            break;
-        case EEnableWindowSizeCache :
-            {
-            if (ETestSizeCacheEnabled == aEnableWindowSizeCache)
-                {
-                aWs.EnableWindowSizeCacheL();
-                }
-            }
-            break;
-        default :
-            break;
-        }
-    }
-
-void CTWindowSizeCacheTest::TestRandomisedStressL(TSizeCacheStatus aEnableWindowSizeCache, TUint aIterations)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    TEST(KErrNone == err);
-    CleanupClosePushL(rws);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    err = wg.Construct(0);
-    TEST(KErrNone == err);
-    CleanupClosePushL(wg);
-
-    // w1 State 0
-    RWindow w1(rws);
-    err = w1.Construct(wg,1);
-    TEST(KErrNone == err);
-    CleanupClosePushL(w1);
-    
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-
-    for (TUint iter = 0; iter < aIterations; ++iter)
-        {
-        TRWindowAction action = static_cast<TRWindowAction>(NextRandom(EMaxAction));
-        RWindowPerformAction(action, aEnableWindowSizeCache, rws, w1, size1);
-        }
-    
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-
-    CleanupStack::Pop();
-    rws.Close();
-    __UHEAP_MARKEND;
-    }
-
-/*
-TCleanupOperation for a window pool, implemented as RPointerArray<RWindow>.
- */
-void CTWindowSizeCacheTest::CleanupWindowPool(TAny* aPtr)
-    {
-    RPointerArray<RWindow> windowPool = *(static_cast<RPointerArray<RWindow>*>(aPtr));
-    const TUint poolSize = windowPool.Count();
-    // Note: ResetAndDestroy deletes referenced objects, so no need to delete items in loop
-    for (TUint iter = 0; iter < poolSize; ++iter)
-        {
-        windowPool[iter]->Close();
-        }
-    windowPool.ResetAndDestroy();
-    }
-
-void CTWindowSizeCacheTest::TestRandomisedStressMultiSessionL(TSizeCacheStatus aEnableWindowSizeCache, TUint aIterations)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws1;
-    TInt err = rws1.Connect();
-    TEST(KErrNone == err);
-    CleanupClosePushL(rws1);
-
-    // Multiple sessions in one thread
-    RWsSession rws2;
-    err = rws2.Connect();
-    TEST(KErrNone == err);
-    CleanupClosePushL(rws2);
-    
-    RWindowGroup rws1_wg1(rws1);
-    err = rws1_wg1.Construct(0);
-    CleanupClosePushL(rws1_wg1);
-    TEST(KErrNone == err);
-
-    RWindowGroup rws2_wg1(rws2);
-    err = rws2_wg1.Construct(0);
-    CleanupClosePushL(rws2_wg1);
-    TEST(KErrNone == err);
-
-    // Multiple window groups in one session
-    RWindowGroup rws2_wg2(rws2);
-    err = rws2_wg2.Construct(1);
-    CleanupClosePushL(rws2_wg2);
-    TEST(KErrNone == err);
-    
-    // Window pool for all windows owned by session rws1
-    RPointerArray<RWindow> rws1_windowPool;
-    CleanupStack::PushL(TCleanupItem(CleanupWindowPool,&rws1_windowPool));
-    // Each window in window pool has a corresponding expected size at corresponding array index
-    RArray<TSize> rws1_expectedSizePool;
-    CleanupClosePushL(rws1_expectedSizePool);
-
-    // Window pool for all windows owned by session rws2
-    RPointerArray<RWindow> rws2_windowPool;
-    CleanupStack::PushL(TCleanupItem(CleanupWindowPool,&rws2_windowPool));
-    // Each window in window pool has a corresponding expected size at corresponding array index
-    RArray<TSize> rws2_expectedSizePool;
-    CleanupClosePushL(rws2_expectedSizePool);
-    
-    // Populate window pool
-    const TUint KWindowCount_rws1_wg1 = 50;
-    const TUint KWindowCount_rws2_wg1 = 50;
-    const TUint KWindowCount_rws2_wg2 = 50;
-    
-    // Windows for session 1 belonging to rws1_wg1
-    // Many windows - siblings
-    for (TUint iter = 0; iter < KWindowCount_rws1_wg1; ++iter)
-        {
-        RWindow* win = new (ELeave) RWindow(rws1);
-        CleanupStack::PushL(win);
-        TInt err = win->Construct(rws1_wg1,iter+1);
-        TEST(KErrNone == err);
-        rws1_windowPool.AppendL(win);
-        CleanupStack::Pop(win);
-        TSize expectedSize (NextRandom(),NextRandom());
-        win->SetSize(expectedSize);
-        // Wserv flattens size to zero
-        expectedSize.iHeight = (expectedSize.iHeight < 0) ? 0 : expectedSize.iHeight;
-        expectedSize.iWidth = (expectedSize.iWidth < 0) ? 0 : expectedSize.iWidth;
-        rws1_expectedSizePool.AppendL(expectedSize);
-        TSize retSize1 = win->Size();
-        TEST(retSize1 == expectedSize);
-        }
-
-    // Windows for session 2 belonging to rws2_wg1
-    // Many windows - siblings
-    for (TUint iter = 0; iter < KWindowCount_rws2_wg1; ++iter)
-        {
-        RWindow* win = new (ELeave) RWindow(rws2);
-        CleanupStack::PushL(win);
-        TInt err = win->Construct(rws2_wg1,iter+2);
-        TEST(KErrNone == err);
-        rws2_windowPool.AppendL(win);
-        CleanupStack::Pop();
-        TSize expectedSize (NextRandom(),NextRandom());
-        win->SetSize(expectedSize);
-        // Wserv flattens size to zero
-        expectedSize.iHeight = (expectedSize.iHeight < 0) ? 0 : expectedSize.iHeight;
-        expectedSize.iWidth = (expectedSize.iWidth < 0) ? 0 : expectedSize.iWidth;
-        rws2_expectedSizePool.AppendL(expectedSize);
-        TSize retSize1 = win->Size();
-        TEST(retSize1 == expectedSize);
-        }
-    
-    // Windows for session 2 belonging to rws2_wg2
-    // Many windows - children
-    RWindowTreeNode parent = rws2_wg2; 
-    for (TUint iter = 0; iter < KWindowCount_rws2_wg2; ++iter)
-        {
-        RWindow* win = new (ELeave) RWindow(rws2);
-        CleanupStack::PushL(win);
-        TInt err = win->Construct(parent,KWindowCount_rws2_wg1+iter+2);
-        TEST(KErrNone == err);
-        parent = *win;
-        rws2_windowPool.AppendL(win);
-        CleanupStack::Pop();
-        TSize expectedSize (NextRandom(),NextRandom());
-        win->SetSize(expectedSize);
-        // Wserv flattens size to zero
-        expectedSize.iHeight = (expectedSize.iHeight < 0) ? 0 : expectedSize.iHeight;
-        expectedSize.iWidth = (expectedSize.iWidth < 0) ? 0 : expectedSize.iWidth;
-        rws2_expectedSizePool.AppendL(expectedSize);
-        TSize retSize1 = win->Size();
-        TEST(retSize1 == expectedSize);
-        }
-
-    // Stress system by performing actions on windows
-    for (TUint iter = 0; iter < aIterations; ++iter)
-        {
-        TRWindowAction action = static_cast<TRWindowAction>(NextRandom(EMaxAction));
-        TUint32 windowPool = NextRandom(2);
-        switch (windowPool)
-            {
-            case 0 :
-                {
-                TUint32 target = NextRandom(rws1_windowPool.Count());
-                RWindowPerformAction(action, aEnableWindowSizeCache, rws1, *(rws1_windowPool[target]) , rws1_expectedSizePool[target]);
-                }
-                break;
-            case 1 :
-                {
-                TUint32 target = NextRandom(rws2_windowPool.Count());
-                RWindowPerformAction(action, aEnableWindowSizeCache, rws2, *(rws2_windowPool[target]) , rws2_expectedSizePool[target]);
-                }
-                break;
-            default :
-                User::Invariant();
-            }
-        }
-     
-
-    // Cleanup afterwards
-    CleanupStack::Pop(9);
-
-    CleanupWindowPool(&rws1_windowPool);
-    rws1_expectedSizePool.Close();
-    rws1_wg1.Close();
-    rws1.Close();
-
-    CleanupWindowPool(&rws2_windowPool);
-    rws2_expectedSizePool.Close();
-    rws2_wg1.Close();
-    rws2_wg2.Close();
-    rws2.Close();
-    }
-
-void CTWindowSizeCacheTest::TestRandomisedStressCacheEntryVolumeL(TSizeCacheStatus aEnableWindowSizeCache, TUint aIterations, TUint aWindowPoolSize)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws1;
-    TInt err = rws1.Connect();
-    TEST(KErrNone == err);
-    CleanupClosePushL(rws1);
-
-    if (aEnableWindowSizeCache)
-        {
-        rws1.EnableWindowSizeCacheL();
-        }
-  
-    RWindowGroup rws1_wg1(rws1);
-    err = rws1_wg1.Construct(0);
-    TEST(KErrNone == err);
-    CleanupClosePushL(rws1_wg1);
-    
-    RPointerArray<RWindow> windowPool;
-    CleanupStack::PushL(TCleanupItem(CleanupWindowPool,&windowPool));
-    // Each window in window pool has a corresponding expected size at corresponding array index
-    RArray<TSize> expectedSizePool;
-    CleanupClosePushL(expectedSizePool);
-    
-    // Populate window pool
-    for (TUint iter = 0; iter < aWindowPoolSize; ++iter)
-        {
-        RWindow* win = new (ELeave) RWindow(rws1);
-        CleanupStack::PushL(win);
-        TInt err = win->Construct(rws1_wg1,iter+1);
-        TEST(KErrNone == err);
-        windowPool.AppendL(win);
-        CleanupStack::Pop(win);
-        
-        TSize expectedSize (NextRandom(),NextRandom());
-        win->SetSize(expectedSize);
-        // Wserv flattens size to zero
-        expectedSize.iHeight = (expectedSize.iHeight < 0) ? 0 : expectedSize.iHeight;
-        expectedSize.iWidth = (expectedSize.iWidth < 0) ? 0 : expectedSize.iWidth;
-        expectedSizePool.AppendL(expectedSize);
-        TSize retSize1 = win->Size();
-        TEST(retSize1 == expectedSize);
-        }
-
-    // Stress system by performing actions on windows
-    for (TUint iter = 0; iter < aIterations; ++iter)
-        {
-        TRWindowAction action = static_cast<TRWindowAction>(NextRandom(EMaxAction));
-        TUint32 target = NextRandom(aWindowPoolSize);
-        RWindowPerformAction(action, aEnableWindowSizeCache, rws1, *(windowPool[target]), expectedSizePool[target]);
-        }
-
-    // Cleanup afterwards
-    CleanupStack::Pop(4);
-
-    CleanupWindowPool(&windowPool);
-    expectedSizePool.Close();
-    rws1_wg1.Close();
-    rws1.Close();
-    
-    __UHEAP_MARKEND;
-    }
-
-//------------------------------------------------------------------------------------------
-
-void CTWindowSizeCacheTest::TestStressEnableWindowSizeCacheL(TUint aIterations)
-    {
-    __UHEAP_MARK;
-    // w* State Initial
-    RWsSession rws;
-    TInt err = rws.Connect();
-    CleanupClosePushL(rws);
-    TEST(err==KErrNone);
-
-    // Only the first call to EnableWindowSizeCacheL() should have an effect
-    // All subsequent calls to EnableWindowSizeCacheL() should have no effect
-    for (TUint iter = 0; iter < aIterations; iter++)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-
-    RWindowGroup wg(rws);
-    wg.Construct(0);
-    CleanupClosePushL(rws);
-
-    // w1 State 0
-    RWindow w1(rws);
-    w1.Construct(wg,1);
-    CleanupClosePushL(w1);
-    
-    TSize size1 (10001,123);
-    w1.SetSize(size1);
-
-    // w1 State 1
-    TSize retSize1 = w1.Size();
-    TEST(retSize1 == size1);
-
-    // w1 State 2
-    TSize size2 (20002,223);
-    w1.SetSize(size2); 
-
-    // w1 State 2
-    // Only the first call to EnableWindowSizeCacheL() should have an effect
-    // All subsequent calls to EnableWindowSizeCacheL() should have no effect
-    for (TUint iter = 0; iter < aIterations; iter++)
-        {
-        rws.EnableWindowSizeCacheL();
-        }
-   
-    // w1 State 1
-    TSize retSize2 = w1.Size();
-    TEST(retSize2 == size2);
-
-    // w1 State Final
-    CleanupStack::Pop();
-    w1.Close();
-    
-    CleanupStack::Pop();
-    wg.Close();
-    
-    CleanupStack::Pop();
-    rws.Close();
-
-    __UHEAP_MARKEND;
-    }
-
-/*
-Tests 701-706 focus on window creation operating correctly, alternating use of the window size cache.
-Tests 707-710 aim to cover state transitions for cache entries in the window size cache for RWindow.
-Tests 711-712 performs basic verification of size related functionality for RBlankWindow and RBackedUpWindow.
-Test 713 focusses on ensuring a performance gain is achieved with window size caching enabled.
-Tests 714-720 aim to stress the window size cache with pseudo-random sequences of RWindow size related functions.
-
-The states in the state machine model used for testing the RWindow size cache in tests 707-710 is as follows:
-
-State: Initial
-    Window not yet in existence
-   
-State 0: No Cache entry
-    Window created, window size cache does not contain an entry for this window
-    
-State 1: Cache entry exists, cache clean
-    Window created, window size cache exists, contains a valid size
-    
-State 2: Cache entry exists, cache dirty
-    Window created, window size cache exists, does not contain a valid size
-    
-State: Final
-    Window destroyed
- */
-void CTWindowSizeCacheTest::RunTestCaseL(TInt /*aCurTestCase*/)
-    {
-    _LIT(KTest1,"Create RWindow, window size cache off");
-    _LIT(KTest2,"Create RWindow, window size cache on");
-    _LIT(KTest3,"Create RBlankWindow, window size cache off");
-    _LIT(KTest4,"Create RBlankWindow, window size cache on");
-    _LIT(KTest5,"Create RBackedUpWindow, window size cache off");
-    _LIT(KTest6,"Create RBackedUpWindow, window size cache on");
-    
-    _LIT(KTest7,"RWindow - No cache entry");
-    _LIT(KTest8,"RWindow - Cache entry exists, cache clean");
-    _LIT(KTest9,"RWindow - Cache entry exists, cache dirty");
-    _LIT(KTest10,"RWindow - Cache entry exists, cache dirty->clean");
-   
-    _LIT(KTest11,"RBlankWindow size cache");
-    _LIT(KTest12,"RBackedUpWindow size cache");
-
-    _LIT(KTest13,"RWindow Size Performance");
-    _LIT(KTest14,"RWindow Randomised Stress window size cache off");
-    _LIT(KTest15,"RWindow Randomised Stress window size cache on");
-    _LIT(KTest16,"RWindow Randomised Stress MultiSession cache off");
-    _LIT(KTest17,"RWindow Randomised Stress MultiSession cache on");
-    _LIT(KTest18,"RWindow Randomised Stress Entry Volume cache off");
-    _LIT(KTest19,"RWindow Randomised Stress Entry Volume cache on");
-    _LIT(KTest20,"RWsSession stress EnableWindowSizeCacheL");
-
-    const TDisplayMode displayMode = EColor16MAP;
-    const TUint KPerformanceIterations = 50000;
-    const TUint KStressTestIterations = 3000;
-    const TUint KStressWindowPoolSize = 100;
-    
-    ((CTWindowSizeCacheTestStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-
-    switch(++iTest->iState)
-        {
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0701
-
-@SYMDEF             DevCR BBRE-7UWGHL
-
-@SYMTestCaseDesc    Test creation and destruction for instances of RWindow, window size cache off 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates an RWsSession, some RWindowGroup and RWindow instances, and closes them.
-
-@SYMTestExpectedResults Window objects created successfully, no memory leaks.
-*/
-        case 1:
-            ((CTWindowSizeCacheTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0701"));
-            iTest->LogSubTest(KTest1);
-            TestCreateRWindowL(ETestSizeCacheNotEnabled);
-            break;
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0702
-
-@SYMDEF             DevCR BBRE-7UWGHL
-
-@SYMTestCaseDesc    Test creation and destruction for instances of RWindow, window size cache on 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates an RWsSession, enables window size cache, creates some RWindowGroup and RWindow instances, and closes them.
-
-@SYMTestExpectedResults Window objects created successfully, no memory leaks.
-*/
-        case 2:
-            ((CTWindowSizeCacheTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0702"));
-            iTest->LogSubTest(KTest2);
-            TestCreateRWindowL(ETestSizeCacheEnabled);
-            break;
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0703
-
-@SYMDEF             DevCR BBRE-7UWGHL
-
-@SYMTestCaseDesc    Test creation and destruction for instances of RBlankWindow, window size cache off 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates an RWsSession, creates some RWindowGroup and RBlankWindow instances, and closes them.
-
-@SYMTestExpectedResults Window objects created successfully, no memory leaks.
-*/
-        case 3:
-            ((CTWindowSizeCacheTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0703"));
-            iTest->LogSubTest(KTest3);
-            TestCreateRBlankWindowL(ETestSizeCacheNotEnabled);
-            break;
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0704
-
-@SYMDEF             DevCR BBRE-7UWGHL
-
-@SYMTestCaseDesc    Test creation and destruction for instances of RBlankWindow, window size cache on 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates an RWsSession, enables window size cache, creates some RWindowGroup and RBlankWindow instances, and closes them.
-
-@SYMTestExpectedResults Window objects created successfully, no memory leaks.
-*/
-        case 4:
-            ((CTWindowSizeCacheTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0704"));
-            iTest->LogSubTest(KTest4);
-            TestCreateRBlankWindowL(ETestSizeCacheEnabled);
-            break;
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0705
-
-@SYMDEF             DevCR BBRE-7UWGHL
-
-@SYMTestCaseDesc    Test creation and destruction for instances of RBackedUpWindow, window size cache off
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates an RWsSession, creates some RWindowGroup and RBackedUpWindow instances, and closes them.
-
-@SYMTestExpectedResults Window objects created successfully, no memory leaks.
-*/
-        case 5:
-            ((CTWindowSizeCacheTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0705"));
-            iTest->LogSubTest(KTest5);
-            TestCreateRBackedUpWindowL(ETestSizeCacheNotEnabled, displayMode);
-            break;
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0706
-
-@SYMDEF             DevCR BBRE-7UWGHL
-
-@SYMTestCaseDesc    Test creation and destruction for instances of RBackedUpWindow, window size cache on 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates an RWsSession, enables window size cache, creates some RWindowGroup and RBackedUpWindow instances, and closes them.
-
-@SYMTestExpectedResults Window objects created successfully, no memory leaks.
-*/
-        case 6:
-            ((CTWindowSizeCacheTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0706"));
-            iTest->LogSubTest(KTest6);
-            TestCreateRBackedUpWindowL(ETestSizeCacheEnabled, displayMode);
-            break;
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0707
-
-@SYMDEF             DevCR BBRE-7UWGHL
-
-@SYMTestCaseDesc    Test RWindow size cache - State: No Cache Entry  
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Perform the following with window size cache on and off:
-                        Create RWsSession, creates RWindowGroup and RWindow.
-                        Perform one of SetExtent/SetSize/SetExtentErr/SetSizeErr/EnableWindowSizeCacheL.
-                        Clean up.
-                        
-@SYMTestExpectedResults Window objects created successfully, no memory leaks.
-*/
-        case 7:
-            ((CTWindowSizeCacheTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0707"));
-            iTest->LogSubTest(KTest7);
-            TestRWindowNoCacheEntryL(ETestSizeCacheNotEnabled);
-            TestRWindowNoCacheEntryL(ETestSizeCacheEnabled);
-            TestRWindowNoCacheEntrySetExtentErrL(ETestSizeCacheNotEnabled);
-            TestRWindowNoCacheEntrySetExtentErrL(ETestSizeCacheEnabled);
-            TestRWindowNoCacheEntrySetSizeErrL(ETestSizeCacheNotEnabled);
-            TestRWindowNoCacheEntrySetSizeErrL(ETestSizeCacheEnabled);
-            TestRWindowNoCacheEntrySetExtentL(ETestSizeCacheNotEnabled);
-            TestRWindowNoCacheEntrySetExtentL(ETestSizeCacheEnabled);
-            TestRWindowNoCacheEntrySetSizeL(ETestSizeCacheNotEnabled);
-            TestRWindowNoCacheEntrySetSizeL(ETestSizeCacheEnabled);
-            TestRWindowNoCacheEntryEnableWindowSizeCacheL();
-            break;
-
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0708
-
-@SYMDEF             DevCR BBRE-7UWGHL
-
-@SYMTestCaseDesc    Test RWindow size cache State: Cache entry exists, cache clean 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Perform the following with window size cache on and off:
-                        Create RWsSession, creates RWindowGroup and RWindow, calls SetSize.
-                        Perform one of Size/EnableWindowSizeCacheL.
-                        Check that size returned matches expected size.
-                        Clean up.
-                        
-@SYMTestExpectedResults Window objects created successfully, no memory leaks.
-*/
-        case 8:
-            ((CTWindowSizeCacheTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0708"));
-            iTest->LogSubTest(KTest8);
-            TestRWindowCacheEntryExistsCacheCleanL(ETestSizeCacheNotEnabled);
-            TestRWindowCacheEntryExistsCacheCleanL(ETestSizeCacheEnabled);
-            TestRWindowCacheEntryExistsCacheCleanSizeL(ETestSizeCacheNotEnabled);
-            TestRWindowCacheEntryExistsCacheCleanSizeL(ETestSizeCacheEnabled);
-            TestRWindowCacheEntryExistsCacheCleanEnableWindowSizeCacheL();
-            TestRWindowCacheEntryExistsCacheCleanEnableWindowSizeCacheLSizeL();
-            break;
-
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0709
-
-@SYMDEF             DevCR BBRE-7UWGHL
-
-@SYMTestCaseDesc    Test RWindow size cache State: Cache entry exists, cache dirty
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Perform the following with window size cache on and off:
-                        Create RWsSession, creates RWindowGroup and RWindow.
-                        Calls SetSize, Size, then SetSize to enter state with dirty cache entry.
-                        Perform combinations of SetSize/SetExtent/SetSizeErr/SetExtentErr/EnableWindowSizeCacheL.
-                        Check that size returned matches the last size set on the window whenever size is queried.
-                        Clean up.
-                        
-@SYMTestExpectedResults Window objects created successfully, no memory leaks.
-*/
-        case 9:
-            ((CTWindowSizeCacheTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0709"));
-            iTest->LogSubTest(KTest9);
-            TestRWindowCacheEntryExistsCacheDirtySetSizeL(ETestSizeCacheNotEnabled);
-            TestRWindowCacheEntryExistsCacheDirtySetSizeL(ETestSizeCacheEnabled);
-            TestRWindowCacheEntryExistsCacheDirtySetExtentL(ETestSizeCacheNotEnabled);
-            TestRWindowCacheEntryExistsCacheDirtySetExtentL(ETestSizeCacheEnabled);
-            TestRWindowCacheEntryExistsCacheDirtySetSizeErrL(ETestSizeCacheNotEnabled);
-            TestRWindowCacheEntryExistsCacheDirtySetSizeErrL(ETestSizeCacheEnabled);
-            TestRWindowCacheEntryExistsCacheDirtySetExtentErrL(ETestSizeCacheNotEnabled);
-            TestRWindowCacheEntryExistsCacheDirtySetExtentErrL(ETestSizeCacheEnabled);
-            TestRWindowCacheEntryExistsCacheDirtySetSizeTwiceL(ETestSizeCacheNotEnabled);
-            TestRWindowCacheEntryExistsCacheDirtySetSizeTwiceL(ETestSizeCacheEnabled);
-            TestRWindowCacheEntryExistsCacheDirtySetSizeSetExtentL(ETestSizeCacheNotEnabled);
-            TestRWindowCacheEntryExistsCacheDirtySetSizeSetExtentL(ETestSizeCacheEnabled);
-            TestRWindowCacheEntryExistsCacheDirtySetSizeSetSizeErrL(ETestSizeCacheNotEnabled);
-            TestRWindowCacheEntryExistsCacheDirtySetSizeSetSizeErrL(ETestSizeCacheEnabled);
-            TestRWindowCacheEntryExistsCacheDirtySetSizeSetExtentErrL(ETestSizeCacheNotEnabled);
-            TestRWindowCacheEntryExistsCacheDirtySetSizeSetExtentErrL(ETestSizeCacheEnabled);
-            TestRWindowCacheEntryExistsCacheDirtySetSizeEnableWindowSizeCacheL();
-            break;
-            
-            
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0710
-
-@SYMDEF             DevCR BBRE-7UWGHL
-
-@SYMTestCaseDesc    Test RWindow size cache State: Cache entry exists, cache dirty -> State: Cache entry exists, cache clean 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Perform the following with window size cache on and off:
-                        Create RWsSession, creates RWindowGroup and RWindow.
-                        Calls SetSize, Size, to enter state with clean cache entry.
-                        Perform combinations of SetSize/SetExtent/SetSizeErr/SetExtentErr/EnableWindowSizeCacheL to enter state with dirty cache entry.
-                        Calls RWindow::Size to re-enter state with clean cache entry.
-                        Check that size returned matches the last size set on the window whenever size is queried.
-                        Clean up.
- 
-@SYMTestExpectedResults Window objects created successfully, no memory leaks.
-*/
-        case 10:
-            ((CTWindowSizeCacheTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0710"));
-            iTest->LogSubTest(KTest10);
-            TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeL(ETestSizeCacheNotEnabled);
-            TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeL(ETestSizeCacheEnabled);
-            TestRWindowCacheEntryExistsCacheDirtyToCleanSetExtentL(ETestSizeCacheNotEnabled);
-            TestRWindowCacheEntryExistsCacheDirtyToCleanSetExtentL(ETestSizeCacheEnabled);
-            TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeErrL(ETestSizeCacheNotEnabled);
-            TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeErrL(ETestSizeCacheEnabled);
-            TestRWindowCacheEntryExistsCacheDirtyToCleanSetExtentErrL(ETestSizeCacheNotEnabled);
-            TestRWindowCacheEntryExistsCacheDirtyToCleanSetExtentErrL(ETestSizeCacheEnabled);
-            TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeTwiceL(ETestSizeCacheNotEnabled);
-            TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeTwiceL(ETestSizeCacheEnabled);
-            TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeSetExtentL(ETestSizeCacheNotEnabled);
-            TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeSetExtentL(ETestSizeCacheEnabled);
-            TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeSetSizeErrL(ETestSizeCacheNotEnabled);
-            TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeSetSizeErrL(ETestSizeCacheEnabled);
-            TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeSetExtentErrL(ETestSizeCacheNotEnabled);
-            TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeSetExtentErrL(ETestSizeCacheEnabled);
-            TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeEnableWindowSizeCacheL();
-            break;
-
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0711
-
-@SYMDEF             DevCR BBRE-7UWGHL
-
-@SYMTestCaseDesc    Test RBlankWindow Size cache behaviour 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Utilises RBlankWindow::SetSize, RBlankWindow::SetExtent, RBlankWindow::Size.
-                    Checks size returned by RBlankWindow::Size.
-                    Cleans up.
-
-@SYMTestExpectedResults Window objects created successfully, no memory leaks, size returned should be last size set on window
-*/
-        case 11:
-            ((CTWindowSizeCacheTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0711"));
-            iTest->LogSubTest(KTest11);
-            TestRBlankWindowSetSizeSetExtentL(ETestSizeCacheNotEnabled);
-            TestRBlankWindowSetSizeSetExtentL(ETestSizeCacheEnabled);
-            break;
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0712
-
-@SYMDEF             DevCR BBRE-7UWGHL
-
-@SYMTestCaseDesc    Test RBackedUpWindow Size cache behaviour 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Utilises RBackedUpWindow::SetSizeErr, RBackedUpWindow::SetExtentErr, RBackedUpWindow::Size.
-                    Checks size returned by RBackedUpWindow::Size.
-                    Cleans up.
-
-@SYMTestExpectedResults Window objects created successfully, no memory leaks, size returned should be last size set on window
-*/
-        case 12:
-            ((CTWindowSizeCacheTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0712"));
-            iTest->LogSubTest(KTest12);
-            TestRBackedUpWindowSetSizeErrSetExtentErrL(ETestSizeCacheNotEnabled);
-            TestRBackedUpWindowSetSizeErrSetExtentErrL(ETestSizeCacheEnabled);
-            break;
-            
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0713
-
-@SYMDEF             DevCR BBRE-7UWGHL
-
-@SYMTestCaseDesc    Compare performance of RWindow::Size function with size cache on and off 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates an RWsSession, optionally enables window size cache, creates an RWindowGroup and an RWindow 
-                    Calls RWindow::Size KPerformanceIterations times.
-                    Measures time taken - with and without size cache enabled
-
-@SYMTestExpectedResults Window objects created successfully, no memory leaks, time taken for KPerformanceIterations RWindow::Size() calls with cache enabled should be faster.
-*/
-        case 13:
-            {
-            ((CTWindowSizeCacheTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0713"));
-            iTest->LogSubTest(KTest13);
-            TUint64 sizeCacheOffDeltaMicroSeconds = TestRWindowSizePerformanceL(ETestSizeCacheNotEnabled, KPerformanceIterations);
-            TUint64 sizeCacheOnDeltaMicroSeconds = TestRWindowSizePerformanceL(ETestSizeCacheEnabled, KPerformanceIterations);
-            TEST(sizeCacheOnDeltaMicroSeconds < sizeCacheOffDeltaMicroSeconds);
-            INFO_PRINTF1(_L("Accessing size using cache is faster"));
-            }
-            break;
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0714
-
-@SYMDEF             DevCR BBRE-7UWGHL
-
-@SYMTestCaseDesc    Randomised stress test - RWindow size related functions
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates an RWsSession, creates some RWindowGroup and RWindow instances, performs random size related actions, cleans up.
-
-@SYMTestExpectedResults Window objects created successfully, no memory leaks, size for each window matches last size set on window
-*/
-        case 14:
-            {
-            ((CTWindowSizeCacheTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0714"));
-            iTest->LogSubTest(KTest14);
-            TInt seed = Math::Random();
-            // To replicate a test run, take the random seed from the test log and pass into SetRandomSeed
-            SetRandomSeed(seed);
-            TestRandomisedStressL(ETestSizeCacheNotEnabled, KStressTestIterations);
-            }
-            break;
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0714
-
-@SYMDEF             DevCR BBRE-7UWGHL
-
-@SYMTestCaseDesc    Randomised stress test - RWindow size related functions, size cache on 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates an RWsSession, enables window size cache, creates some RWindowGroup and RWindow instances, performs random size related actions, cleans up.
-
-@SYMTestExpectedResults Window objects created successfully, no memory leaks, size for each window matches last size set on window
-*/
-        case 15:
-            {
-            ((CTWindowSizeCacheTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0715"));
-            iTest->LogSubTest(KTest15);
-            TInt seed = Math::Random();
-            // To replicate a test run, take the random seed from the test log and pass into SetRandomSeed
-            SetRandomSeed(seed);
-            TestRandomisedStressL(ETestSizeCacheEnabled, KStressTestIterations);
-            }
-            break;
-
-            
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0716
-
-@SYMDEF             DevCR BBRE-7UWGHL
-
-@SYMTestCaseDesc    Randomised stress test - RWindow size related functions, multiple sessions 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates two RWsSession instances, creates some RWindowGroup and RWindow instances, performs random size related actions, cleans up.
-
-@SYMTestExpectedResults Window objects created successfully, no memory leaks, size for each window matches last size set on window
-*/
-        case 16:
-            {
-            ((CTWindowSizeCacheTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0716"));
-            iTest->LogSubTest(KTest16);
-            TInt seed = Math::Random();
-            // To replicate a test run, take the random seed from the test log and pass into SetRandomSeed
-            SetRandomSeed(seed);
-            TestRandomisedStressMultiSessionL(ETestSizeCacheNotEnabled, KStressTestIterations);
-            }
-            break;
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0717
-
-@SYMDEF             DevCR BBRE-7UWGHL
-
-@SYMTestCaseDesc    Randomised stress test - RWindow size related functions, multiple sessions, size cache on
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates two RWsSession instances, enables window size cache, creates some RWindowGroup and RWindow instances, performs random size related actions, cleans up.
-
-@SYMTestExpectedResults Window objects created successfully, no memory leaks, size for each window matches last size set on window
-*/
-        case 17:
-            {
-            ((CTWindowSizeCacheTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0717"));
-            iTest->LogSubTest(KTest17);
-            TInt seed = Math::Random();
-            // To replicate a test run, take the random seed from the test log and pass into SetRandomSeed
-            SetRandomSeed(seed);
-            TestRandomisedStressMultiSessionL(ETestSizeCacheEnabled, KStressTestIterations);
-            }
-            break;
-
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0718
-
-@SYMDEF             DevCR BBRE-7UWGHL
-
-@SYMTestCaseDesc    Randomised stress test - RWindow size related functions, large number of windows 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates an RWsSession, creates some RWindowGroup and RWindow instances, performs random size related actions, cleans up.
-
-@SYMTestExpectedResults Window objects created successfully, no memory leaks, size for each window matches last size set on window
-*/
-        case 18:
-            {
-            ((CTWindowSizeCacheTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0718"));
-            iTest->LogSubTest(KTest18);
-            TInt seed = Math::Random();
-            // To replicate a test run, take the random seed from the test log and pass into SetRandomSeed
-            SetRandomSeed(seed);
-            TestRandomisedStressCacheEntryVolumeL(ETestSizeCacheNotEnabled, KStressTestIterations, KStressWindowPoolSize);
-            }
-            break;
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0719
-
-@SYMDEF             DevCR BBRE-7UWGHL
-
-@SYMTestCaseDesc    Randomised stress test - RWindow size related functions, large number of windows 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates an RWsSession, enables window size cache, creates some RWindowGroup and RWindow instances, performs random size related actions, cleans up.
-
-@SYMTestExpectedResults Window objects created successfully, no memory leaks, size for each window matches last size set on window
-*/
-        case 19:
-            {
-            ((CTWindowSizeCacheTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0719"));
-            iTest->LogSubTest(KTest19);
-            TInt seed = Math::Random();
-            // To replicate a test run, take the random seed from the test log and pass into SetRandomSeed
-            SetRandomSeed(seed);
-            TestRandomisedStressCacheEntryVolumeL(ETestSizeCacheEnabled, KStressTestIterations, KStressWindowPoolSize);
-            }
-            break;
-
-/**
-@SYMTestCaseID      GRAPHICS-WSERV-0720
-
-@SYMDEF             DevCR BBRE-7UWGHL
-
-@SYMTestCaseDesc    Test RWsSession::EnableWindowSizeCacheL() API 
-
-@SYMTestPriority    High
-
-@SYMTestStatus      Implemented
-
-@SYMTestActions     Creates an RWsSession, calls EnableWindowSizeCacheL() multiple times, uses Size related APIs.
-
-@SYMTestExpectedResults No memory leaks.
-*/
-        case 20:
-            {
-            ((CTWindowSizeCacheTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0720"));
-            iTest->LogSubTest(KTest20);
-            TestStressEnableWindowSizeCacheL(KStressTestIterations);
-            }
-            break;
-        default:
-            ((CTWindowSizeCacheTestStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
-            ((CTWindowSizeCacheTestStep*)iStep)->CloseTMSGraphicsStep();
-            TestComplete();
-            break;
-        }
-    ((CTWindowSizeCacheTestStep*)iStep)->RecordTestResultL();
-    }
-
-__WS_CONSTRUCT_STEP__(WindowSizeCacheTest)
--- a/windowing/windowserver/tauto/twindowsizecache.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TWINDOWSIZECACHE_H__
-#define __TWINDOWSIZECACHE_H__
-
-#include <e32std.h>
-#include <w32std.h>
-#include "AUTO.H"
-
-#include "../nga/CLIENT/w32comm.h"
-
-#include "../tlib/testbase.h"
-#include "TGraphicsHarness.h"
-
-//-----------------------------------------------------------
-class CTWindowSizeCacheTest : public CTWsGraphicsBase
-    {
-public:
-    enum TSizeCacheStatus
-        {
-        ETestSizeCacheNotEnabled,
-        ETestSizeCacheEnabled,
-        };
-    enum TRWindowAction
-        {
-        ESetExtent,
-        ESetExtentErr,
-        ESetSize,
-        ESetSizeErr,
-        ECheckSize,
-        EFlushSession,
-        EEnableWindowSizeCache,
-        EMaxAction,
-        };
-public:
-    CTWindowSizeCacheTest(CTestStep* aStep);
-    ~CTWindowSizeCacheTest();
-    TestState DoTestL();
-    void ConstructL();
-//    
-    void TestCreateRWindowL(TSizeCacheStatus aEnableWindowSizeCache);
-    void TestCreateRBlankWindowL(TSizeCacheStatus aEnableWindowSizeCache);
-    void TestCreateRBackedUpWindowL(TSizeCacheStatus aEnableWindowSizeCache, TDisplayMode aDisplayMode);
-//    
-    void TestRWindowNoCacheEntryL(TSizeCacheStatus aEnableWindowSizeCache);
-    void TestRWindowNoCacheEntrySetExtentErrL(TSizeCacheStatus aEnableWindowSizeCache);
-    void TestRWindowNoCacheEntrySetSizeErrL(TSizeCacheStatus aEnableWindowSizeCache);
-    void TestRWindowNoCacheEntrySetExtentL(TSizeCacheStatus aEnableWindowSizeCache);
-    void TestRWindowNoCacheEntrySetSizeL(TSizeCacheStatus aEnableWindowSizeCache);
-    void TestRWindowNoCacheEntryEnableWindowSizeCacheL();
-//
-    void TestRWindowCacheEntryExistsCacheCleanL(TSizeCacheStatus aEnableWindowSizeCache);
-    void TestRWindowCacheEntryExistsCacheCleanSizeL(TSizeCacheStatus aEnableWindowSizeCache);
-    void TestRWindowCacheEntryExistsCacheCleanEnableWindowSizeCacheL();
-    void TestRWindowCacheEntryExistsCacheCleanEnableWindowSizeCacheLSizeL();
-//
-    void TestRWindowCacheEntryExistsCacheDirtySetSizeL(TSizeCacheStatus aEnableWindowSizeCache);
-    void TestRWindowCacheEntryExistsCacheDirtySetExtentL(TSizeCacheStatus aEnableWindowSizeCache);
-    void TestRWindowCacheEntryExistsCacheDirtySetSizeErrL(TSizeCacheStatus aEnableWindowSizeCache);
-    void TestRWindowCacheEntryExistsCacheDirtySetExtentErrL(TSizeCacheStatus aEnableWindowSizeCache);
-    void TestRWindowCacheEntryExistsCacheDirtySetSizeTwiceL(TSizeCacheStatus aEnableWindowSizeCache);
-    void TestRWindowCacheEntryExistsCacheDirtySetSizeSetExtentL(TSizeCacheStatus aEnableWindowSizeCache);
-    void TestRWindowCacheEntryExistsCacheDirtySetSizeSetSizeErrL(TSizeCacheStatus aEnableWindowSizeCache);
-    void TestRWindowCacheEntryExistsCacheDirtySetSizeSetExtentErrL(TSizeCacheStatus aEnableWindowSizeCache);
-    void TestRWindowCacheEntryExistsCacheDirtySetSizeEnableWindowSizeCacheL();
-//    
-    void TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeL(TSizeCacheStatus aEnableWindowSizeCache);
-    void TestRWindowCacheEntryExistsCacheDirtyToCleanSetExtentL(TSizeCacheStatus aEnableWindowSizeCache);
-    void TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeErrL(TSizeCacheStatus aEnableWindowSizeCache);
-    void TestRWindowCacheEntryExistsCacheDirtyToCleanSetExtentErrL(TSizeCacheStatus aEnableWindowSizeCache);
-    void TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeTwiceL(TSizeCacheStatus aEnableWindowSizeCache);
-    void TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeSetExtentL(TSizeCacheStatus aEnableWindowSizeCache);
-    void TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeSetSizeErrL(TSizeCacheStatus aEnableWindowSizeCache);
-    void TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeSetExtentErrL(TSizeCacheStatus aEnableWindowSizeCache);
-    void TestRWindowCacheEntryExistsCacheDirtyToCleanSetSizeEnableWindowSizeCacheL();
-//
-    void TestRBlankWindowSetSizeSetExtentL(TSizeCacheStatus aEnableWindowSizeCache);
-    void TestRBackedUpWindowSetSizeErrSetExtentErrL(TSizeCacheStatus aEnableWindowSizeCache);
-//    
-    void SetRandomSeed(TInt64 aSeed);
-    inline TInt NextRandom(TUint aMax = 0);
-//    
-    TUint64 TestRWindowSizePerformanceL(TSizeCacheStatus aEnableWindowSizeCache, TUint aIterations);
-//    
-    static void CleanupWindowPool(TAny* aPtr);
-    void RWindowPerformAction(TRWindowAction aAction, TSizeCacheStatus aEnableWindowSizeCache, RWsSession& aWs, RWindow& aWindow, TSize& aExpectedSize);
-    void TestRandomisedStressL(TSizeCacheStatus aEnableWindowSizeCache, TUint aIterations);
-    void TestRandomisedStressMultiSessionL(TSizeCacheStatus aEnableWindowSizeCache, TUint aIterations);
-    void TestRandomisedStressCacheEntryVolumeL(TSizeCacheStatus aEnableWindowSizeCache, TUint aIterations, TUint aWindowPoolSize);
-    void TestStressEnableWindowSizeCacheL(TUint aIterations);
-    
-protected:
-//from  CTGraphicsStep
-    virtual void RunTestCaseL(TInt aCurTestCase);
-    
-private:
-    TInt64 iSeed;
-    };
-
-//-----------------------------------------------------------
-inline TInt CTWindowSizeCacheTest::NextRandom(TUint aMax)
-    {
-    TInt random = Math::Rand(iSeed);
-    if (aMax != 0)
-        {
-        random = random % aMax;
-        }
-    return random;
-    }
-
-//-----------------------------------------------------------
-class CTWindowSizeCacheTestStep : public CTGraphicsStep
-    {
-public:
-    CTWindowSizeCacheTestStep();
-protected:
-    //from CTGraphicsStep
-    virtual CTGraphicsBase* CreateTestL();
-    };
-
-_LIT(KTWindowSizeCacheTestStep,"TWindowSizeCacheTest");
-
-//-----------------------------------------------------------
-#endif // TWINDOWSIZECACHE
--- a/windowing/windowserver/tauto/wscons.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include <e32std.h>
-#include <e32cons.h>
-
-NONSHARABLE_CLASS(CWsConsole) : public CConsoleBase
-	{
-public:
-// Pure virtuals from CConsoleBase
-	TInt Create(const TDesC& aTitle,TSize aSize);
-	void Read(TRequestStatus& aStatus);
-	void ReadCancel();
-	void Write(const TDesC& aDes);
-	TPoint CursorPos() const;
-	void SetCursorPosAbs(const TPoint& aPoint);
-	void SetCursorPosRel(const TPoint& aPoint);
-	void SetCursorHeight(TInt aPercentage);
-	void SetTitle(const TDesC& aTitle);
-	void ClearScreen();
-	void ClearToEndOfLine();
-	TSize ScreenSize() const;
-	TKeyCode KeyCode() const;
-	TUint KeyModifiers() const;
-private:
-	TRequestStatus* iStatus;
-	};
-
-//
-// CWsConsole
-//
-
-TInt CWsConsole::Create(const TDesC&,TSize )
-	{
-	return(KErrNone);
-	}
-
-void CWsConsole::Read(TRequestStatus& aStatus)
-	{
-	aStatus=KRequestPending;
-	iStatus=&aStatus;
-	User::RequestComplete(iStatus,KErrNone);
-	}
-
-void CWsConsole::ReadCancel()
-	{
-	User::RequestComplete(iStatus,KErrCancel);
-	}
-
-void CWsConsole::Write(const TDesC&)
-	{
-	}
-
-TPoint CWsConsole::CursorPos() const
-	{
-	return(TPoint());
-	}
-
-void CWsConsole::SetCursorPosAbs(const TPoint&)
-	{
-	}
-
-void CWsConsole::SetCursorPosRel(const TPoint&)
-	{
-	}
-
-void CWsConsole::SetCursorHeight(TInt )
-	{
-	}
-
-void CWsConsole::SetTitle(const TDesC&)
-	{
-	}
-
-void CWsConsole::ClearScreen()
-	{
-	}
-
-void CWsConsole::ClearToEndOfLine()
-	{
-	}
-
-TSize CWsConsole::ScreenSize() const
-	{
-	return(TSize(32,20));
-	}
-
-TKeyCode CWsConsole::KeyCode() const
-	{
-	return(EKeyNull);
-	}
-
-TUint CWsConsole::KeyModifiers() const
-	{
-	return(0);
-	}
-
-EXPORT_C TAny* NewConsole()
-	{
-	return new CWsConsole;
-	}
--- a/windowing/windowserver/tbufferdrawer/bufferdrawer.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "bufferdrawer.h"
-#include <s32mem.h>
-#include <s32strm.h>
-#include <fbs.h>
-#include <bitdev.h>
-#include <bitstd.h>
-#include <graphics/wsgraphicscontext.h>
-#include <graphics/wsuibuffer.h>
-
-
-// CWsGraphicDrawer	
-CWsBufferGraphicDrawer* CWsBufferGraphicDrawer::NewL()
-	{
-	return new(ELeave) CWsBufferGraphicDrawer;	
-	}
-	
-CWsBufferGraphicDrawer::~CWsBufferGraphicDrawer()
-	{
-	}
-
-void CWsBufferGraphicDrawer::ConstructL(MWsGraphicDrawerEnvironment& aEnv, const TGraphicDrawerId& aId, MWsClient& aOwner, const TDesC8& /*aData*/)
-	{
-	BaseConstructL(aEnv, aId, aOwner);
- 	// default white line number
-	iWhiteLinePos = 0;
- 	}
-
-void CWsBufferGraphicDrawer::HandleMessage(const TDesC8& aData)
-	{
-	TInt linePos = aData[0];
-	DoUpdateWhiteLinePos(linePos);
-	}
-
-void CWsBufferGraphicDrawer::DoUpdateWhiteLinePos(TInt aWhiteLinePos)
-	{
-	iWhiteLinePos = aWhiteLinePos;
-	// Invalidate the redrawing
-	Invalidate();
-	}
-
-void CWsBufferGraphicDrawer::DoDraw(MWsGc& aGc, const TRect& aRect, const TDesC8& /*aData*/) const
-	{
-	MWsGraphicsContext* context = static_cast<MWsGraphicsContext*>(aGc.ResolveObjectInterface(KMWsGraphicsContext));
-	
-	//Draw a filled rect with the chosen color
-	context->Push();
-	context->SetBrushStyle(MWsGraphicsContext::ESolidBrush);
-	context->SetBrushColor(KRgbBlue);
-	context->DrawRect(aRect);
-	context->Pop();
-	
-	//Obtain access to the screen/OSB buffer
-	MWsUiBuffer* buffer = static_cast<MWsUiBuffer*>(aGc.ResolveObjectInterface(KMWsUiBufferInterfaceId));
-	TAny* data;
-	TInt stride;
-	
-	TInt err = buffer->MapReadWrite(data, stride);
-	
-	if (err == KErrNone)
-		{
-		//Fill the chosen line with white
-		TUint8* scanLine = static_cast<TUint8*>(data);
-		scanLine += stride * iWhiteLinePos;
-		Mem::Fill(scanLine, stride, 0xFF);
-	
-		buffer->Unmap();
-		}
-	}
--- a/windowing/windowserver/tbufferdrawer/bufferdrawer.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef BUFFERDRAWER_H_
-#define BUFFERDRAWER_H_
-
-#include <bitstd.h>
-#include <graphics/wsgraphicdrawer.h>
-#include <graphics/wsgraphicdrawerinterface.h>
-
-// A buffer drawer 
-NONSHARABLE_CLASS(CWsBufferGraphicDrawer): public CWsGraphicDrawer
-	{
-public:
-	enum {EImplUid = 0x10285D54};	
-		
-public:		
-	static CWsBufferGraphicDrawer* NewL();
-	virtual ~CWsBufferGraphicDrawer();
- 	// override CWsGraphicDrawer
-	virtual void ConstructL(MWsGraphicDrawerEnvironment& aEnv,const TGraphicDrawerId& aId, MWsClient& aOwner, const TDesC8& aData);
-	virtual void HandleMessage(const TDesC8& aData);
-	
-protected:
-	// override CWsGraphicDrawer
-	virtual void DoDraw(MWsGc& aGc, const TRect& aRect, const TDesC8& aData) const;
-	
-private:
-	void DoUpdateWhiteLinePos(TInt aWhiteLinePos);
-	
-private:
-	TInt iWhiteLinePos;
-};
-
-
-#endif /*BUFFERDRAWER_H_*/
--- a/windowing/windowserver/tbufferdrawer/bufferdrawer.rss	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include <ecom/registryinfo.rh>
-
-RESOURCE REGISTRY_INFO registry_info
-	{
-	dll_uid = 0x10285D52;
-	interfaces =
-		{
-		INTERFACE_INFO
-			{
-			interface_uid = 0x10285D53;
-			implementations =
-				{
-				IMPLEMENTATION_INFO
-					{
-					implementation_uid = 0x10285D54;
-					version_no = 1;
-					display_name = "CWsBufferGraphicDrawer";
-					default_data = "";
-					opaque_data = "";
-					}
-				};
-			}
-		};
-	}
--- a/windowing/windowserver/tbufferdrawer/proxy.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include <ecom/implementationproxy.h>
-#include "bufferdrawer.h"
-
-
-LOCAL_C const TImplementationProxy KImplementationTable[] =
-	{
-	IMPLEMENTATION_PROXY_ENTRY(CWsBufferGraphicDrawer::EImplUid, CWsBufferGraphicDrawer::NewL),
-	};
-
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
-	{
-	aTableCount = sizeof(KImplementationTable)/sizeof(TImplementationProxy);
-	return KImplementationTable;
-	}
--- a/windowing/windowserver/tbufferdrawer/wsbufferdrawer.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "wsbufferdrawer.h"
-#include <s32mem.h>
-
-CWsBufferGraphic::CWsBufferGraphic()
-	{
-	}
-
-EXPORT_C CWsBufferGraphic::~CWsBufferGraphic()
-	{
-	}
-
-EXPORT_C CWsBufferGraphic* CWsBufferGraphic::NewL()
-	{
-	CWsBufferGraphic* self = new(ELeave) CWsBufferGraphic;
-	CleanupStack::PushL(self);
- 	self->BaseConstructL(KBufferDrawerImplId,KNullDesC8());
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-EXPORT_C CWsBufferGraphic* CWsBufferGraphic::NewL(TUid aUid)
-	{
-	CWsBufferGraphic* self = new(ELeave) CWsBufferGraphic;
-	CleanupStack::PushL(self);
-	self->BaseConstructL(aUid,KBufferDrawerImplId,KNullDesC8());
-	CleanupStack::Pop(self);
-	return self;
-	}
-	
-EXPORT_C CWsBufferGraphic* CWsBufferGraphic::NewL(const TWsGraphicId& aReplace)
-	{
-	CWsBufferGraphic* self = new(ELeave) CWsBufferGraphic;
-	CleanupStack::PushL(self);
-	self->BaseConstructL(aReplace,KBufferDrawerImplId,KNullDesC8());
- 	CleanupStack::Pop(self);
-	return self;
-	}
-
-EXPORT_C TInt CWsBufferGraphic::UpdateWhiteLinePos(TInt aWhiteLinePos)
-	{
-	// Send the message to server side
-	TBuf8<1> cmd;
-	cmd.Append(aWhiteLinePos);
-	
-	SendMessage(cmd);
-	return Flush();
-	}
-
-EXPORT_C void CWsBufferGraphic::HandleMessage(const TDesC8& /*aData*/)
-	{
-	}
-
-EXPORT_C void CWsBufferGraphic::OnReplace()
-	{
-	}
-
-EXPORT_C TInt CWsBufferGraphic::ShareGlobally()
-	{
-	return CWsGraphic::ShareGlobally();
-	}
-
-EXPORT_C TInt CWsBufferGraphic::UnShareGlobally()
-	{
-	return CWsGraphic::UnShareGlobally();
-	}
-
-EXPORT_C TInt CWsBufferGraphic::Share(TSecureId aClientId)
-	{
-	return CWsGraphic::Share(aClientId);
-	}
-
-EXPORT_C TInt CWsBufferGraphic::UnShare(TSecureId aClientId)
-	{
-	return CWsGraphic::UnShare(aClientId);
-	}  		 
-
--- a/windowing/windowserver/tbufferdrawer/wsbufferdrawer.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef WSBUFFERDRAWER_H_
-#define WSBUFFERDRAWER_H_
-
-
-#include <w32std.h>
-const TUid KBufferDrawerInterfaceId = {0x10285D53};
-const TUid KBufferDrawerImplId = {0x10285D54};
-
-/** Client representation of a window-server-side drawing owned by this Client
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(CWsBufferGraphic): public CWsGraphic
-	{
-public:
-	IMPORT_C static CWsBufferGraphic* NewL();
-	IMPORT_C static CWsBufferGraphic* NewL(TUid aUid);
-	IMPORT_C static CWsBufferGraphic* NewL(const TWsGraphicId& aReplace);
-	IMPORT_C ~CWsBufferGraphic();
-	IMPORT_C TInt UpdateWhiteLinePos(TInt aWhiteLinePos);
-	
-public: // protected virtuals from CWsGraphic promoted to public
-	IMPORT_C TInt ShareGlobally();
-	IMPORT_C TInt UnShareGlobally();
-	IMPORT_C TInt Share(TSecureId aClientId);
-	IMPORT_C TInt UnShare(TSecureId aClientId);
-	
-public:
-	CWsBufferGraphic();
-	void HandleMessage(const TDesC8& aData);
-	void OnReplace();
-};
-
-#endif /*WSBUFFERDRAWER_H_*/
--- a/windowing/windowserver/tcapability/TCapTest.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,745 +0,0 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Automatically test the window server capabilities.
-// 
-//
-
-#include <e32std.h>
-#include "W32STD.H"
-#include "../SERVER/w32cmd.h"
-#include <e32svr.h>
-#include <bacline.h>
-#include <hal.h>
-
-typedef TInt (*TPanicFunction)(TInt aInt,TDes& capability,TInt aExternalGroupId);
-LOCAL_D const TUint KPanicThreadHeapSize=0x2000;
-#define EWindowGroupHandle 1234
-#define EWindowGroupHandle2 4567
-_LIT(KCAPABILITY_ALL,"CAPABILITY_ALL");
-_LIT(KCAPABILITY_NONE,"CAPABILITY_NONE");
-_LIT(KWRITEDATA_SWEVENT,"WRITEDATA+SWEVENT");
-_LIT(KWRITEDATA_POWERMGMT,"WRITEDATA+POWERMGMT");
-_LIT(KPOWERMGMT_SWEVENT,"POWERMGMT+SWEVENT");
-_LIT(KSetOrdinalPositionPri,"EWsWinOpSetOrdinalPositionPri Capability Check");
-_LIT(KSetOrdinalPositionErr,"EWsWinOpSetOrdinalPositionErr Capability Check");
-TLogMessageText LogMessageText;
-
-//Enum for indicating which capability is checked.
-enum TTestCapability
-	{
-	EWriteDeviceData,
-	ESwEvent,
-	EPowerMgmt,
-	EDoNotTest,
-	ENoCapReq,
-	EEikSrvSID,
-	ESwEventPri,
-	ENoSwEventPri,
-	ENoSwEventPriSmallOrdinal,
-	ESwEventErr,
-	ENoSwEventErr,
-	ENoSwEventErrSmallOrdinal,
-	};
-
-//Enum for test exit reasons
-enum TTestState
-	{
-	EWsExitReasonBad,
-	EWsTestNext,
-	EWsTestFinished,
-	};
-	
-	
-TTestCapability gTheTestCapability;
-TInt gTestState=KErrNone;
-
-
-//Panics if EWsExitReasonBad
-enum TAutoPanics
-	{
-	EAutoPanicPanicFailed,
-	};
-
-//Thread function structure
-struct SPanicParams
-	{
-	TInt num;
-	TPanicFunction func;
-	TBuf<256> capability;
-	TInt externalGroupId;
-	};
-
-class CTestBase
-	{
-public:
-	CTestBase();
-	~CTestBase();
-	void ConstructL(const TDes* aCapabilityTest);
-	TInt TestWsPanicL(TPanicFunction aFunction, TInt aInt, const TDes& aCommandLine);
-	void UpdateLogsL();
-private :
-	TInt TestPanicL(SPanicParams* aPtr);
-	TInt LaunchPanicThread(RThread& aThread, SPanicParams* aPtr);
-	void Test(TInt aCondition);
-private :
-	TInt iThreadNumber;
-	RWsSession iWs;
-	TBuf<256> iCapabilityTest;
-	TInt iTestCount;
-	TInt iTestPass;
-	};
-
-//RWsSession derived class to test the EWservMessShutdown message
-class RShellWsSession : public RWsSession
-	{
-public:
-	void ShutDown();
-	};
-	
-void RShellWsSession::ShutDown()
-	{
-	SendReceive(EWservMessShutdown,TIpcArgs(EWservShutdownCheck));
-	}
-	
-LOCAL_C TInt PanicThreadFunc(TAny* aPtr)
-	{
-	CTrapCleanup* CleanUpStack=CTrapCleanup::New();
-	SPanicParams* ptr=(SPanicParams*)aPtr;
-	TInt ret;
-	TRAP(ret,ret=(*ptr->func)(ptr->num,ptr->capability,ptr->externalGroupId));
-	delete CleanUpStack;
-	if (ret==EWsExitReasonBad)
-		{
-		User::Panic(_L("Auto"),EAutoPanicPanicFailed);
-		}
-	return(ret);
-	}
-
-CTestBase::CTestBase() 
-	{
-	}
-	
-CTestBase::~CTestBase() 
-	{
-	iWs.Close();
-	}
-	
-void CTestBase::ConstructL(const TDes* aCapabilityTest)
-	{
-	iTestCount=iTestPass=0;
-	iWs.Connect();
-	TLex lex(*aCapabilityTest);
- 	TPtrC capability = lex.NextToken();
- 	iCapabilityTest.Append(capability);
-	}
-	
-TInt CTestBase::LaunchPanicThread(RThread& aThread, SPanicParams* aPtr)
-	{
-	TBuf<32> threadName;
-	_LIT(KPanicThread, "AutoPanicThread%d");
-	threadName.AppendFormat(KPanicThread,iThreadNumber++);
-	return(aThread.Create(threadName,PanicThreadFunc,KDefaultStackSize,KPanicThreadHeapSize,KPanicThreadHeapSize,aPtr,EOwnerThread));
-	}
-	
-TInt CTestBase::TestPanicL(SPanicParams* aPtr)
-	{
-	RThread thread;
-	TRequestStatus stat;
-	TInt err=LaunchPanicThread(thread, aPtr);
-	if (err==KErrAlreadyExists)
-		{
-		// wait for kernel to clear up old threads
-		// and have several attempts at starting the thread
-		// if unsuccessful the first time
-		for (TInt i=0;i<3;i++)
-			{
-			User::After(TTimeIntervalMicroSeconds32(100000));		//0.1 secs
-			err=LaunchPanicThread(thread, aPtr);
-			if (err!=KErrAlreadyExists)
-				{
-				break;
-				}
-			}
-		}
-	User::LeaveIfError(err);
-	thread.Logon(stat);
-	User::SetJustInTime(EFalse);
-	thread.Resume();
-	User::WaitForRequest(stat);
-	User::SetJustInTime(ETrue);
-	TInt threadExit=thread.ExitReason();
-	if (threadExit!=EWsTestFinished)
-		{
-		if (gTheTestCapability==ENoCapReq)
-			{
-			Test(threadExit==KErrNone);
-			}
-		else if(gTheTestCapability==EEikSrvSID)
-			{
-			Test(threadExit==KErrPermissionDenied);
-			}
-		else if(!iCapabilityTest.Compare(KCAPABILITY_ALL))
-			{
-			if(gTheTestCapability!=EDoNotTest)
-				{
-				iTestCount++;
-				if(gTheTestCapability==ESwEventPri)
-					{
-					Test(threadExit==KPasswordWindowGroupPriority);
-					}
-				else
-					{
-					Test(threadExit==KErrNone);
-					}
-				}
-			}
-		else if(!iCapabilityTest.Compare(KCAPABILITY_NONE))
-			{
-			if(gTheTestCapability!=EDoNotTest)
-				{
-				iTestCount++;
-				if((gTheTestCapability==ENoSwEventPriSmallOrdinal)||(gTheTestCapability==ENoSwEventPri))
-					{
-					Test(threadExit==KPasswordWindowGroupPriority-1);
-					}
-				else if(gTheTestCapability==ENoSwEventErrSmallOrdinal)
-					{
-					Test(threadExit==KErrNone);
-					}
-				else if(gTheTestCapability==ENoSwEventErr)
-					{
-					Test(threadExit==KErrPermissionDenied);
-					}
-				else
-					{
-					Test((threadExit==EWservPanicPermissionDenied)||(threadExit==KErrPermissionDenied));
-					}
-				}
-			}
-		else if(!iCapabilityTest.Compare(KWRITEDATA_SWEVENT))
-			{
-			if(gTheTestCapability==EWriteDeviceData || gTheTestCapability==ESwEvent)
-				{
-				iTestCount++;
-				Test(threadExit==KErrNone);
-				}
-			if(gTheTestCapability==EPowerMgmt)
-				{
-				iTestCount++;
-				Test((threadExit==EWservPanicPermissionDenied)||(threadExit==KErrPermissionDenied));
-				}
-			}
-		else if(!iCapabilityTest.Compare(KWRITEDATA_POWERMGMT))
-			{
-			if(gTheTestCapability==EWriteDeviceData || gTheTestCapability==EPowerMgmt)
-				{
-				iTestCount++;
-				Test(threadExit==KErrNone);
-				}
-			if(gTheTestCapability==ESwEvent) 	
-				{
-				iTestCount++;
-				Test((threadExit==EWservPanicPermissionDenied)||(threadExit==KErrPermissionDenied));
-				}
-			}
-		else if(!iCapabilityTest.Compare(KPOWERMGMT_SWEVENT))
-			{
-			if(gTheTestCapability==EPowerMgmt || gTheTestCapability==ESwEvent)
-				{
-				iTestCount++;
-				Test(threadExit==KErrNone);
-				}
-			if(gTheTestCapability==EWriteDeviceData) 
-				{
-				iTestCount++;
-				Test((threadExit==EWservPanicPermissionDenied)||(threadExit==KErrPermissionDenied));
-				}
-			}
-		}
-	thread.Close();
-	return(threadExit);
-	}
-
-TInt CTestBase::TestWsPanicL(TPanicFunction aFunction,TInt aTestNo, const TDes& aCommandLine)
-	{
-	TLex lex(aCommandLine);
- 	TPtrC capability = lex.NextToken();
- 	TPtrC idstr = lex.NextToken();
- 	lex = idstr;
- 	TInt id = 0;
- 	lex.Val(id);
-
-	SPanicParams params;
-	params.num=aTestNo;
-	params.func=aFunction;
-	params.capability.Copy(capability);
-	params.externalGroupId = id;
-	return TestPanicL(&params);
-	}
-
-void CTestBase::Test(TInt aCondition)
-	{
-	if(!aCondition)
-		{
-		TLogMessageText buf;
-		_LIT(Fail,"AUTO Failed in Capability Test : ");
-		buf.Append(Fail);
-		buf.Append(iCapabilityTest);
-		iWs.LogMessage(buf);
-		iWs.Flush();
-		}
-	else
-		{
-		iTestPass++;
-		}
-	}
-	
-void CTestBase::UpdateLogsL()
-	{
-	TBuf<256> testResult;
-	RFs fileSession;
-	RFile resultFile;
-	User::LeaveIfError(fileSession.Connect());
-	CleanupClosePushL(fileSession);
-	resultFile.Replace(fileSession,_L("C:\\DATA\\TestResult.Dat"),EFileWrite);
-	CleanupClosePushL(resultFile);
-	TFileText fileText;
-	fileText.Set(resultFile);
-	testResult.Num(iTestCount);
-	fileText.Write(testResult);
-	testResult.Num(iTestPass);
-	fileText.Write(testResult);
-	resultFile.Close();
-	fileSession.Close();
-	CleanupStack::PopAndDestroy(&resultFile);
-	CleanupStack::PopAndDestroy(&fileSession);
-	}
-	
-TInt TestCapability(TInt aTest, TDes& aCapability, TInt aExternalGroupId)
-	{
-	_LIT(KDllName,"CLICK");
-	RWsSession ws;
-	ws.Connect();
-	CleanupClosePushL(ws);
-	RWindowGroup gr1(ws);
-	RWindowGroup gr2(ws);
-	gr1.Construct(EWindowGroupHandle,EFalse);
-	gr2.Construct(EWindowGroupHandle2,EFalse);
-	CleanupClosePushL(gr1);
-	CleanupClosePushL(gr2);
-	TWsEvent event;
-	RSoundPlugIn click1(ws);
-	CWsScreenDevice *screenDevice;
-	TRawEvent rawEvent;
-	CPalette* defPalette=CPalette::NewDefaultL(EColor256);
-	TInt ret=KErrNone;
-	switch(aTest)
-		{
-		case 0:
-	//		ws.LogMessage(_L("EWsClOpSetKeyboardRepeatRate Capability Check"));
-			gTheTestCapability=EWriteDeviceData;
-			ret=ws.SetKeyboardRepeatRate(TTimeIntervalMicroSeconds32(1000000), TTimeIntervalMicroSeconds32(500000));
-			ws.Flush();
-			break;
-		case 1:
-	//		ws.LogMessage(_L("EWsClOpSetDoubleClick Capability Check"));
-			gTheTestCapability=EWriteDeviceData;
-			ret=ws.SetDoubleClick(TTimeIntervalMicroSeconds32(900000),10);	
-			ws.Flush();
-			break;
-		case 2:
-	//		ws.LogMessage(_L("EWsClOpSendEventToWindowGroup (external group) Capability Check"));
-			gTheTestCapability=ESwEvent;
-			event.SetType(EEventModifiersChanged);
-			ret=ws.SendEventToWindowGroup(aExternalGroupId,event);
-			break;
-		case 3:
-	//		ws.LogMessage(_L("EWsClOpSendEventToAllWindowGroup Capability Check"));
-			gTheTestCapability=ESwEvent;
-			event.SetType(EEventModifiersChanged);
-			ret=ws.SendEventToAllWindowGroups(event);
-			break;
-		case 4:
-	//		ws.LogMessage(_L("EWsClOpSendEventToAllWindowGroupPriority Capability Check"));
-			gTheTestCapability=ESwEvent;
-			event.SetType(EEventModifiersChanged);
-			gr1.SetOrdinalPosition(0,1);
-			ret=ws.SendEventToAllWindowGroups(gr1.OrdinalPriority(),event);
-			break;
-		case 5:
-	//		ws.LogMessage(_L("EWsClOpSendEventToOneWindowGroupPerClient Capability Check"));
-			gTheTestCapability=ESwEvent;
-			event.SetType(EEventModifiersChanged);
-			ret=ws.SendEventToOneWindowGroupsPerClient(event);
-			break;
-		case 6:
-	//		ws.LogMessage(_L("EWsClOpSendMessageToWindowGroup (external group) Capability Check"));
-			gTheTestCapability=ESwEvent;
-			ret=ws.SendMessageToWindowGroup(aExternalGroupId,TUid::Uid(123),_L8("SomeParams"));
-			break;
-		case 7:
-	//		ws.LogMessage(_L("EWsClOpClaimSystemPointerCursorList Capability Check"));
-			gTheTestCapability=EWriteDeviceData;
-			ret=ws.ClaimSystemPointerCursorList();
-			//This may return KErrInUse if succeeds.
-			if(ret==KErrInUse)
-				{
-				ret=KErrNone;
-				}
-			break;
-		case 8:
-	//		ws.LogMessage(_L("EWsClOpSetClientCursorMode Capability Check"));
-			gTheTestCapability=EWriteDeviceData;
-			ret=ws.SetClientCursorMode(EPointerCursorNone);
-			ws.Flush();
-			break;
-		case 9:
-			//Check only if capability is not defined,since the windowgroup is not focused.
-			if(aCapability.Compare(KCAPABILITY_ALL)&&aCapability.Compare(KWRITEDATA_POWERMGMT)&&aCapability.Compare(KWRITEDATA_SWEVENT))
-				{
-	//			ws.LogMessage(_L("EWsClOpSetPointerCursorPosition Capability Check"));
-				gTheTestCapability=EWriteDeviceData;
-				ret=ws.SetPointerCursorPosition(TPoint(60,20));
-				ws.Flush();
-				}
-			else
-				{
-				gTheTestCapability=EDoNotTest;	
-				}
-			break;
-		case 10:
-	//		ws.LogMessage(_L("EWsClOpSetModifierState Capability Check"));
-			gTheTestCapability=EWriteDeviceData;
-			ret=ws.SetModifierState(EModifierCapsLock,ETurnOnModifier);
-			ret=ws.SetModifierState(EModifierCapsLock,ETurnOffModifier); 
-			ws.Flush();
-			break;
-		case 11:
-			{
-	//		ws.LogMessage(_L("EWsClOpRawEvent Capability Check"));
-			gTheTestCapability=ESwEvent;
-			rawEvent.Set(TRawEvent::EActive);
-			ws.SimulateRawEvent(rawEvent);
-			ws.Flush();
-			}
-			break;
-		case 12:
-			{
-	//		ws.LogMessage(_L("EWsClOpKeyEvent Capability Check"));
-			gTheTestCapability=ESwEvent;
-			TKeyEvent keyEvent;
-			keyEvent.iCode='J';
-			keyEvent.iScanCode=0;
-			keyEvent.iModifiers=EModifierAutorepeatable;
-			keyEvent.iRepeats=0;
-			ws.SimulateKeyEvent(keyEvent);
-			ws.Flush();
-			}
-			break;
-		case 13:
-	//		ws.LogMessage(_L("EWsClOpSendOffEventsToShell Capability Check"));
-			gTheTestCapability=EPowerMgmt;
-			ret=ws.RequestOffEvents(EFalse);
-			break;
-		case 14:
-	//		ws.LogMessage(_L("EWsClOpSetFaded Capability Check"));
-			gTheTestCapability=EWriteDeviceData;
-			ret=ws.SetSystemFaded(EFalse);
-			break;
-		case 15:
-			//Since there is some problem in running the  EWsClOpNoFlickerFree
-			//code this test is not run if WriteDeviceData capability is defined.
-	//		ws.LogMessage(_L("EWsClOpNoFlickerFree Capability Check"));
-			if(aCapability.Compare(KCAPABILITY_ALL)&&aCapability.Compare(KWRITEDATA_POWERMGMT)&&aCapability.Compare(KWRITEDATA_SWEVENT))
-				{
-				CWsScreenDevice* screen = new (ELeave) CWsScreenDevice(ws);
-				gTheTestCapability=EWriteDeviceData;
-				TInt err;
-				if ((err=screen->Construct(0))!=KErrNone)
-					{
-					delete screen;
-					User::Leave(err);
-					}
-				ws.TestWrite(ws.WsHandle(), EWsClOpNoFlickerFree, NULL, 0);
-				ws.Flush();
-				delete screen;
-				}
-			else
-				{
-				gTheTestCapability=EDoNotTest;
-				}
-			break;
-		case 16:
-	//		ws.LogMessage(_L("EWsClOpSetFocusScreen Capability Check"));
-			gTheTestCapability=EWriteDeviceData;
-			ret=ws.SetFocusScreen(0);
-			break;
-		case 17:
-			{
-			//Check only if capability is not defined. Otherwise it will shut down the shell.
-			if(aCapability.Compare(KCAPABILITY_ALL)&&aCapability.Compare(KWRITEDATA_POWERMGMT)&&aCapability.Compare(KPOWERMGMT_SWEVENT))
-				{
-	//			ws.LogMessage(_L("EWservMessShutdown Capability Check"));
-				gTheTestCapability=EPowerMgmt;
-				RShellWsSession wsShell;
-				wsShell.Connect();
-				wsShell.ShutDown();
-				}
-			else
-				{
-				gTheTestCapability=EDoNotTest;	
-				}
-			break;
-			}
-		case 18:
-	//		ws.LogMessage(_L("EWsWinOpCaptureKey Capability Check"));
-			gTheTestCapability=ESwEvent;
-			ret=gr2.CaptureKey('a',EModifierFunc,EModifierFunc);
-			//If the function succeeds capability check,the ret value is handle identifying the capture key.
-			if(ret>0)
-				{
-				ret=KErrNone;
-				}
-			break;
-		case 19:
-	//		ws.LogMessage(_L("EWsWinOpCaptureKeyUpsAndDowns Capability Check"));
-			gTheTestCapability=ESwEvent;
-			ret=gr2.CaptureKeyUpAndDowns('a',0,0);
-			//If the function succeeds capability check,the ret value is handle identifying the capture key.
-			if(ret>0)
-				{
-				ret=KErrNone;
-				}
-			break;
-		case 20:
-	//		ws.LogMessage(_L("EWsWinOpCaptureLongKey Capability Check"));
-			gTheTestCapability=ESwEvent;
-			ret=gr2.CaptureLongKey(EKeyEscape,'e',0,0,2,ELongCaptureNormal|ELongCaptureRepeatEvents);
-			//If the function succeeds capability check,the ret value is handle identifying the capture key.
-			if(ret>0)
-				{
-				ret=KErrNone;
-				}
-			break;
-		case 21:
-	//		ws.LogMessage(_L("EWsClickOpLoad Capability Check"));
-			gTheTestCapability=EWriteDeviceData;
-			click1.Construct();
-			CleanupClosePushL(click1);
-			ret=click1.Load(KDllName);
-			CleanupStack::PopAndDestroy(&click1);
-			break;
-		case 22:
-	//		ws.LogMessage(_L("EWsClickOpUnLoad Capability Check"));
-			gTheTestCapability=EWriteDeviceData;
-			click1.Construct();
-			ret=click1.Unload();
-			break;
-		case 23:
-	//		ws.LogMessage(_L("EWsSdOpSetScreenMode Capability Check"));
-			gTheTestCapability=EWriteDeviceData;
-			screenDevice=new(ELeave) CWsScreenDevice(ws);
-			CleanupStack::PushL(screenDevice);
-			screenDevice->Construct(0);
-			screenDevice->SetScreenMode(0);
-			CleanupStack::PopAndDestroy(screenDevice);
-			break;
-		case 24:
-	//		ws.LogMessage(_L("EWsSdOpSetScreenModeEnforcement Capability Check"));
-			gTheTestCapability=EWriteDeviceData;
-			screenDevice=new(ELeave) CWsScreenDevice(ws);
-			CleanupStack::PushL(screenDevice);
-			screenDevice->Construct(0);
-			screenDevice->SetScreenModeEnforcement(ESizeEnforcementNone);
-			ws.Flush();
-			CleanupStack::PopAndDestroy(screenDevice);
-			break;
-		case 25:
-			{
-	//		ws.LogMessage(_L("EWsSdOpSetPalette Capability Check"));
-			gTheTestCapability=EWriteDeviceData;
-			screenDevice=new(ELeave) CWsScreenDevice(ws);
-			CleanupStack::PushL(screenDevice);
-			screenDevice->Construct(0);
-			ret=screenDevice->SetCustomPalette(defPalette);
-			//Returns KErrNotSupported if succeeds capability check.
-			if(ret==KErrNotSupported)
-				{
-				ret=KErrNone;
-				}
-			CleanupStack::PopAndDestroy(screenDevice);
-			}
-			break;
-		case 26:
-			{
-			//Checking the capability for SetHotKeys
-	//		ws.LogMessage(_L("EWsClOpSetHotKey Capability Check"));
-			gTheTestCapability=ESwEvent;
-			ret=ws.SetHotKey(EHotKeyEnableLogging,'e',EModifierFunc|EModifierCtrl|EModifierShift,0);
-			ws.Flush();
-			}
-			break;
-		case 27:
-			{
-			//Checking the capability for ClearHotKeys
-	//		ws.LogMessage(_L("EWsClOpClearHotKeys Capability Check"));
-			gTheTestCapability=ESwEvent;
-			ret=ws.ClearHotKeys(EHotKeyEnableLogging);
-			ws.Flush();
-			}
-			break;
-		case 28:
-	//		ws.LogMessage(_L("EWsClOpSendEventToWindowGroup (own group) Capability Check"));
-			gTheTestCapability=ENoCapReq;
-			event.SetType(EEventModifiersChanged);
-			ret=ws.SendEventToWindowGroup(gr1.Identifier(),event);
-			break;
-		case 29:
-	//		ws.LogMessage(_L("EWsClOpSendMessageToWindowGroup (own group) Capability Check"));
-			gTheTestCapability=ENoCapReq;
-			ret=ws.SendMessageToWindowGroup(gr1.Identifier(),TUid::Uid(123),_L8("SomeParams"));
-			break;
-		case 30:
-	//		ws.LogMessage(_L("EWsClOpSetBackLight Capability Check"));
-			gTheTestCapability=EEikSrvSID;
-			screenDevice=new(ELeave) CWsScreenDevice(ws);
-			CleanupStack::PushL(screenDevice);
-			screenDevice->Construct(0);
-			ret=screenDevice->SetBackLight(ETrue);	//Always returns KErrPermissionDenied.
-			CleanupStack::PopAndDestroy(screenDevice);
-			break;
-		case 31:
-			{
-			TBool test=EFalse;
-			if(!aCapability.Compare(KCAPABILITY_ALL))
-				{
-				gTheTestCapability=ESwEventPri;
-				test=ETrue;
-				}
-			else if(!aCapability.Compare(KCAPABILITY_NONE))
-				{
-				gTheTestCapability=ENoSwEventPri;
-				test=ETrue;
-				}
-			else
-				{
-				gTheTestCapability=EDoNotTest;	
-				}
-			if(test)
-				{
-				LogMessageText.Format(KSetOrdinalPositionPri);
-				ws.LogMessage(LogMessageText);
-				gr1.SetOrdinalPosition(0,KPasswordWindowGroupPriority);
-				ret=ws.GetWindowGroupOrdinalPriority(gr1.Identifier());
-				}
-			}
-			break;
-		case 32:
-			if(!aCapability.Compare(KCAPABILITY_NONE))
-				{
-				LogMessageText.Format(KSetOrdinalPositionPri);
-				ws.LogMessage(LogMessageText);
-				gTheTestCapability=ENoSwEventPriSmallOrdinal;
-				gr1.SetOrdinalPosition(0,KPasswordWindowGroupPriority-1);
-				ret=ws.GetWindowGroupOrdinalPriority(gr1.Identifier());
-				}
-			else
-				{
-				gTheTestCapability=EDoNotTest;	
-				}
-			break;
-		case 33:
-			{
-			TBool test=EFalse;
-			if(!aCapability.Compare(KCAPABILITY_ALL))
-				{
-				gTheTestCapability=ESwEventErr;
-				test=ETrue;
-				}
-			else if(!aCapability.Compare(KCAPABILITY_NONE))
-				{
-				gTheTestCapability=ENoSwEventErr;
-				test=ETrue;
-				}
-			else
-				{
-				gTheTestCapability=EDoNotTest;	
-				}
-			if(test)
-				{
-				LogMessageText.Format(KSetOrdinalPositionErr);
-				ws.LogMessage(LogMessageText);
-				ret=gr1.SetOrdinalPositionErr(0,KPasswordWindowGroupPriority);
-				}
-			}
-			break;
-		case 34:
-			if(!aCapability.Compare(KCAPABILITY_NONE))
-				{
-				LogMessageText.Format(KSetOrdinalPositionErr);
-				ws.LogMessage(LogMessageText);
-				gTheTestCapability=ENoSwEventErrSmallOrdinal;
-				ret=gr1.SetOrdinalPositionErr(0,KPasswordWindowGroupPriority-1);
-				}
-			else
-				{
-				gTheTestCapability=EDoNotTest;	
-				}
-			break;
-		case 35:
-			// EWsClOpSetCloseProximityThresholds Capability Check			
-			gTheTestCapability=EWriteDeviceData;
-			ret=ws.SetCloseProximityThresholds(-20, -50);
-			ws.SetCloseProximityThresholds(KMaxTInt, KMinTInt);
-			break;
-		case 36:
-			// EWsClOpSetHighPressureThresholds Capability Check			
-			gTheTestCapability=EWriteDeviceData;
-			ret=ws.SetHighPressureThresholds(4000, 2000);
-			ws.SetHighPressureThresholds(KMaxTInt, KMinTInt);
-			break;
-		default:
-			ret=gTestState=EWsTestFinished;
-		}
-	CleanupStack::PopAndDestroy(&gr2);	
-	CleanupStack::PopAndDestroy(&gr1);
-	CleanupStack::PopAndDestroy(&ws);
-	return ret;
-	}
-
-void MainL()
-	{
-    TBuf<256> commandLine;
-    User::CommandLine(commandLine);
-	CTestBase testBase;
-	testBase.ConstructL(&commandLine);
-	TInt ii=0;
-	while(gTestState!=EWsTestFinished)
-		testBase.TestWsPanicL(&TestCapability,ii++,commandLine) ;
-//	testBase.UpdateLogsL();	
-	}
-
-GLDEF_C TInt E32Main()
-	{
-	__UHEAP_MARK;
-	CTrapCleanup* cleanUpStack=CTrapCleanup::New();
-	if(cleanUpStack==NULL)
-		{
-		return KErrNoMemory;
-		}
-	TRAP_IGNORE(MainL())
-	delete cleanUpStack;
-	__UHEAP_MARKEND;
-	return(KErrNone);
-	}
--- a/windowing/windowserver/tcontaindrawer/containdrawer.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "containdrawer.h"
-#include "wsgraphicdrawercontext.h"
-#include <s32mem.h>
-#include <s32strm.h>
-
-const TGraphicDrawerId KChildInterfaceId1={0x1028353A, ETrue};
-const TGraphicDrawerId KChildInterfaceId2={0x1028353C, ETrue};
-
-
-// CWsGraphicDrawer	
-CWsContainGraphicDrawer* CWsContainGraphicDrawer::NewL()
-	{
-	return new(ELeave) CWsContainGraphicDrawer;	
-	}
-	
-CWsContainGraphicDrawer::~CWsContainGraphicDrawer()
-	{
-	if (iContext)
-		{
-		iContext->Destroy();
-		iContext = NULL;
-		}
-	}
-
-void CWsContainGraphicDrawer::ConstructL(MWsGraphicDrawerEnvironment& aEnv, const TGraphicDrawerId& aId, MWsClient& aOwner, const TDesC8& /*aData*/)
-	{
-	BaseConstructL(aEnv, aId, aOwner);
-	iColor = KRgbWhite;
-	if (!(aEnv.Screen(0)->ResolveObjectInterface(KMWsCompositionContext) || aEnv.Screen(0)->ResolveObjectInterface(KMWsScene)))
-		{
-		iContext = CWsGraphicDrawerNonNgaContext::NewL();
-		}
-	else
-		{
-		iContext = CWsGraphicDrawerNgaContext::NewL();
-		}
-	}
-
-void CWsContainGraphicDrawer::HandleMessage(const TDesC8& aData)
-	{
-	TInt red = aData[0];
-	TInt green = aData[1];
-	TInt blue = aData[2];
-	TRgb color(red, green, blue);
-	DoUpdateColor(color);
-	}
-	
-void CWsContainGraphicDrawer::DoUpdateColor(TRgb aColor)
-	{
-    iColor = aColor;
-    // Invalidate the redrawing
-    Invalidate();
- 	}
-
-void CWsContainGraphicDrawer::DoDraw(MWsGc& aGc, const TRect& aRect, const TDesC8& aData) const
-	{
-	iContext->DrawEllipse(aGc, aRect, iColor);
-
-	// invoke another CRPs to draw their artwork
-    TRect rect1 = TRect(TPoint(100,150),TSize(50,50));
-	const CWsGraphicDrawer* child1 = Env().ResolveGraphic(KChildInterfaceId1);
-   	if (child1)
-   		child1->Draw(aGc, rect1, aData);	
-	TRect rect2 = TRect(TPoint(200,150),TSize(50,50));
-   	const CWsGraphicDrawer* child2 = Env().ResolveGraphic(KChildInterfaceId2);
-   	if (child2)
-        child2->Draw(aGc, rect2, aData);		
-	}
-	
-// inherited API to indicate there are contained drawers	
-TBool CWsContainGraphicDrawer::HasAsChild(const TArray<TGraphicDrawerId>& aIds) const
-	{
-	// Two child CRPs
-	const CWsGraphicDrawer* child1 = Env().ResolveGraphic(KChildInterfaceId1);
-   	const CWsGraphicDrawer* child2 = Env().ResolveGraphic(KChildInterfaceId2);
-   	if (child1 && child1->Contains(aIds))
-   		return ETrue;
-   	else if (child2 && child2->Contains(aIds))
-   		return ETrue;
-   	else
-   		return EFalse;
-	}
--- a/windowing/windowserver/tcontaindrawer/containdrawer.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __CONTAINDRAWER_H__
-#define __CONTAINDRAWER_H__
-
-#include <graphics/wsgraphicdrawer.h>
-#include <graphics/wsgraphicdrawerinterface.h>
-
-class MWsGraphicDrawerContext;
-
-NONSHARABLE_CLASS(CWsContainGraphicDrawer): public CWsGraphicDrawer
-	{
-public:
-	enum {EImplUid = 0x10283521};	
-		
-public:		
-	static CWsContainGraphicDrawer* NewL();
-	virtual ~CWsContainGraphicDrawer();
-	// override CWsGraphicDrawer
-	virtual void ConstructL(MWsGraphicDrawerEnvironment& aEnv,const TGraphicDrawerId& aId, MWsClient& aOwner, const TDesC8& aData);
-	virtual void HandleMessage(const TDesC8& aData);
-private:
-	// override CWsGraphicDrawer
-	virtual void DoDraw(MWsGc& aGc, const TRect& aRect, const TDesC8& aData) const;
-    virtual TBool HasAsChild(const TArray<TGraphicDrawerId>& aIds) const;
-
-	void DoUpdateColor(TRgb aColor);
-private:
-	MWsGraphicDrawerContext* iContext;
-	TRgb iColor;
-};
-
-#endif
--- a/windowing/windowserver/tcontaindrawer/containdrawer.rss	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include <ecom/registryinfo.rh>
-
-RESOURCE REGISTRY_INFO registry_info
-	{
-	dll_uid = 0x10283520;
-	interfaces =
-		{
-		INTERFACE_INFO
-			{
-			interface_uid = 0x10283522;
-			implementations =
-				{
-				IMPLEMENTATION_INFO
-					{
-					implementation_uid = 0x10283521;
-					version_no = 1;
-					display_name = "CWsContainDrawer";
-					default_data = "";
-					opaque_data = "";
-					}
-				};
-			interface_uid = 0x1028351B;
-			implementations =
-				{
-				IMPLEMENTATION_INFO
-					{
-					implementation_uid = 0x1028351C;
-					version_no = 1;
-					display_name = "CWsSimpleDrawer";
-					default_data = "";
-					opaque_data = "";
-					}
-				};
-			interface_uid = 0x1028353A;
-			implementations =
-				{
-				IMPLEMENTATION_INFO
-					{
-					implementation_uid = 0x10283539;
-					version_no = 1;
-					display_name = "CWsInvisibleDrawer1";
-					default_data = "";
-					opaque_data = "";
-					}
-				};
-			interface_uid = 0x1028353C;
-			implementations =
-				{
-				IMPLEMENTATION_INFO
-					{
-					implementation_uid = 0x1028353B;
-					version_no = 1;
-					display_name = "CWsInvisibleDrawer2";
-					default_data = "";
-					opaque_data = "";
-					}
-				};
- 			}
-		};
-	}
--- a/windowing/windowserver/tcontaindrawer/proxy.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include <ecom/implementationproxy.h>
-#include "containdrawer.h"
-#include "simpledrawer.h"
-
-
-LOCAL_C const TImplementationProxy KImplementationTable[] =
-	{
-	IMPLEMENTATION_PROXY_ENTRY(CWsContainGraphicDrawer::EImplUid, CWsContainGraphicDrawer::NewL),
-	IMPLEMENTATION_PROXY_ENTRY(CWsSimpleGraphicDrawer::EImplUid, CWsSimpleGraphicDrawer::NewL),
-   	IMPLEMENTATION_PROXY_ENTRY(CWsInvisibleGraphicDrawer1::EImplUid, CWsInvisibleGraphicDrawer1::NewL),
-   	IMPLEMENTATION_PROXY_ENTRY(CWsInvisibleGraphicDrawer2::EImplUid, CWsInvisibleGraphicDrawer2::NewL),
-	};
-
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
-	{
-	aTableCount = sizeof(KImplementationTable)/sizeof(TImplementationProxy);
-	return KImplementationTable;
-	}
--- a/windowing/windowserver/tcontaindrawer/simpledrawer.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "simpledrawer.h"
-#include "wsgraphicdrawercontext.h"
-#include <s32mem.h>
-#include <s32strm.h>
-
-// CWsGraphicDrawer	
-CWsSimpleGraphicDrawer* CWsSimpleGraphicDrawer::NewL()
-	{
-	return new(ELeave) CWsSimpleGraphicDrawer;	
-	}
-	
-CWsSimpleGraphicDrawer::~CWsSimpleGraphicDrawer()
-	{
-	if (iContext)
-		{
-		iContext->Destroy();
-		iContext = NULL;
-		}
-	}
-
-void CWsSimpleGraphicDrawer::ConstructL(MWsGraphicDrawerEnvironment& aEnv, const TGraphicDrawerId& aId, MWsClient& aOwner, const TDesC8& /*aData*/)
-	{
-	BaseConstructL(aEnv, aId, aOwner);
- 	// default color
-	iColor = KRgbBlue;
- 	}
-
-void CWsSimpleGraphicDrawer::HandleMessage(const TDesC8& aData)
-	{
-	TInt red = aData[0];
-	TInt green = aData[1];
-	TInt blue = aData[2];
-	TRgb color(red, green, blue);
-	DoUpdateColor(color);
-	}
-
-void CWsSimpleGraphicDrawer::BaseConstructL(MWsGraphicDrawerEnvironment& aEnv,const TGraphicDrawerId& aId,MWsClient& aOwner)
-	{
-	CWsGraphicDrawer::BaseConstructL(aEnv, aId, aOwner);
-	if (!(aEnv.Screen(0)->ResolveObjectInterface(KMWsCompositionContext) || aEnv.Screen(0)->ResolveObjectInterface(KMWsScene)))
-		{
-		iContext = CWsGraphicDrawerNonNgaContext::NewL();
-		}
-	else
-		{
-		iContext = CWsGraphicDrawerNgaContext::NewL();
-		}
-	}
-
-void CWsSimpleGraphicDrawer::DoUpdateColor(TRgb aColor)
-	{
-	iColor = aColor;
-	// Invalidate the redrawing
-	Invalidate();
-	}
-
-void CWsSimpleGraphicDrawer::DoDraw(MWsGc& aGc, const TRect& aRect, const TDesC8& /*aData*/) const
-	{
-	iContext->DrawEllipse(aGc, aRect, iColor);
-	}
-	
-// First contained (child) drawer
-CWsInvisibleGraphicDrawer1* CWsInvisibleGraphicDrawer1::NewL()
-	{
-	return new(ELeave) CWsInvisibleGraphicDrawer1;	
-	}
-	
-CWsInvisibleGraphicDrawer1::~CWsInvisibleGraphicDrawer1()
-	{
-	}
-
-void CWsInvisibleGraphicDrawer1::ConstructL(MWsGraphicDrawerEnvironment& aEnv, const TGraphicDrawerId& aId, MWsClient& aOwner, const TDesC8& /*aData*/)
-	{
-	BaseConstructL(aEnv, aId, aOwner);
-	// default color
-	iColor = KRgbYellow;
-	}
-
-// Second contained (child) drawer
-CWsInvisibleGraphicDrawer2* CWsInvisibleGraphicDrawer2::NewL()
-	{
-	return new(ELeave) CWsInvisibleGraphicDrawer2;	
-	}
-	
-CWsInvisibleGraphicDrawer2::~CWsInvisibleGraphicDrawer2()
-	{
-	}
-
-void CWsInvisibleGraphicDrawer2::ConstructL(MWsGraphicDrawerEnvironment& aEnv, const TGraphicDrawerId& aId, MWsClient& aOwner, const TDesC8& /*aData*/)
-	{
-	BaseConstructL(aEnv, aId, aOwner);
-	// default color
-	iColor = KRgbCyan;
-	}
--- a/windowing/windowserver/tcontaindrawer/simpledrawer.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __SIMPLEDRAWER_H__
-#define __SIMPLEDRAWER_H__
-
-#include <graphics/wsgraphicdrawer.h>
-#include <graphics/wsgraphicdrawerinterface.h>
-
-class MWsGraphicDrawerContext;
-
-// A simple drawer
-NONSHARABLE_CLASS(CWsSimpleGraphicDrawer): public CWsGraphicDrawer//, public MWsEventHandler
-	{
-public:
-	enum {EImplUid = 0x1028351C};	
-		
-public:		
-	static CWsSimpleGraphicDrawer* NewL();
-	virtual ~CWsSimpleGraphicDrawer();
- 	// override CWsGraphicDrawer
-	virtual void ConstructL(MWsGraphicDrawerEnvironment& aEnv,const TGraphicDrawerId& aId, MWsClient& aOwner, const TDesC8& aData);
-	virtual void HandleMessage(const TDesC8& aData);
-protected:
-	// override CWsGraphicDrawer
-	void BaseConstructL(MWsGraphicDrawerEnvironment& aEnv,const TGraphicDrawerId& aId,MWsClient& aOwner);
-	virtual void DoDraw(MWsGc& aGc, const TRect& aRect, const TDesC8& aData) const;
- 	void DoUpdateColor(TRgb aColor);
-protected:
-	MWsGraphicDrawerContext* iContext;
-	TRgb iColor;
-};
-
-// First Contained (Child) drawer
-NONSHARABLE_CLASS(CWsInvisibleGraphicDrawer1): public CWsSimpleGraphicDrawer//, public MWsEventHandler
-	{
-public:
-	enum {EImplUid = 0x10283539};	
-		
-public:		
-	static CWsInvisibleGraphicDrawer1* NewL();
-	virtual ~CWsInvisibleGraphicDrawer1();
-	// override CWsGraphicDrawer
-	virtual void ConstructL(MWsGraphicDrawerEnvironment& aEnv,const TGraphicDrawerId& aId, MWsClient& aOwner, const TDesC8& aData);
-};
-
-// Second contained (child) drawer
-NONSHARABLE_CLASS(CWsInvisibleGraphicDrawer2): public CWsSimpleGraphicDrawer//, public MWsEventHandler
-	{
-public:
-	enum {EImplUid = 0x1028353B};	
-		
-public:		
-	static CWsInvisibleGraphicDrawer2* NewL();
-	virtual ~CWsInvisibleGraphicDrawer2();
-	// override CWsGraphicDrawer
-	virtual void ConstructL(MWsGraphicDrawerEnvironment& aEnv,const TGraphicDrawerId& aId, MWsClient& aOwner, const TDesC8& aData);
-};
-
-#endif
--- a/windowing/windowserver/tcontaindrawer/wscontaindrawer.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// The plug-in provides the client side CWsGraphic instance CWsListen, which is used in 
-// GRAPHICS-WSERV-0438. 
-// This also provides Test Case INC103472: CRedrawRegion::ContainsDrawers does not look for all drawers. 
-// The customer incident "INC103472" reports CWsRedrawMsgWindow::CRedrawRegion::ContainsDrawers in wnredraw.cpp 
-// is suppose to return whether some drawers are contained within a specific region. 
-// But right now it doesn't check for drawers in drawers.
-// So if one drawer from the iDrawerArray contains one of the drawers passed along 
-// in aDrawers it will still return EFalse when it should return ETrue.
-// The fix is added in CWsRedrawMsgWindow::CRedrawRegion::ContainsDrawers(const TArray& aDrawers,const RRegion& aRegion).
-// The drawer->Contains() call will end up in HasAsChild(const TArray& aIds), 
-// where the CWsGraphicDrawer has to look for its own nested drawers and return ETrue or EFalse.
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-//CWsGraphic
-#include "wscontaindrawer.h"
-
-CWsContainGraphicBitmap::CWsContainGraphicBitmap()
-	{
-	}
-
-EXPORT_C CWsContainGraphicBitmap::~CWsContainGraphicBitmap()
-	{
-	iIsReady = EFalse;
-	}
-
-EXPORT_C CWsContainGraphicBitmap* CWsContainGraphicBitmap::NewL()
-	{
-	CWsContainGraphicBitmap* self = new(ELeave) CWsContainGraphicBitmap;
-	CleanupStack::PushL(self);
-	self->BaseConstructL(KContainDrawerImplId,KNullDesC8());
-	self->iIsReady = ETrue;
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-EXPORT_C CWsContainGraphicBitmap* CWsContainGraphicBitmap::NewL(TUid aUid)
-	{
-	CWsContainGraphicBitmap* self = new(ELeave) CWsContainGraphicBitmap;
-	CleanupStack::PushL(self);
-	self->BaseConstructL(aUid,KContainDrawerImplId,KNullDesC8());
- 	self->iIsReady = ETrue;
-  	CleanupStack::Pop(self);
-	return self;
-	}
-	
-EXPORT_C CWsContainGraphicBitmap* CWsContainGraphicBitmap::NewL(const TWsGraphicId& aReplace)
-	{
-	CWsContainGraphicBitmap* self = new(ELeave) CWsContainGraphicBitmap;
-	CleanupStack::PushL(self);
-    self->BaseConstructL(aReplace,KContainDrawerImplId,KNullDesC8());
-  	self->iIsReady = ETrue;
-  	CleanupStack::Pop(self);
-	return self;
-	}
-
-EXPORT_C TInt CWsContainGraphicBitmap::UpdateColor(TRgb aColor)
-	{
-	if (!iIsReady)
-		return KErrNotReady;
-	// Send the color the server side
-	TBuf8<3> cmd;
-	TInt red = aColor.Red();
-	TInt green = aColor.Green();
-	TInt blue = aColor.Blue();
-    //Append the color
-	cmd.Append(red);
-	cmd.Append(green);
-	cmd.Append(blue);
-	
-	SendMessage(cmd);
-	return Flush();
-	}
-
-
-EXPORT_C void CWsContainGraphicBitmap::HandleMessage(const TDesC8& /*aData*/)
-	{
-	}
-
-EXPORT_C void CWsContainGraphicBitmap::OnReplace()
-	{
-	}
-
-EXPORT_C TInt CWsContainGraphicBitmap::ShareGlobally()
-	{
-	return CWsGraphic::ShareGlobally();
-	}
-
-EXPORT_C TInt CWsContainGraphicBitmap::UnShareGlobally()
-	{
-	return CWsGraphic::UnShareGlobally();
-	}
-
-EXPORT_C TInt CWsContainGraphicBitmap::Share(TSecureId aClientId)
-	{
-	return CWsGraphic::Share(aClientId);
-	}
-
-EXPORT_C TInt CWsContainGraphicBitmap::UnShare(TSecureId aClientId)
-	{
-	return CWsGraphic::UnShare(aClientId);
-	}   
-	 
--- a/windowing/windowserver/tcontaindrawer/wscontaindrawer.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __WSCONTAINDRAWER_H__
-#define __WSCONTAINDRAWER_H__
-
-#include <w32std.h>
-
-const TUid KContainDrawerInterfaceId = {0x10283522};
-const TUid KContainDrawerImplId = {0x10283521};
-/** Client representation of a window-server-side drawing owned by this Client
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(CWsContainGraphicBitmap): public CWsGraphic
-	{
-public:
-	IMPORT_C static CWsContainGraphicBitmap* NewL();
-	IMPORT_C static CWsContainGraphicBitmap* NewL(TUid aUid);
-	IMPORT_C static CWsContainGraphicBitmap* NewL(const TWsGraphicId& aReplace);
-	IMPORT_C ~CWsContainGraphicBitmap();
-public: 
-	IMPORT_C TInt ShareGlobally();
-	IMPORT_C TInt UnShareGlobally();
-	IMPORT_C TInt Share(TSecureId aClientId);
-	IMPORT_C TInt UnShare(TSecureId aClientId);
-	
-	IMPORT_C TInt UpdateColor(TRgb aColor);
-public:
-	CWsContainGraphicBitmap();
-	void HandleMessage(const TDesC8& aData);
-	void OnReplace();
-private:
-	TBool iIsReady;
-};
-
-#endif
--- a/windowing/windowserver/tcontaindrawer/wsgraphicdrawercontext.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef __WSGRAPHICDRAWERCONTEXT_H__
-#define __WSGRAPHICDRAWERCONTEXT_H__
-
-#include <e32base.h>
-#include <e32std.h>
-
-class MWsGc;
-class TRgb;
-
-class MWsGraphicDrawerContext
-	{
-public:
-	virtual void Destroy() = 0;
-	virtual void DrawEllipse(MWsGc& aGc, const TRect& aRect, const TRgb& aColor) const = 0;
-	};
-
-class CWsGraphicDrawerNgaContext : public CBase, public MWsGraphicDrawerContext
-	{
-public:
-	static MWsGraphicDrawerContext* NewL();
-public:
-	void Destroy();
-	void DrawEllipse(MWsGc& aGc, const TRect& aRect, const TRgb& aColor) const;
-	};
-
-class CWsGraphicDrawerNonNgaContext : public CBase, public MWsGraphicDrawerContext
-	{
-public:
-	static MWsGraphicDrawerContext* NewL();
-public:
-	void Destroy();
-	void DrawEllipse(MWsGc& aGc, const TRect& aRect, const TRgb& aColor) const;
-	};
-
-#endif // __WSGRAPHICDRAWERCONTEXT_H__
--- a/windowing/windowserver/tcontaindrawer/wsgraphicdrawerngacontext.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#define SYMBIAN_GRAPHICS_GCE
-
-#include "wsgraphicdrawercontext.h"
-#include <graphics/wsgraphicscontext.h>
-
-MWsGraphicDrawerContext* CWsGraphicDrawerNgaContext::NewL()
-	{
-	return new(ELeave) CWsGraphicDrawerNgaContext();
-	}
-
-void CWsGraphicDrawerNgaContext::Destroy()
-	{
-	delete this;
-	}
-
-void CWsGraphicDrawerNgaContext::DrawEllipse(MWsGc& aGc, const TRect& aRect, const TRgb& aColor) const
-	{
-	MWsGraphicsContext* context = aGc.ObjectInterface<MWsGraphicsContext>();
-	if (context)
-		{
-		context->Push();
-		context->SetBrushStyle(MWsGraphicsContext::ESolidBrush);
-		context->SetBrushColor(aColor);
-		context->DrawEllipse(aRect);
-		context->Pop();
-		}
-	}
--- a/windowing/windowserver/tcontaindrawer/wsgraphicdrawernonngacontext.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#undef SYMBIAN_GRAPHICS_GCE
-
-#include "wsgraphicdrawercontext.h"
-#include <graphics/wsgraphicdrawerinterface.h>
-#include <bitstd.h>
-
-MWsGraphicDrawerContext* CWsGraphicDrawerNonNgaContext::NewL()
-	{
-	return new(ELeave) CWsGraphicDrawerNonNgaContext();
-	}
-
-void CWsGraphicDrawerNonNgaContext::Destroy()
-	{
-	delete this;
-	}
-
-void CWsGraphicDrawerNonNgaContext::DrawEllipse(MWsGc& aGc, const TRect& aRect, const TRgb& aColor) const
-	{
-	aGc.PushBitGcSettings();
-	CFbsBitGc& bitGc = aGc.BitGc();
-	bitGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
-	bitGc.SetBrushColor(aColor);
-	bitGc.DrawEllipse(aRect);
-	aGc.PopBitGcSettings();
-	}
--- a/windowing/windowserver/tcontaindrawer/wssimpledrawer.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,181 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// The plug-in provides the client side CWsGraphic instance CWsListen, which is used in 
-// GRAPHICS-WSERV-0438. 
-// This also provides Test Case INC103472: CRedrawRegion::ContainsDrawers does not look for all drawers. 
-// The customer incident "INC103472" reports CWsRedrawMsgWindow::CRedrawRegion::ContainsDrawers in wnredraw.cpp 
-// is suppose to return wheather some drawers are contained within a specific region. 
-// But it currently fails to check for drawers in drawers.
-// So if one drawer from the iDrawerArray contains one of the drawers passed along 
-// in aDrawers it will still return EFalse when it should return ETrue.
-// The fix is added in CWsRedrawMsgWindow::CRedrawRegion::ContainsDrawers(const TArray& aDrawers,const RRegion& aRegion).
-// The drawer->Contains() call will end up in HasAsChild(const TArray& aIds), 
-// where the CWsGraphicDrawer has to look for its own nested drawers and return ETrue or EFalse.
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-//CWsGraphic
-#include "wssimpledrawer.h"
-#include <s32mem.h>
-
-CWsSimpleGraphicBitmap::CWsSimpleGraphicBitmap()
-	{
-	}
-
-EXPORT_C CWsSimpleGraphicBitmap::~CWsSimpleGraphicBitmap()
-	{
-	iIsReady = EFalse;
-	}
-
-EXPORT_C CWsSimpleGraphicBitmap* CWsSimpleGraphicBitmap::NewL()
-	{
-	CWsSimpleGraphicBitmap* self = new(ELeave) CWsSimpleGraphicBitmap;
-	CleanupStack::PushL(self);
- 	self->BaseConstructL(KSimpleDrawerImplId,KNullDesC8());
-	self->iIsReady = ETrue;
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-EXPORT_C CWsSimpleGraphicBitmap* CWsSimpleGraphicBitmap::NewL(TUid aUid)
-	{
-	CWsSimpleGraphicBitmap* self = new(ELeave) CWsSimpleGraphicBitmap;
-	CleanupStack::PushL(self);
-	self->BaseConstructL(aUid,KSimpleDrawerImplId,KNullDesC8());
-	self->iIsReady = ETrue;
-	CleanupStack::Pop(self);
-	return self;
-	}
-	
-EXPORT_C CWsSimpleGraphicBitmap* CWsSimpleGraphicBitmap::NewL(const TWsGraphicId& aReplace)
-	{
-	CWsSimpleGraphicBitmap* self = new(ELeave) CWsSimpleGraphicBitmap;
-	CleanupStack::PushL(self);
-	self->BaseConstructL(aReplace,KSimpleDrawerImplId,KNullDesC8());
-	self->iIsReady = ETrue;
- 	CleanupStack::Pop(self);
-	return self;
-	}
-
-EXPORT_C TInt CWsSimpleGraphicBitmap::UpdateColor(TRgb aColor)
-	{
-	if (!iIsReady)
-		return KErrNotReady;
-	// Send the message to server side
-	TBuf8<3> cmd;
-	TInt red = aColor.Red();
-	TInt green = aColor.Green();
-	TInt blue = aColor.Blue();
-    //Append the color
-	cmd.Append(red);
-	cmd.Append(green);
-	cmd.Append(blue);
-	
-	SendMessage(cmd);
-	return Flush();
-	}
-
-EXPORT_C void CWsSimpleGraphicBitmap::HandleMessage(const TDesC8& /*aData*/)
-	{
-	}
-
-EXPORT_C void CWsSimpleGraphicBitmap::OnReplace()
-	{
-	}
-
-EXPORT_C TInt CWsSimpleGraphicBitmap::ShareGlobally()
-	{
-	return CWsGraphic::ShareGlobally();
-	}
-
-EXPORT_C TInt CWsSimpleGraphicBitmap::UnShareGlobally()
-	{
-	return CWsGraphic::UnShareGlobally();
-	}
-
-EXPORT_C TInt CWsSimpleGraphicBitmap::Share(TSecureId aClientId)
-	{
-	return CWsGraphic::Share(aClientId);
-	}
-
-EXPORT_C TInt CWsSimpleGraphicBitmap::UnShare(TSecureId aClientId)
-	{
-	return CWsGraphic::UnShare(aClientId);
-	}  		 
-
-EXPORT_C CWsInvisibleGraphicBitmap1* CWsInvisibleGraphicBitmap1::NewL()
-	{
-	CWsInvisibleGraphicBitmap1* self = new(ELeave) CWsInvisibleGraphicBitmap1;
-	CleanupStack::PushL(self);
-	self->BaseConstructL(KInvisibleDrawerImplId1,KNullDesC8());
-	self->iIsReady = ETrue;
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-EXPORT_C CWsInvisibleGraphicBitmap1* CWsInvisibleGraphicBitmap1::NewL(TUid aUid)
-	{
-	CWsInvisibleGraphicBitmap1* self = new(ELeave) CWsInvisibleGraphicBitmap1;
-	CleanupStack::PushL(self);
-	self->BaseConstructL(aUid,KInvisibleDrawerImplId1,KNullDesC8());
-	self->iIsReady = ETrue;
-	CleanupStack::Pop(self);
-	return self;
-	}
-	
-EXPORT_C CWsInvisibleGraphicBitmap1* CWsInvisibleGraphicBitmap1::NewL(const TWsGraphicId& aReplace)
-	{
-	CWsInvisibleGraphicBitmap1* self = new(ELeave) CWsInvisibleGraphicBitmap1;
-	CleanupStack::PushL(self);
-	self->BaseConstructL(aReplace,KInvisibleDrawerImplId1,KNullDesC8());
-	self->iIsReady = ETrue;
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-EXPORT_C CWsInvisibleGraphicBitmap2* CWsInvisibleGraphicBitmap2::NewL()
-	{
-	CWsInvisibleGraphicBitmap2* self = new(ELeave) CWsInvisibleGraphicBitmap2;
-	CleanupStack::PushL(self);
- 	self->BaseConstructL(KInvisibleDrawerImplId2,KNullDesC8());
-	self->iIsReady = ETrue;
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-EXPORT_C CWsInvisibleGraphicBitmap2* CWsInvisibleGraphicBitmap2::NewL(TUid aUid)
-	{
-	CWsInvisibleGraphicBitmap2* self = new(ELeave) CWsInvisibleGraphicBitmap2;
-	CleanupStack::PushL(self);
-	self->BaseConstructL(aUid,KInvisibleDrawerImplId2,KNullDesC8());
-	self->iIsReady = ETrue;
- 	CleanupStack::Pop(self);
-	return self;
-	}
-	
-EXPORT_C CWsInvisibleGraphicBitmap2* CWsInvisibleGraphicBitmap2::NewL(const TWsGraphicId& aReplace)
-	{
-	CWsInvisibleGraphicBitmap2* self = new(ELeave) CWsInvisibleGraphicBitmap2;
-	CleanupStack::PushL(self);
-	self->BaseConstructL(aReplace,KInvisibleDrawerImplId2,KNullDesC8());
-	self->iIsReady = ETrue;
- 	CleanupStack::Pop(self);
-	return self;
-	}
-
--- a/windowing/windowserver/tcontaindrawer/wssimpledrawer.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __WSSIMPLEDRAWER_H__
-#define __WSSIMPLEDRAWER_H__
-
-
-#include <w32std.h>
-const TUid KSimpleDrawerInterfaceId = {0x1028351B};
-const TUid KSimpleDrawerImplId = {0x1028351C};
-
-/** Client representation of a window-server-side drawing owned by this Client
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(CWsSimpleGraphicBitmap): public CWsGraphic
-	{
-public:
-	IMPORT_C static CWsSimpleGraphicBitmap* NewL();
-	IMPORT_C static CWsSimpleGraphicBitmap* NewL(TUid aUid);
-	IMPORT_C static CWsSimpleGraphicBitmap* NewL(const TWsGraphicId& aReplace);
-
-	IMPORT_C ~CWsSimpleGraphicBitmap();
-public: // protected virtuals from CWsGraphic promoted to public
-	IMPORT_C TInt ShareGlobally();
-	IMPORT_C TInt UnShareGlobally();
-	IMPORT_C TInt Share(TSecureId aClientId);
-	IMPORT_C TInt UnShare(TSecureId aClientId);
-	
-	IMPORT_C TInt UpdateColor(TRgb aColor);
-
-public:
-	CWsSimpleGraphicBitmap();
-	void HandleMessage(const TDesC8& aData);
-	void OnReplace();
-public:
-	TBool iIsReady;
-};
-
-
-const TUid KInvisibleDrawerInterfaceId1 = {0x1028353A};
-const TUid KInvisibleDrawerImplId1 = {0x10283539};
-
-/** Client representation of a window-server-side drawing owned by this Client
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(CWsInvisibleGraphicBitmap1): public CWsSimpleGraphicBitmap
-	{
-public:
-	IMPORT_C static CWsInvisibleGraphicBitmap1* NewL();
-	IMPORT_C static CWsInvisibleGraphicBitmap1* NewL(TUid aUid);
-	IMPORT_C static CWsInvisibleGraphicBitmap1* NewL(const TWsGraphicId& aReplace);
-};
-
-
-const TUid KInvisibleDrawerInterfaceId2 = {0x1028353C};
-const TUid KInvisibleDrawerImplId2 = {0x1028353B};
-
-/** Client representation of a window-server-side drawing owned by this Client
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(CWsInvisibleGraphicBitmap2): public CWsSimpleGraphicBitmap
-	{
-public:
-	IMPORT_C static CWsInvisibleGraphicBitmap2* NewL();
-	IMPORT_C static CWsInvisibleGraphicBitmap2* NewL(TUid aUid);
-	IMPORT_C static CWsInvisibleGraphicBitmap2* NewL(const TWsGraphicId& aReplace);
-};
-
-
-
-#endif
--- a/windowing/windowserver/tcrx/tcrx.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,393 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include <gdi.h>
-#include "tcrx.h"
-#include "wsredir.h"
-#include "wslisten.h"
-
-static TRedirectorInfo TheInfo;
-
-class CTwoWindow: public CBase
-	{
-public:
-	static CTwoWindow* NewL();
-	~CTwoWindow();
-private:
-	void ConstructL();
-private:
-	RWsSession iWs;
-	CWsScreenDevice* iScr;
-	CWindowGc* iGc;
-	RWindowGroup iGroup;
-	RWindow iBg;
-	RWindow iFg;
-	};
-
-CTwoWindow* CTwoWindow::NewL()
-	{
-	CTwoWindow* tw = new(ELeave) CTwoWindow;
-	CleanupStack::PushL(tw);
-	tw->ConstructL();
-	CleanupStack::Pop(tw);
-	return tw;
-	}
-
-CTwoWindow::~CTwoWindow()
-	{
-	iFg.Close();
-	iBg.Close();
-	iGroup.Close();
-	delete iGc;
-	delete iScr;
-	iWs.Close();	
-	}
-
-void CTwoWindow::ConstructL()
-	{
-	User::LeaveIfError(iWs.Connect());
-	iScr = new(ELeave) CWsScreenDevice(iWs);
-	User::LeaveIfError(iScr->Construct());
-	User::LeaveIfError(iScr->CreateContext(iGc));
-	iGroup = RWindowGroup(iWs);
-	User::LeaveIfError(iGroup.Construct(0xc0de,ETrue));
-	
-	iBg = RWindow(iWs);
-	User::LeaveIfError(iBg.Construct(iGroup,0xc0debabe));
-	iBg.SetRequiredDisplayMode(EColor64K);
-	iBg.Activate();
-	iWs.Flush();
-
-	iBg.BeginRedraw();
-	iGc->Activate(iBg);
-	iGc->SetBrushColor(KRgbGreen);
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	TRect rect(iScr->SizeInPixels());
-	iGc->DrawRect(rect);
-	iGc->SetBrushColor(KRgbBlue);
-	iGc->DrawEllipse(rect);
-	iGc->Deactivate();
-	iBg.EndRedraw();
-	iWs.Flush();
-	
-	iFg = RWindow(iWs);
-	User::LeaveIfError(iFg.Construct(iGroup,0xc0decafe));
-	iFg.SetRequiredDisplayMode(EColor64K);
-	iFg.SetTransparencyAlphaChannel();
-	iFg.SetBackgroundColor(TRgb(0xff,0x55,0x55,0x80));
-	iFg.Activate();
-	iWs.Flush();
-	}
-
-CClient* CClient::NewL()
-	{
-	CClient* self = new(ELeave) CClient;
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	
-	return self;
-	}
-
-CClient::CClient(): CActive(CActive::EPriorityStandard)
-	{
-	}
-
-void CClient::ConstructL()
-	{
-	CActiveScheduler::Add(this);
-	User::LeaveIfError(iWs.Connect());
-	iScreen = new(ELeave) CWsScreenDevice(iWs);
-	User::LeaveIfError(iScreen->Construct(0));
-	iGroup = RWindowGroup(iWs);
-	User::LeaveIfError(iGroup.Construct(0xCAFE, ETrue));
-	iGc = new(ELeave) CWindowGc(iScreen);
-	User::LeaveIfError(iGc->Construct());
-	iWin = new(ELeave) CWindow(this);
-	iWin->ConstructL(NULL, EFalse);
-	iRedraw = CRedrawHandler::NewL(this);
-
-	iRedir = CWsRedir::NewL();
-	iListen = CWsListen::NewL();
-		
-	MakeRequest();
-	}
-
-void CClient::HandleCommand(TInt aCmd)
-	{
-	switch (aCmd)
-		{
-		case 1:
-		iRedir->Redirect(CWsRedir::EFrontBuffer, ETrue);
-		break;
-
-		case 2:
-		iRedir->Redirect(CWsRedir::EBackBuffer, ETrue);
-		break;
-
-		case 3:
-		iRedir->Redirect(CWsRedir::EFrontBuffer, EFalse);
-		break;
-
-		case 4:
-		iRedir->Redirect(CWsRedir::EBackBuffer, EFalse);
-		break;
-
-		case 5:
-		iListen->Enable(ETrue);
-		break;
-
-		case 6:
-		iListen->Enable(EFalse);
-		break;
-
-		case 7:
-		iRedir->QueryPlugin(TheInfo);
-		break;
-		
-		case 8:
-		iBlank.Close();
-		iBlank = RBlankWindow(iWs);
-		iBlank.Construct(iGroup, 0xbeef);
-		iBlank.SetRequiredDisplayMode(EColor64K);
-		iBlank.SetColor(KRgbRed);
-		iBlank.SetExtent(TPoint(20,20),TSize(100,100));
-		iBlank.Activate();
-		break;
-		
-		case 9:
-		ClearTwoWindow();
-		DrawTwoWindow();
-		break;
-		
-		case 10:
-		CActiveScheduler::Stop();
-		break;
-		}
-	}
-	
-CClient::~CClient()
-	{	
-	Deque();
-	ClearTwoWindow();
-	iBlank.Close();
-	
-	delete iListen;
-	delete iRedir;
-	delete iWin;
-	delete iRedraw;
-	delete iGc;
-	delete iScreen;
-	
-	iGroup.Close();
-	iWs.Close();
-	}
-
-void CClient::DrawTwoWindow()
-	{
-	TRAP_IGNORE(iTwo = CTwoWindow::NewL());
-	}
-
-void CClient::ClearTwoWindow()
-	{
-	delete iTwo;
-	iTwo = NULL;	
-	}
-
-void CClient::RunL()
-	{
-	iWs.GetEvent(iEvent);
-	if (iEvent.Type()==EEventKey)
-		HandleCommand(iEvent.Key()->iCode-'0');
-	MakeRequest();
-	}
-
-void CClient::DoCancel()
-	{
-	iWs.EventReadyCancel();
-	}
-
-void CClient::MakeRequest()
-	{
-	iWs.EventReady(&iStatus);
-	SetActive();
-	}
-
-CRedrawHandler* CRedrawHandler::NewL(CClient* aClient)
-	{
-	CRedrawHandler* self=new(ELeave) CRedrawHandler(aClient);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	
-	return self;
-	}
-
-CRedrawHandler::CRedrawHandler(CClient* aClient) : CActive(CActive::EPriorityStandard), iClient(aClient)
-	{
-	}
-
-void CRedrawHandler::ConstructL()
-	{
-	CActiveScheduler::Add(this);
-	MakeRequest();
-	}
-
-CRedrawHandler::~CRedrawHandler()
-	{
-	Cancel();
-	}
-
-void CRedrawHandler::RunL()
-	{
-	TWsRedrawEvent event;
-	iClient->Ws().GetRedraw(event);
-	CWindow* win = (CWindow*)event.Handle();
-	if (win) 
-		{
-		TRect rect=event.Rect();
-		iClient->Gc().Activate(win->Window());
-		win->Window().BeginRedraw(rect);
-		win->Draw(rect);
-		win->Window().EndRedraw();
-		iClient->Gc().Deactivate();
-		}
-		
-	MakeRequest();
-	}
-
-void CRedrawHandler::MakeRequest()
-	{
-	iClient->Ws().RedrawReady(&iStatus);
-	SetActive();
-	}
-
-void CRedrawHandler::DoCancel()
-	{
-	iClient->Ws().RedrawReadyCancel();
-	}
-
-CWindow::CWindow(CClient* aClient) : iClient(aClient)
-	{
-	}
-
-CWindow::~CWindow()
-	{
-	iWin.Close();
-	}
-
-void CWindow::ConstructL(CWindow* aParent, TBool aTransparentFlag)
-	{
-	iParent = aParent;
-	iWin = RWindow(iClient->Ws());
-	RWindowTreeNode* node=iParent? &iParent->Window() : (RWindowTreeNode*)&iClient->Group();
-	User::LeaveIfError(iWin.Construct(*node, (TUint32)this));
-	iWin.SetRequiredDisplayMode(EColor64K);
-	if (aTransparentFlag)
-		{
-		iWin.SetBackgroundColor(TRgb(0,0,0,0x80));
-		iWin.SetTransparencyAlphaChannel();
-		}
-	iWin.SetExtent(TPoint(0,0),TSize(240,240));
-	iWin.Activate();
-	}
-
-void CWindow::Draw(const TRect& aRect) const
-	{
-	CWindowGc& gc = iClient->Gc();
-	gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
-	gc.SetBrushColor(TRgb(0,0,0xff,0xff));	
-	gc.DrawRect(TRect(aRect.iTl.iX,aRect.iTl.iY,aRect.iBr.iX,aRect.iBr.iY/2));
-	gc.SetBrushColor(TRgb(0,0,0xff,0x80));	
-	gc.DrawRect(TRect(aRect.iTl.iX,aRect.iBr.iY/2,aRect.iBr.iX,aRect.iBr.iY));	
-	DrawMenu();
-	
-	gc.DrawWsGraphic(iClient->WsRedir()->Id(),TRect(aRect.iTl.iX,aRect.iBr.iY/2,aRect.iBr.iX,aRect.iBr.iY));
-	}
-
-_LIT(KMenu1, "1. Redirect screen");
-_LIT(KMenu2, "2. Redirect flickerfree");
-_LIT(KMenu3, "3. Restore screen");
-_LIT(KMenu4, "4. Restore flickerfree");
-_LIT(KMenu5, "5. Register event listener");
-_LIT(KMenu6, "6. Unregister listener");
-_LIT(KMenu7, "7. Test send receive msg");
-_LIT(KMenu8, "8. Test blank window");
-_LIT(KMenu9, "9. Test two window");
-_LIT(KMenuA, "A. Exit");
-
-const TBufC<32> TheMenu[] = 
-	{
-	(const TDesC&)KMenu1,
-	(const TDesC&)KMenu2,
-	(const TDesC&)KMenu3,
-	(const TDesC&)KMenu4,
-	(const TDesC&)KMenu5,
-	(const TDesC&)KMenu6,
-	(const TDesC&)KMenu7,
-	(const TDesC&)KMenu8,
-	(const TDesC&)KMenu9,
-	(const TDesC&)KMenuA
-	};
-	
-_LIT(KTypeFace, "DejaVu Sans Condensed");
-
-void CWindow::DrawMenu() const
-	{
-	CWsScreenDevice* scr = iClient->Screen();
-	CFont* font = NULL;
-	TFontSpec fs(KTypeFace, 15);
-	scr->GetNearestFontInPixels(font, fs);
-	CWindowGc& gc = iClient->Gc();
-	gc.UseFont(font);
-	TInt h = font->HeightInPixels();
-	gc.SetPenColor(KRgbYellow);
-	TInt nMenu = sizeof(TheMenu)/sizeof(TheMenu[0]);
-	for (TInt ii=0; ii<nMenu; ++ii)
-		gc.DrawText(TheMenu[ii], TPoint(10,(ii+1)*h));
-	gc.DiscardFont();
-	scr->ReleaseFont(font);
-	}
-
-void MainL()
-	{
-	CClient* client=CClient::NewL();
-	CActiveScheduler::Start();
-	
-	delete client;
-	}
-
-GLDEF_C TInt E32Main()
-	{
-	CTrapCleanup* trap=CTrapCleanup::New();
-	if (!trap)
-		return KErrNoMemory;
-	CActiveScheduler* scheduler = new(ELeave) CActiveScheduler;
-	CActiveScheduler::Install(scheduler);
-	
-	__UHEAP_MARK;	
-	TRAPD(err, MainL());
-	__UHEAP_MARKEND;	
-	
-	delete scheduler;
-	delete trap;
-	return err;
-	}
--- a/windowing/windowserver/tcrx/tcrx.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,128 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __TCRX_H__
-#define __TCRX_H__
-
-#include <e32base.h>
-#include <w32std.h>
-
-class CRedrawHandler;
-class CWindow;
-class CWsListen;
-class CWsRedir;
-class CTwoWindow;
-
-class CClient: public CActive
-	{
-public:
-	static CClient* NewL();
-	~CClient();
-	void RunL();
-	void DoCancel();
-	inline RWsSession& Ws();
-	inline RWindowGroup& Group();
-	inline CWindowGc& Gc();
-	inline CWindow* Win();
-	inline CWsScreenDevice* Screen();
-	inline CWsRedir* WsRedir();
-	inline CWsListen* WsListen();
-	void HandleCommand(TInt aCmd);
-private:
-	CClient();
-	void ConstructL();
-	void MakeRequest();
-	void DrawTwoWindow();
-	void ClearTwoWindow();
-
-	RWsSession iWs;
-	RWindowGroup iGroup;
-	CWsScreenDevice* iScreen;
-	CWindowGc* iGc;
-	TWsEvent iEvent;
-	CWindow* iWin;
-	CRedrawHandler* iRedraw;
-	CWsListen* iListen;
-	CWsRedir* iRedir;
-	RBlankWindow iBlank;
-	CTwoWindow* iTwo;
-	};
-
-class CRedrawHandler: public CActive
-	{
-public:
-	static CRedrawHandler* NewL(CClient* aClient);
-	~CRedrawHandler();
-	void RunL();
-	void DoCancel();
-private:
-	CRedrawHandler(CClient* aClient);
-	void ConstructL();
-	void MakeRequest();
-
-	CClient* iClient;
-	};
-
-class CWindow: public CBase
-	{
-public:
-	CWindow(CClient* aClient);
-	void ConstructL(CWindow* aParent, TBool aTransparentFlag);
-	~CWindow();
-	void Draw(const TRect& aRect) const;
-	void DrawMenu() const;
-	inline RWindow& Window();
-	inline CWindow* Parent();
-	inline TSize Size();
-	inline CClient* Client();
-private:
-	CClient* iClient;
-	RWindow iWin;
-	CWindow* iParent;
-	};
-
-// CClient
-inline RWsSession& CClient::Ws() 
-	{return iWs;}
-inline RWindowGroup& CClient::Group() 
-	{return iGroup;}
-inline CWindowGc& CClient::Gc() 
-	{return *iGc;}
-inline CWindow* CClient::Win() 
-	{return iWin;}
-inline CWsScreenDevice* CClient::Screen() 
-	{return iScreen;}
-inline CWsListen* CClient::WsListen()
-	{return iListen;}
-inline CWsRedir* CClient::WsRedir()
-	{return iRedir;}
-// CWindow
-inline RWindow& CWindow::Window() 
-	{return iWin;}
-inline CWindow* CWindow::Parent() 
-	{return iParent;}
-inline TSize CWindow::Size() 
-	{return iWin.Size();}
-inline CClient* CWindow::Client() 
-	{return iClient;}
-
-#endif
-
--- a/windowing/windowserver/tcsc/cwsgcecsc.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,656 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// @file
-// 
-//
-
-#include <w32std.h>
-#include <e32std.h>
-#include "cwsgcecsc.h"
-#include "extendtef.h"
-#include "teflogextensions.h"
-#include "testscreencapture.h"
-
-
-#if defined(__X86GCC__)
-extern "C" TInt atexit(void (*function)(void))
-	{
-	return KErrNone;
-	}
-#endif
-
-void TefUnitFailLeaveL()
-	{
-	User::Leave(KErrTEFUnitFail);
-	}
-
-CWSGceCsc::CWSGceCsc()
-	{
-	}
-
-CWSGceCsc::~CWSGceCsc()
-	{
-	}
-
-/**
-Common set up code for all tests.
-
-Creates the session and window group for further windows, plus a simple white
-background to obscure any unwanted stuff behind the test. Sets up the surface
-update session and surface manager, to work with surfaces. Creates a screen
-device for use in the tests.
-*/
-void CWSGceCsc::SetupL()
-	{
-	CWsGceCscBase::SetupL();
-	}
-
-/**
-Common tear down code for all tests.
-
-Windows, group and session created are closed. Screen device is destroyed.
-Surfaces, manager and update session are closed.
-*/
-void CWSGceCsc::TearDownL()
-	{
-	CWsGceCscBase::TearDownL();
-	}
-
-CTestSuite* CWSGceCsc::CreateSuiteL( const TDesC& aName)
-	{
-	SUB_SUITE;
-	ADD_WSGCE_TEST_STEP(CWSGceCsc, GRAPHICS_WSERV_CSC_101L);
-	ADD_WSGCE_TEST_STEP(CWSGceCsc, GRAPHICS_WSERV_CSC_102L);
-	ADD_WSGCE_TEST_STEP(CWSGceCsc, GRAPHICS_WSERV_CSC_103L);
-	ADD_WSGCE_TEST_STEP(CWSGceCsc, GRAPHICS_WSERV_CSC_104L);
-	ADD_WSGCE_TEST_STEP(CWSGceCsc, GRAPHICS_WSERV_CSC_105L);
-	END_SUITE;
-	}
-
-/**
- @SYMTestCaseID			GRAPHICS_WSERV_CSC_101L
- 
- @SYMTestCaseDesc		Compare the screen composition using the new and legacy API
- 						
- @SYMPREQ				CSC
- 
- @SYMTestStatus			Implemented
- 
- @SYMTestPriority		1
- 
- @SYMTestPurpose		To check that the screen composition retrieved using the new and legacy APIs
-
- @SYMTestActions		Initialization.
-						Construct a background opaque window.
-						Create two bitmaps with the size equal with the composition.
-						Draw something on the screen.
-						Use legacy API CopyScreenToBitmap() to copy the screen to first bitmap.
-						Use the the new API to copy the composition of the screen.
-						Compare the results.
- 
- @SYMTestExpectedResults  The bitmap should be identical	 
-*/
-void CWSGceCsc::GRAPHICS_WSERV_CSC_101L()
-	{
-	TRect screen(iScreenDevice->SizeInPixels());
-	RWindow nonSurfacedWindow(iSession);
-	iTestName.Format(_L("GRAPHICS_WSERV_CSC_101L"));
-
-	INFO_PRINTF2(_L("%S"),&iTestName);
-	iDisplayMode = iScreenDevice->DisplayMode();	// Get default display mode
-
-	ConstructOpaqueWindowLC(nonSurfacedWindow, 
-			                iCyan, 
-		                    0, 
-                            TPoint(0, 0),
-                            screen.Size());
-	iSession.Flush();
-	Pause(1000);
-
-	MTestScreenCapture* csc = static_cast<MTestScreenCapture*> (iScreenDevice->GetInterface(MTestScreenCapture::KUidTestScreenCaptureIf));
-    ASSERT_NOT_NULL(csc);
-
-	TSize compositionScreenSize;
-	
-	User::LeaveIfError(csc->GetCompositedSize(compositionScreenSize));
-	
-    CFbsBitmap *bmp1 = new (ELeave) CFbsBitmap;
-    CleanupStack::PushL(bmp1);
-    User::LeaveIfError(bmp1->Create(compositionScreenSize, EColor16MU));
-    
-    CFbsBitmap *bmp2 = new (ELeave) CFbsBitmap;
-    CleanupStack::PushL(bmp2);
-	User::LeaveIfError(bmp2->Create(compositionScreenSize, EColor16MU));
-	
-	iSession.Flush();
-	Pause(200);
-	
-	iScreenDevice->CopyScreenToBitmap(bmp1);
-	User::LeaveIfError(csc->ComposeScreen(*bmp2));
-	
-	SetBackgroundColorWindow(nonSurfacedWindow, iRed);
-	iSession.Flush();
-	
-	Pause(500);
-	
-	iGc->Activate(nonSurfacedWindow);
-	iGc->BitBlt(TPoint(0, 0), bmp1);
-	iGc->Deactivate();
-	iSession.Flush();
-	Pause(500);
-	
-	SetBackgroundColorWindow(nonSurfacedWindow, iWhite);
-	iSession.Flush();
-	Pause(500);
-	
-	iGc->Activate(nonSurfacedWindow);
-	iGc->BitBlt(TPoint(0, 0), bmp2);
-	iGc->Deactivate();
-	iSession.Flush();
-	Pause(500);
-
-    ASSERT_TRUE(Compare(*bmp1, *bmp2));    
-	
-	if (GCEIsSupported())
-		{
-		iUtility->DestroyAll();
-		}
-	
-	CleanupStack::PopAndDestroy(bmp2);
-	CleanupStack::PopAndDestroy(bmp1);
-	CleanupStack::PopAndDestroy(&nonSurfacedWindow);
-	iSession.Flush();
-	Pause(1000);
-	}
-
-void CWSGceCsc::DrawBasicPattern (RWindow& aWin)
-    {
-    TSize rectSize(100, 100);
-    aWin.Invalidate();
-    aWin.BeginRedraw();
-    iGc->Activate(aWin);
-    iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-    iGc->SetBrushColor(KRgbDarkRed);
-    iGc->DrawRect(TRect(TPoint(35, 5), rectSize));
-    iGc->SetBrushColor(KRgbBlack);
-    iGc->DrawRect(TRect(TPoint(55, 15), rectSize));
-    iGc->SetBrushColor(KRgbDarkBlue);
-    iGc->DrawRect(TRect(TPoint(75, 35), rectSize));
-    iGc->SetBrushColor(KRgbYellow);
-    iGc->DrawRect(TRect(TPoint(95, 55), rectSize));
-    iGc->Deactivate();
-    aWin.EndRedraw();
-    iSession.Flush();
-    Pause(500);
-    }
-
-/**
- @SYMTestCaseID			GRAPHICS_WSERV_CSC_102L
- 
- @SYMTestCaseDesc		Compare the screen composition using the new and legacy API
- 						
- @SYMPREQ				CSC
- 
- @SYMTestStatus			Implemented
- 
- @SYMTestPriority		1
- 
- @SYMTestPurpose		To check that the screen composition retrieved using the new and legacy APIs 
-
- @SYMTestActions		Initialization.
- 						Draw a pattern on the screen
- 						Retrieve to a bitmap the UI content using the legacy API
- 						Blank the screen.
- 						Display the retrieved content to a surface
- 						Retrieve the composited content
- 						Compare the UI content with the composited content
- 						NOTE:assumes current screen mode is at 0 offset
- 
- @SYMTestExpectedResults  The UI content should be identical with the composited content	 
-*/
-void CWSGceCsc::GRAPHICS_WSERV_CSC_102L()
-	{
-	TRect screen(iScreenDevice->SizeInPixels());
-	RWindow testWindow(iSession);
-	RWindow surfacedTestWindow(iSession);
-	TSurfaceId surfaceID;
-
-    MTestScreenCapture* csc = static_cast<MTestScreenCapture*> (iScreenDevice->GetInterface(MTestScreenCapture::KUidTestScreenCaptureIf));
-    ASSERT_NOT_NULL(csc);
-	
-	TSize compositionScreenSize;
-	User::LeaveIfError(csc->GetCompositedSize(compositionScreenSize));
-	
-	iTestName.Format(_L("GRAPHICS_WSERV_CSC_102"));
-	INFO_PRINTF2(_L("%S"),&iTestName);
-	
-	iDisplayMode = iScreenDevice->DisplayMode();
-
-	TRAPD(err, surfaceID = iUtility->CreateSurfaceL(compositionScreenSize, 
-			                                        KSurfaceFormat, 
-			                                        compositionScreenSize.iWidth * KBytesPerPixel));
-	ASSERT_EQUALS(err,KErrNone);
-	
-	ConstructOpaqueWindowLC(testWindow, 
-			                iWhite, 
-		                    0, 
-                            TPoint(0, 0),
-                            compositionScreenSize);
-
-	iSession.Flush();
-	Pause(100);
-	
-	CFbsBitmap *bmp1 = new (ELeave) CFbsBitmap;
-	CleanupStack::PushL(bmp1);
-	User::LeaveIfError(bmp1->Create(compositionScreenSize, EColor16MU));
-	
-	CFbsBitmap *bmp2 = new (ELeave) CFbsBitmap;
-	CleanupStack::PushL(bmp2);
-	User::LeaveIfError(bmp2->Create(compositionScreenSize, EColor16MU));
-	
-	iSession.Flush();
-	Pause(500);
-
-	SetBackgroundColorWindow(testWindow, iWhite);
-	DrawBasicPattern (testWindow);
-	
-	iScreenDevice->CopyScreenToBitmap(bmp1);
-	iSession.Flush();
-    Pause(100);
-    
-	ConstructOpaqueSurfacedWindowLC(surfacedTestWindow, 
-			                        iRed,
-		                            0,
-		                            TPoint(0, 0),
-		                            compositionScreenSize,
-		                            surfaceID);
-	
-	TRAP(err,iUtility->FillSurfaceL(surfaceID, iCyan));
-	ASSERT_EQUALS(err,KErrNone);
-	iSession.Flush();
-    Pause(500);
-    
-	TRAP(err, iUtility->CopyBitmapToSurfaceL(surfaceID, *bmp1));
-	ASSERT_EQUALS(err,KErrNone);
-	iSession.Flush();
-    Pause(500);
-
-	User::LeaveIfError(csc->ComposeScreen(*bmp2));
-    
-    ASSERT_TRUE(Compare(*bmp1, *bmp2));    
-	
-	iUtility->DestroyAll();
-	CleanupStack::PopAndDestroy(&surfacedTestWindow);
-	CleanupStack::PopAndDestroy(bmp2);
-	CleanupStack::PopAndDestroy(bmp1);
-	CleanupStack::PopAndDestroy(&testWindow);
-	iSession.Flush();
-	Pause(1000);
-	}
-
-/**
- @SYMTestCaseID			GRAPHICS_WSERV_CSC_103L
- 
- @SYMTestCaseDesc		Test TranslateExtent
- 						
- @SYMPREQ				CSC
- 
- @SYMTestStatus			Implemented
- 
- @SYMTestPriority		1
- 
- @SYMTestPurpose		To check that the correct translated extent is returned to the client 
-
- @SYMTestActions		Initialization
- 						Change to app mode with offset and 90 degrees rotation
- 						Translate a rectangle corresponding to the original app mode
- 						Compare the expected rectangle with the translated rectangle
- 
- @SYMTestExpectedResults  The translated rectangle should take into account the offset and rotation
-							and be equal to the expected rectangle
-*/
-void CWSGceCsc::GRAPHICS_WSERV_CSC_103L()
-	{
-	TRect screen(iScreenDevice->SizeInPixels());
-	RWindow testWindow(iSession);
-	
-	iTestName.Format(_L("GRAPHICS_WSERV_CSC_103L"));
-	INFO_PRINTF2(_L("%S"),&iTestName);
-	
-	iDisplayMode = iScreenDevice->DisplayMode();
-	
-	ConstructOpaqueWindowLC(testWindow, 
-			                iWhite, 
-		                    0, 
-                            TPoint(0, 0),
-                            screen.Size());
-	iSession.Flush();
-	Pause(1000);
-
-	// Get the screen modes
-	RArray<TInt> modeList;
-	TInt err = iScreenDevice->GetScreenSizeModeList(&modeList);
-	ASSERT_TRUE(err > 1);  //2 modes expected
-	ASSERT_TRUE(modeList.Count() > 1); //2 modes expected
-	
-	// The initial extent and the expected translated extent
-	TRect initial(TPoint(10,10), TSize(20,30));
-	TRect extent(initial);
-	TRect expected(TPoint(15,15), TSize(20,30));
-	
-	// Change app mode to 5 pixels offset
-	iScreenDevice->SetAppScreenMode(modeList[1]);
-	iScreenDevice->SetScreenMode(modeList[1]);
-	iSession.Flush();
-	Pause(100);
-
-	TPoint origin = iScreenDevice->GetCurrentScreenModeScaledOrigin();
-	if(origin != TPoint(0,0))
-		{
-		// Calculate the new extent
-	    MTestScreenCapture* csc = static_cast<MTestScreenCapture*> (iScreenDevice->GetInterface(MTestScreenCapture::KUidTestScreenCaptureIf));
-	    ASSERT_NOT_NULL(csc);
-		csc->TranslateExtent(initial, extent);	
-		ASSERT_TRUE(extent == expected); 
-		}
-	else
-		{
-		INFO_PRINTF1(_L("Non zero offset not supported"));
-		}
-    // Change app mode
-    iScreenDevice->SetAppScreenMode(modeList[0]);
-    iScreenDevice->SetScreenMode(modeList[0]);
-    iSession.Flush();
-    Pause(100);
-
-    modeList.Close();
-	CleanupStack::PopAndDestroy(&testWindow);
-	iSession.Flush();
-	Pause(1000);
-	}
-
-/**
- @SYMTestCaseID			GRAPHICS_WSERV_CSC_104L
- 
- @SYMTestCaseDesc		Compare the screen composition using bitmaps with different display modes
- 						
- @SYMPREQ				CSC
- 
- @SYMTestStatus			Implemented
- 
- @SYMTestPriority		1
- 
- @SYMTestPurpose		To check that bitmaps with different display modes  
-
- @SYMTestActions		Initialization.
- 						Draw a pattern on the screen
- 						Retrieve to a bitmap the UI content using the legacy API
- 						Blank the screen.
- 						Display the retrieved content to a surface
- 						Retrieve the composited content to a 2nd bitmap
- 						Compare the UI content with the composited content
- 
- @SYMTestExpectedResults  The bitmaps format should not match and should return KErrArgument 
-*/
-void CWSGceCsc::GRAPHICS_WSERV_CSC_104L()
-	{
-	TRect screen(iScreenDevice->SizeInPixels());
-	RWindow testWindow(iSession);
-	RWindow surfacedTestWindow(iSession);
-	TSurfaceId surfaceID;
-
-    MTestScreenCapture* csc = static_cast<MTestScreenCapture*> (iScreenDevice->GetInterface(MTestScreenCapture::KUidTestScreenCaptureIf));
-    ASSERT_NOT_NULL(csc);
-	
-	TSize compositionScreenSize;
-	User::LeaveIfError(csc->GetCompositedSize(compositionScreenSize));
-	
-	iTestName.Format(_L("GRAPHICS_WSERV_CSC_102"));
-	INFO_PRINTF2(_L("%S"),&iTestName);
-	
-	iDisplayMode = iScreenDevice->DisplayMode();
-
-	TRAPD(err, surfaceID = iUtility->CreateSurfaceL(compositionScreenSize, 
-			                                        KSurfaceFormat, 
-			                                        compositionScreenSize.iWidth * KBytesPerPixel));
-	ASSERT_EQUALS(err,KErrNone);
-	
-	ConstructOpaqueWindowLC(testWindow, 
-			                iWhite, 
-		                    0, 
-                            TPoint(0, 0),
-                            compositionScreenSize);
-
-	iSession.Flush();
-	Pause(100);
-	
-	CFbsBitmap *bmp1 = new (ELeave) CFbsBitmap;
-	CleanupStack::PushL(bmp1);
-	User::LeaveIfError(bmp1->Create(compositionScreenSize, EColor16MU));
-	
-	// Invalid bitmap display mode
-	CFbsBitmap *bmp2 = new (ELeave) CFbsBitmap;
-	CleanupStack::PushL(bmp2);
-	User::LeaveIfError(bmp2->Create(compositionScreenSize, EColor256));
-	
-	iSession.Flush();
-	Pause(500);
-
-	// Draw a pattern using WServ
-	SetBackgroundColorWindow(testWindow, iWhite);
-
-	TSize rectSize(100, 100);
-	testWindow.Invalidate();
-	testWindow.BeginRedraw();
-	iGc->Activate(testWindow);
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	iGc->SetBrushColor(KRgbDarkRed);
-	iGc->DrawRect(TRect(TPoint(35, 5), rectSize));
-	iGc->SetBrushColor(KRgbBlack);
-	iGc->DrawRect(TRect(TPoint(55, 15), rectSize));
-	iGc->SetBrushColor(KRgbDarkBlue);
-	iGc->DrawRect(TRect(TPoint(75, 35), rectSize));
-	iGc->SetBrushColor(KRgbYellow);
-	iGc->DrawRect(TRect(TPoint(95, 55), rectSize));
-	iGc->Deactivate();
-	testWindow.EndRedraw();
-	iSession.Flush();
-	Pause(500);
-	
-	iScreenDevice->CopyScreenToBitmap(bmp1);
-	iSession.Flush();
-    Pause(100);
-    
-	ConstructOpaqueSurfacedWindowLC(surfacedTestWindow, 
-			                        iRed,
-		                            0,
-		                            TPoint(0, 0),
-		                            compositionScreenSize,
-		                            surfaceID);
-	
-	TRAP(err,iUtility->FillSurfaceL(surfaceID, iCyan));
-	ASSERT_EQUALS(err,KErrNone);
-	iSession.Flush();
-    Pause(500);
-    
-	TRAP(err, iUtility->CopyBitmapToSurfaceL(surfaceID, *bmp1));
-	ASSERT_EQUALS(err,KErrNone);
-	iSession.Flush();
-    Pause(500);
-
-    // negative test, it should fail wit KErrArgument
-	TInt ret = csc->ComposeScreen(*bmp2);
-	ASSERT_EQUALS(ret, KErrArgument);
-	
-	iUtility->DestroyAll();
-	CleanupStack::PopAndDestroy(&surfacedTestWindow);
-	CleanupStack::PopAndDestroy(bmp2);
-	CleanupStack::PopAndDestroy(bmp1);
-	CleanupStack::PopAndDestroy(&testWindow);
-	iSession.Flush();
-	Pause(1000);
-	}
-
-/**
- @SYMTestCaseID         GRAPHICS_WSERV_CSC_105L
- @SYMTestCaseDesc       Correct bitmap size returned when in small screen mode
- @SYMDEF                DEF139191                   
- @SYMPREQ               CSC
- @SYMTestStatus         Implemented
- @SYMTestPriority       1
- @SYMTestPurpose        Checking GetCompositedSize is correct on gce & acceptable behaviour in non gce mode
- @SYMTestActions        For every available screen mode
-                        Get size from GetCompositedSize
-                        Draw some coloured rectangles on screen
-                        If gce, do a full screen surface, and paste the coloured rectangles into the surface
-                        ComposeScreen - bitmap 1 should be the same as bitmap 2
-                        Note - non GCE mode - GetCompositedSize returns unrotated appmode size, so only
-                            compares the intersection of that with actual screen size
-                        Note - gce mode - GetCompositedSize returns actual rotated screen size, so 
-                            does a complete screen comparison
- @SYMTestExpectedResults  All asserts should complete. Comparison should succeed!
-*/
-void CWSGceCsc::GRAPHICS_WSERV_CSC_105L()
-    {
-    iTestName.Format(_L("GRAPHICS_WSERV_CSC_105"));
-    INFO_PRINTF2(_L("%S"),&iTestName);
-    TInt err;
-    //get list of modes
-    RArray<TInt> screenModes;
-    err = iScreenDevice->GetScreenSizeModeList(&screenModes);
-    ASSERT_TRUE (err > 0);
-    //get first mode info
-    TPixelsAndRotation firstModeInfo;
-    iScreenDevice->GetScreenModeSizeAndRotation(screenModes[0],firstModeInfo);
-
-    //make sure csc is available
-    MTestScreenCapture* csc = static_cast<MTestScreenCapture*> (iScreenDevice->GetInterface(MTestScreenCapture::KUidTestScreenCaptureIf));
-    ASSERT_NOT_NULL(csc);
-
-    TBool differentSizes = EFalse;
-    TSizeMode currentModeInfo;
-    TSize compositionScreenSize;
-    //for every screen mode
-    for (TInt ii = 0; ii < screenModes.Count(); ++ii && !differentSizes)
-        {
-        //set mode
-        iScreenDevice->SetAppScreenMode(screenModes[ii]);
-        iScreenDevice->SetScreenMode(screenModes[ii]);
-        iSession.Flush();
-        Pause(100);
-        //get mode info
-        currentModeInfo = iScreenDevice->GetCurrentScreenModeAttributes();
-        if (currentModeInfo.iScreenSize.iWidth != firstModeInfo.iPixelSize.iWidth ||
-                currentModeInfo.iScreenSize.iHeight != firstModeInfo.iPixelSize.iHeight ||
-                currentModeInfo.iRotation != firstModeInfo.iRotation)
-            {   //note that we have modes of different sizes / rotations
-            differentSizes = ETrue;
-            }
-
-        RWindow testWindow(iSession);
-        RWindow surfacedTestWindow(iSession);
-        TSurfaceId surfaceID;
-
-        err = csc->GetCompositedSize(compositionScreenSize);
-        ASSERT_EQUALS (err,KErrNone);
-        iDisplayMode = iScreenDevice->DisplayMode();
-        
-        if (GCEIsSupported())
-            {   //create a surface
-            TRAP(err, surfaceID = iUtility->CreateSurfaceL(compositionScreenSize, 
-                                                       KSurfaceFormat, 
-                                                       compositionScreenSize.iWidth * KBytesPerPixel));
-            ASSERT_EQUALS(err,KErrNone);
-            }
-        
-        //create a basic window
-        ConstructOpaqueWindowLC(testWindow, 
-                iWhite, 
-                0, 
-                -currentModeInfo.iOrigin,
-                compositionScreenSize);  //negative origin to ensure it fills screen, not app mode area
-        iSession.Flush();
-        Pause(100);
-        
-        //bitmap 1 to compare against
-        CFbsBitmap *bmp1 = new (ELeave) CFbsBitmap;
-        CleanupStack::PushL(bmp1);
-        User::LeaveIfError(bmp1->Create(compositionScreenSize, EColor16MU));
-        //bitmap 2 to pass into csc
-        CFbsBitmap *bmp2 = new (ELeave) CFbsBitmap;
-        CleanupStack::PushL(bmp2);
-        User::LeaveIfError(bmp2->Create(compositionScreenSize, EColor16MU));
-        
-        //draw coloured rectangles in the test window
-        SetBackgroundColorWindow(testWindow, iWhite);
-        DrawBasicPattern (testWindow);
-        
-        //copy screen to bitmap 1
-        err = iScreenDevice->CopyScreenToBitmap(bmp1);
-        ASSERT_EQUALS (err,KErrNone);
-        iSession.Flush();
-        Pause(100);
-        
-        if (GCEIsSupported())
-            {   //place a window with a surface into the screen
-            ConstructOpaqueSurfacedWindowLC(surfacedTestWindow, 
-                    iRed,
-                    0,
-                    -currentModeInfo.iOrigin,
-                    compositionScreenSize,
-                    surfaceID);  //negative origin to ensure it fills screen,not app mode area
-
-            //make surface boring cyan
-            TRAP(err,iUtility->FillSurfaceL(surfaceID, iCyan));
-            ASSERT_EQUALS(err,KErrNone);
-            iSession.Flush();
-            Pause(300);
-            
-            //paste bitmap 1 contents into the surface
-            TRAP(err, iUtility->CopyBitmapToSurfaceL(surfaceID, *bmp1));
-            ASSERT_EQUALS(err,KErrNone);
-            iSession.Flush();
-            Pause(300);
-            }
-        
-        //use csc to get a copy of the screen
-        err = csc->ComposeScreen(*bmp2);
-        ASSERT_EQUALS (err, KErrNone);
-        
-        //should match the original bitmap copy of the screen
-        ASSERT_TRUE(Compare(*bmp1, *bmp2));    
-        
-        if (GCEIsSupported())
-            {
-            iUtility->DestroyAll();
-            CleanupStack::PopAndDestroy(&surfacedTestWindow);
-            }
-        else
-            {
-            surfacedTestWindow.Close();
-            }
-        CleanupStack::PopAndDestroy(bmp2);
-        CleanupStack::PopAndDestroy(bmp1);
-        CleanupStack::PopAndDestroy(&testWindow);
-        iSession.Flush();
-        Pause(300);
-        }
-    if (!differentSizes)
-        {
-        INFO_PRINTF1(_L("Didn't find screen modes of different sizes - test inconclusive"));
-        }
-    iScreenDevice->SetAppScreenMode(screenModes[0]);
-    iScreenDevice->SetScreenMode(screenModes[0]);
-    screenModes.Close();
-    }
--- a/windowing/windowserver/tcsc/cwsgcecsc.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-* @file
-* 
-*
-*/
-
-
-
-#ifndef CWSGCECSC_H_
-#define CWSGCECSC_H_
-
-#include <test/tefunit.h>
-#include <w32std.h>
-#include "cwsgcecscbase.h"
-
-class CWSGceCsc : public CWsGceCscBase
-{
-private:
-	
-public:
-	CWSGceCsc();
-	virtual ~CWSGceCsc();
-	static CTestSuite* CreateSuiteL(const TDesC &aName);
-	virtual void SetupL();
-	virtual void TearDownL();
-	void GRAPHICS_WSERV_CSC_101L();
-	void GRAPHICS_WSERV_CSC_102L();
-	void GRAPHICS_WSERV_CSC_103L();
-	void GRAPHICS_WSERV_CSC_104L();
-	void GRAPHICS_WSERV_CSC_105L();
-private:
-    void DrawBasicPattern (RWindow& aWin);
-public:
-
-private:
-};
-
-#endif /*CWSGCECSC_H_*/
--- a/windowing/windowserver/tcsc/cwsgcecscbase.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,400 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// @file
-// 
-//
-
-#include <e32std.h>
-#include <e32math.h>
-#include <w32std.h>
-#include <w32debug.h>
-#include <e32base.h>
-#include "teflogextensions.h"
-#include "globalsettings.h"
-#include "CWsGceCscBase.h"
-#include <bitdraw.h>
-#include <bitdrawinterfaceid.h>
-#include <imageconversion.h>
-#include <test/tefunit.h>
-
-
-CWsGceCscBase::CWsGceCscBase():
-iDoTearDown(EFalse),
-iUtility(this, NULL)
-{
-}
-
-CWsGceCscBase::~CWsGceCscBase()
-{
-if (iDoTearDown)
-	TearDownFromDeleteL();	//This mechanism is not entirely clean to use.
-}
-
-void CWsGceCscBase::SetupL()
-{
-iDoTearDown=ETrue;
-iRed.SetInternal(0xFFFF0000);
-iGreen.SetInternal(0xFF00FF00);
-iBlue.SetInternal(0xFF0000FF);
-iCyan.SetInternal(0xFF00FFFF);
-iMagenta.SetInternal(0xFFFF00FF);
-iYellow.SetInternal(0xFFFFFF00);
-iWhite.SetInternal(0xFFFFFFFF);
-
-ASSERT_EQUALS_X(iSession.Connect(), KErrNone);
-
-	{//Stolen from TAuto CloseAllPanicWindows()
-	TInt idFocus = iSession.GetFocusWindowGroup();
-	TWsEvent event;
-	event.SetType(EEventKey); //EEventKeyDown
-	TKeyEvent *keyEvent = event.Key();
-	keyEvent->iCode = EKeyEscape;
-	keyEvent->iScanCode = EStdKeyEscape;
-	keyEvent->iModifiers = 0;
-	TInt theLimit = 50;
-	while(idFocus != NULL && (theLimit-- > 0))
-		{
-		iSession.SendEventToAllWindowGroups(event);
-		TInt idNewFocus = iSession.GetFocusWindowGroup();
-		if (idNewFocus!=idFocus)
-			{
-			INFO_PRINTF1(_L("A window was closed [probably a panic box from the previous test]."));
-			}
-		idFocus=idNewFocus;
-		}
-	}
-TInt err = KErrNone;
-
-TRAP(err, iScreenDevice = new (ELeave) CWsScreenDevice(iSession));
-PRINT_ON_ERROR2_L(err, _L("Failed to create screen device: %d"), err);
-ASSERT_EQUALS_X(iScreenDevice->Construct(TGlobalSettings::Instance().iScreen), KErrNone);
-iDisplayMode = iScreenDevice->DisplayMode();	// Get default display mode
-
-TRAP(err, iGc = new (ELeave) CWindowGc(iScreenDevice));
-PRINT_ON_ERROR2_L(err, _L("Failed to create graphics context: %d"), err);
-ASSERT_EQUALS_X(iGc->Construct(), KErrNone);
-
-iGroup = RWindowGroup(iSession);
-ASSERT_EQUALS_X(iGroup.Construct(++iWindowHandle,iScreenDevice), KErrNone);
-iSession.Flush();
-
-RWindow testTrans(iSession);
-ASSERT_EQUALS_X(testTrans.Construct(iGroup, ++iWindowHandle), KErrNone);
-iTransparencyEnabled=(testTrans.SetTransparencyFactor(iWhite)==KErrNone);
-testTrans.Close();
-
-//clean-up if previous test abended
-	if (PostTestCleanupInstance().iSharedUtility)
-	{
-//Temp removed - may be causing ONB fails!
-//	if (PostTestCleanupInstance().iSharedUtility->DestroyAll())
-//		{
-//		INFO_PRINTF1(_L("Destroyed some surfaces from previous test."));
-//
-//		}
-	}
-	if (!PostTestCleanupInstance().iCleanedUpOnExit)
-	PostTestCleanupInstance().iCleanedUpOnExit=EFalse;
-	
-	if (!GCEIsSupported())
-		{
-		INFO_PRINTF1(_L("Some Setup skipped: GCE support is not loaded"));
-		return;
-		}
-
-	TRAPD(err_FailedToCreateSurfaceUtility, iUtility = CSurfaceUtility::NewL( PostTestCleanupInstance().iSharedUtility));
-	ASSERT_EQUALS(err_FailedToCreateSurfaceUtility,KErrNone);
-
-}
-
-void CWsGceCscBase::TearDownL()
-{
-iDoTearDown=EFalse;
-delete iGc;
-delete iScreenDevice;
-
-iGroup.Close();
-iSession.Flush();
-iSession.Close();
-
-delete iUtility();
-PostTestCleanupInstance().iCleanedUpOnExit=ETrue;
-Pause(1000);
-}
-
-void CWsGceCscBase::TearDownFromDeleteL()
-{
-CWsGceCscBase::TearDownL();
-}
-
-void CWsGceCscBase::Pause(TInt aMilliseconds)
-{
-User::After(TTimeIntervalMicroSeconds32(aMilliseconds * 1000));
-}
-
-/**	Test using an indipendent method that GCE version of WServ is running
- *  This method can only be called after the testcase is started
- * 
- * 	@return	true if WServ version is GCE technology, false if legacy technology
- **/
-TBool CWsGceCscBase::GCEIsSupported() const
-	{
-	CFbsDrawDevice* screenDevice=NULL;
-	TDisplayMode displayMode=iScreenDevice->DisplayMode();
-	TRAPD(err, screenDevice = CFbsDrawDevice::NewScreenDeviceL(TGlobalSettings::Instance().iScreen, displayMode));
-	TBool rv=EFalse;
-	if(err == KErrNone)
-		{
-		TAny* p=NULL;
-		rv=(screenDevice->GetInterface(KSurfaceInterfaceID, p)==KErrNone);
-		delete screenDevice;
-		}
-	return rv;
-	}
-/**	Test using an indipendent method that GCE version of WServ is running
- *  This method can be called at any time, even by external code, but creates temporary window session objects
- * 
- * 	@return	true if WServ version is GCE technology, false if legacy technology
- **/
-TBool CWsGceCscBase::GCEIsSupportedStatic()
-	{
-	CFbsDrawDevice* screenDevice=NULL;
-	RWsSession session;
-	if (session.Connect()!=KErrNone)
-		{
-		return EFalse;
-		}
-	CWsScreenDevice screen(session);
-	if (screen.Construct(TGlobalSettings::Instance().iScreen)!=KErrNone)
-		{
-		return EFalse;
-		}
-	
-	TDisplayMode displayMode=screen.DisplayMode();
-	TRAPD(err, screenDevice = CFbsDrawDevice::NewScreenDeviceL(TGlobalSettings::Instance().iScreen, displayMode));
-	TBool rv=EFalse;
-	if(err == KErrNone)
-		{
-		TAny* p=NULL;
-		rv=(screenDevice->GetInterface(KSurfaceInterfaceID, p)==KErrNone);
-		delete screenDevice;
-		}
-	return rv;
-	}
-
-//Allocating an instance of surface utility here means all test code instances will share the same instance of the utility class.
-// Owns the singleton
-CWsGceCscBase::TPostTestCleanup& CWsGceCscBase::PostTestCleanupInstance()
-	{
-	static 
-	class RPostTestCleanup:public TPostTestCleanup
-		{
-		public:
-		RPostTestCleanup()
-			{
-			iSharedUtility=NULL;
-			iCleanedUpOnExit=ETrue;
-			}
-		~RPostTestCleanup()
-			{
-	// I want to cleanly release the surface utility, but at this point the threads have already been pulled down!
-	//		if (iSharedUtility)
-	//			delete iSharedUtility;
-			iSharedUtility=NULL;	//avoid phoenix behaviour
-			}
-		}	staticInstance;
-		return staticInstance;
-	}
-
-// This handles any non-member uses of the extended ASSERT_XXX macros
-extern void TefUnitFailLeaveL();
-/**
- * side-effect: log the state info just before I leave!
- * Note that this only logs intentional assertion failures.
- * Fails due to panics or throws won't log this info.
- **/
-void CWsGceCscBase::TefUnitFailLeaveL()
-	{
-	for (TInt line=0;line<KMaxInfoLines;line++)
-		if (iTestInfo[line].Length())
-			Logger().LogExtra((TText8*)"Test state at fail - line",line, ESevrAll, iTestInfo[line]);
-	TGlobalSettings::Instance().Report(Logger());
-	
-	User::Leave(KErrTEFUnitFail);
-	}
-
-TInt	CWsGceCscBase::DebugInfo(TWsDebugInfoFunc aFunction, 
-		                                 TInt aParam, 
-		                                 TDes8& aHostBuffer,
-		                                 const void*&aReturnedObject,
-		                                 TInt aObjectSize)const
-	{
-	TInt reqSize=iSession.DebugInfo(aFunction,aHostBuffer,aParam);
-	aReturnedObject=NULL;
-	if (reqSize<0)
-		{
-		if ((reqSize%aObjectSize)!=0)
-			{
-			return KErrCorrupt;
-			}
-		else
-			{
-			return reqSize;
-			}
-		}
-	if (reqSize>aHostBuffer.MaxLength())
-		{
-		return reqSize/aObjectSize;
-		}
-	if (reqSize==0)
-		{
-		reqSize=aHostBuffer.MaxLength();
-		}
-	if ((reqSize%aObjectSize)!=0)
-		{
-		return KErrCorrupt;
-		}
-	aReturnedObject=(const void*)aHostBuffer.Ptr();
-	reqSize/=aObjectSize;
-	return reqSize;
-	}
-
-void CWsGceCscBase::SetCompositionMode(RWindow& aWindow, TDisplayMode aMode)
-	{
-		iDisplayMode = (TDisplayMode)aWindow.SetRequiredDisplayMode(aMode);
-		aWindow.Invalidate();
-		aWindow.BeginRedraw();
-		aWindow.EndRedraw();
-	}
-
-TBool CWsGceCscBase::Compare(CFbsBitmap& aBitmap1, CFbsBitmap& aBitmap2)
-	{
-	if ((aBitmap1.SizeInPixels() == aBitmap2.SizeInPixels()) &&
-		(aBitmap1.DisplayMode() == aBitmap2.DisplayMode()))
-		{
-		TSize size = aBitmap1.SizeInPixels();
-		TInt width = size.iWidth;
-		TInt height = size.iHeight;
-		TRgb color1, color2;
-		
-		for (TInt i = 0; i < width; i++)
-			{
-			for (TInt j = 0; j < height; j++)
-				{
-				aBitmap1.GetPixel(color1, TPoint(i, j));
-				aBitmap2.GetPixel(color2, TPoint(i, j));
-				if (color1 != color2)
-					{
-					return EFalse;
-					}
-				}
-			}
-		
-		return ETrue;
-		}
-	return EFalse;
-	}
-
-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();
-	}
-
-void CWsGceCscBase::ConstructOpaqueWindowLC(RWindow& aWindow, 
-		                                    const TRgb& aColor, 
-		                                    TInt aPos,
-		                                    const TPoint &aPoint, 
-		                                    const TSize &aSize)
-	{
-	ASSERT_EQUALS_X(aWindow.Construct(iGroup, ++iWindowHandle), KErrNone);
-	CleanupClosePushL(aWindow);
-	aWindow.SetRequiredDisplayMode(iDisplayMode);
-	aWindow.SetExtent(aPoint, aSize);
-	aWindow.SetBackgroundColor(aColor);
-	aWindow.SetOrdinalPosition(aPos);
-	aWindow.SetVisible(ETrue);
-	aWindow.Activate();
-	aWindow.BeginRedraw();
-	iGc->Activate(aWindow);
-	iGc->Clear();
-	iGc->Deactivate();
-	aWindow.EndRedraw();
-	}
-
-
-void CWsGceCscBase::SetBackgroundColorWindow(RWindow& aWindow, const TRgb& aColor)
-	{
-	aWindow.Invalidate();
-	aWindow.SetBackgroundColor(aColor);
-	aWindow.BeginRedraw();
-	iGc->Activate(aWindow);
-	iGc->Deactivate();
-	aWindow.EndRedraw();
-	}
-
-void CWsGceCscBase::ConstructOpaqueSurfacedWindowLC(RWindow& aWindow,
-		                                            const TRgb& aColor, 
-		                                            TInt aPos,
-		                                            const TPoint &aPoint, 
-		                                            const TSize &aSize,
-		                                            TSurfaceId& aSurfaceID)
-	{
-	ASSERT_EQUALS_X(aWindow.Construct(iGroup, ++iWindowHandle), KErrNone);
-	CleanupClosePushL(aWindow);
-	aWindow.SetRequiredDisplayMode(iDisplayMode);
-	aWindow.SetExtent(aPoint, aSize);
-	aWindow.SetBackgroundColor(aColor);
-	aWindow.SetOrdinalPosition(aPos);	
-	ASSERT_EQUALS_X(aWindow.SetBackgroundSurface(aSurfaceID), KErrNone);
-	aWindow.Activate();
-	aWindow.BeginRedraw();
-	iGc->Activate(aWindow);
-	iGc->Deactivate();
-	aWindow.EndRedraw();
-	}
-
-void CWsGceCscBase::ConstructOpaqueSurfacedWindowL(RWindow& aWindow,
-		                                           const TRgb& aColor, 
-		                                           TInt aPos,
-		                                           const TPoint& aPoint, 
-		                                           const TSize& aSize,
-		                                           const TSurfaceId& aSurfaceID)
-	{
-	ASSERT_EQUALS_X(aWindow.Construct(iGroup, ++iWindowHandle), KErrNone);
-	aWindow.SetRequiredDisplayMode(iDisplayMode);
-	aWindow.SetExtent(aPoint, aSize);
-	aWindow.SetBackgroundColor(aColor);
-	aWindow.SetOrdinalPosition(aPos);	
-	ASSERT_EQUALS_X(aWindow.SetBackgroundSurface(aSurfaceID), KErrNone);
-	aWindow.Activate();
-	aWindow.BeginRedraw();
-	iGc->Activate(aWindow);
-	iGc->Deactivate();
-	aWindow.EndRedraw();
-	}
-
-
--- a/windowing/windowserver/tcsc/cwsgcecscbase.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,181 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef TCWGCECSCBASE_H_
-#define TCWGCECSCBASE_H_
-
-#include <test/tefunit.h>
-#include <w32debug.h>
-#include "surfaceutility.h"
-#include <e32property.h>
-
-class TPerfProperties
-{
-public:
-	TBool GetValue(TUint aKey);
-	void PrintAllL(CTestFixture& aLogger);
-	TBool ResetValue(TUint aKey);
-	void UpdateAll();
-	void ResetAll();
-private:
-#ifdef GCE_BACKEND_PROFILING
-	TInt iValue[EPerfLastKey];
-	TInt iPrevValue[EPerfLastKey];
-	const static TBuf<100> propertyKeysTxt[EPerfLastKey];
-#endif
-};
-
-class CWsGceCscBase: public CTestFixture
-{
-
-public:
-	template <class Referee,class LoggerOwner>
-	class	SafePointer
-		{
-	public:
-		SafePointer(LoggerOwner* aOwner,Referee* aReferee=NULL):
-			iOwner(aOwner),	iReferee(aReferee)
-			{}
-		Referee*	operator=(Referee* aReferee)
-			{
-			return iReferee=aReferee;
-			}
-		Referee*&	operator()()
-			{
-			return iReferee;
-			}
-		Referee*	operator->()
-			{
-			if (iReferee==NULL)
-				{
-				iOwner -> INFO_PRINTF1(_L("Tried to dereference a pointer that is null!"));
-				User::Panic(_L("null pointer"),__LINE__);
-				}
-			return iReferee;
-			}
-	private:
-		LoggerOwner* iOwner;
-		Referee* iReferee;
-		};
-	
-public:
-	CWsGceCscBase();
-	virtual ~CWsGceCscBase();
-	virtual void SetupL();
-	virtual void TearDownL();
-	virtual void TearDownFromDeleteL();
-
-protected:
-	typedef TBuf<KMaxTestName> TTestName;
-	
-	class TPostTestCleanup
-		{
-		protected:
-		TPostTestCleanup()	{}
-		public:
-		CSurfaceUtility*	iSharedUtility;
-		TBool				iCleanedUpOnExit;
-		};
-
-
-	typedef enum TOptimizationLevel
-		{
-		EDisable,
-		EDetectFrontmostFullScreenOpaqueLayer,
-		EMaximum,
-		} TOptimizationLevel;
-
-		
-protected:
-	void SetCompositionMode(RWindow& aWindow, TDisplayMode aMode);
-	
-	TBool Compare(CFbsBitmap& aBitmap1, CFbsBitmap& aBitmap2);
-
-	void ConstructOpaqueWindowLC(RWindow& aWindow, 
-			                     const TRgb& aColor,
-			                     TInt aPos,
-			                     const TPoint& aPoint,
-			                     const TSize& aSize);
-	
-	void ConstructOpaqueWindowL(RWindow& aWindow, 
-			                    const TRgb& aColor,
-			                    TInt aPos,
-			                    const TPoint& aPoint,
-			                    const TSize& aSize);
-	
-	void SetBackgroundColorWindow(RWindow& aWindow, const TRgb& aColor);
-	
-	void ConstructOpaqueSurfacedWindowLC(RWindow& aWindow,
-		                                 const TRgb& aColor,
-		                                 TInt aPos,
-		                                 const TPoint& aPoint,
-		                                 const TSize& aSize,
-		                                 TSurfaceId& aSurfaceID);
-	void ConstructOpaqueSurfacedWindowL(RWindow& aWindow,
-		                                const TRgb& aColor,
-		                                TInt aPos,
-		                                const TPoint& aPoint,
-		                                const TSize& aSize,
-		                                const TSurfaceId& aSurfaceID);
-	
-protected:
-	inline TInt ObjIndScr(TInt aScreen,TInt aWin=0,TInt aLayer=0,TInt aExtra=0);
-	template <class DataType>	// DataType may be TSurfaceId, TInt,TRect, TSurfaceConfiguration (not TRegion)
-	TInt	DebugInfo(TWsDebugInfoFunc aFunction, TInt aObjectIndex, TDes8& aHostBuffer,const DataType*&aReturnedObject)const
-	{
-	return DebugInfo(aFunction,aObjectIndex,aHostBuffer,(const void*&)aReturnedObject,sizeof(DataType));
-	}
-	TInt DebugInfo(TWsDebugInfoFunc aFunction, 
-			       TInt aParam, 
-			       TDes8& aHostBuffer,
-			       const void*&aReturnedObject,
-			       TInt aObjectSize)const;
-	void TefUnitFailLeaveL();
-	static void Pause(TInt aMilliseconds=200);
-	TBool GCEIsSupported() const;
-	static TBool GCEIsSupportedStatic();
-	static TPostTestCleanup& PostTestCleanupInstance();
-	
-protected:
-	TBool	iDoTearDown;
-	RWsSession iSession;
-	RWindowGroup iGroup;
-	CWsScreenDevice* iScreenDevice;
-	CWindowGc* iGc;
-	TInt iWindowHandle;
-	TBool	iTransparencyEnabled;
-	TRgb iRed, iGreen, iBlue, iCyan, iMagenta, iYellow, iWhite;
-	TDisplayMode iDisplayMode;
-	SafePointer<CSurfaceUtility,CWsGceCscBase> iUtility;
-	static const TInt KMaxInfoLines=5;
-	TTestName iTestInfo[KMaxInfoLines];
-	TTestName iTestName;
-	static const TUidPixelFormat KSurfaceFormat = EUidPixelFormatXRGB_8888;
-	static const TInt KBytesPerPixel = 4;	// Four bytes per pixel for the format above.
-	TPerfProperties iProperties;
-};
-
-inline TInt CWsGceCscBase::ObjIndScr(TInt aScreen,
-		                                     TInt aWin,
-		                                     TInt aLayer,
-		                                     TInt aExtra)
-	{
-	return 	(aScreen<<EWsDebugArgScreenShift)
-		|	(aWin<<EWsDebugArgWindowShift)
-		|	(aLayer<<EWsDebugArgLayerShift)
-		|	(aExtra<<EWsDebugArgExtraShift);
-	}
-
-#endif /*TCWGCECSCBASE_H_*/
Binary file windowing/windowserver/tcsc/resources/wsini_csc_classic.ini has changed
Binary file windowing/windowserver/tcsc/resources/wsini_csc_classic_naviengine.ini has changed
Binary file windowing/windowserver/tcsc/resources/wsini_csc_classic_qvga.ini has changed
Binary file windowing/windowserver/tcsc/resources/wsini_csc_classic_vga.ini has changed
Binary file windowing/windowserver/tcsc/resources/wsini_csc_nga.ini has changed
Binary file windowing/windowserver/tcsc/resources/wsini_csc_nga_changetracking.ini has changed
Binary file windowing/windowserver/tcsc/resources/wsini_csc_nga_h6.ini has changed
Binary file windowing/windowserver/tcsc/resources/wsini_csc_nga_naviengine.ini has changed
Binary file windowing/windowserver/tcsc/resources/wsini_csc_nga_qvga.ini has changed
Binary file windowing/windowserver/tcsc/resources/wsini_csc_nga_qvga_changetracking.ini has changed
Binary file windowing/windowserver/tcsc/resources/wsini_csc_nga_vga.ini has changed
Binary file windowing/windowserver/tcsc/resources/wsini_csc_nga_vga_changetracking.ini has changed
--- a/windowing/windowserver/tcsc/t_gcecscserver.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// @file
-// 
-//
-
-
-#include <test/ctefunitserver.h>
-#include "cwsgcecsc.h"
-
-_LIT( KServerName, "wsgcecscserver" );
-
-GLDEF_C const TTestName ServerName()
-/**
- * ServerName
- *
- * @return - The TEF server name
- */
-	{
-	TTestName serverName(KServerName);
-	return serverName;
-	}
-
-
-GLDEF_C CTestSuite* CreateTestSuiteL()
-/**
- * Create the overall test suite.
- *
- * @return - The top level suite
- */
-	{
-	START_SUITE;
-	ADD_TEST_SUITE(CWSGceCsc);
-	END_SUITE;
-	}
-
-
-GLDEF_C CTestStep* CreateTEFTestStep(const TDesC& /*aStepName*/, CTEFUnitServer& /* aServer */)
-/**
- * Create individual test steps, outside the suite.
- */
-	{
-	// Initialise test step object to NULL if no TEF step is found
-	CTestStep* testStep = NULL;
-
-
-
-	return testStep;
-	}
-
--- a/windowing/windowserver/tcsc/tcsc.iby	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-rem    Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-
-#if (!defined __TCSC_IBY__)
-#define __TCSC_IBY__
-
-#include <testexecute.iby>
-
-// Display channel test server and test script
-file=ABI_DIR\DEBUG_DIR\wsgcecscserver.exe              	\sys\bin\wsgcecscserver.exe
-data=EPOCROOT##epoc32\data\z\wstest\wscsc.script		\wstest\wscsc.script
-
-#endif
--- a/windowing/windowserver/tcsc/wscsc.script	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// WsGcePerformance.script
-//
-
-LOAD_SUITE wsgcecscserver
-
-// Run the tests as specified by the wrapping script
-// RUN_TEST_STEP 100 wsgcecscserver TEFUnit.CGlobalSettings.Report
-
-////////////////
-// CSC NGA tests
-////////////////
-RUN_TEST_STEP 500 wsgcecscserver TEFUnit.CWSGceCsc.GRAPHICS_WSERV_CSC_101L
-RUN_TEST_STEP 500 wsgcecscserver TEFUnit.CWSGceCsc.GRAPHICS_WSERV_CSC_102L
-RUN_TEST_STEP 500 wsgcecscserver TEFUnit.CWSGceCsc.GRAPHICS_WSERV_CSC_103L
-// Negative test cases
-RUN_TEST_STEP 500 wsgcecscserver TEFUnit.CWSGceCsc.GRAPHICS_WSERV_CSC_104L
-// Defect test cases
-RUN_TEST_STEP 500 wsgcecscserver TEFUnit.CWSGceCsc.GRAPHICS_WSERV_CSC_105L
--- a/windowing/windowserver/tcsc/wscscclassic.script	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// WsGcePerformance.script
-//
-
-LOAD_SUITE wsgcecscserver
-
-// Run the tests as specified by the wrapping script
-// RUN_TEST_STEP 100 wsgcecscserver TEFUnit.CGlobalSettings.Report
-
-////////////////
-// CSC related tests
-////////////////
-RUN_TEST_STEP 500 wsgcecscserver TEFUnit.CWSGceCsc.GRAPHICS_WSERV_CSC_101L
-RUN_TEST_STEP 500 wsgcecscserver TEFUnit.CWSGceCsc.GRAPHICS_WSERV_CSC_103L
-RUN_TEST_STEP 500 wsgcecscserver TEFUnit.CWSGceCsc.GRAPHICS_WSERV_CSC_105L
--- a/windowing/windowserver/tdynamicres/group/bld.inf	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// @file
-// @test
-// @internalComponent
-// 
-//
-
-
-PRJ_TESTMMPFILES
-#ifndef SMP
-#ifdef SYMBIAN_BUILD_GCE
-tdynamicres.mmp
-#endif // SYMBIAN_BUILD_GCE
-tdynamicresclassic.mmp
-#endif // SMP
-PRJ_TESTEXPORTS
-
-#ifdef SYMBIAN_BUILD_GCE
-../scripts/wsdynamicresbasic_no_scaling.script	z:/wstest/dynamicres/wsdynamicresbasic_no_scaling.script
-../scripts/wsdynamicresbasic_integer_scaling.script	z:/wstest/dynamicres/wsdynamicresbasic_integer_scaling.script
-../scripts/wsdynamicresbasic_isotropic_scaling.script	z:/wstest/dynamicres/wsdynamicresbasic_isotropic_scaling.script
-../scripts/wsdynamicresbasic_anisotropic_scaling.script	z:/wstest/dynamicres/wsdynamicresbasic_anisotropic_scaling.script
-../scripts/wsdynamicresbasic_openvg_isotropic.script	z:/wstest/dynamicres/wsdynamicresbasic_openvg_isotropic.script
-#endif // SYMBIAN_BUILD_GCE
-wstestdynamicres.iby	/epoc32/rom/include/wstestdynamicres.iby
-../scripts/wsdynamicresclassic.script	z:/wstest/dynamicres/wsdynamicresclassic.script
-
-
-
--- a/windowing/windowserver/tdynamicres/group/tdynamicres.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
-*/
-
-TARGET			wsdynamicrestestserver.exe
-TARGETTYPE		exe
-UID				0x1000007A 0x102864B7
-
-// For setting the screen mode and registering GUID CRPs
-CAPABILITY		PowerMgmt WriteDeviceData SwEvent ProtServ	
-SOURCEPATH		../src
-
-SOURCE			globalsettings.cpp
-SOURCE			screenselect.cpp
-SOURCE			surfaceutility.cpp
-SOURCE			wsgcedebugsession.cpp
-
-SOURCE			t_wsdynamicrestestserver.cpp 
-SOURCE			t_wsdynamicreswinbase.cpp
-
-SOURCE			wsdynamicresbase.cpp
-SOURCE			wsdynamicresbasic.cpp
-
-USERINCLUDE		../inc
-USERINCLUDE 	../../SERVER ../../nga/SERVER ../../SERVER/restricted ../../inc
-
-MW_LAYER_SYSTEMINCLUDE_SYMBIAN
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-OS_LAYER_LIBC_SYSTEMINCLUDE 
-
-MACRO			SYMBIAN_GRAPHICS_GCE
-
-STATICLIBRARY	tefunit.lib
-LIBRARY			euser.lib
-LIBRARY			estlib.lib 
-LIBRARY			testexecuteutils.lib
-LIBRARY			testexecutelogclient.lib
-LIBRARY			rfileloggerclient.lib
-LIBRARY			ws32.lib
-LIBRARY			surfacemanager.lib
-LIBRARY			surfaceupdateclient.lib
-LIBRARY			imageconversion.lib
-LIBRARY			efsrv.lib
-LIBRARY			fbscli.lib
-LIBRARY			gdi.lib
-LIBRARY			bitgdi.lib
-LIBRARY			hal.lib
-LIBRARY			scdv.lib 
-//LIBRARY			samplegraphicsurface.lib w32stdgraphic.lib samplegraphictestsurfacemulti.lib
-
-
-SMPSAFE
--- a/windowing/windowserver/tdynamicres/group/tdynamicresclassic.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
-*/
-
-TARGET			wsdynamicresclassictestserver.exe
-TARGETTYPE		exe
-UID				0x1000007A 0x102864B8
-
-// For setting the screen mode and registering GUID CRPs
-CAPABILITY		PowerMgmt WriteDeviceData SwEvent ProtServ	
-SOURCEPATH		../src
-SOURCE			t_wsdynamicresclassictestserver.cpp
-SOURCE			wsdynamicresclassic.cpp 
-
-USERINCLUDE		../inc
-
-MW_LAYER_SYSTEMINCLUDE_SYMBIAN
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-OS_LAYER_LIBC_SYSTEMINCLUDE 
-
-
-STATICLIBRARY	tefunit.lib
-LIBRARY			euser.lib
-LIBRARY			estlib.lib 
-LIBRARY			testexecuteutils.lib
-LIBRARY			testexecutelogclient.lib
-LIBRARY			rfileloggerclient.lib
-LIBRARY			ws32.lib
-
-SMPSAFE
--- a/windowing/windowserver/tdynamicres/group/wstestdynamicres.iby	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// WSLog.iby
-// 
-//
-
-#ifndef __WSTESTDYNAMICRES_IBY__
-#define __WSTESTDYNAMICRES_IBY__
-
-REM Window Server Dynamic Resolution Test Scripts [no plugins]
-
-//All these test scripts are copied to the rom. 
-//Please execute only the tests appropriate to your hardware capabilities.
-
-//The following test script asserts that the simplest tests to open the new interfaces will fail.
-//The Symbian reference H4 does not implement MDisplayControl, but some vendors may create their own support.
-file=ABI_DIR\DEBUG_DIR\wsdynamicresclassictestserver.exe	System\Libs\wsdynamicresclassictestserver.exe
-data=DATAZ_\wstest\dynamicres\wsdynamicresclassic.script	wstest\dynamicres\wsdynamicresclassic.script
-
-//Note the following scripts expect H4 GCE to support MDisplayControl.
-//They also optionally benefit from having screen capture installed (dll and wsini.ini)
-//The Symbian reference H4 does not implement MDisplayControl, but some vendors may create their own support.
-//These represent tests that apply to different scaling modes as specified in wsini.ini
-#ifdef SYMBIAN_GRAPHICS_USE_GCE
-file=ABI_DIR\DEBUG_DIR\wsdynamicrestestserver.exe	System\Libs\wsdynamicrestestserver.exe
-data=DATAZ_\wstest\dynamicres\wsdynamicresbasic_anisotropic_scaling.script	wstest\dynamicres\wsdynamicresbasic_anisotropic_scaling.script
-data=DATAZ_\wstest\dynamicres\wsdynamicresbasic_integer_scaling.script	wstest\dynamicres\wsdynamicresbasic_integer_scaling.script
-data=DATAZ_\wstest\dynamicres\wsdynamicresbasic_isotropic_scaling.script	wstest\dynamicres\wsdynamicresbasic_isotropic_scaling.script
-data=DATAZ_\wstest\dynamicres\wsdynamicresbasic_no_scaling.script	wstest\dynamicres\wsdynamicresbasic_no_scaling.script
-data=DATAZ_\wstest\dynamicres\wsdynamicresbasic_openvg_isotropic.script	wstest\dynamicres\wsdynamicresbasic_openvg_isotropic.script
-#endif
-
-#endif
--- a/windowing/windowserver/tdynamicres/inc/globalsettings.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test class that allows a script to set global values 
-// 
-//
-
-#ifndef __GLOBALSETTINGS_H__
-#define __GLOBALSETTINGS_H__
-
-#include <test/tefunit.h>
-#include <w32std.h>
-#include <pixelformats.h>
-class CTestExecuteLogger;
-
-class TGlobalSettings
-	{
-public:
-	static const TGlobalSettings& Instance();
-	
-public:
-	TInt			iScreen;
-	TBool			iDisconnected;  //This value might be changed from CWsDynamicResWinBase::SetupL
-	};								//once the screen has been connected.
-
-class CGlobalSettings : public CTestFixture 
-	{
-public:
-	static const TGlobalSettings& Instance();
-
-	// SetUp and TearDown code 
-
-	// Create a suite of all the tests
-	static CTestSuite* CreateSuiteL(const TDesC& aName);
-	
-	//these tests are public to allow the old CScreenSelect to get to them!
-	void SetScreenNoL(TInt aScreenNo);
-	void ExpectDisconnectedScreenL(TBool aValue);
-	};
-
-
-#endif	//__GLOBALSETTINGS_H__
--- a/windowing/windowserver/tdynamicres/inc/screenselect.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-* @file
-* 
-*
-*/
-
-
-
-#ifndef __SCREEN_SELECT__
-#define __SCREEN_SELECT__
-
-#include <test/tefunit.h>
-
-/**
-Test step to set a static screen number selection, which can be used to run the
-same test code on an alternate screen by simply adding this step and repeating
-the test.
-
-Test steps which support this must use the static CSelectScreen::Number()
-function to get the currently selected screen number, and pass this to the
-Construct() call for a CWsScreenDevice.
-*/
-
-class CScreenSelect : public CTestStep
-	{
-public:
-	CScreenSelect(TInt aScreenNumber, const TDesC& aStepName);
-	~CScreenSelect();
-
-	static TInt Number();
-
-	virtual TVerdict doTestStepL();
-
-private:
-	TInt iScreenNumber;
-	};
-
-#endif // __SCREEN_SELECT__
-
--- a/windowing/windowserver/tdynamicres/inc/surfaceutility.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/**
-* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-
-/**
- @file
-*/
-
-#ifndef __SURFACE_UTILITY__
-#define __SURFACE_UTILITY__
-
-#include <e32base.h>
-#include <graphics/surface.h>
-#include <graphics/surfacemanager.h>
-#include <graphics/surfaceupdateclient.h>
-
-#define ENABLE_TEST_LOGGING
-#define ALPHA_FIX_24BIT	0xffU //This forces a non-zero value into the X byte of 16MU color values
-
-#if defined(ENABLE_TEST_LOGGING)
-#define LOG(X)	RDebug::Printf X
-#else
-#define LOG(X)
-#endif
-
-class TRgb;
-class CFbsBitmap;
-
-class CSurfaceUtility : public CBase
-	{
-public:
-	static CSurfaceUtility* NewL(CSurfaceUtility* aClone=NULL);
-	virtual ~CSurfaceUtility();
-	TSize SurfaceSize(const TSurfaceId& aSurface);
-	void CreateSurfaceFromFileL(const TDesC& aFileName, TSurfaceId& aSurface);
-	TSurfaceId CreateSurfaceL(const TSize& aSize, TUidPixelFormat aPixelFormat, TInt aStride, TInt aBuffers = 1);
-	TInt BytesPerPixelL(TUidPixelFormat aPixelFormat);
-	void FillSurfaceL(TSurfaceId& aSurface, const TRgb& aColor);
-	void FillChunkL(TSurfaceId& aSurface, RChunk& aChunk, const TRgb& aColor, TInt aBufferNumber);
-	void FillRectangleL(TSurfaceId& aSurface, const TPoint& aStartPos, const TSize& aSize, const TRgb& aColor);
-	void FillRectangleNoUpdateL(TSurfaceId& aSurface, const TPoint& aStartPos, const TSize& aSize, const TRgb& aColor);
-	void GridFillSurfaceL(TSurfaceId& aSurface, const TRgb& aColor, const TRgb& aLines);
-	void PatternFillSurfaceL(TSurfaceId& aSurface);
-	void FanFillSurfaceL(TSurfaceId& aSurface, const TRgb& aColor, const TRgb& aLinesTL,const TRgb& aLinesBR);
-	void LineFillSurfaceL(TSurfaceId& aSurface, const TRgb& aBackColor, const TRgb& aLineColor, TInt aPosition);
-	CFbsBitmap* EquivalentBitmapL(TSurfaceId& aSurface, CFbsBitmap* aCopyTo=NULL);
-	void DestroySurface(TSurfaceId& aSurface);
-	TBool DestroyAll();
-	void SubmitUpdate(TInt aScreenNumber, const TSurfaceId& aSurface, const TRegion* aRegion, TInt aBufferNumber = 0);
-	void MapAndSubmitUpdateL(RChunk& aChunk, TInt aScreenNumber, const TSurfaceId& aSurface, const TRegion* aRegion);
-	void MapSurfaceL(const TSurfaceId& aSurface, RChunk& aChunk);
-	void CopyBitmapFromFileToSurfaceL(const TDesC& aFileName, TSurfaceId& aSurface);
-	void CopyBitmapSurfaceL(const CFbsBitmap* aBitmap, TSurfaceId& aSurface);
-	void CopyBitmapToSurfaceL(TSurfaceId& aSurface, const CFbsBitmap& aBitmap);
-private:
-	CSurfaceUtility(CSurfaceUtility* aClone);
-	void ConstructL();
-
-private:
-	RSurfaceManager iManager;
-	RSurfaceUpdateSession iSurfaceUpdateSession;
-	//This local object wraps the array operations in a heap switch
-	//The reason for providing this wrapper is to allow threads to share the surface manager surface ID list.
-	//In particular, the next test can attempt to release the previous test's surfaces if it paniced. 
-	//Note that the presumption is that the owning thread will be paused, 
-	//so there will be no thread interlock issues with it's heap manager.
-	class RHeapSurfaceArray
-		{
-		public:
-		typedef RArray<TSurfaceId>	Array;
-		RHeapSurfaceArray(RHeapSurfaceArray* aUseExternalArray=NULL);
-
-		//Emulation of RArray entrypoints. Add more stub methods if required...
-		TSurfaceId& operator[](TUint aIndex);
-		void Close();
-		TInt Count() const;
-		inline void Reset();
-		void AppendL(const TSurfaceId &anEntry);
-		TInt Find(const TSurfaceId &anEntry) const;
-		void Remove(TInt anIndex);
-		
-		private:
-		static void PopHeap(void* mainheap);
-		static void SwitchHeapLC(RHeap* aNewHeap);
-		
-		Array iLocalArray;
-		Array* iUseArray;
-		RHeap &iExternalHeapRef;
-		}	iSurfaces;
-	};
-
-#endif // __SURFACE_UTILITY__
-
--- a/windowing/windowserver/tdynamicres/inc/t_wsdynamicreswinbase.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,169 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// twsgcetestwinbase.h
-// 
-//
-
-#ifndef TWSDYNAMICRESWINBASE_H_
-#define TWSDYNAMICRESWINBASE_H_
-
-#include <gdi.h>
-#include <test/tefunit.h>
-#include <w32std.h>
-#include <w32debug.h>
-#include "wsgcedebugsession.h"
-struct TWsDebugWindowId;
-
-/**
- * Base class sets up the tryptich of test windows.
- * 
- * 
- **/
-class CWsDynamicResWinBase : public CTestFixture
-{
-public:
-	CWsDynamicResWinBase();
-	virtual ~CWsDynamicResWinBase();
-	virtual void SetupL();
-	virtual void SetupL(TBool aUseOtherScreenForInfo);
-	
-	virtual void TearDownL();
-	virtual void TearDownFromDeleteL();
-	
-	static TBool	ActivateWithWipe(CWindowGc* aGc,RWindow& aWin,TRgb aColor=TRgb(0,0));
-	
-	/* Note that each derived test class needs to declare a static function to register tests.
-	 * This should match the following prototype:
-	static CTestSuite* CreateSuiteL( const TDesC& aName );
-	*/ 
-	
-protected:
-	static void Pause(TInt aMilliseconds=200);
-
-	TBool GCEIsSupported() const;
-	static TBool GCEIsSupportedStatic();
-
-	TBool DisplayHasAlpha() const;
-	TBool SelectChromaCompositionMode();
-	TBool SelectAlphaCompositionMode(TDisplayMode aMode = EColor16MA);
-	TRgb  GceHoleColor(RWindowBase& aWin)const;
-	void DrawUIContent(RWindow& aWindow);
-	void DrawPlainUI(RWindow& aWindow,TBool aInvalidate,TRgb aWipeColor=TRgb(0,0));
-	void DrawCross(RWindow& aWindow, TRgb aColor, TInt aThickness=1);
-	void TestPixelL(TPoint aPt, TRgb aColor, TBool aMatch);
-	TBool TestRectL(TRect aRect,TRgb aInnerColor,TInt aOtherInnerColors,TRgb aOuterColor,TInt aOtherOuterColors,TInt aCornerSize);
-	void MakeTitleAndCompareWindowsL(TRefByValue<const TDesC16> aTitle,TRefByValue<const TDesC16> aDetail=_L(""));
-	void LargerCompareWindow(TBool aGoLarger=ETrue);
-	void UpdateTitleWindowL(TRefByValue<const TDesC16> aDetail,TInt aIndex=0);
-	void RepaintTitleWindowL();
-	void TefUnitFailLeaveL();
-	CWindowGc*	GcForWindow(RWindow& aWin);
-	TBool		InvalidateRegion(const TRegion& aRegion,RWindow& aWin);
-	CWindowGc*	BeginActivateWithWipe(TBool aInvalidate,RWindow& aWin,TRgb aColor=TRgb(0,0));
-	CWindowGc*	BeginActivateWithWipe(TBool aInvalidate,TRect aRect,RWindow& aWin,TRgb aColor=TRgb(0,0));
-	CWindowGc*	BeginActivateWithWipe(const TRegion& aRegion,RWindow& aWin,TRgb aColor);
-	/** Helper method to find a named screen region
-	 *	start/end letter should be 'a' to 'y' (yes that includes 'i')
-	 **/
-	static TRect PentCellRect(const TRect& aFullRect,char aStartLetter,char aEndLetter=0);
-	void CheckAndConnectScreen();
-
-protected:
-	static const TInt KSurfaceWidth = 50;
-	static const TInt KSurfaceHeight = 50;
-	TBool	iDoTearDown;
-	RWsDebugSession iSession;
-	RWindowGroup iGroup;
-	RWindowGroup iInfoGroupInstance;
-	RWindowGroup* iInfoGroup;
-	CWsScreenDevice* iScreenDevice;
-	CWsScreenDevice* iInfoScreenDevice;
-	CWindowGc* iGc;
-	CWindowGc* iInfoGc;
-	TInt iWindowHandle;
-	static TBool	iTransparencyEnabled;
-	TRgb iRed, iGreen, iBlue, iCyan, iMagenta, iYellow, iWhite;
-	TRgb TITLE_BACKGROUND;
-	TRgb COMPARE_BACKGROUND;
-	RBlankWindow iBackground;
-	RWindow iCompare;
-	RWindow iTitle;
-	TRect 	iTestPos;
-	TRect   iCenteredFrontWinRect;
-	TPoint	iTestPointCentre;
-	TDisplayMode iDisplayMode;
-	static const TInt KMaxTestName = 80;
-	typedef TBuf<KMaxTestName> TTestName;
-	mutable TRgb	iLastGceHoleColor;
-	TTestName iTestName;
-	static const TInt KMaxInfoLines=5;
-	TTestName iTestInfo[KMaxInfoLines];
-	static CActiveScheduler	iScheduler;
-};
-
-// This little helper class checks that the given bytes contain the expected pattern.
-namespace Pattern
-	{
-		void Fill(void* aTrg,TInt aOffset,TInt aLength);
-		TBool Check(void* aTrg,TInt aOffset,TInt aLength);
-		TBool CheckVal(void* aTrg,TInt aOffset,TInt aLength,char val=0);
-	}
-
-//This wrapper for the configuration class allows stress testing of the configuration object
-
-template <class TXxxConfiguration,TInt aExtraSize,TInt aFalseSize> 
-class TestExtend:	public TXxxConfiguration
-	{
-public:
-	char iExtraData[aExtraSize];
-	TestExtend():
-		TXxxConfiguration(aFalseSize)
-		{
-		TXxxConfiguration::iSize=aFalseSize;
-		Pattern::Fill(this,aFalseSize,sizeof(*this)-aFalseSize);
-		}
-	void* operator new(unsigned int,TestExtend* inplace)
-	{	//Use this inplace operator new to pre-initialise the memory
-	return inplace;
-	}
-	void operator delete(void*,TestExtend*)
-	{	//Stops the warning!
-	}
-	TestExtend(const TXxxConfiguration&i):
-		TXxxConfiguration(i)
-		{
-		Pattern::Check(this,sizeof(TXxxConfiguration),aExtraSize);
-		}
-	TBool WasExtraOverwritten()
-		{
-		return Pattern::Check(this,sizeof(TXxxConfiguration),aExtraSize);
-		}
-	TBool WasFalseSizeOverwritten()
-		{
-		return Pattern::Check(this,aFalseSize,sizeof(*this)-aFalseSize);
-		}
-	TBool WasFalseSizeZero()
-		{
-		return Pattern::CheckVal(this,aFalseSize,sizeof(TXxxConfiguration)-aFalseSize);
-		}
-	void	StompValue(TInt aOffsetInLongs,TInt aNewValue)
-		{
-		*((TInt*)this+aOffsetInLongs)=aNewValue;
-		}
-	TInt	ReadValue(TInt aOffsetInLongs)
-		{
-		return *((TInt*)this+aOffsetInLongs);
-		}
-	};
-#endif /*TWSDYNAMICRESWINBASE_H_*/
--- a/windowing/windowserver/tdynamicres/inc/teflogextensions.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-* @file
-* 
-*
-*/
-
-
-
-#ifndef __TEF_LOG_EXTENSIONS__
-#define __TEF_LOG_EXTENSIONS__
-
-#include <test/tefunit.h>
-
-/*
-This file contains extensions to the TEF macros used for logging, defined in
-tefunit.h.
-*/
-
-/*
-Wrapper to check for an error, then print it and leave with it if not KErrNone.
-do ... while (0) ensures the macro can be treated like a single statement. A
-macro is used to get the line number information.
-Note that p1 will be evaluated once and only once.
-*/
-#define PRINT_ON_ERROR2_L(test, p1, p2)	\
-	do \
-		{ \
-		TInt result = (test); \
-		if (result != KErrNone) \
-			{ \
-			Logger().LogExtra(((TText8*)__FILE__), __LINE__, ESevrErr, (p1), (p2)); \
-			User::Leave(result); \
-			} \
-		} \
-	while (0)
-
-#define PRINT_ON_ERROR3_L(test, p1, p2, p3)	\
-	do \
-		{ \
-		TInt result = (test); \
-		if (result != KErrNone) \
-			{ \
-			Logger().LogExtra(((TText8*)__FILE__), __LINE__, ESevrErr, (p1), (p2), (p3)); \
-			User::Leave(result); \
-			} \
-		} \
-	while (0)
-
-/*
-Modified version of ASSERT_EQUALS() that will log the expression tested, the
-expected result and the actual one.
-*/
-#define ASSERT_CONDITION(c)	_LIT(KExpression, c);
-
-#define ASSERT_EQUALS_X(aExpression, aExpected) \
-	do \
-		{ \
-		TInt result = (TInt)(aExpression); \
-		TInt expected = (TInt)(aExpected); \
-		if (result != expected) \
-			{ \
-			ASSERT_CONDITION(#aExpression); \
-			Logger().LogExtra(((TText8*)__FILE__), __LINE__, ESevrErr, _L("%S == %d, not %d"), &KExpression(), result, expected ); \
-			User::Leave(KErrTEFUnitFail); \
-			} \
-		} \
-	while (0)
-
-#define ASSERT_NOT_EQUALS_X(aExpression, aUnexpected) \
-	do \
-		{ \
-		TInt result = (TInt)(aExpression); \
-		TInt unexpected = (TInt)(aUnexpected); \
-		if (result == unexpected) \
-			{ \
-			ASSERT_CONDITION(#aExpression); \
-			Logger().LogExtra(((TText8*)__FILE__), __LINE__, ESevrErr, _L("%S == %d, unexpectedly"), &KExpression(), result ); \
-			User::Leave(KErrTEFUnitFail); \
-			} \
-		} \
-	while (0)
-
-#define ASSERT_TRUE_X(aExpression) \
-	do \
-		{ \
-		TBool result = (TBool)(aExpression); \
-		if (!result) \
-			{ \
-			ASSERT_CONDITION(#aExpression); \
-			Logger().LogExtra(((TText8*)__FILE__), __LINE__, ESevrErr, _L("%S false"), &KExpression() ); \
-			User::Leave(KErrTEFUnitFail); \
-			} \
-		} \
-	while (0)
-
-#endif // __TEF_LOG_EXTENSIONS__
-
--- a/windowing/windowserver/tdynamicres/inc/wsdynamicresbase.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,164 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef WSDYNAMICRESBASE_H_
-#define WSDYNAMICRESBASE_H_
-
-#include "t_wsdynamicreswinbase.h"
-#include <graphics/surface.h>
-#include "surfaceutility.h"
-
-//************************************
-//
-// Asserting wrapper around dereferencing a pointer that might be NULL.
-// I don't want to fill the test code with checks that this pointer is not null before calling surface utility methods....
-//
-//************************************
-
-template <class Referee,class LoggerOwner>
-class	SafePointer
-	{
-public:
-	SafePointer(LoggerOwner* aOwner,Referee* aReferee=NULL):
-		iOwner(aOwner),	iReferee(aReferee)
-		{}
-	Referee*	operator=(Referee* aReferee)
-		{
-		return iReferee=aReferee;
-		}
-	Referee*&	operator()()
-		{
-		return iReferee;
-		}
-	Referee*	operator->()
-		{
-		if (iReferee==NULL)
-			{
-			iOwner -> INFO_PRINTF1(_L("Tried to dereference a pointer that is null!"));
-			User::Panic(_L("null pointer"),__LINE__);
-			}
-		return iReferee;
-		}
-private:
-	LoggerOwner* iOwner;
-	Referee* iReferee;
-	};
-	
-/**
- * Base class test harness that provides facilities for windowing and surface testing
- * 
- **/
-class CWsDynamicResBase : public CWsDynamicResWinBase
-{
-public:
-	CWsDynamicResBase();
-	virtual ~CWsDynamicResBase();
-	
-	virtual void SetupL();
-	virtual void SetupL(TBool aUseOtherScreenForInfo);
-	virtual void TearDownL();
-	virtual void TearDownFromDeleteL();
-	/* Note that each derived test class needs to declare a static function to register tests.
-	 * This should match the following prototype:
-	static CTestSuite* CreateSuiteL( const TDesC& aName );
-	*/ 
-
-	protected:
-	void UISurfaceL(TSurfaceId& aSurfaceId) const;
-	void CommonSurfaceWindowSetupL(RWindow& aWindow, TSurfaceId& aSurface, const TRgb& aColor);
-	void CommonOverlayWindowSetupL(RWindow& aWindow, const TRgb& aColor);
-	void ResizeTestCommonSetupL(RWindow& aWindow, const TRgb& aColor);
-
-	void MakeTestWindowPairL(TRect aOuterRect,TRgb aOuterColor,TRect aInnerRect,TRgb aInnerColor);
-	void LargerTestWindow(TInt aPercentOfBack=80);
-	void DestroyTestWindowPair(TBool aKillTestBack=ETrue,TBool aKillTestFront=ETrue,TBool aKillTestChildren=ETrue);
-	void MakeTestWindowTripleL(TRect aOuterRect,TRgb aOuterColor,TRect aInnerRect,TRgb aInnerColor,TRect aChildRect,TRgb aChildColor,TRect aSecondChildRect,TRgb aSecondChildColor);
-	void CreateTestWindowQuadL(TRect aOuterRect,TRgb aOuterColor,TRect aInnerRect,TRgb aInnerColor,TRect aChildRect,TRgb aChildColor,TRect aSecondChildRect,TRgb aSecondChildColor);
-	void MakeTestWindowTripleL(TRect aOuterRect,TRgb aOuterColor,TRect aInnerRect,TRgb aInnerColor,TRect aChildRect,TRgb aChildColor);
-	void MakeExtraChildWindowL(const RWindowBase& aFromParent,TRect aChildRect,TRgb aChildColor);
-	struct LoopingGcPtr;
-	LoopingGcPtr	LoopBeginActivateWithWipe(const TRegion& aRegion,RWindow& aWin,TRgb aColor);
-	CWindowGc*	BeginActivateWithWipe(TBool aInvalidate,RWindow& aWin,TRgb aColor=TRgb(0,0));
-	CWindowGc*	BeginActivateWithWipe(TBool aInvalidate,TRect aRect,RWindow& aWin,TRgb aColor=TRgb(0,0));
-	CWindowGc*	BeginActivateWithWipe(const TRegion& aRegion,RWindow& aWin,TRgb aColor);
-	static CFbsBitmap* RotateBitmapLC(const CFbsBitmap* aSrcBitmap);
-
-	void Pause(TInt aMilliseconds);
-	TInt	RegionDiffForUiLayer(TInt aUiLayer);	//returns values from TRegionExtend::TOverlapFlags enumeration
-	enum	 FastPathMode
-		{	//Tereat this as bit flags or distinct states as you wish.
-			EFpExternalOpaque=0,
-			EFpUiOpaque=1,
-			EFpUiBlended=2,
-			EFpUiComplex=3,			//If ony this is set then both blended and opaque are full=screen
-			EFpUiRegions=4,			//If this FLAG is set then the regions are less than full-screen. Never occurs on its own
-			EFpUiRegionsOpaque=5,			//If this is set then the regions are less than full-screen
-			EFpUiRegionsBlended=6,			//If this is set then the regions are less than full-screen
-			EFpUiRegionsComplex=7	//This is the expected setting for windowed cr1108 optimisation. 
-		};
-	FastPathMode	DeduceUiFastPathMode();
-protected:
-	SafePointer<CSurfaceUtility,CWsDynamicResBase> iUtility;
-	class TPostTestCleanup
-		{
-		protected:
-		TPostTestCleanup()	{}
-		public:
-		mutable CSurfaceUtility*	iSharedUtility;
-		mutable TBool				iCleanedUpOnExit;
-		void				CreateSharedUtilityL()const ;
-		};
-	static const TPostTestCleanup& PostTestCleanupInstance();
-	RWindow	iTestBack;
-	RWindow	iTestFront;
-	RWindow	iTestChild;
-	RWindow	iTestSecondChild;
-	static const TUidPixelFormat KSurfaceFormat = EUidPixelFormatXRGB_8888;
-	static const TInt KBytesPerPixel = 4;	// Four bytes per pixel for the format above.
-private:
-
-};
-
-struct CWsDynamicResBase::LoopingGcPtr
-	{
-	LoopingGcPtr(const TRegion& aRegion,RWindow& aWin,TRgb aColor,CWindowGc *aGc)
-		:	iRegion(aRegion),	iWin(aWin),	iColor(aColor), iGc(aGc), iPass(-1)	
-		{ operator++();	}
-	LoopingGcPtr(const LoopingGcPtr& aRhs)
-		:	iRegion(aRhs.iRegion),	iWin(aRhs.iWin),	
-			iColor(aRhs.iColor), iGc(aRhs.iGc),
-			iPass(aRhs.iPass)	
-		{}
-	void operator ++();	
-	operator bool()		{ return iPass>=0?iGc:(CWindowGc *)NULL;	}
-	CWindowGc * operator ->()	{ return iPass>=0?iGc:(CWindowGc *)NULL;	}
-	const TRegion& iRegion;
-	RWindow& iWin;
-	TRgb iColor;
-	CWindowGc *iGc;
-	TInt iPass;
-	};
-
-#define LOG_AND_PANIC_IF_NOT_GCE											\
-		{																	\
-		if (!GCEIsSupported())												\
-			{																\
-			INFO_PRINTF1(_L("Test skipped: GCE support is not loaded"));	\
-			User::Panic(_L("GCE.Wrong.Mode"),1);							\
-			return;															\
-			}																\
-		}
-
-#endif /*WSDYNAMICRESBASE_H_*/
--- a/windowing/windowserver/tdynamicres/inc/wsdynamicresbasic.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,187 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
-*/
-
-#ifndef __WSDYNAMICRESBASIC_H__
-#define __WSDYNAMICRESBASIC_H__
-
-#include "wsdynamicresbase.h"
-#include <graphics/displayconfiguration.h>
-#include <graphics/displaycontrol.h>
-#include <graphics/displaymapping.h>
-#include <e32math.h>
-/**
- *
- **/
-
-static TBool cSCLogged =EFalse;
-
-
-class CWsDynamicResBasic : public CWsDynamicResBase
-{
-	typedef CWsDynamicResBase MyBase;
-private:
-	struct TBitmapRegionPair
-		{
-		CFbsBitmap* bitmap;
-		RRegion* region;
-		TRect drawRect;
-		};
-
-public:
-	CWsDynamicResBasic();
-	virtual ~CWsDynamicResBasic();
-	virtual void SetupL();
-	virtual void TearDownL();
-	virtual void TearDownFromDeleteL();
-	
-	static CTestSuite* CreateSuiteL( const TDesC& aName );
-	
-	void ResetScreens();
-	
-protected:
-//tests
-	
-	//BASIC
-	void	GRAPHICS_WSERV_DYNAMICRES_0001L();
-	void	GRAPHICS_WSERV_DYNAMICRES_0002L();
-	void	GRAPHICS_WSERV_DYNAMICRES_0003L();
-	void	GRAPHICS_WSERV_DYNAMICRES_0004L();
-	void	GRAPHICS_WSERV_DYNAMICRES_0005L();
-	void	GRAPHICS_WSERV_DYNAMICRES_0006L();
-	void	GRAPHICS_WSERV_DYNAMICRES_0007L();
-	void	GRAPHICS_WSERV_DYNAMICRES_0008L();
-	void	GRAPHICS_WSERV_DYNAMICRES_0009L();
-	void	GRAPHICS_WSERV_DYNAMICRES_0010L();
-	void	GRAPHICS_WSERV_DYNAMICRES_0011L();
-	void	GRAPHICS_WSERV_DYNAMICRES_0012L();
-	void	GRAPHICS_WSERV_DYNAMICRES_0013L();
-	void	GRAPHICS_WSERV_DYNAMICRES_0014L();
-	void	GRAPHICS_WSERV_DYNAMICRES_0015L();
-	void	GRAPHICS_WSERV_DYNAMICRES_0016L();
-	void	GRAPHICS_WSERV_DYNAMICRES_0017L();
-	void	GRAPHICS_WSERV_DYNAMICRES_0018L();
-
-	//NEGATIVE
-	void	GRAPHICS_WSERV_DYNAMICRES_0021L(TBool aScaleMode);
-	
-	//OOM
-	void	GRAPHICS_WSERV_DYNAMICRES_0031L();
-	void	GRAPHICS_WSERV_DYNAMICRES_0032L();
-	void	GRAPHICS_WSERV_DYNAMICRES_0033L();
-	void	GRAPHICS_WSERV_DYNAMICRES_0034L();
-	
-	//SCREEN CAPTURE
-	void	GRAPHICS_WSERV_DYNAMICRES_0041L(TBool aIsSurface);
-	void	GRAPHICS_WSERV_DYNAMICRES_0042L(TBool aIsSurface);
-	
-	//DYNAMIC SCREEN MODE
-	void	GRAPHICS_WSERV_DYNAMICRES_0051L();
-	void	GRAPHICS_WSERV_DYNAMICRES_0052L();
-	void	GRAPHICS_WSERV_DYNAMICRES_0053L();
-
-	//DEFECT
-	void	GRAPHICS_WSERV_DYNAMICRES_0101L();
-	void	GRAPHICS_WSERV_DYNAMICRES_0102L();
-	
-	
-	void SetRotation (TDisplayConfiguration& aConfig, const MDisplayControl::TResolution& aResolution);
-	TBool Compare(const CFbsBitmap& aBitmap, const TRect& aRect1,
-			const TRect& aRect2, RArray<TBitmapRegionPair>& aRegionArray, TBool aIsSurface);
-	TRgb GreatestColor(TRgb& aColor) const;
-
-//data members:
-private:
-	CActiveScheduler	iScheduler;
-};
-
-class CWsDisplayEvent : public CActive
-	{
-	
-public:
-	CWsDisplayEvent(RWsSession *aWs);
-	~CWsDisplayEvent();
-	void Request();
-	TInt ConfigSpinner()	{return iConfigSpinner;}
-	TInt ResListSpinner()	{return iResListSpinner;}
-	TInt ReceivedEventCount()	{return iReceivedEventCount;}
-	TInt ReceivedDeviceEventCount()	{return iReceivedDeviceEventCount;}
-	TInt ReceivedPointerEventCount() {return iReceivedPointerEventCount;}
-	void SetExpectedPointPos(const TPoint& aPos) {iPointerPos = aPos;}
-	TBool PointerTestPassed() {return iPointerPosTestPass;}
-protected:
-	void DoCancel();
-	void RunL();
-	
-private:
-	RWsSession *iWs;
-	TInt iConfigSpinner;
-	TInt iResListSpinner;
-	TInt iReceivedEventCount;
-	TInt iReceivedDeviceEventCount;
-	TInt iReceivedPointerEventCount;	
-	TPoint iPointerPos;
-	TBool iPointerPosTestPass;
-	};
-
-class CEventTimer : public CActive
-	{
-public:
-	static CEventTimer* NewL();
-	~CEventTimer();
-	void Wait(TInt aDelay);
-	// From CActive:
-	void RunL();
-	void DoCancel();
-	
-protected:
-	CEventTimer();
-	void ConstructL();
-	protected:
-RTimer iTimer;
-};
-
-
-
-class CDSATestDrawing: public CTimer, public MDirectScreenAccess
-	{
-public:
-
-	void Draw();
-
-	
-	
-	static CDSATestDrawing* NewL();
-	void ConstructL();
-	//from MDirectScreenAccess
-	void Restart(RDirectScreenAccess::TTerminationReasons aReason);
-	void AbortNow(RDirectScreenAccess::TTerminationReasons aReason);
-	~CDSATestDrawing();
-	void SetDSA(CDirectScreenAccess *aDSA){iDSA = aDSA;}
-	void SetWindow(RWindow &aWindow){iWin = &aWindow;}
-	void StartDrawingL(CDirectScreenAccess *aDSA);
-	void RunL();
-	
-private:
-	CDSATestDrawing();
-	TRect iRect;
-	RWindow* iWin;
-	CDirectScreenAccess *iDSA;
-	};
-
-#endif	/*__WSDYNAMICRESBASIC_H__*/
--- a/windowing/windowserver/tdynamicres/inc/wsdynamicresclassic.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test class that allows a script to set global values 
-// 
-//
-
-#ifndef __WSDYNAMICRESCLASSIC_H__
-#define __WSDYNAMICRESCLASSIC_H__
-
-#include <test/tefunit.h>
-#include <w32std.h>
-class CTestExecuteLogger;
-
-class CWsDynamicResClassic : public CTestFixture 
-	{
-public:
-	static const CWsDynamicResClassic& Instance();
-
-	// Create a suite of all the tests
-	static CTestSuite* CreateSuiteL(const TDesC& aName);
-		
-private:
-	// Private tests
-	void GRAPHICS_WSERV_DYNAMICRES_0100L();
-	};
-
-
-#endif	//__WSDYNAMICRESCLASSIC_H__
--- a/windowing/windowserver/tdynamicres/inc/wsgcedebugsession.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef WSGCEDEBUGSESSION_H_
-#define WSGCEDEBUGSESSION_H_
-
-#include <w32std.h>
-#include <w32debug.h>
-struct TWsDebugWindowId;
-
-class RWsDebugSession:public RWsSession
-	{
-public:
-	RWsDebugSession(TInt aScreenNo = -1);
-	~ RWsDebugSession();
-	using RWsSession::DebugInfo;		//exposes the following two functions:
-//	TInt	DebugInfo(TInt aFunction, TInt aParam=0) const;
-//	TInt	DebugInfo(TInt aFunction, TDes8& aReturnBuf, TInt aParam=0) const;
-	
-	/**	Returns an array of debug data about the specified object. 
-	 *  The data is placed in the aHostBuffer 
-	 * 	If data is returned, aReturnedObject points to the start of the returned data, and the return value is the number of DataType objects.
-	 * 	If no data is returned, aReturnedObject is NULL.
-	 *  If so the return code indicates an error code, or the required number of objects.
-	 * 	The object index is specified using the masks and shifts in TWsDebugClassArgMask
-	 *  Various error codes may be returned from the server, some of which may simply explain why no data is available.
-	 * 	The client may return 
-	 * 		KErrCancel to indicate that there is zero length of data
-	 * 		KErrCorrupt if the size of the returned data is not an exact multiple of DataType.
-	 * 	No other type checking is performed.  
-	 **/
-	template <class DataType>	// DataType may be TSurfaceId, TInt,TRect, TSurfaceConfiguration (not TRegion)
-	TInt	DebugInfo(TWsDebugInfoFunc aFunction, TInt aObjectIndex, TDes8& aHostBuffer,const DataType*&aReturnedObject)const
-	{
-	return DebugInfo(aFunction,aObjectIndex,aHostBuffer,(const void*&)aReturnedObject,sizeof(DataType));
-	}
-	/**	Fills the region object with the specified debug information.
-	 * 	If required the region is resized to fit the data, which may fail with KErrNoMemory
-	 * 	The region will be forced to error state if an error code is returned.
-	 * 	Other details: see overloads
-	 **/
-	TInt	DebugInfo(TWsDebugInfoFunc aFunction, TInt aObjectIndex, TRegion& aPreAllocatedReturnedRegion)const;
-	
-	/** Indicates the start of a "consistancy-critical-read" section and fetches the window list.
-	 * 	Any number of debug commands can be fetched in the section, then client can check if the were interrupted by a server recalculation.
-	 **/
-	TInt	ResetUpdatedAndGetSurfaceWindowList (const TWsDebugWindowId*&);
-	/** Indicates the start or end of a "consistancy-critical-read" section
-	 * 	Any number of debug commands can be fetched in the section, then client can check if the were interrupted by a server recalculation.
-	 * 	If this method returns ETrue then the data fetched since the start may be inconsistant, and should be refetched.
-	 * 	This method may also be used as a dirty way of waiting for a deferred update to occur.
-	 **/
-	TBool	ResetUpdated();
-	/**	Returns the screen number assigned when the stub was created. 
-	 **/
-	TInt DebugScreenNo()	{	return iScreenNo;	}
-	/** Helper method to correctly format the aObjectIndex parameter.
-	 **/
-	inline TInt ObjInd(TInt aWin=0,TInt aLayer=0,TInt aExtra=0)
-		{	return ObjIndScr(iScreenNo,aWin,aLayer,aExtra);	}
-	/** Helper method to correctly format the aObjectIndex parameter.
-	 **/
-	inline TInt ObjIndScr(TInt aScreen,TInt aWin=0,TInt aLayer=0,TInt aExtra=0);
-	
-	inline	TInt Finish(TBool aAndFlush=ETrue)
-		{
-		if (aAndFlush)
-			Flush();
-		return RWsSession::Finish();
-		}
-protected:
-	// Resolves the template parameter to a size. See overload docs for more info.
-	TInt	DebugInfo(TWsDebugInfoFunc aFunction, TInt aObjectIndex, TDes8& aHostBuffer,const void*&aReturnedObject,TInt aSize)const;
-	TInt	iScreenNo;
-	TInt	iSurfaceUpdateSerial;
-	RBuf8	iSurfaceListBuffer;
-	};
-inline TInt RWsDebugSession::ObjIndScr(TInt aScreen,TInt aWin,TInt aLayer,TInt aExtra)
-	{
-	return 	(aScreen<<EWsDebugArgScreenShift)
-		|	(aWin<<EWsDebugArgWindowShift)
-		|	(aLayer<<EWsDebugArgLayerShift)
-		|	(aExtra<<EWsDebugArgExtraShift);
-	}
-
-#endif /*WSGCEDEBUGSESSION_H_*/
--- a/windowing/windowserver/tdynamicres/scripts/wsdynamicresbasic_anisotropic_scaling.script	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-//
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description: 
-//
-
-LOAD_SUITE wsdynamicrestestserver 
-
-RUN_PROGRAM tclosepanicwindow.exe
-
-RUN_TEST_STEP 100 wsdynamicrestestserver TEFUnit.CGlobalSettings.SetScreenNoL.0
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0001L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0002L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0003L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0004L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0005L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0006L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0007L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0008L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0009L
-//0010 skipped
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0011L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0012L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0013L
-//0014 0015 skipped
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0016L
-//0017 skipped
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0018L
-
-//0021 skipped
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0031L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0032L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0033L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0034L
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0041L.0
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0042L.0
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0041L.1
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0042L.1
-
-//0051 0052 skipped
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0101L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0102L
-
-RUN_TEST_STEP 100 wsdynamicrestestserver TEFUnit.CGlobalSettings.SetScreenNoL.1
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0001L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0002L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0003L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0004L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0005L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0006L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0007L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0008L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0009L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0010L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0011L
-//0012 skipped
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0013L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0014L
-//0015 skipped
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0016L
-//0017 skipped
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0018L
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0021L.1
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0031L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0032L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0033L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0034L
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0041L.0
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0042L.0
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0041L.1
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0042L.1
-
-//0051 0052 skipped
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0101L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0102L
-
-//Tidy up
-RUN_PROGRAM tclosepanicwindow.exe
--- a/windowing/windowserver/tdynamicres/scripts/wsdynamicresbasic_integer_scaling.script	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-//
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description: 
-//
-
-LOAD_SUITE wsdynamicrestestserver 
-
-RUN_PROGRAM tclosepanicwindow.exe
-
-RUN_TEST_STEP 100 wsdynamicrestestserver TEFUnit.CGlobalSettings.SetScreenNoL.0
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0001L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0002L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0003L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0004L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0005L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0006L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0007L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0008L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0009L
-//0010 skipped
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0011L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0012L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0013L
-//0014 0015 0016 skipped
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0017L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0018L
-
-//0021 skipped
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0031L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0032L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0033L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0034L
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0041L.0
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0042L.0
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0041L.1
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0042L.1
-
-//0051 0052 skipped
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0101L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0102L
-
-RUN_TEST_STEP 100 wsdynamicrestestserver TEFUnit.CGlobalSettings.SetScreenNoL.1
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0001L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0002L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0003L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0004L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0005L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0006L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0007L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0008L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0009L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0010L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0011L
-//0012 skipped
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0013L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0014L
-//0015 0016 skipped
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0017L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0018L
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0021L.1
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0031L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0032L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0033L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0034L
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0041L.0
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0042L.0
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0041L.1
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0042L.1
-
-//0051 0052 skipped
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0101L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0102L
-
-//Tidy up
-RUN_PROGRAM tclosepanicwindow.exe
--- a/windowing/windowserver/tdynamicres/scripts/wsdynamicresbasic_isotropic_scaling.script	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-//
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description: 
-//
-
-LOAD_SUITE wsdynamicrestestserver 
-
-RUN_PROGRAM tclosepanicwindow.exe
-
-RUN_TEST_STEP 100 wsdynamicrestestserver TEFUnit.CGlobalSettings.SetScreenNoL.0
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0001L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0002L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0003L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0004L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0005L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0006L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0007L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0008L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0009L
-//0010 skipped
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0011L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0012L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0013L
-//0014 0015 0016 0017 skipped
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0018L
-
-//0021 skipped
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0031L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0032L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0033L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0034L
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0041L.0
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0042L.0
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0041L.1
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0042L.1
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0051L
-//0052 skipped
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0053L
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0101L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0102L
-
-RUN_TEST_STEP 100 wsdynamicrestestserver TEFUnit.CGlobalSettings.SetScreenNoL.1
-RUN_TEST_STEP 100 wsdynamicrestestserver TEFUnit.CGlobalSettings.ExpectDisconnectedScreenL.on
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0001L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0002L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0003L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0004L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0005L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0006L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0007L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0008L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0009L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0010L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0011L
-//0012 skipped
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0013L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0014L
-//0015 0016 0017 skipped
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0018L
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0021L.1
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0031L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0032L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0033L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0034L
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0041L.0
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0042L.0
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0041L.1
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0042L.1
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0051L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0052L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0053L
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0101L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0102L
-
-//Tidy up
-RUN_PROGRAM tclosepanicwindow.exe
--- a/windowing/windowserver/tdynamicres/scripts/wsdynamicresbasic_no_scaling.script	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-//
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description: 
-//
-
-LOAD_SUITE wsdynamicrestestserver 
-
-RUN_PROGRAM tclosepanicwindow.exe
-
-RUN_TEST_STEP 100 wsdynamicrestestserver TEFUnit.CGlobalSettings.SetScreenNoL.0
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0001L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0002L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0003L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0004L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0005L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0006L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0007L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0008L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0009L
-//0010 skipped
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0011L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0012L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0013L
-//0014 skipped
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0015L
-//0016 0017 skipped
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0018L
-
-//0021 skipped
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0031L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0032L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0033L
-//0034 skipped
-
-//RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0041L.0
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0042L.0
-//RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0041L.1
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0042L.1
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0051L
-//0052 0053 skipped
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0101L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0102L
-
-RUN_TEST_STEP 100 wsdynamicrestestserver TEFUnit.CGlobalSettings.SetScreenNoL.1
-RUN_TEST_STEP 100 wsdynamicrestestserver TEFUnit.CGlobalSettings.ExpectDisconnectedScreenL.on
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0001L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0002L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0003L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0004L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0005L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0006L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0007L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0008L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0009L
-//0010 skipped
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0011L
-//0012 skipped
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0013L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0014L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0015L
-//0016 0017 skipped
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0018L
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0021L.0
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0031L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0032L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0033L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0034L
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0041L.0
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0042L.0
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0041L.1
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0042L.1
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0051L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0052L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0053L
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0101L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0102L
-
-//Tidy up
-RUN_PROGRAM tclosepanicwindow.exe
--- a/windowing/windowserver/tdynamicres/scripts/wsdynamicresbasic_openvg_isotropic.script	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-//
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description: 
-//
-
-LOAD_SUITE wsdynamicrestestserver 
-
-RUN_PROGRAM tclosepanicwindow.exe
-
-RUN_TEST_STEP 100 wsdynamicrestestserver TEFUnit.CGlobalSettings.SetScreenNoL.0
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0001L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0002L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0003L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0004L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0005L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0006L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0007L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0008L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0009L
-//0010 skipped
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0011L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0012L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0013L
-//0014 0015 0016 0017 skipped
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0018L
-
-//0021 skipped
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0031L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0032L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0033L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0034L
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0041L.0
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0042L.0
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0041L.1
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0042L.1
-
-//0051 0052 skipped
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0101L
-
-RUN_TEST_STEP 100 wsdynamicrestestserver TEFUnit.CGlobalSettings.SetScreenNoL.1
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0001L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0002L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0003L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0004L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0005L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0006L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0007L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0008L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0009L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0010L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0011L
-//0012 skipped
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0013L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0014L
-//0015 0016 0017 skipped
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0018L
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0021L.1
-
-RUN_TEST_STEP 400 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0031L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0032L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0033L
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0034L
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0041L.0
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0042L.0
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0041L.1
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0042L.1
-
-//0051 0052 skipped
-
-RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0101L
-
-//Tidy up
-RUN_PROGRAM tclosepanicwindow.exe
--- a/windowing/windowserver/tdynamicres/scripts/wsdynamicresclassic.script	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-//////////////////////////////////////////////////////////////////
-LOAD_SUITE wsdynamicresclassictestserver
-
-RUN_PROGRAM tclosepanicwindow.exe
-RUN_TEST_STEP 100 wsdynamicresclassictestserver TEFUnit.CWsDynamicResClassic.GRAPHICS_WSERV_DYNAMICRES_0100L
-RUN_PROGRAM tclosepanicwindow.exe
--- a/windowing/windowserver/tdynamicres/src/globalsettings.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test class that allows a scriopt to set global values 
-// 
-//
-
-#include "globalsettings.h"
-#include <test/extendtef.h>
-
-TGlobalSettings	settings_instance={0,0};
-const TGlobalSettings& TGlobalSettings::Instance()
-	{
-	return settings_instance;
-	}
-
-// Create a suite of all the tests
-CTestSuite* CGlobalSettings::CreateSuiteL(const TDesC& aName)
-	{
-	SUB_SUITE_OPT(CGlobalSettings,NULL);
-
-		ADD_TEST_STEP_PARAM_RANGE(SetScreenNoL,0,9);
-		ADD_TEST_STEP_PARAM_BOOL(ExpectDisconnectedScreenL);
-
-	END_SUITE;	
-	}
-
-void CGlobalSettings::SetScreenNoL(TInt aScreenNo)
-	{
-	RWsSession session;
-	ASSERT_EQUALS(session.Connect(), KErrNone);
-	TInt maxScreens=session.NumberOfScreens();
-	
-	if (maxScreens>aScreenNo)
-		{
-		INFO_PRINTF2(_L("New screen number for all output selected: %i"),aScreenNo);
-			{
-			CWsScreenDevice screen(session);
-			screen.Construct(aScreenNo);
-			screen.SetCurrentRotations(0,CFbsBitGc::TGraphicsOrientation(0));
-			screen.SetScreenMode(0);
-			screen.SetAppScreenMode(0);
-			}
-		settings_instance.iScreen=aScreenNo;
-		session.Flush();
-		session.Close();
-		}
-	else
-		{
-		INFO_PRINTF1(_L("**************************"));
-		INFO_PRINTF1(_L(""));
-		INFO_PRINTF3(_L("Can't set screen output to %i. Only got %i screens"),aScreenNo,maxScreens);
-		INFO_PRINTF2(_L("Screen number for all output remains at: %i"),settings_instance.iScreen);
-
-		INFO_PRINTF1(_L(""));
-		INFO_PRINTF1(_L("**************************"));
-		session.Flush();
-		session.Close();
-		User::Leave(KErrTEFUnitFail);
-		}
-	}
-
-void CGlobalSettings::ExpectDisconnectedScreenL(TBool aValue)
-	{
-	settings_instance.iDisconnected=aValue;
-	}
--- a/windowing/windowserver/tdynamicres/src/screenselect.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
-*/
-
-#include <e32std.h>
-#include <w32std.h>
-#include "teflogextensions.h"
-#include "screenselect.h"
-#include "globalsettings.h"
-
-//Note that this class now just acts as a stub to the CGlobalSettings::SetScreenNoL() method and data, so both are equivalent.
-
-CScreenSelect::CScreenSelect(TInt aScreenNumber, const TDesC& aStepName)
-	{
-	SetTestStepName(aStepName);
-	iScreenNumber = aScreenNumber;
-	}
-
-CScreenSelect::~CScreenSelect()
-	{
-	}
-
-
-TInt CScreenSelect::Number()
-	{
-	return	TGlobalSettings::Instance().iScreen;
-	}
-
-
-TVerdict CScreenSelect::doTestStepL()
-	{
-	SetTestStepError(EFail);
-
-	CGlobalSettings* globalSettings=new (ELeave) CGlobalSettings;
-	
-	globalSettings->SetLoggerL(Logger());
-	TRAPD(err,globalSettings->SetScreenNoL( iScreenNumber));
-	
-	if (err==KErrNone)
-		{
-		SetTestStepError(EPass);
-		return EPass;
-		}
-	else
-		{
-		return EFail;
-		}
-	}
-
--- a/windowing/windowserver/tdynamicres/src/surfaceutility.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1544 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
-*/
-
-#include <e32std.h>
-#include <imageconversion.h>
-#include "surfaceutility.h"
-
-CSurfaceUtility::CSurfaceUtility(CSurfaceUtility* aClone/*=NULL*/)
-	:	iSurfaces(aClone?&(aClone->iSurfaces):NULL)
-	{
-	}
-	
-CSurfaceUtility* CSurfaceUtility::NewL(CSurfaceUtility* aClone/*=NULL*/)
-	{
-	CSurfaceUtility* utility = new (ELeave)CSurfaceUtility(aClone);
-	CleanupStack::PushL(utility);
-	utility->ConstructL();
-	CleanupStack::Pop(utility);
-	return utility;
-	}
-	
-void CSurfaceUtility::ConstructL()
-	{
-	TInt r = iManager.Open();
-	if (r != KErrNone)
-		{
-		LOG(("Surface manager failed to open: %d", r));
-		User::Leave(r);
-		}
-	
-	r = iSurfaceUpdateSession.Connect();
-	if (r != KErrNone)
-		{
-		LOG(("Failed to connect to update server: %d", r));
-		User::Leave(r);
-		}
-	}
-	
-CSurfaceUtility::~CSurfaceUtility()
-	{
-	DestroyAll();
-
-	iSurfaces.Close();
-
-	iManager.Close();
-
-	iSurfaceUpdateSession.Close();
-	}
-
-TBool CSurfaceUtility::DestroyAll()
-	{
-	TInt err = 	KErrNone;
-	TInt jj = iSurfaces.Count() - 1;
-	if (jj<0)
-		return EFalse;
-	for (; jj >= 0; jj--)
-		{
-		err = iManager.CloseSurface(iSurfaces[jj]);
-		if (err!=KErrNone)
-			{
-			LOG(("Error closing surface: 0x%X\n", err));
-			}
-		}
-	iSurfaces.Reset();
-	return ETrue;
-	}
-
-/***************************************
- * The aim of the THeapSurfaceArray is to locally switch in the specified heap for any array operation
- ***************************************/
-
-CSurfaceUtility::RHeapSurfaceArray::RHeapSurfaceArray(RHeapSurfaceArray* aUseExternalArray)
-	:	iUseArray(aUseExternalArray?aUseExternalArray->iUseArray:&this->iLocalArray),
-	iExternalHeapRef(aUseExternalArray?aUseExternalArray->iExternalHeapRef:User::Heap())
-	{
-	
-	}
-/************************************
- * The following methods have been used by the surfaceutility... some require the heap wrapping, and some don't
- * I actually need three different startegies (count em) for 7 methods...
- * Some methods only read the existing objects, so don't need a heap swap at all
- * Leaving methods have to use PopAndDestroy strategy to restore the heap on leaving or success
- * Non-leaving methods must not call PushL, so directly make SwitchHeap calls!
- ************************************/
-
-// PopAndDestroy method to restore the heap
-/*static*/ void	CSurfaceUtility::RHeapSurfaceArray::PopHeap(void* aHeapPtr)
-	{
-	RHeap* heapPtr=(RHeap*)aHeapPtr;
-	User::SwitchHeap(heapPtr);
-	}
-
-// Switches and pushes the previous heap so it can be restored with PopAndDestroy
-/*static*/ void CSurfaceUtility::RHeapSurfaceArray::SwitchHeapLC(RHeap* aNewHeap)
-	{
-	CleanupStack::PushL(TCleanupItem(PopHeap,NULL));
-	CleanupStack::PushL(TCleanupItem(PopHeap,NULL));
-	CleanupStack::PushL(TCleanupItem(PopHeap,NULL));
-	CleanupStack::Pop(3);
-	RHeap* oldHeap=User::SwitchHeap(aNewHeap);
-	delete new char;
-	CleanupStack::PushL(TCleanupItem(PopHeap,oldHeap));
-	}
-
-
-TSurfaceId& CSurfaceUtility::RHeapSurfaceArray::operator[](TUint aIndex)
-	{
-	return iUseArray->operator[](aIndex);
-	}
-// Close only closes the local array, while Reset resets the active array (may be external)
-void CSurfaceUtility::RHeapSurfaceArray::Close()
-	{
-	RHeap* oldHeap=User::SwitchHeap(&iExternalHeapRef);
-	iLocalArray.Close();
-	User::SwitchHeap(oldHeap);
-	}
-TInt CSurfaceUtility::RHeapSurfaceArray::Count() const
-	{
-	return iUseArray->Count();
-	}
-// Close only closes the local array, while Reset resets the active array (may be external)
-inline void CSurfaceUtility::RHeapSurfaceArray::Reset()
-	{
-	RHeap* oldHeap=User::SwitchHeap(&iExternalHeapRef);
-	iUseArray->Reset();
-	User::SwitchHeap(oldHeap);
-	}
-void CSurfaceUtility::RHeapSurfaceArray::AppendL(const TSurfaceId &anEntry)
-	{
-	SwitchHeapLC(&iExternalHeapRef);
-	iUseArray->AppendL(anEntry);
-	CleanupStack::PopAndDestroy();
-	}
-TInt CSurfaceUtility::RHeapSurfaceArray::Find(const TSurfaceId &anEntry) const
-	{
-	return iUseArray->Find(anEntry);
-	}
-void CSurfaceUtility::RHeapSurfaceArray::Remove(TInt anIndex)
-	{
-	RHeap* oldHeap=User::SwitchHeap(&iExternalHeapRef);
-	iUseArray->Remove(anIndex);
-	User::SwitchHeap(oldHeap);
-	}
-
-
-
-
-/**
-Cleanup stack helper object, holding references to both utility and surface, so
-that the standard Close() semantics can be used.
-*/
-class TSurfaceCleanup
-	{
-public:
-	TSurfaceCleanup(CSurfaceUtility& aUtility, TSurfaceId& aSurface)
-		: iUtility(aUtility), iSurface(aSurface)
-		{}
-	void Close()
-		{
-		// Removes the surface from the list of surfaces to clean up, and closes
-		// the surface reference.
-		iUtility.DestroySurface(iSurface);
-		}
-private:
-	CSurfaceUtility& iUtility;
-	TSurfaceId& iSurface;
-	};
-
-/**
-Read the given image file into a new surface.
-
-@param aFileName The name of the image file.
-@param aSurface Filled with the surface ID for the surface containing the pixels.
-*/
-void CSurfaceUtility::CreateSurfaceFromFileL(const TDesC& aFileName, TSurfaceId& aSurface)
-	{
-	RFs fs;
-	
-	User::LeaveIfError(fs.Connect());
-	CleanupClosePushL(fs);
-	CImageDecoder* decoder = CImageDecoder::FileNewL(fs, aFileName, CImageDecoder::EOptionAlwaysThread);
-	CleanupStack::PushL(decoder);
-
-	const TFrameInfo& info = decoder->FrameInfo();
-
-	TSize size = info.iOverallSizeInPixels;
-	TInt stride = size.iWidth << 2;		// Default to four bytes per pixel
-	TDisplayMode bmpFormat = info.iFrameDisplayMode;
-	TUidPixelFormat pixelFormat = EUidPixelFormatUnknown;
-
-	switch (bmpFormat)
-		{
-		case EGray2:
-		case EGray4:
-		case EGray16:
-		case EGray256:
-		case EColor16:
-		case EColor256:
-		case EColor16M:
-		case EColor16MU:
-			{
-			bmpFormat = EColor16MU;
-			pixelFormat = EUidPixelFormatXRGB_8888;
-			break;
-			}
-		case EColor4K:
-			{
-			stride = size.iWidth << 1;
-			pixelFormat = EUidPixelFormatXRGB_4444;
-			break;
-			}
-		case EColor64K:
-			{
-			stride = size.iWidth << 1;
-			pixelFormat = EUidPixelFormatRGB_565;
-			break;
-			}
-		case EColor16MA:
-			{
-			pixelFormat = EUidPixelFormatARGB_8888;
-			break;
-			}
-		case EColor16MAP:
-			{
-			pixelFormat = EUidPixelFormatARGB_8888_PRE;
-			break;
-			}
-		default:
-			{
-			LOG(("Unsupported display mode: %d", bmpFormat));
-			User::Leave(KErrNotSupported);
-			break;
-			}
-		}
-
-	// Create an intermediary bitmap for decoding into
-	CFbsBitmap* bitmap = new (ELeave) CFbsBitmap();
-	CleanupStack::PushL(bitmap);
-	User::LeaveIfError(bitmap->Create(size, info.iFrameDisplayMode));
-
-	// Create the final surface.
-	aSurface = CreateSurfaceL(size, pixelFormat, stride);
-	TSurfaceCleanup surfaceCleanup(*this, aSurface);
-	CleanupClosePushL(surfaceCleanup);
-
-	RChunk chunk;
-	User::LeaveIfError(iManager.MapSurface(aSurface, chunk));
-	CleanupClosePushL(chunk);
-
-	// Convert the image file into a Symbian bitmap
-	TRequestStatus status;
-	decoder->Convert(&status, *bitmap);
-	User::WaitForRequest(status);
-	User::LeaveIfError(status.Int());
-
-	TInt offsetToFirstBuffer;
-	User::LeaveIfError(iManager.GetBufferOffset(aSurface, 0, offsetToFirstBuffer));
-	
-	// Copy the data from the bitmap into the surface.
-	TPoint start;
-	TUint8 *pSurfStart = chunk.Base() + offsetToFirstBuffer; 
-	for (start.iY = 0; start.iY < size.iHeight; start.iY++)
-		{
-		// Set up a descriptor for the current line in the surface and get pixels.
-		TPtr8 ptr(pSurfStart + start.iY * stride, stride);
-		bitmap->GetScanLine(ptr, start, size.iWidth, bmpFormat);
-		}
-
-	CleanupStack::PopAndDestroy(/* chunk */);
-	CleanupStack::Pop(/* surfaceCleanup */);
-	CleanupStack::PopAndDestroy(bitmap);
-	CleanupStack::PopAndDestroy(decoder);
-	CleanupStack::PopAndDestroy(/* fs */);
-	}
-
-void CSurfaceUtility::CopyBitmapSurfaceL(const CFbsBitmap* aBitmap, TSurfaceId& aSurface)
-	{
-	RChunk chunk;
-	User::LeaveIfError(iManager.MapSurface(aSurface, chunk));
-	CleanupClosePushL(chunk);
-	TSize bitmapSize = aBitmap->SizeInPixels();
-	TSize size = SurfaceSize(aSurface);
-	TInt stride = size.iWidth*4;		// Default to four bytes per pixel
-
-	TInt offsetToFirstBuffer;
-	User::LeaveIfError(iManager.GetBufferOffset(aSurface, 0, offsetToFirstBuffer));
-	
-	// Copy the data from the bitmap into the surface.
-	TPoint start;
-	TUint8 *pSurfStart = chunk.Base() + offsetToFirstBuffer; 
-	for (start.iY = 0; start.iY < bitmapSize.iHeight; start.iY++)
-		{
-		// Set up a descriptor for the current line in the surface and get pixels.
-		TPtr8 ptr(pSurfStart + start.iY * stride, stride);
-		aBitmap->GetScanLine(ptr, start, bitmapSize.iWidth, EColor16MU);
-		}
-	CleanupStack::PopAndDestroy(/* chunk */);
-
-	}
-/**
-Copy the bitmap from a file to a surface.
-
-@param aFileName The name of the image file.
-@param aSurface Filled with the surface ID for the surface containing the pixels.
-*/
-void CSurfaceUtility::CopyBitmapFromFileToSurfaceL(const TDesC& aFileName, TSurfaceId& aSurface)
-	{
-	RFs fs;
-	
-	User::LeaveIfError(fs.Connect());
-	CleanupClosePushL(fs);
-	CImageDecoder* decoder = CImageDecoder::FileNewL(fs, aFileName, CImageDecoder::EOptionAlwaysThread);
-	CleanupStack::PushL(decoder);
-
-	const TFrameInfo& info = decoder->FrameInfo();
-
-	RSurfaceManager::TInfoBuf infoBuf;
-	RSurfaceManager::TSurfaceInfoV01& infoSurf = infoBuf();
-	User::LeaveIfError(iManager.SurfaceInfo(aSurface, infoBuf));
-	
-	TSize size = infoSurf.iSize;
-	TDisplayMode bmpFormat = info.iFrameDisplayMode;
-	TInt stride = size.iWidth << 2;		// Default to four bytes per pixel
-
-	// Create an intermediary bitmap for decoding into
-	CFbsBitmap* bitmap = new (ELeave) CFbsBitmap();
-	CleanupStack::PushL(bitmap);
-	User::LeaveIfError(bitmap->Create(size, info.iFrameDisplayMode));
-
-	RChunk chunk;
-	User::LeaveIfError(iManager.MapSurface(aSurface, chunk));
-	CleanupClosePushL(chunk);
-
-	// Convert the image file into a Symbian bitmap
-	TRequestStatus status;
-	decoder->Convert(&status, *bitmap);
-	User::WaitForRequest(status);
-	User::LeaveIfError(status.Int());
-
-	TInt offsetToFirstBuffer;
-	User::LeaveIfError(iManager.GetBufferOffset(aSurface, 0, offsetToFirstBuffer));
-
-	// Copy the data from the bitmap into the surface.
-	TPoint start;
-	TUint8 *pSurfStart = chunk.Base() + offsetToFirstBuffer;
-	for (start.iY = 0; start.iY < size.iHeight; start.iY++)
-		{
-		// Set up a descriptor for the current line in the surface and get pixels.
-		TPtr8 ptr(pSurfStart + start.iY * stride, stride);
-		bitmap->GetScanLine(ptr, start, size.iWidth, bmpFormat);
-		}
-
-	CleanupStack::PopAndDestroy(/* chunk */);
-	CleanupStack::PopAndDestroy(bitmap);
-	CleanupStack::PopAndDestroy(decoder);
-	CleanupStack::PopAndDestroy(/* fs */);
-	}
-/**
-Get the size of a surface.
-
-@param aSurface The surface to get the size for.
-@return The size in pixels, or empty on failure.
-*/
-TSize CSurfaceUtility::SurfaceSize(const TSurfaceId& aSurface)
-	{
-	RSurfaceManager::TInfoBuf infoBuf;
-	RSurfaceManager::TSurfaceInfoV01& info = infoBuf();
-
-	if (iManager.SurfaceInfo(aSurface, infoBuf) == KErrNone)
-		{
-		return info.iSize;
-		}
-
-	return TSize();
-	}
-
-
-/**
-Create a surface using the surface manager.
-
-Stores the ID for tear down, as well as returning it.
-
-@param aSize Dimensions of the surface.
-@param aPixelFormat	UID of the pixel format.
-@param aStride	Stride value for the surface (usually bytes per pixel * width)
-@leave May leave due to lack of memory.
-@return New surface's ID.
-*/
-TSurfaceId CSurfaceUtility::CreateSurfaceL(const TSize& aSize, TUidPixelFormat aPixelFormat, TInt aStride, TInt aBuffers)
-	{
-	RSurfaceManager::TSurfaceCreationAttributesBuf bf;
-	RSurfaceManager::TSurfaceCreationAttributes& b = bf();
-	
-	b.iSize.iWidth = aSize.iWidth;
-	b.iSize.iHeight = aSize.iHeight;
-	b.iBuffers = aBuffers;				// number of buffers in the surface
-	b.iPixelFormat = aPixelFormat;
-	b.iStride = aStride;		// Number of bytes between start of one line and start of next
-	b.iOffsetToFirstBuffer = 0;	// way of reserving space before the surface pixel data
-	b.iAlignment = 4;			// alignment, 1,2,4,8 byte aligned
-	b.iContiguous = EFalse;
-	b.iMappable = ETrue;
-
-	TSurfaceId surface = TSurfaceId::CreateNullId();
-
-	User::LeaveIfError(iManager.CreateSurface(bf, surface));
-	iSurfaces.AppendL(surface);
-	return surface;
-	}
-
-/**
-A helper function that returns the bytes per pixel for a given pixel format uid
-
-@param aPixelFormat Pixel format UID to convert
-@return The bytes per pixel
-*/
-TInt CSurfaceUtility::BytesPerPixelL(TUidPixelFormat aPixelFormat)
-	{
-	TInt bytesPerPixel = 0;
-	switch (aPixelFormat)
-		{
-		case EUidPixelFormatXRGB_8888:
-		case EUidPixelFormatARGB_8888:
-		case EUidPixelFormatARGB_8888_PRE:
-			{
-			bytesPerPixel = 4;
-			break;
-			}
-		case EUidPixelFormatXRGB_4444:
-		case EUidPixelFormatARGB_4444:
-		case EUidPixelFormatRGB_565:
-			{
-			bytesPerPixel = 2;
-			break;
-			}
-		default:
-			{
-			User::Leave(KErrNotSupported);
-			break;
-			}
-		}
-	return bytesPerPixel;
-	}
-
-/**
-Fill the given surface with a color.
-
-@param aSurface	The surface to be filled.
-@param aColor	The color to fill it with.
-*/
-void CSurfaceUtility::FillSurfaceL(TSurfaceId& aSurface, const TRgb& aColor)
-	{
-	RSurfaceManager::TInfoBuf infoBuf;
-	RSurfaceManager::TSurfaceInfoV01& info = infoBuf();
-
-	User::LeaveIfError(iManager.SurfaceInfo(aSurface, infoBuf));
-	TUint32 color = 0;
-	TBool use16 = EFalse;
-
-	if (info.iSize.iHeight<0 || info.iSize.iWidth<0 || info.iStride<0)
-		{
-		User::Leave(KErrCorrupt);
-		}
-	if (info.iSize.iHeight==0 || info.iSize.iWidth==0 || info.iStride==0)
-		{
-		User::Leave(KErrNotReady);
-		}
-
-	switch (info.iPixelFormat)
-		{
-		case EUidPixelFormatXRGB_8888:
-			{
-			color = aColor.Color16MU();
-#ifdef ALPHA_FIX_24BIT
-			color |= ((ALPHA_FIX_24BIT)&0xff)<<24;
-#endif
-			break;
-			}
-		case EUidPixelFormatARGB_8888:
-			{
-			color = aColor.Color16MA();
-			break;
-			}
-		case EUidPixelFormatARGB_8888_PRE:
-			{
-			color = aColor.Color16MAP();
-			break;
-			}
-		case EUidPixelFormatXRGB_4444:
-		case EUidPixelFormatARGB_4444:
-			{
-			color = aColor.Color4K();
-			use16 = ETrue;
-			break;
-			}
-		case EUidPixelFormatRGB_565:
-			{
-			color = aColor.Color64K();
-			use16 = ETrue;
-			break;
-			}
-		default:
-			{
-			User::Leave(KErrNotSupported);
-			break;
-			}
-		}
-
-	RChunk chunk;
-	User::LeaveIfError(iManager.MapSurface(aSurface, chunk));
-	CleanupClosePushL(chunk);
-
-	TInt offsetToFirstBuffer;
-	User::LeaveIfError(iManager.GetBufferOffset(aSurface, 0, offsetToFirstBuffer));
-	TUint8* surfacePtr = chunk.Base() + offsetToFirstBuffer;
-	TUint8* linePtr = surfacePtr;
-
-	if (use16)
-		{
-		if ( info.iSize.iWidth*2>info.iStride)
-			{
-			User::Leave(KErrOverflow);
-			}
-		TUint16* ptr = reinterpret_cast<TUint16*>(surfacePtr);
-
-		// Fill first line
-		for (TInt xx = 0; xx < info.iSize.iWidth; xx++)
-			{
-			ptr[xx] = (TUint16)color;
-			}
-		}
-	else
-		{
-		if ( info.iSize.iWidth*4>info.iStride)
-			{
-			User::Leave(KErrOverflow);
-			}
-		TUint32* ptr = reinterpret_cast<TUint32*>(surfacePtr);
-
-		// Fill first line
-		for (TInt xx = 0; xx < info.iSize.iWidth; xx++)
-			{
-			ptr[xx] = color;
-			}
-		}
-
-	// Now copy that to the other lines
-	for (TInt yy = 1; yy < info.iSize.iHeight; yy++)
-		{
-		linePtr += info.iStride;
-		Mem::Copy(linePtr, surfacePtr, info.iSize.iWidth * BytesPerPixelL(info.iPixelFormat));
-		}
-	
-	TInt err = iSurfaceUpdateSession.SubmitUpdate(KAllScreens, aSurface, 0, NULL);
-	if (err!=KErrNone)
-		LOG(("Error submitting update: 0x%X\n", err));
-
-	CleanupStack::PopAndDestroy(/* chunk */);
-	}
-
-/**
-Fill the given memory chunk with a color.
-
-@param aSurface	The surface to be filled.
-@param aChunk	The surface to be filled.
-@param aColor	The color to fill it with.
-*/
-void CSurfaceUtility::FillChunkL(TSurfaceId& aSurface, RChunk& aChunk, const TRgb& aColor, TInt aBufferNumber)
-	{
-	RSurfaceManager::TInfoBuf infoBuf;
-	RSurfaceManager::TSurfaceInfoV01& info = infoBuf();
-
-	User::LeaveIfError(iManager.SurfaceInfo(aSurface, infoBuf));
-	TUint32 color = 0;
-	TBool use16 = EFalse;
-
-	if (info.iSize.iHeight<0 || info.iSize.iWidth<0 || info.iStride<0)
-		{
-		User::Leave(KErrCorrupt);
-		}
-	if (info.iSize.iHeight==0 || info.iSize.iWidth==0 || info.iStride==0)
-		{
-		User::Leave(KErrNotReady);
-		}
-
-	switch (info.iPixelFormat)
-		{
-		case EUidPixelFormatXRGB_8888:
-			{
-			color = aColor.Color16MU();
-#ifdef ALPHA_FIX_24BIT
-			color |= ((ALPHA_FIX_24BIT)&0xff)<<24;
-#endif
-			break;
-			}
-		case EUidPixelFormatARGB_8888:
-			{
-			color = aColor.Color16MA();
-			break;
-			}
-		case EUidPixelFormatARGB_8888_PRE:
-			{
-			color = aColor.Color16MAP();
-			break;
-			}
-		case EUidPixelFormatXRGB_4444:
-		case EUidPixelFormatARGB_4444:
-			{
-			color = aColor.Color4K();
-			use16 = ETrue;
-			break;
-			}
-		case EUidPixelFormatRGB_565:
-			{
-			color = aColor.Color64K();
-			use16 = ETrue;
-			break;
-			}
-		default:
-			{
-			User::Leave(KErrNotSupported);
-			break;
-			}
-		}
-
-	User::LeaveIfError(iManager.MapSurface(aSurface, aChunk));
-	
-	TInt offsetToFirstBuffer;
-	User::LeaveIfError(iManager.GetBufferOffset(aSurface, 0, offsetToFirstBuffer));
-	TInt offsetToBufferNumber;
-	User::LeaveIfError(iManager.GetBufferOffset(aSurface, aBufferNumber, offsetToBufferNumber));
-	
-	TUint8* chunkPtr = aChunk.Base() + offsetToFirstBuffer;
-	TUint8* linePtr = aChunk.Base() + offsetToBufferNumber;
-	TUint8* surfPlanePtr = linePtr;
-
-	if (use16)
-		{
-		if ( info.iSize.iWidth*2>info.iStride)
-			{
-			aChunk.Close();
-			User::Leave(KErrOverflow);
-			}
-		TUint16* ptr = reinterpret_cast<TUint16*>(surfPlanePtr);
-
-		// Fill first line
-		for (TInt xx = 0; xx < info.iSize.iWidth; xx++)
-			{
-			ptr[xx] = (TUint16)color;
-			}
-		}
-	else
-		{
-		if ( info.iSize.iWidth*4>info.iStride)
-			{
-			aChunk.Close();
-			User::Leave(KErrOverflow);
-			}
-		TUint32* ptr = reinterpret_cast<TUint32*>(surfPlanePtr);
-
-		// Fill first line
-		for (TInt xx = 0; xx < info.iSize.iWidth; xx++)
-			{
-			ptr[xx] = color;
-			}
-		}
-
-	// Now copy that to the other lines
-	for (TInt yy = 1; yy < info.iSize.iHeight; yy++)
-		{
-		linePtr += info.iStride;
-		Mem::Copy(linePtr, surfPlanePtr, info.iSize.iWidth * BytesPerPixelL(info.iPixelFormat));
-		}
-
-	aChunk.Close();
-	}
-
-/**
-Fill a rectangle on the given surface.
-
-@param aSurface		The surface to be filled.
-@param aStartPos	Where to place the rectangle.
-@param aSize		Size of the rectangle.
-@param aColor		The colour to fill it with.
-*/
-void CSurfaceUtility::FillRectangleL(TSurfaceId& aSurface, const TPoint& aStartPos, const TSize& aSize, const TRgb& aColor)
-	{
-	FillRectangleNoUpdateL(aSurface, aStartPos, aSize, aColor);
-	
-	TInt err = iSurfaceUpdateSession.SubmitUpdate(KAllScreens, aSurface, 0, NULL);
-	if (err!=KErrNone)
-		LOG(("Error submitting update: 0x%X\n", err));
-	}
-
-/**
-Fill a rectangle on the given surface - does not submit update.
-
-@param aSurface		The surface to be filled.
-@param aStartPos	Where to place the rectangle.
-@param aSize		Size of the rectangle.
-@param aColor		The colour to fill it with.
-*/
-void CSurfaceUtility::FillRectangleNoUpdateL(TSurfaceId& aSurface, const TPoint& aStartPos, const TSize& aSize, const TRgb& aColor)
-	{
-	RSurfaceManager::TInfoBuf infoBuf;
-	RSurfaceManager::TSurfaceInfoV01& info = infoBuf();
-
-	User::LeaveIfError(iManager.SurfaceInfo(aSurface, infoBuf));
-	TUint32 color = 0;
-	TBool use16 = EFalse;
-
-	if (info.iSize.iHeight<0 || info.iSize.iWidth<0 || info.iStride<0)
-		{
-		User::Leave(KErrCorrupt);
-		}
-	if (info.iSize.iHeight==0 || info.iSize.iWidth==0 || info.iStride==0)
-		{
-		User::Leave(KErrNotReady);
-		}
-
-	switch (info.iPixelFormat)
-		{
-		case EUidPixelFormatXRGB_8888:
-			{
-			color = aColor.Color16MU();
-#ifdef ALPHA_FIX_24BIT
-			color |= ((ALPHA_FIX_24BIT)&0xff)<<24;
-#endif
-			break;
-			}
-		case EUidPixelFormatARGB_8888:
-			{
-			color = aColor.Color16MA();
-			break;
-			}
-		case EUidPixelFormatARGB_8888_PRE:
-			{
-			color = aColor.Color16MAP();
-			break;
-			}
-		case EUidPixelFormatXRGB_4444:
-		case EUidPixelFormatARGB_4444:
-			{
-			color = aColor.Color4K();
-			use16 = ETrue;
-			break;
-			}
-		case EUidPixelFormatRGB_565:
-			{
-			color = aColor.Color64K();
-			use16 = ETrue;
-			break;
-			}
-		default:
-			{
-			User::Leave(KErrNotSupported);
-			break;
-			}
-		}
-
-	RChunk chunk;
-	User::LeaveIfError(iManager.MapSurface(aSurface, chunk));
-	CleanupClosePushL(chunk);
-
-	TInt offsetToFirstBuffer;
-	User::LeaveIfError(iManager.GetBufferOffset(aSurface, 0, offsetToFirstBuffer));
-	TUint8* surfacePtr = chunk.Base() + offsetToFirstBuffer;
-	
-	// Check for out of bounds
-	TBool validRect = ETrue;
-	TInt surfaceWidth = info.iSize.iWidth;
-	TInt surfaceHeight = info.iSize.iHeight;
-	
-	// Width and Height
-	if ((aStartPos.iX + aSize.iWidth) > surfaceWidth)
-		validRect = EFalse;
-	
-	if ((aStartPos.iY + aSize.iHeight) > surfaceHeight)
-		validRect = EFalse;
-	
-	// Starting position
-	if ((aStartPos.iX < 0) || (aStartPos.iY < 0))
-		validRect = EFalse;
-	
-	if (!validRect)
-		User::Leave(KErrOverflow);
-		
-	if (use16)
-		{
-		if ( info.iSize.iWidth*2>info.iStride)
-			{
-			User::Leave(KErrOverflow);
-			}
-		
-		TUint16* ptr = reinterpret_cast<TUint16*>(surfacePtr);
-		
-		// Fill the rectangle
-		TInt yPos = aStartPos.iY;
-		TInt xPos = aStartPos.iX;
-		for (TInt yy = 0; yy < aSize.iHeight; ++yy)
-			{
-			ptr = reinterpret_cast<TUint16*>(surfacePtr+(yPos*info.iStride));
-			for (TInt xx = 0; xx < aSize.iWidth; ++xx)
-				{
-				ptr[xPos] = color;
-				xPos++;
-				}
-			xPos = aStartPos.iX;
-			yPos++;
-			}
-		}
-	else
-		{
-		if ( info.iSize.iWidth*4>info.iStride)
-			{
-			User::Leave(KErrOverflow);
-			}
-
-		TUint32* ptr = reinterpret_cast<TUint32*>(surfacePtr);		
-		
-		// Fill the rectangle
-		TInt yPos = aStartPos.iY;
-		TInt xPos = aStartPos.iX;
-		for (TInt yy = 0; yy < aSize.iHeight; ++yy)
-			{
-			ptr = reinterpret_cast<TUint32*>(surfacePtr+(yPos*info.iStride));
-			for (TInt xx = 0; xx < aSize.iWidth; ++xx)
-				{
-				ptr[xPos] = color;
-				xPos++;
-				}
-			xPos = aStartPos.iX;
-			yPos++;
-			}
-		}
-	
-	CleanupStack::PopAndDestroy(/* chunk */);
-	}
-
-/**
-Fill the given surface with a grid over a solid color.
-
-Similar to FillSurfaceL(), but with a grid overlayed. The pitch of the grid is
-eight pixels.
-
-@param aSurface	The surface to be filled.
-@param aColor	The color to fill it with.
-@param aLines	The color of the grid lines.
-*/
-void CSurfaceUtility::GridFillSurfaceL(TSurfaceId& aSurface, const TRgb& aColor, const TRgb& aLines)
-	{
-	RSurfaceManager::TInfoBuf infoBuf;
-	RSurfaceManager::TSurfaceInfoV01& info = infoBuf();
-
-	User::LeaveIfError(iManager.SurfaceInfo(aSurface, infoBuf));
-	TUint32 color = 0;
-	TUint32 lines = 0;
-	TBool use16 = EFalse;
-
-	if (info.iSize.iHeight<0 || info.iSize.iWidth<0 || info.iStride<0)
-		{
-		User::Leave(KErrCorrupt);
-		}
-	if (info.iSize.iHeight==0 || info.iSize.iWidth==0 || info.iStride==0)
-		{
-		User::Leave(KErrNotReady);
-		}
-
-	switch (info.iPixelFormat)
-		{
-		case EUidPixelFormatXRGB_8888:
-			{
-			color = aColor.Color16MU();
-			lines = aLines.Color16MU();
-#ifdef ALPHA_FIX_24BIT
-			color |= ((ALPHA_FIX_24BIT)&0xff)<<24;
-			lines |= ((ALPHA_FIX_24BIT)&0xff)<<24;
-#endif
-			break;
-			}
-		case EUidPixelFormatARGB_8888:
-			{
-			color = aColor.Color16MA();
-			lines = aLines.Color16MA();
-			break;
-			}
-		case EUidPixelFormatARGB_8888_PRE:
-			{
-			color = aColor.Color16MAP();
-			lines = aLines.Color16MAP();
-			break;
-			}
-		case EUidPixelFormatXRGB_4444:
-		case EUidPixelFormatARGB_4444:
-			{
-			color = aColor.Color4K();
-			lines = aLines.Color4K();
-			use16 = ETrue;
-			break;
-			}
-		case EUidPixelFormatRGB_565:
-			{
-			color = aColor.Color64K();
-			lines = aLines.Color64K();
-			use16 = ETrue;
-			break;
-			}
-		default:
-			{
-			User::Leave(KErrNotSupported);
-			break;
-			}
-		}
-
-	RChunk chunk;
-	User::LeaveIfError(iManager.MapSurface(aSurface, chunk));
-	CleanupClosePushL(chunk);
-
-	TInt offsetToFirstBuffer;
-	User::LeaveIfError(iManager.GetBufferOffset(aSurface, 0, offsetToFirstBuffer));
-	TUint8* surfacePtr = chunk.Base() + offsetToFirstBuffer;
-	TUint8* linePtr = surfacePtr;
-
-	if (use16)
-		{
-		if ( info.iSize.iWidth*2>info.iStride)
-			{
-			User::Leave(KErrOverflow);
-			}
-		TUint16* ptr = reinterpret_cast<TUint16*>(surfacePtr);
-
-		// Fill first line
-		for (TInt xx1 = 0; xx1 < info.iSize.iWidth; xx1++)
-			{
-			ptr[xx1] = (TUint16)lines;
-			}
-
-		// Fill second line
-		ptr = reinterpret_cast<TUint16*>(surfacePtr + info.iStride);
-		for (TInt xx2 = 0; xx2 < info.iSize.iWidth; xx2++)
-			{
-			// Vertical line every 8 pixels across
-			ptr[xx2] = (TUint16)((xx2 & 7) ? color : lines);
-			}
-		}
-	else
-		{
-		if ( info.iSize.iWidth*4>info.iStride)
-			{
-			User::Leave(KErrOverflow);
-			}
-		TUint32* ptr = reinterpret_cast<TUint32*>(surfacePtr);
-
-		// Fill first line
-		for (TInt xx3 = 0; xx3 < info.iSize.iWidth; xx3++)
-			{
-			ptr[xx3] = lines;
-			}
-
-		// Fill second line
-		ptr = reinterpret_cast<TUint32*>(surfacePtr + info.iStride);
-		for (TInt xx4 = 0; xx4 < info.iSize.iWidth; xx4++)
-			{
-			// Vertical line every 8 pixels across
-			ptr[xx4] = (xx4 & 7) ? color : lines;
-			}
-		}
-	linePtr += info.iStride;
-
-	// Now copy that to the other lines
-	for (TInt yy = 2; yy < info.iSize.iHeight; yy++)
-		{
-		linePtr += info.iStride;
-		if (yy & 7)
-			{
-			// Copy second line
-			Mem::Copy(linePtr, surfacePtr + info.iStride, info.iSize.iWidth * BytesPerPixelL(info.iPixelFormat));
-			}
-		else
-			{
-			// Copy first line
-			Mem::Copy(linePtr, surfacePtr, info.iSize.iWidth * BytesPerPixelL(info.iPixelFormat));
-			}
-		}
-
-	TInt err =iSurfaceUpdateSession.SubmitUpdate(KAllScreens, aSurface, 0, NULL);
-	if (err!=KErrNone)
-		LOG(("Error submitting update: 0x%X\n", err));
-	
-	CleanupStack::PopAndDestroy(/* chunk */);
-	}
-
-
-/**
-Fill the given surface with a pattern suitable for automated testing.
-
-@param aSurface	The surface to be filled.
-*/
-void CSurfaceUtility::PatternFillSurfaceL(TSurfaceId& aSurface)
-	{
-	RSurfaceManager::TInfoBuf infoBuf;
-	RSurfaceManager::TSurfaceInfoV01& info = infoBuf();
-
-	User::LeaveIfError(iManager.SurfaceInfo(aSurface, infoBuf));	
-	
-	// Fill the background
-	FillSurfaceL(aSurface, TRgb(0x00000000));
-
-	TInt surfaceWidth = info.iSize.iWidth;
-	TInt surfaceHeight = info.iSize.iHeight;
-	
-	// Create the 4 rectangles in the corners
-	TPoint startPos(0,0);
-	TSize size(15,15);
-	TInt rectWidth = size.iWidth;
-	TInt rectHeight = size.iHeight;
-	// Top left
-	FillRectangleL(aSurface, startPos, size, TRgb(0x0000ff));
-	
-	// Top right
-	startPos.iX = surfaceWidth - rectWidth;
-	startPos.iY = 0;
-	FillRectangleL(aSurface, startPos, size, TRgb(0x00ff00));
-	
-	// Bottom left
-	startPos.iX = 0;
-	startPos.iY = surfaceHeight - rectHeight;
-	FillRectangleL(aSurface, startPos, size, TRgb(0x00ffff));
-	
-	// Bottom right
-	startPos.iX = surfaceWidth - rectWidth;
-	startPos.iY = surfaceHeight - rectHeight;
-	FillRectangleL(aSurface, startPos, size, TRgb(0xffffff));
-	
-	// Create the 4 side bars
-	startPos.iX = 0;
-	startPos.iY = 6;
-	size.iWidth = 5;
-	size.iHeight = surfaceHeight - 12;
-	// Left
-	FillRectangleL(aSurface, startPos, size, TRgb(0x808000));
-	
-	startPos.iX = surfaceWidth - size.iWidth;
-	startPos.iY = 6;
-	// Right
-	FillRectangleL(aSurface, startPos, size, TRgb(0xff00ff));
-	
-	startPos.iX = 6;
-	startPos.iY = surfaceHeight - size.iWidth;
-	size.iWidth = surfaceWidth - 12;
-	size.iHeight = 5;
-	// Top
-	FillRectangleL(aSurface, startPos, size, TRgb(0xaaaaaa));
-	
-	startPos.iX = 6;
-	startPos.iY = 0;
-	// Bottom
-	FillRectangleL(aSurface, startPos, size, TRgb(0x000080));
-	}
-
-
-template <class TIntType> void
-DdaLine(TUint aX1, TUint aY1,TUint aX2,TUint aY2, TUint aPixPerScan, TIntType* aBuffer, TIntType aColor)
-	{
-	TInt dx=aX2-aX1;
-	TInt dy=aY2-aY1;
-	TInt adx=dx,sdx=1;
-	if (adx<0)
-		{	adx=-adx; sdx=-1;	}
-	TInt ady=dy,sdy=aPixPerScan;
-	if (ady<0)
-		{	ady=-ady; sdy=-aPixPerScan;	}
-	//This is simplistic integert DDA.
-	//The vertical cases are handled by this 1/2 accumulator:
-	//	If adx is zero then we step in sdy indefinitely
-	//  If ady is zero then we step in sdx indefinitely
-	TInt accum=adx/2;
-	
-	TIntType* bufferend=aBuffer+aX2+aY2*aPixPerScan;
-	aBuffer+=aX1+aY1*aPixPerScan;
-	*aBuffer=aColor;
-	while (aBuffer!=bufferend)
-		{
-		if (accum>0)
-			{
-			accum-=ady;
-			aBuffer+=sdx;
-			}
-		else
-			{
-			accum+=adx;
-			aBuffer+=sdy;
-			}
-		*aBuffer=aColor;
-		}
-	
-
-	}
-template <class TIntType> void	
-FanFill(const TPoint& aInnerXY,TUint aPixPerScan, TIntType* aSurfacePtr, TIntType aLinesTL, 
-			TIntType aLinesBR, TIntType aLinesTR, TIntType aLinesBL)
-	{
-	
-		DdaLine(aInnerXY.iX,0,aInnerXY.iX-aInnerXY.iX*180/1024,aInnerXY.iY,aPixPerScan,aSurfacePtr,aLinesTR);
-		DdaLine(aInnerXY.iX,0,aInnerXY.iX-aInnerXY.iX*372/1024,aInnerXY.iY,aPixPerScan,aSurfacePtr,aLinesTR);
-		DdaLine(aInnerXY.iX,0,aInnerXY.iX-aInnerXY.iX*591/1024,aInnerXY.iY,aPixPerScan,aSurfacePtr,aLinesTR);
-		DdaLine(aInnerXY.iX,0,aInnerXY.iX-aInnerXY.iX*859/1024,aInnerXY.iY,aPixPerScan,aSurfacePtr,aLinesTR);
-
-		DdaLine(aInnerXY.iX,0,0,aInnerXY.iY*180/1024,aPixPerScan,aSurfacePtr,aLinesTR);
-		DdaLine(aInnerXY.iX,0,0,aInnerXY.iY*372/1024,aPixPerScan,aSurfacePtr,aLinesTR);
-		DdaLine(aInnerXY.iX,0,0,aInnerXY.iY*591/1024,aPixPerScan,aSurfacePtr,aLinesTR);
-		DdaLine(aInnerXY.iX,0,0,aInnerXY.iY*859/1024,aPixPerScan,aSurfacePtr,aLinesTR);
-		
-		DdaLine(0,aInnerXY.iY,aInnerXY.iX*180/1024,0,aPixPerScan,aSurfacePtr,aLinesBL);
-		DdaLine(0,aInnerXY.iY,aInnerXY.iX*372/1024,0,aPixPerScan,aSurfacePtr,aLinesBL);
-		DdaLine(0,aInnerXY.iY,aInnerXY.iX*591/1024,0,aPixPerScan,aSurfacePtr,aLinesBL);
-		DdaLine(0,aInnerXY.iY,aInnerXY.iX*859/1024,0,aPixPerScan,aSurfacePtr,aLinesBL);
-
-		DdaLine(0,aInnerXY.iY,aInnerXY.iX,aInnerXY.iY-aInnerXY.iY*180/1024,aPixPerScan,aSurfacePtr,aLinesBL);
-		DdaLine(0,aInnerXY.iY,aInnerXY.iX,aInnerXY.iY-aInnerXY.iY*372/1024,aPixPerScan,aSurfacePtr,aLinesBL);
-		DdaLine(0,aInnerXY.iY,aInnerXY.iX,aInnerXY.iY-aInnerXY.iY*591/1024,aPixPerScan,aSurfacePtr,aLinesBL);
-		DdaLine(0,aInnerXY.iY,aInnerXY.iX,aInnerXY.iY-aInnerXY.iY*859/1024,aPixPerScan,aSurfacePtr,aLinesBL);
-		
-		DdaLine(0,0,aInnerXY.iX*180/1024,aInnerXY.iY,aPixPerScan,aSurfacePtr,aLinesTL);
-		DdaLine(0,0,aInnerXY.iX*372/1024,aInnerXY.iY,aPixPerScan,aSurfacePtr,aLinesTL);
-		DdaLine(0,0,aInnerXY.iX*591/1024,aInnerXY.iY,aPixPerScan,aSurfacePtr,aLinesTL);
-		DdaLine(0,0,aInnerXY.iX*859/1024,aInnerXY.iY,aPixPerScan,aSurfacePtr,aLinesTL);
-
-		DdaLine(0,0,aInnerXY.iX,aInnerXY.iY*180/1024,aPixPerScan,aSurfacePtr,aLinesTL);
-		DdaLine(0,0,aInnerXY.iX,aInnerXY.iY*372/1024,aPixPerScan,aSurfacePtr,aLinesTL);
-		DdaLine(0,0,aInnerXY.iX,aInnerXY.iY*591/1024,aPixPerScan,aSurfacePtr,aLinesTL);
-		DdaLine(0,0,aInnerXY.iX,aInnerXY.iY*859/1024,aPixPerScan,aSurfacePtr,aLinesTL);
-		
-		DdaLine(0,aInnerXY.iY-aInnerXY.iY*180/1024,aInnerXY.iX,aInnerXY.iY,aPixPerScan,aSurfacePtr,aLinesBR);
-		DdaLine(0,aInnerXY.iY-aInnerXY.iY*372/1024,aInnerXY.iX,aInnerXY.iY,aPixPerScan,aSurfacePtr,aLinesBR);
-		DdaLine(0,aInnerXY.iY-aInnerXY.iY*591/1024,aInnerXY.iX,aInnerXY.iY,aPixPerScan,aSurfacePtr,aLinesBR);
-		DdaLine(0,aInnerXY.iY-aInnerXY.iY*859/1024,aInnerXY.iX,aInnerXY.iY,aPixPerScan,aSurfacePtr,aLinesBR);
-
-		DdaLine(aInnerXY.iX-aInnerXY.iX*180/1024,0,aInnerXY.iX,aInnerXY.iY,aPixPerScan,aSurfacePtr,aLinesBR);
-		DdaLine(aInnerXY.iX-aInnerXY.iX*372/1024,0,aInnerXY.iX,aInnerXY.iY,aPixPerScan,aSurfacePtr,aLinesBR);
-		DdaLine(aInnerXY.iX-aInnerXY.iX*591/1024,0,aInnerXY.iX,aInnerXY.iY,aPixPerScan,aSurfacePtr,aLinesBR);
-		DdaLine(aInnerXY.iX-aInnerXY.iX*859/1024,0,aInnerXY.iX,aInnerXY.iY,aPixPerScan,aSurfacePtr,aLinesBR);
-	
-	}
-/**
-Fill the given surface with a fan of lines over a solid color.
-
-Similar to FillSurfaceL(), but with a fan of lines overlayed. 
-One fan is drawn about the top-left, and second fan at bottom-right.
-The fan contains 8 segments.
-
-@param aSurface	The surface to be filled.
-@param aColor	The color to fill it with.
-@param aLines	The color of the grid lines.
-*/
-void CSurfaceUtility::FanFillSurfaceL(TSurfaceId& aSurface, const TRgb& aColor, const TRgb& aLinesTL, const TRgb& aLinesBR)
-	{
-	FillSurfaceL(aSurface,aColor);
-	RSurfaceManager::TInfoBuf infoBuf;
-	RSurfaceManager::TSurfaceInfoV01& info = infoBuf();
-
-	User::LeaveIfError(iManager.SurfaceInfo(aSurface, infoBuf));
-	TUint32 linesTL = 0;
-	TUint32 linesBR = 0;
-	TUint32 linesTR = 0;
-	TUint32 linesBL = 0;
-	TBool use16 = EFalse;
-	TRgb	rgbLinesTR(0,0,0);
-	TRgb	rgbLinesBL(255,255,255);
-
-	switch (info.iPixelFormat)
-		{
-		case EUidPixelFormatXRGB_8888:
-			{
-			linesBR = aLinesBR.Color16MU();
-			linesTL = aLinesTL.Color16MU();
-			linesTR = rgbLinesTR.Color16MU();
-			linesBL = rgbLinesBL.Color16MU();
-#ifdef ALPHA_FIX_24BIT
-			linesBR |= ((ALPHA_FIX_24BIT)&0xff)<<24;
-			linesTL |= ((ALPHA_FIX_24BIT)&0xff)<<24;
-			linesTR |= ((ALPHA_FIX_24BIT)&0xff)<<24;
-			linesBL |= ((ALPHA_FIX_24BIT)&0xff)<<24;
-#endif
-			break;
-			}
-		case EUidPixelFormatARGB_8888:
-			{
-			linesBR = aLinesBR.Color16MA();
-			linesTL = aLinesTL.Color16MA();
-			linesTR = rgbLinesTR.Color16MA();
-			linesBL = rgbLinesBL.Color16MA();
-			break;
-			}
-		case EUidPixelFormatARGB_8888_PRE:
-			{
-			linesBR = aLinesBR.Color16MAP();
-			linesTL = aLinesTL.Color16MAP();
-			linesTR = rgbLinesTR.Color16MAP();
-			linesBL = rgbLinesBL.Color16MAP();
-			break;
-			}
-		case EUidPixelFormatXRGB_4444:
-		case EUidPixelFormatARGB_4444:
-			{
-			linesBR = aLinesBR.Color4K();
-			linesTL = aLinesTL.Color4K();
-			linesTR = rgbLinesTR.Color4K();
-			linesBL = rgbLinesBL.Color4K();
-			use16 = ETrue;
-			break;
-			}
-		case EUidPixelFormatRGB_565:
-			{
-			linesBR = aLinesBR.Color64K();
-			linesTL = aLinesTL.Color64K();
-			linesTR = rgbLinesTR.Color64K();
-			linesBL = rgbLinesBL.Color64K();
-			use16 = ETrue;
-			break;
-			}
-		default:
-			{
-			User::Leave(KErrNotSupported);
-			break;
-			}
-		}
-	if (info.iSize.iHeight<0 || info.iSize.iWidth<0 || info.iStride<0)
-		{
-		User::Leave(KErrCorrupt);
-		}
-	if (info.iSize.iHeight==0 || info.iSize.iWidth==0 || info.iStride==0)
-		{
-		User::Leave(KErrNotReady);
-		}
-	RChunk chunk;
-	User::LeaveIfError(iManager.MapSurface(aSurface, chunk));
-	CleanupClosePushL(chunk);
-	
-	TInt offsetToFirstBuffer;
-	User::LeaveIfError(iManager.GetBufferOffset(aSurface, 0, offsetToFirstBuffer));
-	TUint8* surfacePtr = chunk.Base() + offsetToFirstBuffer;
-	TPoint innerXY(info.iSize.iWidth-1,info.iSize.iHeight-1);
-	if (use16)
-		{
-		if ( info.iSize.iWidth*2>info.iStride)
-			{
-			User::Leave(KErrOverflow);
-			}
-		FanFill<TUint16>(innerXY,info.iStride/2,(TUint16*)surfacePtr,linesTL,linesBR,linesBL,linesTR);
-		}
-	else
-		{
-		if ( info.iSize.iWidth*4>info.iStride)
-			{
-			User::Leave(KErrOverflow);
-			}
-		FanFill<TUint>(innerXY,info.iStride/4,(TUint*)surfacePtr,linesTL,linesBR,linesBL,linesTR);
-		}
-	
-	iSurfaceUpdateSession.SubmitUpdate(KAllScreens, aSurface, 0, NULL);
-	
-	CleanupStack::PopAndDestroy(/* chunk */);
-	}
-/**
-Fill the given surface with vertical line at the given position
-
-Similar to FillSurfaceL(), but with a vertical line overlayed. 
-The position along the surface is given as a percentage from the left
-
-@param aSurface	The surface to be filled.
-@param aColor	The color to fill it with.
-@param aLine	The color of the line.
-@param aPosition Position of the vertical line given as a percentage across the surface from the left edge
-*/
-void CSurfaceUtility::LineFillSurfaceL(TSurfaceId& aSurface, const TRgb& aBackColor, const TRgb& aLineColor, TInt aPosition)
-	{
-	if (aPosition<0 || aPosition>100)
-		{
-		aPosition=0;
-		}
-	FillSurfaceL(aSurface,aBackColor);
-	RSurfaceManager::TInfoBuf infoBuf;
-	RSurfaceManager::TSurfaceInfoV01& info = infoBuf();
-	
-	User::LeaveIfError(iManager.SurfaceInfo(aSurface, infoBuf));
-	TUint32 lineColor = 0;
-	TBool use16 = EFalse;
-	
-	switch (info.iPixelFormat)
-		{
-		case EUidPixelFormatXRGB_8888:
-			{
-			lineColor = aLineColor.Color16MU();
-#ifdef ALPHA_FIX_24BIT
-			lineColor |= ((ALPHA_FIX_24BIT)&0xff)<<24;
-#endif
-			break;
-			}
-		case EUidPixelFormatARGB_8888:
-			{
-			lineColor = aLineColor.Color16MA();
-			break;
-			}
-		case EUidPixelFormatARGB_8888_PRE:
-			{
-			lineColor = aLineColor.Color16MAP();
-			break;
-			}
-		case EUidPixelFormatXRGB_4444:
-		case EUidPixelFormatARGB_4444:
-			{
-			lineColor = aLineColor.Color4K();
-			use16 = ETrue;
-			break;
-			}
-		case EUidPixelFormatRGB_565:
-			{
-			lineColor = aLineColor.Color64K();
-			use16 = ETrue;
-			break;
-			}
-		default:
-			{
-			User::Leave(KErrNotSupported);
-			break;
-			}
-		}
-	RChunk chunk;
-	User::LeaveIfError(iManager.MapSurface(aSurface, chunk));
-	
-	TInt offsetToFirstBuffer;
-	User::LeaveIfError(iManager.GetBufferOffset(aSurface, 0, offsetToFirstBuffer));
-	TUint8* surfacePtr = chunk.Base() + offsetToFirstBuffer;
-	if (use16)
-		{
-		DdaLine<TUint16>((info.iSize.iWidth*aPosition)/100,0,(info.iSize.iWidth*aPosition)/100,
-				info.iSize.iHeight-1,info.iStride/2,(TUint16*)surfacePtr,lineColor);
-		}
-	else
-		{
-		DdaLine<TUint>((info.iSize.iWidth*aPosition)/100,0,(info.iSize.iWidth*aPosition)/100,
-				info.iSize.iHeight-1,info.iStride/4,(TUint*)surfacePtr,lineColor);
-		}
-
-	chunk.Close();
-	
-	iSurfaceUpdateSession.SubmitUpdate(KAllScreens, aSurface, 0, NULL);
-	}
-/**
- * Generates a bitmap equivalent to the surface.
- * Can reuse an existing bitmap or create a new bitmap.
- * The existing bitmap must be an exact match (eg previously generated by this method)
- **/
-CFbsBitmap* CSurfaceUtility::EquivalentBitmapL(TSurfaceId& aSurface,CFbsBitmap* aCopyToMayBeNull)
-	{
-	RSurfaceManager::TInfoBuf infoBuf;
-	RSurfaceManager::TSurfaceInfoV01& info = infoBuf();
-
-	User::LeaveIfError(iManager.SurfaceInfo(aSurface, infoBuf));
-	TInt bytesPerPixel=0;
-	TDisplayMode	bitmapMode = ENone;
-	switch (info.iPixelFormat)
-		{
-		case EUidPixelFormatXRGB_8888:
-			{
-			bitmapMode = EColor16MU;
-			bytesPerPixel = 4;
-			break;
-			}
-		case EUidPixelFormatARGB_8888:
-			{
-			bitmapMode=EColor16MA;
-			bytesPerPixel = 4;
-			break;
-			}
-		case EUidPixelFormatARGB_8888_PRE:
-			{
-			bitmapMode=EColor16MAP;
-			bytesPerPixel = 4;
-			break;
-			}
-		case EUidPixelFormatXRGB_4444:
-		case EUidPixelFormatARGB_4444:
-			{
-			bitmapMode=EColor4K;
-			bytesPerPixel = 2;
-			break;
-			}
-		case EUidPixelFormatRGB_565:
-			{
-			bitmapMode=EColor64K;
-			bytesPerPixel = 2;
-			break;
-			}
-		default:
-			{
-			User::Leave(KErrNotSupported);
-			break;
-			}
-		}
-	CFbsBitmap* retVal=NULL;
-	if (aCopyToMayBeNull)
-		{
-		retVal=aCopyToMayBeNull;
-		if (retVal->SizeInPixels()!=info.iSize)
-			User::Leave(KErrCorrupt);
-		if (retVal->DisplayMode()!=bitmapMode)
-			User::Leave(KErrCorrupt);
-		}
-	else
-		{
-		retVal=new CFbsBitmap;
-		CleanupStack::PushL(retVal);
-		User::LeaveIfError(retVal->Create(info.iSize,bitmapMode));
-		}
-	RChunk chunk;
-	CleanupClosePushL(chunk);
-	User::LeaveIfError(iManager.MapSurface(aSurface, chunk));
-	TInt offsetToFirstBuffer;
-	User::LeaveIfError(iManager.GetBufferOffset(aSurface, 0, offsetToFirstBuffer));
-	TUint8* surfacePtr = chunk.Base() + offsetToFirstBuffer;
-	TUint8* bitmapPtr = (TUint8*)retVal->DataAddress();
-	TInt copyBytes=info.iSize.iWidth*bytesPerPixel;
-	for (TInt y=0;y<info.iSize.iHeight;y++)
-		{
-		Mem::Copy(bitmapPtr,surfacePtr,copyBytes);
-		surfacePtr+=info.iStride;
-		bitmapPtr+=retVal->DataStride();
-		}
-	CleanupStack::PopAndDestroy(&chunk);
-	if (!aCopyToMayBeNull)
-		CleanupStack::Pop(retVal);
-	return retVal;
-	}
-
-/**
-Destroy a surface.
-
-As well as destroying the surface, it is removed from the set held for
-destruction during tear down.
-
-@param aSurface	The surface to be destroyed.
-*/
-void CSurfaceUtility::DestroySurface(TSurfaceId& aSurface)
-	{
-	TInt index = iSurfaces.Find(aSurface);
-	
-	if (index != KErrNotFound)
-		{
-		iSurfaces.Remove(index);
-		}
-
-	TInt err = iManager.CloseSurface(aSurface);
-	if (err!=KErrNone)
-		LOG(("Error closing surfaces: 0x%X\n", err));
-	}
-
-
-/**
-Submit an update to a surface to the update server.
-
-@param aScreenNumber	The screen to be updated where the surface is shown.
-@param aSurface	The surface which has been updated.
-@param aRegion	The area of the surface affected, or NULL for all of it.*/
-void CSurfaceUtility::SubmitUpdate(TInt /* aScreenNumber */, const TSurfaceId& aSurface, const TRegion* aRegion,TInt aBufferNumber)
-	{
-	TInt err =iSurfaceUpdateSession.SubmitUpdate(KAllScreens, aSurface, aBufferNumber, aRegion); 
-	if (err!=KErrNone)
-		LOG(("Error submitting update: 0x%X\n", err));
-	}
-
-/**
-Map and submit an update to a surface to the update server.
-
-@param aChunk	The chunk of memory to be mapped
-@param aScreenNumber	The screen to be updated where the surface is shown.
-@param aSurface	The surface which has been updated.
-@param aRegion	The area of the surface affected, or NULL for all of it.*/
-void CSurfaceUtility::MapAndSubmitUpdateL(RChunk& aChunk, 
-		                                TInt /* aScreenNumber */, 
-		                                const TSurfaceId& aSurface, 
-		                                const TRegion* aRegion)
-	{
-	User::LeaveIfError(iManager.MapSurface(aSurface, aChunk));
-	aChunk.Close();
-	TInt err =iSurfaceUpdateSession.SubmitUpdate(KAllScreens, aSurface, 0, aRegion); 
-	if (err!=KErrNone)
-		LOG(("Error submitting update: 0x%X\n", err));
-	}
-
-void CSurfaceUtility::MapSurfaceL(const TSurfaceId& aSurface, RChunk& aChunk)
-	{
-	User::LeaveIfError(iManager.MapSurface(aSurface, aChunk));
-	}
-
-void CSurfaceUtility::CopyBitmapToSurfaceL(TSurfaceId& aSurface, const CFbsBitmap& aBitmap)
-	{
-	TSize size = SurfaceSize(aSurface);
-	
-	TDisplayMode bmpFormat = aBitmap.DisplayMode();
-	TInt stride = size.iWidth * 4;		// Default to four bytes per pixel
-
-	RChunk chunk;
-	User::LeaveIfError(iManager.MapSurface(aSurface, chunk));
-	CleanupClosePushL(chunk);
-
-	TInt offsetToFirstBuffer;
-	User::LeaveIfError(iManager.GetBufferOffset(aSurface, 0, offsetToFirstBuffer));
-
-	// Copy the data from the bitmap into the surface.
-	TPoint start;
-	TUint8 *pSurfStart = chunk.Base() + offsetToFirstBuffer;
-	for (start.iY = 0; start.iY < size.iHeight; start.iY++)
-		{
-		// Set up a descriptor for the current line in the surface and get pixels.
-		TPtr8 ptr(pSurfStart + start.iY * stride, stride);
-		aBitmap.GetScanLine(ptr, start, size.iWidth, bmpFormat);
-		}
-
-	TInt err =iSurfaceUpdateSession.SubmitUpdate(KAllScreens, aSurface, 0, NULL);
-	if (err!=KErrNone)
-		{
-		LOG(("Error submitting update: 0x%X\n", err));
-		}
-
-	CleanupStack::PopAndDestroy(/* chunk */);
-	}
--- a/windowing/windowserver/tdynamicres/src/t_wsdynamicresclassictestserver.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
-*/
-
-#include "wsdynamicresclassic.h"
-#include <test/ctefunitserver.h>
-
-_LIT( KServerName, "wsdynamicresclassictestserver" );
-
-GLDEF_C const TTestName ServerName()
-/**
- * ServerName
- *
- * @return - The TEF server name
- */
-	{
-	TTestName serverName(KServerName);
-	return serverName;
-	}
-
-GLDEF_C CTestSuite* CreateTestSuiteL()
-/**
- * Create the overall test suite.
- *
- * @return - The top level suite
- */
-	{
-	START_SUITE;
-
-	ADD_TEST_SUITE( CWsDynamicResClassic );
-
-	END_SUITE;
-	}
-
-GLDEF_C CTestStep* CreateTEFTestStep(const TDesC& , CTEFUnitServer& /* aServer */)
-/**
- * Create individual test steps, outside the suite.
- */
-	{
-	// Initialise test step object to NULL if no TEF step is found
-	CTestStep* testStep = NULL;
-
-	return testStep;
-	}
--- a/windowing/windowserver/tdynamicres/src/t_wsdynamicrestestserver.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
-*/
-#include <test/ctefunitserver.h>
-#include "globalsettings.h"
-#include "screenselect.h"
-#include "wsdynamicresbase.h"
-#include "wsdynamicresbasic.h"
-
-_LIT( KServerName, "wsdynamicrestestserver" );
-
-GLDEF_C const TTestName ServerName()
-/**
- * ServerName
- *
- * @return - The TEF server name
- */
-	{
-	TTestName serverName(KServerName);
-	return serverName;
-	}
-
-GLDEF_C CTestSuite* CreateTestSuiteL()
-/**
- * Create the overall test suite.
- *
- * @return - The top level suite
- */
-	{
-	START_SUITE;
-	ADD_TEST_SUITE( CWsDynamicResBasic );
-	ADD_TEST_SUITE( CGlobalSettings );
-	END_SUITE;
-	}
-
-_LIT(KSelectScreen0, "SelectScreen0");
-_LIT(KSelectScreen1, "SelectScreen1");
-
-GLDEF_C CTestStep* CreateTEFTestStep(const TDesC& aStepName, CTEFUnitServer& /* aServer */)
-/**
- * Create individual test steps, outside the suite.
- */
-	{
-	// Initialise test step object to NULL if no TEF step is found
-	CTestStep* testStep = NULL;
-
-	if (aStepName == KSelectScreen0)
-		testStep = new CScreenSelect(0, aStepName);
-	else if (aStepName == KSelectScreen1)
-		testStep = new CScreenSelect(1, aStepName);
-
-	return testStep;
-	}
-
--- a/windowing/windowserver/tdynamicres/src/t_wsdynamicreswinbase.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,980 +0,0 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
-*/
-
-
-#include <e32std.h>
-#include <e32math.h>
-#include <w32std.h>
-#include <w32debug.h>
-#include "teflogextensions.h"
-#include "t_wsdynamicreswinbase.h"
-#include "globalsettings.h"
-#include <bitdraw.h>
-#include <bitdrawinterfaceid.h>
-#include <u32hal.h>
-#include <dispchannel.h>
-#include <graphics/displaycontrol.h>
-
-#if (!defined(K_DISPLAY_CH_MAJOR_VERSION_NUMBER) && !defined(K_DISPLAY_CH_MINOR_VERSION_NUMBER))
-#define MODE_CHANGE_BASE_FUNCTIONALITY_NOT_PRESENT_IN_HEADER
-#endif
-
-_LIT(KMonospaceTestFontTypefaceName,"Arial");
-const TInt KMaxFontSize = 150;
-TBool	CWsDynamicResWinBase::iTransparencyEnabled=EFalse;
-
-CWsDynamicResWinBase::CWsDynamicResWinBase():
-	iDoTearDown(EFalse),
-	iSession(TGlobalSettings::Instance().iScreen)
-{
-}
-
-void CWsDynamicResWinBase::SetupL()
-	{
-	SetupL(EFalse);
-	}
-CActiveScheduler	CWsDynamicResWinBase::iScheduler;
-
-void CWsDynamicResWinBase::SetupL(TBool aUseOtherScreenForInfo)
-	{	
-	if (CActiveScheduler::Current()!=&iScheduler)
-		{
-		new (&iScheduler) CActiveScheduler;
-		CActiveScheduler::Install(&iScheduler);
-		}
-	iDoTearDown=ETrue;
-	iRed.SetInternal(0xFFFF0000);
-	iGreen.SetInternal(0xFF00FF00);
-	iBlue.SetInternal(0xFF0000FF);
-	iCyan.SetInternal(0xFF00FFFF);
-	iMagenta.SetInternal(0xFFFF00FF);
-	iYellow.SetInternal(0xFFFFFF00);
-	iWhite.SetInternal(0xFFFFFFFF);
-	iLastGceHoleColor.SetInternal(0);
-	TITLE_BACKGROUND=iCyan;
-	COMPARE_BACKGROUND=iBlue;
-
-	ASSERT_EQUALS_X(iSession.Connect(), KErrNone);
-
-		{//Stolen from TAuto CloseAllPanicWindows()
-		TInt idFocus = iSession.GetFocusWindowGroup();
-		TWsEvent event;
-		event.SetType(EEventKey); //EEventKeyDown
-		TKeyEvent *keyEvent = event.Key();
-		keyEvent->iCode = EKeyEscape;
-		keyEvent->iScanCode = EStdKeyEscape;
-		keyEvent->iModifiers = 0;
-		TInt theLimit = 50;
-		while(idFocus != NULL && (theLimit-- > 0))
-			{
-			iSession.SendEventToAllWindowGroups(event);
-			TInt idNewFocus = iSession.GetFocusWindowGroup();
-			if (idNewFocus!=idFocus)
-				{
-				INFO_PRINTF1(_L("A window was closed [probably a panic box from the previous test]."));
-				}
-			idFocus=idNewFocus;
-			}
-		}
-	TInt err = KErrNone;
-
-	TRAP(err, iScreenDevice = new (ELeave) CWsScreenDevice(iSession));
-	PRINT_ON_ERROR2_L(err, _L("Failed to create screen device: %d"), err);
-	ASSERT_EQUALS_X(iScreenDevice->Construct(TGlobalSettings::Instance().iScreen), KErrNone);
-	iDisplayMode = iScreenDevice->DisplayMode();	// Get default display mode
-
-	CheckAndConnectScreen();
-
-	TRAP(err, iGc = new (ELeave) CWindowGc(iScreenDevice));
-	PRINT_ON_ERROR2_L(err, _L("Failed to create graphics context: %d"), err);
-	ASSERT_EQUALS_X(iGc->Construct(), KErrNone);
-	
-	iGroup = RWindowGroup(iSession);
-	ASSERT_EQUALS_X(iGroup.Construct(++iWindowHandle,iScreenDevice), KErrNone);
-	iGroup.SetOrdinalPositionErr(0, KPasswordWindowGroupPriority - 1); // Added code ---- Fastpath
-	iSession.Flush();
-	
-	if (aUseOtherScreenForInfo)
-		{
-		if (iSession.NumberOfScreens()>1)
-			{	//Create server objects for info windows to appear on alternate screen
-			TInt alternateScreenNum=iSession.NumberOfScreens()-1;
-			if (TGlobalSettings::Instance().iScreen==alternateScreenNum)
-				{	//Alternate screen is last screen, or first screen if that is being tested. 
-				alternateScreenNum=0;
-				}
-			
-			TRAP(err, iInfoScreenDevice = new (ELeave) CWsScreenDevice(iSession));
-			PRINT_ON_ERROR2_L(err, _L("Failed to create second screen device: %d"), err);
-			ASSERT_EQUALS_X(iInfoScreenDevice->Construct(alternateScreenNum), KErrNone);
-	
-			TRAP(err, iInfoGc = new (ELeave) CWindowGc(iInfoScreenDevice));
-			PRINT_ON_ERROR2_L(err, _L("Failed to create second graphics context: %d"), err);
-			ASSERT_EQUALS_X(iInfoGc->Construct(), KErrNone);
-
-			iInfoGroupInstance = RWindowGroup(iSession);
-			ASSERT_EQUALS_X(iInfoGroupInstance.Construct(++iWindowHandle,iInfoScreenDevice), KErrNone);
-			iInfoGroup=&iInfoGroupInstance;
-			}
-		else
-			{	//If alternate screen is not available then no text or compare windows should be created!
-			iInfoScreenDevice=iScreenDevice;	//it is "convenient" for the device to still be good.
-			iInfoGc=NULL;
-			iInfoGroup=NULL;
-			}
-		}
-	else
-		{	//
-		iInfoScreenDevice=iScreenDevice;
-		iInfoGc=iGc;
-		iInfoGroup=&iGroup;
-		}
-	
-	if (iInfoGroup && iInfoGc)
-		{
-		// Add a plain background window to obscure anything else that
-		// happens to be behind the test. Setting this window's display mode is also
-		// used to set the screen device display mode, and hence the composition
-		// mode: alpha or chroma key.
-		iBackground = RBlankWindow(iSession);
-		ASSERT_EQUALS_X(iBackground.Construct(*iInfoGroup, ++iWindowHandle), KErrNone);
-	
-		iBackground.SetOrdinalPosition(100);	// Behind anything else in this group.
-		iBackground.SetColor(TRgb(iWhite));
-		//iBackground.SetExtent(TPoint(-1000,-1000),TSize(3000,3000));
-		iBackground.Activate();
-		iBackground.SetVisible(ETrue);
-		}
-	iSession.Flush();
-	
-	RWindow testTrans(iSession);
-	ASSERT_EQUALS_X(testTrans.Construct(iGroup, ++iWindowHandle), KErrNone);
-	iTransparencyEnabled=(testTrans.SetTransparencyFactor(iWhite)==KErrNone);
-	if (iTransparencyEnabled)
-		{
-		TTestName testName;
-		testName.Format(_L("Screen %i, depth %i: Found Trans Man"),
-				TGlobalSettings::Instance().iScreen
-			);
-		UpdateTitleWindowL(testName,KMaxInfoLines-1);
-		}
-	else
-		{
-		TTestName testName;
-		testName.Format(_L("Screen %i, depth %i: No Trans Man"),
-				TGlobalSettings::Instance().iScreen
-			);
-		UpdateTitleWindowL(testName,KMaxInfoLines-1);
-		}
-	testTrans.Close();
-	}
-
-
-void CWsDynamicResWinBase::CheckAndConnectScreen()
-	{
-	if (TGlobalSettings::Instance().iDisconnected) //set from script file to match wsini keyword SIMULATE_STARTUP_DISCONNECTED
-		{
-		//Verify that the display really is disconnected
-		ASSERT_TRUE_X(iScreenDevice != NULL);
-		MDisplayControl* interface = static_cast<MDisplayControl*>(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-		ASSERT_TRUE_X(interface != NULL);
-		RArray<MDisplayControl::TResolution> resolutions;
-		const TInt err = interface->GetResolutions(resolutions);
-		ASSERT_EQUALS_X(err, KErrDisconnected);
-		resolutions.Close();
-		}
-	
-#ifndef MODE_CHANGE_BASE_FUNCTIONALITY_NOT_PRESENT_IN_HEADER
-	//make sure display is attached to screen (only if I/F is available at compile time...)
-	TInt displayState = ENormalResolution;
-	UserSvr::HalFunction(EHalGroupDisplay | (TGlobalSettings::Instance().iScreen<<16), EDisplayHalSetDisplayState, &displayState, NULL);
-	Pause(200);
-#endif	
-	
-	if (TGlobalSettings::Instance().iDisconnected)
-		{
-		//Verify that the display now is connected
-		MDisplayControl* interface = static_cast<MDisplayControl*>(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-		RArray<MDisplayControl::TResolution> resolutions;
-		const TInt err = interface->GetResolutions(resolutions);
-		ASSERT_EQUALS_X(err, KErrNone);
-		const_cast<TGlobalSettings&>(TGlobalSettings::Instance()).iDisconnected = EFalse;
-		resolutions.Close();
-		}
-	}
-
-/**
-Common tear down code for all tests.
-
-Windows, group and session created are closed. Screen device is destroyed.
-Surfaces, manager and update session are closed.
-*/
-void CWsDynamicResWinBase::TearDownL()
-	{
-	iDoTearDown=EFalse;
-	if (iInfoGc!=iGc)
-		delete iInfoGc;
-	delete iGc;
-	if (iInfoScreenDevice!=iScreenDevice)
-		delete iInfoScreenDevice;
-	delete iScreenDevice;
-
-	iGroup.Close();
-	if (iInfoGroupInstance.WsHandle())
-		iInfoGroupInstance.Close();
-	iSession.Flush();
-	iSession.Close();
-	}
-/**
- * Note that this is not the ideal mechanism.
- * A derived class may thinks its TearDown is safe to do from delete, but in the class it is derived from it may not be safe
- **/
-void CWsDynamicResWinBase::TearDownFromDeleteL()	
-	{
-	CWsDynamicResWinBase::TearDownL();	//Explicitly call the non-derived implementation.
-	}
-
-CWsDynamicResWinBase::~CWsDynamicResWinBase()
-{
-	if (iDoTearDown)
-		TearDownFromDeleteL();	//This mechanism is not entirely clean to use.
-}
-/**
-Pause for the given number of milliseconds.
-
-@param aMilliseconds	Time to wait in milliseconds.
-*/
-void CWsDynamicResWinBase::Pause(TInt aMilliseconds)
-	{
-	User::After(TTimeIntervalMicroSeconds32(aMilliseconds * 1000));
-	}
-// This handles any non-member uses of the extended ASSERT_XXX macros
-void TefUnitFailLeaveL()
-	{
-	
-	User::Leave(KErrTEFUnitFail);
-	}
-/**
- * side-effect: log the state info just before I leave!
- * Note that this only logs intentional assertion failures.
- * Fails due to panics or throws won't log this info.
- **/
-void CWsDynamicResWinBase::TefUnitFailLeaveL()
-	{
-	for (TInt line=0;line<KMaxInfoLines;line++)
-		if (iTestInfo[line].Length())
-			Logger().LogExtra((TText8*)"Test state at fail - line",line, ESevrAll, iTestInfo[line]);
-	
-	User::Leave(KErrTEFUnitFail);
-	}
-
-/**	Creates the LHS info window, annd a middle window to display a representation of the expected result.
- *  Also sets up a rectangle representing the space on the right to be used for the test
- * 	@param	aTitle	The title to display on the info window
- *  @param	aDetail	Optional text to display on the first line under the title
-**/
-void CWsDynamicResWinBase::MakeTitleAndCompareWindowsL(TRefByValue<const TDesC16> aTitle,TRefByValue<const TDesC16> aDetail)
-	{	
-	iTestName=aTitle;
-	iTestInfo[0]=aDetail;
-	
-	TRect screenSize(iInfoScreenDevice->SizeInPixels());
-	TPoint oneThird(screenSize.iBr.iX/3,screenSize.iBr.iY/3);
-	TRect winSize(0,0,oneThird.iX,oneThird.iY);
-	
-	if (oneThird.iX>oneThird.iY)
-		{
-		oneThird.iY=0;
-		winSize.iBr.iY=screenSize.iBr.iY;
-		}
-	else
-		{
-		oneThird.iX=0;
-		winSize.iBr.iX=screenSize.iBr.iX;
-		}
-	winSize.Shrink(5,5);
-
-	if (iInfoGc)
-		{
-		iTitle=RWindow(iSession);
-		ASSERT_EQUALS_X(iTitle.Construct(*iInfoGroup, ++iWindowHandle), KErrNone);
-		iTitle.SetBackgroundColor(iCyan);
-		iTitle.SetExtent(winSize.iTl,winSize.Size());
-		iTitle.Activate();
-		
-		RepaintTitleWindowL();
-		iTitle.SetVisible(ETrue);
-	
-		winSize.Move(oneThird);
-		iCompare=RWindow(iSession);
-		ASSERT_EQUALS_X(iCompare.Construct(*iInfoGroup, ++iWindowHandle), KErrNone);
-		iCompare.SetBackgroundColor(COMPARE_BACKGROUND);
-		iCompare.SetExtent(winSize.iTl,winSize.Size());
-		iCompare.Activate();
-		iCompare.BeginRedraw();
-		ActivateWithWipe(iInfoGc,iCompare,COMPARE_BACKGROUND);
-	
-		TFontSpec fspec(KMonospaceTestFontTypefaceName,KMaxFontSize);
-		CFont *font=NULL;
-		ASSERT_EQUALS(iScreenDevice->GetNearestFontToDesignHeightInTwips(font,fspec),KErrNone);
-		iInfoGc->UseFont(font);
-		iInfoGc->DrawText(_L("Simulation"),winSize.Size(),winSize.Size().iHeight-5,iGc->ECenter);
-	
-		iInfoGc->Deactivate();
-		iCompare.EndRedraw();
-		iCompare.SetVisible(ETrue);
-		if (iScreenDevice!=iInfoScreenDevice)
-			{
-			winSize.Move(-oneThird);
-			}
-		else
-			{
-			winSize.Move(oneThird);
-			}
-		}
-	else
-		{
-		winSize=iScreenDevice->SizeInPixels();
-		}
-	
-	iTestPos=winSize;
-	iTestPointCentre=winSize.Center();
-	iCenteredFrontWinRect=winSize;
-	iCenteredFrontWinRect.Shrink(winSize.Size().iWidth/3,winSize.Size().iHeight/3);
-
-	}
-/**	Makes the compare window larger by covering the test window area as well.
- * 	Copes with vertically aligned screens, but will be naughty if called multiple times!!!
- *  @param aGoLarger	If set false, resets the size back.
- **/
-void CWsDynamicResWinBase::LargerCompareWindow(TBool aGoLarger)
-	{
-	TPoint currPos=iCompare.AbsPosition();
-	TSize currSize=iCompare.Size();
-	if (currPos.iX<currPos.iY)
-		{
-		if (aGoLarger)
-			currSize.iHeight<<=1;
-		else
-			currSize.iHeight>>=1;
-		}
-	else
-		{
-		if (aGoLarger)
-			currSize.iWidth<<=1;
-		else
-			currSize.iWidth>>=1;
-		}
-	iCompare.SetSize(currSize);
-	}
-	
-
-/**	Puts a line of text on the LHS window.
- *  Repaints the window. The line of text will also be shown in the log if the test fails.
- *	@param	aDetail	The text to display
- * 	@param	aIndex	The row number to display at
- **/
-void CWsDynamicResWinBase::UpdateTitleWindowL(TRefByValue<const TDesC16> aDetail,TInt aIndex)
-	{
-	ASSERT(aIndex>=0 && aIndex<KMaxInfoLines);
-	iTestInfo[aIndex]=aDetail;
-
-	RepaintTitleWindowL();
-	
-	}
-/**	Activate the GC onto the Window.
- *  In non-transparent mode it also performs a wipe background as the WServ system does not necessarily do this.
- * 	@param	aGc		The GC to associate
- * 	@param	aWin	The window to associate
- * 	@param	aColor	The color to use as the wipe. Default is transparent, which means no wipe.
- **/
-TBool	CWsDynamicResWinBase::ActivateWithWipe(CWindowGc* aGc,RWindow& aWin,TRgb aColor)
-	{
-	aGc->Activate(aWin);
-	aGc->SetBrushColor(aColor);
-	aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	if (aColor!=TRgb(0,0) && !iTransparencyEnabled)	//presume that all redraw-stored windows will draw background
-		{
-		aGc->Clear();
-		return ETrue;	//window was cleared
-		}
-	return EFalse;	
-	}
-
-CWindowGc*	CWsDynamicResWinBase::GcForWindow(RWindow& aWin)
-	{
-	if (aWin.WsHandle()==NULL)
-		return NULL;	//can't activate uninitialised window.
-	CWindowGc* gc=iGc;
-	if (iGc!=iInfoGc)
-		if (&aWin==&iCompare || &aWin==&iTitle)
-			gc=iInfoGc;
-		else if (iInfoGroup && aWin.WindowGroupId()==iInfoGroup->WindowGroupId())
-			gc=iInfoGc;
-	return gc;
-	}
-/** Activates an appropriate predefined GC on the specified window and wipes the background if necessary. 
- *  @param	aWin	The window to wipe
- * 	@param	aColor	The colour to wipe with (if necessary)
- * 	@return	the GC to use for drawing and deactivate at end. This may be NULL if the window is not "live"
- **/
-CWindowGc*	CWsDynamicResWinBase::BeginActivateWithWipe(TBool aInvalidate,RWindow& aWin,TRgb aColor)
-	{
-	CWindowGc* gc=GcForWindow(aWin);
-	iSession.Flush();
-	if (gc==NULL)
-		return gc;	//can't activate uninitialised window.
-	if (aInvalidate)
-		aWin.Invalidate();
-	iSession.Flush();
-	aWin.BeginRedraw();
-	iSession.Flush();
-	ActivateWithWipe(gc,aWin,aColor);
-	return gc;	
-	}
-
-/** Activates an appropriate predefined GC on the specified window and wipes the background if necessary. 
- *  @param	aWin	The window to wipe
- * 	@param	aColor	The colour to wipe with (if necessary)
- * 	@return	the GC to use for drawing and deactivate at end. This may be NULL if the window is not "live"
- **/
-CWindowGc*	CWsDynamicResWinBase::BeginActivateWithWipe(TBool aInvalidate,TRect aRect,RWindow& aWin,TRgb aColor)
-	{
-	if (aWin.WsHandle()==NULL)
-		return NULL;	//can't activate uninitialised window.
-	if (aInvalidate)
-		aWin.Invalidate(aRect);
-	aWin.BeginRedraw(aRect);
-	CWindowGc* gc=iGc;
-	if (iGc!=iInfoGc)
-		if (&aWin==&iCompare || &aWin==&iTitle)
-			gc=iInfoGc;
-		else if (aWin.WindowGroupId()==iInfoGroup->WindowGroupId())
-			gc=iInfoGc;
-	ActivateWithWipe(gc,aWin,aColor);
-	return gc;	
-	}
-
-TBool		CWsDynamicResWinBase::InvalidateRegion(const TRegion& aRegion,RWindow& aWin)
-	{
-	if (aWin.WsHandle()==NULL)
-		return false;	//can't activate uninitialised window.
-	for (TInt ii = 0; ii < aRegion.Count(); ii++)
-		{
-		aWin.Invalidate(aRegion[ii]);
-		}
-	return true;
-	}
-
-CWindowGc*	CWsDynamicResWinBase::BeginActivateWithWipe(const TRegion& aRegion,RWindow& aWin,TRgb aColor)
-	{
-	if (!InvalidateRegion(aRegion,aWin))
-		return NULL;	//can't activate uninitialised window.
-
-	aWin.BeginRedraw();
-	CWindowGc* gc=iGc;
-	if (iGc!=iInfoGc)
-		if (&aWin==&iCompare || &aWin==&iTitle)
-			gc=iInfoGc;
-		else if (aWin.WindowGroupId()==iInfoGroup->WindowGroupId())
-			gc=iInfoGc;
-	ActivateWithWipe(gc,aWin,aColor);
-	return gc;	
-	}
-
-
-/**	Paints the LHS window with rows of text.
- * 
- **/
-void CWsDynamicResWinBase::RepaintTitleWindowL()
-	{
-	if (iTitle.WsHandle())
-		{
-		iTitle.Invalidate();
-	
-		iTitle.BeginRedraw();
-		ActivateWithWipe(iInfoGc,iTitle,TITLE_BACKGROUND);
-		iInfoGc->SetUnderlineStyle(EUnderlineOn);
-		TSize winSize=iTitle.Size();
-		TRect textRect(winSize);
-		textRect.iBr.iY/=4;
-		TFontSpec fspec(KMonospaceTestFontTypefaceName,KMaxFontSize);
-		CFont *font=NULL;
-		ASSERT_EQUALS(iInfoScreenDevice->GetNearestFontToDesignHeightInTwips(font,fspec),KErrNone);
-		iInfoGc->UseFont(font);
-		iInfoGc->DrawText(iTestName,textRect,textRect.iBr.iY/2,iGc->ECenter);
-		iInfoGc->SetUnderlineStyle(EUnderlineOff);
-		textRect.iTl.iY=textRect.iBr.iY;
-		TInt rowHeight=winSize.iHeight*3/(4*(KMaxInfoLines+1));
-		textRect.iBr.iY+=rowHeight;
-		for (TInt index=0;index<KMaxInfoLines;index++)
-			{
-			if (iTestInfo[index].Length())
-				iInfoGc->DrawText(iTestInfo[index],textRect,textRect.Size().iHeight*3/4,iInfoGc->ECenter);
-			textRect.Move(0,rowHeight);
-			}
-		iInfoGc->DiscardFont();
-		iInfoGc->Deactivate();
-		iTitle.EndRedraw();
-		iInfoScreenDevice->ReleaseFont(font);
-	
-		iSession.Flush();
-		iSession.Finish();
-		}
-	}
-
-/** Useful test culled from other GCE test classes.
- * 	
- * 
- * 
- **/
-TBool CWsDynamicResWinBase::DisplayHasAlpha() const
-	{
-	return (iDisplayMode == EColor16MA || iDisplayMode == EColor16MAP);
-	}
-/**	Test using an indipendent method that GCE version of WServ is running
- *  This method can only be called after the testcase is started
- * 
- * 	@return	true if WServ version is GCE technology, false if legacy technology
- **/
-TBool CWsDynamicResWinBase::GCEIsSupported() const
-	{
-	CFbsDrawDevice* screenDevice=NULL;
-	TDisplayMode displayMode=iScreenDevice->DisplayMode();
-	TRAPD(err, screenDevice = CFbsDrawDevice::NewScreenDeviceL(TGlobalSettings::Instance().iScreen, displayMode));
-	TBool rv=EFalse;
-	if(err == KErrNone)
-		{
-		TAny* p=NULL;
-		rv=(screenDevice->GetInterface(KSurfaceInterfaceID, p)==KErrNone);
-		delete screenDevice;
-		}
-	return rv;
-	}
-/**	Test using an indipendent method that GCE version of WServ is running
- *  This method can be called at any time, even by external code, but creates temporary window session objects
- * 
- * 	@return	true if WServ version is GCE technology, false if legacy technology
- **/
-TBool CWsDynamicResWinBase::GCEIsSupportedStatic()
-	{
-	CFbsDrawDevice* screenDevice=NULL;
-	RWsSession session;
-	if (session.Connect()!=KErrNone)
-		{
-		return EFalse;
-		}
-	TDisplayMode displayMode=ENone;
-		{CWsScreenDevice screen(session);
-		if (screen.Construct(TGlobalSettings::Instance().iScreen)!=KErrNone)
-			{
-			return EFalse;
-			}
-			displayMode=screen.DisplayMode();
-		}//screen destroyed
-		TRAPD(err, screenDevice = CFbsDrawDevice::NewScreenDeviceL(TGlobalSettings::Instance().iScreen, displayMode));
-		TBool rv=EFalse;
-		if(err == KErrNone)
-			{
-			TAny* p=NULL;
-			rv=(screenDevice->GetInterface(KSurfaceInterfaceID, p)==KErrNone);
-			delete screenDevice;
-			}
-	return rv;
-	}//session destroyed
-/**
-Use the full-screen background window to select a display mode that doesn't use
-alpha (anything other than EColor16MA or EColor16MAP). Record the mode for use
-in setting all other windows.
-@return ETrue if an appropriate mode was selected, EFalse otherwise.
-*/
-TBool CWsDynamicResWinBase::SelectChromaCompositionMode()
-	{
-	// Request EColor64K, but as long as the actual mode doesn't use alpha, it
-	// doesn't matter too much which one is used.
-	if (iInfoGc==iGc)
-		{
-		iDisplayMode = (TDisplayMode)iBackground.SetRequiredDisplayMode(EColor64K);
-		iSession.Flush();		// Force switching to the display mode.
-		}
-	return !DisplayHasAlpha();
-	}
-/**	Returns the colour used by WServ to paint holes in UI layer to reveal the GCE behind.
- * 	The window should have a surface attached.
- * 	If the method is called after the surface has been detached or the window was removed then 
- * 	the previous recorded hole color is returned.
- **/
-TRgb  CWsDynamicResWinBase::GceHoleColor( RWindowBase& aWin)const
-	{
-	if (aWin.WsHandle()==NULL)
-		{
-		return iLastGceHoleColor;
-		}
-	TRgb retVal=aWin.KeyColor();
-	if (retVal==TRgb(0,0))
-		{
-		return iLastGceHoleColor;
-		}
-	else
-		{
-		iLastGceHoleColor=retVal;
-		return retVal;
-		}
-	}
-
-
-/**
-Use the full-screen background window to select a display mode that can use
-alpha (either EColor16MA or EColor16MAP). Record the mode for use in setting all
-other windows.
-@return ETrue if an appropriate mode was selected, EFalse otherwise.
-*/
-TBool CWsDynamicResWinBase::SelectAlphaCompositionMode(TDisplayMode aMode)
-	{
-	// Request EColor16MA, but as long as the actual mode can use alpha, it
-	// doesn't matter too much which one is used.
-	if (iInfoGc==iGc)
-		{
-		iDisplayMode = (TDisplayMode)iBackground.SetRequiredDisplayMode(aMode);
-		iSession.Flush();		// Force switching to the display mode.
-		}
-	return DisplayHasAlpha();
-	}
-
-/**
- * 	Interesting UI pattern used by other GCE tests.
- * 
- * 
- **/
-void CWsDynamicResWinBase::DrawUIContent(RWindow& aWindow)
-	{
-	aWindow.BeginRedraw();
-	CWindowGc* gc=(&aWindow==&iCompare)?iInfoGc:iGc;
-	
-	gc->Activate(aWindow);
-
-	TBool hasAlpha = DisplayHasAlpha();
-
-	// Draw a red-green graduated box in the central portion of the window,
-	// with alpha if available.
-	TPoint start;
-	TPoint end;
-	TInt halfW = KSurfaceWidth / 2;
-	TInt quarterW = halfW / 2;
-	TInt halfH = KSurfaceHeight / 2;
-	TInt quarterH = halfH / 2;
-
-	// Set constant ordinals for non-alpha case.
-	start.iX = quarterW;
-	end.iX = quarterW + halfW;
-
-	for (TInt yy = 0; yy < halfH; yy++)
-		{
-		TInt yval = yy * 255 / (halfH - 1);
-		start.iY = yy + quarterH;
-		end.iY = start.iY;
-
-		if (hasAlpha)
-			{
-			for (TInt xx = 0; xx < halfW; xx++)
-				{
-				TInt xval = xx * 255 / (halfW - 1);
-				start.iX = xx + quarterW;
-				end.iX = start.iX + 1;
-				gc->SetPenColor(TRgb(yval, 255 - yval, 0, xval));
-				gc->DrawLine(start, end);
-				}
-			}
-		else
-			{
-			gc->SetPenColor(TRgb(yval, 255 - yval, 0));
-			gc->DrawLine(start, end);
-			}
-		}
-
-	gc->Deactivate();
-	aWindow.EndRedraw();
-	}
-
-/**
- * 	Causes the given window to be redrawn.
- * 	Doesn't draw anything except the background wipe, when the transparency manager hasn't
- * 
- **/
-void CWsDynamicResWinBase::DrawPlainUI(RWindow& aWindow,TBool aInvalidate,TRgb aWipeColor)
-	{
-	if (CWindowGc* gc=BeginActivateWithWipe(aInvalidate,aWindow,aWipeColor))
-		{
-		//actually does nothing!
-		gc->Deactivate();
-		aWindow.EndRedraw();
-		}
-	}
-/**
- *  	Interesting UI pattern used by other GCE tests.
- * 
- * 
- **/
-void CWsDynamicResWinBase::DrawCross(RWindow& aWindow, TRgb aColor, TInt aThickness)
-	{
-	aWindow.BeginRedraw();
-	CWindowGc* gc=(&aWindow==&iCompare)?iInfoGc:iGc;
-	gc->Activate(aWindow);
-
-	// Draw a red diagonal cross in the window.
-	gc->SetPenColor(aColor);
-	gc->SetPenSize(TSize(aThickness, aThickness));
-	gc->DrawLine(TPoint(0, 0), TPoint(KSurfaceWidth, KSurfaceHeight));
-	gc->DrawLine(TPoint(KSurfaceWidth, 0), TPoint(0, KSurfaceHeight));
-
-	gc->Deactivate();
-	aWindow.EndRedraw();
-	}
-
-/**
- * 	Checks the RGB value
- * 
- * 
- **/
-void CWsDynamicResWinBase::TestPixelL(TPoint aPt, TRgb aColor, TBool aMatch)
-	{
-	TRect screenArea(iScreenDevice->SizeInPixels());
-	if (aPt.iX < screenArea.iTl.iX)
-		{
-		aPt.iX = screenArea.iTl.iX;
-		}
-	else if (aPt.iX >= screenArea.iBr.iX)
-		{
-		aPt.iX = screenArea.iBr.iX - 1;
-		}
-	if (aPt.iY < screenArea.iTl.iY)
-		{
-		aPt.iY = screenArea.iTl.iY;
-		}
-	else if (aPt.iY >= screenArea.iBr.iY)
-		{
-		aPt.iY = screenArea.iBr.iY - 1;
-		}
-
-	TRgb pixel;
-	iScreenDevice->GetPixel(pixel, aPt);
-	if (aMatch)
-		{
-		ASSERT_EQUALS_X(pixel.Internal(), aColor.Internal());
-		}
-	else
-		{
-		ASSERT_NOT_EQUALS_X(pixel.Internal(), aColor.Internal());
-		}
-	}
-
-struct CountColour
-	{
-	TRgb	iColor;
-	TInt	iCount;
-	TBool operator  < (const CountColour& aRhs)const	
-		{	return iColor.Value()<aRhs.iColor.Value();	}
-	
-	CountColour(TRgb	aColor,TInt	aCount=0): 
-			iColor(aColor),iCount(aCount) {}
-	
-	CountColour(const CountColour& aRhs): 
-			iColor(aRhs.iColor),iCount(aRhs.iCount) {}
-	};
-
-void LogColorL(TRgb aPixel,RArray<CountColour>& aColors)
-	{
-	//I am sure one of the find methods would do this, but life is too short!
-	TInt existingIndex;
-	for (existingIndex=0;existingIndex<aColors.Count();existingIndex++)
-		if (aColors[existingIndex].iColor==aPixel)
-			break;
-	if (existingIndex==aColors.Count())
-		aColors.AppendL(CountColour(aPixel,1));
-	else
-		aColors[existingIndex].iCount++;
-	}
-
-/**
- * Tests the outline of the given rectangle to verify that it has the expected inner and outer colors
- * There may be a limited number of other colors present.
- * If the given count of other colors is exceeded then false is returned
- * If the majority of inner and outer edge pixels are not the given colors then returns false
- * If the  colors are repeated on inside and outside then returns false
- * If there are corners then the insides of the corners are also check for outside color
- * Note that the right and bottom edge coordinates are outside the rectangle.
- * Note that I am not performing any safety clipping at present. The rectangle must be on-screen!
- * A negative value for corner size indicates that the window may or may not have corners that size.
- * Only leaves if fatal memory condition!
-**/
-TBool CWsDynamicResWinBase::TestRectL(TRect aRect,TRgb aInnerColor,TInt aOtherInnerColors,TRgb aOuterColor,TInt aOtherOuterColors,TInt aExpectedCornerSize)
-	{
-	if (aRect.iTl.iX<=0 || aRect.iTl.iY<=0)
-		return ETrue;	//can't perform the test against the outside of the screen
-	//quantise the expectation based on the current mode.
-	TDisplayMode displayMode=iScreenDevice->DisplayMode();
-	switch (displayMode)
-		{
-	case EColor4K:
-		aInnerColor=aInnerColor.Color4K(aInnerColor.Color4K());
-		aOuterColor=aOuterColor.Color4K(aOuterColor.Color4K());
-		break;
-	case EColor64K:
-		aInnerColor=aInnerColor.Color64K(aInnerColor.Color64K());
-		aOuterColor=aOuterColor.Color64K(aOuterColor.Color64K());
-		break;
-	case EColor16M:
-	case EColor16MU:
-	case EColor16MA:
-	case EColor16MAP:
-		break;
-	default:
-		ASSERT_EQUALS(EColor16MA,displayMode);		//Can't quantise color for this display mode!
-		}
-
-	RArray<CountColour> innerColors;
-	innerColors.AppendL(aInnerColor);
-	RArray<CountColour> outerColors;
-	outerColors.AppendL(aOuterColor);
-	TInt cornerSize=aExpectedCornerSize>=0?aExpectedCornerSize:-aExpectedCornerSize;
-	//Check outside first!
-	TRgb pixelVal;
-	for(TPoint pixelPos(aRect.iTl.iX-1,aRect.iTl.iY-1);pixelPos.iX<aRect.iBr.iX;pixelPos.iX++)
-		{
-		iScreenDevice->GetPixel(pixelVal, pixelPos);
-		LogColorL(pixelVal,outerColors);
-		}
-	for(TPoint pixelPos(aRect.iTl.iX,aRect.iBr.iY);pixelPos.iX<=aRect.iBr.iX;pixelPos.iX++)
-		{
-		iScreenDevice->GetPixel(pixelVal, pixelPos);
-		LogColorL(pixelVal,outerColors);
-		}
-	for(TPoint pixelPos(aRect.iTl.iX-1,aRect.iTl.iY);pixelPos.iY<=aRect.iBr.iY;pixelPos.iY++)
-		{
-		iScreenDevice->GetPixel(pixelVal, pixelPos);
-		LogColorL(pixelVal,outerColors);
-		}
-	for(TPoint pixelPos(aRect.iBr.iX,aRect.iTl.iY-1);pixelPos.iY<aRect.iBr.iY;pixelPos.iY++)
-		{
-		iScreenDevice->GetPixel(pixelVal, pixelPos);
-		LogColorL(pixelVal,outerColors);
-		}
-	TInt cornerStart=1;
-	if (cornerSize)
-		{
-		cornerStart=cornerSize;
-		if (aExpectedCornerSize>0)
-			{
-			iScreenDevice->GetPixel(pixelVal, aRect.iTl);
-			LogColorL(pixelVal,outerColors);
-			iScreenDevice->GetPixel(pixelVal, TPoint(aRect.iTl.iX,aRect.iBr.iY-1));
-			LogColorL(pixelVal,outerColors);
-			iScreenDevice->GetPixel(pixelVal, TPoint(aRect.iBr.iX-1,aRect.iTl.iY));
-			LogColorL(pixelVal,outerColors);
-			iScreenDevice->GetPixel(pixelVal, TPoint(aRect.iBr.iX-1,aRect.iBr.iY-1));
-			LogColorL(pixelVal,outerColors);
-			}
-		}
-	
-	//test inside edges (excluding 4 corner pixels - do them seperately)
-	for(TPoint pixelPos(aRect.iTl.iX+cornerStart,aRect.iTl.iY);pixelPos.iX<aRect.iBr.iX-cornerStart;pixelPos.iX++)
-		{
-		iScreenDevice->GetPixel(pixelVal, pixelPos);
-		LogColorL(pixelVal,innerColors);
-		}
-	for(TPoint pixelPos(aRect.iTl.iX+cornerStart,aRect.iBr.iY-1);pixelPos.iX<aRect.iBr.iX-cornerStart;pixelPos.iX++)
-		{
-		iScreenDevice->GetPixel(pixelVal, pixelPos);
-		LogColorL(pixelVal,innerColors);
-		}
-	for(TPoint pixelPos(aRect.iTl.iX,aRect.iTl.iY+cornerStart);pixelPos.iY<aRect.iBr.iY-cornerStart;pixelPos.iY++)
-		{
-		iScreenDevice->GetPixel(pixelVal, pixelPos);
-		LogColorL(pixelVal,innerColors);
-		}
-	for(TPoint pixelPos(aRect.iBr.iX-1,aRect.iTl.iY+cornerStart);pixelPos.iY<aRect.iBr.iY-cornerStart;pixelPos.iY++)
-		{
-		iScreenDevice->GetPixel(pixelVal, pixelPos);
-		LogColorL(pixelVal,innerColors);
-		}
-	//the 4 corner cells - not checking the whole corner area...
-	if (aExpectedCornerSize>=0)
-		{
-		iScreenDevice->GetPixel(pixelVal, TPoint(aRect.iTl.iX+cornerSize,aRect.iTl.iY+cornerSize));
-		LogColorL(pixelVal,innerColors);
-		iScreenDevice->GetPixel(pixelVal, TPoint(aRect.iTl.iX+cornerSize,aRect.iBr.iY-1-cornerSize));
-		LogColorL(pixelVal,innerColors);
-		iScreenDevice->GetPixel(pixelVal, TPoint(aRect.iBr.iX-1-cornerSize,aRect.iBr.iY-1-cornerSize));
-		LogColorL(pixelVal,innerColors);
-		iScreenDevice->GetPixel(pixelVal, TPoint(aRect.iBr.iX-1-cornerSize,aRect.iTl.iY+cornerSize));
-		LogColorL(pixelVal,innerColors);
-		}
-	//OK... that has tested all the pixels, now check the result
-	if (innerColors.Count()>aOtherInnerColors+1)
-		return EFalse;
-	if (outerColors.Count()>aOtherOuterColors+1)
-		return EFalse;
-	for (TInt index=1;index<innerColors.Count();index++)
-		if (innerColors[0].iCount<innerColors[index].iCount)
-			{
-			return EFalse;
-			}
-	for (TInt index=1;index<outerColors.Count();index++)
-		if (outerColors[0].iCount<outerColors[index].iCount)
-			{
-			return EFalse;
-			}
-	for (TInt indexIn=1;indexIn<innerColors.Count();indexIn++)
-		for (TInt indexOut=0;indexOut<outerColors.Count();indexOut++)
-			if (innerColors[indexIn].iColor.Value()==outerColors[indexOut].iColor.Value())
-				{
-				return EFalse;
-				}
-	return ETrue;
-	}
-
-TRect CWsDynamicResWinBase::PentCellRect(const TRect& aFullRect,char aStartLetter,char aEndLetter)
-	{
-	if (aEndLetter==0)
-		aEndLetter=aStartLetter;
-	aStartLetter&=0x1f;
-	aEndLetter&=0x1f;
-	TInt startx=(aStartLetter-1)%5;
-	TInt starty=(aStartLetter-1)/5;
-	TInt endx=(aEndLetter-1)%5;
-	TInt endy=(aEndLetter-1)/5;
-	if (starty>endy)
-		{	//swap			//	s		e
-		starty-=endy;		//	s-e
-		endy+=starty;		//			s					
-		starty=endy-starty;	//	e
-		}
-	if (startx>endx)
-		{	//swap			//	s		e
-		startx-=endx;		//	s-e
-		endx+=startx;		//			s					
-		startx=endx-startx;	//	e
-		}
-	TSize fullSize=aFullRect.Size();
-	return TRect(	aFullRect.iTl.iX+fullSize.iWidth*startx/5,
-					aFullRect.iTl.iY+fullSize.iHeight*starty/5,
-					aFullRect.iTl.iX+fullSize.iWidth*(endx+1)/5,
-					aFullRect.iTl.iY+fullSize.iHeight*(endy+1)/5
-				);
-	}
--- a/windowing/windowserver/tdynamicres/src/wsdynamicresbase.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,603 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include <w32std.h>
-#include "wsdynamicresbase.h"
-#include "teflogextensions.h"
-#include "globalsettings.h"
-#include <bitdraw.h>
-#include <bitdrawinterfaceid.h>
-#include <bitdrawsurface.h>
-#include <graphics/surfaceconfiguration.h>
-#include "regionextend.h"
-
-
-#if defined(__X86GCC__)
-extern "C" TInt atexit(void (*function)(void))
-	{
-	return KErrNone;
-	}
-#endif
-
-CWsDynamicResBase::CWsDynamicResBase():
-	iUtility(this)
-	{
-	}
-
-CWsDynamicResBase::~CWsDynamicResBase()
-	{
-	}
-
-/**
-Common set up code for all tests.
-
-Creates the session and window group for further windows, plus a simple white
-background to obscure any unwanted stuff behind the test. Sets up the surface
-update session and surface manager, to work with surfaces. Creates a screen
-device for use in the tests.
-*/
-void CWsDynamicResBase::SetupL()
-	{
-	SetupL(EFalse);
-	}
-void CWsDynamicResBase::SetupL(TBool aUseOtherScreenForInfo)
-	{
-	CWsDynamicResWinBase::SetupL(aUseOtherScreenForInfo);
-	
-	
-//clean-up if previous test abended
-	if (PostTestCleanupInstance().iSharedUtility)
-	{
-//Temp removed - may be causing ONB fails!
-//	if (PostTestCleanupInstance().iSharedUtility->DestroyAll())
-//		{
-//		INFO_PRINTF1(_L("Destroyed some surfaces from previous test."));
-//
-//		}
-	}
-	if (!PostTestCleanupInstance().iCleanedUpOnExit)
-	PostTestCleanupInstance().iCleanedUpOnExit=EFalse;
-	
-	if (!GCEIsSupported())
-		{
-		INFO_PRINTF1(_L("Some Setup skipped: GCE support is not loaded"));
-		return;
-		}
-
-	TRAPD(err_FailedToCreateSurfaceUtility, iUtility = CSurfaceUtility::NewL( PostTestCleanupInstance().iSharedUtility));
-	ASSERT_EQUALS(err_FailedToCreateSurfaceUtility,KErrNone);
-
-	
-	}
-
-/**
-Common tear down code for all tests.
-
-Windows, group and session created are closed. Screen device is destroyed.
-Surfaces, manager and update session are closed.
-*/
-void CWsDynamicResBase::TearDownL()
-	{
-	CWsDynamicResWinBase::TearDownL();
-	delete iUtility();
-	PostTestCleanupInstance().iCleanedUpOnExit=ETrue;
-	//Pause(1000);
-	}
-/**
- * Note that this is not the ideal mechanism.
- * A derived class may thinks its TearDown is safe to do from delete, but in the class it is derived from it may not be safe
- **/
-void CWsDynamicResBase::TearDownFromDeleteL()	
-	{
-	CWsDynamicResBase::TearDownL();	
-	}
-
-//Allocating an instance of surface utility here means all test code instances will share the same instance of the utility class.
-// Owns the singleton
-/*static*/ const CWsDynamicResBase::TPostTestCleanup& CWsDynamicResBase::PostTestCleanupInstance()
-	{
-	static 
-	class RPostTestCleanup:public TPostTestCleanup
-		{
-		public:
-		RPostTestCleanup()
-			{
-			iSharedUtility=NULL;
-			iCleanedUpOnExit=ETrue;
-			}
-		~RPostTestCleanup()
-			{
-	// I want to cleanly release the surface utility, but at this point the threads have already been pulled down!
-	//		if (iSharedUtility)
-	//			delete iSharedUtility;
-			iSharedUtility=NULL;	//avoid phoenix behaviour
-			}
-		}	staticInstance;
-		return staticInstance;
-	}
-
-void	CWsDynamicResBase::TPostTestCleanup::CreateSharedUtilityL()const
-	{
-	if (iSharedUtility==NULL)
-		iSharedUtility=CSurfaceUtility::NewL();
-	}
-
-/**
-Pause for the given number of milliseconds.
-
-@param aMilliseconds	Time to wait in milliseconds.
-*/
-void CWsDynamicResBase::Pause(TInt aMilliseconds)
-	{
-	User::After(TTimeIntervalMicroSeconds32(aMilliseconds * 1000));
-	}
-
-/**	Creates the normal scenario used by these tests.
- *  With a large window behind and small window in front.
- *  If the windows already exist then they are just repositioned and redrawn.
- * 	@param	aOuterRect	Position of back window
- * 	@param	aOuterColor	Background colour for back window
- * 	@param	aInnerRect	Position of front window
- * 	@param	aInnerColor	Background colour for front window
- * 
- **/
-void CWsDynamicResBase::MakeTestWindowPairL(TRect aOuterRect,TRgb aOuterColor,TRect aInnerRect,TRgb aInnerColor)
-	{
-	if (!iTestBack.WsHandle())
-		{
-		iTestBack=RWindow(iSession);
-		ASSERT_EQUALS_X(iTestBack.Construct(iGroup, ++iWindowHandle), KErrNone);
-#ifdef  FLICKER
-		iTestBack.Activate();
-#endif
-		iTestBack.SetRequiredDisplayMode(iDisplayMode);
-		iTestBack.SetBackgroundColor(aOuterColor);
-		iTestBack.SetExtent(aOuterRect.iTl,aOuterRect.Size());
-#ifndef FLICKER
-		iTestBack.Activate();
-#endif
-		}
-	else
-		{
-		iTestBack.SetRequiredDisplayMode(iDisplayMode);
-		iTestBack.SetBackgroundColor(aOuterColor);
-		iTestBack.SetExtent(aOuterRect.iTl,aOuterRect.Size());
-		}
-	iTestBack.BeginRedraw();
-	ActivateWithWipe(iGc,iTestBack,aOuterColor);
-	iGc->Deactivate();
-	iTestBack.EndRedraw();
-	iTestBack.SetVisible(ETrue);
-	
-	if (!iTestFront.WsHandle())
-		{
-		iTestFront=RWindow(iSession);
-		ASSERT_EQUALS_X(iTestFront.Construct(iGroup, ++iWindowHandle), KErrNone);
-#ifdef FLICKER
-		iTestFront.Activate();
-#endif
-		iTestFront.SetRequiredDisplayMode(iDisplayMode);
-		iTestFront.SetBackgroundColor(aInnerColor);	
-		iTestFront.SetExtent(aInnerRect.iTl,aInnerRect.Size());
-
-#ifndef FLICKER
-		iTestFront.Activate();
-#endif
-		}
-	else
-		{
-		iTestFront.SetRequiredDisplayMode(iDisplayMode);
-		iTestFront.SetBackgroundColor(aInnerColor);
-		iTestFront.SetExtent(aInnerRect.iTl,aInnerRect.Size());
-		}
-	
-	DrawPlainUI(iTestFront,EFalse,aInnerColor);
-	iTestFront.SetVisible(ETrue);
-	
-	}
-
-void CWsDynamicResBase::LargerTestWindow(TInt aPercentOfBack)
-	{
-	TRect newPos=iTestPos;
-	TSize backSize=iTestPos.Size();
-	newPos.Grow((aPercentOfBack-100)*backSize.iWidth/200,(aPercentOfBack-100)*backSize.iHeight/200);
-	iCenteredFrontWinRect=newPos;
-	if (iTestFront.WsHandle())
-		{
-		iTestFront.SetExtent(newPos.iTl,newPos.Size());
-		}
-	
-	}
-
-/** Destroys some or all of the test windows so the test can loop (or test the state after destruction.
- *  The windows are destroyed when the test exits normally.
- * 	Child windows are automatically killed when parent window is killed!
- * 
- **/
-void CWsDynamicResBase::DestroyTestWindowPair(TBool aKillTestBack,TBool aKillTestFront,TBool aKillTestChildren)
-	{
-	if (aKillTestBack && iTestBack.WsHandle())
-		{
-		iTestBack.Close();
-		}
-	if (aKillTestFront && iTestFront.WsHandle())
-		{
-		iTestFront.Close();
-		}
-	if (aKillTestChildren)
-		{
-		if (iTestChild.WsHandle())
-			{
-			iTestChild.Close();
-			}
-		if (iTestSecondChild.WsHandle())
-			{
-			iTestSecondChild.Close();
-			}
-		}
-	}
-/**	Creates a child window inside the front window of the usual test scenario
-*  With a large window behind and small window in front.
- *  If the windows already exist then they are just repositioned and redrawn.
- * 	@param	aOuterRect	Position of back window
- * 	@param	aOuterColor	Background colour for back window
- * 	@param	aInnerRect	Position of front window
- * 	@param	aInnerColor	Background colour for front window
- * 	@param	aChildRect	Position of child window
- * 	@param	aChildColor	Background colour for child window
- * 	@param	aSecondChildRect	Position of Second child window
- * 	@param	aSecondChildColor	Background colour for Second child window
- * 
- **/
-void CWsDynamicResBase::MakeTestWindowTripleL(TRect aOuterRect,TRgb aOuterColor,TRect aInnerRect,TRgb aInnerColor,TRect aChildRect,TRgb aChildColor,TRect aSecondChildRect,TRgb aSecondChildColor)
-	{
-	MakeTestWindowTripleL(aOuterRect,aOuterColor,aInnerRect,aInnerColor,aChildRect,aChildColor);
-
-	MakeExtraChildWindowL(iTestChild,aSecondChildRect,aSecondChildColor);
-	}
-
-/**	Creates a child window inside the front window of the usual test scenario
-*  With a large window behind and small window in front.
- *  If the windows already exist then they are just repositioned and redrawn.
- * 	@param	aOuterRect	Position of back window
- * 	@param	aOuterColor	Background colour for back window
- * 	@param	aInnerRect	Position of front window
- * 	@param	aInnerColor	Background colour for front window
- * 	@param	aChildRect	Position of child window
- * 	@param	aChildColor	Background colour for child window
- *  @param	aSecondChildRect	Position of second child window
- * 	@param	aSecondChildColor	Background colour for second child window
- * 
- **/
-void CWsDynamicResBase::CreateTestWindowQuadL(TRect aOuterRect,TRgb aOuterColor,TRect aInnerRect,TRgb aInnerColor,TRect aChildRect,TRgb aChildColor,TRect aSecondChildRect,TRgb aSecondChildColor)
-	{
-	MakeTestWindowTripleL(aOuterRect,aOuterColor,aInnerRect,aInnerColor,aChildRect,aChildColor);
-	
-	MakeExtraChildWindowL(iTestFront,aSecondChildRect,aSecondChildColor);
-	}
-
-void CWsDynamicResBase::MakeExtraChildWindowL(const RWindowBase& aFromParent,TRect aChildRect,TRgb aChildColor)
-	{
-	ASSERT(aFromParent.WsHandle());
-	if (!iTestSecondChild.WsHandle())
-		{
-		iTestSecondChild=RWindow(iSession);
-		ASSERT_EQUALS_X(iTestSecondChild.Construct(aFromParent, ++iWindowHandle), KErrNone);
-		iTestSecondChild.SetRequiredDisplayMode(iDisplayMode);
-		}
-	iTestSecondChild.SetBackgroundColor(aChildColor);
-	iTestSecondChild.SetExtent(aChildRect.iTl,aChildRect.Size());
-	iTestSecondChild.Activate();
-	iTestSecondChild.BeginRedraw();
-	iGc->Activate(iCompare);
-	iGc->SetBrushColor(iBlue);
-	iGc->Clear();
-	iGc->Deactivate();
-	iTestSecondChild.EndRedraw();
-	iTestSecondChild.SetVisible(ETrue);
-	}
-
-CWsDynamicResBase::LoopingGcPtr  CWsDynamicResBase::LoopBeginActivateWithWipe(const TRegion& aRegion,RWindow& aWin,TRgb aColor)
-	{
-	InvalidateRegion(aRegion,aWin);
-	return LoopingGcPtr(aRegion,aWin,aColor,GcForWindow(aWin));
-	}
-
-//This gets called each itteration of the while loop, and is used to step the rectangle count!
-void CWsDynamicResBase::LoopingGcPtr::operator ++()
-	{
-	iPass++;
-	if (iPass<iRegion.Count())
-		{	//Invalidate all the rectangles in the region
-		iWin.BeginRedraw(iRegion[iPass]);
-		CWsDynamicResWinBase::ActivateWithWipe(iGc,iWin,iColor);
-//		return true;
-		}
-	else
-		{
-		iGc=NULL;
-//		return false;
-		}
-	}
-
-CWindowGc*	CWsDynamicResBase::BeginActivateWithWipe(TBool aInvalidate,RWindow& aWin,TRgb aColor)
-	{
-	return CWsDynamicResWinBase::BeginActivateWithWipe(aInvalidate,aWin,aColor);
-	}
-
-CWindowGc*	CWsDynamicResBase::BeginActivateWithWipe(TBool aInvalidate,TRect aRect,RWindow& aWin,TRgb aColor)
-	{
-	return CWsDynamicResWinBase::BeginActivateWithWipe(aInvalidate,aRect,aWin,aColor);
-	}
-
-CWindowGc*	CWsDynamicResBase::BeginActivateWithWipe(const TRegion& aRegion,RWindow& aWin,TRgb aColor)
-	{
-	return CWsDynamicResWinBase::BeginActivateWithWipe(aRegion,aWin,aColor);
-	}
-
-/**	Creates a child window inside the front window of the usual test scenario
-*  With a large window behind and small window in front.
- *  If the windows already exist then they are just repositioned and redrawn.
- * 	@param	aOuterRect	Position of back window
- * 	@param	aOuterColor	Background colour for back window
- * 	@param	aInnerRect	Position of front window
- * 	@param	aInnerColor	Background colour for front window
- * 	@param	aChildRect	Position of child window
- * 	@param	aChildColor	Background colour for child window
- * 
- **/
-void CWsDynamicResBase::MakeTestWindowTripleL(TRect aOuterRect,TRgb aOuterColor,TRect aInnerRect,TRgb aInnerColor,TRect aChildRect,TRgb aChildColor)
-	{
-	MakeTestWindowPairL(aOuterRect,aOuterColor,aInnerRect,aInnerColor);
-	ASSERT(iTestFront.WsHandle());
-	
-	if (!iTestChild.WsHandle())
-		{
-		iTestChild=RWindow(iSession);
-		ASSERT_EQUALS_X(iTestChild.Construct(iTestFront, ++iWindowHandle), KErrNone);
-		iTestChild.SetRequiredDisplayMode(iDisplayMode);
-		}
-	iTestChild.SetBackgroundColor(aChildColor);
-	iTestChild.SetExtent(aChildRect.iTl,aChildRect.Size());
-	iTestChild.Activate();
-	iTestChild.BeginRedraw();
-	iGc->Activate(iCompare);
-	iGc->SetBrushColor(iBlue);
-	iGc->Clear();
-	iGc->Deactivate();
-	iTestChild.EndRedraw();
-	iTestChild.SetVisible(ETrue);
-	}
-/**	
- * 	Generates a valid surfaceID for the current display mode.
- * 	This is then used in negative testing.
- * 
- * 
- **/
-void CWsDynamicResBase::UISurfaceL(TSurfaceId& aSurfaceId) const
-	{
-	CFbsDrawDevice* screenDevice=NULL;
-	TDisplayMode displayMode=iScreenDevice->DisplayMode();
-	screenDevice = CFbsDrawDevice::NewScreenDeviceL(TGlobalSettings::Instance().iScreen, displayMode);
-	CleanupStack::PushL(screenDevice);
-	TAny* p=NULL;
-	User::LeaveIfError(screenDevice->GetInterface(KSurfaceInterfaceID, p));
-	MSurfaceId* uiSurface = static_cast<MSurfaceId*>(p);
-	uiSurface->GetSurface(aSurfaceId);
-	CleanupStack::PopAndDestroy(screenDevice);
-	}
-
-/**
-Common set up code for creating a surface based window.
-
-Given window and surface objects and a color: creates the window and surface,
-sets the window to a default size (the same as the surface), sets the background
-to the bitwise inverse of the given color, sets the surface as the background,
-fills the surface with the color and completes a redraw to prevent an event.
-
-@param aWindow	The window object, connected to a session.
-@param aSurface	The surface object, to be initialized.
-@param aColor	The color to fill the surface with.
-*/
-void CWsDynamicResBase::CommonSurfaceWindowSetupL(RWindow& aWindow, TSurfaceId& aSurface, const TRgb& aColor)
-	{
-	TInt err = KErrNone;
-
-	TRAP(err, aSurface = iUtility->CreateSurfaceL(TSize(KSurfaceWidth, KSurfaceHeight), 
-			KSurfaceFormat, KSurfaceWidth * KBytesPerPixel));
-	PRINT_ON_ERROR2_L(err, _L("Failed to create surface: %d"), err);
-	ASSERT_EQUALS_X(aWindow.Construct(iGroup, ++iWindowHandle), KErrNone);
-
-	aWindow.SetRequiredDisplayMode(iDisplayMode);
-	aWindow.SetExtent(TPoint(0, 0), TSize(KSurfaceWidth, KSurfaceHeight));
-	aWindow.SetBackgroundColor(TRgb(aColor.Value() ^ 0xFFFFFF));
-
-	ASSERT_EQUALS_X(aWindow.SetBackgroundSurface(aSurface), KErrNone);
-
-	TRAP(err, iUtility->FillSurfaceL(aSurface, aColor));
-	PRINT_ON_ERROR2_L(err, _L("Failed to fill surface: %d"), err);
-	DrawUIContent(aWindow);
-	}
-
-/**
-Common set up code for resizing tests.
-
-Similar to the common surface window code, but filling the surface with a grid
-instead of a solid color. The grid lines are always black. Also, the background
-color is always blue.
-*/
-void CWsDynamicResBase::ResizeTestCommonSetupL(RWindow& aWindow, const TRgb& aColor)
-	{
-	// Session and group created in SetUpL()
-
-	TSurfaceId surface;
-	TInt err = KErrNone;
-
-	TRAP(err, surface = iUtility->CreateSurfaceL(TSize(KSurfaceWidth, KSurfaceHeight), 
-			KSurfaceFormat, KSurfaceWidth * KBytesPerPixel));
-	PRINT_ON_ERROR2_L(err, _L("Failed to create surface: %d"), err);
-
-	ASSERT_EQUALS_X(aWindow.Construct(iGroup, ++iWindowHandle), KErrNone);
-
-	aWindow.SetRequiredDisplayMode(iDisplayMode);
-	aWindow.SetExtent(TPoint(0, 0), TSize(KSurfaceWidth, KSurfaceHeight));
-	aWindow.SetBackgroundColor(iBlue);
-	ASSERT_EQUALS_X(aWindow.SetBackgroundSurface(surface), KErrNone);
-
-	TRAP(err, iUtility->GridFillSurfaceL(surface, aColor, TRgb(0)));
-	PRINT_ON_ERROR2_L(err, _L("Failed to grid fill surface: %d"), err);
-	DrawUIContent(aWindow);
-	}
-
-CFbsBitmap* CWsDynamicResBase::RotateBitmapLC(const CFbsBitmap* aSrcBitmap)
-	{
-	CFbsBitmap* rv=new CFbsBitmap;
-	CleanupStack::PushL(rv);
-	TSize srcSize=aSrcBitmap->SizeInPixels();
-	rv->Create(TSize(srcSize.iHeight,srcSize.iWidth),EColor16MA);
-	TRgb* linestore=new TRgb[srcSize.iHeight];
-	TPtr8 buff((unsigned char*)linestore,srcSize.iHeight*sizeof(TRgb),srcSize.iHeight*sizeof(TRgb));
-	for (TInt col=0;col<aSrcBitmap->SizeInPixels().iWidth;col++)
-		{
-		for (TInt row=0,brow=srcSize.iHeight-1;row<srcSize.iHeight;row++,brow--)
-			{
-			aSrcBitmap->GetPixel(linestore[row],TPoint(col,brow));
-			}
-		rv->SetScanLine(buff,col);
-		}
-	delete[] linestore;
-	return rv;
-	}
-
-
-//
-//
-//
-// Pattern checking. Is a given pattern still present?
-// To make life interesting, the pattern is stored backwards!
-// The pattern is fibonnacci sequence masked to byte:
-//	1	2	3	5	8	13	21	34	55	89	144	233	121
-//	98	219	61	24	85	109	194	47	241	32	17	49	66
-//	115	181	40	221	5	226	231	201	176	121	41	162
-//
-//
-void Pattern::Fill(void* aTrg,TInt aOffset,TInt aLength)
-	{
-	unsigned char* ptr=(unsigned char*)aTrg;
-	TInt a=0;
-	TInt b=1;
-	while (--aLength)
-		{
-			TInt c=a+b;
-			*(ptr+aOffset+aLength)=c&0xff;
-			a=b;
-			b=c;
-		}
-	}
-TBool Pattern::Check(void* aTrg,TInt aOffset,TInt aLength)
-	{
-	unsigned char* ptr=(unsigned char*)aTrg;
-	TInt a=0;
-	TInt b=1;
-	while (--aLength)
-		{
-			TInt c=a+b;
-			if (*(ptr+aOffset+aLength)!=c&0xff)
-				return EFalse;
-			a=b;
-			b=c;
-		}
-	return ETrue;
-	}
-TBool Pattern::CheckVal(void* aTrg,TInt aOffset,TInt aLength,char val)
-	{
-	unsigned char* ptr=(unsigned char*)aTrg;
-	while (--aLength)
-		{
-			if (*(ptr+aOffset+aLength)!=val&0xff)
-				return EFalse;
-		}
-	return ETrue;
-	}
-
-//I have removed these only because they use TRegionExtend
-//
-//TInt	CWsDynamicResBase::RegionDiffForUiLayer(TInt aUiLayer)
-//	{
-//	EWsDebugGetUILayerConfig,		//return: TSurfaceConfig		//Index UI layer via EWsDebugArgLayerMask
-//	EWsDebugGetUILayerBase,			//return: TRect[]
-//	
-//	RRegion 	layerRegion;
-//	TInt layerRegionLen=iSession.DebugInfo(EWsDebugGetUILayerBase,iSession.ObjInd(0,aUiLayer),layerRegion);
-//	if (layerRegionLen==KErrCancel)
-//		return TRegionExtend::EExact;
-//	ASSERT_TRUE(layerRegionLen>=0);
-//	TBuf8<sizeof(TSurfaceConfiguration)> configBuf(sizeof(TSurfaceConfiguration));
-//	const TSurfaceConfiguration* config;
-//	TInt configLen=iSession.DebugInfo(EWsDebugGetUILayerConfig,iSession.ObjInd(0,aUiLayer),configBuf,config);
-//	ASSERT_TRUE(configLen>=0);
-//	TRect layerExtent;
-//	config->GetExtent(layerExtent);
-//	TInt retVal=TRegionExtend::Cast(layerRegion).TestDifference(layerExtent.Size());
-//	layerRegion.Close();
-//	return retVal;
-//	}
-//CWsDynamicResBase::FastPathMode	CWsDynamicResBase::DeduceUiFastPathMode()
-//	{
-//	TInt blendedRegionState=RegionDiffForUiLayer(0);
-//	TInt opaqueRegionState=RegionDiffForUiLayer(1);
-//	if (blendedRegionState&TRegionExtend::ENoIntersect)
-//		{
-//		if (opaqueRegionState&TRegionExtend::ENoIntersect)
-//			{
-//			return EFpExternalOpaque;			//fullscreen fast-path external surface
-//			}
-//		else
-//			if (opaqueRegionState&TRegionExtend::EAdd)
-//				{
-//				return (FastPathMode)(EFpUiOpaque|EFpUiRegions);	//windowed max-opt no blending
-//				}
-//			else
-//				{
-//				return EFpUiOpaque;		//full-screen fastpath
-//				}
-//		}
-//	else
-//		{
-//		if (opaqueRegionState&TRegionExtend::ENoIntersect)
-//			{
-//			if (blendedRegionState&TRegionExtend::EAdd)
-//				{
-//				return (FastPathMode)(EFpUiBlended|EFpUiRegions);	//windowed max-opt no opaque
-//				}
-//			else
-//				{
-//				return (EFpUiBlended);	//full-screen blended
-//				}
-//			}
-//		else
-//			{
-//			if ((blendedRegionState|opaqueRegionState)&TRegionExtend::EAdd)
-//				{
-//				return (FastPathMode)(EFpUiComplex|EFpUiRegions);	//moxed blending, opaque and external max optimisation
-//				}
-//			else
-//				{
-//				return EFpUiComplex;	//Error! blend and opaque both enabled and full-screen!
-//				}
-//			}
-//		
-//		}
-//	}
--- a/windowing/windowserver/tdynamicres/src/wsdynamicresbasic.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4540 +0,0 @@
-// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
-*/
-#include "wsdynamicresbasic.h"
-#include <test/extendtef.h>
-#include "globalsettings.h"
-#include <w32debug.h>
-#include <w32stdgraphic.h>
-#include "regionextend.h"
-#include <fbs.h>
-#include <e32svr.h>
-#include <u32hal.h>
-#include <graphics/surfaceconfiguration.h>
-#include "surfaceutility.h"
-#include <graphics/testscreencapture.h>
-
-//verify which base code is available to the test
-#include <dispchannel.h>
-#if (!defined(K_DISPLAY_CH_MAJOR_VERSION_NUMBER) && !defined(K_DISPLAY_CH_MINOR_VERSION_NUMBER))
-#define MODE_CHANGE_BASE_FUNCTIONALITY_NOT_PRESENT_IN_HEADER
-#endif
-
-
-//#define VISIBLE_PAUSES 1000
-#define OVERLAPPING_CELL	0	//'m'	//0 indicates cells do not overlap
-/*
- * CWsGceTestPlaceSurfExtra implementation
- * 
- * 
- * 
- * 
- */
-CWsDynamicResBasic::CWsDynamicResBasic()
-{
-}
-
-CWsDynamicResBasic::~CWsDynamicResBasic()
-{
-}
-
-void CWsDynamicResBasic::SetupL()
-	{
-	MyBase::SetupL();
-	}
-void CWsDynamicResBasic::TearDownL()
-	{
-	MyBase::TearDownL();
-	
-	}
-void CWsDynamicResBasic::TearDownFromDeleteL()
-	{
-	MyBase::TearDownFromDeleteL();
-	}
-
-
-CTestSuite* CWsDynamicResBasic::CreateSuiteL( const TDesC& aName )
-	{
-	//Create the surface manager here, before the test suite creates additional threads
-	if (GCEIsSupportedStatic())
-		{
-		TRAP_IGNORE(PostTestCleanupInstance().CreateSharedUtilityL());
-		}
-	
-	SUB_SUITE_OPT(CWsDynamicResBasic,NULL);
-
-		//BASIC
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0001L);
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0002L);
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0003L);
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0004L);
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0005L);
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0006L);
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0007L);
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0008L);
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0009L);
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0010L);	//only run on screen 1
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0011L);
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0012L);	//only run on screen 0
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0013L);
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0014L);	//only run on screen 1
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0015L);	//only run with no scaling
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0016L);	//only run with anisotropic scaling
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0017L);	//only run with integer scaling
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0018L);
-
-		ADD_TEST_STEP_PARAM_BOOL(GRAPHICS_WSERV_DYNAMICRES_0021L);	//only run on screen 1
-		
-		//OOM
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0031L);
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0032L);
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0033L);
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0034L);	//dont run with no scaling on screen 0
-
-		//SCREEN CAPTURE
-		ADD_TEST_STEP_PARAM_BOOL(GRAPHICS_WSERV_DYNAMICRES_0041L);
-		ADD_TEST_STEP_PARAM_BOOL(GRAPHICS_WSERV_DYNAMICRES_0042L);
-		
-		//DYNAMIC SCREEN MODE - only run these with no scaling and isotropic scaling
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0051L);	
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0052L);	//only run on screen 1 (multiple resolutions)
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0053L);
-
-		//DEFECT
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0101L);
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0102L);
-
-	END_SUITE;
-	}
-
-#define LOG_AND_PANIC_IF_NOT_GCE											\
-		{																	\
-		if (!GCEIsSupported())												\
-			{																\
-			INFO_PRINTF1(_L("Test skipped: GCE support is not loaded"));	\
-			User::Panic(_L("GCE.Wrong.Mode"),1);							\
-			return;															\
-			}																\
-		}
-
-CWsDisplayEvent::CWsDisplayEvent(RWsSession *aWs):
-CActive(EPriorityStandard), iWs(aWs), iConfigSpinner(0), iResListSpinner(0),iReceivedEventCount(0), 
-iReceivedPointerEventCount(0), iPointerPosTestPass(ETrue) 
-	{
-	CActiveScheduler::Add(this);
-	}
-CWsDisplayEvent::~CWsDisplayEvent()
-	{
-	Cancel();
-	}
-
-void CWsDisplayEvent::DoCancel()
-	{
-	iWs->EventReadyCancel();
-	}
-
-void CWsDisplayEvent::Request()
-	{
-	iWs->EventReady(&iStatus);
-	SetActive();
-	}
-
-void CWsDisplayEvent::RunL()
-	{
-	TWsEvent event;
-	iWs->GetEvent(event);
-	
-	if(iStatus == KErrNone)
-		{
-		switch(event.Type())
-			{
-			case EEventScreenDeviceChanged:
-				{
-				iReceivedDeviceEventCount++;
-				}
-			case EEventPointer:
-				{
-				iReceivedPointerEventCount++;
-				TPointerEvent* ptEvent = event.Pointer();
-				//make 1 pixels distance allowance, as non integer scalling from composition to app may occur
-				//1 pixels allowance because we never scale greater than 2 times
-				if(ptEvent->iPosition.iX < iPointerPos.iX - 1 && ptEvent->iPosition.iX > iPointerPos.iX + 1
-						&& ptEvent->iPosition.iY < iPointerPos.iY - 1 &&ptEvent->iPosition.iY > iPointerPos.iY + 1)
-					{
-					iPointerPosTestPass = EFalse;
-					}
-				}
-			case EEventDisplayChanged:
-				{
-				iConfigSpinner = event.DisplayChanged()->iConfigurationChangeId;
-				iResListSpinner = event.DisplayChanged()->iResolutionListChangeId;
-				iReceivedEventCount++;
-				}
-				break;
-			default:
-				break;
-			}
-		}
-	else
-		User::Leave(iStatus.Int());
-	
-	Request();
-	}
-
-CEventTimer* CEventTimer::NewL()
-	{
-	CEventTimer* self = new (ELeave) CEventTimer;
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
-	}
-      
-void CEventTimer::ConstructL()
-	{
-	User::LeaveIfError(iTimer.CreateLocal());
-	CActiveScheduler::Add(this);
-	}
- 
-CEventTimer::CEventTimer() : CActive(EPriorityStandard)
-	{
-	
-	}
-
-CEventTimer::~CEventTimer()
-	{
-	Cancel();
-	iTimer.Close();
-	}
-
-void CEventTimer::DoCancel()
-	{
-	iTimer.Cancel();
-	CActiveScheduler::Stop();
-	}
-
-void CEventTimer::RunL()
-	{
-	CActiveScheduler::Stop();
-	}
-
-void CEventTimer::Wait(TInt aDelay)
-	{
-	iTimer.After(iStatus, aDelay);
-	SetActive();
-	CActiveScheduler::Start();
-	}
-
-//Set display state to normal and to the first decent resolution
-//A failed test could leave it in a bad state
-void CWsDynamicResBasic::ResetScreens()
-	{
-	Pause(1000);
-#ifndef MODE_CHANGE_BASE_FUNCTIONALITY_NOT_PRESENT_IN_HEADER
-	TInt displayState = ENormalResolution; 
-	UserSvr::HalFunction(EHalGroupDisplay | (iScreenDevice->GetScreenNumber()<<16), EDisplayHalSetDisplayState, &displayState, NULL);
-#endif
-	MDisplayControl* interface = static_cast<MDisplayControl*>
-				(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-	ASSERT_TRUE(interface);
-	
-	RArray<TInt> appModeIndexList;
-	TInt currMode=iScreenDevice->CurrentScreenMode();
-	iScreenDevice->GetScreenSizeModeList(&appModeIndexList);
-	if (appModeIndexList[0]!=currMode)
-		{
-		iScreenDevice->SetAppScreenMode(appModeIndexList[0]);
-		iScreenDevice->SetScreenMode(appModeIndexList[0]);
-		}
-	appModeIndexList.Close();
-	
-	TInt resolutions = interface->NumberOfResolutions();
-	ASSERT_TRUE (resolutions > 0);
-	RArray<MDisplayControl::TResolution> resolutionList1;
-	TInt error = interface->GetResolutions(resolutionList1);
-	ASSERT_EQUALS(error,KErrNone);
-	ASSERT_EQUALS(resolutionList1.Count(), resolutions);
-	TDisplayConfiguration config;
-	TInt goodRes=0;
-	if (resolutionList1[goodRes].iPixelSize==TSize())
-		{
-		goodRes++;
-		ASSERT_TRUE(resolutions>goodRes);		//First res was blank, and no more to choose!
-		}
-	config.SetResolution(resolutionList1[goodRes].iPixelSize);
-	error=interface->SetConfiguration(config);
-	ASSERT_EQUALS(error,KErrNone);
-	resolutionList1.Close();
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0001L
-@SYMTestCaseDesc		WSERV Screen Device GetInterface returns known interface
-@SYMREQ					REQ10325
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPriority		1
-@SYMTestPurpose			Basic classic behaviour
-@SYMTestActions			
-	Call GetInterface with a well known GUID
-@SYMTestExpectedResults	
-	Returns a pointer
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0001L()
-	{
-	LOG_AND_PANIC_IF_NOT_GCE;
-	MakeTitleAndCompareWindowsL(_L("GRAPHICS_WSERV_DYNAMICRES_0001L"),_L("Basic Dynamic Resolution test"));
-	
-	MDisplayControlBase* interface1 = static_cast<MDisplayControlBase*>
-			(iScreenDevice->GetInterface(MDisplayControlBase::ETypeId));
-	ASSERT_TRUE(interface1);
-	
-	MDisplayControl* interface2 = static_cast<MDisplayControl*>
-			(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-	ASSERT_TRUE(interface2);
-	
-	MDisplayMappingBase* interface3 = static_cast<MDisplayMappingBase*>
-			(iScreenDevice->GetInterface(MDisplayMappingBase::ETypeId));
-	ASSERT_TRUE(interface3);
-	
-	MDisplayMapping* interface4 = static_cast<MDisplayMapping*>
-			(iScreenDevice->GetInterface(MDisplayMapping::ETypeId));
-	ASSERT_TRUE(interface4);
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0002L
-@SYMTestCaseDesc		Basic test for NumberOfResolutions
-@SYMREQ					REQ10328
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPriority		1
-@SYMTestPurpose			NumberOfResolutions returns correctly
-@SYMTestActions			
-	GetInterface
-	then call NumberOfResolutions.
-@SYMTestExpectedResults	
-	It shouldn't return KErrNotSupported
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0002L()
-	{
-	LOG_AND_PANIC_IF_NOT_GCE;
-	MDisplayControl* interface = static_cast<MDisplayControl*>
-				(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-	ASSERT_TRUE(interface);
-	TInt resolutions = interface->NumberOfResolutions();
-	ASSERT_TRUE (resolutions != KErrNotSupported);
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0003L
-@SYMTestCaseDesc		Basic test for GetResolutions
-@SYMREQ					REQ10328
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPriority		
-@SYMTestPurpose			Check GetResolutions returns a valid TSize RArray
-@SYMTestActions			
-	GetInterface
-	Call NumberOfResolutions
-	Create an array and garbage fill based on amount of resolutions
-	Call GetResolutions on this array
-	Create an array (dont garbage fill)
-	Call GetResolutions on this empty array
-	Create an array with smaller size than required
-	Call GetResolutions on this array
-	Create an array with larger size than required
-	Call GetResolutions on this array
-@SYMTestExpectedResults	
-	For both GetResolutions calls, it should allocate memory if needed, and fill
-	with correct sizes
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0003L()
-	{
-	LOG_AND_PANIC_IF_NOT_GCE;
-	TInt count;
-	TInt error;
-	
-	MDisplayControl* interface = static_cast<MDisplayControl*>
-				(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-	ASSERT_TRUE(interface);
-	
-	TInt resolutions = interface->NumberOfResolutions();
-	ASSERT_TRUE (resolutions > 0);
-	
-	RArray<MDisplayControl::TResolution> resolutionList1;
-	for (count=0;count<resolutions;count++)
-		{
-		resolutionList1.Append(MDisplayControl::TResolution(TSize(),TSize()));
-		}
-	error = interface->GetResolutions(resolutionList1);
-	ASSERT_EQUALS(error,KErrNone);
-	ASSERT_EQUALS(resolutionList1.Count(), resolutions);
-	
-	RArray<MDisplayControl::TResolution> resolutionList2;
-	error = interface->GetResolutions(resolutionList2);
-	ASSERT_EQUALS(error,KErrNone);
-	ASSERT_EQUALS(resolutionList2.Count(), resolutions);
-	
-	RArray<MDisplayControl::TResolution> resolutionList3;
-	for (count=0;count<resolutions-1;count++)
-		{
-		resolutionList3.Append(MDisplayControl::TResolution(TSize(),TSize()));
-		}
-	error = interface->GetResolutions(resolutionList3);
-	ASSERT_EQUALS(error,KErrNone);
-	ASSERT_EQUALS(resolutionList3.Count(), resolutions);
-	
-	RArray<MDisplayControl::TResolution> resolutionList4;
-	for (count=0;count<resolutions+2;count++)
-		{
-		resolutionList4.Append(MDisplayControl::TResolution(TSize(),TSize()));
-		}
-	error = interface->GetResolutions(resolutionList4);
-	ASSERT_EQUALS(error,KErrNone);
-	ASSERT_EQUALS(resolutionList4.Count(), resolutions);
-	
-	for (count=0;count<resolutions;count++)
-		{
-		ASSERT_EQUALS(resolutionList1[count].iPixelSize,resolutionList2[count].iPixelSize);
-		ASSERT_EQUALS(resolutionList1[count].iPixelSize,resolutionList3[count].iPixelSize);
-		ASSERT_EQUALS(resolutionList1[count].iPixelSize,resolutionList4[count].iPixelSize);
-		
-		ASSERT_EQUALS(resolutionList1[count].iTwipsSize,resolutionList2[count].iTwipsSize);
-		ASSERT_EQUALS(resolutionList1[count].iTwipsSize,resolutionList3[count].iTwipsSize);
-		ASSERT_EQUALS(resolutionList1[count].iTwipsSize,resolutionList4[count].iTwipsSize);
-		
-		if (!(resolutionList1[count].iFlags == resolutionList2[count].iFlags))
-			{
-			ASSERT_TRUE(EFalse);
-			}
-		if (!(resolutionList1[count].iFlags == resolutionList3[count].iFlags))
-			{
-			ASSERT_TRUE(EFalse);
-			}
-		if (!(resolutionList1[count].iFlags == resolutionList4[count].iFlags))
-			{
-			ASSERT_TRUE(EFalse);
-			}
-		}
-	resolutionList1.Close();
-	resolutionList2.Close();
-	resolutionList3.Close();
-	resolutionList4.Close();
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0004L
-@SYMTestCaseDesc		Test for GetConfiguration
-@SYMREQ					REQ10328
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPriority		1
-@SYMTestPurpose			Check GetConfiguration returns a configuration object
-@SYMTestActions			
-	GetInterface
-	GetConfiguration with standard TDisplayConfiguration
-	GetResolution from the TDisplayConfiguration object
-	GetConfiguration with TDisplayConfiguration object with a greater version/size
-	GetResolution from the TDisplayConfiguration object
-	GetConfiguration with TDisplayConfiguration object with a smaller version/size -- equal to TDisplayConfiguration1
-	GetResolution from the TDisplayConfiguration object
-	Check all the resolutions should be same
-@SYMTestExpectedResults	
-	
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0004L()
-	{
-	LOG_AND_PANIC_IF_NOT_GCE;
-			
-	MDisplayControl* interface = static_cast<MDisplayControl*>
-				(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-	ASSERT_TRUE(interface);
-	
-	TDisplayConfiguration dispConfig;
-	interface->GetConfiguration(dispConfig);
-	ASSERT_TRUE(dispConfig.IsDefined(TDisplayConfigurationBase::EResolution));
-	TSize size;
-	TSize twips;
-	ASSERT_TRUE(dispConfig.GetResolution(size));
-	ASSERT_TRUE(dispConfig.GetResolutionTwips(twips));
-	
-	TDisplayConfiguration dispConfig1(TDisplayConfiguration().Version() + 10);
-	interface->GetConfiguration(dispConfig1);
-	ASSERT_TRUE(dispConfig1.IsDefined(TDisplayConfigurationBase::EResolution));
-	TSize size1;
-	TSize twips1;
-	ASSERT_TRUE(dispConfig1.GetResolution(size1));
-	ASSERT_TRUE(dispConfig1.GetResolutionTwips(twips1));
-	
-	TDisplayConfiguration dispConfig2(TDisplayConfiguration1().Version());
-	interface->GetConfiguration(dispConfig2);
-	ASSERT_TRUE(dispConfig2.IsDefined(TDisplayConfigurationBase::EResolution));
-	TSize size2;
-	TSize twips2;
-	ASSERT_TRUE(dispConfig2.GetResolution(size2));
-	ASSERT_TRUE(dispConfig2.GetResolutionTwips(twips2));
-	
-	ASSERT_EQUALS(size, size1);
-	ASSERT_EQUALS(size, size2);
-	ASSERT_EQUALS(twips, twips1);
-	ASSERT_EQUALS(twips, twips2);
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0005L
-@SYMTestCaseDesc		Test getting display change event from event queue
-@SYMREQ					REQ10329 REQ10330
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPriority		1
-@SYMTestPurpose			Verify the correct behaviour of display change notification
-@SYMTestActions			
-	Run through various ways of changing resolution
-	For each, check if event has been received
-@SYMTestExpectedResults	
-	Based on type of change, check event
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0005L()
-	{
-	LOG_AND_PANIC_IF_NOT_GCE;
-	ResetScreens();
-#ifdef MODE_CHANGE_BASE_FUNCTIONALITY_NOT_PRESENT_IN_HEADER
-	ASSERT_FALSE("Display connection test not compiled because MODE_CHANGE_BASE_FUNCTIONALITY_NOT_PRESENT_IN_HEADER");
-#else
-	TInt screenNo = iScreenDevice->GetScreenNumber();
-	
-	MDisplayControl* interface = static_cast<MDisplayControl*>
-				(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-	ASSERT_TRUE(interface);
-	interface->EnableDisplayChangeEvents(ETrue);
-	ASSERT_TRUE(interface->DisplayChangeEventsEnabled());
-	
-	CWsDisplayEvent* displayEventAO = new(ELeave) CWsDisplayEvent(&iSession);
-	CleanupStack::PushL(displayEventAO);
-	displayEventAO->Request();
-	CEventTimer *timer = CEventTimer::NewL();
-	CleanupStack::PushL(timer);
-	TInt dispSpinnerValue = displayEventAO->ResListSpinner();
-	TInt configSpinnerValue = displayEventAO->ConfigSpinner();
-	
-	iSession.Flush();		
-	TInt displayState = EDisconnect;
-	UserSvr::HalFunction(EHalGroupDisplay | (screenNo<<16), EDisplayHalSetDisplayState, &displayState, NULL);
-	
-	timer->Wait(100000);
-	ASSERT_TRUE(displayEventAO->ConfigSpinner() >= configSpinnerValue); //this is also a config change
-	ASSERT_TRUE(displayEventAO->ResListSpinner() > dispSpinnerValue); //1st display change event
-	dispSpinnerValue = displayEventAO->ResListSpinner();
-	configSpinnerValue = displayEventAO->ConfigSpinner();
-	
-	
-	interface->EnableDisplayChangeEvents(ETrue);//enable again
-	ASSERT_TRUE(interface->DisplayChangeEventsEnabled());
-	interface->EnableDisplayChangeEvents(EFalse);//disable
-	ASSERT_FALSE(interface->DisplayChangeEventsEnabled());
-	interface->EnableDisplayChangeEvents(EFalse);//disable again
-	interface->EnableDisplayChangeEvents(ETrue);//enable again
-	iSession.Flush();
-	
-	TDisplayConfiguration disconnectedConfig;
-	disconnectedConfig.SetResolution(TSize(10,11));
-	disconnectedConfig.SetResolutionTwips(TSize(12,13));
-	disconnectedConfig.SetRotation(TDisplayConfiguration1::ERotationNormal);
-	interface->GetConfiguration(disconnectedConfig);
-	ASSERT_FALSE(disconnectedConfig.IsDefined(disconnectedConfig.EResolution));
-	ASSERT_FALSE(disconnectedConfig.IsDefined(disconnectedConfig.EResolutionTwips));
-	ASSERT_FALSE(disconnectedConfig.IsDefined(disconnectedConfig.ERotation));
-	
-	displayState = ENormalResolution; 
-	UserSvr::HalFunction(EHalGroupDisplay | (screenNo<<16), EDisplayHalSetDisplayState, &displayState, NULL);
-	
-	timer->Wait(1000000);
-	ASSERT_TRUE(displayEventAO->ConfigSpinner() >= configSpinnerValue); //this is a config change if display policy is enabled. not a change otherwise
-	ASSERT_TRUE(displayEventAO->ResListSpinner() > dispSpinnerValue); //display change event	
-	dispSpinnerValue = displayEventAO->ResListSpinner();
-	configSpinnerValue = displayEventAO->ConfigSpinner();
-	
-	TDisplayConfiguration dispConfig, dispConfig2;
-	TSize resolution,resolution2;
-	interface->GetConfiguration(dispConfig2);
-	dispConfig2.GetResolution(resolution2);
-	RArray<MDisplayControl::TResolution> resolutions;
-	TInt err = interface->GetResolutions(resolutions);
-	ASSERT_EQUALS(err, KErrNone);
-	dispConfig.SetResolution(resolutions[resolutions.Count()/2].iPixelSize);
-	err = interface->SetConfiguration(dispConfig);
-	ASSERT_EQUALS(err, KErrNone);
-	interface->GetConfiguration(dispConfig);
-	
-	timer->Wait(100000);
-	
-	if(!(dispConfig2 == dispConfig))
-		{
-		ASSERT_TRUE(displayEventAO->ConfigSpinner() > configSpinnerValue); //a config change, but on screen 0 with DP disabled, as we only have 1 resolution when DP disabled
-		}
-	else
-		{
-		ASSERT_TRUE(displayEventAO->ConfigSpinner() == configSpinnerValue);
-		}
-	ASSERT_EQUALS(displayEventAO->ResListSpinner(), dispSpinnerValue); //this is not a display change event	
-	dispSpinnerValue = displayEventAO->ResListSpinner();
-	configSpinnerValue = displayEventAO->ConfigSpinner();
-	resolutions.Close();
-	
-	//here we flood the event queue with key events, so the next display change
-	//can't put event and queue and force the retry AO on server side to kick off
-	iSession.SetFocusScreen(TGlobalSettings::Instance().iScreen);
-	for(TInt scanCode = 'a'; scanCode < 't'; scanCode ++)
-		{
-		TRawEvent rawEvent;
-		rawEvent.Set(TRawEvent::EKeyDown,scanCode);
-		iSession.SimulateRawEvent(rawEvent);
-		rawEvent.Set(TRawEvent::EKeyUp,scanCode);
-		iSession.SimulateRawEvent(rawEvent);
-		}
-	iSession.Flush();
-
-	TInt eventCount1 = displayEventAO->ReceivedEventCount(); 
-	//we should still receive this
-	displayState = EDisconnect; 
-	UserSvr::HalFunction(EHalGroupDisplay | (screenNo<<16), EDisplayHalSetDisplayState, &displayState, NULL);
-	//let retry AO retry more times before we try to get it
-	User::After(1000000);
-	
-	timer->Wait(10000000);
-	ASSERT_TRUE(displayEventAO->ConfigSpinner()> configSpinnerValue ); //4th config change
-	ASSERT_TRUE(displayEventAO->ResListSpinner() > dispSpinnerValue); //4th display change event
-	
-	//This part is doomed as well. Now the received event count includes all the pointer, device and display change event
-	/*
-	TInt eventCount2 = displayEventAO->ReceivedEventCount();
-	//make sure retry AO is stopped - we only receive 1 display event
-	ASSERT_EQUALS(eventCount1 + 1, eventCount2);
-	*/
-	displayState = ENormalResolution; 
-	UserSvr::HalFunction(EHalGroupDisplay | (screenNo<<16), EDisplayHalSetDisplayState, &displayState, NULL);
-	
-	CleanupStack::PopAndDestroy(2, displayEventAO);
-#endif
-	}
-
-//Adds the first rotation defined in the TResolution to the display configuration
-void CWsDynamicResBasic::SetRotation (TDisplayConfiguration& aConfig, const MDisplayControl::TResolution& aResolution)
-	{
-	if (aResolution.iFlags.IsSet(MDisplayControlBase::TResolution::ERotationNormalSupported))
-		{
-		aConfig.SetRotation(TDisplayConfiguration1::ERotationNormal);
-		}
-	else if (aResolution.iFlags.IsSet(MDisplayControlBase::TResolution::ERotation90Supported))
-		{
-		aConfig.SetRotation(TDisplayConfiguration1::ERotation90CW);
-		}
-	else if (aResolution.iFlags.IsSet(MDisplayControlBase::TResolution::ERotation180Supported))
-		{
-		aConfig.SetRotation(TDisplayConfiguration1::ERotation180);
-		}
-	else if (aResolution.iFlags.IsSet(MDisplayControlBase::TResolution::ERotation270Supported))
-		{
-		aConfig.SetRotation(TDisplayConfiguration1::ERotation270CW);
-		}
-	ASSERT_TRUE(aConfig.IsDefined(aConfig.ERotation));
-	}
-	
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0006L
-@SYMTestCaseDesc		Set Screen display res
-@SYMREQ					REQ10326
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPriority		
-@SYMTestPurpose			Checking window and layer extents continue working
-@SYMTestActions			
-	Get resolution list
-	For every resolution
-		Set resolution
-		Draw many rectangles that shrink to demonstrate scaling issues
-		Draw surface
-		Move window around
-@SYMTestExpectedResults	
-	Every resolution that is supported by current app mode should successfully be set
-	All rectangles and surface should be visible
-	As the window moves, the rectangles and surface should move with it, keeping visible
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0006L()
-	{
-	LOG_AND_PANIC_IF_NOT_GCE;
-	ResetScreens();
-	TInt error;
-	MakeTitleAndCompareWindowsL(_L("GFX_WSERV_DYNAMICRES_0006L"),_L("Change Resolution"));
-
-	iTestBack=RWindow(iSession);
-	ASSERT_EQUALS(iTestBack.Construct(iGroup, ++iWindowHandle), KErrNone);
-	iTestBack.SetRequiredDisplayMode(iDisplayMode);
-	iTestBack.SetBackgroundColor(TRgb(255,0,0));
-	iTestBack.SetExtent(iTestPos.iTl,iTestPos.Size());
-	iTestBack.Activate();
-	iTestBack.BeginRedraw();
-	ActivateWithWipe(iGc,iTestBack,TRgb(255,0,0));
-	iGc->Deactivate();
-	iTestBack.EndRedraw();
-	iTestBack.SetVisible(ETrue);
-	
-	struct DrawCompare
-		{
-		static void Draw(CWindowGc*	aGc)
-			{
-			aGc->SetPenStyle(aGc->ESolidPen);
-			aGc->SetPenColor(TRgb(255,255,255));
-			aGc->SetBrushColor(TRgb(0,0,0));
-			TRect r(2,2,82,82);
-			while(r.Width()>0)
-				{
-				aGc->DrawRect(r);
-				r.Shrink(2,2);
-				}
-			}
-		};
-	TSurfaceId surfaceID;
-	TRAPD(err, surfaceID = iUtility->CreateSurfaceL(TSize(200,200), 
-			KSurfaceFormat, 200 * KBytesPerPixel));
-	ASSERT_EQUALS(err,KErrNone);
-	TRAP(err,iUtility->FanFillSurfaceL(surfaceID,iYellow,iRed,iMagenta));
-	ASSERT_EQUALS(err,KErrNone);
-	TSurfaceConfiguration surfConf;
-	surfConf.SetSurfaceId(surfaceID);
-	
-	surfConf.SetExtent(TRect(2,84,82,166));
-	iCompare.SetBackgroundSurface(surfConf,EFalse);
-	
-	if (CWindowGc*	gc=BeginActivateWithWipe(ETrue,iCompare,TRgb(128,128,128)))
-		{
-		DrawCompare::Draw(gc);
-		gc->Deactivate();
-		iCompare.EndRedraw();
-		
-		}
-	iSession.Finish(ETrue);
-	Pause(1000);
-	
-	MDisplayControl* interface = static_cast<MDisplayControl*>
-				(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-	ASSERT_TRUE(interface);
-	
-	TInt resolutions = interface->NumberOfResolutions();
-	ASSERT_TRUE (resolutions > 0);
-	
-	RArray<MDisplayControl::TResolution> resolutionList1;
-	error = interface->GetResolutions(resolutionList1);
-	ASSERT_EQUALS(error,KErrNone);
-	ASSERT_EQUALS(resolutionList1.Count(), resolutions);
-	
-	TDisplayConfiguration dispConfigBefore;
-	interface->GetConfiguration(dispConfigBefore);
-	ASSERT_TRUE(dispConfigBefore.IsDefined(dispConfigBefore.EResolution))
-	if (resolutions>1)
-		{
-		//Got a mode to change to!
-		TSize resBefore;
-		TBool ok=dispConfigBefore.GetResolution(resBefore);
-		ASSERT_TRUE(ok);	//we "know" this should be ok, as we just asserted the flag
-		TBool foundBeforeRes=EFalse;
-		for (TInt res=0;res<resolutionList1.Count();res++)
-			{
-//			if (resolutionList1[res].iPixelSize!=resBefore)
-				{
-				if (resolutionList1[res].iPixelSize!=TSize(0,0))	//this test is not about turning the display off
-					{
-					TDisplayConfiguration dispConfigReq;
-					dispConfigReq.SetResolution(resolutionList1[res].iPixelSize);
-					ASSERT_TRUE(dispConfigReq.IsDefined(dispConfigReq.EResolution));
-					
-					SetRotation(dispConfigReq,resolutionList1[res]);	//set rotation to first defined in res list
-					
-					TInt errCode=interface->SetConfiguration(dispConfigReq);
-					//ASSERT_EQUALS(errCode,KErrNone);
-					if (errCode != KErrNone)
-						{
-						//Probably current size mode does not support the rotation of the passed in configuration
-						
-						ASSERT_EQUALS(errCode,KErrArgument);	//failed to find compatible res in the policy
-						continue;
-						}
-					Pause(300);
-					TRect outerrect(iTestPos.iTl,resolutionList1[res].iPixelSize.AsPoint());
-					iTestBack.SetExtent(outerrect.iTl,outerrect.Size());
-					iSession.Finish(ETrue);
-					Pause(300);
-					if (CWindowGc*	gc=BeginActivateWithWipe(ETrue,iCompare,TRgb(128,128,128)))
-						{
-						DrawCompare::Draw(gc);
-						gc->Deactivate();
-						iCompare.EndRedraw();
-						}
-					TBuf16<20> s;
-					s.AppendNum(res);
-					UpdateTitleWindowL(s,2);
-					s.Zero();
-					s.AppendNum(resolutionList1[res].iPixelSize.iWidth);
-					s.Append('x');
-					s.AppendNum(resolutionList1[res].iPixelSize.iHeight);
-					UpdateTitleWindowL(s,3);
-					
-					iSession.Finish(ETrue);
-					Pause(300);
-					outerrect.iBr.iX-=5;
-					outerrect.iBr.iY-=5;
-					iTestBack.SetExtent(outerrect.iTl,outerrect.Size());
-					iSession.Finish(ETrue);
-					Pause(300);
-					TPoint winpos=iCompare.AbsPosition();
-					TSize winsize=iCompare.Size();
-//					iInfoScreenDevice->ReleaseTwipsCache();
-					RepaintTitleWindowL();
-					for (TSize z=TSize(1,1);z!=TSize(-1,-1);)
-						{
-						for (TInt i=0;i<15;i++)
-							{
-							winpos+=z;
-							iCompare.SetExtent(winpos,winsize);
-							iSession.Finish(ETrue);
-							Pause(100);
-							}
-						if (z.iHeight && z.iWidth)
-							z=TSize(0,-1);
-						else
-						if (z.iHeight)
-							z=TSize(-1,0);
-						else
-							z=TSize(-1,-1);
-						}
-					TDisplayConfiguration dispConfigAfter;
-					interface->GetConfiguration(dispConfigAfter);
-					TSize resAfter;
-					TBool ok=dispConfigAfter.GetResolution(resAfter);
-					ASSERT_TRUE(ok);
-					if (resolutionList1[res].iPixelSize!=resAfter)
-						{
-						INFO_PRINTF3(_L("Did not receive expected resolution %ix%i"),resolutionList1[res].iPixelSize.iWidth,resolutionList1[res].iPixelSize.iHeight);
-						INFO_PRINTF3(_L("Instead got %ix%i"),resAfter.iWidth,resAfter.iHeight);
-						}
-					}
-				}
-			if (resolutionList1[res].iPixelSize==resBefore)
-				{
-				foundBeforeRes=ETrue;
-				}
-			}
-		ASSERT_TRUE(foundBeforeRes);
-		//restore initial res
-		interface->SetConfiguration(dispConfigBefore);
-		Pause(1000);
-		TDisplayConfiguration dispConfigAfter;
-		interface->GetConfiguration(dispConfigAfter);
-		TSize resAfter;
-		ok=dispConfigAfter.GetResolution(resAfter);
-		ASSERT_TRUE(ok);	
-		ASSERT_EQUALS(resBefore,resAfter);
-		}
-	else
-		{
-		INFO_PRINTF1(_L("Only 1 resolution configured on this screen - res change test skipped."));
-		}
-	resolutionList1.Close();
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0007L
-@SYMTestCaseDesc		Coordinates Mapping
-@SYMREQ					REQ10336
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPurpose			Basic call to mapcoordinates
-@SYMTestActions			
-	Call mapCoordinates
-@SYMTestExpectedResults	
-	targetRect should be correctly filled in with same rect as sourceRect
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0007L()
-	{
-	MDisplayMapping* interface = static_cast<MDisplayMapping*>
-			(iScreenDevice->GetInterface(MDisplayMapping::ETypeId));
-	ASSERT_TRUE(interface);
-	TRect sourceRect(10, 10, 30, 50);
-	TRect targetRect(5,5,10,10);
-	TInt err = interface->MapCoordinates(EApplicationSpace, sourceRect, EApplicationSpace, targetRect);
-	ASSERT_EQUALS(err, KErrNone);
-	ASSERT_EQUALS(sourceRect, targetRect);
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0008L
-@SYMTestCaseDesc		SetModes and mapCoordinates
-@SYMREQ					REQ10336
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPurpose			Basic SetSizeMode and complex MapCoordinates function
-@SYMTestActions			
-	Set a new size mode
-	Perform many rect conversions using MapCoordinates
-@SYMTestExpectedResults	
-	Ensure that through multiple conversions, accuracy is not lost
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0008L()
-	{
-	LOG_AND_PANIC_IF_NOT_GCE;
-	ResetScreens();
-	TInt error;
-	MakeTitleAndCompareWindowsL(_L("GFX_WSERV_DYNAMICRES_0008L"),_L("Change Size Mode"));
-
-	iTestBack=RWindow(iSession);
-	ASSERT_EQUALS(iTestBack.Construct(iGroup, ++iWindowHandle), KErrNone);
-	iTestBack.SetRequiredDisplayMode(iDisplayMode);
-	iTestBack.SetBackgroundColor(TRgb(255,0,0));
-	iTestBack.SetExtent(iTestPos.iTl,iTestPos.Size());
-	iTestBack.Activate();
-	iTestBack.BeginRedraw();
-	ActivateWithWipe(iGc,iTestBack,TRgb(255,0,0));
-	iGc->Deactivate();
-	iTestBack.EndRedraw();
-	iTestBack.SetVisible(ETrue);
-	
-	
-	if (CWindowGc*	gc=BeginActivateWithWipe(ETrue,iCompare,TRgb(128,128,128)))
-		{
-		gc->SetPenStyle(gc->ESolidPen);
-		gc->SetPenColor(TRgb(255,255,255));
-		gc->SetBrushColor(TRgb(0,0,0));
-		TRect r(2,2,22,22);
-		while(r.Width()>0)
-			{
-			gc->DrawRect(r);
-			r.Shrink(2,2);
-			}
-		gc->Deactivate();
-		iCompare.EndRedraw();
-		
-		}
-	iSession.Finish(ETrue);
-	Pause(1000);
-	
-	MDisplayControl* interface = static_cast<MDisplayControl*>
-				(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-	ASSERT_TRUE(interface);
-	
-	TInt resolutions = interface->NumberOfResolutions();
-	ASSERT_TRUE (resolutions > 0);
-	
-	RArray<MDisplayControl::TResolution> resolutionList1;
-	error = interface->GetResolutions(resolutionList1);
-	ASSERT_EQUALS(error,KErrNone);
-	ASSERT_EQUALS(resolutionList1.Count(), resolutions);
-	
-	TDisplayConfiguration dispConfigBefore;
-	interface->GetConfiguration(dispConfigBefore);
-	ASSERT_TRUE(dispConfigBefore.IsDefined(dispConfigBefore.EResolution));
-	
-	RArray<TInt> screenModeList;
-	iInfoScreenDevice->GetScreenSizeModeList(&screenModeList);
-	ASSERT_TRUE (screenModeList.Count() > 1);
-	iScreenDevice->SetAppScreenMode(screenModeList[1]);
-	iScreenDevice->SetScreenMode(screenModeList[1]);
-	iSession.Finish(ETrue);
-	Pause(1000);
-	
-	MDisplayMapping* interfaceM = static_cast<MDisplayMapping*>
-			(iScreenDevice->GetInterface(MDisplayMapping::ETypeId));
-	TRect appRect(20, 40, 193, 110);
-	TRect uiRect(1,2,3,4);
-	TRect compRect(5,6,7,8);
-	TRect tempRect(10,11,12,13);
-	TInt err;
-	while (ETrue)
-		{
-		//quick get for a print
-		err = interfaceM->MapCoordinates(EApplicationSpace, appRect, EFullScreenSpace, uiRect);
-		err = interfaceM->MapCoordinates(EApplicationSpace, appRect, ECompositionSpace, compRect);
-		
-//		print
-//		INFO_PRINTF5(_L("appRect : %d , %d - %d , %d"),appRect.iTl.iX,appRect.iTl.iY,appRect.iBr.iX,appRect.iBr.iY);
-//		INFO_PRINTF5(_L("uiRect : %d , %d - %d , %d"),uiRect.iTl.iX,uiRect.iTl.iY,uiRect.iBr.iX,uiRect.iBr.iY);
-//		INFO_PRINTF5(_L("compRect : %d , %d - %d , %d"),compRect.iTl.iX,compRect.iTl.iY,compRect.iBr.iX,compRect.iBr.iY);
-//		INFO_PRINTF1(_L("  "));
-		
-		//longer process to insure conversions both ways dont lose accuracy
-		err = interfaceM->MapCoordinates(EApplicationSpace, appRect, EFullScreenSpace, uiRect);
-		err = interfaceM->MapCoordinates(EFullScreenSpace, uiRect, EApplicationSpace, tempRect);
-		ASSERT_EQUALS(tempRect,appRect);
-		
-		err = interfaceM->MapCoordinates(EApplicationSpace, appRect, ECompositionSpace, compRect);
-		err = interfaceM->MapCoordinates(ECompositionSpace, compRect, EApplicationSpace, tempRect);
-		ASSERT_EQUALS(tempRect,appRect);
-		
-		err = interfaceM->MapCoordinates(EApplicationSpace, appRect, EFullScreenSpace, uiRect);
-		err = interfaceM->MapCoordinates(EFullScreenSpace, uiRect, ECompositionSpace, compRect);
-		err = interfaceM->MapCoordinates(ECompositionSpace, compRect, EFullScreenSpace, tempRect);
-		ASSERT_EQUALS(tempRect,uiRect);
-		
-		appRect.iBr.iX--;
-		appRect.iBr.iY--;
-		if (appRect.IsEmpty())
-			{
-			break;
-			}
-		}
-	
-	TRect rect1(5,5,10,10);
-	TRect rect2(15,15,20,20);
-	TRect rect3(50,50,50,50);
-	//1
-	err = interfaceM->MapCoordinates(ECompositionSpace, rect1, ECompositionSpace, rect2);
-	err = interfaceM->MapCoordinates(EFullScreenSpace, rect2, ECompositionSpace, rect3);
-	ASSERT_EQUALS(rect1,rect2);
-	
-	err = interfaceM->MapCoordinates(ECompositionSpace, rect1, EFullScreenSpace, rect2);
-	err = interfaceM->MapCoordinates(EFullScreenSpace, rect2, ECompositionSpace, rect3);
-	ASSERT_EQUALS(rect1,rect3);
-
-	err = interfaceM->MapCoordinates(ECompositionSpace, rect1, EApplicationSpace, rect2);
-	err = interfaceM->MapCoordinates(EApplicationSpace, rect2, ECompositionSpace, rect3);
-	ASSERT_EQUALS(rect1,rect3);
-	
-	err = interfaceM->MapCoordinates(ECompositionSpace, rect1, EDirectScreenAccessSpace, rect2);
-	err = interfaceM->MapCoordinates(EDirectScreenAccessSpace, rect2, ECompositionSpace, rect3);
-	ASSERT_EQUALS(rect1,rect3);
-	
-	//2
-	err = interfaceM->MapCoordinates(EFullScreenSpace, rect1, EFullScreenSpace, rect2);
-	ASSERT_EQUALS(rect1,rect2);
-	
-	err = interfaceM->MapCoordinates(EFullScreenSpace, rect1, EApplicationSpace, rect2);
-	err = interfaceM->MapCoordinates(EApplicationSpace, rect2, EFullScreenSpace, rect3);
-	ASSERT_EQUALS(rect1,rect3);
-	
-	err = interfaceM->MapCoordinates(EFullScreenSpace, rect1, EDirectScreenAccessSpace, rect2);
-	err = interfaceM->MapCoordinates(EDirectScreenAccessSpace, rect2, EFullScreenSpace, rect3);
-	ASSERT_EQUALS(rect1,rect3);
-	
-	//3
-	err = interfaceM->MapCoordinates(EApplicationSpace, rect1, EApplicationSpace, rect2);
-	ASSERT_EQUALS(rect1,rect2);
-	
-	err = interfaceM->MapCoordinates(EApplicationSpace, rect1, EDirectScreenAccessSpace, rect2);
-	err = interfaceM->MapCoordinates(EDirectScreenAccessSpace, rect2, EApplicationSpace, rect3);
-	ASSERT_EQUALS(rect1,rect3);
-	
-	//4
-	err = interfaceM->MapCoordinates(EDirectScreenAccessSpace, rect1, EDirectScreenAccessSpace, rect2);
-	ASSERT_EQUALS(rect1,rect2);
-	
-	//invalid
-	err = interfaceM->MapCoordinates(ECompositionSpace, rect1, (TCoordinateSpace)0, rect2);
-	ASSERT_EQUALS(err,KErrNotSupported);
-	err = interfaceM->MapCoordinates(EFullScreenSpace, rect1, (TCoordinateSpace)0, rect2);
-	ASSERT_EQUALS(err,KErrNotSupported);
-	err = interfaceM->MapCoordinates(EApplicationSpace, rect1, (TCoordinateSpace)0, rect2);
-	ASSERT_EQUALS(err,KErrNotSupported);
-	err = interfaceM->MapCoordinates(EDirectScreenAccessSpace, rect1, (TCoordinateSpace)0, rect2);
-	ASSERT_EQUALS(err,KErrNotSupported);
-	err = interfaceM->MapCoordinates((TCoordinateSpace)0, rect1, EDirectScreenAccessSpace, rect2);
-	ASSERT_EQUALS(err,KErrNotSupported);
-	
-	TDisplayConfiguration dispConfigAfter;
-	interface->GetConfiguration(dispConfigAfter);
-
-	screenModeList.Close();
-	resolutionList1.Close();
-	iScreenDevice->SetAppScreenMode(0);
-	iScreenDevice->SetScreenMode(0);
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0009L
-@SYMTestCaseDesc		Set Screen display res using app mode
-@SYMREQ					REQ10336
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPurpose			SetScreenMode functions correctly
-@SYMTestActions			
-	Similar to 0006, but setting every available screen mode instead of resolution
-@SYMTestExpectedResults	
-	Every set should work, including modes that involve a rotation!
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0009L()
-	{
-	LOG_AND_PANIC_IF_NOT_GCE;
-	ResetScreens();
-	TInt error;
-	iSession.Finish(ETrue);
-	MakeTitleAndCompareWindowsL(_L("GFX_WSERV_DYNAMICRES_0009L"),_L("Change Size Mode"));
-	iSession.Finish(ETrue);
-
-	iTestBack=RWindow(iSession);
-	ASSERT_EQUALS(iTestBack.Construct(iGroup, ++iWindowHandle), KErrNone);
-	iTestBack.SetRequiredDisplayMode(iDisplayMode);
-	iTestBack.SetBackgroundColor(TRgb(255,0,0));
-	iTestBack.SetExtent(iTestPos.iTl,iTestPos.Size());
-	iTestBack.Activate();
-	iTestBack.BeginRedraw();
-	ActivateWithWipe(iGc,iTestBack,TRgb(255,0,0));
-	iGc->Deactivate();
-	iTestBack.EndRedraw();
-	iTestBack.SetVisible(ETrue);
-	iSession.Finish(ETrue);
-	
-	struct DrawCompare
-		{
-		static void Draw(CWindowGc*	aGc)
-			{
-			aGc->SetPenStyle(aGc->ESolidPen);
-			aGc->SetPenColor(TRgb(255,255,255));
-			aGc->SetBrushColor(TRgb(0,0,0));
-			TRect r(2,2,82,82);
-			while(r.Width()>0)
-				{
-				aGc->DrawRect(r);
-				r.Shrink(2,2);
-				}
-			}
-		};
-	TSurfaceId surfaceID;
-	TRAPD(err, surfaceID = iUtility->CreateSurfaceL(TSize(200,200), 
-			KSurfaceFormat, 200 * KBytesPerPixel));
-	ASSERT_EQUALS(err,KErrNone);
-	TRAP(err,iUtility->FanFillSurfaceL(surfaceID,iYellow,iRed,iMagenta));
-	ASSERT_EQUALS(err,KErrNone);
-	TSurfaceConfiguration surfConf;
-	surfConf.SetSurfaceId(surfaceID);
-	
-	surfConf.SetExtent(TRect(2,84,82,166));
-	iCompare.SetBackgroundSurface(surfConf,EFalse);
-	
-	if (CWindowGc*	gc=BeginActivateWithWipe(ETrue,iCompare,TRgb(128,128,128)))
-		{
-		DrawCompare::Draw(gc);
-		gc->Deactivate();
-		iCompare.EndRedraw();
-		
-		}
-	iSession.Finish(ETrue);
-	Pause(1000);
-	RArray<TInt> screenModeList;
-	iInfoScreenDevice->GetScreenSizeModeList(&screenModeList);
-	MDisplayControl* interface = static_cast<MDisplayControl*>
-				(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-	ASSERT_TRUE(interface);
-	
-	TInt resolutions = interface->NumberOfResolutions();
-	ASSERT_TRUE (resolutions > 0);
-	
-	RArray<MDisplayControl::TResolution> resolutionList1;
-	error = interface->GetResolutions(resolutionList1);
-	ASSERT_EQUALS(error,KErrNone);
-	ASSERT_EQUALS(resolutionList1.Count(), resolutions);
-	
-	TDisplayConfiguration dispConfigBefore;
-	interface->GetConfiguration(dispConfigBefore);
-	ASSERT_TRUE(dispConfigBefore.IsDefined(dispConfigBefore.EResolution))
-	if (screenModeList.Count()>1)
-		{
-		//Got a mode to change to!
-		TSize resBefore;
-		TBool ok=dispConfigBefore.GetResolution(resBefore);
-		ASSERT_TRUE(ok);	//we "know" this should be ok, as we just asserted the flag
-		for (TInt res=0;res<screenModeList.Count();res++)
-			{
-				{
-					{
-					TDisplayConfiguration dispConfigReq;
-					iInfoScreenDevice->SetAppScreenMode(screenModeList[res]);
-					iInfoScreenDevice->SetScreenMode(screenModeList[res]);
-					iSession.Finish(ETrue);
-					Pause(300);
-					
-					TPixelsAndRotation pr;
-					iInfoScreenDevice->GetDefaultScreenSizeAndRotation(pr);
-					TPoint 	origin=iInfoScreenDevice->GetDefaultScreenModeOrigin();
-					Pause(300);
-					
-					if (CWindowGc*	gc=BeginActivateWithWipe(ETrue,iCompare,TRgb(128,128,128)))
-						{
-						DrawCompare::Draw(gc);
-						gc->Deactivate();
-						iCompare.EndRedraw();
-						}
-					if (iTitle.WsHandle())
-						{
-						TPoint	infoWinPos;
-						TSize	infoWinSize;
-						infoWinPos=iTitle.AbsPosition();
-						infoWinSize=iTitle.Size();
-						infoWinSize.iHeight=pr.iPixelSize.iHeight-2*infoWinPos.iY;
-						iTitle.SetSize(infoWinSize);
-						}
-					TBuf16<20> s;
-					s.AppendNum(res);
-					UpdateTitleWindowL(s,1);
-					s.Zero();
-					s.AppendNum(pr.iPixelSize.iWidth);
-					s.Append('x');
-					s.AppendNum(pr.iPixelSize.iHeight);
-					UpdateTitleWindowL(s,2);
-					s.Zero();
-					s.AppendNum(origin.iX);
-					s.Append(',');
-					s.AppendNum(origin.iY);
-					UpdateTitleWindowL(s,3);
-					
-					iSession.Finish(ETrue);
-					Pause(300);
-					
-					TPoint winpos=iCompare.AbsPosition();
-					TSize winsize=iCompare.Size();
-
-					for (TSize z=TSize(1,1);z!=TSize(-1,-1);)
-						{
-						for (TInt i=0;i<15;i++)
-							{
-							winpos+=z;
-							iCompare.SetExtent(winpos,winsize);
-							iSession.Finish(ETrue);
-							Pause(100);
-							}
-						if (z.iHeight && z.iWidth)
-							z=TSize(0,-1);
-						else
-						if (z.iHeight)
-							z=TSize(-1,0);
-						else
-							z=TSize(-1,-1);
-						}
-					}
-				}
-			}
-		//restore initial res
-		if (screenModeList.Count() > 1)
-            {   //set back to basics
-            iInfoScreenDevice->SetAppScreenMode(screenModeList[0]);
-            iInfoScreenDevice->SetScreenMode(screenModeList[0]);
-            Pause(300);
-            }
-		
-		interface->SetConfiguration(dispConfigBefore);
-		Pause(1000);
-		TDisplayConfiguration dispConfigAfter;
-		interface->GetConfiguration(dispConfigAfter);
-		TSize resAfter;
-		ok=dispConfigAfter.GetResolution(resAfter);
-		ASSERT_TRUE(ok);	
-		ASSERT_EQUALS(resBefore,resAfter);
-		}
-	else
-		{
-		INFO_PRINTF1(_L("Only 1 screen size mode configured on this screen - res change test skipped."));
-		}
-
-	screenModeList.Close();
-	resolutionList1.Close();
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0010L
-@SYMTestCaseDesc		Test app mode setting during attach/detach
-@SYMREQ					REQ10330
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPurpose			Make sure display resumes last app mode when reattached
-@SYMTestActions			
-	Save app mode and display configuration before detach and compare it with those after reattach.
-	Repeat for a second app mode
-	If available, repeat with dynamic app mode
-@SYMTestExpectedResults	
-	For normal app mode, on reconnect it should re apply the old configuration
-	For dynamic app mode, on reconnect it should be 0x0	
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0010L()
-	{
-	LOG_AND_PANIC_IF_NOT_GCE;
-	ResetScreens();
-#ifdef MODE_CHANGE_BASE_FUNCTIONALITY_NOT_PRESENT_IN_HEADER
-	ASSERT_FALSE("Test not compiled because MODE_CHANGE_BASE_FUNCTIONALITY_NOT_PRESENT_IN_HEADER");
-#else
-	TInt error;
-	iSession.Finish(ETrue);
-	MakeTitleAndCompareWindowsL(_L("GFX_WSERV_DYNAMICRES_0010L"),_L("detach/attach"));
-	iSession.Finish(ETrue);
-
-	Pause(1000);
-	TInt screenNo = iScreenDevice->GetScreenNumber();
-	RArray<TInt> screenModeList;
-	iInfoScreenDevice->GetScreenSizeModeList(&screenModeList);
-	
-	//Find 2 real app modes and 1 dynamic app mode
-	TInt firstAvailableAppMode = -1;
-	TInt secondAvailableAppMode = -1;
-	TInt dynamicAppMode = -1;
-	for (TInt ii = 0; ii < screenModeList.Count(); ii++)
-		{
-		TBool dynamic = iInfoScreenDevice->IsModeDynamic(screenModeList[ii]);
-		if (dynamic && dynamicAppMode == -1)
-			{
-			dynamicAppMode = screenModeList[ii];
-			}
-		if (!dynamic)
-			{
-			if (firstAvailableAppMode == -1)
-				{
-				firstAvailableAppMode = screenModeList[ii];
-				}
-			else if (secondAvailableAppMode == -1)
-				{
-				secondAvailableAppMode = screenModeList[ii];
-				}
-			}
-		}
-	ASSERT_TRUE(firstAvailableAppMode!=-1);
-	ASSERT_TRUE(secondAvailableAppMode!=-1);
-	
-	MDisplayControl* interface = static_cast<MDisplayControl*>
-				(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-	ASSERT_TRUE(interface);
-	
-	MDisplayMapping* mappingInterface = static_cast<MDisplayMapping*>
-				(iScreenDevice->GetInterface(MDisplayMapping::ETypeId));
-	ASSERT_TRUE(mappingInterface);
-	
-	TInt resolutions = interface->NumberOfResolutions();
-	ASSERT_TRUE (resolutions > 0);
-	
-	RArray<MDisplayControl::TResolution> resolutionList1;
-	error = interface->GetResolutions(resolutionList1);
-	ASSERT_EQUALS(error,KErrNone);
-	ASSERT_EQUALS(resolutionList1.Count(), resolutions);
-	
-	TDisplayConfiguration configBeforeDetach, configAfterReattach;
-	TInt appModeBeforeDetach, appModeAfterReattach;
-
-	//
-	//1st detach - attach sequence
-	appModeBeforeDetach = firstAvailableAppMode;
-	iScreenDevice->SetAppScreenMode(appModeBeforeDetach );
-	iScreenDevice->SetScreenMode(appModeBeforeDetach );
-	Pause(200);
-	interface->GetConfiguration(configBeforeDetach);
-	
-	TInt displayState = EDisconnect;
-	UserSvr::HalFunction(EHalGroupDisplay | (screenNo<<16), EDisplayHalSetDisplayState, &displayState, NULL);
-	Pause(300);
-	
-	//dummy mapping should return KErrNotReady if display is disconnected
-	TRect dummyRect(1,2,5,8);
-	error = mappingInterface->MapCoordinates(ECompositionSpace, dummyRect, EFullScreenSpace, dummyRect);
-	ASSERT_EQUALS(error, KErrNotReady);
-	
-	displayState = ENormalResolution;
-	UserSvr::HalFunction(EHalGroupDisplay | (screenNo<<16), EDisplayHalSetDisplayState, &displayState, NULL);
-	Pause(300);
-	
-	interface->GetConfiguration(configAfterReattach);
-	ASSERT_TRUE(configBeforeDetach==configAfterReattach);
-	appModeAfterReattach = iScreenDevice->CurrentScreenMode();
-	ASSERT_EQUALS(appModeBeforeDetach, appModeAfterReattach);
-	//1st detach - attach sequence ends here
-	//
-	
-	configBeforeDetach.ClearAll();
-	configAfterReattach.ClearAll();
-	
-	//
-	//2nd detach-attach sequence - non dynamic app mode
-	iScreenDevice->SetAppScreenMode(secondAvailableAppMode);
-	iScreenDevice->SetScreenMode(secondAvailableAppMode);
-	Pause(200);
-	appModeBeforeDetach = iScreenDevice->CurrentScreenMode();
-	interface->GetConfiguration(configBeforeDetach);
-	displayState = EDisconnect;
-	UserSvr::HalFunction(EHalGroupDisplay | (screenNo<<16), EDisplayHalSetDisplayState, &displayState, NULL);
-	Pause(300);
-	//dummy mapping should return KErrNotReady if display is disconnected
-	error = mappingInterface->MapCoordinates(ECompositionSpace, dummyRect, EFullScreenSpace, dummyRect);
-	ASSERT_EQUALS(error, KErrNotReady);
-	
-	displayState = ENoResolution;
-	UserSvr::HalFunction(EHalGroupDisplay | (screenNo<<16), EDisplayHalSetDisplayState, &displayState, NULL);
-	Pause(300);
-	//dummy mapping should return KErrNotReady if display is disconnected
-	error = mappingInterface->MapCoordinates(ECompositionSpace, dummyRect, EFullScreenSpace, dummyRect);
-	ASSERT_EQUALS(error, KErrNotReady);
-	
-	displayState = ENormalResolution;
-	UserSvr::HalFunction(EHalGroupDisplay | (screenNo<<16), EDisplayHalSetDisplayState, &displayState, NULL);
-	Pause(300);
-	
-	interface->GetConfiguration(configAfterReattach);
-	ASSERT_TRUE(configBeforeDetach==configAfterReattach);
-	appModeAfterReattach = iScreenDevice->CurrentScreenMode();
-	ASSERT_EQUALS(appModeBeforeDetach, appModeAfterReattach);
-	//2nd detach-attach sequence ends here
-	//
-	
-	configBeforeDetach.ClearAll();
-	configAfterReattach.ClearAll();
-	
-	//
-	//3rd detach-attach sequence - dynamic app mode
-	if (dynamicAppMode == -1)
-		{
-		screenModeList.Close();
-		resolutionList1.Close();
-		INFO_PRINTF1(_L("No dynamic app mode, end test"));	//not a fail if there isn't a dynamic app mode
-		return;
-		}
-	
-	iScreenDevice->SetAppScreenMode(dynamicAppMode);
-	iScreenDevice->SetScreenMode(dynamicAppMode);
-	Pause(200);
-	appModeBeforeDetach = iScreenDevice->CurrentScreenMode();
-	interface->GetConfiguration(configBeforeDetach);
-	displayState = EDisconnect;
-	UserSvr::HalFunction(EHalGroupDisplay | (screenNo<<16), EDisplayHalSetDisplayState, &displayState, NULL);
-	Pause(300);
-	//dummy mapping should return KErrNotReady if display is disconnected
-	error = mappingInterface->MapCoordinates(ECompositionSpace, dummyRect, EFullScreenSpace, dummyRect);
-	ASSERT_EQUALS(error, KErrNotReady);
-	
-	displayState = ENoResolution;
-	UserSvr::HalFunction(EHalGroupDisplay | (screenNo<<16), EDisplayHalSetDisplayState, &displayState, NULL);
-	Pause(300);
-	//dummy mapping should return KErrNotReady if display is disconnected
-	error = mappingInterface->MapCoordinates(ECompositionSpace, dummyRect, EFullScreenSpace, dummyRect);
-	ASSERT_EQUALS(error, KErrNotReady);
-	
-	displayState = ENormalResolution;
-	UserSvr::HalFunction(EHalGroupDisplay | (screenNo<<16), EDisplayHalSetDisplayState, &displayState, NULL);
-	Pause(300);
-	
-	interface->GetConfiguration(configAfterReattach);
-	ASSERT_FALSE(configBeforeDetach==configAfterReattach);
-	TSize afterReattachSize;
-	ASSERT_TRUE(configAfterReattach.GetResolution(afterReattachSize));
-	ASSERT_EQUALS(afterReattachSize,TSize(0,0));
-	ASSERT_TRUE(configAfterReattach.GetResolutionTwips(afterReattachSize));
-	ASSERT_EQUALS(afterReattachSize,TSize(0,0));
-	
-	appModeAfterReattach = iScreenDevice->CurrentScreenMode();
-	ASSERT_EQUALS(appModeBeforeDetach, appModeAfterReattach);
-	//3rd detach-attach sequence ends here
-	//
-	
-	screenModeList.Close();
-	resolutionList1.Close();
-#endif
-	}
-
-
-CDSATestDrawing::CDSATestDrawing():CTimer(EPriorityStandard)
-	{}
-
-CDSATestDrawing::~CDSATestDrawing()
-	{
-	Cancel();
-	}
-CDSATestDrawing* CDSATestDrawing::NewL()
-	{
-	CDSATestDrawing *self = new(ELeave) CDSATestDrawing();
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-void CDSATestDrawing::ConstructL()
-	{
-	CTimer::ConstructL();
-	CActiveScheduler::Add(this);
-	}
-
-void CDSATestDrawing::StartDrawingL(CDirectScreenAccess *aDSA)
-	{
-	
-	if(aDSA)
-		{
-		iDSA = aDSA;
-		}
-	
-	if(iDSA)
-		{
-		iDSA->StartL();
-		
-		iRect = TRect(TPoint(0,0), iDSA->DrawingRegion()->BoundingRect().Size());
-		
-		iWin->Invalidate();
-		iWin->BeginRedraw();
-		CFbsBitGc* gc = iDSA->Gc();
-		gc->SetBrushColor(TRgb(220,220,220));
-		gc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-		gc->Clear();
-		iWin->EndRedraw();
-		After(500000);
-		}
-	
-	}
-
-void CDSATestDrawing::RunL()
-	{
-	Draw();
-	After(500000);
-	}
-
-void CDSATestDrawing::Draw()
-	{
-	iWin->Invalidate();
-	iWin->BeginRedraw();
-	CFbsBitGc* gc = iDSA->Gc();
-	gc->SetPenStyle(gc->ESolidPen);
-	gc->SetPenColor(TRgb(255,0,0));
-	gc->SetBrushStyle(gc->ENullBrush);
-	iRect.Shrink(1, 1);
-	gc->DrawRect(iRect);
-	iDSA->ScreenDevice()->Update();
-	iWin->EndRedraw();
-	
-	}
-void CDSATestDrawing::Restart(RDirectScreenAccess::TTerminationReasons /*aReason*/) 
-	{
-	
-	StartDrawingL(NULL);
-	}
-
-void CDSATestDrawing::AbortNow(RDirectScreenAccess::TTerminationReasons /*aReason*/)
-	{
-	Cancel();
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0011L
-@SYMTestCaseDesc		Test DSA drawing in different App Mode
-@SYMREQ					REQ10332 REQ10336
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPurpose			Test DSA can restart and draw at correct place when screen mode changes
-@SYMTestActions			
-	A rectangle will be drawn 1 pixel inside the DSA drawing region, and continue to shrink before the drawing
-	time runs out. when screen mode changes, DSA should restart and the rectangle should be reset to 1 pixel inside
-	the new drawing region.
-	
-	note: DSA drawing region is clipped by DSA buffer, App Size and the visible area of the window which it drawns in
-@SYMTestExpectedResults	
-	All tests should pass.
-	
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0011L()
-	{
-	LOG_AND_PANIC_IF_NOT_GCE;
-	ResetScreens();
-
-	Pause(1000);
-	MakeTitleAndCompareWindowsL(_L("GFX_WSERV_DYNAMICRES_0011L"),_L("DSA drawing"));
-	CDSATestDrawing *dsaDraw = CDSATestDrawing::NewL();
-	CleanupStack::PushL(dsaDraw);
-	CDirectScreenAccess *dsa = CDirectScreenAccess::NewL(iSession, *iScreenDevice, iCompare, *dsaDraw);
-	CleanupStack::PushL(dsa);
-	dsaDraw->SetWindow(iCompare);
-	dsaDraw->StartDrawingL(dsa);
-	
-	CEventTimer *timer = CEventTimer::NewL();
-	CleanupStack::PushL(timer);
-	
-	RArray<TInt> screenModeList;
-	iInfoScreenDevice->GetScreenSizeModeList(&screenModeList);
-	MDisplayControl* interface = static_cast<MDisplayControl*>
-				(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-	ASSERT_TRUE(interface);
-	
-	MDisplayMapping* mappingInterface = static_cast<MDisplayMapping*>
-				(iScreenDevice->GetInterface(MDisplayMapping::ETypeId));
-	ASSERT_TRUE(mappingInterface);
-	
-	CFbsScreenDevice *pixelReadBackDevice = CFbsScreenDevice::NewL(iScreenDevice->GetScreenNumber(), iScreenDevice->DisplayMode());
-	CleanupStack::PushL(pixelReadBackDevice);
-	
-	for (TInt res=0;res<screenModeList.Count();res++)
-		{
-		iScreenDevice->SetAppScreenMode(screenModeList[res]);
-		iScreenDevice->SetScreenMode(screenModeList[res]);
-		dsa->ScreenDevice()->Update();
-		Pause(300);
-		//wait for DSA to restart
-		timer->Wait(500000);
-		TRect regionRect(dsa->DrawingRegion()->BoundingRect());
-
-		TPoint winpos = iCompare.AbsPosition();
-		TSize winsize = iCompare.Size();
-		
-		TPixelsAndRotation pr;
-		iInfoScreenDevice->GetDefaultScreenSizeAndRotation(pr);
-		TPoint 	origin=iInfoScreenDevice->GetDefaultScreenModeOrigin();
-		Pause(300);
-		if (iTitle.WsHandle())
-			{
-			TPoint	infoWinPos;
-			TSize	infoWinSize;
-			infoWinPos=iTitle.AbsPosition();
-			infoWinSize=iTitle.Size();
-			infoWinSize.iHeight=pr.iPixelSize.iHeight-2*infoWinPos.iY;
-			iTitle.SetSize(infoWinSize);
-			}
-		TBuf16<20> s;
-		s.AppendNum(res);
-		UpdateTitleWindowL(s,1);
-		s.Zero();
-		s.AppendNum(pr.iPixelSize.iWidth);
-		s.Append('x');
-		s.AppendNum(pr.iPixelSize.iHeight);
-		UpdateTitleWindowL(s,2);
-		s.Zero();
-		s.AppendNum(origin.iX);
-		s.Append(',');
-		s.AppendNum(origin.iY);
-		UpdateTitleWindowL(s,3);
-		
-		INFO_PRINTF2(_L("---------test %i---------"), res);
-		INFO_PRINTF3(_L("resolution %i x %i"), pr.iPixelSize.iWidth, pr.iPixelSize.iHeight);
-		INFO_PRINTF3(_L("Origin (%i, %i)"), origin.iX, origin.iY);
-		//INFO_PRINTF3(_L("Test Window Origin (%i, %i)"), iCompare.AbsPosition().iX, iCompare.AbsPosition().iY);
-		INFO_PRINTF3(_L("DSA drawing region bounding rect origin (%i, %i)"), dsa->DrawingRegion()->BoundingRect().iTl.iX,
-				dsa->DrawingRegion()->BoundingRect().iTl.iY);
-		INFO_PRINTF3(_L("DSA drawing region bounding rect size (%i x %i)"), dsa->DrawingRegion()->BoundingRect().Width(),
-						dsa->DrawingRegion()->BoundingRect().Height());
-		//give time so DSA AO can start drawing
-		timer->Wait(5000000);
-		
-
-		TRect readBackRect;
-		mappingInterface->MapCoordinates(EApplicationSpace, TRect(0,0,1,1), EDirectScreenAccessSpace, readBackRect);
-		pixelReadBackDevice->SetDrawDeviceOffset(readBackRect.iTl);
-		pixelReadBackDevice->SetDeviceOrientation((TDeviceOrientation)(1 << pr.iRotation));
-		readBackRect.SetRect(dsa->DrawingRegion()->BoundingRect().iTl, dsa->DrawingRegion()->BoundingRect().iBr);
-		
-		if(readBackRect.IsEmpty())
-			{
-			INFO_PRINTF1(_L("DSA drawing region is empty, skip checking pixel colour"));
-			continue;
-			}
-		
-		//if my rectangle's iTl is (0,0) and iBr is (100,100). Why does it gives me the rect width and height
-		//both 100? 0 - 100 is 101 pixels drawn. Or does this indicates iBr is exclusive and iTl is inclusive?
-		//Ruo: Oh I almost believe iBr is exclusive now
-		TDisplayConfiguration dispConfigAfter2;
-		interface->GetConfiguration(dispConfigAfter2);
-		TSize theSize;
-		dispConfigAfter2.GetResolution(theSize);
-		TDisplayConfiguration1::TRotation orient;
-		dispConfigAfter2.GetRotation(orient);
-		if (orient == TDisplayConfiguration1::ERotation90CW || orient == TDisplayConfiguration1::ERotation270CW)
-			{
-			TInt temp = theSize.iHeight;
-			theSize.iHeight = theSize.iWidth;
-			theSize.iWidth = temp;
-			}
-		TRect uiSize(TPoint(0,0), theSize);
-		MDisplayMapping* mappingInterface = static_cast<MDisplayMapping*>
-					(iScreenDevice->GetInterface(MDisplayMapping::ETypeId));
-		ASSERT_TRUE(mappingInterface);
-		TRect finalSize;
-		mappingInterface->MapCoordinates(EApplicationSpace, uiSize, ECompositionSpace, finalSize);
-				
-		CFbsBitmap* bmp2 = new (ELeave) CFbsBitmap;
-		CleanupStack::PushL(bmp2);
-		User::LeaveIfError(bmp2->Create(finalSize.Size(), EColor16MU));
-		MTestScreenCapture
-				* csc =
-						static_cast<MTestScreenCapture*> (iScreenDevice->GetInterface(MTestScreenCapture::KUidTestScreenCaptureIf));
-	
-		if (csc)
-			{
-			TInt errr = csc->ComposeScreen(*bmp2);
-			ASSERT_TRUE(errr == KErrNone);
-			}
-		else
-			{
-			if (!cSCLogged)
-				{
-				cSCLogged = ETrue;
-				_LIT(KNoCSC, "CSC testing not enabled as CSC render stage not defined");
-				Logger().LogExtra(((TText8*)__FILE__), __LINE__, ESevrAll, KNoCSC);
-				}
-			}
-
-		readBackRect.iBr = readBackRect.iBr - TPoint(1,1);
-		//check 4 outter corners
-		TRgb pixelRgb;
-		TRgb cornerRgb(220, 220, 220);
-		TRgb innerRgb(255, 0, 0);
-		readBackRect.Grow(1, 1);
-		TRect compSpaceReadBackRect;
-		mappingInterface->MapCoordinates(EApplicationSpace, readBackRect, ECompositionSpace, compSpaceReadBackRect);
-
-			
-		if (csc)
-			{
-			if (finalSize.Contains(compSpaceReadBackRect.iTl))
-				{
-				bmp2->GetPixel(pixelRgb, compSpaceReadBackRect.iTl);
-				if(!(pixelRgb != cornerRgb))
-					{
-					_LIT(KCompareFailed, "Corner check failed on app mode: %d");
-					TBuf<256> x;
-					x.Format(KCompareFailed, res+1);
-					Logger().LogExtra(((TText8*)__FILE__), __LINE__, ESevrErr, x);
-					CleanupStack::PopAndDestroy(bmp2);
-					continue;
-					}
-				}
-			if (finalSize.Contains(TPoint(compSpaceReadBackRect.iBr.iX, compSpaceReadBackRect.iTl.iY)))
-				{
-				bmp2->GetPixel(pixelRgb, TPoint(compSpaceReadBackRect.iBr.iX, compSpaceReadBackRect.iTl.iY));
-				if(!(pixelRgb != cornerRgb))
-					{
-					_LIT(KCompareFailed, "Corner check failed on app mode: %d");
-					TBuf<256> x;
-					x.Format(KCompareFailed, res+1);
-					Logger().LogExtra(((TText8*)__FILE__), __LINE__, ESevrErr, x);
-					CleanupStack::PopAndDestroy(bmp2);
-					continue;
-					}
-				}
-			if (finalSize.Contains(compSpaceReadBackRect.iBr))
-				{
-				bmp2->GetPixel(pixelRgb, compSpaceReadBackRect.iBr);
-				if(!(pixelRgb != cornerRgb))
-					{
-					_LIT(KCompareFailed, "Corner check failed on app mode: %d");
-					TBuf<256> x;
-					x.Format(KCompareFailed, res+1);
-					Logger().LogExtra(((TText8*)__FILE__), __LINE__, ESevrErr, x);
-					CleanupStack::PopAndDestroy(bmp2);
-					continue;
-					}
-				}
-			if (finalSize.Contains(TPoint(compSpaceReadBackRect.iTl.iX, compSpaceReadBackRect.iBr.iY)))
-				{
-				bmp2->GetPixel(pixelRgb, TPoint(compSpaceReadBackRect.iTl.iX, compSpaceReadBackRect.iBr.iY));
-				if(!(pixelRgb != cornerRgb))
-					{
-					_LIT(KCompareFailed, "Corner check failed on app mode: %d");
-					TBuf<256> x;
-					x.Format(KCompareFailed, res+1);
-					Logger().LogExtra(((TText8*)__FILE__), __LINE__, ESevrErr, x);
-					CleanupStack::PopAndDestroy(bmp2);
-					continue;
-					}
-				}
-			}
-		
-		pixelReadBackDevice->GetPixel(pixelRgb, readBackRect.iTl);
-		ASSERT_TRUE(pixelRgb != cornerRgb);
-		pixelReadBackDevice->GetPixel(pixelRgb, TPoint(readBackRect.iBr.iX, readBackRect.iTl.iY));
-		ASSERT_TRUE(pixelRgb != cornerRgb);
-		pixelReadBackDevice->GetPixel(pixelRgb, readBackRect.iBr);
-		ASSERT_TRUE(pixelRgb != cornerRgb);
-		pixelReadBackDevice->GetPixel(pixelRgb, TPoint(readBackRect.iTl.iX, readBackRect.iBr.iY));
-		ASSERT_TRUE(pixelRgb != cornerRgb);
-		
-		//check 4 inner corners
-		readBackRect.Shrink(1,1);
-		mappingInterface->MapCoordinates(EApplicationSpace, readBackRect, ECompositionSpace, compSpaceReadBackRect);
-	
-		if (csc)
-			{
-			if (finalSize.Contains(compSpaceReadBackRect.iTl))
-				{
-				bmp2->GetPixel(pixelRgb, compSpaceReadBackRect.iTl);
-				if(!(pixelRgb == cornerRgb))
-					{
-					_LIT(KCompareFailed, "Corner check failed on app mode: %d");
-					TBuf<256> x;
-					x.Format(KCompareFailed, res+1);
-					Logger().LogExtra(((TText8*)__FILE__), __LINE__, ESevrErr, x);
-					CleanupStack::PopAndDestroy(bmp2);
-					continue;
-					}
-				}
-			if (finalSize.Contains(TPoint(compSpaceReadBackRect.iBr.iX, compSpaceReadBackRect.iTl.iY)))
-				{
-				bmp2->GetPixel(pixelRgb, TPoint(compSpaceReadBackRect.iBr.iX, compSpaceReadBackRect.iTl.iY));
-				if(!(pixelRgb == cornerRgb))
-					{
-					_LIT(KCompareFailed, "Corner check failed on app mode: %d");
-					TBuf<256> x;
-					x.Format(KCompareFailed, res+1);
-					Logger().LogExtra(((TText8*)__FILE__), __LINE__, ESevrErr, x);
-					CleanupStack::PopAndDestroy(bmp2);
-					continue;
-					}
-				}
-			if (finalSize.Contains(compSpaceReadBackRect.iBr))
-				{
-				bmp2->GetPixel(pixelRgb, compSpaceReadBackRect.iBr);
-				if(!(pixelRgb == cornerRgb))
-					{
-					_LIT(KCompareFailed, "Corner check failed on app mode: %d");
-					TBuf<256> x;
-					x.Format(KCompareFailed, res+1);
-					Logger().LogExtra(((TText8*)__FILE__), __LINE__, ESevrErr, x);
-					CleanupStack::PopAndDestroy(bmp2);
-					continue;
-					}
-				}
-			if (finalSize.Contains(TPoint(compSpaceReadBackRect.iTl.iX, compSpaceReadBackRect.iBr.iY)))
-				{
-				bmp2->GetPixel(pixelRgb, TPoint(compSpaceReadBackRect.iTl.iX, compSpaceReadBackRect.iBr.iY));
-				if(!(pixelRgb == cornerRgb))
-					{
-					_LIT(KCompareFailed, "Corner check failed on app mode: %d");
-					TBuf<256> x;
-					x.Format(KCompareFailed, res+1);
-					Logger().LogExtra(((TText8*)__FILE__), __LINE__, ESevrErr, x);
-					CleanupStack::PopAndDestroy(bmp2);
-					continue;
-					}
-				}
-			}
-		
-		pixelReadBackDevice->GetPixel(pixelRgb, readBackRect.iTl);
-		ASSERT_TRUE(pixelRgb == cornerRgb);
-		pixelReadBackDevice->GetPixel(pixelRgb, TPoint(readBackRect.iBr.iX, readBackRect.iTl.iY));
-		ASSERT_TRUE(pixelRgb == cornerRgb);
-		pixelReadBackDevice->GetPixel(pixelRgb, readBackRect.iBr);
-		ASSERT_TRUE(pixelRgb == cornerRgb);
-		pixelReadBackDevice->GetPixel(pixelRgb, TPoint(readBackRect.iTl.iX, readBackRect.iBr.iY));
-		ASSERT_TRUE(pixelRgb == cornerRgb);
-		//check inner colour
-		if(readBackRect.Width() < 3 || readBackRect.Height() < 3)
-			{
-			INFO_PRINTF1(_L("DSA drawing region is too small for drawing inner rectangle skip checking inner colour"));
-			CleanupStack::PopAndDestroy(bmp2);
-			continue;
-			}
-		
-		readBackRect.Shrink(1,1);
-		mappingInterface->MapCoordinates(EApplicationSpace, readBackRect, ECompositionSpace, compSpaceReadBackRect);
-		
-		if (csc)
-			{
-			if (finalSize.Contains(compSpaceReadBackRect.iTl))
-				{
-				bmp2->GetPixel(pixelRgb, compSpaceReadBackRect.iTl);
-				if(!(pixelRgb == innerRgb))
-					{
-					_LIT(KCompareFailed, "Corner check failed on app mode: %d");
-					TBuf<256> x;
-					x.Format(KCompareFailed, res+1);
-					Logger().LogExtra(((TText8*)__FILE__), __LINE__, ESevrErr, x);
-					CleanupStack::PopAndDestroy(bmp2);
-					continue;
-					}
-				}
-			if (finalSize.Contains(TPoint(compSpaceReadBackRect.iBr.iX, compSpaceReadBackRect.iTl.iY)))
-				{
-				bmp2->GetPixel(pixelRgb, TPoint(compSpaceReadBackRect.iBr.iX, compSpaceReadBackRect.iTl.iY));
-				if(!(pixelRgb == innerRgb))
-					{
-					_LIT(KCompareFailed, "Corner check failed on app mode: %d");
-					TBuf<256> x;
-					x.Format(KCompareFailed, res+1);
-					Logger().LogExtra(((TText8*)__FILE__), __LINE__, ESevrErr, x);
-					CleanupStack::PopAndDestroy(bmp2);
-					continue;
-					}
-				}
-			if (finalSize.Contains(compSpaceReadBackRect.iBr))
-				{
-				bmp2->GetPixel(pixelRgb, compSpaceReadBackRect.iBr);
-				if(!(pixelRgb == innerRgb))
-					{
-					_LIT(KCompareFailed, "Corner check failed on app mode: %d");
-					TBuf<256> x;
-					x.Format(KCompareFailed, res+1);
-					Logger().LogExtra(((TText8*)__FILE__), __LINE__, ESevrErr, x);
-					CleanupStack::PopAndDestroy(bmp2);
-					continue;
-					}
-				}
-			if (finalSize.Contains(TPoint(compSpaceReadBackRect.iTl.iX, compSpaceReadBackRect.iBr.iY)))
-				{
-				bmp2->GetPixel(pixelRgb, TPoint(compSpaceReadBackRect.iTl.iX, compSpaceReadBackRect.iBr.iY));
-				if(!(pixelRgb == innerRgb))
-					{
-					_LIT(KCompareFailed, "Corner check failed on app mode: %d");
-					TBuf<256> x;
-					x.Format(KCompareFailed, res+1);
-					Logger().LogExtra(((TText8*)__FILE__), __LINE__, ESevrErr, x);
-					CleanupStack::PopAndDestroy(bmp2);
-					continue;
-					}
-				}
-			}
-		
-		pixelReadBackDevice->GetPixel(pixelRgb, readBackRect.iTl);
-		ASSERT_TRUE(pixelRgb == innerRgb);
-		pixelReadBackDevice->GetPixel(pixelRgb, TPoint(readBackRect.iBr.iX, readBackRect.iTl.iY));
-		ASSERT_TRUE(pixelRgb == innerRgb);
-		pixelReadBackDevice->GetPixel(pixelRgb, readBackRect.iBr);
-		ASSERT_TRUE(pixelRgb == innerRgb);
-		pixelReadBackDevice->GetPixel(pixelRgb, TPoint(readBackRect.iTl.iX, readBackRect.iBr.iY));
-		ASSERT_TRUE(pixelRgb == innerRgb);
-
-		CleanupStack::PopAndDestroy(bmp2);
-		}
-	screenModeList.Close();
-	CleanupStack::PopAndDestroy(4, dsaDraw);
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0012L
-@SYMTestCaseDesc		Test Pointer event coordinates are correct in different screen modes.
-@SYMREQ					REQ10336
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPriority		1
-@SYMTestPurpose			Test Pointer event coordinates are correct in different screen mode
-@SYMTestActions			
-	In each screen mode, the simulated pointer event should always at the same relative position
-	inside iCompare window
-@SYMTestExpectedResults	
-	All test should pass
-	**NOTE  Can only be tested in screen 0 **
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0012L()
-	{
-	LOG_AND_PANIC_IF_NOT_GCE;
-	ResetScreens();
-	MakeTitleAndCompareWindowsL(_L("GFX_WSERV_DYNAMICRES_0012L"),_L("Pointer coordinates"));		
-	Pause(300);
-
-	CWsDisplayEvent* displayEventAO = new(ELeave) CWsDisplayEvent(&iSession);
-	CleanupStack::PushL(displayEventAO);
-	displayEventAO->Request();
-	CEventTimer *timer = CEventTimer::NewL();
-	CleanupStack::PushL(timer);
-	
-	MDisplayMapping* mappingInterface = static_cast<MDisplayMapping*>
-				(iScreenDevice->GetInterface(MDisplayMapping::ETypeId));
-	ASSERT_TRUE(mappingInterface);
-	
-	RArray<TInt> screenModeList;
-	iInfoScreenDevice->GetScreenSizeModeList(&screenModeList);
-	iSession.SetFocusScreen(TGlobalSettings::Instance().iScreen);
-	
-	for (TInt res=0;res<screenModeList.Count();res++)
-		{
-		iScreenDevice->SetAppScreenMode(screenModeList[res]);
-		iScreenDevice->SetScreenMode(screenModeList[res]);
-		Pause(300);
-		
-		//win position in app space
-		TPoint winPos = iCompare.AbsPosition();
-		TSize winSize = iCompare.Size();
-		
-		//pointer event at the origin of window
-		TRect rectNearWinOrigin(winPos+TPoint(1,1), TSize(1,1));
-		//the expected pointer position received by client to compare with the actual point received.
-		//it's (1,1) because it's relative to window
-		displayEventAO->SetExpectedPointPos(TPoint(1, 1)); 
-		TRect rectInComp, rectBackInApp;
-		mappingInterface->MapCoordinates(EApplicationSpace, rectNearWinOrigin, ECompositionSpace, rectInComp);
-		//as we got the physical coordinates at where we simulate pointer event
-		TRawEvent rawEvent;
-		rawEvent.Set(TRawEvent::EButton1Down, rectInComp.iTl.iX, rectInComp.iTl.iY);
-		iSession.SimulateRawEvent(rawEvent);
-		rawEvent.Set(TRawEvent::EButton1Up, rectInComp.iTl.iX, rectInComp.iTl.iY);
-		iSession.SimulateRawEvent(rawEvent);
-		iSession.Flush();
-		timer->Wait(1000);
-		
-		ASSERT_EQUALS(displayEventAO->ReceivedPointerEventCount(), res*4+2);
-		ASSERT_TRUE(displayEventAO->PointerTestPassed());
-		
-		//pointer event at 1/2 width and height inside the window
-		TRect rectAtWinCenter(winPos+TPoint(winSize.iWidth/2, winSize.iHeight/2), TSize(1,1));
-		displayEventAO->SetExpectedPointPos(rectAtWinCenter.iTl - winPos);
-		mappingInterface->MapCoordinates(EApplicationSpace, rectAtWinCenter, ECompositionSpace, rectInComp);
-		//as we got the physical coordinates at where we simulate pointer event
-		rawEvent.Set(TRawEvent::EButton1Down, rectInComp.iTl.iX, rectInComp.iTl.iY);
-		iSession.SimulateRawEvent(rawEvent);
-		rawEvent.Set(TRawEvent::EButton1Up, rectInComp.iTl.iX, rectInComp.iTl.iY);
-		iSession.SimulateRawEvent(rawEvent);
-		iSession.Flush();
-		timer->Wait(1000);
-		
-		ASSERT_EQUALS(displayEventAO->ReceivedPointerEventCount(), res*4 + 4);
-		ASSERT_TRUE(displayEventAO->PointerTestPassed());
-		}
-	screenModeList.Close();
-	CleanupStack::PopAndDestroy(2, displayEventAO);
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0013L
-@SYMTestCaseDesc		Test the twips size after detach
-@SYMREQ					REQ10329
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPurpose			Make sure the twips size is undefined after detach.
-@SYMTestActions			
-	Save display configuration before detach and compare it with the display configuration after detach.
-@SYMTestExpectedResults	
-	all tests should pass
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0013L()
-	{
-	LOG_AND_PANIC_IF_NOT_GCE;
-	ResetScreens();
-#ifdef MODE_CHANGE_BASE_FUNCTIONALITY_NOT_PRESENT_IN_HEADER
-	ASSERT_FALSE("Test not compiled because MODE_CHANGE_BASE_FUNCTIONALITY_NOT_PRESENT_IN_HEADER");
-#else
-	TInt error;
-	iSession.Finish(ETrue);
-	MakeTitleAndCompareWindowsL(_L("GFX_WSERV_DYNAMICRES_0013L"),_L("detach/attach - twips size"));
-	iSession.Finish(ETrue);
-
-	Pause(1000);
-	TInt screenNo = iScreenDevice->GetScreenNumber();
-	RArray<TInt> screenModeList;
-	iInfoScreenDevice->GetScreenSizeModeList(&screenModeList);
-	MDisplayControl* interface = static_cast<MDisplayControl*>
-				(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-	ASSERT_TRUE(interface);
-	
-	MDisplayMapping* mappingInterface = static_cast<MDisplayMapping*>
-				(iScreenDevice->GetInterface(MDisplayMapping::ETypeId));
-	ASSERT_TRUE(mappingInterface);
-	
-	TInt resolutions = interface->NumberOfResolutions();
-	ASSERT_TRUE (resolutions > 0);
-	
-	RArray<MDisplayControl::TResolution> resolutionList1;
-	error = interface->GetResolutions(resolutionList1);
-	ASSERT_EQUALS(error,KErrNone);
-	ASSERT_EQUALS(resolutionList1.Count(), resolutions);
-	
-	TDisplayConfiguration configBeforeDetach;
-	
-	// detach the display
-	interface->GetConfiguration(configBeforeDetach);
-	TInt displayState = EDisconnect;
-	UserSvr::HalFunction(EHalGroupDisplay | (screenNo<<16), EDisplayHalSetDisplayState, &displayState, NULL);
-	Pause(300);
-	
-	// retrieve the display configuration
-	interface->GetConfiguration(configBeforeDetach);
-	ASSERT_FALSE(configBeforeDetach.IsDefined(TDisplayConfiguration::EResolutionTwips));
-	
-	error = interface->GetResolutions(resolutionList1);
-	ASSERT_EQUALS(error,KErrDisconnected);
-	
-	configBeforeDetach.ClearAll();
-	
-	screenModeList.Close();
-	resolutionList1.Close();
-	
-	displayState = ENormalResolution;
-	UserSvr::HalFunction(EHalGroupDisplay | (screenNo<<16), EDisplayHalSetDisplayState, &displayState, NULL);
-#endif
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0014L
-@SYMTestCaseDesc		Test GetConfiguration immediatly after SetConfiguration
-@SYMREQ					REQ10328
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPurpose			Make sure the twips size is buffered so immediate GetConfiguration can get correct twip size
-@SYMTestActions			
-	successive SetConfiguration/GetConfiguration pair 
-@SYMTestExpectedResults	
-	all tests should pass
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0014L()
-	{
-	MDisplayControl* interface = static_cast<MDisplayControl*>
-					(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-	ASSERT_TRUE(interface);
-	
-	RArray<MDisplayControl::TResolution> resolutions;
-	TInt err = interface->GetResolutions(resolutions);
-	ASSERT_EQUALS(err, KErrNone);
-	TDisplayConfiguration configSet, configGet;
-	TSize twipsGet, resolutionGet;
-	
-	TInt screenNo = iScreenDevice->GetScreenNumber();
-	iSession.SetFocusScreen(TGlobalSettings::Instance().iScreen);
-	for(TInt testIndex = 0; testIndex < 2; testIndex++)
-		{//run twice
-#ifdef MODE_CHANGE_BASE_FUNCTIONALITY_NOT_PRESENT_IN_HEADER
-	INFO_PRINTF1(_L("Test not compiled because MODE_CHANGE_BASE_FUNCTIONALITY_NOT_PRESENT_IN_HEADER"));
-#else
-		TInt displayState;
-		displayState = ENormalResolution;
-		UserSvr::HalFunction(EHalGroupDisplay | (screenNo<<16), EDisplayHalSetDisplayState, &displayState, NULL);
-#endif
-		for (TInt i=0;i<resolutions.Count();i++)
-			{
-			INFO_PRINTF2(_L("i = %i"), i);
-			INFO_PRINTF3(_L("resolutions: %i x %i"), resolutions[i].iPixelSize.iWidth, resolutions[i].iPixelSize.iHeight);
-			INFO_PRINTF3(_L("twips: %i x %i"), resolutions[i].iTwipsSize.iWidth, resolutions[i].iTwipsSize.iHeight);
-			configSet.ClearAll();
-			configGet.ClearAll();
-			configSet.SetResolution(resolutions[i].iPixelSize);
-			err = interface->SetConfiguration(configSet);
-			if(err != KErrNone)
-				{
-				//with scaling, KErrArgument means current config is not compatible with appmode. 
-				//In none scaling, it does mean an error,
-				//but the purpose of this test is to see if twips size is buffered so we can read it back instantly
-				//let other tests test the functionality of SetConfiguration.
-				ASSERT_EQUALS(err, KErrArgument); 
-												
-				INFO_PRINTF1(_L("this configuration is not compatible with current appmode, skip"));
-				continue;
-				}
-			interface->GetConfiguration(configGet);
-			ASSERT_TRUE(configGet.IsDefined(TDisplayConfigurationBase::EResolutionTwips));
-			ASSERT_TRUE(configGet.IsDefined(TDisplayConfigurationBase::EResolution));
-			configGet.GetResolutionTwips(twipsGet);
-			configGet.GetResolution(resolutionGet);
-			INFO_PRINTF3(_L("resolution readback: %i x %i"), resolutionGet.iWidth, resolutionGet.iHeight);
-			INFO_PRINTF3(_L("twips readback: %i x %i"), twipsGet.iWidth, twipsGet.iHeight);
-			ASSERT_EQUALS(twipsGet, resolutions[i].iTwipsSize);
-			Pause(300);
-			}
-#ifdef MODE_CHANGE_BASE_FUNCTIONALITY_NOT_PRESENT_IN_HEADER
-	INFO_PRINTF1(_L("Test not compiled because MODE_CHANGE_BASE_FUNCTIONALITY_NOT_PRESENT_IN_HEADER"));
-#else
-		displayState = EDisconnect;
-		UserSvr::HalFunction(EHalGroupDisplay | (screenNo<<16), EDisplayHalSetDisplayState, &displayState, NULL);
-#endif		
-		}
-	resolutions.Close();
-	
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0015L
-@SYMTestCaseDesc		No Scaling doesnt return virtual resolutions
-@SYMREQ					REQ10336
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPriority		1
-@SYMTestPurpose			no scaling should mean basic resolution selection
-@SYMTestActions			
-	Get resolution list
-	Should not contain virtual resolutions
-	Set every app mode
-	Should not change resolution
-@SYMTestExpectedResults	
-	All test should pass
-	**SENSITIVE TO CHANGES IN EPOC.INI and WSINI.INI**
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0015L()
-	{	//ONLY RUN WITH 'NO SCALING' WSINI.INI, can be found in resources
-	MDisplayControl* interface = static_cast<MDisplayControl*>
-			(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-	ASSERT_TRUE(interface);
-	
-	TInt resolutions = interface->NumberOfResolutions();
-	TInt screenNumber = iScreenDevice->GetScreenNumber();
-	if (screenNumber == 0)
-		{
-		ASSERT_EQUALS(resolutions,1);
-		}
-	else if (screenNumber == 1)
-		{
-		ASSERT_EQUALS(resolutions,4);
-		}	
-	
-	RArray<MDisplayControl::TResolution> resolutionList1;
-	TInt error = interface->GetResolutions(resolutionList1);
-	ASSERT_EQUALS(error,KErrNone);
-	ASSERT_EQUALS(resolutionList1.Count(), resolutions);
-	
-	RArray<TInt> screenModeList;
-	iInfoScreenDevice->GetScreenSizeModeList(&screenModeList);
-	
-	TDisplayConfiguration dispConfig1;
-	interface->GetConfiguration(dispConfig1);
-	TSize size1;
-	ASSERT_TRUE(dispConfig1.GetResolution(size1));
-	
-	for (TInt ii = 0; ii < screenModeList.Count(); ii++)
-		{
-		iInfoScreenDevice->SetAppScreenMode(screenModeList[ii]);
-		iInfoScreenDevice->SetScreenMode(screenModeList[ii]);
-		iSession.Finish(ETrue);
-		Pause(300);
-		
-		TDisplayConfiguration newConfig;
-		interface->GetConfiguration(newConfig);
-		TSize newSize;
-		ASSERT_TRUE(dispConfig1.GetResolution(newSize));
-		ASSERT_EQUALS(size1,newSize);
-		}
-	iInfoScreenDevice->SetAppScreenMode(screenModeList[0]);
-	iInfoScreenDevice->SetScreenMode(screenModeList[0]);
-	iSession.Finish(ETrue);
-	Pause(300);
-	
-	screenModeList.Close();
-	resolutionList1.Close();
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0016L
-@SYMTestCaseDesc		Anisotropic scaling
-@SYMREQ					REQ10336
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPriority		1
-@SYMTestPurpose			Check using twips will cause virtual resolutions to possibly be different
-@SYMTestActions			
-	Check the virtual resolution for XXX is correctly XXX
-	Check when setting the appmode, it choses the correct resolution
-@SYMTestExpectedResults	
-	Tests should pass
-	**SENSITIVE TO CHANGES IN EPOC.INI and WSINI.INI**
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0016L()
-	{	//ONLY RUN WITH ANISOTROPIC WSINI.INI
-
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0017L
-@SYMTestCaseDesc		Integer scales correctly in policy
-@SYMREQ					REQ10336
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPriority		1
-@SYMTestPurpose			Integer scaling should not create resolutions of non integer value!
-@SYMTestActions			
-	For every virtual resolution
-		Check its an integer size of a real resolution
-@SYMTestExpectedResults	
-	All should be integers (1:1 , 1:2 , 1:3 or 1:4 in current policy)
-	**NOTE ONLY RUN WITH INTEGER WSINI.INI**
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0017L()
-	{	//ONLY RUN WITH INTEGER WSINI.INI
-	MDisplayControl* interface = static_cast<MDisplayControl*>
-			(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-	ASSERT_TRUE(interface);
-	
-	TInt resolutions = interface->NumberOfResolutions();
-	ASSERT_TRUE(resolutions>1);
-	
-	RArray<MDisplayControl::TResolution> resolutionList1;
-	TInt error = interface->GetResolutions(resolutionList1);
-	ASSERT_EQUALS(error,KErrNone);
-	ASSERT_EQUALS(resolutionList1.Count(), resolutions);
-	
-	TInt index;
-	for (index=0;index<resolutions;index++)
-		{
-		if (resolutionList1[index].iFlags.IsSet(MDisplayControlBase::TResolution::EIsVirtual))
-			{
-			TBool foundMatch = EFalse;
-			for (TInt index2=0;index2<resolutions;index2++)
-				{
-				if (resolutionList1[index2].iFlags.IsClear(MDisplayControlBase::TResolution::EIsVirtual))
-					{
-					for (TInt scale=1;scale<=4;scale++)
-						{
-						TSize compare;
-						compare.iWidth=resolutionList1[index].iPixelSize.iWidth/scale;
-						compare.iHeight=resolutionList1[index].iPixelSize.iHeight/scale;
-						if (resolutionList1[index2].iPixelSize == compare)
-							{
-							foundMatch = ETrue;
-							break;
-							}
-						}
-					}
-				if (foundMatch)
-					{
-					break;
-					}
-				}
-			ASSERT_TRUE(foundMatch);
-			}
-		}
-	resolutionList1.Close();
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0018L
-@SYMTestCaseDesc		MDisplayMapping interface function test
-@SYMREQ					REQ10336
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPriority		1
-@SYMTestPurpose			All the MDisplayMapping interface functions are consistent
-@SYMTestActions			
-	Check different mapping functions are consistent
-@SYMTestExpectedResults	
-	All test should pass
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0018L()
-	{
-	
-	LOG_AND_PANIC_IF_NOT_GCE;
-	ResetScreens();
-	TInt error;
-	iSession.Finish(ETrue);
-	MakeTitleAndCompareWindowsL(_L("GFX_WSERV_DYNAMICRES_0020L"),_L("Mapping function consistency"));
-	iSession.Finish(ETrue);
-	
-	MDisplayControl* interface = static_cast<MDisplayControl*>
-			(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-	ASSERT_TRUE(interface);
-	
-	MDisplayMapping* mapInterface = static_cast<MDisplayMapping*>
-			(iScreenDevice->GetInterface(MDisplayMapping::ETypeId));
-	ASSERT_TRUE(mapInterface);
-	
-	RArray<TInt> screenModeList;
-	iInfoScreenDevice->GetScreenSizeModeList(&screenModeList);
-	
-	TRect maxWinExtent, refMaxWinExtent;
-	TSize surfaceSize, surfaceTwips, refSurfaceSize, refSurfaceTwips;
-	TRect displayWinExtent, refDisplayWinExtent;
-	for (TInt i = 0; i < screenModeList.Count(); i++)
-		{
-		iInfoScreenDevice->SetAppScreenMode(screenModeList[i]);
-		iInfoScreenDevice->SetScreenMode(screenModeList[i]);
-		iSession.Finish(ETrue);
-		Pause(300);
-		
-		INFO_PRINTF1(_L("---------------"));
-		INFO_PRINTF2(_L("screen mode : %i"), screenModeList[i]);
-		
-		mapInterface->GetMaximumWindowExtent(maxWinExtent);
-		INFO_PRINTF3(_L("MaximumWindowExtent Origin: (%i, %i)"), maxWinExtent.iTl.iX, maxWinExtent.iTl.iY);
-		INFO_PRINTF3(_L("MaximumWindowExtent Size: %i x %i"), maxWinExtent.Width(), maxWinExtent.Height());
-		
-		
-		TDisplayConfiguration config;
-		interface->GetConfiguration(config);
-		ASSERT_TRUE(config.IsDefined(TDisplayConfigurationBase::EResolution));
-		TSize fullUiSize;
-		config.GetResolution(fullUiSize);
-		error = mapInterface->MapCoordinates(EFullScreenSpace, fullUiSize, EApplicationSpace, refMaxWinExtent);
-		ASSERT_EQUALS(error, KErrNone);
-		INFO_PRINTF3(_L("ref MaximumWindowExtent Origin: (%i, %i)"), refMaxWinExtent.iTl.iX, refMaxWinExtent.iTl.iY);
-		INFO_PRINTF3(_L("ref MaximumWindowExtent Size: %i x %i"), refMaxWinExtent.Width(), refMaxWinExtent.Height());
-		ASSERT_EQUALS(maxWinExtent, refMaxWinExtent);
-		INFO_PRINTF1(_L("Match"));
-		
-		mapInterface->GetMaximumSurfaceSize(surfaceSize, surfaceTwips);
-		INFO_PRINTF3(_L("MaxSurfaceSize: %i x %i"), surfaceSize.iWidth, surfaceSize.iHeight);
-		INFO_PRINTF3(_L("MaxSurfaceTwips: %i x %i"), surfaceTwips.iWidth, surfaceSize.iHeight);
-		TRect compositionRect;
-		error = mapInterface->MapCoordinates(EFullScreenSpace, fullUiSize, ECompositionSpace, compositionRect);
-		ASSERT_EQUALS(error, KErrNone);
-		refSurfaceSize = compositionRect.Size();
-		INFO_PRINTF3(_L("RefSurfaceSize: %i x %i"), refSurfaceSize.iWidth, refSurfaceSize.iHeight);
-		ASSERT_TRUE(config.IsDefined(TDisplayConfigurationBase::EResolutionTwips));
-		config.GetResolutionTwips(refSurfaceTwips);
-		INFO_PRINTF3(_L("RefSurfaceTwips: %i x %i"), refSurfaceTwips.iWidth, refSurfaceTwips.iHeight);
-		ASSERT_EQUALS(surfaceSize, refSurfaceSize);
-		ASSERT_EQUALS(surfaceTwips, refSurfaceTwips);
-		INFO_PRINTF1(_L("Match"));
-		
-		mapInterface->GetDisplayExtentOfWindow(iCompare, displayWinExtent);
-		INFO_PRINTF3(_L("DisplayWin origin: (%i, %i)"), displayWinExtent.iTl.iX, displayWinExtent.iTl.iY);
-		INFO_PRINTF3(_L("DisplayWin Size: (%i x %i"), displayWinExtent.Width(), displayWinExtent.Height());
-		error = mapInterface->MapCoordinates(EApplicationSpace, TRect(TPoint(iCompare.AbsPosition()),iCompare.Size()), ECompositionSpace, refDisplayWinExtent);
-		ASSERT_EQUALS(error, KErrNone);
-		INFO_PRINTF3(_L("RefDisplayWin origin: (%i, %i)"), refDisplayWinExtent.iTl.iX, refDisplayWinExtent.iTl.iY);
-		INFO_PRINTF3(_L("RefDisplayWin Size: (%i x %i"), refDisplayWinExtent.Width(), refDisplayWinExtent.Height());
-		ASSERT_EQUALS(displayWinExtent, refDisplayWinExtent);
-		INFO_PRINTF1(_L("Match"));
-		}
-	iInfoScreenDevice->SetAppScreenMode(screenModeList[0]);
-	iInfoScreenDevice->SetScreenMode(screenModeList[0]);
-	screenModeList.Close();
-	}
-
-/*
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0021L
-@SYMTestCaseDesc		SetResolution negative test
-@SYMREQ					REQ10326
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPriority		1
-@SYMTestPurpose			Invalid configurations should return error and change nothing!
-@SYMTestActions			
-	Set config with rubbish resolution
-	Set config with rubbish twips
-	Set config with valid resolution, rubbish twips
-	Set config with valid twips, rubbish resolution
-	Set config with nothing defined
-@SYMTestExpectedResults	
-	Should all fail safely and not change any settings.
-	Config with nothing defined in a scaled mode will reset the resolution to current modes
-	equivilent virtual resolution
-	**NOTE ONLY RUN IN SCREEN 1 - we need multiple resolutions available**
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0021L(TBool aScaleMode)
-	{	//aScaleMode 0 = no scaling, 1 = integer,isotropic or anisotropic
-	MDisplayControl* interface = static_cast<MDisplayControl*>
-			(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-	ASSERT_TRUE(interface);
-	
-	TInt resolutions = interface->NumberOfResolutions();
-	ASSERT_TRUE (resolutions > 1);
-		
-	RArray<MDisplayControl::TResolution> resolutionList1;
-	TInt error = interface->GetResolutions(resolutionList1);
-	ASSERT_EQUALS(resolutionList1.Count(), resolutions);
-	
-	TDisplayConfiguration original;
-	original.SetResolution(resolutionList1[0].iPixelSize);
-	error = interface->SetConfiguration(original);
-	ASSERT_EQUALS(error,KErrNone);
-	
-	TDisplayConfiguration beforeConfig;
-	TDisplayConfiguration afterConfig;
-	interface->GetConfiguration(beforeConfig);
-	
-	TInt differentRes;
-	for (differentRes = 1; differentRes < resolutions; differentRes++)
-		{
-		if (!(resolutionList1[differentRes].iPixelSize == resolutionList1[0].iPixelSize))
-			{
-			break;
-			}
-		}
-	ASSERT_TRUE(differentRes < resolutions);	//otherwise it didnt find a resolution different to the one set
-	
-	TDisplayConfiguration test1;
-	test1.SetResolution(TSize(5,6));	//rubbish resolution!
-	error = interface->SetConfiguration(test1);
-
-	ASSERT_EQUALS(error,KErrArgument);
-
-	ASSERT_EQUALS(error,KErrArgument);
-	iSession.Flush();
-	interface->GetConfiguration(afterConfig);
-	ASSERT_TRUE(beforeConfig == afterConfig);
-	
-	TDisplayConfiguration test2;
-	test2.SetResolutionTwips(TSize(7,8));	//rubbish twips!
-	error = interface->SetConfiguration(test2);
-	ASSERT_EQUALS(error,KErrArgument);
-	iSession.Flush();
-	interface->GetConfiguration(afterConfig);
-	ASSERT_TRUE(beforeConfig == afterConfig);
-	
-	TDisplayConfiguration test3;
-	test3.SetResolution(resolutionList1[differentRes].iPixelSize);	//ok resolution!
-	test3.SetResolutionTwips(TSize(9,10));	//rubbish twips!
-	error = interface->SetConfiguration(test3);
-	//ASSERT_EQUALS(error,KErrArgument);
-	if (error != KErrArgument)
-		{
-		ASSERT_EQUALS (aScaleMode,0);	//if no policy, we currently have issue with confing not being validated
-		INFO_PRINTF1(_L("config was not honoured!"));
-		error = interface->SetConfiguration(original);
-		ASSERT_EQUALS(error,KErrNone);
-		iSession.Flush();
-		Pause(200);
-		}
-	else
-		{
-		iSession.Flush();
-		Pause(200);
-		interface->GetConfiguration(afterConfig);
-		ASSERT_TRUE(beforeConfig == afterConfig);
-		}
-
-	TDisplayConfiguration test4;
-	test4.SetResolution(TSize(11,12));	//rubbish resolution!
-	test4.SetResolutionTwips(resolutionList1[differentRes].iTwipsSize);	//ok twips!
-	error = interface->SetConfiguration(test4);
-	if (error != KErrArgument)
-		{
-		ASSERT_EQUALS (aScaleMode,0);	//if no policy, we currently have issue with config not being validated
-		INFO_PRINTF1(_L("config was not honoured!"));
-		error = interface->SetConfiguration(original);
-		ASSERT_EQUALS(error,KErrNone);
-		iSession.Flush();
-		Pause(200);
-		}
-	else
-		{
-		iSession.Flush();
-		Pause(200);
-		interface->GetConfiguration(afterConfig);
-		ASSERT_TRUE(beforeConfig == afterConfig);
-		}
-	
-	if (aScaleMode)
-		{
-		RArray<TInt> screenModeList;
-		iInfoScreenDevice->GetScreenSizeModeList(&screenModeList);
-		ASSERT_TRUE(screenModeList.Count()>1);
-		//set default screen mode, sets resolution to best fit for this mode
-		iInfoScreenDevice->SetAppScreenMode(screenModeList[0]);
-		iInfoScreenDevice->SetScreenMode(screenModeList[0]);	//also sets its best resolution
-		iSession.Finish(ETrue);
-		Pause(200);
-		
-		TDisplayConfiguration newModeConfig;
-		interface->GetConfiguration(newModeConfig);
-		//get best fit resolution
-		TSize newModeRes;
-		ASSERT_TRUE(newModeConfig.GetResolution(newModeRes));
-		
-		//find a different resolution
-		TInt i;
-		for (i = 0; i < resolutions; i++)
-			{
-			if (!(resolutionList1[i].iPixelSize == newModeRes))
-				{
-				break;
-				}
-			}
-		ASSERT_TRUE(i < resolutions);	//otherwise it didnt find a resolution different to the one set
-		TDisplayConfiguration newSetConfig;
-		
-		//set the different resolution
-		newSetConfig.SetResolution(resolutionList1[i].iPixelSize);
-		error = interface->SetConfiguration(newSetConfig);
-		ASSERT_TRUE(error == KErrNone);
-		iSession.Flush();
-		Pause(200);
-		TDisplayConfiguration checkConfig;
-		
-		//check its set this new resolution
-		interface->GetConfiguration(checkConfig);
-		TSize checkSize;
-		checkConfig.GetResolution(checkSize);
-		ASSERT_TRUE (checkSize == resolutionList1[i].iPixelSize);
-		
-		TDisplayConfiguration emptyConfig;
-		TDisplayConfiguration newModeConfig2(newModeConfig);
-		newModeConfig2.Clear(newModeConfig2.EResolutionTwips);
-		//set empty config, which should reset resolution to current modes default
-		error = interface->SetConfiguration(emptyConfig);//emptyConfig);
-		ASSERT_TRUE(error == KErrNone);
-		iSession.Finish();
-		Pause(200);
-	
-		interface->GetConfiguration(checkConfig);
-		ASSERT_TRUE (newModeConfig == checkConfig);	//empty config reset res to modes default res
-
-		screenModeList.Close();
-		}
-	else
-		{
-		TDisplayConfiguration test5;
-		error = interface->SetConfiguration(test5);
-		ASSERT_EQUALS(error,KErrArgument);
-		}
-	resolutionList1.Close();	
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0031L
-@SYMTestCaseDesc		SetConfiguration in OOM (changing resolution)
-@SYMREQ					REQ10326
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPriority		1
-@SYMTestPurpose			Safety check against OOM
-@SYMTestActions			
-	Set OOM failure
-	Set a resolution that will definately cause a change of resolution
-	Increase length of time to failure, repeat
-	Finish after 5 successful changes of resolution
-@SYMTestExpectedResults	
-	Set resolution should either return a fail and not have cause a change in resolution,
-	or it should have returned no fail and have set the new resolution
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0031L()
-	{
-	MDisplayControl* interface = static_cast<MDisplayControl*>
-			(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-	ASSERT_TRUE(interface);
-	INFO_PRINTF1(_L("Interface obtained sucessfully."));
-	
-	TInt resolutions = interface->NumberOfResolutions();
-	ASSERT_TRUE (resolutions > 0);
-	INFO_PRINTF1(_L("NumberOfResolutions obtained sucessfully."));
-	
-	RArray<MDisplayControl::TResolution> resolutionList1;
-	TInt error = interface->GetResolutions(resolutionList1);
-	ASSERT_EQUALS(error,KErrNone);
-	ASSERT_EQUALS(resolutionList1.Count(), resolutions);
-	INFO_PRINTF1(_L("resolutionList1 has correct number of resolutions."));
-	
-	TInt index;
-	TDisplayConfiguration dispConfigBefore;
-	TDisplayConfiguration dispConfigAfter;
-	
-	dispConfigBefore.SetResolution(resolutionList1[0].iPixelSize);
-	interface->SetConfiguration(dispConfigBefore);
-	interface->GetConfiguration(dispConfigBefore);
-	ASSERT_TRUE(dispConfigBefore.IsDefined(dispConfigBefore.EResolution));
-	INFO_PRINTF1(_L("dispConfigBefore is defined."));
-	TSize dispResBefore;
-	TSize dispResAfter;
-	dispConfigBefore.GetResolution(dispResBefore);
-	TDisplayConfiguration::TRotation dispRotBefore;
-	TDisplayConfiguration::TRotation dispRotReq;
-	dispConfigBefore.GetRotation(dispRotBefore);
-
-	for (index = 0; index < resolutionList1.Count(); index++)
-		{
-		INFO_PRINTF2(_L("Starting resolution %d."), index);
-		if (resolutionList1[index].iPixelSize.iWidth == 0)
-			{
-			continue;
-			}
-		TInt heapFail = 1;
-		TBool notComplete = ETrue;
-		TInt completeCount = 0;
-		while (notComplete)
-			{
-			TDisplayConfiguration dispConfigReq;
-			dispConfigReq.SetResolution(resolutionList1[index].iPixelSize);
-			ASSERT_TRUE(dispConfigReq.IsDefined(dispConfigReq.EResolution));
-			SetRotation(dispConfigReq,resolutionList1[index]);	//set rotation to first defined in res list
-			dispConfigReq.GetRotation(dispRotReq);
-			INFO_PRINTF2(_L("Before heap failure, value of heapfail is %d."), heapFail);
-			
-			iSession.Finish(ETrue);
-			iSession.HeapSetFail(RHeap::EDeterministic,heapFail);
-			TInt errCode=interface->SetConfiguration(dispConfigReq);
-			iSession.HeapSetFail(RHeap::ENone,0);
-			INFO_PRINTF1(_L("After Heap Failure."));
-			iSession.Finish(ETrue);
-			Pause (100);
-			INFO_PRINTF1(_L("After Session Finish."));
-			
-			interface->GetConfiguration(dispConfigAfter);
-			ASSERT_TRUE(dispConfigAfter.IsDefined(dispConfigAfter.EResolution));
-			dispConfigAfter.GetResolution(dispResAfter);
-			
-			TBool worked = ETrue;
-			if (errCode < KErrNone)
-				{			
-				worked = EFalse;
-				ASSERT_EQUALS(dispResAfter,dispResBefore);
-				if (dispRotReq != dispRotBefore)
-					{	//didnt expect it work-KErrGeneral can mean a memory allocation fail
-					if (errCode == KErrArgument)
-						{	//if it didnt panic, that is a good enough pass in this instance
-						worked = ETrue;
-						}
-					}
-				}
-			else
-				{				
-				ASSERT_EQUALS(dispResAfter,resolutionList1[index].iPixelSize);
-				}
-			if (worked)
-				{	
-				completeCount++;
-				if (completeCount == 5)
-					{
-					notComplete = EFalse;
-					}
-				}
-			else
-				{
-				completeCount = 0;
-				}
-			interface->SetConfiguration(dispConfigBefore);
-			INFO_PRINTF1(_L("After Setting Original Configuration."));
-			heapFail++;
-			if (heapFail == 80)
-				{
-				ASSERT_TRUE(0);	//worrying amount of fails
-				}
-			}
-		}
-	resolutionList1.Close();
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0032L
-@SYMTestCaseDesc		SetAppMode in OOM
-@SYMREQ					REQ10326 REQ10336
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPriority		1
-@SYMTestPurpose			Safety check against OOM
-@SYMTestActions			
-	Set OOM failure
-	Set new app mode
-	Increase length of time to failure, repeat
-	Finish after 5 successful changes of mode
-@SYMTestExpectedResults	
-	SetAppMode should either return a fail and not have cause a change in resolution,
-	or it should have returned no fail and have set the new resolution
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0032L()
-	{
-	MDisplayControl* interface = static_cast<MDisplayControl*>
-			(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-	ASSERT_TRUE(interface);
-	
-	TInt resolutions = interface->NumberOfResolutions();
-	ASSERT_TRUE (resolutions > 0);
-	RArray<TInt> screenModeList;
-	iInfoScreenDevice->GetScreenSizeModeList(&screenModeList);
-	ASSERT_TRUE (screenModeList.Count()>0);
-	
-	iInfoScreenDevice->SetAppScreenMode(screenModeList[0]);
-	iInfoScreenDevice->SetScreenMode(screenModeList[0]);
-	
-	for (TInt index = 1; index < screenModeList.Count(); index++)
-		{	//skip index 0, as that wouldn't be changing mode
-		TInt heapFail = 1;
-		TBool notComplete = ETrue;
-		TInt completeCount = 0;
-		while (notComplete)
-			{
-			iInfoScreenDevice->SetAppScreenMode(screenModeList[index]);
-			iSession.Finish(ETrue);
-			iSession.HeapSetFail(RHeap::EDeterministic,heapFail);
-			iInfoScreenDevice->SetScreenMode(screenModeList[index]);
-			iSession.HeapSetFail(RHeap::ENone,0);
-			iSession.Finish(ETrue);
-			Pause(50);
-			TInt newMode = iInfoScreenDevice->CurrentScreenMode();
-
-			if (screenModeList[index] == newMode)
-				{
-				completeCount++;
-				if (completeCount == 5)
-					{
-					INFO_PRINTF2(_L("Succeeded with heapFail = %d"),heapFail);
-					notComplete = EFalse;
-					}
-				iInfoScreenDevice->SetAppScreenMode(screenModeList[0]);
-				iInfoScreenDevice->SetScreenMode(screenModeList[0]);
-				iSession.Finish(ETrue);
-				Pause(50);
-				}
-			else
-				{
-				completeCount = 0;
-				}
-			heapFail++;
-			if (heapFail == 80)
-				{
-				ASSERT_TRUE(0);	//worrying amount of fails
-				}
-			}
-		}
-	screenModeList.Close();
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0033L
-@SYMTestCaseDesc		GetConfiguration in OOM
-@SYMREQ					REQ10328
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPriority		1
-@SYMTestPurpose			Safety check against OOM
-@SYMTestActions			
-	Set OOM failure
-	GetConfiguration
-	Check config
-	Increase time till failure
-	Success after 5 completed gets
-@SYMTestExpectedResults	
-	Should always succeed
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0033L()
-	{
-	MDisplayControl* interface = static_cast<MDisplayControl*>
-			(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-	ASSERT_TRUE(interface);
-	
-	TInt heapFail = 1;
-	for (TInt i=0;i<5;i++)
-		{
-		TDisplayConfiguration config;
-		iSession.Finish(ETrue);
-		iSession.HeapSetFail(RHeap::EDeterministic,heapFail);
-		interface->GetConfiguration(config);
-		iSession.HeapSetFail(RHeap::ENone,0);
-		iSession.Finish(ETrue);
-		ASSERT_TRUE(config.IsDefined(config.ERotation));
-		ASSERT_TRUE(config.IsDefined(config.EResolution));
-		ASSERT_TRUE(config.IsDefined(config.EResolutionTwips));
-		heapFail++;
-		}
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0034L
-@SYMTestCaseDesc		GetResolutions in OOM
-@SYMREQ					REQ10328
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPriority		1
-@SYMTestPurpose			Safety check against OOM
-@SYMTestActions			
-	Set OOM failure
-	GetResolutions
-	Check resolutions filled in
-	Success after 5 completed gets
-@SYMTestExpectedResults	
-	Should never panic!
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0034L()
-	{
-	MDisplayControl* interface = static_cast<MDisplayControl*>
-			(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-	ASSERT_TRUE(interface);
-	
-	TInt resolutions = interface->NumberOfResolutions();
-	ASSERT_TRUE(resolutions>1);
-	
-	RArray<MDisplayControl::TResolution> resolutionList1;
-	TInt error = interface->GetResolutions(resolutionList1);
-	ASSERT_EQUALS(error,KErrNone);
-	ASSERT_TRUE(resolutionList1.Count() > 0);
-
-	TInt heapFail = 1;
-	TInt completeCount = 0;
-	TBool notComplete = ETrue;
-	while (notComplete)
-		{
-		RArray<MDisplayControl::TResolution> resolutionList2;
-		iSession.Finish(ETrue);
-		iSession.HeapSetFail(RHeap::EDeterministic,heapFail);
-		error = interface->GetResolutions(resolutionList2);
-		iSession.HeapSetFail(RHeap::ENone,0);
-		iSession.Finish(ETrue);
-		if (error<KErrNone)
-			{
-			ASSERT_EQUALS(error,KErrNoMemory);
-			completeCount = 0;
-			}
-		else
-			{
-			ASSERT_EQUALS(resolutionList2.Count(),resolutionList1.Count());
-			for (TInt i=0;i<resolutionList2.Count();i++)
-				{
-				ASSERT_EQUALS(resolutionList1[i].iPixelSize,resolutionList2[i].iPixelSize);
-				ASSERT_EQUALS(resolutionList1[i].iTwipsSize,resolutionList2[i].iTwipsSize);
-				if (!(resolutionList1[i].iFlags==resolutionList2[i].iFlags))
-					{
-					ASSERT_TRUE(0);
-					}
-				}
-			completeCount++;
-			}
-		heapFail++;
-		resolutionList2.Close();
-		if (completeCount == 5)
-			{
-			notComplete = EFalse;
-			}
-		if (heapFail == 20)
-			{
-			ASSERT_TRUE(0);	//worrying amount of fails
-			}
-		}
-	resolutionList1.Close();
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0041L
-@SYMTestCaseDesc		Test Drawing of bitmaps (case 0) and surfaces (case 1) in all different AppModes
-@SYMREQ					REQ10332 REQ10336
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPurpose			Check to see if Bitmaps and Surfaces are drawn correctly in different app modes
-@SYMTestActions			
-	A Simple pattern will be drawn by a bitmap on the left and a surface on the right, about half the window size each. The Composited Screen Capture code will be used to compare the drawing to a unchanged copy of the bitmap to see if they are drawn correctly
-	
-	Note, add .0 to test name to test bitmap drawing and .1 to test surface drawing
-@SYMTestExpectedResults	
-	All tests should pass.
-	
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0041L(TBool aIsSurface)
-	{
-	LOG_AND_PANIC_IF_NOT_GCE;
-	ResetScreens();
-	TInt error;
-	iSession.Finish(ETrue);
-	
-	TRect screenSize(iInfoScreenDevice->SizeInPixels());
-	screenSize.Shrink(5,5);
-	
-	RBlankWindow testWindow;
-	if (iInfoGc)
-		{
-		testWindow=RBlankWindow(iSession);
-		ASSERT_EQUALS(testWindow.Construct(*iInfoGroup, ++iWindowHandle), KErrNone);
-		testWindow.SetColor(iBlue);
-		testWindow.SetExtent(screenSize.iTl,screenSize.Size());
-		testWindow.Activate();
-		
-		if (testWindow.WsHandle())
-			{		
-			iSession.Flush();
-			iSession.Finish();
-			}
-		testWindow.SetVisible(ETrue);
-		}
-	
-	iSession.Finish(ETrue);
-	
-	RArray<TInt> screenModeList;
-	iInfoScreenDevice->GetScreenSizeModeList(&screenModeList);
-	MDisplayControl* interface = static_cast<MDisplayControl*>
-				(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-	ASSERT_TRUE(interface);
-	
-	TInt resolutions = interface->NumberOfResolutions();
-	ASSERT_TRUE (resolutions > 0);
-	
-	RArray<MDisplayControl::TResolution> resolutionList1;
-	error = interface->GetResolutions(resolutionList1);
-	ASSERT_EQUALS(error,KErrNone);
-	ASSERT_EQUALS(resolutionList1.Count(), resolutions);
-	
-	TDisplayConfiguration dispConfigBefore;
-	interface->GetConfiguration(dispConfigBefore);
-	ASSERT_TRUE(dispConfigBefore.IsDefined(dispConfigBefore.EResolution))
-	if (screenModeList.Count()>1)
-		{
-		//Got a mode to change to!
-		TSize resBefore;
-		TBool ok=dispConfigBefore.GetResolution(resBefore);
-		ASSERT_TRUE(ok);	//we "know" this should be ok, as we just asserted the flag
-		for (TInt res=0;res<screenModeList.Count();res++)
-			{
-				{
-					{
-					TDisplayConfiguration dispConfigReq;
-					iInfoScreenDevice->SetAppScreenMode(screenModeList[res]);
-					iInfoScreenDevice->SetScreenMode(screenModeList[res]);
-					iSession.Finish(ETrue);
-					Pause(300);
-					
-
-					TSize pr = iInfoScreenDevice->SizeInPixels();
-					TPoint 	origin=iInfoScreenDevice->GetDefaultScreenModeOrigin();					
-					Pause(300);
-					TSize winpos;
-					
-					TSize surfaceSize = pr;
-					surfaceSize.iWidth /= 2;
-					surfaceSize.iWidth -= 20;
-					surfaceSize.iHeight -= 20;
-					TSurfaceId surfaceID;
-					TRAPD(err, surfaceID = iUtility->CreateSurfaceL(surfaceSize, 
-								KSurfaceFormat, surfaceSize.iWidth * KBytesPerPixel));
-					ASSERT_EQUALS(err,KErrNone);
-					TRAP(err,iUtility->PatternFillSurfaceL(surfaceID));
-					ASSERT_EQUALS(err,KErrNone);
-								
-					CFbsBitmap* equivalentBitmap=NULL;
-					TRAP(err,equivalentBitmap=iUtility->EquivalentBitmapL(surfaceID));
-					CleanupStack::PushL(equivalentBitmap);
-					ASSERT_EQUALS(err,KErrNone);
-					
-					screenSize = iInfoScreenDevice->SizeInPixels();
-					TSize testSize = iScreenDevice->SizeInPixels();
-					screenSize.Shrink(5,5);
-					
-					if (iInfoGc)
-						{
-						testWindow.SetExtent(screenSize.iTl,screenSize.Size());
-						
-						if (testWindow.WsHandle())
-							{
-							
-							iSession.Flush();
-							iSession.Finish();
-							}
-						testWindow.SetVisible(ETrue);
-						}
-					Pause(200);			
-					iSession.Finish(ETrue);
-					
-					RWindow surfWindow;
-					if (iInfoGc)
-						{
-						surfWindow=RWindow(iSession);
-						ASSERT_EQUALS(surfWindow.Construct(*iInfoGroup, ++iWindowHandle), KErrNone);
-						surfWindow.SetBackgroundSurface(surfaceID);
-						surfWindow.SetExtent(screenSize.iTl+TPoint( screenSize.Width()/2 +5,5),surfaceSize);
-						surfWindow.Activate();
-						
-						if (surfWindow.WsHandle())
-							{
-							surfWindow.Invalidate();
-						
-							surfWindow.BeginRedraw();
-							ActivateWithWipe(iInfoGc,surfWindow,iRed);
-							surfWindow.EndRedraw();
-						
-							iSession.Flush();
-							iSession.Finish();
-							}
-						surfWindow.SetVisible(ETrue);
-						iInfoGc->Deactivate();
-						}
-					
-					iSession.Finish(ETrue);
-					
-					TRect bitmapDrawRect;
-					bitmapDrawRect = surfaceSize;
-					
-					RWindow bmpWindow;
-					if (iInfoGc)
-						{
-						bmpWindow=RWindow(iSession);
-						ASSERT_EQUALS(bmpWindow.Construct(*iInfoGroup, ++iWindowHandle), KErrNone);
-						bmpWindow.SetBackgroundColor(iRed);
-						bmpWindow.SetExtent(screenSize.iTl+TPoint(5,5),surfaceSize);
-						bmpWindow.Activate();
-						
-						if (bmpWindow.WsHandle())
-							{
-							bmpWindow.Invalidate();
-						
-							bmpWindow.BeginRedraw();
-							ActivateWithWipe(iInfoGc,bmpWindow,iRed);
-							// Not drawing, draw twice??
-							iInfoGc->DrawBitmap(bitmapDrawRect, equivalentBitmap);
-							bmpWindow.EndRedraw();
-						
-							iSession.Flush();
-							iSession.Finish();
-							}
-						bmpWindow.SetVisible(ETrue);
-						iInfoGc->Deactivate();
-						}
-					Pause(200);			
-					iSession.Finish(ETrue);
-
-					
-					if (iInfoGc)
-						{
-						
-						if (bmpWindow.WsHandle())
-							{
-							bmpWindow.Invalidate();
-						
-							bmpWindow.BeginRedraw();
-							ActivateWithWipe(iInfoGc,bmpWindow,iRed);
-							// Not drawing, draw twice??
-							iInfoGc->DrawBitmap(bitmapDrawRect, equivalentBitmap);
-							bmpWindow.EndRedraw();
-							
-							iSession.Flush();
-							iSession.Finish();
-							}
-						bmpWindow.SetVisible(ETrue);
-						iInfoGc->Deactivate();
-						}
-					Pause(200);			
-					iSession.Finish(ETrue);
-					
-					if (iInfoGc)
-						{
-								
-						if (bmpWindow.WsHandle())
-							{
-							bmpWindow.Invalidate();
-											
-							bmpWindow.BeginRedraw();
-							ActivateWithWipe(iInfoGc,bmpWindow,iRed);
-							// Not drawing, draw twice??
-							iInfoGc->DrawBitmap(bitmapDrawRect, equivalentBitmap);
-							bmpWindow.EndRedraw();
-							iSession.Flush();
-							iSession.Finish();
-							}
-						bmpWindow.SetVisible(ETrue);
-						iInfoGc->Deactivate();
-						}
-					Pause(200);			
-					iSession.Finish(ETrue);
-
-					RArray<TBitmapRegionPair> regionArray;					
-
-					RRegion equivRegion;
-					TBitmapRegionPair bitmap1Region;
-					bitmap1Region.bitmap = equivalentBitmap;
-					bitmap1Region.drawRect = TRect(TPoint(0,0),surfaceSize);
-					equivRegion.AddRect(TRect(TPoint(0,0),surfaceSize));
-					bitmap1Region.region = &equivRegion;
-
-					regionArray.Append(bitmap1Region);
-
-
-					TDisplayConfiguration dispConfigAfter2;
-					interface->GetConfiguration(dispConfigAfter2);
-					TSize theSize;
-					dispConfigAfter2.GetResolution(theSize);
-					TDisplayConfiguration1::TRotation orient;
-					dispConfigAfter2.GetRotation(orient);
-					if (orient == TDisplayConfiguration1::ERotation90CW || orient == TDisplayConfiguration1::ERotation270CW)
-						{
-						TInt temp = theSize.iHeight;
-						theSize.iHeight = theSize.iWidth;
-						theSize.iWidth = temp;
-						}
-					TRect uiSize(TPoint(0,0), theSize);
-					MDisplayMapping* mappingInterface = static_cast<MDisplayMapping*>
-								(iScreenDevice->GetInterface(MDisplayMapping::ETypeId));
-					ASSERT_TRUE(mappingInterface);
-					TRect finalSize;
-					mappingInterface->MapCoordinates(EApplicationSpace, uiSize, ECompositionSpace, finalSize);
-						
-
-					CFbsBitmap* bmp2 = new (ELeave) CFbsBitmap;
-					CleanupStack::PushL(bmp2);
-					User::LeaveIfError(bmp2->Create(finalSize.Size(), EColor16MU));
-
-					MTestScreenCapture
-							* csc =
-									static_cast<MTestScreenCapture*> (iScreenDevice->GetInterface(MTestScreenCapture::KUidTestScreenCaptureIf));
-					if (csc)
-						{
-						TInt errr = csc->ComposeScreen(*bmp2);
-						ASSERT_TRUE(errr == KErrNone);
-						}
-					else
-						{
-						if (!cSCLogged)
-							{
-							cSCLogged = ETrue;
-							_LIT(KNoCSC, "CSC testing not enabled as CSC render stage not defined");
-							Logger().LogExtra(((TText8*)__FILE__), __LINE__, ESevrAll, KNoCSC);
-							}
-						}
-					
-					
-					TRect compareRect(bmpWindow.AbsPosition(), bmpWindow.Size());
-					TRect testRect(surfWindow.AbsPosition(), surfWindow.Size());
-
-					if (csc)
-						{
-						if(!Compare(*bmp2, compareRect, testRect, regionArray, aIsSurface))
-							{
-							_LIT(KCompareFailed, "Compare Failed on app mode: %d");
-							TBuf<256> x;
-							x.Format(KCompareFailed, res+1);
-							Logger().LogExtra(((TText8*)__FILE__), __LINE__, ESevrErr, x);
-							}
-						}
-
-					CleanupStack::PopAndDestroy(bmp2);
-
-					equivRegion.Close();
-					regionArray.Close();
-					
-					CleanupStack::PopAndDestroy(equivalentBitmap);
-					surfWindow.Close();
-					bmpWindow.Close();
-					}
-				}
-			}
-		//restore initial res
-		if (screenModeList.Count() > 1)
-            {   //set back to basics
-            iInfoScreenDevice->SetAppScreenMode(screenModeList[0]);
-            iInfoScreenDevice->SetScreenMode(screenModeList[0]);
-            Pause(300);
-            }
-		
-		interface->SetConfiguration(dispConfigBefore);
-		Pause(1000);
-		TDisplayConfiguration dispConfigAfter;
-		interface->GetConfiguration(dispConfigAfter);
-		TSize resAfter;
-		ok=dispConfigAfter.GetResolution(resAfter);
-		ASSERT_TRUE(ok);	
-		ASSERT_EQUALS(resBefore,resAfter);
-		}
-	else
-		{
-		INFO_PRINTF1(_L("Only 1 screen size mode configured on this screen - res change test skipped."));
-		}
-	testWindow.Close();
-	screenModeList.Close();
-	resolutionList1.Close();
-	}
-	
-
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0042L
-@SYMTestCaseDesc		Test Drawing of bitmaps (case 0) and surfaces (case 1) in all different resolutions
-@SYMREQ					REQ10332
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPurpose			Check to see if Bitmaps and Surfaces are drawn correctly in different resolutions
-@SYMTestActions			
-	A Simple pattern will be drawn by a bitmap on the left and a surface on the right, about half the window size each. The Composited Screen Capture code will be used to compare the drawing to a unchanged copy of the bitmap to see if they are drawn correctly
-	
-	Note, add .0 to test name to test bitmap drawing and .1 to test surface drawing
-@SYMTestExpectedResults	
-	All tests should pass.
-	
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0042L(TBool aIsSurface)
-	{
-	LOG_AND_PANIC_IF_NOT_GCE;
-	ResetScreens();
-	TInt error;
-	iSession.Finish(ETrue);
-	
-	TRect screenSize(iInfoScreenDevice->SizeInPixels());
-	screenSize.Shrink(5,5);
-	
-	RBlankWindow testWindow;
-	if (iInfoGc)
-		{
-		testWindow=RBlankWindow(iSession);
-		ASSERT_EQUALS(testWindow.Construct(*iInfoGroup, ++iWindowHandle), KErrNone);
-		testWindow.SetColor(iBlue);
-		testWindow.SetExtent(screenSize.iTl,screenSize.Size());
-		testWindow.Activate();
-		
-		if (testWindow.WsHandle())
-			{		
-			iSession.Flush();
-			iSession.Finish();
-			}
-		testWindow.SetVisible(ETrue);
-		}
-	
-	iSession.Finish(ETrue);
-	
-	RArray<TInt> screenModeList;
-	iInfoScreenDevice->GetScreenSizeModeList(&screenModeList);
-	MDisplayControl* interface = static_cast<MDisplayControl*>
-				(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-	ASSERT_TRUE(interface);
-	
-	TInt resolutions = interface->NumberOfResolutions();
-	ASSERT_TRUE (resolutions > 0);
-	
-	RArray<MDisplayControl::TResolution> resolutionList1;
-	error = interface->GetResolutions(resolutionList1);
-	ASSERT_EQUALS(error,KErrNone);
-	ASSERT_EQUALS(resolutionList1.Count(), resolutions);
-	
-	TDisplayConfiguration dispConfigBefore;
-	interface->GetConfiguration(dispConfigBefore);
-
-	iInfoScreenDevice->SetAppScreenMode(screenModeList[1]);
-	iInfoScreenDevice->SetScreenMode(screenModeList[1]);
-	iSession.Finish();
-	Pause(50);
-	
-	if (resolutions>1)
-		{
-		//Got a mode to change to!
-		TSize resBefore;
-		TBool ok=dispConfigBefore.GetResolution(resBefore);
-		ASSERT_TRUE(ok);	//we "know" this should be ok, as we just asserted the flag
-		for (TInt res=0;res<resolutionList1.Count();res++)
-			{
-			if (resolutionList1[res].iPixelSize!=TSize(0,0))	//this test is not about turning the display off
-				{
-				TDisplayConfiguration dispConfigReq;
-				dispConfigReq.SetResolution(resolutionList1[res].iPixelSize);
-				ASSERT_TRUE(dispConfigReq.IsDefined(dispConfigReq.EResolution));
-				
-				SetRotation(dispConfigReq,resolutionList1[res]);	//set rotation to first defined in res list
-				
-				
-				
-
-				TInt errCode=interface->SetConfiguration(dispConfigReq);
-				//ASSERT_EQUALS(errCode,KErrNone);
-				if (errCode != KErrNone)
-					{
-					//Probably current size mode does not support the rotation of the passed in configuration
-					
-					ASSERT_EQUALS(errCode,KErrArgument);	//failed to find compatible res in the policy
-					continue;
-					}
-				
-				
-				TSize pr = iInfoScreenDevice->SizeInPixels();
-				TPoint 	origin=iInfoScreenDevice->GetDefaultScreenModeOrigin();					
-				Pause(300);
-				TSize winpos;
-				
-				TSize surfaceSize = pr;
-				surfaceSize.iWidth /= 2;
-				surfaceSize.iWidth -= 20;
-				surfaceSize.iHeight -= 20;
-				TSurfaceId surfaceID;
-				TRAPD(err, surfaceID = iUtility->CreateSurfaceL(surfaceSize, 
-							KSurfaceFormat, surfaceSize.iWidth * KBytesPerPixel));
-				ASSERT_EQUALS(err,KErrNone);
-				TRAP(err,iUtility->PatternFillSurfaceL(surfaceID));
-				ASSERT_EQUALS(err,KErrNone);
-							
-				CFbsBitmap* equivalentBitmap=NULL;
-				TRAP(err,equivalentBitmap=iUtility->EquivalentBitmapL(surfaceID));
-				CleanupStack::PushL(equivalentBitmap);
-				ASSERT_EQUALS(err,KErrNone);
-				
-				screenSize = iInfoScreenDevice->SizeInPixels();
-				screenSize.Shrink(5,5);
-				
-				if (iInfoGc)
-					{
-					testWindow.SetExtent(screenSize.iTl,screenSize.Size());
-					
-					if (testWindow.WsHandle())
-						{
-						
-						iSession.Flush();
-						iSession.Finish();
-						}
-					testWindow.SetVisible(ETrue);
-					}
-				Pause(200);			
-				iSession.Finish(ETrue);
-				
-				RWindow surfWindow;
-				if (iInfoGc)
-					{
-					surfWindow=RWindow(iSession);
-					ASSERT_EQUALS(surfWindow.Construct(*iInfoGroup, ++iWindowHandle), KErrNone);
-					surfWindow.SetBackgroundSurface(surfaceID);
-					surfWindow.SetExtent(screenSize.iTl+TPoint( screenSize.Width()/2 +5,5),surfaceSize);
-					surfWindow.Activate();
-					
-					if (surfWindow.WsHandle())
-						{
-						surfWindow.Invalidate();
-					
-						surfWindow.BeginRedraw();
-						ActivateWithWipe(iInfoGc,surfWindow,iRed);
-						surfWindow.EndRedraw();
-					
-						iSession.Flush();
-						iSession.Finish();
-						}
-					surfWindow.SetVisible(ETrue);
-					iInfoGc->Deactivate();
-					}
-				
-				iSession.Finish(ETrue);
-				
-				TRect bitmapDrawRect;
-				bitmapDrawRect = surfaceSize;
-				
-				RWindow bmpWindow;
-				if (iInfoGc)
-					{
-					bmpWindow=RWindow(iSession);
-					ASSERT_EQUALS(bmpWindow.Construct(*iInfoGroup, ++iWindowHandle), KErrNone);
-					bmpWindow.SetBackgroundColor(iRed);
-					bmpWindow.SetExtent(screenSize.iTl+TPoint(5,5),surfaceSize);
-					bmpWindow.Activate();
-					
-					if (bmpWindow.WsHandle())
-						{
-						bmpWindow.Invalidate();
-					
-						bmpWindow.BeginRedraw();
-						ActivateWithWipe(iInfoGc,bmpWindow,iRed);
-						// Not drawing, draw twice??
-						iInfoGc->DrawBitmap(bitmapDrawRect, equivalentBitmap);
-						bmpWindow.EndRedraw();
-					
-						iSession.Flush();
-						iSession.Finish();
-						}
-					bmpWindow.SetVisible(ETrue);
-					iInfoGc->Deactivate();
-					}
-				Pause(200);			
-				iSession.Finish(ETrue);
-				
-				
-				if (iInfoGc)
-					{
-					
-					if (bmpWindow.WsHandle())
-						{
-						bmpWindow.Invalidate();
-							
-						bmpWindow.BeginRedraw();
-						ActivateWithWipe(iInfoGc,bmpWindow,iRed);
-						// Not drawing, draw twice??
-						iInfoGc->DrawBitmap(bitmapDrawRect, equivalentBitmap);
-						bmpWindow.EndRedraw();
-											
-						iSession.Flush();
-						iSession.Finish();
-						}
-					bmpWindow.SetVisible(ETrue);
-					iInfoGc->Deactivate();
-					}
-				Pause(200);			
-				iSession.Finish(ETrue);
-									
-
-				
-
-				RArray<TBitmapRegionPair> regionArray;					
-
-				RRegion equivRegion;
-				TBitmapRegionPair bitmap1Region;
-				bitmap1Region.bitmap = equivalentBitmap;
-				bitmap1Region.drawRect = TRect(TPoint(0,0),surfaceSize);
-				equivRegion.AddRect(TRect(TPoint(0,0),surfaceSize));
-				bitmap1Region.region = &equivRegion;
-
-				regionArray.Append(bitmap1Region);
-
-
-				TDisplayConfiguration dispConfigAfter2;
-				interface->GetConfiguration(dispConfigAfter2);
-				TSize theSize;
-				dispConfigAfter2.GetResolution(theSize);
-				TDisplayConfiguration1::TRotation orient;
-				dispConfigAfter2.GetRotation(orient);
-				if (orient & 0x1)
-					{
-					TInt temp = theSize.iHeight;
-					theSize.iHeight = theSize.iWidth;
-					theSize.iWidth = temp;
-					}
-				TRect uiSize(TPoint(0,0), theSize);
-				MDisplayMapping* mappingInterface = static_cast<MDisplayMapping*>
-							(iScreenDevice->GetInterface(MDisplayMapping::ETypeId));
-				ASSERT_TRUE(mappingInterface);
-				TRect finalSize;
-				mappingInterface->MapCoordinates(EApplicationSpace, uiSize, ECompositionSpace, finalSize);
-
-				
-				
-
-				CFbsBitmap* bmp2 = new (ELeave) CFbsBitmap;
-				CleanupStack::PushL(bmp2);
-				TInt bmpErr = bmp2->Create(finalSize.Size(), EColor16MU);
-				ASSERT_EQUALS(bmpErr, KErrNone);
-
-				MTestScreenCapture
-						* csc =
-								static_cast<MTestScreenCapture*> (iScreenDevice->GetInterface(MTestScreenCapture::KUidTestScreenCaptureIf));
-				if (csc)
-					{
-					TInt errr = csc->ComposeScreen(*bmp2);
-					}
-				else
-					{
-					if (!cSCLogged)
-						{
-						cSCLogged = ETrue;
-						_LIT(KNoCSC, "CSC testing not enabled as CSC render stage not defined");
-						Logger().LogExtra(((TText8*)__FILE__), __LINE__, ESevrAll, KNoCSC);
-						}
-					}
-				TRect compareRect(bmpWindow.AbsPosition(), bmpWindow.Size());
-				TRect testRect(surfWindow.AbsPosition(), surfWindow.Size());
-
-				if (csc)
-					{
-					if(!Compare(*bmp2, compareRect, testRect, regionArray, aIsSurface))
-						{
-						_LIT(KCompareFailed, "Compare Failed on resolution: %d");
-						TBuf<256> x;
-						x.Format(KCompareFailed, res+1);
-						Logger().LogExtra(((TText8*)__FILE__), __LINE__, ESevrErr, x);
-						}
-					}
-				CleanupStack::PopAndDestroy(bmp2);
-
-				equivRegion.Close();
-				regionArray.Close();
-				
-				CleanupStack::PopAndDestroy(equivalentBitmap);
-				surfWindow.Close();
-				bmpWindow.Close();
-				}
-			}
-			//restore initial res
-			iInfoScreenDevice->SetAppScreenMode(0);
-			iInfoScreenDevice->SetScreenMode(0);
-			}
-		else
-			{
-			INFO_PRINTF1(_L("Only 1 screen size mode configured on this screen - res change test skipped."));
-			}
-		testWindow.Close();
-		screenModeList.Close();
-		resolutionList1.Close();
-	}
-
-
-/**
- Tests to see if the pixels in the bitmap match what should be drawn with regards to the bitmaps and regions in aBitmapRegionPairArray
- It does this by in the case of non-scaled bitmaps, performing a pixel by pixel comparison between what has been drawn to the CSC created bitmap and either the pixels of the bitmap if they are contained within the related region or the pixels of the simulation screen. In the case of scalingm only certain pixels are compared from the CSC bitmap to the comparison drawing as the scaling algorithm is hard to replicate.
-
-
- @param aBitmap a bitmap of the entire screen which should be generated using the Composited Screen Capture code
- @param aRect1 A rectangle representing the middle window in the comparison triple
- @param aRect2 A rectangle represneting the right window in the comparison triple
- @param aBitmapRegionPairArray An array of the different regions that are being drawn on the screen. They should be placed in order such that the closest to the foreground is first and the furthest away is last in the queue. Each member of the array is a misleadingly titled TBitmapRegion pair, the bitmap member of this should be the bitmap that is being drawn to the region of the screen, if the region is just a blank color then a blank color bitmap should be drawn. The region should be the region that the bitmap is being drawn to and should be the same as the clipping region which is set jsut before the bitmap is drawn to screen. Finally the draw rect is the basic rectangle the bitmap is being drawn to and is mainly used to test if the bitmap is being scaled
- @return True
- */
-TBool CWsDynamicResBasic::Compare(const CFbsBitmap& aBitmap,
-		const TRect& aRect1, const TRect& aRect2,
-		RArray<TBitmapRegionPair>& aBitmapRegionPairArray, TBool aIsSurface)
-	{
-	MDisplayMapping* mappingInterface = static_cast<MDisplayMapping*>
-				(iScreenDevice->GetInterface(MDisplayMapping::ETypeId));
-	ASSERT_TRUE(mappingInterface);
-		
-	
-	TRgb color1;
-	TRgb color2;
-
-	TInt errorPixels =0;
-	TInt diffPixels = 0;
-	RRegion ignoreDueToResizing;
-	TInt regionCount = aBitmapRegionPairArray.Count();
-	for (TInt i=regionCount-1; i>=0; i--)
-		{
-		if (aBitmapRegionPairArray[i].bitmap->SizeInPixels()
-				!= aBitmapRegionPairArray[i].drawRect.Size())
-			{
-			RArray<TPoint> corners;
-			corners.Append(aBitmapRegionPairArray[i].drawRect.iTl);
-			corners.Append(TPoint(aBitmapRegionPairArray[i].drawRect.iBr.iX-1,
-					aBitmapRegionPairArray[i].drawRect.iTl.iY));
-			corners.Append(TPoint(aBitmapRegionPairArray[i].drawRect.iTl.iX,
-					aBitmapRegionPairArray[i].drawRect.iBr.iY-1));
-			corners.Append(aBitmapRegionPairArray[i].drawRect.iBr- TPoint(1,1));
-			for (TInt j=0; j<corners.Count(); j++)
-				{
-				TBool inOther=EFalse;
-				for (TInt k=0; k<i; k++)
-					{
-					if (aBitmapRegionPairArray[k].region->Contains(corners[j]))
-						{
-						inOther = ETrue;
-						}
-					}
-				if (inOther)
-					{
-					continue;
-					}
-				aBitmap.GetPixel(color1, aRect2.iTl + corners[j]);
-				aBitmap.GetPixel(color2, aRect1.iTl + corners[j]);
-				TRgb color3 = GreatestColor(color1);
-				TRgb color4 = GreatestColor(color2);
-				if (color3 != color4)
-					{
-					// Bitmap copy can be off by a pixel on grid filled surface so allow for green and yellow to be treated equally as they are the background colours, this may allow a misfunctioning gce to pass the test though.
-					if (color4 == TRgb(0, 1, 0) && color3 == TRgb(1, 1, 0))
-						{
-						}
-					else
-						if (color4 == TRgb(1, 1, 0) && color3 == TRgb(0, 1, 0))
-							{
-							}
-						else
-							{
-							corners.Close();
-							return EFalse;
-							}
-					}
-
-				}
-			// testPoints contains first the pixel within the destRect followed by the pixel in the original position for comparison to
-			RArray<TPoint> testPoints;
-			testPoints.Append(aBitmapRegionPairArray[i].drawRect.Center());
-			testPoints.Append(TPoint(
-					aBitmapRegionPairArray[i].bitmap->SizeInPixels().iWidth/2,
-					aBitmapRegionPairArray[i].bitmap->SizeInPixels().iHeight/2));
-			testPoints.Append(TPoint(aBitmapRegionPairArray[i].drawRect.iTl.iX,
-					aBitmapRegionPairArray[i].drawRect.Center().iY));
-			testPoints.Append(TPoint(0,
-					aBitmapRegionPairArray[i].bitmap->SizeInPixels().iHeight/2));
-			testPoints.Append(TPoint(aBitmapRegionPairArray[i].drawRect.iBr.iX
-					-1, aBitmapRegionPairArray[i].drawRect.Center().iY));
-			testPoints.Append(TPoint(
-					aBitmapRegionPairArray[i].bitmap->SizeInPixels().iWidth-1,
-					aBitmapRegionPairArray[i].bitmap->SizeInPixels().iHeight/2));
-			TSize sizeee = aBitmapRegionPairArray[i].drawRect.Size();
-			if (aBitmapRegionPairArray[i].drawRect.Size().iWidth > 11 && aBitmapRegionPairArray[i].drawRect.Size().iHeight > 20)
-				{
-				testPoints.Append(TPoint(
-						aBitmapRegionPairArray[i].drawRect.Center().iX, aBitmapRegionPairArray[i].drawRect.iTl.iY));
-				testPoints.Append(TPoint(
-						aBitmapRegionPairArray[i].bitmap->SizeInPixels().iWidth/2, 0));
-
-				testPoints.Append(TPoint(
-						aBitmapRegionPairArray[i].drawRect.Center().iX, aBitmapRegionPairArray[i].drawRect.iBr.iY-1));
-				testPoints.Append(TPoint(
-						aBitmapRegionPairArray[i].bitmap->SizeInPixels().iWidth/2,
-						aBitmapRegionPairArray[i].bitmap->SizeInPixels().iHeight-1));
-
-				if (aBitmapRegionPairArray[i].drawRect.Size().iWidth > 34
-						&& aBitmapRegionPairArray[i].drawRect.Size().iHeight > 43)
-					{
-					testPoints.Append(aBitmapRegionPairArray[i].drawRect.iTl
-							+ TPoint(5, 5));
-					testPoints.Append(TPoint(5, 5));
-					testPoints.Append(TPoint(
-							aBitmapRegionPairArray[i].drawRect.iBr.iX - 6,
-							aBitmapRegionPairArray[i].drawRect.iTl.iY + 5));
-					testPoints.Append(TPoint(
-							aBitmapRegionPairArray[i].bitmap->SizeInPixels().iWidth-6, 5));
-					testPoints.Append(TPoint(
-							aBitmapRegionPairArray[i].drawRect.iTl.iX + 5,
-							aBitmapRegionPairArray[i].drawRect.iBr.iY -6));
-					testPoints.Append(TPoint(5,
-							aBitmapRegionPairArray[i].bitmap->SizeInPixels().iHeight - 6));
-					testPoints.Append(aBitmapRegionPairArray[i].drawRect.iBr
-							- TPoint(6, 6));
-					testPoints.Append(TPoint(
-							aBitmapRegionPairArray[i].bitmap->SizeInPixels().iWidth-6,
-							aBitmapRegionPairArray[i].bitmap->SizeInPixels().iHeight-6));
-					}
-				else
-					{
-					testPoints.Append(aBitmapRegionPairArray[i].drawRect.iTl
-							+ TPoint(2, 3));
-					testPoints.Append(TPoint(5, 5));
-					testPoints.Append(TPoint(
-							aBitmapRegionPairArray[i].drawRect.iBr.iX - 3,
-							aBitmapRegionPairArray[i].drawRect.iTl.iY + 3));
-					testPoints.Append(TPoint(
-							aBitmapRegionPairArray[i].bitmap->SizeInPixels().iWidth-6, 5));
-					testPoints.Append(TPoint(
-							aBitmapRegionPairArray[i].drawRect.iTl.iX + 2,
-							aBitmapRegionPairArray[i].drawRect.iBr.iY -4));
-					testPoints.Append(TPoint(5,
-							aBitmapRegionPairArray[i].bitmap->SizeInPixels().iHeight - 6));
-					testPoints.Append(aBitmapRegionPairArray[i].drawRect.iBr
-							- TPoint(3, 4));
-					testPoints.Append(TPoint(
-							aBitmapRegionPairArray[i].bitmap->SizeInPixels().iWidth-6,
-							aBitmapRegionPairArray[i].bitmap->SizeInPixels().iHeight-6));
-					}
-				}
-			for (int jj=0; jj<testPoints.Count(); jj+=2)
-				{
-				TBool inOther=EFalse;
-				if (!aBitmapRegionPairArray[i].region->Contains(testPoints[jj]))
-					{
-					continue;
-					}
-				for (TInt k=0; k<i; k++)
-					{
-					if (aBitmapRegionPairArray[k].region->Contains(testPoints[jj]))
-						{
-						inOther = ETrue;
-						}
-					}
-				if (inOther)
-					{
-					continue;
-					}
-				TPoint currentPoint = testPoints[jj];
-				TRect bound = aBitmapRegionPairArray[i].region->BoundingRect();
-				TBool
-						contat =
-								aBitmapRegionPairArray[i].region->Contains(testPoints[jj]);
-				aBitmap.GetPixel(color1, aRect2.iTl + testPoints[jj]);
-				aBitmapRegionPairArray[i].bitmap->GetPixel(color2,
-						testPoints[jj+1]);
-				TRgb color5 = GreatestColor(color1);
-				TRgb color6 = GreatestColor(color2);
-				if (color5 != color6)
-					{
-					// Bitmap copy can be off by a pixel on grid filled surface so allow for green and yellow to be treated equally as they are the background colours, this may allow a misfunctioning gce to pass the test though.
-					if (color6 == TRgb(0, 1, 0) && color5 == TRgb(1, 1, 0))
-						{
-						}
-					else
-						if (color6 == TRgb(1, 1, 0) && color5 == TRgb(0, 1, 0))
-							{
-							}
-						else
-							{
-							testPoints.Close();
-							return EFalse;
-							}
-					}
-				}
-
-			testPoints.Close();
-			corners.Close();
-			ignoreDueToResizing.Union(*aBitmapRegionPairArray[i].region);
-			aBitmapRegionPairArray.Remove(i);
-			}
-		}
-
-	RRegion superRegion;
-
-	regionCount = aBitmapRegionPairArray.Count();
-
-	for (TInt i=0; i<regionCount; i++)
-		{
-		superRegion.Union(*(aBitmapRegionPairArray[i].region));
-		}
-	TRect boundingRect = superRegion.BoundingRect();
-	superRegion.Close();
-	TInt width = boundingRect.Width();
-	TInt height = boundingRect.Height();
-	TInt xStart = boundingRect.iTl.iX;
-	TInt yStart = boundingRect.iTl.iY;
-	
-	TSize superSize = aBitmap.SizeInPixels();
-	TRgb HHH1;
-	TInt nonWhiteCount = 0;
-	for (TInt iii = 0; iii<superSize.iWidth; iii++)
-		{
-		for (TInt jjj=0; jjj<superSize.iHeight; jjj++)
-			{
-			aBitmap.GetPixel(HHH1, TPoint(iii,jjj));
-			if (HHH1 != TRgb (255, 255, 255))
-				{
-				nonWhiteCount++;
-				}
-			}
-		}
-
-	if (aBitmapRegionPairArray.Count()>0)
-		{
-		for (TInt i=0; i<width; i++)
-			{
-			for (TInt j=0; j<height; j++)
-				{
-				TInt arrayIndex = 0;
-				TBool pointInArray= EFalse;
-				TPoint currentPoint(xStart + i, yStart + j);
-				if (!ignoreDueToResizing.Contains(currentPoint))
-					{
-					do
-						{
-						if (aBitmapRegionPairArray[arrayIndex].region->Contains(currentPoint))
-							{							
-							if (aIsSurface)
-								{
-								TPoint checkPoint = currentPoint + aRect2.iTl;
-								TRect readBackRect;
-								mappingInterface->MapCoordinates(EApplicationSpace, TRect(checkPoint, TSize(1,1)), ECompositionSpace, readBackRect);
-								aBitmap.GetPixel(color1, readBackRect.iTl);
-								}
-							else 
-								{
-								TPoint checkPoint = currentPoint + aRect1.iTl;
-								TRect readBackRect;
-								mappingInterface->MapCoordinates(EApplicationSpace, TRect(checkPoint, TSize(1,1)), ECompositionSpace, readBackRect);
-								aBitmap.GetPixel(color1, readBackRect.iTl);
-								}
-
-							aBitmapRegionPairArray[arrayIndex].bitmap->GetPixel(color2,	currentPoint
-																		- aBitmapRegionPairArray[arrayIndex].drawRect.iTl);
-							
-							TRgb color7 = GreatestColor(color1);
-							TRgb color8 = GreatestColor(color2);
-
-							if (color7 != color8)
-								{
-								diffPixels++;
-								//return EFalse;
-								}
-							pointInArray = ETrue;
-							}
-						arrayIndex++;
-						}
-					while (!pointInArray && !(arrayIndex
-							>= aBitmapRegionPairArray.Count()));
-
-					if (!pointInArray)
-						{
-						aBitmap.GetPixel(color1, TPoint(i + aRect2.iTl.iX
-								+ xStart, j +aRect2.iTl.iY +yStart));
-						aBitmap.GetPixel(color2, TPoint(i + aRect1.iTl.iX
-								+xStart, j +aRect1.iTl.iY+yStart));
-						// Bitmap copy is duller on first few iterations so just pick the greatest color or two colors and see if they match
-						TRgb color3 = GreatestColor(color1);
-						TRgb color4 = GreatestColor(color2);
-
-						if (color3 != color4)
-							{
-							// Bitmap copy can be off by a pixel on grid filled surface so allow for green and yellow to be treated equally as they are the background colours, this may allow a misfunctioning gce to pass the test though.
-							if (GreatestColor(color2) == TRgb(0, 1, 0)
-									&& GreatestColor(color1) == TRgb(1, 1, 0))
-								{
-								continue;
-								}
-							else
-								if (GreatestColor(color2) == TRgb(1, 1, 0)
-										&& GreatestColor(color1) == TRgb(0, 1,
-												0))
-									{
-									continue;
-									}
-								else
-									{
-									errorPixels++;
-									//return EFalse;
-									}
-							}
-						}
-					}
-				}
-			}
-		}
-	ignoreDueToResizing.Close();
-	if (errorPixels+diffPixels < 2)
-		{
-		return ETrue;
-		}
-	else
-		{
-		return EFalse;
-		}
-
-	}
-
-
-/*
-  Creates a rough apprxoiamtion to the color pass in. This is used because of issues with the bitmap drwaing in the comparison window. If these issues are fixed then this method can be changed to simply return aColor.
-
- @param aColor the color to be approximated
- @return an approximation of aColor.
- */
-TRgb CWsDynamicResBasic::GreatestColor(TRgb& aColor) const
-	{
-	TInt test = aColor.Difference(TRgb(0, 0, 0));
-	// Accounts for a case when Rgb = 20,20,20 due to poor bitmap drawing
-	if (aColor == TRgb(32, 32, 32))
-		{
-		return TRgb(0, 0, 0);
-		}
-	if (aColor == TRgb(0, 0, 0))
-		{
-		return TRgb(0, 0, 0);
-		}
-	TRgb test2;
-	test2.SetInternal(0xFFFEDF01);
-	if (aColor == test2)
-		{
-		return TRgb(1, 1, 0);
-		}
-
-	if (test < 70)
-		{
-		return TRgb(0, 0, 0);
-		}
-	if (aColor.Green() > aColor.Blue())
-		{
-		if (aColor.Green() > aColor.Red())
-			{
-			return TRgb(0, 1, 0);
-			}
-		else
-			if (aColor.Green() == aColor.Red())
-				{
-				return TRgb(1, 1, 0);
-				}
-		}
-	if (aColor.Green() > aColor.Red())
-		{
-		if (aColor.Green() > aColor.Blue())
-			{
-			return TRgb(0, 1, 0);
-			}
-		else
-			if (aColor.Green() == aColor.Blue())
-				{
-				return TRgb(0, 1, 1);
-				}
-		}
-
-	if (aColor.Red() > aColor.Green())
-		{
-		if (aColor.Red() > aColor.Blue())
-			{
-			return TRgb(1, 0, 0);
-			}
-		else
-			if (aColor.Red() == aColor.Blue())
-				{
-				return TRgb(1, 0, 1);
-				}
-		}
-	if (aColor.Red() > aColor.Blue())
-		{
-		if (aColor.Red() > aColor.Green())
-			{
-			return TRgb(1, 0, 0);
-			}
-		else
-			if (aColor.Red() == aColor.Green())
-				{
-				return TRgb(1, 1, 0);
-				}
-		}
-
-	if (aColor.Blue() > aColor.Red())
-		{
-		if (aColor.Blue() > aColor.Green())
-			{
-			return TRgb(0, 0, 1);
-			}
-		else
-			if (aColor.Blue() == aColor.Green())
-				{
-				return TRgb(0, 1, 1);
-				}
-		}
-	if (aColor.Blue() > aColor.Green())
-		{
-		if (aColor.Blue() > aColor.Red())
-			{
-			return TRgb(0, 0, 1);
-			}
-		else
-			if (aColor.Blue() == aColor.Red())
-				{
-				return TRgb(1, 0, 1);
-				}
-		}
-
-	// Should never reach here, but the compiler cannot be sure
-	return TRgb(0, 0, 0);
-	}
-
-/*
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0051L
-@SYMTestCaseDesc		Getting if a mode is dynamic
-@SYMREQ					REQ11554
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPriority		1
-@SYMTestPurpose			Check functions work correctly
-@SYMTestActions			
-	Do IsModeDynamic for a wrong mode number
-	Do IsModeDynamic for a mode that isnt dynamic
-	Do IsModeDynamic for a mode that is dynamic
-	Do IsCurrentModeDynamic when current mode is not dynamic
-	Do IsCurrentModeDynamic when current mode is dynamic
-	MODE 10 must be dynamic
-@SYMTestExpectedResults	
-	All should return as expected.
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0051L()
-	{
-	RArray<TInt> screenModeList;
-	iInfoScreenDevice->GetScreenSizeModeList(&screenModeList);
-	iInfoScreenDevice->SetAppScreenMode(0);
-	iInfoScreenDevice->SetScreenMode(0);
-	iSession.Flush();
-	Pause(50);
-	ASSERT_FALSE(iInfoScreenDevice->IsModeDynamic(25));
-	ASSERT_FALSE(iInfoScreenDevice->IsModeDynamic(1));
-	ASSERT_TRUE(iInfoScreenDevice->IsModeDynamic(10));
-	ASSERT_FALSE(iInfoScreenDevice->IsCurrentModeDynamic());
-	iInfoScreenDevice->SetAppScreenMode(10);
-	iInfoScreenDevice->SetScreenMode(10);
-	iSession.Flush();
-	Pause(50);
-	ASSERT_TRUE(iInfoScreenDevice->IsCurrentModeDynamic());
-	screenModeList.Close();
-	iInfoScreenDevice->SetAppScreenMode(0);
-	iInfoScreenDevice->SetScreenMode(0);
-	}
-
-/* Takes any 0x0 resolutions out of the res list, useful for some tests
-*/
-void ResListCleanup(RArray<MDisplayControl::TResolution>& aResList)
-	{
-	for (TInt ii=0; ii<aResList.Count(); ii++)
-		{
-		if (aResList[ii].iPixelSize.iWidth == 0 ||
-				aResList[ii].iPixelSize.iHeight == 0)
-			{
-			aResList.Remove(ii);
-			ii--;
-			}
-		}
-	}
-
-/*
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0052L
-@SYMTestCaseDesc		Getting if a mode is dynamic
-@SYMREQ					REQ11554
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPriority		1
-@SYMTestPurpose			Check functions work correctly
-@SYMTestActions			
-	For every standard screen mode
-		Check twips and pixel conversions are correct based on screen mode values
-	Set dynamic app mode
-	For every resolution
-		Check twips and pixel conversions are correct based on physical screen values
-@SYMTestExpectedResults	
-	All should return as expected.
-	NOTE- there must be a dynamic screen mode available
-	NOTE- only run on a screen with multiple resolutions available
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0052L()
-	{
-	MDisplayControl* interface = static_cast<MDisplayControl*>
-			(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-	ASSERT_TRUE(interface);
-	
-	TInt resolutions = interface->NumberOfResolutions();
-	ASSERT_TRUE (resolutions > 1);
-		
-	RArray<MDisplayControl::TResolution> resolutionList1;
-	TInt error = interface->GetResolutions(resolutionList1);
-	ASSERT_EQUALS(resolutionList1.Count(), resolutions);
-	ResListCleanup(resolutionList1);	//remove any 0x0
-	ASSERT_TRUE (resolutionList1.Count() > 1);	//without multiple proper res this test is pointless
-	
-	TDisplayConfiguration newResolution;
-	newResolution.SetResolution(resolutionList1[0].iPixelSize);
-	error = interface->SetConfiguration(newResolution);
-	ASSERT_EQUALS(error,KErrNone);
-	
-	TSizeMode info;
-	RArray<TInt> screenModes;
-	error = iInfoScreenDevice->GetScreenSizeModeList(&screenModes);
-	ASSERT_TRUE(error>KErrNone);
-	TInt dynamicMode1 = -1;
-	TInt dynamicMode2 = -1;
-	TPixelsTwipsAndRotation modeAttributes;
-	
-	//for every app mode, check calculations update correctly
-	for (TInt ii=0;ii<screenModes.Count();ii++)
-		{
-		TInt screenMode = screenModes[ii];
-		if (iInfoScreenDevice->IsModeDynamic(screenMode))
-			{
-			CArrayFixFlat<TInt>* rotations=new(ELeave) CArrayFixFlat<TInt>(1);
-			CleanupStack::PushL(rotations);
-			TInt error = iInfoScreenDevice->GetRotationsList(screenMode,rotations);
-			ASSERT_EQUALS(error,KErrNone);
-			ASSERT_TRUE(rotations->Count()>0);
-			for (TInt jj = 0; jj < rotations->Count(); jj++)
-			    {
-			    if ((*rotations)[jj] == (TInt)CFbsBitGc::EGraphicsOrientationNormal ||
-			            (*rotations)[jj] == (TInt)CFbsBitGc::EGraphicsOrientationRotated180)
-                    {
-                    dynamicMode1 = screenMode;
-                    }
-			    else if ((*rotations)[jj] == (TInt)CFbsBitGc::EGraphicsOrientationRotated90 ||
-			            (*rotations)[jj] == (TInt)CFbsBitGc::EGraphicsOrientationRotated270)
-                    {
-                    dynamicMode2 = screenMode;
-                    }
-			    }
-			CleanupStack::PopAndDestroy(rotations);
-			continue;	//dont want to test dynamic modes
-			}
-		
-		INFO_PRINTF2(_L("ScreenMode %d"),screenMode);
-		newResolution.ClearAll();
-		
-		iInfoScreenDevice->SetAppScreenMode(screenMode);
-		iInfoScreenDevice->SetScreenMode(screenMode);
-		iSession.Flush();
-		Pause(50);
-		
-		info = iInfoScreenDevice->GetCurrentScreenModeAttributes();
-		//These 2 asserts relate to DEF136304 - disconnect on startup causes invalid
-		//twips values.  They need to be calculated when the screen is connected
-		ASSERT_TRUE(info.iScreenTwipsSize.iWidth < 40000);
-		ASSERT_TRUE(info.iScreenTwipsSize.iHeight < 40000);
-		
-		//test that conversions correlate to values reported by config
-		TInt test = iInfoScreenDevice->HorizontalTwipsToPixels(
-				info.iScreenTwipsSize.iWidth);
-		ASSERT_EQUALS (test,info.iScreenSize.iWidth);
-		
-		test = iInfoScreenDevice->VerticalTwipsToPixels(
-				info.iScreenTwipsSize.iHeight);
-		ASSERT_EQUALS (test,info.iScreenSize.iHeight);
-		
-		test = iInfoScreenDevice->HorizontalPixelsToTwips(
-				info.iScreenSize.iWidth);
-		ASSERT_EQUALS (test,info.iScreenTwipsSize.iWidth);
-		
-		test = iInfoScreenDevice->VerticalPixelsToTwips(
-				info.iScreenSize.iHeight);
-		ASSERT_EQUALS (test,info.iScreenTwipsSize.iHeight);
-		}
-
-	if (dynamicMode1 == -1 && dynamicMode2 == -1)	//expected to find at least 1 dynamic mode
-		{
-		ASSERT_TRUE(0);
-		}
-
-	for (TInt jj=0;jj<2;jj++)  //for dynamic mode 1 and 2
-	    {
-	    TInt dynMode = (jj == 0) ? dynamicMode1 : dynamicMode2;
-	    if (dynMode == -1)
-	        continue;
-        //set dynamic app mode
-	    iInfoScreenDevice->SetAppScreenMode(dynMode);
-	    iInfoScreenDevice->SetScreenMode(dynMode);
-	    iSession.Flush();
-	    Pause(50);
-	    ASSERT_TRUE(iInfoScreenDevice->IsModeDynamic(dynMode));
-	    ASSERT_TRUE(iInfoScreenDevice->IsCurrentModeDynamic());
-	    ASSERT_EQUALS(dynMode,iInfoScreenDevice->CurrentScreenMode());
-        for (TInt ii=0;ii<resolutionList1.Count();ii++)
-            {
-            INFO_PRINTF2(_L("ResIndex %d"),ii);
-            newResolution.ClearAll();
-            //set config
-            newResolution.SetResolution(resolutionList1[ii].iPixelSize);
-            newResolution.SetResolutionTwips(resolutionList1[ii].iTwipsSize);
-            SetRotation(newResolution,resolutionList1[ii]);
-            TDisplayConfiguration1::TRotation tempSetRot;
-            newResolution.GetRotation(tempSetRot);
-            
-            error = interface->SetConfiguration(newResolution);
-
-            if (jj == 0)
-                {
-                if (tempSetRot == TDisplayConfiguration1::ERotation90CW ||
-                        tempSetRot == TDisplayConfiguration1::ERotation270CW) //mode rotation will not work with config rotation
-                    {
-                    ASSERT_EQUALS(error,KErrArgument);
-                    continue;
-                    }
-                }
-            else    //jj == 1
-                {
-                if (tempSetRot == TDisplayConfiguration1::ERotationNormal ||
-                        tempSetRot == TDisplayConfiguration1::ERotation180) //mode rotation will not work with config rotation
-                    {
-                    ASSERT_EQUALS(error,KErrArgument);
-                    continue;
-                    }
-                }
-            ASSERT_EQUALS(error,KErrNone);
-            interface->GetConfiguration(newResolution);
-            iSession.Flush();
-            Pause(50);
-            
-            //test that conversions correlate to values reported by config
-            TInt test = iInfoScreenDevice->HorizontalTwipsToPixels(
-                    resolutionList1[ii].iTwipsSize.iWidth);
-            ASSERT_EQUALS (test,resolutionList1[ii].iPixelSize.iWidth);
-            
-            test = iInfoScreenDevice->VerticalTwipsToPixels(
-                    resolutionList1[ii].iTwipsSize.iHeight);
-            ASSERT_EQUALS (test,resolutionList1[ii].iPixelSize.iHeight);
-            
-            test = iInfoScreenDevice->HorizontalPixelsToTwips(
-                    resolutionList1[ii].iPixelSize.iWidth);
-            ASSERT_EQUALS (test,resolutionList1[ii].iTwipsSize.iWidth);
-            
-            test = iInfoScreenDevice->VerticalPixelsToTwips(
-                    resolutionList1[ii].iPixelSize.iHeight);
-            ASSERT_EQUALS (test,resolutionList1[ii].iTwipsSize.iHeight);
-            }
-	    }
-
-	resolutionList1.Close();
-	screenModes.Close();
-	}
-
-/*
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0053L
-@SYMTestCaseDesc		SetScreenSizeAndRotation
-@SYMREQ					REQ11554
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPriority		1
-@SYMTestPurpose			Check functions work correctly
-@SYMTestActions			
-	Perform calls to SetScreenSizeAndRotation with the various structure types
-	MODE 10 must be dynamic
-@SYMTestExpectedResults	
-	Cannt fail, used for debugging and coverage.
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0053L()
-	{
-	MDisplayControl* interface = static_cast<MDisplayControl*>
-			(iScreenDevice->GetInterface(MDisplayControl::ETypeId));
-	ASSERT_TRUE(interface);
-	
-	TInt resolutions = interface->NumberOfResolutions();
-	ASSERT_TRUE (resolutions > 1);
-		
-	RArray<MDisplayControl::TResolution> resolutionList1;
-	TInt error = interface->GetResolutions(resolutionList1);
-	ASSERT_EQUALS(resolutionList1.Count(), resolutions);
-	
-	//set default app mode and default resolution
-	iInfoScreenDevice->SetAppScreenMode(0);
-	iInfoScreenDevice->SetScreenMode(0);
-	iSession.Flush();
-	Pause(50);
-	TDisplayConfiguration original;
-	original.SetResolution(resolutionList1[0].iPixelSize);
-	interface->SetConfiguration(original);
-	iSession.Flush();
-	Pause(50);
-	
-	TPixelsAndRotation setup0;
-	setup0.iPixelSize = TSize(30,40);
-	setup0.iRotation = CFbsBitGc::EGraphicsOrientationNormal;
-	
-	TPixelsTwipsAndRotation setup1;
-	setup1.iPixelSize = TSize(50,60);
-	setup1.iTwipsSize = TSize(70,80);
-	setup1.iRotation = CFbsBitGc::EGraphicsOrientationNormal;
-	
-	iInfoScreenDevice->SetScreenSizeAndRotation(setup0);
-	iInfoScreenDevice->SetScreenSizeAndRotation(setup1);
-	
-	//set dynamic app mode
-	iInfoScreenDevice->SetAppScreenMode(10);
-	iInfoScreenDevice->SetScreenMode(10);
-	iSession.Flush();
-	Pause(50);
-	
-	iInfoScreenDevice->SetScreenSizeAndRotation(setup0);
-	iInfoScreenDevice->SetScreenSizeAndRotation(setup1);
-
-	const CWsScreenDevice* newDevice = iScreenDevice;
-	const MDisplayControl* interface2 = (MDisplayControl*)
-			newDevice->GetInterface(MDisplayControl::ETypeId);
-	TInt version = interface2->PreferredDisplayVersion();	//for coverage!
-	(void)version;
-
-	//set default app mode and default resolution
-	iInfoScreenDevice->SetAppScreenMode(1);
-	iInfoScreenDevice->SetScreenMode(1);
-	iSession.Flush();
-	Pause(50);
-	interface->SetConfiguration(original);
-	iSession.Flush();
-	Pause(50);
-	
-	resolutionList1.Close();
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0101L
-@SYMTestCaseDesc		Quick demonstration of app modes sizes and positions on screen
-@SYMREQ					
-@SYMPREQ				PREQ2102
-@SYMTestType			CT (manual visual test)
-@SYMTestPurpose			To show app modes
-@SYMTestActions			
-	For every app mode
-	Draw a blue box showing the full size and position of the app mode.
-	Draw thin red lines demonstrating a window can be drawn outside of the app area to fill
-	the screen.
-	Green borders at the edge of the appmode, to show we are drawing up to the edges of the
-	appmode.
-@SYMTestExpectedResults	
-	Blue window should represent appmode (with offset and size)
-	Red windows should be visible across screen
-	Green border (made of windows) around the appmode (blue window)
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0101L()
-	{
-	RArray<TInt> screenModeList;
-	iInfoScreenDevice->GetScreenSizeModeList(&screenModeList);
-
-	if (screenModeList.Count()>1)
-		{
-		//Got modes to change between!
-		TSize resBefore;
-		for (TInt res=0;res<screenModeList.Count();res++)
-			{
-			TDisplayConfiguration dispConfigReq;
-			iInfoScreenDevice->SetAppScreenMode(screenModeList[res]);
-			iInfoScreenDevice->SetScreenMode(screenModeList[res]);
-			iSession.Flush();
-			Pause(50);
-
-			TSize appSize = iInfoScreenDevice->SizeInPixels();
-			RWindow backWindow(iSession);
-			ASSERT_EQUALS(backWindow.Construct(iGroup, 123455), KErrNone);
-			backWindow.SetRequiredDisplayMode(iDisplayMode);
-			backWindow.SetBackgroundColor(iCyan);
-			backWindow.SetExtent(TPoint(40,40),appSize-TSize(40,40));	//shows size of the apparea
-			backWindow.Activate();
-		
-			TSurfaceId surfaceID;
-			TRAPD(err, surfaceID = iUtility->CreateSurfaceL(TSize(200,200), 
-					KSurfaceFormat, 200 * KBytesPerPixel));
-			ASSERT_EQUALS(err,KErrNone);
-			TRAP(err,iUtility->FanFillSurfaceL(surfaceID,iYellow,iRed,iMagenta));
-			ASSERT_EQUALS(err,KErrNone);
-			TSurfaceConfiguration surfConf;
-			surfConf.SetSurfaceId(surfaceID);
-			
-			backWindow.SetBackgroundSurface(surfaceID);
-			
-			DrawPlainUI(backWindow,ETrue,iBlue);
-			iSession.Flush();
-			Pause(200);
-
-			RWindow longWindow1(iSession);
-			ASSERT_EQUALS(longWindow1.Construct(iGroup, 123456), KErrNone);
-			longWindow1.SetRequiredDisplayMode(iDisplayMode);
-			longWindow1.SetBackgroundColor(iRed);
-			longWindow1.SetExtent(TPoint(-2000,10),TSize(5000,5));	//shows you can draw outside the apparea
-			longWindow1.Activate();
-			DrawPlainUI(longWindow1,ETrue,iRed);
-
-			iBackground.SetColor(TRgb(0x001000*res|0x800000));
-			iSession.SetBackgroundColor(TRgb(0x001000*res+0x40));
-			iSession.Flush();
-			Pause(100);
-			
-			RWindow longWindow2(iSession);
-			ASSERT_EQUALS(longWindow2.Construct(iGroup, 123457), KErrNone);
-			longWindow2.SetRequiredDisplayMode(iDisplayMode);
-			longWindow2.SetBackgroundColor(iRed);
-			longWindow2.SetExtent(TPoint(20,-2000),TSize(5,5000));	//shows you can draw outside the apparea
-			longWindow2.Activate();
-			DrawPlainUI(longWindow2,ETrue,iRed);
-			
-			//borders
-			RWindow borderTop(iSession);
-			ASSERT_EQUALS(borderTop.Construct(iGroup, 123460), KErrNone);
-			borderTop.SetRequiredDisplayMode(iDisplayMode);
-			borderTop.SetBackgroundColor(iGreen);
-			borderTop.SetExtent(TPoint(0,0),TSize(appSize.iWidth,5));	//border
-			borderTop.Activate();
-			DrawPlainUI(borderTop,ETrue,iGreen);
-			
-			RWindow borderLeft(iSession);
-			ASSERT_EQUALS(borderLeft.Construct(iGroup, 123461), KErrNone);
-			borderLeft.SetRequiredDisplayMode(iDisplayMode);
-			borderLeft.SetBackgroundColor(iGreen);
-			borderLeft.SetExtent(TPoint(0,0),TSize(5,appSize.iHeight));	//border
-			borderLeft.Activate();
-			DrawPlainUI(borderLeft,ETrue,iGreen);
-						
-			RWindow borderRight(iSession);
-			ASSERT_EQUALS(borderRight.Construct(iGroup, 123462), KErrNone);
-			borderRight.SetRequiredDisplayMode(iDisplayMode);
-			borderRight.SetBackgroundColor(iGreen);
-			borderRight.SetExtent(TPoint(appSize.iWidth-5,0),TSize(5,appSize.iHeight));	//border
-			borderRight.Activate();
-			DrawPlainUI(borderRight,ETrue,iGreen);
-									
-			RWindow borderBottom(iSession);
-			ASSERT_EQUALS(borderBottom.Construct(iGroup, 123463), KErrNone);
-			borderBottom.SetRequiredDisplayMode(iDisplayMode);
-			borderBottom.SetBackgroundColor(iGreen);
-			borderBottom.SetExtent(TPoint(0,appSize.iHeight-5),TSize(appSize.iWidth,5));	//border
-			borderBottom.Activate();
-			DrawPlainUI(borderBottom,ETrue,iGreen);
-
-			iSession.Flush();
-			Pause(100);
-
-			backWindow.Close();
-			longWindow1.Close();
-			longWindow2.Close();
-			borderTop.Close();
-			borderLeft.Close();
-			borderRight.Close();
-			borderBottom.Close();
-			
-			iSession.Finish();
-			Pause(50);
-			}
-		}
-	else
-		{
-		INFO_PRINTF1(_L("Only 1 screen size mode configured on this screen - test skipped."));
-		}
-
-	screenModeList.Close();
-	iInfoScreenDevice->SetAppScreenMode(0);
-	iInfoScreenDevice->SetScreenMode(0);
-	iSession.Finish(ETrue);
-	Pause(100);
-	INFO_PRINTF1(_L("Drawing to borderBottom completed."));
-	}
-
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0102L
-@SYMTestCaseDesc		Quick demonstration of square app modes in all 4 rotations
-@SYMREQ					
-@SYMPREQ				PREQ2102
-@SYMTestType			CT (manual visual test)
-@SYMTestPurpose			To show square app mode in all 4 rotations
-@SYMTestActions			
-	Draw a blue box showing the full size and position of the app mode.
-	Draw thin red lines demonstrating a window can be drawn outside of the app area to fill
-	the screen.
-	Green borders at the edge of the appmode, to show we are drawing up to the edges of the
-	appmode.
-@SYMTestExpectedResults	
-	Blue window should represent appmode (with offset and size)
-	Red windows should be visible across screen
-	Green border (made of windows) around the appmode (blue window)
-*/
-void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0102L()
-	{
-	RArray<TInt> screenModeList;
-	iInfoScreenDevice->GetScreenSizeModeList(&screenModeList);
-
-
-	TSize resBefore;
-	TInt res;
-	for (res=0;res<screenModeList.Count();res++)
-		{
-		iInfoScreenDevice->SetAppScreenMode(screenModeList[res]);
-		iInfoScreenDevice->SetScreenMode(screenModeList[res]);
-
-		iSession.Finish(ETrue);
-		iSession.Flush();
-		Pause(50);
-		
-		TPixelsAndRotation pr;
-		iInfoScreenDevice->GetDefaultScreenSizeAndRotation(pr);
-		if(pr.iPixelSize.iHeight == pr.iPixelSize.iWidth)
-			{
-			//found square appmode
-			break;
-			}
-		}
-	
-	for(TInt rotation = CFbsBitGc::EGraphicsOrientationNormal; rotation <= CFbsBitGc::EGraphicsOrientationRotated270; rotation++)
-		{
-		iScreenDevice->SetCurrentRotations(screenModeList[res], (CFbsBitGc::TGraphicsOrientation)rotation);
-		iSession.Flush();
-		Pause(50);
-		TDisplayConfiguration dispConfigReq;
-		TSize appSize = iInfoScreenDevice->SizeInPixels();
-		RWindow backWindow(iSession);
-		ASSERT_EQUALS(backWindow.Construct(iGroup, 123455), KErrNone);
-		backWindow.SetRequiredDisplayMode(iDisplayMode);
-		backWindow.SetBackgroundColor(iBlue);
-		backWindow.SetExtent(TPoint(0,0),appSize);	//shows size of the apparea
-		backWindow.Activate();
-		DrawPlainUI(backWindow,ETrue,iBlue);
-		iSession.Flush();
-		Pause(200);
-
-		RWindow longWindow1(iSession);
-		ASSERT_EQUALS(longWindow1.Construct(iGroup, 123456), KErrNone);
-		longWindow1.SetRequiredDisplayMode(iDisplayMode);
-		longWindow1.SetBackgroundColor(iRed);
-		longWindow1.SetExtent(TPoint(-2000,10),TSize(5000,5));	//shows you can draw outside the apparea
-		longWindow1.Activate();
-		DrawPlainUI(longWindow1,ETrue,iRed);
-
-		iBackground.SetColor(TRgb(0x001000*res|0x800000));
-		iSession.SetBackgroundColor(TRgb(0x001000*res+0x40));
-		iSession.Flush();
-		Pause(100);
-		
-		RWindow longWindow2(iSession);
-		ASSERT_EQUALS(longWindow2.Construct(iGroup, 123457), KErrNone);
-		longWindow2.SetRequiredDisplayMode(iDisplayMode);
-		longWindow2.SetBackgroundColor(iRed);
-		longWindow2.SetExtent(TPoint(20,-2000),TSize(5,5000));	//shows you can draw outside the apparea
-		longWindow2.Activate();
-		DrawPlainUI(longWindow2,ETrue,iRed);
-		
-		//borders
-		RWindow borderTop(iSession);
-		ASSERT_EQUALS(borderTop.Construct(iGroup, 123460), KErrNone);
-		borderTop.SetRequiredDisplayMode(iDisplayMode);
-		borderTop.SetBackgroundColor(iGreen);
-		borderTop.SetExtent(TPoint(0,0),TSize(appSize.iWidth,5));	//border
-		borderTop.Activate();
-		DrawPlainUI(borderTop,ETrue,iGreen);
-		
-		RWindow borderLeft(iSession);
-		ASSERT_EQUALS(borderLeft.Construct(iGroup, 123461), KErrNone);
-		borderLeft.SetRequiredDisplayMode(iDisplayMode);
-		borderLeft.SetBackgroundColor(iGreen);
-		borderLeft.SetExtent(TPoint(0,0),TSize(5,appSize.iHeight));	//border
-		borderLeft.Activate();
-		DrawPlainUI(borderLeft,ETrue,iGreen);
-					
-		RWindow borderRight(iSession);
-		ASSERT_EQUALS(borderRight.Construct(iGroup, 123462), KErrNone);
-		borderRight.SetRequiredDisplayMode(iDisplayMode);
-		borderRight.SetBackgroundColor(iGreen);
-		borderRight.SetExtent(TPoint(appSize.iWidth-5,0),TSize(5,appSize.iHeight));	//border
-		borderRight.Activate();
-		DrawPlainUI(borderRight,ETrue,iGreen);
-								
-		RWindow borderBottom(iSession);
-		ASSERT_EQUALS(borderBottom.Construct(iGroup, 123463), KErrNone);
-		borderBottom.SetRequiredDisplayMode(iDisplayMode);
-		borderBottom.SetBackgroundColor(iGreen);
-		borderBottom.SetExtent(TPoint(0,appSize.iHeight-5),TSize(appSize.iWidth,5));	//border
-		borderBottom.Activate();
-		DrawPlainUI(borderBottom,ETrue,iGreen);
-
-		iSession.Flush();
-		Pause(100);
-
-		backWindow.Close();
-		longWindow1.Close();
-		longWindow2.Close();
-		borderTop.Close();
-		borderLeft.Close();
-		borderRight.Close();
-		borderBottom.Close();
-		
-		iSession.Finish();
-		Pause(50);
-		
-		}
-
-
-	screenModeList.Close();
-	iInfoScreenDevice->SetAppScreenMode(0);
-	iInfoScreenDevice->SetScreenMode(0);
-	iSession.Finish(ETrue);
-	Pause(100);
-	}
--- a/windowing/windowserver/tdynamicres/src/wsdynamicresclassic.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// TDISPLAYCONFIGURATION.CPP
-// Test class for TDisplayConfiguration
-// 
-//
-
-#include "wsdynamicresclassic.h"
-#include <test/extendtef.h>
-#include "teflogextensions.h"
-
-struct TLoggerStub
-{
-	TLoggerStub(CTestExecuteLogger& aLogger)
-	:	iLogger(&aLogger)	{}
-	CTestExecuteLogger* iLogger;
-	CTestExecuteLogger& operator()()const
-		{
-		return *iLogger;
-		}
-};
-
-// This handles any non-member uses of the extended ASSERT_XXX macros
-void TefUnitFailLeaveL()
-	{
-	
-	User::Leave(KErrTEFUnitFail);
-	}
-
-// Create a suite of all the tests
-CTestSuite* CWsDynamicResClassic::CreateSuiteL(const TDesC& aName)
-	{
-	SUB_SUITE_OPT(CWsDynamicResClassic,NULL);
-
-		ADD_THIS_TEST_STEP(GRAPHICS_WSERV_DYNAMICRES_0100L);
-
-	END_SUITE;	
-	}
-
-// Published Tests
-
-/**
-@SYMTestCaseID			GRAPHICS_WSERV_DYNAMICRES_0100L
-@SYMTestCaseDesc		GetInterface in classic
-@SYMREQ					
-@SYMPREQ				PREQ2102
-@SYMTestType			CT
-@SYMTestPriority		
-@SYMTestPurpose			GetInterface should always return NULL in classic
-@SYMTestActions			
-	Create an RWsSession
-	Create a CWsScreenDevice
-	Call GetInterface with various GUIDS.
-@SYMTestExpectedResults	
-	Should always return NULL
-**/
-void CWsDynamicResClassic::GRAPHICS_WSERV_DYNAMICRES_0100L()
-	{
-	RWsSession session;
-	session.Connect();
-
-	CWsScreenDevice* screenDevice = NULL;
-
-	TRAPD(err, screenDevice = new (ELeave) CWsScreenDevice(session));
-	PRINT_ON_ERROR2_L(err, _L("Failed to create screen device: %d"), err);
-	if (screenDevice)
-		{
-		ASSERT_EQUALS_X(screenDevice->Construct(0), KErrNone);
-	
-		void* interface = screenDevice->GetInterface(12344321);
-		ASSERT_NULL (interface);
-		interface = screenDevice->GetInterface(0);
-		ASSERT_NULL (interface);
-		}
-
-	delete screenDevice;
-	session.Close();
-	}
-
--- a/windowing/windowserver/tdynamicres/src/wsgcedebugsession.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,177 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
-*/
-
-#include "wsgcedebugsession.h"
-
-RWsDebugSession::RWsDebugSession(TInt aScreenNo /*= -1*/):
-	iScreenNo(aScreenNo),
-	iSurfaceUpdateSerial(-1)
-	{
-	iSurfaceListBuffer.CreateMax(48);
-	}
-
-RWsDebugSession::~RWsDebugSession()
-	{
-	iSurfaceListBuffer.Close();
-	
-	}
-
-TBool RWsDebugSession::ResetUpdated()
-	{
-	TInt surfaceUpdateSerial=DebugInfo(EWsDebugSerialSurfacesUpdated,iScreenNo);
-	TBool retVal=(iSurfaceUpdateSerial!=surfaceUpdateSerial);
-	iSurfaceUpdateSerial=surfaceUpdateSerial;
-	return retVal;
-	}
-
-TInt RWsDebugSession::ResetUpdatedAndGetSurfaceWindowList(const TWsDebugWindowId * & aWinList)
-	{
-	iSurfaceUpdateSerial=DebugInfo(EWsDebugSerialSurfacesUpdated,iScreenNo);
-	TInt reqSize=DebugInfo(EWsDebugSurfaceWindowList,iSurfaceListBuffer,iScreenNo);
-	while (reqSize>iSurfaceListBuffer.MaxLength())
-		{
-		iSurfaceListBuffer.Close();
-		iSurfaceListBuffer.CreateMax(reqSize);
-		iSurfaceUpdateSerial=DebugInfo(EWsDebugSerialSurfacesUpdated,iScreenNo);
-		reqSize=DebugInfo(EWsDebugSurfaceWindowList,iSurfaceListBuffer,iScreenNo);
-		}
-	if (reqSize==KErrCancel)
-		{
-		aWinList=NULL;
-		return 0;
-		}
-	else
-		{
-		aWinList=(TWsDebugWindowId*)iSurfaceListBuffer.Ptr();
-		return reqSize/sizeof(TWsDebugWindowId);
-		}
-	}
-/**
- * Stream data into the provided buffer and point the return object pointer to it.
- * The pointer is left null if the method returns an error code or the buffer is too small.
- * The ret5urn code reports 
- * 
- **/
-TInt	RWsDebugSession::DebugInfo(TWsDebugInfoFunc aFunction, TInt aParam, TDes8& aHostBuffer,const void*&aReturnedObject,TInt aObjectSize)const
-	{
-	aHostBuffer.SetMax();
-	TInt reqSize=DebugInfo(aFunction,aHostBuffer,aParam);
-	aReturnedObject=NULL;
-	if (reqSize<0)
-		{
-		return reqSize;	//Error code is transmitted unmolested
-		}
-	if (reqSize==0)		//Size 0 is transformed to max
-		reqSize=aHostBuffer.MaxLength();
-	if ((reqSize%aObjectSize)!=0)
-		{				//Size not multiple of object --> error
-		return KErrCorrupt;
-		}
-	if (reqSize<=aHostBuffer.MaxLength())
-		{		//Pointer is only set if data fits buffer
-		aReturnedObject=(const void*)aHostBuffer.Ptr();
-		}
-	reqSize/=aObjectSize;	//Return the exact number of objects filled
-	return reqSize;
-	}
-/**
- * Stream the reply data via the buffer associated with the region.
- * Some protected accessor optimisation used to manage the reported size of the region after streaming.
- * 
- **/
-TInt	RWsDebugSession::DebugInfo(TWsDebugInfoFunc aFunction, TInt aParam, TRegion& aPreAllocatedReturnedRegion)const
-	{
-	//Attempt to fit the received data in the preexisting region buffer...
-	class XRegion:public TRegion
-		{
-		public:
-			using TRegion::AppendRect;
-		//	using TRegion::SetListSize;
-			using TRegion::RectangleListW;
-			TInt MaxSize()				
-				{ return iAllocedRects;	}
-			void  SetListSize(TInt aNewSize)	//DANGER no error checking!!!				
-				{ iCount=aNewSize;	}
-		}& preAllocatedReturnedRegion=(XRegion&)aPreAllocatedReturnedRegion;
-	typedef TRect TElt;
-	TInt reqSize=preAllocatedReturnedRegion.MaxSize();
-	const TElt* elements=preAllocatedReturnedRegion.RectangleListW();
-	TInt lenBytes=reqSize*sizeof(TElt);
-	TPtr8 pBuff((TUint8*)elements,lenBytes,lenBytes);
-	reqSize=DebugInfo(aFunction,aParam,pBuff,elements);
-	
-	if (elements)
-		{
-		if (reqSize==0)
-			{
-			reqSize=preAllocatedReturnedRegion.MaxSize();
-			}
-		preAllocatedReturnedRegion.SetListSize(reqSize);
-		return reqSize;
-		}
-	//If data does not fit in preexisting buffer
-	//Use a temp array instead
-	//Still try to block copy into the existing capacity
-	//I think this use of region copy is more efficient than appending,
-	//and definitely better than unioning the elements.
-	if (reqSize>=0)
-		{
-		TInt breakLoop=10;
-		do	{
-			TElt* tempbuff=new TElt[reqSize];
-			if (tempbuff==NULL)
-				{
-				reqSize=KErrNoMemory;
-				break;
-				}
-			elements=tempbuff;
-			TInt lenBytes=reqSize*sizeof(TElt);
-			TPtr8 pBuff((TUint8*)elements,lenBytes,lenBytes);
-			TInt reqSize2=DebugInfo(aFunction,aParam,pBuff,elements);
-			if (reqSize2!=0)
-				reqSize=reqSize2;
-			if (elements)
-				{
-				RRegion r(reqSize,tempbuff);	//note this region does not own its memory so should not be closed!
-				aPreAllocatedReturnedRegion.Copy(r);
-				if (aPreAllocatedReturnedRegion.CheckError())
-					reqSize=KErrNoMemory;
-				}
-			delete[] tempbuff;
-			}while (reqSize>0 && elements==NULL && --breakLoop);
-		}
-	if (reqSize>=0 && elements==NULL)
-		{
-		preAllocatedReturnedRegion.ForceError();
-		reqSize=KErrTimedOut;
-		}
-	if (reqSize<0)
-		{
-		if (reqSize==KErrCancel)
-			{
-			preAllocatedReturnedRegion.Clear();
-			}
-		else
-			{
-			preAllocatedReturnedRegion.ForceError();
-			}
-	
-		}
-	return reqSize;
-	}
--- a/windowing/windowserver/test/ANIMWIN.H	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/ANIMWIN.H	Fri Jul 16 11:45:55 2010 +0300
@@ -21,7 +21,7 @@
 #include <e32std.h>
 #include <e32base.h>
 #include "W32STD.H"
-#include "../tlib/testbase.h"
+#include "../test/tlib/testbase.h"
 
 _LIT(VIDEO_MBM_NAME,"Z:\\WSTEST\\MAILANIM.MBM");
 
--- a/windowing/windowserver/test/CONNECT.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/CONNECT.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -19,7 +19,7 @@
 #include "W32STD.H"
 #include <e32svr.h>
 #include "../SERVER/w32cmd.h"
-#include "../tlib/testbase.h"
+#include "../test/tlib/testbase.h"
 #include "ANIMWIN.H"
 #include "HNDLODR.H"
 
--- a/windowing/windowserver/test/FadeCount.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/FadeCount.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -19,7 +19,7 @@
 #include <e32std.h>
 #include "W32STD.H"
 #include <e32svr.h>
-#include "../tlib/testbase.h"
+#include "../test/tlib/testbase.h"
 
 const TInt ETestFailed = 1;
 
--- a/windowing/windowserver/test/SHELL.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/SHELL.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -21,8 +21,8 @@
 #include "../SERVER/w32cmd.h"
 #include <e32svr.h>
 #include <hal.h>
-#include "../tlib/testbase.h"
-#include "../TClick/CLICK.H"
+#include "../test/tlib/testbase.h"
+#include "../test/TClick/CLICK.H"
 
 #define __USING_PROCESS_
 
--- a/windowing/windowserver/test/TAutoServer/TAutoServer.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/TAutoServer/TAutoServer.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -72,6 +72,7 @@
 #include "TMULSCREENS.h"
 #include "TBUFFERSECURITY.H"
 #include "TFLICKERFREE.H"
+#include "tdevicerotation.h"
 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
 #include "TFADINGBITMAP.H"
 #endif
@@ -86,6 +87,7 @@
 #include "tdrawresource.h"
 #include "twindowsizecache.h"
 
+
 /* Path to the script
 z:\GraphicsTest\gditest.script
 */
@@ -309,6 +311,8 @@
   		testStep = new CTBufferSecurityStep();
    	else if(aStepName == KTFlickerFreeStep)
   		testStep = new CTFlickerFreeStep();
+    else if(aStepName == KTDeviceRotationStep)
+     testStep = new CTDeviceRotationStep();
 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
 	else if(aStepName == KTFadingBitmapStep)
   		testStep = new CTFadingBitmapStep();
--- a/windowing/windowserver/test/TAutoServer/openwfc/TAutoServer_nga.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/TAutoServer/openwfc/TAutoServer_nga.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -24,22 +24,19 @@
 MACRO TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
 MACRO SYMBIAN_GRAPHICS_GCE
 
-USERINCLUDE		../../../../../graphicstest/graphicstestharness/inc ../../../inc ../../../tauto ../../../tauto/openwfc
-USERINCLUDE		../../../tredir ../../../tlisten ../../../tframerate ../../../tcontaindrawer ../../t_gdcoverage ../../../tbufferdrawer
-USERINCLUDE		../../../tlib ../../
+USERINCLUDE		../../../../../graphicstest/graphicstestharness/inc ../../../inc ../../tauto ../../tauto/openwfc
+USERINCLUDE		../../tredir ../../tlisten ../../tframerate ../../tcontaindrawer ../../t_gdcoverage ../../tbufferdrawer
+USERINCLUDE		../../tlib ../../
 
-APP_LAYER_SYSTEMINCLUDE_SYMBIAN
-MW_LAYER_SYSTEMINCLUDE_SYMBIAN
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-OS_LAYER_LIBC_SYSTEMINCLUDE 
-
+OS_LAYER_SYSTEMINCLUDE
+OS_LAYER_LIBC_SYSTEMINCLUDE
 
 SOURCEPATH    ../
 SOURCE        TAutoServer.cpp
 SOURCEPATH    ../../
 SOURCE        PARSEINIDATA.CPP
 
-SOURCEPATH    ../../../tauto
+SOURCEPATH    ../../tauto
 SOURCE        AUTO.CPP
 SOURCE        TAUTODLL.CPP
 SOURCE        TEvent.CPP
@@ -102,6 +99,7 @@
 SOURCE	      tmultiptrevent.cpp
 SOURCE	      tdrawresource.cpp
 SOURCE	      twindowsizecache.cpp
+SOURCE        tdevicerotation.cpp
 
 //Required to test CommamdBuffer::Play using MWsGraphicsContext in tgc
 SOURCE        directgdigcwrapper.cpp
--- a/windowing/windowserver/test/TAutoServer/openwfc/TAutoServer_nonnga.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/TAutoServer/openwfc/TAutoServer_nonnga.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -23,12 +23,11 @@
 
 MACRO TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
 
-USERINCLUDE		../../../../../graphicstest/graphicstestharness/inc ../../../inc ../../../tauto ../../../tauto/openwfc
-USERINCLUDE		../../../tredir ../../../tlisten ../../../tframerate ../../../tcontaindrawer ../../t_gdcoverage
-USERINCLUDE		../../../tlib ../../
+USERINCLUDE		../../../../../graphicstest/graphicstestharness/inc ../../../inc ../../tauto ../../tauto/openwfc
+USERINCLUDE		../../tredir ../../tlisten ../../tframerate ../../tcontaindrawer ../../t_gdcoverage
+USERINCLUDE		../../tlib ../../
 
-MW_LAYER_SYSTEMINCLUDE_SYMBIAN
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+OS_LAYER_SYSTEMINCLUDE
 OS_LAYER_LIBC_SYSTEMINCLUDE
 
 SOURCEPATH    ../
@@ -36,7 +35,7 @@
 SOURCEPATH    ../../
 SOURCE        PARSEINIDATA.CPP
 
-SOURCEPATH    ../../../tauto
+SOURCEPATH    ../../tauto
 SOURCE        AUTO.CPP
 SOURCE        TAUTODLL.CPP
 SOURCE        TEvent.CPP
@@ -96,6 +95,7 @@
 SOURCE        THeartBeat.CPP
 SOURCE        tgc.cpp
 SOURCE	      TGRAPHICSDRAWER.CPP
+SOURCE        tdevicerotation.cpp
 
 LIBRARY	        bitgdi.lib	efsrv.lib	euser.lib	fbscli.lib
 LIBRARY	        gdi.lib		hal.lib		tlib.lib	ws32.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/windowing/windowserver/test/TAutoServer/tevent_captureapp.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,29 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Helper application for TEvent test case GRAPHICS-WSERV-417-61800-0004
+//
+
+TARGET		tevent_captureapp.exe
+TARGETTYPE	exe
+UID			0x00000000 0x102872e4
+VENDORID	0x70000001
+CAPABILITY	SwEvent
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+SOURCEPATH	../tauto
+SOURCE		tevent_captureapp.cpp
+
+LIBRARY		euser.lib
+LIBRARY		ws32.lib
--- a/windowing/windowserver/test/scripts/wstest_config.cmd	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/scripts/wstest_config.cmd	Fri Jul 16 11:45:55 2010 +0300
@@ -1,22 +1,22 @@
 @echo off
-rem Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+rem Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 rem All rights reserved.
 rem This component and the accompanying materials are made available
 rem under the terms of "Eclipse Public License v1.0"
 rem which accompanies this distribution, and is available
 rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
-rem 
+rem
 rem Initial Contributors:
 rem Nokia Corporation - initial contribution.
-rem 
+rem
 rem Contributors:
-rem 
+rem
 rem Description:
 rem @internalComponent - Internal Symbian
 rem 
 rem
 set nonnga=false
-if not defined EPOC_INI set EPOC_INI=\epoc32\data\epoc.ini
+if not defined EPOC_INI set EPOC_INI=%EPOCROOT%epoc32\data\epoc.ini
 if /i "%2"=="nonnga" set nonnga=true
 if /i "%3"=="nonnga" set nonnga=true
 if "%nonnga%"=="true" echo Configuring for Non-NGA
@@ -33,7 +33,7 @@
 	call :doinstall %EMULATOR_DATA_DIR% multiscreen %2 %3
 )
 
-echo If EPOC.INI isn't already backuped then backup EPOC.INI to EPOC.INI.bak
+rem If EPOC.INI isn't already backed up then backup EPOC.INI to EPOC.INI.bak
 if not exist %EPOC_INI%.bak copy /y %EPOC_INI% %EPOC_INI%.bak
 
 echo Editing EPOC.INI to use multiscreen.
@@ -46,7 +46,7 @@
 
 
 :doinstall
-rem If WSINI.INI(s) aren't already backuped then backup WSINI.INI(s)
+rem If WSINI.INI(s) aren't already backed up then backup WSINI.INI(s)
 if not exist %1\z\system\data\wsini.bak   if exist %1\z\system\data\wsini.ini   copy /y %1\z\system\data\wsini.ini   %1\z\system\data\wsini.bak >nul
 if not exist %1\z\resource\data\wsini.bak if exist %1\z\resource\data\wsini.ini copy /y %1\z\resource\data\wsini.ini %1\z\resource\data\wsini.bak >nul
 
@@ -84,7 +84,7 @@
 	call :doinstall_changetracking %EMULATOR_DATA_DIR% multiscreen %2 %3
 )
 
-echo If EPOC.INI isn't already backuped then backup EPOC.INI to EPOC.INI.bak
+rem If EPOC.INI isn't already backed up then backup EPOC.INI to EPOC.INI.bak
 if not exist %EPOC_INI%.bak copy /y %EPOC_INI% %EPOC_INI%.bak >nul
 
 echo Editing EPOC.INI to use multiscreen.
@@ -128,9 +128,9 @@
 	call :douninstall %EMULATOR_DATA_DIR%
 )
 
-echo If EPOC.INI was already backuped then restore EPOC.INI from EPOC.INI.bak
+rem If EPOC.INI was already backed up then restore EPOC.INI from EPOC.INI.bak
 if exist %EPOC_INI%.bak (
-	echo Restore EPOC.INI from backup
+	echo Restoring EPOC.INI from backup
 	copy /y %EPOC_INI%.bak %EPOC_INI% >nul
 	del /f /q %EPOC_INI%.bak >nul
 )
@@ -139,7 +139,7 @@
 
 :douninstall
 
-rem If WSINI.INI(s) were already backuped then restore WSINI.INI
+rem If WSINI.INI(s) were already backed up then restore WSINI.INI
 if exist %1\z\system\data\wsini.bak (
 copy /y %1\z\system\data\wsini.bak   %1\z\system\data\wsini.ini >nul
 del  /f /q %1\z\system\data\wsini.bak >nul
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/windowing/windowserver/test/scripts/wstest_t_devicerotation_s0_nga.script	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,31 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+//
+
+PRINT Run WServ NGA device rotation tests on screen 0
+
+LOAD_SUITE tautoserver_nga
+
+//
+// Uncommenting the TMemLeakCheckEnable test will set Wserv into a mode where
+// between each test it effectively shuts itself down, checks for memory leaks,
+// then restarts. This is especially useful when the final TMemLeakCheckOneShot
+// test indicates a memory leak somewhere in the tests.
+// RUN_TEST_STEP 100 tautoserver_nga TMemLeakCheckEnable
+//
+
+RUN_TEST_STEP 100 tautoserver_nga TDeviceRotation
+
+// Run at the end and it will trigger a Wserv memory leak check
+RUN_TEST_STEP 100 tautoserver_nga TMemLeakCheckOneShot
--- a/windowing/windowserver/test/t_genericplugin/group/bld.inf	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/t_genericplugin/group/bld.inf	Fri Jul 16 11:45:55 2010 +0300
@@ -33,6 +33,8 @@
 
 ../data/ini/wsini_nga.ini					z:/wstest/genericplugin/wsini_nga.ini
 
+../data/ini/wsini_vasco_genericplugin.ini					z:/wstest/genericplugin/wsini_vasco_genericplugin.ini
+
 ../data/ini/wsini_nga_onescreen.ini			z:/wstest/genericplugin/wsini_nga_onescreen.ini
 
 ../data/ini/wsini_nonnga.ini					z:/wstest/genericplugin/wsini_nonnga.ini
--- a/windowing/windowserver/test/t_genericplugin/rom/t_wservgenericplugin.iby	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/t_genericplugin/rom/t_wservgenericplugin.iby	Fri Jul 16 11:45:55 2010 +0300
@@ -18,6 +18,9 @@
 #if (!defined __T_WSERV_GENERICPLUGIN_IBY__)
 #define __T_WSERV_GENERICPLUGIN_IBY__
 
+#include <graphics_sirocco_wsini.hby>
+#define WSERV_TEST_WSINI WSERV_TEST_WSINI_GENERICPLUGIN
+
 #include <testexecute.iby>
 
 // wserv testexecute server
--- a/windowing/windowserver/test/t_ratelimiter/group/bld.inf	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/t_ratelimiter/group/bld.inf	Fri Jul 16 11:45:55 2010 +0300
@@ -26,7 +26,10 @@
 ../data/epoc.ini					z:/wstest/ratelimiter/epoc.ini
 ../data/epoc_singlescreen.ini				z:/wstest/ratelimiter/epoc_singlescreen.ini
 
+
 ../data/wsini.ini					z:/wstest/ratelimiter/wsini.ini
+../data/wsini_vasco_ratelimiter.ini					z:/wstest/ratelimiter/wsini_vasco_ratelimiter.ini
+
 ../data/wsini_changetracking.ini			z:/wstest/ratelimiter/wsini_changetracking.ini
 ../data/wsini_hw_singlescreen.ini			z:/wstest/ratelimiter/wsini_hw_singlescreen.ini
 ../data/wsini_hw_multiscreen.ini			z:/wstest/ratelimiter/wsini_hw_multiscreen.ini
--- a/windowing/windowserver/test/t_ratelimiter/rom/t_ratelimiter.iby	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/t_ratelimiter/rom/t_ratelimiter.iby	Fri Jul 16 11:45:55 2010 +0300
@@ -16,6 +16,9 @@
 #ifndef __T_RATELIMITER_IBY__
 #define __T_RATELIMITER_IBY__
 
+#include <graphics_sirocco_wsini.hby>
+#define WSERV_TEST_WSINI WSERV_TEST_WSINI_RATELIMITER
+
 #include <testexecute.iby>
 
 // wserv testexecute server
--- a/windowing/windowserver/test/tauto/TCapKey.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/tauto/TCapKey.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1996-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -455,16 +455,39 @@
 	TInt retVal;
 	TInt resCount=Client()->iWs.ResourceCount();
 	for(TInt index=0;index<numErrorKeys;index++)
-	{
-		retVal = Client()->iGroup->GroupWin()->CaptureKey(errorKeys[index].keyCode,errorKeys[index].modifier_mask,errorKeys[index].modifiers);
+		{
+		retVal = Client()->iGroup->GroupWin()->CaptureKey(errorKeys[index].keyCode,errorKeys[index].modifier_mask,errorKeys[index].modifiers, errorKeys[index].priority);
 		TEST(retVal==KErrArgument);
 		if (retVal!=KErrArgument)
-			INFO_PRINTF3(_L("Client()->iGroup->GroupWin()->CaptureKey() return value - Expected: %d, Actual: %d"), KErrArgument, retVal);	
-	}
+			{
+			_LIT(KMsg, "CaptureKey() with bad parameter set %d returned %d - expected KErrArgument (%d)");
+			LOG_MESSAGE4(KMsg, index, retVal, KErrArgument);	
+			}
+
+		retVal = Client()->iGroup->GroupWin()->CaptureKeyUpAndDowns(errorKeys[index].keyCode, errorKeys[index].modifier_mask, errorKeys[index].modifiers, errorKeys[index].priority);
+		TEST(retVal == KErrArgument);
+		if (retVal != KErrArgument)
+			{
+			_LIT(KMsg, "CaptureKeyUpAndDowns() with bad parameter set %d returned %d - expected KErrArgument (%d)");
+			LOG_MESSAGE4(KMsg, index, retVal, KErrArgument);	
+			}
+
+		retVal = Client()->iGroup->GroupWin()->CaptureLongKey(errorKeys[index].keyCode, errorKeys[index].keyCode, errorKeys[index].modifier_mask, errorKeys[index].modifiers, errorKeys[index].priority, ELongCaptureNormal);
+		TEST(retVal == KErrArgument);
+		if (retVal != KErrArgument)
+			{
+			_LIT(KMsg, "CaptureLongKey() with bad parameter set %d returned %d - expected KErrArgument (%d)");
+			LOG_MESSAGE4(KMsg, index, retVal, KErrArgument);	
+			}
+		}
+
 	retVal = Client()->iWs.ResourceCount();
 	TEST(retVal==resCount);
 	if (retVal!=resCount)
-		INFO_PRINTF3(_L("Client()->iWs.ResourceCount() return value - Expected: %d, Actual: %d"), resCount, retVal);	
+		{
+		_LIT(KMsg, "Resource count %d - expected %d");
+		LOG_MESSAGE3(KMsg, retVal, resCount);	
+		}
 	}
 
 void CTCaptureKey::SetMode(TTestMode aMode)
@@ -801,8 +824,10 @@
 @SYMTestStatus      Implemented
 
 @SYMTestActions     Memorizes amount of objects that the server has allocated for that client.
-					Tries to register 3 different capture keys with invalid
-					modifiers and modifirs mask pair.
+					Tries to register capture keys with invalid modifiers and
+					modifier mask pairs, using each of the RWindowGroup capture
+					functions CaptureKey(), CaptureKeyUpAndDowns() and
+					CaptureLongKey().
 
 @SYMTestExpectedResults Makes sure that the number of server-side objects for the 
 					session didn't change.
--- a/windowing/windowserver/test/tauto/TCapKey.H	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/tauto/TCapKey.H	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1996-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -157,12 +157,21 @@
 	TInt keyCode;
 	TUint modifier_mask;
 	TUint modifiers;
+	TInt priority;
 	};
 
 LOCAL_D SErrorCapKey errorKeys[]={
-	{'a',EModifierFunc|EModifierShift,EModifierFunc|EModifierCtrl},
-	{'1',0,EModifierFunc},
-	{3,EModifierCtrl,EModifierCtrl|EModifierShift},
+	{'a', EModifierFunc|EModifierShift,EModifierFunc|EModifierCtrl, 0},
+	{'1', 0, EModifierFunc, 0},
+	{3, EModifierCtrl,EModifierCtrl|EModifierShift, 0},
+	// @SYMPREQ 417-61800: Check that attempts to capture keys with
+	// EModifierLong in the modifier mask fail with KErrArgument.
+	{'T', EModifierLongKey, 0, 0},
+	{'u', EModifierLongKey|EModifierAlt, EModifierLongKey, 0},
+	{'V', EModifierLongKey|EModifierShift, EModifierLongKey|EModifierShift, 0},
+	// @SYMPREQ 417-61800: Check that attempts to capture keys with a priority
+	// of KMinTInt fail with KErrArgument.
+	{'W', 0, 0, KMinTInt},
 	};
 
 const TInt numCapKeys=sizeof(capKeys)/sizeof(capKeys[0]);
--- a/windowing/windowserver/test/tauto/TEVENT.H	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/tauto/TEVENT.H	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1996-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -38,6 +38,7 @@
 
 const TInt EMaxEventQueueSize=32;
 const TInt EMinQueueSize = 2;
+const TUint KModifiersIgnore = 0xffffffff;
 
 
 class CTEventTest;
@@ -263,6 +264,11 @@
 		// Add additional enum values before this line
 		EMaxCancelCaptureKeyApis
 		};
+	enum TLongkeyCapPriorityTests
+		{
+		ELongkeyCaptureSamePriority,
+		ELongkeyCaptureDiffPriority
+		};
 private:
 	void RunTestsL(TBool aNeedChildWindows=EFalse);
 	void RunTestsRestoreAreaL(TBool aNeedChildWindows);
@@ -285,13 +291,17 @@
 	void Password_NextSetOfEvents();
 	void GroupListChanged_NextSetOfEventsL();
 	void VisibilityChanged_NextSetOfEventsL();
+#ifndef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA  	
+	void KeyEventTranslation_NextSetOfEventsL();
+	void KeyEventBlocking_NextSetOfEventsL();
+	void KeyEventAppRestriction_NextSetOfEventsL();
+	void KeyEventAppPriority_NextSetOfEventsL();
 #ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS	
-#ifndef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA  	
 	void SurfaceVisibilityChanged1_NextSetOfEventsL();
 	void SurfaceVisibilityChanged2_NextSetOfEventsL();
 	void SurfaceVisibilityChanged3_NextSetOfEventsL();
+#endif //SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
 #endif //TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-#endif //SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
 	void CheckTimeStamp_NextSetOfEventsL();
 	void RepeatableKeysL();
 	void PointerCapture_NextSetOfEventsL();
@@ -311,8 +321,8 @@
 	void EventHandlerRemoval_AddEventHandlerMultipleTimes();
 	void CheckPointerCursorInDifferentScreenMode(TSizeMode aMode,TPoint aOrigin);
 	void SimulateAndCheck(TPoint aOrigin,TSize aScale,TInt aXOffset,TInt aYOffset,TPointerEvent::TType aEventType,TRect aPointerCursorArea);
-	void AddExpectedKey(TInt aEventCode, TInt aScanCode, TInt aCode=0, TInt aRepeats=0, TUint aModifiers=0);
-	void AddExpectedKeyDownUp(TInt aScanCode, TInt aCode=0, TInt aRepeats=0, TUint aModifiers=0);
+	void AddExpectedKey(TInt aEventCode, TInt aScanCode, TInt aCode=0, TInt aRepeats=0, TUint aModifiers=KModifiersIgnore);
+	void AddExpectedKeyDownUp(TInt aScanCode, TInt aCode=0, TInt aRepeats=0, TUint aModifiers=KModifiersIgnore);
 	void AddExpectedEvent(TInt aEventCode, CTWinBase* aWin);
 	void AddExpectedEvent(TInt aEventCode);
 	void AddExpectedEvent(TInt aEventCode,RWindowGroup* aWindow);
@@ -358,6 +368,11 @@
 #endif
 	void TestCaptureAndCancelCapturePair(TCaptureKeyApis aCaptureApi, TCancelCaptureKeyApis aCancelCaptureApi);
 	static TInt GenerateAnEvent(TAny* aEventTest);
+	void CheckLongkeyCaptureWithPriority(TLongkeyCapPriorityTests aTestType);
+	void DelayForRepeatEvents(TInt aNumeratorFracVal, TInt aDenominatorFracVal);
+#ifndef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA 	
+	void SpawnCaptureAppL(RProcess& aProcess);
+#endif
 private:
 	CTBlankWindow* iBlankWin;
 	RBlankWindow iBackingWindow;
@@ -390,13 +405,17 @@
 	TBool iIs3DPointer;
 	TBool iPtrPluginLoaded;
 	TInt iYOffset;
+	TTimeIntervalMicroSeconds32 iKeyBoardRepeatInitialDelay;
+	TTimeIntervalMicroSeconds32 iKeyBoardRepeatNextDelay;
+#ifndef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA 	
+	RProcess iCaptureApp1;
+	RProcess iCaptureApp2;
 #ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS	
-#ifndef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA 	
 	TSurfaceId iSurfaceId;
 	RSurfaceManager iSurfaceManager;
 	CPeriodic* iTimeOutCallback;
+#endif // SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
 #endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-#endif // SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
 	};
 
 class CTQueueWindowGroup : public CTWindowGroup
--- a/windowing/windowserver/test/tauto/TEvent.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/tauto/TEvent.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1996-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -37,6 +37,9 @@
 
 _LIT(KKeyClickPluginDll, "click.dll");
 
+const TInt KLongKeyCaptureLowPriority = 1;
+const TInt KLongKeyCaptureHighPriority = 2;
+
 CTQueueClient::CTQueueClient(CTEventTest *aTest) : iTest(aTest)
 	{
 	}
@@ -203,6 +206,7 @@
 		TestL(wsEvent.Type()==expectedEvent.Type() && wsEvent.Handle()==expectedEvent.Handle());
 		}		
 	iLastEventError=(wsEvent.Type()==EEventErrorMessage);
+
 	switch(wsEvent.Type())
 		{
 		case EEventKey:
@@ -212,7 +216,7 @@
 				{
 				_LIT(KKeysDiff,"Count=%d  Key Code Exp=%d (%c)  Act=%d (%c)");
 				buf.Copy(KStartString);
-				buf.AppendFormat(KKeysDiff,iEventCount,iEventCount,eKeyCode,eKeyCode,wsKeyCode,wsKeyCode);
+				buf.AppendFormat(KKeysDiff,iEventCount,eKeyCode,eKeyCode,wsKeyCode,wsKeyCode);
 				iTest->LOG_MESSAGE(buf);
 				}
 			wsKeyRepeat=wsEvent.Key()->iRepeats,eKeyRepeat=expectedEvent.Key()->iRepeats;
@@ -224,10 +228,15 @@
 				iTest->LOG_MESSAGE(buf);
 				}
 		#endif
-			TestL(wsEvent.Key()->iCode==expectedEvent.Key()->iCode && wsEvent.Key()->iRepeats>=expectedEvent.Key()->iRepeats
-								&& (wsEvent.Key()->iRepeats>0)==(expectedEvent.Key()->iRepeats>0));		//Fall Through
+			TestL(wsEvent.Key()->iCode==expectedEvent.Key()->iCode &&
+				wsEvent.Key()->iRepeats>=expectedEvent.Key()->iRepeats &&
+				(wsEvent.Key()->iRepeats>0)==(expectedEvent.Key()->iRepeats>0));
+			// Fall Through
 		case EEventKeyDown:
 		case EEventKeyUp:
+			{
+			TUint wsModifiers = wsEvent.Key()->iModifiers;
+			TUint eModifiers = expectedEvent.Key()->iModifiers;
 		#if defined(FAIL_LOGGING)
 			wsKeyScan=wsEvent.Key()->iScanCode,eKeyScan=expectedEvent.Key()->iScanCode;
 			if (wsKeyScan!=eKeyScan)
@@ -237,8 +246,18 @@
 				buf.AppendFormat(KScanDiff,iEventCount,eKeyScan,eKeyScan,wsKeyScan,wsKeyScan);
 				iTest->LOG_MESSAGE(buf);
 				}
+
+			if (eModifiers != KModifiersIgnore && wsModifiers != eModifiers)
+				{
+				_LIT(KModDiff,"Count=%d  Modifiers Exp=0x%x  Act=0x%x");
+				buf.Copy(KStartString);
+				buf.AppendFormat(KModDiff, iEventCount, eModifiers, wsModifiers);
+				iTest->LOG_MESSAGE(buf);
+				}
 		#endif
-			TestL(wsEvent.Key()->iScanCode==expectedEvent.Key()->iScanCode);
+			TestL(wsEvent.Key()->iScanCode == expectedEvent.Key()->iScanCode &&
+				(eModifiers == KModifiersIgnore || wsModifiers == eModifiers));
+			}
 			break;
 		case EEventModifiersChanged:
 			{
@@ -708,7 +727,8 @@
 		{
 		iIs3DPointer=EFalse;
 		}
-#endif		
+#endif
+	TheClient->iWs.GetKeyboardRepeatRate(iKeyBoardRepeatInitialDelay, iKeyBoardRepeatNextDelay);
 	}
 
 void CTEventTest::Failed()
@@ -820,7 +840,7 @@
 	group.SetOrdinalPosition(position,priority);
 	}
 
-void CTEventTest::AddExpectedKey(TInt aEventCode, TInt aScanCode, TInt aCode/*=0*/, TInt aRepeats/*=0*/, TUint aModifiers/*=0*/)
+void CTEventTest::AddExpectedKey(TInt aEventCode, TInt aScanCode, TInt aCode/*=0*/, TInt aRepeats/*=0*/, TUint aModifiers/*=KModifiersIgnore*/)
 	{
 	TPckgBuf<TWsEvent> evtPkg;
 	TWsEvent& event=evtPkg();
@@ -834,15 +854,27 @@
 	event.Key()->iRepeats=aRepeats;
 	iQueueClient->AddExpectedEvent(event);
 	if (iAddToClick)
+		{
+		if (aModifiers == KModifiersIgnore)
+			{
+			// Key click tests assume zero modifiers in click event by default
+			event.Key()->iModifiers = 0;
+			}
 		iClick.CommandReply(EClickEventAdd,evtPkg);
-	}
-
-void CTEventTest::AddExpectedKeyDownUp(TInt aScanCode, TInt aCode/*=0*/, TInt aRepeats/*=0*/, TUint aModifiers/*=0*/)
+		}
+	}
+
+void CTEventTest::AddExpectedKeyDownUp(TInt aScanCode, TInt aCode/*=0*/, TInt aRepeats/*=0*/, TUint aModifiers/*=KModifiersIgnore*/)
 	{
 	__ASSERT_DEBUG(aScanCode<'a' || aScanCode>'z',AutoPanic(EAutoPanicScanCapital));
-	AddExpectedKey(EEventKeyDown,aScanCode,0,aRepeats,aModifiers);
+	// EModiferAutorepeatable can be present in EEventKey but is never valid
+	// in EEventKeyDown and EEventKeyUp. 
+	TUint modifiersDownUp = (aModifiers == KModifiersIgnore) ?
+		aModifiers : aModifiers & ~EModifierAutorepeatable;
+
+	AddExpectedKey(EEventKeyDown,aScanCode,0,aRepeats,modifiersDownUp);
 	AddExpectedKey(EEventKey,aScanCode,aCode,aRepeats,aModifiers);
-	AddExpectedKey(EEventKeyUp,aScanCode,0,aRepeats,aModifiers);
+	AddExpectedKey(EEventKeyUp,aScanCode,0,aRepeats,modifiersDownUp);
 	}
 
 void CTEventTest::AddExpectedEvent(TInt aEventCode, CTWinBase* aWin)
@@ -1160,20 +1192,32 @@
 	case 27:
 	    RawEventRepeatTest_NextSetOfEventsL();
 	    break;
-	    
-#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS	    
+
 #ifndef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA 	    
     case 28:
-        SurfaceVisibilityChanged1_NextSetOfEventsL();
+        KeyEventTranslation_NextSetOfEventsL();
         break;
     case 29:
-        SurfaceVisibilityChanged2_NextSetOfEventsL();
+        KeyEventBlocking_NextSetOfEventsL();
         break;
     case 30:
+        KeyEventAppRestriction_NextSetOfEventsL();
+        break;
+    case 31:
+        KeyEventAppPriority_NextSetOfEventsL();
+        break;
+#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS	    
+    case 32:
+        SurfaceVisibilityChanged1_NextSetOfEventsL();
+        break;
+    case 33:
+        SurfaceVisibilityChanged2_NextSetOfEventsL();
+        break;
+    case 34:
         SurfaceVisibilityChanged3_NextSetOfEventsL();
         break;
+#endif // SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
 #endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-#endif // SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
         
 	default:
 		AutoPanic(EAutoPanicWrongTest);
@@ -3545,8 +3589,8 @@
 			break;
 		case 2:
 			AddExpectedKey(EEventKeyDown,EStdKeyRightShift,0,0,EModifierRightShift|EModifierShift);
-			AddExpectedKeyDownUp('B','B',0,EModifierRightShift|EModifierShift);
-			AddExpectedKeyDownUp('W','W',0,EModifierRightShift|EModifierShift);
+			AddExpectedKeyDownUp('B','B',0,EModifierRightShift|EModifierShift|EModifierAutorepeatable);
+			AddExpectedKeyDownUp('W','W',0,EModifierRightShift|EModifierShift|EModifierAutorepeatable);
 			AddExpectedKey(EEventKeyUp,EStdKeyRightShift);
 			iQueueClient->iWs.Flush();
 			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeyRightShift);		//1 event
@@ -3854,11 +3898,9 @@
 
 void CTEventTest::CaptureLong_NextSetOfEventsL()
 	{
-	TTimeIntervalMicroSeconds32 initialTime,time;
-	TheClient->iWs.GetKeyboardRepeatRate(initialTime,time);
 	#if defined(LOGGING)
 		TLogMessageText logMessageText;
-		_LIT(KSet,"CaptureLong SetOfEvents: %d of 14");
+		_LIT(KSet,"CaptureLong SetOfEvents: %d of 23");
 		logMessageText.Format(KSet,iEventSet);
 		INFO_PRINTF1(logMessageText);
 	#endif
@@ -3872,53 +3914,72 @@
 			AddExpectedKeyDownUp('A','a');
 			break;
 		case 1:
-			iCaptureKey=iQueueClient->iGroup->GroupWin()->CaptureLongKey(' ','a',0,0,2,ELongCaptureNormal);
+			// Test CaptureLongKey() with modifier value EModifierShift and flag value ELongCaptureNormal
+			iCaptureKey=iQueueClient->iGroup->GroupWin()->CaptureLongKey(' ','a',EModifierShift,EModifierShift,2,ELongCaptureNormal);
 			iQueueClient->iWs.Flush();
+			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeyLeftShift);
 			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeySpace);
 			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+time.Int()/3);
+			DelayForRepeatEvents(1, 3);
 			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeySpace);
+			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeyLeftShift);
+			AddExpectedKey(EEventKeyDown,EStdKeyLeftShift);
 			AddExpectedKey(EEventKeyDown,EStdKeySpace);
-			AddExpectedKey(EEventKey,EStdKeySpace,' ');
-			AddExpectedKey(EEventKey,EStdKeySpace,'a',1);
+			AddExpectedKey(EEventKey,EStdKeySpace,' ',0,EModifierLeftShift|EModifierShift|EModifierAutorepeatable);
+			AddExpectedKey(EEventKey,EStdKeySpace,'a',1,EModifierLongKey|EModifierLeftShift|EModifierShift|EModifierAutorepeatable);
 			AddExpectedKey(EEventKeyUp,EStdKeySpace);
+			AddExpectedKey(EEventKeyUp,EStdKeyLeftShift);
 			iQueueClient->iGroup->GroupWin()->CancelCaptureLongKey(iCaptureKey);
 			break;
-		case 2:
-			iCaptureKey=iQueueClient->iGroup->GroupWin()->CaptureLongKey(' ','a',0,0,2,ELongCaptureWaitShort);
+		case 2:	
+			// Test CaptureLongKey() with modifier value EModifierFunc and flag value ELongCaptureWaitShort
+			iCaptureKey=iQueueClient->iGroup->GroupWin()->CaptureLongKey(EKeyEnter,'a',EModifierFunc,EModifierFunc,2,ELongCaptureWaitShort);
 			iQueueClient->iWs.Flush();
-			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeySpace);
+			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeyLeftFunc);
+			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeyEnter);
 			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+time.Int()/3);
-			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeySpace);
+			DelayForRepeatEvents(1, 3);
+			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeyEnter);
+			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeyLeftFunc);
 			iTest->SimulateKeyDownUp(EStdKeySpace);
-			AddExpectedKey(EEventKeyDown,EStdKeySpace);
-			AddExpectedKey(EEventKey,EStdKeySpace,'a',1);
-			AddExpectedKey(EEventKeyUp,EStdKeySpace);
+			AddExpectedKey(EEventKeyDown,EStdKeyLeftFunc);
+			AddExpectedKey(EEventKeyDown,EStdKeyEnter);
+			AddExpectedKey(EEventKey,EStdKeyEnter,'a',1,EModifierLongKey|EModifierLeftFunc|EModifierFunc|EModifierAutorepeatable);
+			AddExpectedKey(EEventKeyUp,EStdKeyEnter);
+			AddExpectedKey(EEventKeyUp,EStdKeyLeftFunc);
 			AddExpectedKeyDownUp(EStdKeySpace,' ');
 			iQueueClient->iGroup->GroupWin()->CancelCaptureLongKey(iCaptureKey);
 			break;
 		case 3:
-			iCaptureKey=iQueueClient->iGroup->GroupWin()->CaptureLongKey(' ','a',0,0,2,ELongCaptureNormal|ELongCaptureRepeatEvents);
+			// Test CaptureLongKey() with modifier values EModifierFunc|EModifierAlt and flag values ELongCaptureNormal|ELongCaptureRepeatEvents)
+			iCaptureKey=iQueueClient->iGroup->GroupWin()->CaptureLongKey(EKeyEnter,'a',EModifierFunc|EModifierAlt,EModifierFunc|EModifierAlt,2,ELongCaptureNormal|ELongCaptureRepeatEvents);
 			iQueueClient->iWs.Flush();
-			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeySpace);
+			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeyLeftFunc);
+			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeyLeftAlt);
+			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeyEnter);
 			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+5*time.Int());
-			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeySpace);
-			AddExpectedKey(EEventKeyDown,EStdKeySpace);
-			AddExpectedKey(EEventKey,EStdKeySpace,' ');
-			AddExpectedKey(EEventKey,EStdKeySpace,'a',2);
-			AddExpectedKey(EEventKeyUp,EStdKeySpace);
+			DelayForRepeatEvents(5, 1);
+			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeyEnter);
+			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeyLeftAlt);
+			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeyLeftFunc);
+			AddExpectedKey(EEventKeyDown,EStdKeyLeftFunc);
+			AddExpectedKey(EEventKeyDown,EStdKeyLeftAlt);
+			AddExpectedKey(EEventKeyDown,EStdKeyEnter);
+			AddExpectedKey(EEventKey,EStdKeyEnter,EKeyEnter,0,EModifierLeftFunc|EModifierFunc|EModifierLeftAlt|EModifierAlt|EModifierAutorepeatable);
+			AddExpectedKey(EEventKey,EStdKeyEnter,'a',2,EModifierLongKey|EModifierLeftFunc|EModifierFunc|EModifierLeftAlt|EModifierAlt|EModifierAutorepeatable);
+			AddExpectedKey(EEventKeyUp,EStdKeyEnter);
+			AddExpectedKey(EEventKeyUp,EStdKeyLeftAlt);
+			AddExpectedKey(EEventKeyUp,EStdKeyLeftFunc);
 			iQueueClient->iGroup->GroupWin()->CancelCaptureLongKey(iCaptureKey);
 			break;
 		case 4:
 			iQueueClient->iWs.Flush();
 			iTest->SimulateKey(TRawEvent::EKeyDown,'Z');
 			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+3*time.Int());
+			DelayForRepeatEvents(3, 1);
 			iTest->SimulateKey(TRawEvent::EKeyDown,'Y');
 			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+2*time.Int());
+			DelayForRepeatEvents(2, 1);
 			iTest->SimulateKey(TRawEvent::EKeyUp,'Z');
 			iTest->SimulateKey(TRawEvent::EKeyUp,'Y');
 			AddExpectedKey(EEventKeyDown,'Z');
@@ -3934,13 +3995,13 @@
 			iQueueClient->iWs.Flush();
 			iTest->SimulateKey(TRawEvent::EKeyDown,'Z');
 			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+3*time.Int());
+			DelayForRepeatEvents(3, 1);
 			iTest->SimulateKey(TRawEvent::EKeyDown,'Y');
 			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+5*time.Int()/2);
+			DelayForRepeatEvents(5, 2);
 			iTest->SimulateKey(TRawEvent::EKeyUp,'Y');
 			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+2*time.Int());
+			DelayForRepeatEvents(2, 1);
 			iTest->SimulateKey(TRawEvent::EKeyUp,'Z');
 			AddExpectedKey(EEventKeyDown,'Z');
 			AddExpectedKey(EEventKey,'Z','z');
@@ -3957,12 +4018,12 @@
 			iQueueClient->iWs.Flush();
 			iTest->SimulateKey(TRawEvent::EKeyDown,'X');
 			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+3*time.Int());
+			DelayForRepeatEvents(3, 1);
 			iTest->SimulateKeyDownUp(EStdKeySpace);
 			TheClient->iWs.Flush();
 			if(!iTest->IsFullRomL())
 				{
-				User::After(initialTime.Int()+2*time.Int());
+				DelayForRepeatEvents(2, 1);
 				}
 			iTest->SimulateKey(TRawEvent::EKeyUp,'X');
 			AddExpectedKey(EEventKeyDown,'X');
@@ -3983,14 +4044,14 @@
 			iQueueClient->iWs.Flush();
 			iTest->SimulateKey(TRawEvent::EKeyDown,'X');
 			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+5*time.Int());
+			DelayForRepeatEvents(5, 1);
 			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeySpace);
 			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+time.Int()/3);
+			DelayForRepeatEvents(1, 3);
 			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeySpace);
 			TheClient->iWs.Flush();
 			User::ResetInactivityTime();
-			User::After(initialTime.Int()+4*time.Int());
+			DelayForRepeatEvents(4, 1);
 			iTest->SimulateKey(TRawEvent::EKeyUp,'X');
 			AddExpectedKey(EEventKeyDown,'X');
 			AddExpectedKey(EEventKey,'X','x');
@@ -4008,7 +4069,7 @@
 			iQueueClient->iWs.Flush();
 			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeySpace);
 			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+5*time.Int());
+			DelayForRepeatEvents(5, 1);
 			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeySpace);
 			AddExpectedKey(EEventKeyDown,EStdKeySpace);
 			AddExpectedKey(EEventKey,EStdKeySpace,'c',1);
@@ -4022,10 +4083,10 @@
 			iQueueClient->iWs.Flush();
 			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeySpace);
 			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+5*time.Int()/2);
+			DelayForRepeatEvents(5, 2);
 			iTest->SimulateKeyDownUp(EStdKeyEscape);
 			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+3*time.Int());
+			DelayForRepeatEvents(3, 1);
 			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeySpace);
 			AddExpectedKey(EEventKeyDown,EStdKeySpace);
 			AddExpectedKey(EEventKey,EStdKeySpace,' ');
@@ -4045,33 +4106,36 @@
 			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeySpace);
 			TheClient->iWs.Flush();
 			iQueueClient->iGroup->GroupWin()->CancelCaptureLongKey(iCaptureKey);
-			User::After(initialTime.Int()+5*time.Int());
+			DelayForRepeatEvents(5, 1);
 			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeySpace);
 			AddExpectedKey(EEventKeyDown,EStdKeySpace);
 			AddExpectedKey(EEventKey,EStdKeySpace,' ');
 			AddExpectedKey(EEventKeyUp,EStdKeySpace);
 			break;
 		case 11:
-			//Cancel a capture key up and down event whilst a repeat is underway
-			iCaptureKey=iQueueClient->iGroup->GroupWin()->CaptureKeyUpAndDowns(EStdKeySpace,0,0);
+			// Cancel a key up/down capture whilst a repeat is underway.
+			// This should have no effect since only key press events are
+			// repeated.
+			iCaptureKey=iQueueClient->iGroup->GroupWin()->CaptureKeyUpAndDowns('X',0,0);
 			iQueueClient->iWs.Flush();
 			iTest->SimulateKey(TRawEvent::EKeyDown,'X');
 			TheClient->iWs.Flush();
 			iQueueClient->iGroup->GroupWin()->CancelCaptureKeyUpAndDowns(iCaptureKey);
-			User::After(initialTime.Int()+5*time.Int());
+			DelayForRepeatEvents(5, 1);
 			iTest->SimulateKey(TRawEvent::EKeyUp,'X');
 			AddExpectedKey(EEventKeyDown,'X');
 			AddExpectedKey(EEventKey,'X','x');
+			AddExpectedKey(EEventKey,'X','x',2);
 			AddExpectedKey(EEventKeyUp,'X');
 			break;
 		case 12:
 			//Cancel a capture key event whilst a repeat is underway
-			iCaptureKey=iQueueClient->iGroup->GroupWin()->CaptureKey(EStdKeySpace,0,0);
+			iCaptureKey=iQueueClient->iGroup->GroupWin()->CaptureKey('y',0,0);
 			iQueueClient->iWs.Flush();
 			iTest->SimulateKey(TRawEvent::EKeyDown,'Y');
 			TheClient->iWs.Flush();
 			iQueueClient->iGroup->GroupWin()->CancelCaptureKey(iCaptureKey);
-			User::After(initialTime.Int()+5*time.Int());
+			DelayForRepeatEvents(5, 1);
 			iTest->SimulateKey(TRawEvent::EKeyUp,'Y');
 			AddExpectedKey(EEventKeyDown,'Y');
 			AddExpectedKey(EEventKey,'Y','y');
@@ -4079,13 +4143,13 @@
 			break;
 		case 13:
 			//Variation on case 12 i.e. change in the timing of the CancelCaptureKey call
-			iCaptureKey=iQueueClient->iGroup->GroupWin()->CaptureKey(EStdKeySpace,0,0);
+			iCaptureKey=iQueueClient->iGroup->GroupWin()->CaptureKey('z',0,0);
 			iQueueClient->iWs.Flush();
 			iTest->SimulateKey(TRawEvent::EKeyDown,'Z');
 			TheClient->iWs.Flush();
-			User::After(initialTime.Int()+5*time.Int()/2);
+			DelayForRepeatEvents(5, 2);
 			iQueueClient->iGroup->GroupWin()->CancelCaptureKey(iCaptureKey);
-			User::After(initialTime.Int()+5*time.Int()/2);
+			DelayForRepeatEvents(5, 2);
 			iTest->SimulateKey(TRawEvent::EKeyUp,'Z');
 			AddExpectedKey(EEventKeyDown,'Z');
 			AddExpectedKey(EEventKey,'Z','z');
@@ -4102,7 +4166,7 @@
 			iTest->SimulateKey(TRawEvent::EKeyDown,EStdKeySpace);
 			TheClient->iWs.Flush();
 			iQueueClient->iGroup->GroupWin()->CancelCaptureLongKey(iCaptureKey);
-			User::After(initialTime.Int()+time.Int()/3);
+			DelayForRepeatEvents(1, 3);
 
 			TheClient->iGroup->GroupWin()->CancelCaptureKey(shortCaptKey);
 			iTest->SimulateKey(TRawEvent::EKeyUp,EStdKeySpace);
@@ -4110,6 +4174,132 @@
 			AddExpectedKey(EEventKeyUp,EStdKeySpace);
 			}
 			break;
+		case 15:
+			// @SYMPREQ 417-61800: Check that long key events are marked with
+			// EModifierLongKey and short events are not.
+			iCaptureKey = iQueueClient->iGroup->GroupWin()->CaptureLongKey('m', 'm', 0, 0, 0, ELongCaptureNormal);
+			iQueueClient->iWs.Flush();
+			iTest->SimulateKey(TRawEvent::EKeyDown, 'M');
+			TheClient->iWs.Flush();
+			DelayForRepeatEvents(1, 3);
+			iTest->SimulateKey(TRawEvent::EKeyUp, 'M');
+			AddExpectedKey(EEventKeyDown, 'M', 0, 0, 0);
+			AddExpectedKey(EEventKey, 'M', 'm', 0, EModifierAutorepeatable);
+			AddExpectedKey(EEventKey, 'M', 'm', 1, EModifierLongKey | EModifierAutorepeatable);
+			AddExpectedKey(EEventKeyUp, 'M', 0, 0, 0);
+			iQueueClient->iGroup->GroupWin()->CancelCaptureLongKey(iCaptureKey);
+			break;
+		case 16:
+			CheckLongkeyCaptureWithPriority(ELongkeyCaptureDiffPriority);
+			break;
+		case 17:
+			CheckLongkeyCaptureWithPriority(ELongkeyCaptureSamePriority);
+			break;
+		case 18:
+			// Test CaptureLongKey() with flag value ELongCaptureWaitShort
+			// when key is not held down long enough to generate a long event.
+			// Verify that short event is delivered when the key is released.
+			iCaptureKey = iQueueClient->iGroup->GroupWin()->CaptureLongKey('p', 'p', 0, 0, 0, ELongCaptureWaitShort);
+			iQueueClient->iWs.Flush();
+			iTest->SimulateKey(TRawEvent::EKeyDown, 'P');
+			TheClient->iWs.Flush();
+			User::After(iKeyBoardRepeatInitialDelay.Int() / 2);
+			iTest->SimulateKey(TRawEvent::EKeyUp, 'P');
+			TheClient->iWs.Flush();
+			iTest->SimulateKeyDownUp(EStdKeySpace);
+			AddExpectedKey(EEventKeyDown, 'P');
+			AddExpectedKey(EEventKey, 'P', 'p', 0, EModifierAutorepeatable);
+			AddExpectedKey(EEventKeyUp, 'P');
+			AddExpectedKeyDownUp(EStdKeySpace, ' ');
+			iQueueClient->iGroup->GroupWin()->CancelCaptureLongKey(iCaptureKey);
+			break;
+		case 19:
+			{
+			// Cancel a capture key event whilst a repeat is underway for a
+			// different capture. This should not cancel repeating.
+			iCaptureKey = iQueueClient->iGroup->GroupWin()->CaptureKey('q', 0, 0);
+			TInt captureKey2 = iQueueClient->iGroup->GroupWin()->CaptureKey('r', 0, 0);
+			iQueueClient->iWs.Flush();
+			iTest->SimulateKey(TRawEvent::EKeyDown, 'Q');
+			TheClient->iWs.Flush();
+			iQueueClient->iGroup->GroupWin()->CancelCaptureKey(captureKey2);
+			DelayForRepeatEvents(5, 1);
+			iTest->SimulateKey(TRawEvent::EKeyUp, 'Q');
+			AddExpectedKey(EEventKeyDown, 'Q');
+			AddExpectedKey(EEventKey, 'Q', 'q', 0, EModifierAutorepeatable);
+			AddExpectedKey(EEventKey, 'Q', 'q', 2, EModifierAutorepeatable);
+			AddExpectedKey(EEventKeyUp, 'Q');
+			iQueueClient->iGroup->GroupWin()->CancelCaptureKey(iCaptureKey);
+			}
+			break;
+		case 20:
+			{
+			// Cancel a long capture key event whilst a repeat is underway for
+			// a different capture. This should not cancel repeating.
+			iCaptureKey = iQueueClient->iGroup->GroupWin()->CaptureLongKey('s', 's', 0, 0, 2, ELongCaptureNormal|ELongCaptureRepeatEvents);
+			TInt captureKey2 = iQueueClient->iGroup->GroupWin()->CaptureLongKey('t', 't', 0, 0, 2, ELongCaptureNormal|ELongCaptureRepeatEvents);
+			iQueueClient->iWs.Flush();
+			iTest->SimulateKey(TRawEvent::EKeyDown, 'S');
+			TheClient->iWs.Flush();
+			iQueueClient->iGroup->GroupWin()->CancelCaptureLongKey(captureKey2);
+			DelayForRepeatEvents(5, 1);
+			iTest->SimulateKey(TRawEvent::EKeyUp, 'S');
+			AddExpectedKey(EEventKeyDown, 'S');
+			AddExpectedKey(EEventKey, 'S', 's', 0, EModifierAutorepeatable);
+			AddExpectedKey(EEventKey, 'S', 's', 2, EModifierLongKey | EModifierAutorepeatable);
+			AddExpectedKey(EEventKeyUp, 'S');
+			iQueueClient->iGroup->GroupWin()->CancelCaptureLongKey(iCaptureKey);
+			}
+			break;
+		case 21:
+			{
+			// Test CaptureLongKey() with a user specified initial repeat time.
+			// Simulate holding down the key for a period shorter than the
+			// specified delay. Verify that a long key event is NOT generated.
+			// (Note that the period is longer than the default initial repeat
+			// time, thus proving that CaptureLongKey() has honoured the delay
+			// argument.)
+			TTimeIntervalMicroSeconds32 delay(iKeyBoardRepeatInitialDelay.Int() * 4);
+			iCaptureKey = iQueueClient->iGroup->GroupWin()->CaptureLongKey(delay, 'u', 'u', 0, 0, 0, ELongCaptureNormal);
+			iQueueClient->iWs.Flush();
+			iTest->SimulateKey(TRawEvent::EKeyDown, 'U');
+			TheClient->iWs.Flush();
+			User::After(delay.Int() / 2);
+			iTest->SimulateKey(TRawEvent::EKeyUp, 'U');
+			TheClient->iWs.Flush();
+			iTest->SimulateKeyDownUp(EStdKeySpace);
+			AddExpectedKey(EEventKeyDown, 'U');
+			AddExpectedKey(EEventKey, 'U', 'u', 0, EModifierAutorepeatable);
+			AddExpectedKey(EEventKeyUp, 'U');
+			AddExpectedKeyDownUp(EStdKeySpace, ' ');
+			iQueueClient->iGroup->GroupWin()->CancelCaptureLongKey(iCaptureKey);
+			}
+			break;
+		case 22:
+			{
+			// Test CaptureLongKey() with a user specified initial repeat time.
+			// Simulate holding down the key for a period longer than the
+			// specified delay. Verify that a long key event is generated.
+			// (Note that the period is shorter than the default initial repeat
+			// time, thus proving that CaptureLongKey() has honoured the delay
+			// argument.)
+			TTimeIntervalMicroSeconds32 delay(iKeyBoardRepeatInitialDelay.Int() / 4);
+			iCaptureKey = iQueueClient->iGroup->GroupWin()->CaptureLongKey(delay, 'v', 'v', 0, 0, 0, ELongCaptureNormal);
+			iQueueClient->iWs.Flush();
+			iTest->SimulateKey(TRawEvent::EKeyDown, 'V');
+			TheClient->iWs.Flush();
+			User::After(delay.Int() * 2);
+			iTest->SimulateKey(TRawEvent::EKeyUp, 'V');
+			TheClient->iWs.Flush();
+			iTest->SimulateKeyDownUp(EStdKeySpace);
+			AddExpectedKey(EEventKeyDown, 'V');
+			AddExpectedKey(EEventKey, 'V', 'v', 0, EModifierAutorepeatable);
+			AddExpectedKey(EEventKey, 'V', 'v', 1, EModifierLongKey | EModifierAutorepeatable);
+			AddExpectedKey(EEventKeyUp, 'V');
+			AddExpectedKeyDownUp(EStdKeySpace, ' ');
+			iQueueClient->iGroup->GroupWin()->CancelCaptureLongKey(iCaptureKey);
+			}
+			break;
 		default:
 			CActiveScheduler::Stop();
 			break;
@@ -4117,6 +4307,485 @@
 	TheClient->iWs.Flush();
 	}
 
+/** Function used for checking CaptureLongKey() works fine with different priorities.
+
+If two window groups have requested capture of the same key with different priorities, 
+then the event should be delivered to the group that specified higher priority 
+(even if it is in the background).
+
+If two window groups have requested capture of the same key with same priorities,
+then the event should be delivered to the group that requested capture most recently.
+
+@param aTestType Enum value specifying test with same priority or with different priority
+*/
+void CTEventTest::CheckLongkeyCaptureWithPriority(TLongkeyCapPriorityTests aTestType)
+	{
+	TInt ordinalPriority = TheClient->iGroup->GroupWin()->OrdinalPriority();
+	TInt ordinalPosition = TheClient->iGroup->GroupWin()->OrdinalPosition();
+	// Bring other window group to foreground and request capture with lower/same priority
+	// And request capture from iQueueClient group window with higher priority
+	TheClient->iGroup->GroupWin()->SetOrdinalPosition(0, 10);
+	TInt capKeyFrontWin = TheClient->iGroup->GroupWin()->CaptureLongKey('m', 'm', 0, 0, (aTestType == ELongkeyCaptureDiffPriority ? KLongKeyCaptureLowPriority : KLongKeyCaptureHighPriority), ELongCaptureNormal);
+	iCaptureKey = iQueueClient->iGroup->GroupWin()->CaptureLongKey('m', 'm', 0, 0, KLongKeyCaptureHighPriority, ELongCaptureNormal);
+	iQueueClient->iWs.Flush();
+	iTest->SimulateKey(TRawEvent::EKeyDown, 'M');
+	TheClient->iWs.Flush();
+	DelayForRepeatEvents(1, 3);
+	iTest->SimulateKey(TRawEvent::EKeyUp, 'M');
+	AddExpectedEvent(EEventFocusLost);
+	//Note: Button down/up events along with immediate key events are not delivered to iQueueCLient's window group
+	//as they are sent to foreground/focused window group
+	AddExpectedKey(EEventKey, 'M', 'm', 1, EModifierLongKey | EModifierAutorepeatable);
+	iQueueClient->iGroup->GroupWin()->CancelCaptureLongKey(iCaptureKey);
+	TheClient->iGroup->GroupWin()->CancelCaptureLongKey(capKeyFrontWin);
+	TheClient->iGroup->GroupWin()->SetOrdinalPosition(ordinalPosition, ordinalPriority);
+	AddExpectedEvent(EEventFocusGained);
+	}
+
+/** Function used for delaying current thread so that repeat events can be generated.
+
+It uses iKeyBoardRepeatInitialDelay and iKeyBoardRepeatNextDelay variables to get the desired delay.
+The idea is to wait for initial delay + some extra value so that first repeat is generated.
+For more than one repeat events, wait will be initial delay + next delay + some extra value, and so on.
+
+The extra value is taken as fraction of iKeyBoardRepeatNextDelay.
+
+@param aNumeratorFracVal Numerator value of the fraction.
+@param aDenominatorFracVal Denominator value of the fraction.
+*/
+void CTEventTest::DelayForRepeatEvents(TInt aNumeratorFracVal, TInt aDenominatorFracVal)
+	{
+	if (!aNumeratorFracVal || !aDenominatorFracVal)
+		return;
+	User::After(iKeyBoardRepeatInitialDelay.Int() + (iKeyBoardRepeatNextDelay.Int()*aNumeratorFracVal/aDenominatorFracVal));
+	}
+
+#ifndef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA  	
+void CTEventTest::KeyEventTranslation_NextSetOfEventsL()
+	{
+	TTimeIntervalMicroSeconds32 initialTime;
+	TTimeIntervalMicroSeconds32 time;
+	TheClient->iWs.GetKeyboardRepeatRate(initialTime, time);
+
+	RWindowGroup* wg = iQueueClient->iGroup->GroupWin();
+
+	#if defined(LOGGING)
+		TLogMessageText logMessageText;
+		_LIT(KSet,"KeyEventTranslation SetOfEvents: %d of 5");
+		logMessageText.Format(KSet,iEventSet);
+		INFO_PRINTF1(logMessageText);
+	#endif
+
+	switch (iEventSet++)
+		{
+		case 0:
+			iQueueClient->iWs.Flush();
+			iTest->SimulateKeyDownUp('A');
+			AddExpectedEvent(EEventFocusGained);
+			AddExpectedKeyDownUp('A','a');
+			break;
+		case 1:
+			// Test key event translation using CaptureKey()
+			iCaptureKey = wg->CaptureKey(EKeyDevice0, 0, 0);
+			TEST(iCaptureKey >= 0);
+			iQueueClient->iWs.Flush();
+			iTest->SimulateKeyDownUp(EStdKeyDevice1);
+			TheClient->iWs.Flush();
+			AddExpectedKey(EEventKeyDown, EStdKeyDevice1, 0, 0);
+			AddExpectedKey(EEventKey, EStdKeyDevice1, EKeyDevice0, 0);
+			AddExpectedKey(EEventKeyUp, EStdKeyDevice1, 0, 0);
+			wg->CancelCaptureKey(iCaptureKey);
+			break;
+		case 2:
+			// Test key event translation using CaptureKeyUpAndDowns()
+			iCaptureKey = wg->CaptureKeyUpAndDowns(EStdKeyDevice0, 0, 0);
+			TEST(iCaptureKey >= 0);
+			iQueueClient->iWs.Flush();
+			iTest->SimulateKeyDownUp(EStdKeyDevice1);
+			TheClient->iWs.Flush();
+			AddExpectedKey(EEventKeyDown, EStdKeyDevice0, 0, 0);
+			AddExpectedKey(EEventKey, EStdKeyDevice1, EKeyDevice1, 0);
+			AddExpectedKey(EEventKeyUp, EStdKeyDevice0, 0, 0);
+			wg->CancelCaptureKeyUpAndDowns(iCaptureKey);
+			break;
+		case 3:
+			// Test key event translation using CaptureLongKey()
+			iCaptureKey = wg->CaptureLongKey(EKeyDevice0, EKeyDevice0, 0, 0, 0, ELongCaptureNormal);
+			TEST(iCaptureKey >= 0);
+			iQueueClient->iWs.Flush();
+
+			iTest->SimulateKey(TRawEvent::EKeyDown, EStdKeyDevice1);
+			TheClient->iWs.Flush();
+			User::After(initialTime.Int() + time.Int() / 3);
+			iTest->SimulateKey(TRawEvent::EKeyUp, EStdKeyDevice1);
+			TheClient->iWs.Flush();
+
+			AddExpectedKey(EEventKeyDown, EStdKeyDevice1, 0, 0);
+			AddExpectedKey(EEventKey, EStdKeyDevice1, EKeyDevice1, 0, EModifierAutorepeatable);
+			AddExpectedKey(EEventKey, EStdKeyDevice1, EKeyDevice0, 1, EModifierLongKey | EModifierAutorepeatable);
+			AddExpectedKey(EEventKeyUp, EStdKeyDevice1, 0, 0);
+
+			wg->CancelCaptureLongKey(iCaptureKey);
+			break;
+		case 4:
+			// Negative test: check that the capture key code listed in the
+			// translation table of the Key Routing Plug-in is not translated
+			// in the absence of any capture request for the mapped key.
+			iTest->SimulateKeyDownUp(EStdKeyDevice1);
+			TheClient->iWs.Flush();
+			AddExpectedKey(EEventKeyDown, EStdKeyDevice1, 0, 0);
+			AddExpectedKey(EEventKey, EStdKeyDevice1, EKeyDevice1, 0);
+			AddExpectedKey(EEventKeyUp, EStdKeyDevice1, 0, 0);
+			break;
+		default:
+			CActiveScheduler::Stop();
+			break;
+		}
+
+	TheClient->iWs.Flush();
+	}
+
+void CTEventTest::KeyEventBlocking_NextSetOfEventsL()
+	{
+	TTimeIntervalMicroSeconds32 initialTime;
+	TTimeIntervalMicroSeconds32 time;
+	TheClient->iWs.GetKeyboardRepeatRate(initialTime, time);
+
+	RWindowGroup* wg = iQueueClient->iGroup->GroupWin();
+
+	#if defined(LOGGING)
+		TLogMessageText logMessageText;
+		_LIT(KSet,"KeyEventBlocking SetOfEvents: %d of 5");
+		logMessageText.Format(KSet,iEventSet);
+		INFO_PRINTF1(logMessageText);
+	#endif
+
+	switch (iEventSet++)
+		{
+		case 0:
+			iQueueClient->iWs.Flush();
+			iTest->SimulateKeyDownUp('A');
+			AddExpectedEvent(EEventFocusGained);
+			AddExpectedKeyDownUp('A','a');
+			break;
+		case 1:
+			// Simulate pressing a blocked key (Device3) while no
+			// key capture is in effect.
+			iTest->SimulateKeyDownUp(EStdKeyDevice3);
+			iTest->SimulateKeyDownUp('B');
+			TheClient->iWs.Flush();
+			AddExpectedKeyDownUp('B','b');
+			break;
+		case 2:
+			// Use RWindowGroup::CaptureKey() to capture EKeyDevice3
+			// and simulate pressing the blocked key again.
+			iCaptureKey = wg->CaptureKey(EKeyDevice3, 0, 0);
+			TEST(iCaptureKey >= 0);
+			iQueueClient->iWs.Flush();
+			iTest->SimulateKeyDownUp(EStdKeyDevice3);
+			iTest->SimulateKeyDownUp('B');
+			TheClient->iWs.Flush();
+			AddExpectedKey(EEventKey, EStdKeyDevice3, EKeyDevice3, 0);
+			AddExpectedKeyDownUp('B','b');
+			wg->CancelCaptureKey(iCaptureKey);
+			break;
+		case 3:
+			// Repeat using CaptureKeyUpAndDowns()
+			iCaptureKey = wg->CaptureKeyUpAndDowns(EStdKeyDevice3, 0, 0);
+			TEST(iCaptureKey >= 0);
+			iQueueClient->iWs.Flush();
+			iTest->SimulateKeyDownUp(EStdKeyDevice3);
+			iTest->SimulateKeyDownUp('B');
+			TheClient->iWs.Flush();
+			AddExpectedKey(EEventKeyDown, EStdKeyDevice3, 0, 0);
+			AddExpectedKey(EEventKeyUp, EStdKeyDevice3, 0, 0);
+			AddExpectedKeyDownUp('B','b');
+			wg->CancelCaptureKeyUpAndDowns(iCaptureKey);
+			break;
+		case 4:
+			// Repeat using CaptureLongKey()
+			iCaptureKey = wg->CaptureLongKey(EKeyDevice3, EKeyDevice3, 0, 0, 0, ELongCaptureNormal);
+			TEST(iCaptureKey >= 0);
+			iQueueClient->iWs.Flush();
+			iTest->SimulateKey(TRawEvent::EKeyDown, EStdKeyDevice3);
+			TheClient->iWs.Flush();
+			User::After(initialTime.Int() + time.Int() / 3);
+			iTest->SimulateKey(TRawEvent::EKeyUp, EStdKeyDevice3);
+			iTest->SimulateKeyDownUp('B');
+			TheClient->iWs.Flush();
+			AddExpectedKey(EEventKey, EStdKeyDevice3, EKeyDevice3, 1, EModifierLongKey | EModifierAutorepeatable);
+			AddExpectedKeyDownUp('B','b');
+			wg->CancelCaptureLongKey(iCaptureKey);
+			break;
+		default:
+			CActiveScheduler::Stop();
+			break;
+		}
+
+	TheClient->iWs.Flush();
+	}
+
+void CTEventTest::KeyEventAppRestriction_NextSetOfEventsL()
+	{
+	TTimeIntervalMicroSeconds32 initialTime;
+	TTimeIntervalMicroSeconds32 time;
+	TheClient->iWs.GetKeyboardRepeatRate(initialTime, time);
+
+	RWindowGroup* wg = iQueueClient->iGroup->GroupWin();
+
+	#if defined(LOGGING)
+		TLogMessageText logMessageText;
+		_LIT(KSet,"KeyEventAppRestriction SetOfEvents: %d of 4");
+		logMessageText.Format(KSet,iEventSet);
+		INFO_PRINTF1(logMessageText);
+	#endif
+
+	switch (iEventSet++)
+		{
+		case 0:
+			// Make window group non-focusable so that it receives only
+			// keys that are captured and not those that are default-routed.
+			wg->EnableReceiptOfFocus(EFalse);
+			iQueueClient->iWs.Flush();
+			AddExpectedEvent(EEventFocusGained);
+			AddExpectedEvent(EEventFocusLost);
+			break;
+		case 1:
+			// Using RWindowGroup::CaptureKey(), attempt to capture a key
+			// that is restricted by UID to another application.
+			iCaptureKey = wg->CaptureKey(EKeyF20, 0, 0);
+			TEST(iCaptureKey == KErrPermissionDenied);
+			// Now capture a key that is restricted to the current
+			// application's UID and simulate pressing the restricted key.
+			iCaptureKey = wg->CaptureKey(EKeyF21, 0, 0);
+			TEST(iCaptureKey >= 0);
+			iQueueClient->iWs.Flush();
+			// Can't use SimulateKeyDownUp() here due to its check that scan
+			// codes are not in the range corresponding to lower case letters
+			iTest->SimulateKey(TRawEvent::EKeyDown, EStdKeyF21);
+			iTest->SimulateKey(TRawEvent::EKeyUp, EStdKeyF21);
+			TheClient->iWs.Flush();
+			AddExpectedKey(EEventKey, EStdKeyF21, EKeyF21, 0);
+			wg->CancelCaptureKey(iCaptureKey);
+			break;
+		case 2:
+			// Repeat using CaptureKeyUpAndDowns()
+			iCaptureKey = wg->CaptureKeyUpAndDowns(EStdKeyF20, 0, 0);
+			TEST(iCaptureKey == KErrPermissionDenied);
+			iCaptureKey = wg->CaptureKeyUpAndDowns(EStdKeyF21, 0, 0);
+			TEST(iCaptureKey >= 0);
+			iQueueClient->iWs.Flush();
+			iTest->SimulateKey(TRawEvent::EKeyDown, EStdKeyF21);
+			iTest->SimulateKey(TRawEvent::EKeyUp, EStdKeyF21);
+			TheClient->iWs.Flush();
+			AddExpectedKey(EEventKeyDown, EStdKeyF21, 0, 0);
+			AddExpectedKey(EEventKeyUp, EStdKeyF21, 0, 0);
+			wg->CancelCaptureKeyUpAndDowns(iCaptureKey);
+			break;
+		case 3:
+			// Repeat using CaptureLongKey()
+			iCaptureKey = wg->CaptureLongKey(EKeyF20, EKeyF20, 0, 0, 0, ELongCaptureNormal);
+			TEST(iCaptureKey == KErrPermissionDenied);
+			iCaptureKey = wg->CaptureLongKey(EKeyF21, EKeyF21, 0, 0, 0, ELongCaptureNormal);
+			TEST(iCaptureKey >= 0);
+			iQueueClient->iWs.Flush();
+			iTest->SimulateKey(TRawEvent::EKeyDown, EStdKeyF21);
+			TheClient->iWs.Flush();
+			User::After(initialTime.Int() + time.Int() / 3);
+			iTest->SimulateKey(TRawEvent::EKeyUp, EStdKeyF21);
+			TheClient->iWs.Flush();
+			AddExpectedKey(EEventKey, EStdKeyF21, EKeyF21, 1, EModifierLongKey | EModifierAutorepeatable);
+			wg->CancelCaptureLongKey(iCaptureKey);
+			break;
+		default:
+			CActiveScheduler::Stop();
+			break;
+		}
+
+	TheClient->iWs.Flush();
+	}
+
+void CTEventTest::KeyEventAppPriority_NextSetOfEventsL()
+	{
+	TTimeIntervalMicroSeconds32 initialTime;
+	TTimeIntervalMicroSeconds32 time;
+	TheClient->iWs.GetKeyboardRepeatRate(initialTime, time);
+
+	RWindowGroup* wg = iQueueClient->iGroup->GroupWin();
+	TInt handle1 = 0;
+	TInt handle2 = 0;
+	TInt handle3 = 0;
+	TInt handle4 = 0;
+	TInt handle5 = 0;
+	TInt handle6 = 0;
+
+	#if defined(LOGGING)
+		TLogMessageText logMessageText;
+		_LIT(KSet,"KeyEventAppPriority SetOfEvents: %d of 5");
+		logMessageText.Format(KSet,iEventSet);
+		INFO_PRINTF1(logMessageText);
+	#endif
+
+	switch (iEventSet++)
+		{
+		case 0:
+			SpawnCaptureAppL(iCaptureApp1);
+			iQueueClient->iWs.Flush();
+			AddExpectedEvent(EEventFocusGained);
+			AddExpectedEvent(EEventFocusLost);
+			break;
+		case 1:
+			// Use RWindowGroup::CaptureKey() to capture EKeyF22
+			// and EKeyF23 with priority 0. Simulate pressing both
+			// keys. Since the current application has precedence by UID
+			// for capture of EKeyF22, it should receive that key
+			// but should not receive EKeyF23.
+			handle1 = wg->CaptureKey(EKeyF22, 0, 0);
+			handle2 = wg->CaptureKey(EKeyF23, 0, 0);
+			TEST(handle1 >= 0);
+			TEST(handle2 >= 0);
+			iQueueClient->iWs.Flush();
+			iTest->SimulateKey(TRawEvent::EKeyDown, EStdKeyF22);
+			iTest->SimulateKey(TRawEvent::EKeyUp, EStdKeyF22);
+			iTest->SimulateKey(TRawEvent::EKeyDown, EStdKeyF23);
+			iTest->SimulateKey(TRawEvent::EKeyUp, EStdKeyF23);
+			TheClient->iWs.Flush();
+			AddExpectedKey(EEventKey, EStdKeyF22, EKeyF22, 0);
+			wg->CancelCaptureKey(handle1);
+			wg->CancelCaptureKey(handle2);
+			break;
+		case 2:
+			// Repeat using CaptureKeyUpAndDowns()
+			handle1 = wg->CaptureKeyUpAndDowns(EStdKeyF22, 0, 0);
+			handle2 = wg->CaptureKeyUpAndDowns(EStdKeyF23, 0, 0);
+			TEST(handle1 >= 0);
+			TEST(handle2 >= 0);
+			iQueueClient->iWs.Flush();
+			iTest->SimulateKey(TRawEvent::EKeyDown, EStdKeyF22);
+			iTest->SimulateKey(TRawEvent::EKeyUp, EStdKeyF22);
+			iTest->SimulateKey(TRawEvent::EKeyDown, EStdKeyF23);
+			iTest->SimulateKey(TRawEvent::EKeyUp, EStdKeyF23);
+			TheClient->iWs.Flush();
+			AddExpectedKey(EEventKeyDown, EStdKeyF22, 0, 0);
+			AddExpectedKey(EEventKeyUp, EStdKeyF22, 0, 0);
+			wg->CancelCaptureKeyUpAndDowns(handle1);
+			wg->CancelCaptureKeyUpAndDowns(handle2);
+			break;
+		case 3:
+			// Repeat using CaptureLongKey()
+			handle1 = wg->CaptureLongKey(EKeyF22, EKeyF22, 0, 0, 0, ELongCaptureNormal);
+			handle2 = wg->CaptureLongKey(EKeyF23, EKeyF23, 0, 0, 0, ELongCaptureNormal);
+			TEST(handle1 >= 0);
+			TEST(handle2 >= 0);
+			iQueueClient->iWs.Flush();
+
+			iTest->SimulateKey(TRawEvent::EKeyDown, EStdKeyF22);
+			TheClient->iWs.Flush();
+			User::After(initialTime.Int() + time.Int() / 3);
+			iTest->SimulateKey(TRawEvent::EKeyUp, EStdKeyF22);
+
+			iTest->SimulateKey(TRawEvent::EKeyDown, EStdKeyF23);
+			TheClient->iWs.Flush();
+			User::After(initialTime.Int() + time.Int() / 3);
+			iTest->SimulateKey(TRawEvent::EKeyUp, EStdKeyF23);
+			TheClient->iWs.Flush();
+
+			AddExpectedKey(EEventKey, EStdKeyF22, EKeyF22, 1, EModifierLongKey | EModifierAutorepeatable);
+			wg->CancelCaptureLongKey(handle1);
+			wg->CancelCaptureLongKey(handle2);
+			break;
+		case 4:
+			// Repeat with additional capture requests for improved code
+			// coverage. (Also verifies that UID-based precedence works even
+			// when another app makes the most recent capture request.)
+			// Spawn a second capture app so that requests occur in the
+			// following order:
+			// 1. CaptureApp1, priority 1 (outstanding)
+			// 2. Current App, priority 0, precedence by UID
+			// 3. CaptureApp2, priority 1
+			// Note that all three capture types are tested together here.
+			handle1 = wg->CaptureKey(EKeyF22, 0, 0);
+			handle2 = wg->CaptureKey(EKeyF23, 0, 0);
+			handle3 = wg->CaptureKeyUpAndDowns(EStdKeyF22, 0, 0);
+			handle4 = wg->CaptureKeyUpAndDowns(EStdKeyF23, 0, 0);
+			handle5 = wg->CaptureLongKey(EKeyF22, EKeyF22, 0, 0, 0, ELongCaptureNormal);
+			handle6 = wg->CaptureLongKey(EKeyF23, EKeyF23, 0, 0, 0, ELongCaptureNormal);
+			TEST(handle1 >= 0);
+			TEST(handle2 >= 0);
+			TEST(handle3 >= 0);
+			TEST(handle4 >= 0);
+			TEST(handle5 >= 0);
+			TEST(handle6 >= 0);
+			iQueueClient->iWs.Flush();
+
+			SpawnCaptureAppL(iCaptureApp2);
+
+			iTest->SimulateKey(TRawEvent::EKeyDown, EStdKeyF22);
+			TheClient->iWs.Flush();
+			User::After(initialTime.Int() + time.Int() / 3);
+			iTest->SimulateKey(TRawEvent::EKeyUp, EStdKeyF22);
+
+			iTest->SimulateKey(TRawEvent::EKeyDown, EStdKeyF23);
+			TheClient->iWs.Flush();
+			User::After(initialTime.Int() + time.Int() / 3);
+			iTest->SimulateKey(TRawEvent::EKeyUp, EStdKeyF23);
+			TheClient->iWs.Flush();
+
+			AddExpectedKey(EEventKeyDown, EStdKeyF22, 0, 0);
+			AddExpectedKey(EEventKey, EStdKeyF22, EKeyF22, 0);
+			AddExpectedKey(EEventKey, EStdKeyF22, EKeyF22, 1, EModifierLongKey | EModifierAutorepeatable);
+			AddExpectedKey(EEventKeyUp, EStdKeyF22, 0, 0);
+			wg->CancelCaptureKey(handle1);
+			wg->CancelCaptureKey(handle2);
+			wg->CancelCaptureKeyUpAndDowns(handle3);
+			wg->CancelCaptureKeyUpAndDowns(handle4);
+			wg->CancelCaptureLongKey(handle5);
+			wg->CancelCaptureLongKey(handle6);
+			break;
+		default:
+			iCaptureApp1.Kill(KErrNone);
+			iCaptureApp2.Kill(KErrNone);
+			iCaptureApp1.Close();
+			iCaptureApp2.Close();
+			CActiveScheduler::Stop();
+			break;
+		}
+
+	TheClient->iWs.Flush();
+	}
+
+/**
+Spawn another application that will capture the keys EKeyF22 and
+EKeyF23 with high priority.
+
+@param aProcess		Process to create
+*/
+void CTEventTest::SpawnCaptureAppL(RProcess& aProcess)
+	{
+	_LIT(KCaptureApp, "tevent_captureapp.exe");
+	TInt error = aProcess.Create(KCaptureApp, KNullDesC);
+	if (error != KErrNone)
+		{
+#if defined(LOGGING)
+		TLogMessageText logMessageText;
+		_LIT(KLog, "Cannot create capture app - error %d");
+		logMessageText.Format(KLog, error);
+		INFO_PRINTF1(logMessageText);
+#endif
+		User::Leave(error);
+		}
+
+	// Make rendezvous request to capture app
+	TRequestStatus status;
+	aProcess.Rendezvous(status);
+	aProcess.Resume();
+
+	// Wait for capture app to make its capture requests
+	User::WaitForRequest(status);
+	TEST(status.Int() == KErrNone);
+	}
+#endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA  	
+
 #define PASSWORD_START_OF_DAY 4
 void CTEventTest::Password_NextSetOfEvents()
 	{
@@ -6316,15 +6985,19 @@
 	_LIT(KTest25,"Mismatched Pointer Events");
 	_LIT(KTest26,"Pointer Buffer Purge");
 	_LIT(KTest27,"TRawEvent test for Repeats");
+#ifndef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA 
+	_LIT(KTest28,"Translation of key events by routing plug-in");
+	_LIT(KTest29,"Blocking of key events by routing plug-in");
+	_LIT(KTest30,"App UID based restriction of key capture");
+	_LIT(KTest31,"App UID based routing of key events");
 #ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS            
-#ifndef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA 
-	_LIT(KTest28,"Transparent Surface Visibility Changed Events 1");
-	_LIT(KTest29,"Transparent Surface Visibility Changed Events 2");
-	_LIT(KTest30,"Transparent Surface Visibility Changed Events 3");
+	_LIT(KTest32,"Transparent Surface Visibility Changed Events 1");
+	_LIT(KTest33,"Transparent Surface Visibility Changed Events 2");
+	_LIT(KTest34,"Transparent Surface Visibility Changed Events 3");
+#endif // SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
 #endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-#endif // SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
-	_LIT(KTest31A,"Initialize Queue Size without inactive queue");
-	_LIT(KTest31B,"Initialize Queue Size with inactive queue");	
+	_LIT(KTest35A,"Initialize Queue Size without inactive queue");
+	_LIT(KTest35B,"Initialize Queue Size with inactive queue");	
 	
 	if (!TestBase()->ConfigurationSupportsPointerEventTesting())
 	    {
@@ -6644,15 +7317,16 @@
 
 @SYMDEF             DEF081259
 
-@SYMTestCaseDesc    Send events for capturing large areas of text
+@SYMTestCaseDesc    Test RWindowGroup::CaptureLongKey()
 
 @SYMTestPriority    High
 
 @SYMTestStatus      Implemented
 
-@SYMTestActions     Send events for capturing large areas of text
-
-@SYMTestExpectedResults The events are sent to the window without
+@SYMTestActions     Simulate long key presses and check that long key capture
+					and key repeat work as expected.
+
+@SYMTestExpectedResults The correct key events are sent to the window without
 						error
 */
 		case 15:
@@ -6925,8 +7599,118 @@
 		    RunTestsL();
 		    break;
 		    
+#ifndef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA            
+/**
+@SYMTestCaseID      GRAPHICS-WSERV-0751, GRAPHICS-WSERV-0752, GRAPHICS-WSERV-0753
+@SYMPREQ			417-61800
+@SYMTestCaseDesc    Test translation of key events by Key Event Routing plug-in
+@SYMTestPriority    High
+@SYMTestStatus      Implemented
+@SYMTestActions     Use RWindowGroup::CaptureKey() to capture pseudo key
+					Device0 (key code EKeyDevice0, scan code EStdKeyDevice0).
+					Simulate pressing key Device1.
+					Repeat using CaptureKeyUpAndDowns().
+					Repeat using CaptureLongKey().
+					Repeat without any capture requests.
+@SYMTestExpectedResults
+					The key event delivered contains the key or scan code for
+					Device0, if captured. When using CaptureKey() and
+					CaptureLongKey(), only the key code is translated. Using
+					CaptureKeyUpAndDowns(), only the scan code is translated.
+
+Note: this test requires an entry in the translation table of the Key Routing
+Plug-in to map Device0 to Device1 at capture request time.
+*/
+		case 28:
+            ((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0751"));
+            iTest->LogSubTest(KTest28);
+            RunTestsL();
+            break;
+
+/**
+@SYMTestCaseID      GRAPHICS-WSERV-0760, GRAPHICS-WSERV-0761, GRAPHICS-WSERV-0762
+@SYMPREQ			417-61800
+@SYMTestCaseDesc    Test blocking of key events by Key Event Routing plug-in
+@SYMTestPriority    High
+@SYMTestStatus      Implemented
+@SYMTestActions     Simulate pressing a blocked key (Device3) while no
+					key capture is in effect.
+					Use RWindowGroup::CaptureKey() to capture EKeyDevice3
+					and simulate pressing the blocked key again.
+					Repeat using CaptureKeyUpAndDowns().
+					Repeat using CaptureLongKey().
+@SYMTestExpectedResults
+					The blocked key event is only delivered when captured and
+					is not routed to the focussed window group by default.
+
+Note: this test requires entries in the Blocked Key Table of the Reference
+Key Routing Plug-in for EKeyDevice3 and EStdKeyDevice3.
+*/
+		case 29:
+            ((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0760"));
+            iTest->LogSubTest(KTest29);
+            RunTestsL();
+            break;
+
+/**
+@SYMTestCaseID      GRAPHICS-WSERV-0754, GRAPHICS-WSERV-0755, GRAPHICS-WSERV-0756
+@SYMPREQ			417-61800
+@SYMTestCaseDesc    Test application UID-based restriction of key capture by
+					Key Event Routing plug-in.
+@SYMTestPriority    High
+@SYMTestStatus      Implemented
+@SYMTestActions     Attempt to capture a key that is restricted by UID
+					to another application.
+					Use RWindowGroup::CaptureKey() to capture a key that is
+					restricted to the current application's UID.
+					Simulate pressing the second key.
+					Repeat using CaptureKeyUpAndDowns().
+					Repeat using CaptureLongKey().
+@SYMTestExpectedResults
+					Capture of the first key fails with KErrPermissionDenied.
+					Capture of the second key succeeds and the key event is
+					delivered.
+
+Note: this test requires entries in the Restricted Key Table of the Reference
+Key Routing Plug-in for the chosen keys.
+*/
+		case 30:
+            ((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0754"));
+            iTest->LogSubTest(KTest30);
+            RunTestsL();
+            break;
+
+/**
+@SYMTestCaseID      GRAPHICS-WSERV-0757, GRAPHICS-WSERV-0758, GRAPHICS-WSERV-0759
+@SYMPREQ			417-61800
+@SYMTestCaseDesc    Test application UID-based routing of key events by
+					Key Event Routing plug-in.
+@SYMTestPriority    High
+@SYMTestStatus      Implemented
+@SYMTestActions     Invoke another application to capture two different keys
+					with high priority using each of RWindowGroup::CaptureKey(),
+					CaptureKeyUpAndDowns() and CaptureLongKey(). One key of
+					each pair has precedence for capture by the current
+					application's UID (i.e. this test).
+					In the current application, use RWindowGroup::CaptureKey()
+					to capture both keys with lower priority.
+					Simulate pressing the keys.
+					Repeat using CaptureKeyUpAndDowns().
+					Repeat using CaptureLongKey().
+@SYMTestExpectedResults
+					The key event with UID-based precedence is delivered to
+					the current application but the other key is not.
+
+Note: this test requires entries in the Priority Application Table of the
+Reference Key Routing Plug-in for the chosen key.
+*/
+		case 31:
+            ((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0757"));
+            iTest->LogSubTest(KTest31);
+            RunTestsL();
+            break;
+
 #ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS            
-#ifndef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA            
 /**
 @SYMTestCaseID      GRAPHICS-WSERV-2669-0015
 @SYMREQ             REQ13202: Possibility for external layers to appear above UI layer
@@ -6938,9 +7722,9 @@
 @SYMTestActions     Call SetSurfaceTransparency(ETrue) on win2
 @SYMTestExpectedResults Win1 receives visibility event
 */            
-        case 28:
+        case 32:
             ((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-2669-0015"));
-            iTest->LogSubTest(KTest28);
+            iTest->LogSubTest(KTest32);
             RunTestsL();
             break;
 /**
@@ -6955,9 +7739,9 @@
 @SYMTestActions     Delete win3
 @SYMTestExpectedResults Both win1 and win2 receive visibility events
 */            
-        case 29:
+        case 33:
             ((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-2669-0016"));
-            iTest->LogSubTest(KTest29);
+            iTest->LogSubTest(KTest33);
             RunTestsL();
             break;
 /**
@@ -6971,13 +7755,13 @@
 @SYMTestActions     Move win2 to overlap win1
 @SYMTestExpectedResults No visibility event is received (win1 is still fully visible)
 */            
-        case 30:
+        case 34:
             ((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-2669-0017"));
-            iTest->LogSubTest(KTest30);
+            iTest->LogSubTest(KTest34);
             RunTestsL();
             break;
+#endif // SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS  
 #endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
-#endif // SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS  
 
 /**
 @SYMTestCaseID      GRAPHICS-WSERV-0559
@@ -6994,17 +7778,17 @@
 		case 28:
 #else
 #ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
-		case 31:
+		case 35:
 #else
-		case 28:
+		case 32:
 #endif
 #endif
 		    // This test was moved to be the last test in the test suite, because it sometimes leaves events in the event queue, 
 		    //it can affect the results of other tests. This test case should be the last test in the test suite. 
 		    ((CTEventTestStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0484"));
-		    iTest->LogSubTest(KTest31A);
+		    iTest->LogSubTest(KTest35A);
 		    InitializeQueueSizeTestL(EFalse);
-		    iTest->LogSubTest(KTest31B);
+		    iTest->LogSubTest(KTest35B);
 		    InitializeQueueSizeTestL(ETrue);
 		    break;    
 			
--- a/windowing/windowserver/test/tauto/TOOM.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/tauto/TOOM.CPP	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1996-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -66,6 +66,9 @@
 COomFailBase *CreateOomCaptureKeyUpDown(CTOom *aTest)
 	{return(new(ELeave) COomCaptureKeyUpDown(aTest));}
 
+COomFailBase *CreateOomLongKeyCapture(CTOom *aTest)
+	{return(new(ELeave) COomLongKeyCapture(aTest));}
+
 COomFailBase *CreateOomHotKey(CTOom *aTest)
 	{return(new(ELeave) COomHotKey(aTest));}
 
@@ -113,6 +116,7 @@
 	CreateOomPriorityKey,
 	CreateOomCaptureKey,
 	CreateOomCaptureKeyUpDown,
+	CreateOomLongKeyCapture,
 	CreateOomHotKey,
 	CreateOomGroupName,
 	CreateOomSprite,
@@ -421,7 +425,18 @@
 
 //
 
-COomCaptureKey::COomCaptureKey(CTOom *aTest) : COomSetup(aTest)
+COomCaptureKeyBase::COomCaptureKeyBase(CTOom *aTest) : COomSetup(aTest)
+	{}
+
+COomCaptureKeyBase::~COomCaptureKeyBase()
+	{}
+
+void COomCaptureKeyBase::ConstructL()
+	{
+	COomSetup::ConstructL();
+	}
+
+COomCaptureKey::COomCaptureKey(CTOom *aTest) : COomCaptureKeyBase(aTest)
 	{}
 
 COomCaptureKey::~COomCaptureKey()
@@ -433,11 +448,6 @@
 	return(_L("Capture key"));
 	}
 
-void COomCaptureKey::ConstructL()
-	{
-	COomSetup::ConstructL();
-	}
-
 /** Requests a capture keys for a previously created window group
 */
 TInt COomCaptureKey::Fail()
@@ -460,7 +470,7 @@
 
 //
 
-COomCaptureKeyUpDown::COomCaptureKeyUpDown(CTOom *aTest) : COomSetup(aTest)
+COomCaptureKeyUpDown::COomCaptureKeyUpDown(CTOom *aTest) : COomCaptureKeyBase(aTest)
 	{}
 
 COomCaptureKeyUpDown::~COomCaptureKeyUpDown()
@@ -472,11 +482,6 @@
 	return(_L("Capture up/down keys"));
 	}
 
-void COomCaptureKeyUpDown::ConstructL()
-	{
-	COomSetup::ConstructL();
-	}
-
 /** Requests the capture of key-up and key-down events for a previously created window group
 */
 TInt COomCaptureKeyUpDown::Fail()
@@ -499,6 +504,42 @@
 
 //
 
+COomLongKeyCapture::COomLongKeyCapture(CTOom *aTest) : COomCaptureKeyBase(aTest)
+	{}
+
+COomLongKeyCapture::~COomLongKeyCapture()
+	{
+	}
+
+TOomTestName COomLongKeyCapture::TestName()
+	{
+	_LIT(KLongKeyCapTestName, "Long key capture");
+	return KLongKeyCapTestName();
+	}
+
+/** 
+Requests capture of long key events for a previously created window group
+*/
+TInt COomLongKeyCapture::Fail()
+	{
+	for (iIndex=0; iIndex < KNumCapKeyRequest; iIndex++)
+		{
+		TInt ret=iWinGroup.CaptureLongKey(' ','a',0,0,2,ELongCaptureNormal);
+		if (ret<0)
+			return(ret);
+		iCapKey[iIndex]=ret;
+		}
+	return(KErrNone);
+	}
+
+void COomLongKeyCapture::ClearUpL()
+	{
+	for (TInt index=0;index<iIndex;index++)
+		iWinGroup.CancelCaptureLongKey(iCapKey[index]);
+	}
+
+//
+
 COomHotKey::COomHotKey(CTOom *aTest) : COomSetup(aTest)
 	{}
 
--- a/windowing/windowserver/test/tauto/TOOM.H	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/tauto/TOOM.H	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1996-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -33,6 +33,8 @@
 
 class CTOom;
 
+const TInt KNumCapKeyRequest = 20;
+
 
 class COomFailBase : public CBase
 	{
@@ -192,32 +194,45 @@
 	TOomTestName TestName();
 	};
 
-class COomCaptureKey : public COomSetup
+class COomCaptureKeyBase : public COomSetup
+	{
+public:
+	COomCaptureKeyBase(CTOom *aTest);
+	~COomCaptureKeyBase();
+	void ConstructL();
+protected:
+	TInt32 iCapKey[KNumCapKeyRequest];
+	TInt iIndex;	
+	};
+
+class COomCaptureKey : public COomCaptureKeyBase
 	{
 public:
 	COomCaptureKey(CTOom *aTest);
 	~COomCaptureKey();
-	void ConstructL();
 	void ClearUpL();
 	TInt Fail();
 	TOomTestName TestName();
-private:
-	TInt32 iCapKey[20];
-	TInt iIndex;
 	};
 
-class COomCaptureKeyUpDown : public COomSetup
+class COomCaptureKeyUpDown : public COomCaptureKeyBase
 	{
 public:
 	COomCaptureKeyUpDown(CTOom *aTest);
 	~COomCaptureKeyUpDown();
-	void ConstructL();
 	void ClearUpL();
 	TInt Fail();
 	TOomTestName TestName();
-private:
-	TInt32 iCapKey[20];
-	TInt iIndex;
+	};
+
+class COomLongKeyCapture : public COomCaptureKeyBase
+	{
+public:
+	COomLongKeyCapture(CTOom *aTest);
+	~COomLongKeyCapture();
+	void ClearUpL();
+	TInt Fail();
+	TOomTestName TestName();
 	};
 
 class COomHotKey : public COomSetup
--- a/windowing/windowserver/test/tauto/talphawin.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/tauto/talphawin.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -371,7 +371,8 @@
 
 	theWin.SetExtent(TPoint(0,0), winSize);
 	theWin.SetBackgroundColor(TRgb(127,0,255,127));
-	TInt mode=theWin.SetRequiredDisplayMode(EColor16MA);
+	TDisplayMode mode = EColor16MAP;
+	theWin.SetRequiredDisplayMode(mode);
 	theWin.SetVisible(ETrue);
 	theWin.SetTransparencyAlphaChannel();
 	theWin.Activate();
@@ -447,7 +448,7 @@
 	CFbsBitmap *bitmapOne;
 	bitmapOne = new (ELeave)CFbsBitmap();
 	CleanupStack::PushL(bitmapOne);
-	User::LeaveIfError(bitmapOne->Create(winSize,static_cast<TDisplayMode>(mode)));
+	User::LeaveIfError(bitmapOne->Create(winSize,mode));
 
 	CFbsBitmapDevice *deviceOne=CFbsBitmapDevice::NewL(bitmapOne);
 	CleanupStack::PushL(deviceOne);
@@ -502,7 +503,7 @@
 	User::LeaveIfError(refWin.Construct(*(BaseWin->WinTreeNode()),(TUint32)&refWin));
 
 	refWin.SetExtent(TPoint(0,0), winSize);
-	refWin.SetRequiredDisplayMode(static_cast<TDisplayMode>(mode));
+	refWin.SetRequiredDisplayMode(mode);
 	refWin.SetVisible(ETrue);
 	refWin.SetTransparencyAlphaChannel();
 	refWin.Activate();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/windowing/windowserver/test/tauto/tdevicerotation.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,823 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Set of tests for Tracing Device Rotation. These tests generally test
+// RWsSession::IndicateAppOrientation(...).
+//
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Nokia test code
+*/
+
+#include "tdevicerotation.h"
+#include "themeserverpropertydefine.h"
+#include "..\..\nga\server\renderorientationtracker.h" 
+#include <hal.h>
+#include <hal_data.h>
+#include <w32std.h>
+
+const TInt KPublishTimeout = 1000000; // 1 second in microseconds
+
+//
+// CTDeviceRotation Definition
+//
+
+CTDeviceRotation::CTDeviceRotation(CTestStep* aStep):
+	CTGraphicsBase(aStep), iWaitForPublishOnNextTest(ETrue)
+	{
+	}
+
+CTDeviceRotation::~CTDeviceRotation()
+	{
+    iPublishTimer.Close();
+    
+    iChildWindow.Close();
+    iWindowGroup.Close();
+    iWs.Close();    
+    
+    iSecondChildWindow.Close();
+    iSecondWindowGroup.Close();    
+    iSecondWs.Close();
+   
+    /* This Process called with the argument KThemeServerPropertyDefineCmdDelete, deletes 
+       the theme server RProperty. This is because an RProperty can only be defined and 
+       deleted from within a process with the same UID3 as the RProperty catogory you are 
+       trying to define/delete.*/
+    RProcess themeServerPropertyDefine;
+    TInt err = themeServerPropertyDefine.Create(KThemeServerPropertyDefine,
+            KThemeServerPropertyDefineCmdDelete);
+    if (KErrNone != err)
+        {
+        _LIT(KLog, "themeServerPropertyDefine.Create() failed with error: %d");
+        INFO_PRINTF2(KLog, err);
+        TEST(EFalse);        
+        }
+    //wait for themeServerPropertyDefine process to terminate
+    TRequestStatus themeServerPropertyDefineLogonStatus;
+    themeServerPropertyDefine.Logon(themeServerPropertyDefineLogonStatus);
+    themeServerPropertyDefine.Resume();
+    User::WaitForRequest(themeServerPropertyDefineLogonStatus);
+    if (themeServerPropertyDefineLogonStatus != KErrNone)
+        {
+        _LIT(KLog, "themeServerPropertyDefine.Logon() failed with error: %d");
+        INFO_PRINTF2(KLog, themeServerPropertyDefineLogonStatus);
+        TEST(EFalse);        
+        }
+    themeServerPropertyDefine.Close();
+    
+    iRenderOrientationProperty.Delete(KRenderOrientationCategory, KRenderOrientationKey);
+    iRenderOrientationProperty.Close();
+    iThemeServerOrientationProperty.Close();
+    }
+
+void CTDeviceRotation::ConstructL()
+    {
+    TInt err = iWs.Connect();
+    TESTL(err == KErrNone);
+            
+    err = iSecondWs.Connect();
+    TESTL(KErrNone == err);
+    
+    iWs.SetAutoFlush(ETrue);
+    iSecondWs.SetAutoFlush(ETrue);
+    
+    iWindowGroup = RWindowGroup(iWs);
+    err = iWindowGroup.Construct(iWs.Handle());
+    TESTL(KErrNone == err);
+    iWindowGroup.SetOrdinalPosition(0,1);
+    
+    iChildWindow = RWindow(iWs);
+    err = iChildWindow.Construct(iWindowGroup, reinterpret_cast<TUint32>(&iChildWindow));
+    TESTL(KErrNone == err);    
+
+    iSecondWindowGroup = RWindowGroup(iSecondWs);
+    err = iSecondWindowGroup.Construct(iSecondWs.Handle());
+    TESTL(KErrNone == err);
+    iSecondWindowGroup.SetOrdinalPosition(1,1);
+    
+    iSecondChildWindow = RWindow(iSecondWs);
+    err = iSecondChildWindow.Construct(iSecondWindowGroup, reinterpret_cast<TUint32>(&iSecondChildWindow));
+    TESTL(KErrNone == err);    
+    
+    err= iRenderOrientationProperty.Attach(KRenderOrientationCategory, KRenderOrientationKey, EOwnerThread);
+    TESTL(KErrNone == err);
+    iRenderOrientationProperty.Subscribe(iRenderOrientationStatus);
+    
+    /* This Process called with the argument KThemeServerPropertyDefineCmdDefine, defines
+       the theme server catagory to be the same as the theme servers process ID. This is 
+       because an RProperty can only be defined and deleted from within a process with the 
+       same UID3 as the RProperty catogory you are trying to define/delete.*/
+    RProcess themeServerPropertyDefine;
+    err = themeServerPropertyDefine.Create(KThemeServerPropertyDefine,KThemeServerPropertyDefineCmdDefine);
+    TESTL(KErrNone == err);
+    TRequestStatus themeServerPropertyDefineLogonStatus;
+    themeServerPropertyDefine.Logon(themeServerPropertyDefineLogonStatus);
+    themeServerPropertyDefine.Resume();
+    User::WaitForRequest(themeServerPropertyDefineLogonStatus);
+    TESTL(KErrNone == themeServerPropertyDefineLogonStatus.Int()); 
+    themeServerPropertyDefine.Close(); 
+
+    err = iThemeServerOrientationProperty.Attach(KThemeOrientationCategory, KThemeOrientationKey, EOwnerThread);
+    TESTL(KErrNone == err);
+    
+    SimulateThemeServerOrientation(EDisplayOrientationNormal);
+    
+    iPublishTimer.CreateLocal();
+    }
+
+void CTDeviceRotation::SimulateThemeServerOrientation(TRenderOrientation aOrientation)
+    {
+    _LIT(KFunctionInfo, "SimulateThemeServerOrientation(aOrientation = %d)");
+    INFO_PRINTF2(KFunctionInfo, aOrientation);
+    TInt err = iThemeServerOrientationProperty.Set(aOrientation);
+    if (KErrNone != err)
+        {
+        _LIT(KLog,"iThemeServerOrientationProperty.Set(%d) failed with err %d");
+        INFO_PRINTF3(KLog,aOrientation,err);
+        TEST(EFalse);
+        }
+    switch(aOrientation)
+        {
+        case EDisplayOrientationNormal:
+        case EDisplayOrientation90CW:
+        case EDisplayOrientation180:
+        case EDisplayOrientation270CW:
+            {
+            if(KErrNone == err)
+                {
+                iCurrentThemeServerOrientation = aOrientation;            
+                }                
+            break;
+            }
+        default:
+            _LIT(KLog, "This orientation is not supported by theme server.");
+        	INFO_PRINTF1(KLog);
+        }
+    }
+
+void CTDeviceRotation::IsOrientationCorrect(TRenderOrientation aExpectedOrientation)
+    {
+    // timer to timeout when nothing is published
+    iPublishTimer.After(iPublishTimerStatus, KPublishTimeout);
+    
+    // wait for either
+    User::WaitForRequest(iRenderOrientationStatus, iPublishTimerStatus);
+    
+    // check that the orientation was published or not, as expected
+    if(iWaitForPublishOnNextTest)
+        {
+        // Check that it really has published
+        if(iRenderOrientationStatus.Int()==KErrNone && iPublishTimerStatus.Int()==KRequestPending)
+            {
+            iPublishTimer.Cancel();
+            // re-subscribe
+            iRenderOrientationProperty.Subscribe(iRenderOrientationStatus);            
+            }
+        else
+            {
+            _LIT(KLog,"Timed out (%d) while waiting for render orientation %d to be published");
+            INFO_PRINTF3(KLog,iRenderOrientationStatus.Int(),aExpectedOrientation);        
+            TEST(EFalse);
+            }
+        }
+    else
+        {
+        // Check that it really hasn't published    
+        if(iRenderOrientationStatus.Int()!=KRequestPending)
+            {
+            _LIT(KLog,"Render Orientation %d was published (%d) when not expected (timeout = %d)");
+            INFO_PRINTF4(KLog,aExpectedOrientation, iRenderOrientationStatus.Int(),iPublishTimerStatus.Int());
+            iPublishTimer.Cancel();
+            TEST(EFalse);
+            }
+        else if(iPublishTimerStatus.Int()!=KErrNone)
+            {
+            _LIT(KLog,"Timeout failure %d");
+            INFO_PRINTF2(KLog,iPublishTimerStatus.Int());           
+            TEST(EFalse);        
+            }
+        
+        // reset to default
+        iWaitForPublishOnNextTest = ETrue;
+        }
+    
+    // Retrieve the value.
+    TInt orientation;
+    TInt err = iRenderOrientationProperty.Get(orientation);
+    if(KErrNone != err)
+           {
+           _LIT(KLog,"iThemeServerOrientationProperty.Get(...) failed with err %d");
+           INFO_PRINTF2(KLog,err);
+           TEST(EFalse);
+           }
+    else if(aExpectedOrientation == EDisplayOrientationAuto)
+        {
+        TEST(orientation == iCurrentThemeServerOrientation);
+        CheckHalSetting(iCurrentThemeServerOrientation);
+        }
+    else
+        {
+        TEST(orientation == aExpectedOrientation);
+        CheckHalSetting(static_cast<TRenderOrientation>(orientation));
+        }
+    }
+
+void CTDeviceRotation::CheckHalSetting(TRenderOrientation aOrientation)
+    {
+    HALData::TDigitiserOrientation halOrientationExp = static_cast<HALData::TDigitiserOrientation>
+            (HALData::EDigitiserOrientation_000 + (aOrientation - EDisplayOrientationNormal));
+    TInt halOrientation;
+    TInt err = HAL::Get(iWs.GetFocusScreen(), HALData::EDigitiserOrientation, halOrientation);
+    if (err != KErrNotSupported)
+        {
+        if (err != KErrNone)
+            {
+            _LIT(KLog,"Getting HAL orientation attribute returned error %d when no error expected");
+            INFO_PRINTF2(KLog,err);
+            }
+        TEST(err==KErrNone);
+        if (halOrientationExp != halOrientation)
+            {
+            _LIT(KLog,"HAL orientation is %d when expected to be %d");
+            INFO_PRINTF3(KLog, halOrientation, halOrientationExp);
+            }
+        TEST(halOrientationExp==halOrientation);
+        }
+    else
+        {
+        _LIT(KLog,"HAL-Orientation HALData::EDigitiserOrientation isn't supported by Driver");
+        INFO_PRINTF1(KLog);
+        }
+    }
+
+void CTDeviceRotation::TestIndicateAppOrientation(TRenderOrientation aOrientation)
+	{
+    _LIT(KTestInfo, "TestIndicateAppOrientation(aOrientation = %d)");
+    INFO_PRINTF2(KTestInfo, aOrientation);
+	if (EDisplayOrientationIgnore == aOrientation)
+	    {
+        TEST(EFalse);
+        _LIT(KLog, "TestIndicateAppOrientation(TRenderOrientation aOrientation) cannot be used with EDisplayOrientationIgnore");
+        INFO_PRINTF1(KLog);
+	    }
+	iWs.IndicateAppOrientation(aOrientation);
+	iWindowGroup.SetOrdinalPosition(0);
+	IsOrientationCorrect(aOrientation);
+	}
+
+void CTDeviceRotation::TestIndicateAppOrientation(TRenderOrientation aOrientation, TRenderOrientation aSecondOrientation)
+    {
+    _LIT(KTestInfo, "TestIndicateAppOrientation(aOrientation = %d, aSecondOrientation = %d)");
+    INFO_PRINTF3(KTestInfo, aOrientation, aSecondOrientation);
+    //Inform window serve the orientation status
+    iWs.IndicateAppOrientation(aOrientation);
+    iSecondWs.IndicateAppOrientation(aSecondOrientation);
+    
+    iWindowGroup.SetOrdinalPosition(0,1);
+    iSecondWindowGroup.SetOrdinalPosition(1,1);
+
+    if(aOrientation != EDisplayOrientationIgnore)
+        {
+        IsOrientationCorrect(aOrientation);
+        }
+    else
+        {
+        IsOrientationCorrect(aSecondOrientation);
+        }
+    }
+
+void CTDeviceRotation::TestAppOrientationOnSwap(TRenderOrientation aOrientation, TRenderOrientation aSecondOrientation)
+    {    
+    _LIT(KTestInfo, "TestAppOrientationOnSwap(aOrientation = %d, aSecondOrientation = %d)");
+    INFO_PRINTF3(KTestInfo, aOrientation, aSecondOrientation);
+    
+    iWs.IndicateAppOrientation(aOrientation);
+    iSecondWs.IndicateAppOrientation(aSecondOrientation);
+    
+    iSecondWindowGroup.SetOrdinalPosition(0);
+    if (aSecondOrientation != EDisplayOrientationIgnore)
+        {
+        IsOrientationCorrect(aSecondOrientation);
+        }
+    else
+        {
+        IsOrientationCorrect(aOrientation);
+        }
+    }
+
+void CTDeviceRotation::RunTestCaseL(TInt aCurTestCase)
+	{
+    _LIT(KNewLine, "\n");
+    (reinterpret_cast<CTDeviceRotationStep*>(iStep))->SetTestStepID(KUnknownSYMTestCaseIDName);
+	switch(aCurTestCase)
+		{
+	    case 1:
+            _LIT(KTestStepID1,"Test Initial Orientations");
+            (reinterpret_cast<CTDeviceRotationStep*>(iStep))->SetTestStepID(KTestStepID1);
+            INFO_PRINTF1(KNewLine);
+            INFO_PRINTF1(KTestStepID1);
+            TestInitialOrientation();
+            break;
+		case 2:
+    	    _LIT(KTestStepID2,"Test Fixed Orientations");
+            (reinterpret_cast<CTDeviceRotationStep*>(iStep))->SetTestStepID(KTestStepID2);
+            INFO_PRINTF1(KNewLine);
+            INFO_PRINTF1(KTestStepID2);
+            TestFixedOrientations();
+			break;
+		case 3:
+    	    _LIT(KTestStepID3,"Test Auto Orientation");
+		    (reinterpret_cast<CTDeviceRotationStep*>(iStep))->SetTestStepID(KTestStepID3);
+		    INFO_PRINTF1(KNewLine);
+		    INFO_PRINTF1(KTestStepID3);
+		    TestAutoOrientation();
+			break;
+		case 4:
+            _LIT(KTestStepID4,"Test Ignore Orientation");
+            (reinterpret_cast<CTDeviceRotationStep*>(iStep))->SetTestStepID(KTestStepID4);
+            INFO_PRINTF1(KNewLine);
+            INFO_PRINTF1(KTestStepID4);
+            TestIgnoreOrientation();
+			break;
+        case 5:
+            _LIT(KTestStepID5,"Test Swap Orientations");
+            (reinterpret_cast<CTDeviceRotationStep*>(iStep))->SetTestStepID(KTestStepID5);
+            INFO_PRINTF1(KNewLine);
+            INFO_PRINTF1(KTestStepID5);
+            TestFixedOrientationsOnWindowSwap();
+			break;
+        case 6:
+            _LIT(KTestStepID6,"Test Auto Swap Orientations");
+            (reinterpret_cast<CTDeviceRotationStep*>(iStep))->SetTestStepID(KTestStepID6);
+            INFO_PRINTF1(KNewLine);
+            INFO_PRINTF1(KTestStepID6);
+            TestAutoOrientationOnWindowSwap();
+            break;
+        case 7:
+            _LIT(KTestStepID7,"Test Ignore Swap Orientations");
+            (reinterpret_cast<CTDeviceRotationStep*>(iStep))->SetTestStepID(KTestStepID7);
+            INFO_PRINTF1(KNewLine);
+            INFO_PRINTF1(KTestStepID7);
+            TestIgnoreOrientationOnWindowSwap();
+			break;
+        case 8:
+            _LIT(KTestStepID8,"Test Auto Swap Orientations");
+            (reinterpret_cast<CTDeviceRotationStep*>(iStep))->SetTestStepID(KTestStepID8);
+            INFO_PRINTF1(KNewLine);
+            INFO_PRINTF1(KTestStepID8);
+            TestIgnoreAutoOrientationOnWindowSwap();
+            break;
+        case 9:
+            _LIT(KTestStepID9,"Test Invalid App Orientations");
+            (reinterpret_cast<CTDeviceRotationStep*>(iStep))->SetTestStepID(KTestStepID9);
+            INFO_PRINTF1(KNewLine);
+            INFO_PRINTF1(KTestStepID9);
+            TestInvalidAppOrientation();
+            break;
+        case 10:
+            _LIT(KTestStepID10,"Test Invalid Theme Server Orientations");
+            (reinterpret_cast<CTDeviceRotationStep*>(iStep))->SetTestStepID(KTestStepID10);
+            INFO_PRINTF1(KNewLine);
+            INFO_PRINTF1(KTestStepID10);
+            TestInvalidThemeServerOrientation();
+            break;
+		default:
+            (reinterpret_cast<CTDeviceRotationStep*>(iStep))->SetTestStepID(KNotATestSYMTestCaseIDName);
+			(reinterpret_cast<CTDeviceRotationStep*>(iStep))->CloseTMSGraphicsStep();
+			TestComplete();
+		}
+	(reinterpret_cast<CTDeviceRotationStep*>(iStep))->RecordTestResultL();
+	}
+
+
+/**
+ @SYMTestCaseID             GRAPHICS-WSERV-DEVICEROTATION-0001
+ @SYMTestCaseDesc           Test Auto Orientation
+ @SYMPREQ                   460936 Tracking Device Rotation
+ @SYMTestPriority           1
+ @SYMTestPurpose            To test that we can return the correct initial orientation value from 
+                            the windwoserver.
+ @SYMPrerequisites          An RProperty is set up to subscribe to notifications of 
+                            windowserver orientation changes.
+                            We have set up an RWindowGroup at the foreground and not altered its
+                            indicated orientation.
+ @SYMTestActions            1) Get the value of the orientation as published by window server.
+
+ @SYMTestExpectedResults    The windowserver should return EDisplayOrientationNormal
+ */
+void CTDeviceRotation::TestInitialOrientation()
+    {
+    iWaitForPublishOnNextTest = EFalse;
+    IsOrientationCorrect(EDisplayOrientationNormal);
+    }
+
+/**
+ @SYMTestCaseID             GRAPHICS-WSERV-DEVICEROTATION-0002
+ @SYMTestCaseDesc           Test Fixed Orientations
+ @SYMPREQ                   460936 Tracking Device Rotation
+ @SYMTestPriority           1
+ @SYMTestPurpose            To test that we can return the correct orientation value from 
+                            the windwoserver after we indicate the application orientation
+                            as fixed values using RWsSession::IndicateAppOrientation. Any 
+                            theme server orientations should be ignored.
+ @SYMPrerequisites          An RProperty is set up to subscribe to notifications of 
+                            windowserver orientation changes.
+                            An RProperty is set up to publish Theme server Orientation changes. 
+                            We have set up an RWindowGroup in the foreground.
+                            Windowserver orientation currently set to EDisplayOrientationNormal.
+
+ @SYMTestActions            1) Set Theme Server orientation to EDisplayOrientation90CW.
+                            2) Set the RWindowgroup in ordinal position 0 to a fixed orientation.
+                            3) Check the published orinetation value in windowserver.
+                            4) Repeat steps 2) and 3) for all fixed orientations
+                            3) Set Theme Server orientation to EDisplayOrientationNormal.
+                            4) Repeat Steps 2-4).
+
+ @SYMTestExpectedResults    The orientation set in step 2) should always be the same as the 
+                            orientation set in step 2)
+ */
+void CTDeviceRotation::TestFixedOrientations()
+    {
+    iWaitForPublishOnNextTest = EFalse;
+    SimulateThemeServerOrientation(EDisplayOrientation90CW);
+    TestIndicateAppOrientation(EDisplayOrientationNormal);
+    TestIndicateAppOrientation(EDisplayOrientation90CW);
+    TestIndicateAppOrientation(EDisplayOrientation180);
+    TestIndicateAppOrientation(EDisplayOrientation270CW);
+    
+    SimulateThemeServerOrientation(EDisplayOrientationNormal);
+    TestIndicateAppOrientation(EDisplayOrientationNormal);
+    TestIndicateAppOrientation(EDisplayOrientation90CW);
+    TestIndicateAppOrientation(EDisplayOrientation180);
+    TestIndicateAppOrientation(EDisplayOrientation270CW);
+    
+    SimulateThemeServerOrientation(EDisplayOrientation180);
+    TestIndicateAppOrientation(EDisplayOrientationNormal);
+    TestIndicateAppOrientation(EDisplayOrientation90CW);
+    TestIndicateAppOrientation(EDisplayOrientation180);
+    TestIndicateAppOrientation(EDisplayOrientation270CW);
+    
+    SimulateThemeServerOrientation(EDisplayOrientation270CW);
+    TestIndicateAppOrientation(EDisplayOrientationNormal);
+    TestIndicateAppOrientation(EDisplayOrientation90CW);
+    TestIndicateAppOrientation(EDisplayOrientation180);
+    TestIndicateAppOrientation(EDisplayOrientation270CW);    
+    }
+
+/**
+ @SYMTestCaseID             GRAPHICS-WSERV-DEVICEROTATION-0003
+ @SYMTestCaseDesc           Test Auto Orientation
+ @SYMPREQ                   460936 Tracking Device Rotation
+ @SYMTestPriority           1
+ @SYMTestPurpose            To test that we can return the correct orientation value from 
+                            the windwoserver after we indicate the application orientation
+                            as auto values using RWsSession::IndicateAppOrientation. The wserv
+                            should publish the theme server orientation changes only.
+ @SYMPrerequisites          An RProperty is set up to subscribe to notifications of 
+                            windowserver orientation changes.
+                            An RProperty is set up to publish Theme server Orientation changes.
+                            We have set up an RWindowGroup in the foreground.
+                            WindowServer orinetation is not set to EDisplayOrientation90CW.
+
+ @SYMTestActions            1) Set Theme Server orientation to EDisplayOrientation90CW.
+                            2) Set the RWindowgroup in ordinal position 0 to auto orientation.
+                            3) Check the published orinetation value in windowserver.
+                            4) Set Theme Server orientation to EDisplayOrientationNormal.
+                            5) Check the value of the orientation as published by window server.
+                            6) Repeat 4) and 5) for EDisplayOrientation180 and 
+                               EDisplayOrientation270CW
+                            7) repeat 4) and 5) again for EDisplayOrientation270CW
+
+ @SYMTestExpectedResults    We should get expected notifications where orientations have changed.
+                            The orientation checked in step 3) should be the theme server 
+                            orientation set in step 1).
+                            The orientations checked in step 5) should be the theme server 
+                            orientations set in step 4).
+                            We should recieve no notification for step 7).
+ */
+void CTDeviceRotation::TestAutoOrientation()
+    {
+    SimulateThemeServerOrientation(EDisplayOrientation90CW);
+    TestIndicateAppOrientation(EDisplayOrientationAuto);
+    SimulateThemeServerOrientation(EDisplayOrientationNormal);
+    IsOrientationCorrect(iCurrentThemeServerOrientation);
+    // Now flip it upside down to ensure that nothing assumes this will only be updated incrementally
+    SimulateThemeServerOrientation(EDisplayOrientation180);
+    IsOrientationCorrect(iCurrentThemeServerOrientation);
+    SimulateThemeServerOrientation(EDisplayOrientation270CW);
+    IsOrientationCorrect(iCurrentThemeServerOrientation);
+    
+    // And check that wserv doesn't publish if the theme server publishes the existing orientation
+    SimulateThemeServerOrientation(EDisplayOrientation270CW);
+    iWaitForPublishOnNextTest = EFalse;    
+    IsOrientationCorrect(iCurrentThemeServerOrientation);
+    }
+
+/**
+ @SYMTestCaseID             GRAPHICS-WSERV-DEVICEROTATION-0004
+ @SYMTestCaseDesc           Test Ignore Orientation
+ @SYMPREQ                   460936 Tracking Device Rotation
+ @SYMTestPriority           1
+ @SYMTestPurpose            To test that we can return the correct orientation value from 
+                            the windwoserver after we indicate the front applications 
+                            orientation as ignore.  
+ @SYMPrerequisites          An RProperty is set up to subscribe to notifications of 
+                            windowserver orientation changes.
+                            An RProperty is set up to publish Theme server Orientation changes.
+                            We have set up two RWindowGroups in the ordinal positions 0 and 1. 
+                            WindowServer orinetation is not set to EDisplayOrientationNormal.
+
+ @SYMTestActions            1) Set Theme Server orientation to EDisplayOrientation90CW.
+                            2) Set the RWindowGroup in ordinal position 0 to a ignore orientation.
+                            3) Set the RWindowgroup in ordinal position 1 to a fixed orientation.
+                            4) Check the published orinetation value in windowserver.
+                            5) Repeat steps 2-4) varying the fixed orientation set in step 2).
+                            6) Set Theme Server orientation to EDisplayOrientation90CW.
+                            7) Set the RWindowGroup in ordinal position 0 to a ignore orientation.
+                            8) Set the RWindowgroup in ordinal position 1 to a fixed orientation.
+                            9) Check the published orinetation value in windowserver.
+                            10) Set Theme Server orientation to EDisplayOrientationNormal.
+                            11) Check the published orinetation value in windowserver.
+
+ @SYMTestExpectedResults    We should get expected notifications where orientations have changed.
+                            All orientations checked in step 4) should be the fixed orientations 
+                            of the windows in ordinal position 1, as set in step 3).
+                            The orientation checked in step 9) should be the theme server 
+                            orientation set in step 6).
+                            The orientation checked in step 11) should be the theme server 
+                            orientation set in step 10).
+ */
+void CTDeviceRotation::TestIgnoreOrientation()
+    {
+    SimulateThemeServerOrientation(EDisplayOrientation90CW);
+    TestIndicateAppOrientation(EDisplayOrientationIgnore, EDisplayOrientationNormal);
+    TestIndicateAppOrientation(EDisplayOrientationIgnore, EDisplayOrientation90CW);
+    TestIndicateAppOrientation(EDisplayOrientationIgnore, EDisplayOrientation180);
+    TestIndicateAppOrientation(EDisplayOrientationIgnore, EDisplayOrientation270CW);
+    
+    SimulateThemeServerOrientation(EDisplayOrientation90CW);
+    TestIndicateAppOrientation(EDisplayOrientationIgnore, EDisplayOrientationAuto);
+    SimulateThemeServerOrientation(EDisplayOrientationNormal);
+    IsOrientationCorrect(iCurrentThemeServerOrientation);
+    }
+
+/**
+ @SYMTestCaseID             GRAPHICS-WSERV-DEVICEROTATION-0005
+ @SYMTestCaseDesc           Test Fixed Orientations On Swap
+ @SYMPREQ                   460936 Tracking Device Rotation
+ @SYMTestPriority           1
+ @SYMTestPurpose            To test that we get notifactation of a change in orientation and can 
+                            return the correct orientation value from the windwoserver after we 
+                            swap windows with varying fixed orienations.  
+ @SYMPrerequisites          An RProperty is set up to subscribe to notifications of 
+                            windowserver orientation changes.
+                            We have set up two RWindowGroups in the ordinal positions 0 and 1. 
+
+ @SYMTestActions            1) Set the RWindowGroup in ordinal position 0 to a fixed orientation.
+                            2) Set the RWindowgroup in ordinal position 1 to a fixed orientation.
+                            3) Check the published orinetation value in windowserver.
+                            4) Move the RWindowGroup ordinal position 1 to the ordinal position 0.
+                            5) Check the published orinetation value in windowserver.
+                            6) Repeat steps 1-5 but vary the values the fixed orientation of the 
+                               RWindows set in steps 1) and 2)
+
+ @SYMTestExpectedResults    We should get expected notifications where orientations have changed.
+                            All orientations checked in step 3) should be the fixed orientations 
+                            of the windows in ordinal position 0, as set in step 1).
+                            The orientations checked in step 5) should be the fixed orientations 
+                            of the windows which was in ordinal position 1 before each swap, as 
+                            set in step 2).
+ */
+void CTDeviceRotation::TestFixedOrientationsOnWindowSwap()
+    {
+    iWaitForPublishOnNextTest = EFalse;
+    TestIndicateAppOrientation(EDisplayOrientationNormal, EDisplayOrientationNormal);
+    iWaitForPublishOnNextTest = EFalse;
+    TestAppOrientationOnSwap(EDisplayOrientationNormal, EDisplayOrientationNormal);
+    TestIndicateAppOrientation(EDisplayOrientationNormal, EDisplayOrientation90CW);
+    TestAppOrientationOnSwap(EDisplayOrientationNormal, EDisplayOrientation90CW);
+    TestIndicateAppOrientation(EDisplayOrientation90CW, EDisplayOrientationNormal);
+    TestAppOrientationOnSwap(EDisplayOrientation90CW, EDisplayOrientationNormal);
+    }
+
+/**
+ @SYMTestCaseID             GRAPHICS-WSERV-DEVICEROTATION-0006
+ @SYMTestCaseDesc           Test Auto Orientations On Swap
+ @SYMPREQ                   460936 Tracking Device Rotation
+ @SYMTestPriority           1
+ @SYMTestPurpose            To test that we get notifactation of a change in orientation and can 
+                            return the correct orientation value from the windwoserver after we 
+                            swap windows with auto orienations.  
+ @SYMPrerequisites          An RProperty is set up to subscribe to notifications of 
+                            windowserver orientation changes.
+                            An RProperty is set up to publish Theme server Orientation changes.
+                            We have set up two RWindowGroups in the ordinal positions 0 and 1.
+                            WindowServer orinetation is not set to EDisplayOrientation270CW. 
+
+ @SYMTestActions            1) Set the theme server orientation.
+                            2) Set the RWindowGroup in ordinal position 0 to a fixed orientation.
+                            3) Set the RWindowGroup in ordinal position 1 to auto orientation.
+                            4) Check the published orinetation value in windowserver.
+                            5) Move the RWindowGroup ordinal position 1 to the ordinal position 0. 
+                            6) Check the published orinetation value in windowserver.
+                            7) Repeat steps 1-6 but vary the values of the theme server 
+                               orientation in step 1) and the fixed orientation of the frontwindow
+                               in 2)
+ @SYMTestExpectedResults    We should get expected notifications where orientations have changed.
+                            All orientations checked in step 4) should be the fixed orientations 
+                            of the front windows, which have been set in step 2).
+                            All orientations checked in step 6) should be the theme server 
+                            orientations set in step 1)
+ */
+void CTDeviceRotation::TestAutoOrientationOnWindowSwap()
+    {
+    SimulateThemeServerOrientation(EDisplayOrientation90CW);
+    TestIndicateAppOrientation(EDisplayOrientation270CW, EDisplayOrientationAuto);
+    TestAppOrientationOnSwap(EDisplayOrientation270CW, EDisplayOrientationAuto);
+    SimulateThemeServerOrientation(EDisplayOrientationNormal);
+    TestIndicateAppOrientation(EDisplayOrientationAuto, EDisplayOrientation180);
+    TestAppOrientationOnSwap(EDisplayOrientationAuto, EDisplayOrientation180);
+    
+    SimulateThemeServerOrientation(EDisplayOrientation90CW);
+    TestIndicateAppOrientation(EDisplayOrientation90CW, EDisplayOrientationAuto);
+    iWaitForPublishOnNextTest = EFalse;
+    TestAppOrientationOnSwap(EDisplayOrientation90CW, EDisplayOrientationAuto);
+    SimulateThemeServerOrientation(EDisplayOrientationNormal);
+    TestIndicateAppOrientation(EDisplayOrientationAuto, EDisplayOrientationNormal);
+    iWaitForPublishOnNextTest = EFalse;
+    TestAppOrientationOnSwap(EDisplayOrientationAuto, EDisplayOrientationNormal);
+    }
+
+/**
+ @SYMTestCaseID             GRAPHICS-WSERV-DEVICEROTATION-0007
+ @SYMTestCaseDesc           Test Swap Orientations with Ignore Orientation
+ @SYMPREQ                   460936 Tracking Device Rotation
+ @SYMTestPriority           1
+ @SYMTestPurpose            To test that we get notifactation of a change in orientation and can 
+                            return the correct orientation value from the windwoserver after we 
+                            swap windows with ignore orienations.  
+ @SYMPrerequisites          An RProperty is set up to subscribe to notifications of 
+                            windowserver orientation changes.
+                            An RProperty is set up to publish Theme server Orientation changes.
+                            We have set up two RWindowGroups in the ordinal positions 0 and 1. 
+
+ @SYMTestActions            1) Set the theme server orientation.
+                            2) Set the RWindowGroup in ordinal position 0 to ignore orientation.
+                            3) Set the RWindowGroup in ordinal position 1 to a fixed orientation.
+                            4) Check the published orinetation value in windowserver.
+                            5) Move the RWindowGroup ordinal position 1 to the ordinal position 0. 
+                            6) Check the published orinetation value in windowserver.
+                            7) Repeat steps 1-6 but vary the values of the theme server 
+                               orientation in step 1) and the fixed orientation of the frontwindow
+                               in 3)
+                            8) Set the theme server orientation.
+                            9) Set the RWindowGroup in ordinal position 0 to a fixedorientation.
+                            10) Set the RWindowGroup in ordinal position 1 to ignore orienation.
+                            11) Repeat steps 4-6) 
+                            12) Repeat steps 8-11) but vary the values of the theme server 
+                               orientation in step 8) and the fixed orientation of the 
+                               RwindowGroup in 9)                            
+                               
+ @SYMTestExpectedResults    We should get expected notifications where orientations have changed.
+                            All orientations checked in step 4) and 6) should be the fixed 
+                            orientations RWindowGroups which have been set in step 3).
+                            All orientations checked in step 11) should be the fixed orientations 
+                            of the front RWindowGroups which have been set in step 9).
+*/
+void CTDeviceRotation::TestIgnoreOrientationOnWindowSwap()
+    {
+    SimulateThemeServerOrientation(EDisplayOrientation90CW);
+    TestIndicateAppOrientation(EDisplayOrientationIgnore, EDisplayOrientation270CW);
+    TestAppOrientationOnSwap(EDisplayOrientationIgnore, EDisplayOrientation180);
+    
+    SimulateThemeServerOrientation(EDisplayOrientationNormal);
+    TestIndicateAppOrientation(EDisplayOrientationIgnore, EDisplayOrientationNormal);
+    TestAppOrientationOnSwap(EDisplayOrientationIgnore, EDisplayOrientation90CW);
+    
+    SimulateThemeServerOrientation(EDisplayOrientation90CW);
+    TestIndicateAppOrientation(EDisplayOrientation270CW, EDisplayOrientationIgnore);
+    TestAppOrientationOnSwap(EDisplayOrientation180, EDisplayOrientationIgnore);    
+    
+    SimulateThemeServerOrientation(EDisplayOrientationNormal);
+    TestIndicateAppOrientation(EDisplayOrientationNormal, EDisplayOrientationIgnore);
+    TestAppOrientationOnSwap(EDisplayOrientation90CW, EDisplayOrientationIgnore);
+    }
+
+/**
+ @SYMTestCaseID             GRAPHICS-WSERV-DEVICEROTATION-0008
+ @SYMTestCaseDesc           Test Swap Orientations with Auto and Ignore Orientations
+ @SYMPREQ                   460936 Tracking Device Rotation
+ @SYMTestPriority           1
+ @SYMTestPurpose            To test that we get notifactation of a change in orientation and can 
+                            return the correct orientation value from the windwoserver after we 
+                            swap windows with auto and ignore orienations.  
+ @SYMPrerequisites          An RProperty is set up to subscribe to notifications of 
+                            windowserver orientation changes.
+                            An RProperty is set up to publish Theme server Orientation changes.
+                            We have set up two RWindowGroups in the ordinal positions 0 and 1. 
+ @SYMTestActions            1) Set the theme server orientation to EDisplayOrientationNormal.
+                            2) Set the RWindowGroup in ordinal position 0 to auto orientation.
+                            3) Set the RWindowGroup in ordinal position 1 to ignore orientation.
+                            4) Check the published orinetation value in windowserver.
+                            5) Set the theme server orientation to EDisplayOrientation90CW.
+                            6) Check the published orinetation value in windowserver.
+                            7) Set the theme server orientation to EDisplayOrientationNormal.
+                            8) Move the RWindowGroup in ordinal position 1 to ordinal position 0.
+                            9) Check the published orinetation value in windowserver.
+                            10) Set the theme server orientation to EDisplayOrientation90CW.
+                            11) Check the published orinetation value in windowserver.
+
+ @SYMTestExpectedResults    We should get expected notifications where orientations have changed.
+                            The orientations checked in step 4), 6), 9) and  11) should all be 
+                            the orientations set to the themeserver in steps 1), 5), 8) and 10)
+                            respecvtively. 
+*/
+void CTDeviceRotation::TestIgnoreAutoOrientationOnWindowSwap()
+    {
+    SimulateThemeServerOrientation(EDisplayOrientationNormal);
+    TestIndicateAppOrientation(EDisplayOrientationAuto, EDisplayOrientationIgnore);
+    SimulateThemeServerOrientation(EDisplayOrientation90CW);
+    IsOrientationCorrect(iCurrentThemeServerOrientation);
+    
+    SimulateThemeServerOrientation(EDisplayOrientationNormal);
+    iSecondWindowGroup.SetOrdinalPosition(0);
+    IsOrientationCorrect(iCurrentThemeServerOrientation);
+    SimulateThemeServerOrientation(EDisplayOrientation90CW);
+    IsOrientationCorrect(iCurrentThemeServerOrientation);
+    }
+
+/**
+ @SYMTestCaseID             GRAPHICS-WSERV-DEVICEROTATION-0009
+ @SYMTestCaseDesc           Test Invalid App Orientation
+ @SYMPREQ                   ###TrackingDeviceRotation### TODO replace me
+ @SYMTestPriority           1
+ @SYMTestPurpose            To test that an invalid orientation is ignored.
+ @SYMPrerequisites          An RProperty is set up to subscribe to notifications of 
+                            windowserver orientation changes.
+                            An RProperty is set up to publish Theme server Orientation changes.
+                            We have set up an RWindowGroup in ordinal position 0.
+ @SYMTestActions            1) Set the theme server orientation to EDisplayOrientationNormal.
+                            2) Set the RWindowGroup in ordinal position 0 to 
+                               EDisplayOrientation90CW.
+                            4) Check the published orinetation value in windowserver.
+                            5) Set the RWindowGroup in ordinal position 0 to an invalid 
+                               orientation.
+                            6) Check the published orinetation value in windowserver.
+
+ @SYMTestExpectedResults    Wserv should publish an orientation change for 2) but not for 5).
+                            The orientations checked in steps 4) and 6) should both be the 
+                            orientation set in step 2).
+*/
+void CTDeviceRotation::TestInvalidAppOrientation()
+	{
+	SimulateThemeServerOrientation(EDisplayOrientationNormal);
+	TestIndicateAppOrientation(EDisplayOrientation90CW);
+	iWs.IndicateAppOrientation(static_cast<TRenderOrientation>(1000));
+	iWaitForPublishOnNextTest = EFalse;
+	IsOrientationCorrect(EDisplayOrientation90CW);
+	}
+
+/**
+ @SYMTestCaseID             GRAPHICS-WSERV-DEVICEROTATION-0010
+ @SYMTestCaseDesc           Test Invalid Theme Server Orientation
+ @SYMPREQ                   ###TrackingDeviceRotation### TODO replace me
+ @SYMTestPriority           1
+ @SYMTestPurpose            To test that an invalid theme server orientation is ignored when
+                            the app orientation has been set to auto.
+ @SYMPrerequisites          An RProperty is set up to subscribe to notifications of 
+                            windowserver orientation changes.
+                            An RProperty is set up to publish Theme server Orientation changes.
+                            We have set up an RWindowGroup in ordinal position 0.
+ @SYMTestActions            1) Set the theme server orientation to EDisplayOrientationNormal.
+                            2) Set the RWindowGroup in ordinal position 0 to 
+                               EDisplayOrientationAuto.
+                            4) Check the published orinetation value in windowserver.
+                            5) Set the theme server orientation to an invalid orientation.
+                            6) Check the published orinetation value in windowserver.
+
+ @SYMTestExpectedResults    Wserv should publish an orientation change for 2) but not for 5).
+                            The orientations checked in steps 4) and 6) should both be the 
+                            theme server orientation set in step 1).
+*/
+void CTDeviceRotation::TestInvalidThemeServerOrientation()
+	{
+	SimulateThemeServerOrientation(EDisplayOrientationNormal);
+	TestIndicateAppOrientation(EDisplayOrientationAuto);
+	SimulateThemeServerOrientation(static_cast<TRenderOrientation>(5000));
+	iWaitForPublishOnNextTest = EFalse;
+	IsOrientationCorrect(EDisplayOrientationNormal);
+	}
+
+__CONSTRUCT_STEP__(DeviceRotation)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/windowing/windowserver/test/tauto/tdevicerotation.h	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,110 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Set of tests for Tracing Device Rotation. These tests generally test
+// the RWsSession::IndicateAppOrientation(...) API.
+//
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Nokia test code
+*/
+
+#ifndef __TDEVICERORATION_H__
+#define __TDEVICERORATION_H__
+
+#include <e32std.h>
+#include <w32std.h>
+#include <e32property.h>
+#include <test/testexecutestepbase.h>
+#include "../tlib/testbase.h"
+#include "AUTO.H"
+#include "TGraphicsHarness.h"
+#include <wspublishandsubscribedata.h>
+
+//
+// CTDeviceRotation Definition
+//
+
+class CTDeviceRotation: public CTGraphicsBase
+	{
+public:
+    CTDeviceRotation(CTestStep* aStep);
+	~CTDeviceRotation();
+	/*Sets the windowing environment,*/
+	void ConstructL();
+
+protected:
+	//from 	CTGraphicsStep - Calls the device rotation test.
+	virtual void RunTestCaseL(TInt aCurTestCase);
+private: 
+	//tool functions
+	void SimulateThemeServerOrientation(TRenderOrientation aExpectedaOrientation);
+	void CheckHalSetting(TRenderOrientation aOrientation);
+	void IsOrientationCorrect(TRenderOrientation aOrientation);
+	void TestIndicateAppOrientation(TRenderOrientation aOrientation);
+	void TestIndicateAppOrientation(TRenderOrientation aOrientation, TRenderOrientation aSecondOrientation);
+	void TestIgnoredAppOrientation(TRenderOrientation aSecondOrientation, TInt aThemeServerOrientation, TInt aExpectedOrientation);
+	void TestAppOrientationOnSwap(TRenderOrientation aOrientation, TRenderOrientation aSecondOrientation);
+	//For TESTL
+	inline void testBooleanTrueL(TBool aCondition, const TText8* aFile, TInt aLine) 
+	    {
+	    iStep->testBooleanTrueL(aCondition, aFile, aLine, ETrue);
+	    }
+private:
+	//Test Cases
+	void TestInitialOrientation();
+	void TestFixedOrientations();
+	void TestAutoOrientation();
+	void TestIgnoreOrientation();
+	void TestFixedOrientationsOnWindowSwap();
+	void TestAutoOrientationOnWindowSwap();
+	void TestIgnoreOrientationOnWindowSwap();
+	void TestIgnoreAutoOrientationOnWindowSwap();
+	void TestInvalidAppOrientation();
+	void TestInvalidThemeServerOrientation();
+	
+private:
+	//members
+	// First Session and Window Group
+	RWsSession iWs;
+	RWindowGroup iWindowGroup;
+    RWindow iChildWindow;
+    // Second Session and Window Group
+	RWsSession iSecondWs;
+	RWindowGroup iSecondWindowGroup;
+	RWindow iSecondChildWindow;
+		
+	RProperty iRenderOrientationProperty;
+	RTimer iPublishTimer;
+	TRequestStatus iPublishTimerStatus;
+	TRequestStatus iRenderOrientationStatus;
+	RProperty iThemeServerOrientationProperty;
+
+	TRenderOrientation iCurrentThemeServerOrientation;
+	TBool iWaitForPublishOnNextTest; //Set to EFalse to skip waiting for publish on next test, default ETrue, Resets to ETrue on each Test.
+	};
+
+class CTDeviceRotationStep : public CTGraphicsStep
+	{
+public:
+	CTDeviceRotationStep();
+protected:
+	//from CTGraphicsStep
+	virtual CTGraphicsBase* CreateTestL();
+	};
+
+_LIT(KTDeviceRotationStep,"TDeviceRotation");
+
+#endif //TDEVICERORATION
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/windowing/windowserver/test/tauto/tevent_captureapp.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,67 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Helper application for TEvent test case GRAPHICS-WSERV-0757
+//
+
+#include <e32base.h>
+#include <e32debug.h>
+#include <w32std.h>
+
+const TInt KCapturePriority = 2;
+
+LOCAL_C void MainL()
+	{
+	RWsSession session;
+	User::LeaveIfError(session.Connect());
+	CleanupClosePushL(session);
+	RWindowGroup group(session);
+	User::LeaveIfError(group.Construct(0));
+
+	// Capture keys EKeyF22 and EKeyF23 with raised
+	// priority for each of the three capture types.
+	TInt handle1 = User::LeaveIfError(group.CaptureKey(EKeyF22, 0, 0, KCapturePriority));
+	TInt handle2 = User::LeaveIfError(group.CaptureKeyUpAndDowns(EStdKeyF22, 0, 0, KCapturePriority));
+	TInt handle3 = User::LeaveIfError(group.CaptureLongKey(EKeyF22, EKeyF22, 0, 0, KCapturePriority, ELongCaptureNormal));
+	TInt handle4 = User::LeaveIfError(group.CaptureKey(EKeyF23, 0, 0, KCapturePriority));
+	TInt handle5 = User::LeaveIfError(group.CaptureKeyUpAndDowns(EStdKeyF23, 0, 0, KCapturePriority));
+	TInt handle6 = User::LeaveIfError(group.CaptureLongKey(EKeyF23, EKeyF23, 0, 0, KCapturePriority, ELongCaptureNormal));
+
+	// Complete rendezvous with TEvent. This signals that all the capture
+	// requests have been made.
+	RProcess::Rendezvous(KErrNone);
+
+	// Wait until killed by TEvent
+	User::WaitForAnyRequest();
+
+	group.CancelCaptureKey(handle1);
+	group.CancelCaptureKeyUpAndDowns(handle2);
+	group.CancelCaptureLongKey(handle3);
+	group.CancelCaptureKey(handle4);
+	group.CancelCaptureKeyUpAndDowns(handle5);
+	group.CancelCaptureLongKey(handle6);
+
+	CleanupStack::PopAndDestroy(&session);
+	}
+
+GLDEF_C TInt E32Main()
+	{	
+	__UHEAP_MARK;
+
+	CTrapCleanup* cleanupStack = CTrapCleanup::New(); 	
+	TRAPD(ret, MainL());	
+	delete cleanupStack;
+	
+	__UHEAP_MARKEND;
+	return ret;
+	}
--- a/windowing/windowserver/test/tauto/tgc.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/tauto/tgc.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -1290,7 +1290,11 @@
 	 * that we use matching color depths for our off-screen bitmaps so that accuracy is
 	 * not lost since we compare bitmaps from the screen versus off-screen.
 	 */
-	const TDisplayMode displayMode = device->DisplayMode();
+	TDisplayMode displayMode = device->DisplayMode();
+	if (TDisplayModeUtils::NumDisplayModeBitsPerPixel(displayMode) == 32)
+	    {
+	    displayMode = EColor16MAP;
+	    }
 		
 	_LIT(KText,"RemoteGc & MWsGraphicsContext");
 	TFontSpec fSpec(KTestFontTypefaceName,23);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/windowing/windowserver/test/tauto/themeserverpropertydefine.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,88 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// This Process called with the argument KThemeServerPropertyDefineCmdDefine, defines
+// the theme server RProperty catagory to be the same as the theme servers process ID. 
+// Called with the argument KThemeServerPropertyDefineCmdDelete, it will delete the 
+// theme server RProperty. This is because an RProperty can only be defined and deleted 
+// from within a process with the same UID3 as the RProperty catogory you are trying to 
+// define/delete.
+//
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Nokia test code
+ */
+
+#include <BACLINE.H> 
+#include <e32base.h>
+#include <e32property.h>
+#include "..\..\nga\server\renderorientationtracker.h" //for KThemeOrientationCatagory and KThemeOrientationKey
+#include "themeserverpropertydefine.h"
+
+void DefineThemeServerPropertyL()
+    {
+    RProperty themeServerOrientationProperty;
+    const TSecurityPolicy KThemeOrientationReadSecurityPolicy(
+            TSecurityPolicy::EAlwaysPass);
+    const TSecurityPolicy KThemeOrientationWriteSecurityPolicy(
+            TSecurityPolicy::EAlwaysPass);
+    User::LeaveIfError(RProperty::Define(   KThemeOrientationCategory,
+                                            KThemeOrientationKey, 
+                                            RProperty::EInt,
+                                            KThemeOrientationReadSecurityPolicy,
+                                            KThemeOrientationWriteSecurityPolicy));
+    themeServerOrientationProperty.Close();
+    }
+
+void DeleteThemeServerPropertyL()
+    {
+    TInt err = KErrNone;
+    RProperty themeServerOrientationProperty;
+    User::LeaveIfError(themeServerOrientationProperty.Delete(
+            KThemeOrientationCategory, KThemeOrientationKey));
+    themeServerOrientationProperty.Close();
+    }
+
+void MainL()
+    {
+    CCommandLineArguments* args = CCommandLineArguments::NewLC();
+    TPtrC argumentPrt(args->Arg(1));
+    if (argumentPrt == KThemeServerPropertyDefineCmdDefine)
+        {
+        DefineThemeServerPropertyL();
+        }
+    else if (argumentPrt == KThemeServerPropertyDefineCmdDelete)
+        {
+        DeleteThemeServerPropertyL();
+        }
+    else
+        {
+        User::Leave(KErrNotSupported);
+        }
+    CleanupStack::PopAndDestroy(args);
+    }
+
+GLDEF_C TInt E32Main()
+    {
+    CTrapCleanup* cleanUpStack = CTrapCleanup::New();
+    if (cleanUpStack == NULL)
+        {
+        return KErrNoMemory;
+        }
+    TRAPD(err, MainL());
+    delete cleanUpStack;
+    return (err);
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/windowing/windowserver/test/tauto/themeserverpropertydefine.h	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,29 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Header Defines the EXE name as well as the two possible command line 
+// arguments for twsthemeserverdefine.exe
+
+/**
+ @file
+ @test
+ @internalComponent - Internal Nokia test code
+ */
+#ifndef THEMESERVERSIMULATION_H_
+#define THEMESERVERSIMULATION_H_
+
+_LIT(KThemeServerPropertyDefine, "twsthemeserverpropertydefine.exe");
+_LIT(KThemeServerPropertyDefineCmdDefine, "define");
+_LIT(KThemeServerPropertyDefineCmdDelete, "delete");
+
+#endif /* THEMESERVERSIMULATION_H_ */
--- a/windowing/windowserver/test/tdynamicres/group/bld.inf	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/tdynamicres/group/bld.inf	Fri Jul 16 11:45:55 2010 +0300
@@ -33,6 +33,7 @@
 ../scripts/wsdynamicresbasic_isotropic_scaling.script	z:/wstest/dynamicres/wsdynamicresbasic_isotropic_scaling.script
 ../scripts/wsdynamicresbasic_anisotropic_scaling.script	z:/wstest/dynamicres/wsdynamicresbasic_anisotropic_scaling.script
 ../scripts/wsdynamicresbasic_openvg_isotropic.script	z:/wstest/dynamicres/wsdynamicresbasic_openvg_isotropic.script
+../scripts/wsdynamicresbasic_sirocco.script	z:/wstest/dynamicres/wsdynamicresbasic_sirocco.script
 #endif // SYMBIAN_BUILD_GCE
 wstestdynamicres.iby	/epoc32/rom/include/wstestdynamicres.iby
 ../scripts/wsdynamicresclassic.script	z:/wstest/dynamicres/wsdynamicresclassic.script
--- a/windowing/windowserver/test/tdynamicres/group/wstestdynamicres.iby	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/tdynamicres/group/wstestdynamicres.iby	Fri Jul 16 11:45:55 2010 +0300
@@ -39,6 +39,7 @@
 data=DATAZ_\wstest\dynamicres\wsdynamicresbasic_isotropic_scaling.script	wstest\dynamicres\wsdynamicresbasic_isotropic_scaling.script
 data=DATAZ_\wstest\dynamicres\wsdynamicresbasic_no_scaling.script	wstest\dynamicres\wsdynamicresbasic_no_scaling.script
 data=DATAZ_\wstest\dynamicres\wsdynamicresbasic_openvg_isotropic.script	wstest\dynamicres\wsdynamicresbasic_openvg_isotropic.script
+data=DATAZ_\wstest\dynamicres\wsdynamicresbasic_sirocco.script	wstest\dynamicres\wsdynamicresbasic_sirocco.script
 #endif
 
 #endif
--- a/windowing/windowserver/test/tdynamicres/group/wstestdynamicres_helium.pkg	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/tdynamicres/group/wstestdynamicres_helium.pkg	Fri Jul 16 11:45:55 2010 +0300
@@ -36,11 +36,5 @@
 ;REM Window Server Dynamic Resolution Test Scripts [no plugins]
 
 ;//Please execute only the tests appropriate to your hardware capabilities.
-"\epoc32\data\z\wstest\dynamicres\wsdynamicresclassic.script"-"c:\wstest\dynamicres\wsdynamicresclassic.script"
+"\epoc32\data\z\wstest\dynamicres\wsdynamicresbasic_sirocco.script"-"c:\wstest\dynamicres\wsdynamicresbasic_sirocco.script"
 
-"\epoc32\data\z\wstest\dynamicres\wsdynamicresbasic_anisotropic_scaling.script"-"c:\wstest\dynamicres\wsdynamicresbasic_anisotropic_scaling.script"
-"\epoc32\data\z\wstest\dynamicres\wsdynamicresbasic_integer_scaling.script"-"c:\wstest\dynamicres\wsdynamicresbasic_integer_scaling.script"
-"\epoc32\data\z\wstest\dynamicres\wsdynamicresbasic_isotropic_scaling.script"-"c:\wstest\dynamicres\wsdynamicresbasic_isotropic_scaling.script"
-"\epoc32\data\z\wstest\dynamicres\wsdynamicresbasic_no_scaling.script"-"c:\wstest\dynamicres\wsdynamicresbasic_no_scaling.script"
-"\epoc32\data\z\wstest\dynamicres\wsdynamicresbasic_openvg_isotropic.script"-"c:\wstest\dynamicres\wsdynamicresbasic_openvg_isotropic.script"
-
--- a/windowing/windowserver/test/tdynamicres/inc/wsdynamicresbase.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/tdynamicres/inc/wsdynamicresbase.h	Fri Jul 16 11:45:55 2010 +0300
@@ -81,12 +81,7 @@
 	void CommonOverlayWindowSetupL(RWindow& aWindow, const TRgb& aColor);
 	void ResizeTestCommonSetupL(RWindow& aWindow, const TRgb& aColor);
 
-	void MakeTestWindowPairL(TRect aOuterRect,TRgb aOuterColor,TRect aInnerRect,TRgb aInnerColor);
 	void LargerTestWindow(TInt aPercentOfBack=80);
-	void DestroyTestWindowPair(TBool aKillTestBack=ETrue,TBool aKillTestFront=ETrue,TBool aKillTestChildren=ETrue);
-	void MakeTestWindowTripleL(TRect aOuterRect,TRgb aOuterColor,TRect aInnerRect,TRgb aInnerColor,TRect aChildRect,TRgb aChildColor,TRect aSecondChildRect,TRgb aSecondChildColor);
-	void CreateTestWindowQuadL(TRect aOuterRect,TRgb aOuterColor,TRect aInnerRect,TRgb aInnerColor,TRect aChildRect,TRgb aChildColor,TRect aSecondChildRect,TRgb aSecondChildColor);
-	void MakeTestWindowTripleL(TRect aOuterRect,TRgb aOuterColor,TRect aInnerRect,TRgb aInnerColor,TRect aChildRect,TRgb aChildColor);
 	void MakeExtraChildWindowL(const RWindowBase& aFromParent,TRect aChildRect,TRgb aChildColor);
 	struct LoopingGcPtr;
 	LoopingGcPtr	LoopBeginActivateWithWipe(const TRegion& aRegion,RWindow& aWin,TRgb aColor);
@@ -121,7 +116,7 @@
 		void				CreateSharedUtilityL()const ;
 		};
 	static const TPostTestCleanup& PostTestCleanupInstance();
-	RWindow	iTestBack;
+	RBlankWindow	iTestBack;
 	RWindow	iTestFront;
 	RWindow	iTestChild;
 	RWindow	iTestSecondChild;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/windowing/windowserver/test/tdynamicres/scripts/wsdynamicresbasic_sirocco.script	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,59 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+//
+
+LOAD_SUITE wsdynamicrestestserver 
+
+RUN_TEST_STEP 100 wsdynamicrestestserver TEFUnit.CGlobalSettings.SetScreenNoL.0
+
+RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0001L
+RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0002L
+RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0003L
+RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0004L
+// skipped for Sirocco builds
+// RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0005L
+RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0006L
+RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0007L
+RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0008L
+RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0009L
+//0010 skipped
+RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0011L
+RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0012L
+// skipped for Sirocco builds
+// RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0013L
+//0014 skipped
+RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0015L
+//0016 0017 skipped
+RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0018L
+
+//0021 skipped
+
+RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0031L
+RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0032L
+RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0033L
+//0034 skipped
+
+//RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0041L.0
+RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0042L.0
+//RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0041L.1
+RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0042L.1
+
+// skipped for Sirocco builds
+// RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0051L
+//0052 0053 skipped
+
+RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0101L
+RUN_TEST_STEP 200 wsdynamicrestestserver TEFUnit.CWsDynamicResBasic.GRAPHICS_WSERV_DYNAMICRES_0102L
+
--- a/windowing/windowserver/test/tdynamicres/src/t_wsdynamicreswinbase.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/tdynamicres/src/t_wsdynamicreswinbase.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -526,7 +526,9 @@
 		for (TInt index=0;index<KMaxInfoLines;index++)
 			{
 			if (iTestInfo[index].Length())
+			    {
 				iInfoGc->DrawText(iTestInfo[index],textRect,textRect.Size().iHeight*3/4,iInfoGc->ECenter);
+			    }
 			textRect.Move(0,rowHeight);
 			}
 		iInfoGc->DiscardFont();
--- a/windowing/windowserver/test/tdynamicres/src/wsdynamicresbase.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/tdynamicres/src/wsdynamicresbase.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -144,70 +144,6 @@
 	User::After(TTimeIntervalMicroSeconds32(aMilliseconds * 1000));
 	}
 
-/**	Creates the normal scenario used by these tests.
- *  With a large window behind and small window in front.
- *  If the windows already exist then they are just repositioned and redrawn.
- * 	@param	aOuterRect	Position of back window
- * 	@param	aOuterColor	Background colour for back window
- * 	@param	aInnerRect	Position of front window
- * 	@param	aInnerColor	Background colour for front window
- * 
- **/
-void CWsDynamicResBase::MakeTestWindowPairL(TRect aOuterRect,TRgb aOuterColor,TRect aInnerRect,TRgb aInnerColor)
-	{
-	if (!iTestBack.WsHandle())
-		{
-		iTestBack=RWindow(iSession);
-		ASSERT_EQUALS_X(iTestBack.Construct(iGroup, ++iWindowHandle), KErrNone);
-#ifdef  FLICKER
-		iTestBack.Activate();
-#endif
-		iTestBack.SetRequiredDisplayMode(iDisplayMode);
-		iTestBack.SetBackgroundColor(aOuterColor);
-		iTestBack.SetExtent(aOuterRect.iTl,aOuterRect.Size());
-#ifndef FLICKER
-		iTestBack.Activate();
-#endif
-		}
-	else
-		{
-		iTestBack.SetRequiredDisplayMode(iDisplayMode);
-		iTestBack.SetBackgroundColor(aOuterColor);
-		iTestBack.SetExtent(aOuterRect.iTl,aOuterRect.Size());
-		}
-	iTestBack.BeginRedraw();
-	ActivateWithWipe(iGc,iTestBack,aOuterColor);
-	iGc->Deactivate();
-	iTestBack.EndRedraw();
-	iTestBack.SetVisible(ETrue);
-	
-	if (!iTestFront.WsHandle())
-		{
-		iTestFront=RWindow(iSession);
-		ASSERT_EQUALS_X(iTestFront.Construct(iGroup, ++iWindowHandle), KErrNone);
-#ifdef FLICKER
-		iTestFront.Activate();
-#endif
-		iTestFront.SetRequiredDisplayMode(iDisplayMode);
-		iTestFront.SetBackgroundColor(aInnerColor);	
-		iTestFront.SetExtent(aInnerRect.iTl,aInnerRect.Size());
-
-#ifndef FLICKER
-		iTestFront.Activate();
-#endif
-		}
-	else
-		{
-		iTestFront.SetRequiredDisplayMode(iDisplayMode);
-		iTestFront.SetBackgroundColor(aInnerColor);
-		iTestFront.SetExtent(aInnerRect.iTl,aInnerRect.Size());
-		}
-	
-	DrawPlainUI(iTestFront,EFalse,aInnerColor);
-	iTestFront.SetVisible(ETrue);
-	
-	}
-
 void CWsDynamicResBase::LargerTestWindow(TInt aPercentOfBack)
 	{
 	TRect newPos=iTestPos;
@@ -221,72 +157,6 @@
 	
 	}
 
-/** Destroys some or all of the test windows so the test can loop (or test the state after destruction.
- *  The windows are destroyed when the test exits normally.
- * 	Child windows are automatically killed when parent window is killed!
- * 
- **/
-void CWsDynamicResBase::DestroyTestWindowPair(TBool aKillTestBack,TBool aKillTestFront,TBool aKillTestChildren)
-	{
-	if (aKillTestBack && iTestBack.WsHandle())
-		{
-		iTestBack.Close();
-		}
-	if (aKillTestFront && iTestFront.WsHandle())
-		{
-		iTestFront.Close();
-		}
-	if (aKillTestChildren)
-		{
-		if (iTestChild.WsHandle())
-			{
-			iTestChild.Close();
-			}
-		if (iTestSecondChild.WsHandle())
-			{
-			iTestSecondChild.Close();
-			}
-		}
-	}
-/**	Creates a child window inside the front window of the usual test scenario
-*  With a large window behind and small window in front.
- *  If the windows already exist then they are just repositioned and redrawn.
- * 	@param	aOuterRect	Position of back window
- * 	@param	aOuterColor	Background colour for back window
- * 	@param	aInnerRect	Position of front window
- * 	@param	aInnerColor	Background colour for front window
- * 	@param	aChildRect	Position of child window
- * 	@param	aChildColor	Background colour for child window
- * 	@param	aSecondChildRect	Position of Second child window
- * 	@param	aSecondChildColor	Background colour for Second child window
- * 
- **/
-void CWsDynamicResBase::MakeTestWindowTripleL(TRect aOuterRect,TRgb aOuterColor,TRect aInnerRect,TRgb aInnerColor,TRect aChildRect,TRgb aChildColor,TRect aSecondChildRect,TRgb aSecondChildColor)
-	{
-	MakeTestWindowTripleL(aOuterRect,aOuterColor,aInnerRect,aInnerColor,aChildRect,aChildColor);
-
-	MakeExtraChildWindowL(iTestChild,aSecondChildRect,aSecondChildColor);
-	}
-
-/**	Creates a child window inside the front window of the usual test scenario
-*  With a large window behind and small window in front.
- *  If the windows already exist then they are just repositioned and redrawn.
- * 	@param	aOuterRect	Position of back window
- * 	@param	aOuterColor	Background colour for back window
- * 	@param	aInnerRect	Position of front window
- * 	@param	aInnerColor	Background colour for front window
- * 	@param	aChildRect	Position of child window
- * 	@param	aChildColor	Background colour for child window
- *  @param	aSecondChildRect	Position of second child window
- * 	@param	aSecondChildColor	Background colour for second child window
- * 
- **/
-void CWsDynamicResBase::CreateTestWindowQuadL(TRect aOuterRect,TRgb aOuterColor,TRect aInnerRect,TRgb aInnerColor,TRect aChildRect,TRgb aChildColor,TRect aSecondChildRect,TRgb aSecondChildColor)
-	{
-	MakeTestWindowTripleL(aOuterRect,aOuterColor,aInnerRect,aInnerColor,aChildRect,aChildColor);
-	
-	MakeExtraChildWindowL(iTestFront,aSecondChildRect,aSecondChildColor);
-	}
 
 void CWsDynamicResBase::MakeExtraChildWindowL(const RWindowBase& aFromParent,TRect aChildRect,TRgb aChildColor)
 	{
@@ -347,39 +217,6 @@
 	return CWsDynamicResWinBase::BeginActivateWithWipe(aRegion,aWin,aColor);
 	}
 
-/**	Creates a child window inside the front window of the usual test scenario
-*  With a large window behind and small window in front.
- *  If the windows already exist then they are just repositioned and redrawn.
- * 	@param	aOuterRect	Position of back window
- * 	@param	aOuterColor	Background colour for back window
- * 	@param	aInnerRect	Position of front window
- * 	@param	aInnerColor	Background colour for front window
- * 	@param	aChildRect	Position of child window
- * 	@param	aChildColor	Background colour for child window
- * 
- **/
-void CWsDynamicResBase::MakeTestWindowTripleL(TRect aOuterRect,TRgb aOuterColor,TRect aInnerRect,TRgb aInnerColor,TRect aChildRect,TRgb aChildColor)
-	{
-	MakeTestWindowPairL(aOuterRect,aOuterColor,aInnerRect,aInnerColor);
-	ASSERT(iTestFront.WsHandle());
-	
-	if (!iTestChild.WsHandle())
-		{
-		iTestChild=RWindow(iSession);
-		ASSERT_EQUALS_X(iTestChild.Construct(iTestFront, ++iWindowHandle), KErrNone);
-		iTestChild.SetRequiredDisplayMode(iDisplayMode);
-		}
-	iTestChild.SetBackgroundColor(aChildColor);
-	iTestChild.SetExtent(aChildRect.iTl,aChildRect.Size());
-	iTestChild.Activate();
-	iTestChild.BeginRedraw();
-	iGc->Activate(iCompare);
-	iGc->SetBrushColor(iBlue);
-	iGc->Clear();
-	iGc->Deactivate();
-	iTestChild.EndRedraw();
-	iTestChild.SetVisible(ETrue);
-	}
 /**	
  * 	Generates a valid surfaceID for the current display mode.
  * 	This is then used in negative testing.
--- a/windowing/windowserver/test/tdynamicres/src/wsdynamicresbasic.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/test/tdynamicres/src/wsdynamicresbasic.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -509,6 +509,7 @@
 	For each, check if event has been received
 @SYMTestExpectedResults	
 	Based on type of change, check event
+	@note Test uses HAL to simulate display disconnection. Not supported on production platforms.
 */
 void	CWsDynamicResBasic::GRAPHICS_WSERV_DYNAMICRES_0005L()
 	{
@@ -683,16 +684,12 @@
 	TInt error;
 	MakeTitleAndCompareWindowsL(_L("GFX_WSERV_DYNAMICRES_0006L"),_L("Change Resolution"));
 
-	iTestBack=RWindow(iSession);
+	iTestBack=RBlankWindow(iSession);
 	ASSERT_EQUALS(iTestBack.Construct(iGroup, ++iWindowHandle), KErrNone);
 	iTestBack.SetRequiredDisplayMode(iDisplayMode);
-	iTestBack.SetBackgroundColor(TRgb(255,0,0));
+	iTestBack.SetColor(TRgb(255,0,0));
 	iTestBack.SetExtent(iTestPos.iTl,iTestPos.Size());
 	iTestBack.Activate();
-	iTestBack.BeginRedraw();
-	ActivateWithWipe(iGc,iTestBack,TRgb(255,0,0));
-	iGc->Deactivate();
-	iTestBack.EndRedraw();
 	iTestBack.SetVisible(ETrue);
 	
 	struct DrawCompare
@@ -902,17 +899,14 @@
 	TInt error;
 	MakeTitleAndCompareWindowsL(_L("GFX_WSERV_DYNAMICRES_0008L"),_L("Change Size Mode"));
 
-	iTestBack=RWindow(iSession);
-	ASSERT_EQUALS(iTestBack.Construct(iGroup, ++iWindowHandle), KErrNone);
-	iTestBack.SetRequiredDisplayMode(iDisplayMode);
-	iTestBack.SetBackgroundColor(TRgb(255,0,0));
-	iTestBack.SetExtent(iTestPos.iTl,iTestPos.Size());
-	iTestBack.Activate();
-	iTestBack.BeginRedraw();
-	ActivateWithWipe(iGc,iTestBack,TRgb(255,0,0));
-	iGc->Deactivate();
-	iTestBack.EndRedraw();
-	iTestBack.SetVisible(ETrue);
+    iTestBack=RBlankWindow(iSession);
+    ASSERT_EQUALS(iTestBack.Construct(iGroup, ++iWindowHandle), KErrNone);
+    iTestBack.SetRequiredDisplayMode(iDisplayMode);
+    iTestBack.SetColor(TRgb(255,0,0));
+    iTestBack.SetExtent(iTestPos.iTl,iTestPos.Size());
+    iTestBack.Activate();
+    iTestBack.SetVisible(ETrue);
+    iSession.Finish(ETrue);
 	
 	
 	if (CWindowGc*	gc=BeginActivateWithWipe(ETrue,iCompare,TRgb(128,128,128)))
@@ -1084,17 +1078,13 @@
 	MakeTitleAndCompareWindowsL(_L("GFX_WSERV_DYNAMICRES_0009L"),_L("Change Size Mode"));
 	iSession.Finish(ETrue);
 
-	iTestBack=RWindow(iSession);
-	ASSERT_EQUALS(iTestBack.Construct(iGroup, ++iWindowHandle), KErrNone);
-	iTestBack.SetRequiredDisplayMode(iDisplayMode);
-	iTestBack.SetBackgroundColor(TRgb(255,0,0));
-	iTestBack.SetExtent(iTestPos.iTl,iTestPos.Size());
-	iTestBack.Activate();
-	iTestBack.BeginRedraw();
-	ActivateWithWipe(iGc,iTestBack,TRgb(255,0,0));
-	iGc->Deactivate();
-	iTestBack.EndRedraw();
-	iTestBack.SetVisible(ETrue);
+    iTestBack=RBlankWindow(iSession);
+    ASSERT_EQUALS(iTestBack.Construct(iGroup, ++iWindowHandle), KErrNone);
+    iTestBack.SetRequiredDisplayMode(iDisplayMode);
+    iTestBack.SetColor(TRgb(255,0,0));
+    iTestBack.SetExtent(iTestPos.iTl,iTestPos.Size());
+    iTestBack.Activate();
+    iTestBack.SetVisible(ETrue);
 	iSession.Finish(ETrue);
 	
 	struct DrawCompare
@@ -1503,8 +1493,7 @@
 
 void CDSATestDrawing::Draw()
 	{
-	iWin->Invalidate();
-	iWin->BeginRedraw();
+	//Should not invalidate the window containing DSA drawing. That's the whole point!
 	CFbsBitGc* gc = iDSA->Gc();
 	gc->SetPenStyle(gc->ESolidPen);
 	gc->SetPenColor(TRgb(255,0,0));
@@ -1512,7 +1501,6 @@
 	iRect.Shrink(1, 1);
 	gc->DrawRect(iRect);
 	iDSA->ScreenDevice()->Update();
-	iWin->EndRedraw();
 	
 	}
 void CDSATestDrawing::Restart(RDirectScreenAccess::TTerminationReasons /*aReason*/) 
@@ -1637,8 +1625,6 @@
 			continue;
 			}
 		
-		//if my rectangle's iTl is (0,0) and iBr is (100,100). Why does it gives me the rect width and height
-		//both 100? 0 - 100 is 101 pixels drawn. Or does this indicates iBr is exclusive and iTl is inclusive?
 		//Ruo: Oh I almost believe iBr is exclusive now
 		TDisplayConfiguration dispConfigAfter2;
 		interface->GetConfiguration(dispConfigAfter2);
@@ -2722,12 +2708,16 @@
 		TInt completeCount = 0;
 		while (notComplete)
 			{
+            RDebug::Printf("iInfoScreenDevice->SetAppScreenMode");
 			iInfoScreenDevice->SetAppScreenMode(screenModeList[index]);
 			iSession.Finish(ETrue);
 			iSession.HeapSetFail(RHeap::EDeterministic,heapFail);
+            RDebug::Printf("iInfoScreenDevice->SetAppScreenMode");
 			iInfoScreenDevice->SetScreenMode(screenModeList[index]);
+            RDebug::Printf("SetScreenMode done");
 			iSession.HeapSetFail(RHeap::ENone,0);
 			iSession.Finish(ETrue);
+            RDebug::Printf("Finish done");
 			Pause(50);
 			TInt newMode = iInfoScreenDevice->CurrentScreenMode();
 
@@ -2736,7 +2726,7 @@
 				completeCount++;
 				if (completeCount == 5)
 					{
-					INFO_PRINTF2(_L("Succeeded with heapFail = %d"),heapFail);
+					INFO_PRINTF3(_L("Mode %i Succeeded with heapFail = %d"),index, heapFail);
 					notComplete = EFalse;
 					}
 				iInfoScreenDevice->SetAppScreenMode(screenModeList[0]);
@@ -3740,6 +3730,8 @@
 
 	if (aBitmapRegionPairArray.Count()>0)
 		{
+        RDebug::Printf("Checking");
+        TInt countchecks=0;
 		for (TInt i=0; i<width; i++)
 			{
 			for (TInt j=0; j<height; j++)
@@ -3822,6 +3814,7 @@
 				}
 			}
 		}
+	
 	ignoreDueToResizing.Close();
 	if (errorPixels+diffPixels < 2)
 		{
--- a/windowing/windowserver/tframerate/framerate.RSS	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-// FRAMERATE.RSS
-
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Registry file for framerate test
-// 
-//
-
-#include <ecom/registryinfo.rh>
-
-RESOURCE REGISTRY_INFO test_Info
-	{
-	dll_uid = 0x102827FC;
-	interfaces =
-		{
-		INTERFACE_INFO
-			{
-			interface_uid = 0x10282929;
-			implementations =
-				{
-				IMPLEMENTATION_INFO
-					{
-					implementation_uid = 0x1028292A;
-					version_no = 1;
-					display_name = "CGraphicDrawerTestFrameRate";
-					default_data = "";
-					opaque_data = "";
-					}
-				};
-			}
-		};
-	}
--- a/windowing/windowserver/tframerate/framerate.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test - Test plug-in to test wsgraphic animation artwork framerate
- @internalComponent - Internal Symbian test code
-*/
-
-#include <bitstd.h>
-#include <graphics/wsgraphicdrawer.h>
-#include "framerate.h"
-#include "wsgraphicdrawercontext.h"
-#include "wsframerate.h"
-
-//Constant message handle, which is used to send count value between client and plug-in
-const TUint8 KCmdCount=0;
-
-/**
-Creates new test framerate object.
-*/
-CGraphicDrawerTestFrameRate* CGraphicDrawerTestFrameRate::CreateL()
-	{
-	return new(ELeave) CGraphicDrawerTestFrameRate;
-	}
-
-CGraphicDrawerTestFrameRate::CGraphicDrawerTestFrameRate()
-	{
-	}
-
-CGraphicDrawerTestFrameRate::~CGraphicDrawerTestFrameRate()
-	{
-	}
-
-void CGraphicDrawerTestFrameRate::ConstructL(MWsGraphicDrawerEnvironment& aEnv,const TGraphicDrawerId& aId,MWsClient& aOwner,const TDesC8& /*aData*/)
-	{
-	BaseConstructL(aEnv,aId,aOwner);
-	if (aEnv.Screen(0)->ResolveObjectInterface(KMWsScreenConfigInterfaceId))
-		{
-		iContext = CWsGraphicDrawerNonNgaContext::NewL();
-		}
-	else
-		{
-		iContext = CWsGraphicDrawerNgaContext::NewL();
-		}
-	}
-
-/**	
-Simulate two animations of different frame rate with their respective schedule.
-
-@param MWsGc Window server graphic context to draw the animation
-@param TRect Rectangle are required to draw the animation
-@param TDesC Parameter value to use inside this function.
-*/
-void CGraphicDrawerTestFrameRate::DoDraw(MWsGc& aGc,const TRect& aRect,const TDesC8& aData) const
-	{
-	TInt animId = aData[0];
-	TInt requestedFps = aData[1];
-	++iCounter[animId];
-	//Schedule next redraw based on requested frame rate
-	TTimeIntervalMicroSeconds nextTick = 1000000/requestedFps;
-	iContext->ScheduleAnimation(aGc, aRect, nextTick);
-	}
-
-/**	
-Handles message between client and plug-in.
-
-@param TDesC Constant message command.
-*/
-void CGraphicDrawerTestFrameRate::HandleMessage(const TDesC8& aData)
-	{
-	switch (aData[0])
-		{
-		case KCmdCount:
-			TPckgBuf<TAnimRate> buf;
-			buf().iAnim1=iCounter[0];
-			buf().iAnim2=iCounter[1];
-			TInt err = SendMessage(buf);
-			__ASSERT_DEBUG(err>=KErrNone, User::Invariant());
-			break;
-		}
-	}
-	
--- a/windowing/windowserver/tframerate/framerate.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test - Test plug-in to test wsgraphic animation artwork framerate
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __GRAPHICDRAWERTESTFRAMERATE_H__
-#define __GRAPHICDRAWERTESTFRAMERATE_H__
-
-#include <e32std.h>
-#include "Graphics/WSGRAPHICDRAWER.H"
-#include <Graphics/WSGRAPHICDRAWERINTERFACE.H>
-
-//Maximum number of animations at a time.
-#define KMaxAnim 100
-
-class MWsGraphicDrawerContext;
-
-/**
-Drawer plug-in class used to draw the animation and scheduling.
-*/
-NONSHARABLE_CLASS(CGraphicDrawerTestFrameRate): public CWsGraphicDrawer
-	{
-public:
-	enum 
-		{
-		EImplUid = 0x1028292A
-		};
-	static CGraphicDrawerTestFrameRate* CreateL();
-	~CGraphicDrawerTestFrameRate();
-	void ConstructL(MWsGraphicDrawerEnvironment& aEnv,const TGraphicDrawerId& aId,MWsClient& aOwner,const TDesC8& aData);
-	void HandleMessage(const TDesC8& aData);
-private:
-	void DoDraw(MWsGc& aGc,const TRect& aRect,const TDesC8& aData) const;
-private:
-	CGraphicDrawerTestFrameRate();
-	mutable TInt iCounter[KMaxAnim];
-	MWsGraphicDrawerContext* iContext;
-	};
-
-#endif //__GRAPHICDRAWERTESTFRAMERATE_H__
--- a/windowing/windowserver/tframerate/proxy.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include <ecom/implementationproxy.h>
-#include "framerate.h"
-
-
-LOCAL_C const TImplementationProxy KImplementationTable[] =
-	{
-	IMPLEMENTATION_PROXY_ENTRY(CGraphicDrawerTestFrameRate::EImplUid,CGraphicDrawerTestFrameRate::CreateL)
-	};
-
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
-	{
-	aTableCount = sizeof(KImplementationTable)/sizeof(TImplementationProxy);
-	return KImplementationTable;
-	}
--- a/windowing/windowserver/tframerate/wsframerate.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test - Test client library used to communicate between framerate plug-in and twsgraphs.
- @internalComponent - Internal Symbian test code
-*/
-
-#include "wsframerate.h"
-
-//Constant message handle, which is used to send count value between client and plug-in
-const TUint8 KCmdCount=0;
-
-LOCAL_C const TUid KUidWsGraphicTestFrameRate = {0x1028292A};
-
-/**
-Creates new object of type CGraphicTestFrameRate based on existing plug-in id.
-This interally constructs CWsGraphic object
-
-@param	TUid	Test plug-in id
-*/
-
-EXPORT_C CGraphicTestFrameRate* CGraphicTestFrameRate::NewL(TUid aUid)
-	{
-	CGraphicTestFrameRate* self = new(ELeave) CGraphicTestFrameRate;
-	CleanupStack::PushL(self);
-	self->BaseConstructL(aUid,KUidWsGraphicTestFrameRate,KNullDesC8());
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-/**
-Creates new object of type CGraphicTestFrameRate based on active screen number.
-This interally constructs CWsGraphic object
-
-@param	TInt	Screen number
-*/
-EXPORT_C CGraphicTestFrameRate* CGraphicTestFrameRate::NewL(TInt aScreen)
-	{
-	CGraphicTestFrameRate* self = new(ELeave) CGraphicTestFrameRate;
-	CleanupStack::PushL(self);
-	TBuf8<1> data;
-	data.Append((TUint8)aScreen);
-	self->BaseConstructL(KUidWsGraphicTestFrameRate,data);
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-EXPORT_C CGraphicTestFrameRate::~CGraphicTestFrameRate()
-	{
-	}
-
-CGraphicTestFrameRate::CGraphicTestFrameRate()
-	{
-	}
-
-/**
-Handles message between client and Twsgraphs test call.
-
-@param	TDesc8	Descriptor values passed between client and plugin
-*/
-void CGraphicTestFrameRate::HandleMessage(const TDesC8& aData)
-	{
-	if (aData.Size()>1)
-		{
-		Mem::Copy(iCount, aData.Ptr(),(aData.Size()));
-		}
-	iCallBack.CallBack();
-	}
-
-void CGraphicTestFrameRate::OnReplace()
-	{
-	}
-
-/**
-Query a message value from test plug-in.
-
-@param	TAnimRate	Drawing count for two animations.
-*/
-EXPORT_C TInt CGraphicTestFrameRate::QueryPlugin(TAnimRate& aCount)
-	{
-	TBuf8<1> cmd;
-	cmd.Append(KCmdCount);
-	SendMessage(cmd);
-	TInt err = Flush();
-	if (err!=KErrNone)
-		return err;
-	iCount=&aCount;
-	return KErrNone;
-	}
-
-/**
-Set the callback function
-
-@param	TCallBack	Name of the callback function to invoke.
-*/
-EXPORT_C void CGraphicTestFrameRate::SetCallBack(TCallBack aCallBack)
-	{
-	iCallBack = aCallBack;
-	}
--- a/windowing/windowserver/tframerate/wsframerate.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test GraphicTestFrameRate plugins
-// 
-//
-
-/**
- @file
- @test - Test plug-in to test wsgraphic animation artwork framerate
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __GRAPHICTESTFRAMERATE_H__
-#define __GRAPHICTESTFRAMERATE_H__
-
-#include "W32STD.H"
-
-/**
-Holds draw count values of two different animations
-*/
-NONSHARABLE_STRUCT(TAnimRate)
-	{
-	TInt iAnim1;
-	TInt iAnim2;
-	};
-	
-/** Client representation of a test anim that displays its frame-rate
-
-@publishedPartner
-@released
-*/	
-NONSHARABLE_CLASS(CGraphicTestFrameRate): public CWsGraphic
-
-	{
-public:
-	IMPORT_C static CGraphicTestFrameRate* NewL(TUid aUid);
-	IMPORT_C static CGraphicTestFrameRate* NewL(TInt aScreen);
-	IMPORT_C ~CGraphicTestFrameRate();
-	IMPORT_C TInt QueryPlugin(TAnimRate& aCount);
-	IMPORT_C void SetCallBack(TCallBack aCallBack);
-private:
-	CGraphicTestFrameRate();
-	void HandleMessage(const TDesC8& aData);
-	void OnReplace();
-private:
-	TAnimRate* iCount;
-	TCallBack iCallBack;
-	};
-
-#endif //__GRAPHICTESTFRAMERATE_H__
--- a/windowing/windowserver/tframerate/wsgraphicdrawercontext.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef __WSGRAPHICDRAWERCONTEXT_H__
-#define __WSGRAPHICDRAWERCONTEXT_H__
-
-#include <e32base.h>
-#include <e32std.h>
-
-class MWsGc;
-class TRgb;
-
-class MWsGraphicDrawerContext
-	{
-public:
-	virtual void Destroy() = 0;
-	virtual void ScheduleAnimation(MWsGc& aGc, const TRect& aRect,const TTimeIntervalMicroSeconds& aFromNow) = 0;
-	virtual void ScheduleAnimation(MWsGc& aGc, const TRect& aRect,const TTimeIntervalMicroSeconds& aFromNow,const TTimeIntervalMicroSeconds& aFreq,const TTimeIntervalMicroSeconds& aStop) = 0;
-	};
-
-class CWsGraphicDrawerNgaContext : public CBase, public MWsGraphicDrawerContext
-	{
-public:
-	static MWsGraphicDrawerContext* NewL();
-public:
-	void Destroy();
-	void ScheduleAnimation(MWsGc& aGc, const TRect& aRect,const TTimeIntervalMicroSeconds& aFromNow);
-	void ScheduleAnimation(MWsGc& aGc, const TRect& aRect,const TTimeIntervalMicroSeconds& aFromNow,const TTimeIntervalMicroSeconds& aFreq,const TTimeIntervalMicroSeconds& aStop);
-	};
-
-class CWsGraphicDrawerNonNgaContext : public CBase, public MWsGraphicDrawerContext
-	{
-public:
-	static MWsGraphicDrawerContext* NewL();
-public:
-	void Destroy();
-	void ScheduleAnimation(MWsGc& aGc, const TRect& aRect,const TTimeIntervalMicroSeconds& aFromNow);
-	void ScheduleAnimation(MWsGc& aGc, const TRect& aRect,const TTimeIntervalMicroSeconds& aFromNow,const TTimeIntervalMicroSeconds& aFreq,const TTimeIntervalMicroSeconds& aStop);
-	};
-
-#endif // __WSGRAPHICDRAWERCONTEXT_H__
--- a/windowing/windowserver/tframerate/wsgraphicdrawerngacontext.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#define SYMBIAN_GRAPHICS_GCE
-
-#include "wsgraphicdrawercontext.h"
-#include <graphics/wsgraphicscontext.h>
-
-MWsGraphicDrawerContext* CWsGraphicDrawerNgaContext::NewL()
-	{
-	return new(ELeave) CWsGraphicDrawerNgaContext();
-	}
-
-void CWsGraphicDrawerNgaContext::Destroy()
-	{
-	delete this;
-	}
-
-void CWsGraphicDrawerNgaContext::ScheduleAnimation(MWsGc& aGc, const TRect& aRect,const TTimeIntervalMicroSeconds& aFromNow)
-	{
-	aGc.ScheduleAnimation(aRect, aFromNow);
-	}
-
-void CWsGraphicDrawerNgaContext::ScheduleAnimation(MWsGc& aGc, const TRect& aRect,const TTimeIntervalMicroSeconds& aFromNow,const TTimeIntervalMicroSeconds& aFreq,const TTimeIntervalMicroSeconds& aStop)
-	{
-	aGc.ScheduleAnimation(aRect, aFromNow, aFreq, aStop);
-	}
--- a/windowing/windowserver/tframerate/wsgraphicdrawernonngacontext.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#undef SYMBIAN_GRAPHICS_GCE
-
-#include "wsgraphicdrawercontext.h"
-#include <graphics/wsgraphicdrawerinterface.h>
-#include <bitstd.h>
-
-MWsGraphicDrawerContext* CWsGraphicDrawerNonNgaContext::NewL()
-	{
-	return new(ELeave) CWsGraphicDrawerNonNgaContext();
-	}
-
-void CWsGraphicDrawerNonNgaContext::Destroy()
-	{
-	delete this;
-	}
-
-void CWsGraphicDrawerNonNgaContext::ScheduleAnimation(MWsGc& aGc, const TRect& aRect,const TTimeIntervalMicroSeconds& aFromNow)
-	{
-	aGc.ScheduleAnimation(aRect, aFromNow);
-	}
-
-void CWsGraphicDrawerNonNgaContext::ScheduleAnimation(MWsGc& aGc, const TRect& aRect,const TTimeIntervalMicroSeconds& aFromNow,const TTimeIntervalMicroSeconds& aFreq,const TTimeIntervalMicroSeconds& aStop)
-	{
-	aGc.ScheduleAnimation(aRect, aFromNow, aFreq, aStop);
-	}
--- a/windowing/windowserver/tlib/TESTBASE.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1446 +0,0 @@
-// Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Base classes used for building window server test code
-// 
-//
-
-#include <e32std.h>
-#include <w32std.h>
-#include <e32svr.h>
-#include <e32property.h>
-#include "TLIB.H"
-#include <graphics/wsgraphicdrawerinterface.h>
-
-//
-// Test code classes
-//
-// CTWinBase
-// CTBaseWin
-// CTWin
-// CTBackedUpWin
-// CTGroupWin
-// CTClient
-//
-//
-
-_LIT(KTestFontTypefaceName,"DejaVu Sans Condensed");
-
-class CStopTheScheduler : public CAsyncOneShot
-	{
-public:
-	inline CStopTheScheduler(CTClient* aClient,TInt aPriority,TBool aAll) :CAsyncOneShot(aPriority), iClient(aClient), iAll(aAll) {}
-	inline CStopTheScheduler(CTClient* aClient,TInt aPriority) :CAsyncOneShot(aPriority), iClient(aClient) {}
-	inline CStopTheScheduler(TInt aPriority) :CAsyncOneShot(aPriority) {}
-	void RunL();
-public:
-	CTClient* iClient;
-	TBool iAll;
-#ifdef __WINS__
-	TInt iCStopTheSchedulerRunCount;
-#endif
-	};
-
-
-void TbPanic(TInt aPanic)
-	{
-	User::Panic(_L("TestBase"),aPanic);
-	}
-
-EXPORT_C CTWinBase::CTWinBase(TInt aType) : iType(aType)
-	{
-	__DECLARE_NAME(_S("CTWinBase"));
-	}
-
-EXPORT_C CTWinBase *CTWinBase::Parent() const
-	{
-	return((CTWinBase *)WinTreeNode()->Parent());
-	}
-
-EXPORT_C CTWinBase *CTWinBase::NextSibling() const
-	{
-	return((CTWinBase *)WinTreeNode()->NextSibling());
-	}
-
-EXPORT_C CTWinBase *CTWinBase::PrevSibling() const
-	{
-	return((CTWinBase *)WinTreeNode()->PrevSibling());
-	}
-
-EXPORT_C CTClient *CTWinBase::Client() const
-	{
-	return(iOwnerWin->Client());
-	}
-
-EXPORT_C CTBaseWin *CTWinBase::Child() const
-	{
-	return((CTBaseWin *)WinTreeNode()->Child());
-	}
-
-EXPORT_C TPoint CTWinBase::Position() const
-	{
-	return(TPoint(0,0));
-	}
-
-EXPORT_C void CTWinBase::PointerEnter(const TTime&)
-	{
-	}
-
-EXPORT_C void CTWinBase::PointerExit(const TTime&)
-	{
-	}
-
-EXPORT_C void CTWinBase::PointerBufferReady(const TTime&)
-	{
-	}
-
-EXPORT_C void CTWinBase::PointerL(const TPointerEvent&,const TTime&)
-	{
-	}
-
-EXPORT_C void CTWinBase::SwitchOn(const TTime &)
-	{
-	}
-
-EXPORT_C void CTWinBase::ModifiersChanged(const TModifiersChangedEvent &,const TTime &)
-	{
-	}
-
-EXPORT_C void CTWinBase::AdjustOrdinal(TInt)
-	{
-	}
-
-EXPORT_C void CTWinBase::AdjustShadow(TInt)
-	{
-	}
-
-EXPORT_C void CTWinBase::SetVisible(TBool)
-	{
-	}
-
-EXPORT_C TInt CTWinBase::SubType()
-	{
-	return(0);
-	}
-
-EXPORT_C void CTWinBase::ErrorMessage(const TWsErrorMessage&, const TTime &)
-	{
-	}
-
-EXPORT_C void CTWinBase::__DbgTestInvariant() const
-	{
-	WinTreeNode()->__DbgTestInvariant();
-	}
-
-// CTBaseWin //
-
-EXPORT_C CTBaseWin::CTBaseWin(TInt aType) : CTWinBase(aType)
-	{
-	__DECLARE_NAME(_S("CTBaseWin"));
-	}
-
-EXPORT_C CTBaseWin::~CTBaseWin()
-	{
-	}
-
-EXPORT_C void CTBaseWin::RelinquishFocus()
-	{
-	CTWinBase *parent=Parent();
-	CTWindowGroup *group=Group();
-	CTWinBase *child=group->Child();
-	if (child==this)
-		child=child->NextSibling();
-	group->SetCurrentWindow((parent->iType==EWinTypeClient) ? (CTBaseWin *)parent : (CTBaseWin *)child);
-	}
-
-EXPORT_C void CTBaseWin::SetVisible(TBool aState)
-	{
-	BaseWin()->SetVisible(aState);
-	}
-
-EXPORT_C const RWindowTreeNode *CTBaseWin::WinTreeNode() const
-	{
-	return((const RWindowTreeNode *)BaseWin());
-	}
-
-EXPORT_C RWindowTreeNode *CTBaseWin::WinTreeNode()
-	{
-	return((RWindowTreeNode *)BaseWin());
-	}
-
-EXPORT_C void CTBaseWin::InitWin()
-	{
-	}
-
-EXPORT_C void CTBaseWin::ConstructExtLD(CTWinBase &aParent, const TPoint &aPos, const TSize &aSize)
-//
-// Call ConstructL, SetExt and either of these fail destroy this and leave
-//
-	{
-	TRAPD(err,ConstructL(aParent));
-	if (err!=KErrNone)
-		goto celd_err;
-	TRAP(err,SetExtL(aPos,aSize));
-	if (err!=KErrNone)
-		{
-celd_err:
-		delete this;
-		User::Leave(err);
-		}
-	}
-
-EXPORT_C void CTBaseWin::ConstructL(CTWinBase &aParent)
-	{
-	TInt ret;
-	__ASSERT_DEBUG(aParent.iOwnerWin!=NULL,TbPanic(ETestBasePanicNullOwnerWin));
-	iOwnerWin=aParent.iOwnerWin;
-	if ((ret=ConstructWin(aParent))==KErrNone)
-		{
-		//TFontSpec fspec(KTestFontTypefaceName,200);
-		//User::LeaveIfError(Client()->iScreen->GetNearestFontToDesignHeightInTwips((CFont *&)iFont, fspec));
-		TFontSpec fspec(KTestFontTypefaceName,17);
-		User::LeaveIfError(Client()->iScreen->GetNearestFontToDesignHeightInPixels((CFont *&)iFont, fspec));
-		AdjustShadow(1);
-		InitWin();
-		iSize=BaseWin()->Size();
-		}
-	User::LeaveIfError(ret);
-	}
-
-EXPORT_C void CTBaseWin::Activate()
-	{
-	BaseWin()->Activate();
-	}
-
-EXPORT_C void CTBaseWin::SetFullScreenExtL()
-	{
-	SetExtL(TPoint(0,0), Parent()->Size());
-	}
-
-EXPORT_C void CTBaseWin::SetDefaultExtL()
-	{
-	TSize size=Parent()->Size();
-	size.iWidth>>=1;
-	size.iHeight>>=1;
-	SetExtL(TPoint(size.iWidth>>1,size.iHeight>>1), size);
-	}
-
-EXPORT_C void CTBaseWin::AssignGC(CWindowGc &aGc)
-	{
-	iGc= &aGc;
-	}
-
-EXPORT_C void CTBaseWin::SetPos(const TPoint &aPos)
-	{
-	BaseWin()->SetPosition(aPos);
-	iPos=aPos;
-	}
-
-EXPORT_C void CTBaseWin::SetInitialPos(const TPoint &aPos)
-	{
-	TSize screen=Client()->iScreen->SizeInPixels();
-	TPoint pos(aPos);
-	TPoint botLeft=pos+iSize;
-	if (botLeft.iX>screen.iWidth)
-		pos.iX=Max(0,pos.iX-botLeft.iX+screen.iWidth);
-	if (botLeft.iY>screen.iHeight)
-		pos.iY=Max(0,pos.iY-botLeft.iY+screen.iHeight);
-	SetPos(pos);
-	}
-
-EXPORT_C void CTBaseWin::SetExtL(const TPoint &aPos, const TSize &aSize)
-	{
-	User::LeaveIfError(BaseWin()->SetExtentErr(aPos,aSize));
-	iPos=aPos;
-	iSize=aSize;
-	Resized(iSize);
-	}
-
-EXPORT_C void CTBaseWin::AdjustSizeL(TInt xMove,TInt yMove,TInt modifiers)
-	{
-	if (modifiers&EModifierCtrl)	// 4 times the movement
-		{
-		xMove<<=2;
-		yMove<<=2;
-		}
-	if (modifiers&EModifierShift)
-		{
-		TSize size(iSize.iWidth+xMove,iSize.iHeight+yMove);
-	
-		if (size.iWidth<0)
-			size.iWidth=0;
-		if (size.iHeight<0)
-			size.iHeight=0;
-		if (modifiers&EModifierCtrl)
-			{
-			TPoint pos(iPos);
-			pos.iX-=(xMove>>1);
-			pos.iY-=(yMove>>1);
-			SetExtL(pos,size);
-			}
-		else
-			SetSizeL(size);
-		}
-	else
-		SetPos(TPoint(iPos+TPoint(xMove,yMove)));
-	}
-
-EXPORT_C void CTBaseWin::SetSizeL(const TSize &aSize)
-	{
-	User::LeaveIfError(BaseWin()->SetSizeErr(aSize));
-	iSize=aSize;
-	Resized(iSize);
-	}
-
-EXPORT_C TSize CTBaseWin::Size() const
-	{
-	return(iSize);
-	}
-
-EXPORT_C void CTBaseWin::Resized(const TSize &aSize)
-//
-	{
-	SetDragRect(TRect(aSize));
-	}
-
-EXPORT_C TPoint CTBaseWin::Position() const
-	{
-	return(BaseWin()->Position());
-	}
-
-EXPORT_C void CTBaseWin::Delete(CTBaseWin *aWin)
-	{
-	RHeap& heap = User::Heap();
-	TUint8* base=heap.Base();
-	TInt size=heap.Size();
-	TUint8* cell=REINTERPRET_CAST(TUint8*,aWin);
-	__ASSERT_ALWAYS(base<=cell && cell<base+size, TbPanic(ETestBasePanicInvalidHeapAddress));
-	CTWinBase *tmp=aWin;
-	CTWinBase *win2;
-	CTBaseWin *curwin=NULL;
-	if (tmp->Group())
-		curwin=tmp->Group()->CurWin();
-	do
-		{
-		win2=tmp;
-		while((tmp=win2->Child())!=NULL)
-			win2=tmp;
-		if ((tmp=win2->NextSibling())==NULL)
-			tmp=win2->Parent();
-		if (curwin==win2)
-			((CTBaseWin *)win2)->RelinquishFocus();
-		delete win2;
-		} while(win2!=aWin);
-	}
-
-EXPORT_C void CTBaseWin::KeyUpL(const TKeyEvent &,const TTime&)
-	{
-	}
-
-EXPORT_C void CTBaseWin::KeyDownL(const TKeyEvent &,const TTime&)
-	{
-	}
-
-EXPORT_C void CTBaseWin::WinKeyL(const TKeyEvent &,const TTime&)
-	{
-	}
-
-EXPORT_C void CTBaseWin::PointerL(const TPointerEvent &aPointer,const TTime&)
-	{
-	if (iDragging)
-		{
-		if (aPointer.iType==TPointerEvent::EDrag)
-			SetPos(aPointer.iParentPosition-iDragPos);
-		else
-			iDragging=EFalse;
-		return;
-		}
-	if (aPointer.iType==TPointerEvent::EButton1Down)
-		{
-		if (aPointer.iModifiers&EModifierCtrl)
-			{
-			if (aPointer.iModifiers&EModifierShift)
-				BaseWin()->SetOrdinalPosition(-1);
-			else
-				BaseWin()->SetOrdinalPosition(0);
-			return;
-			}
-#if defined(__WINS__)
-		else if (aPointer.iModifiers&EModifierShift)
-			__DbgTestInvariant();
-#endif
-		else
-			{
-			Group()->SetCurrentWindow(this);
-			if (iDragRect.Contains(aPointer.iPosition))
-				{
-				iDragging=ETrue;
-				iDragPos=aPointer.iPosition;
-				return;
-				}
-			}
-		}
-	}
-
-EXPORT_C void CTBaseWin::DragDropL(const TPointerEvent &,const TTime &)
-	{
-	}
-
-EXPORT_C void CTBaseWin::AdjustOrdinal(TInt aAdjust)
-	{
-	TInt pos=BaseWin()->OrdinalPosition()+aAdjust;
-	if (pos>=0)
-		BaseWin()->SetOrdinalPosition(pos);
-	}
-
-EXPORT_C void CTBaseWin::AdjustShadow(TInt aAdjust)
-	{
-	iShadow+=aAdjust;
-	if (iShadow<0)
-		iShadow=0;
-	BaseWin()->SetShadowHeight(iShadow);
-	}
-
-EXPORT_C void CTBaseWin::DrawBorder()
-	{
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	iGc->DrawRect(TRect(iSize));
-	iGc->SetBrushStyle(CGraphicsContext::ENullBrush);
-	}
-
-EXPORT_C void CTBaseWin::SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc, TDisplayMode *aMode,TBool aVisible,TInt aTransparency)
-	{
-	ConstructL(*parent);
-	if (aMode)
-		BaseWin()->SetRequiredDisplayMode(*aMode);
-	SetExtL(pos,size);
-	if (!aVisible)
-		BaseWin()->SetVisible(aVisible);
-	if (aTransparency!=ENoTransparency)
-		{
-		TInt err=((RWindow*)(BaseWin()))->SetTransparencyFactor(TRgb::_Gray256(aTransparency));	
-		User::LeaveIfError(err);	//asked for transparency when not got none!
-		}
-	Activate();
-	AssignGC(aGc);
-	}
-
-EXPORT_C void CTBaseWin::SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc, TDisplayMode *aMode)
-	{
-	SetUpL(pos,size,parent,aGc,aMode,ETrue);
-	}
-
-EXPORT_C void CTBaseWin::SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc,TBool aVisible)
-	{
-	SetUpL(pos,size,parent,aGc,NULL,aVisible);
-	}
-
-EXPORT_C void CTBaseWin::SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc)
-	{
-	SetUpL(pos,size,parent,aGc,NULL,ETrue);
-	}
-
-EXPORT_C void CTBaseWin::SetDragRect(const TRect &aRect)
-	{
-	BaseWin()->PointerFilter(EPointerFilterDrag,0);	// Clear the drag filter
-	BaseWin()->SetPointerGrab(ETrue);
-	iDragRect=aRect;
-	}
-
-EXPORT_C CTWindowGroup *CTBaseWin::Group() const
-	{
-	return(iOwnerWin);
-	}
-
-EXPORT_C void CTBaseWin::FocusChanged(TBool )
-	{
-	}
-
-EXPORT_C CTBaseWin *CTBaseWin::Next()
-	{
-	CTWinBase *win;
-	CTWinBase *ret=Child();
-	if (ret==NULL)
-		{
-		win=this;
-		while((ret=win->NextSibling())==NULL)
-			{
-			ret=win;
-			win=win->Parent();
-			if (win==NULL)	// Group window
-				{
-				ret=ret->Child();
-				break;
-				}
-			}
-		}
-	return((CTBaseWin *)ret);
-	}
-
-EXPORT_C CTBaseWin *CTBaseWin::Prev()
-	{
-	CTWinBase *par=Parent();
-	CTWinBase *win;
-	CTWinBase *child;
-	if ((win=PrevSibling())==NULL)
-		{
-		if (par->iType==EWinTypeGroup)
-			{
-			CTWinBase *win2=par->Child();
-			do
-				{
-				win=win2;
-				while((win2=win->NextSibling())!=NULL)
-					win=win2;
-				win2=win->Child();
-				} while(win2!=NULL);
-			}
-		else
-			win=par;
-		}
-	else
-		{
-		child=win->Child();
-		while(child!=NULL)
-			{
-			win=child;
-			child=child->NextSibling();
-			}
-		}
-	return((CTBaseWin *)win);
-	}
-
-//EXPORT_C void CTBaseWin::SetDefaultExt()
-//	{
-//	TbPanic(ETestBasePanicUnimplementedBaseFunction);
-//	}
-
-EXPORT_C void CTBaseWin::Draw()
-	{
-	TbPanic(ETestBasePanicUnimplementedBaseFunction);
-	}
-
-EXPORT_C void CTBaseWin::__DbgTestInvariant() const
-	{
-	CTWinBase::__DbgTestInvariant();
-#if defined(__WINS__)
-	if (BaseWin()->Size()!=iSize)
-		User::Invariant();
-	TPoint offset;
-	const CTWinBase *win=this;
-	const CTWinBase *win2;
-	while((win2=win->Parent())!=NULL)
-		{
-		offset+=((CTBaseWin *)win)->BaseWin()->Position();
-		if (BaseWin()->InquireOffset(*(win2->WinTreeNode()))!=offset)
-			User::Invariant();
-		win=win2;
-		}
-#endif
-	}
-
-//CTDrawableWin//
-//	Drawable window					   //
-//
-
-EXPORT_C CTDrawableWin::CTDrawableWin(TInt aType) : CTBaseWin(aType)
-	{
-	__DECLARE_NAME(_S("CTDrawableWin"));
-	}
-
-//CTWin//
-//	Standard client window					   //
-//
-
-EXPORT_C CTWin::CTWin() : CTDrawableWin(EWinTypeClient)
-	{
-	__DECLARE_NAME(_S("CTWin"));
-	}
-
-EXPORT_C CTWin::~CTWin()
-	{
-	if (iFont)
-		Client()->iScreen->ReleaseFont(iFont);
-	iWin.Close();
-	}
-
-EXPORT_C TInt CTWin::ConstructWin(const CTWinBase &aParent)
-	{
-	iWin=RWindow(aParent.Client()->iWs);
-	return(iWin.Construct(*(aParent.WinTreeNode()),(TUint32)this));
-	}
-
-EXPORT_C void CTWin::SetDefaultExt()
-	{
-	TSize size=Parent()->Size();
-	size.iWidth>>=1;
-	size.iHeight>>=1;
-	SetExt(TPoint(size.iWidth>>1,size.iHeight>>1), size);
-	Invalidate();
-	}
-
-EXPORT_C void CTWin::SetExt(const TPoint &aPos, const TSize &aSize)
-	{
-	iWin.SetExtent(aPos,aSize);
-	iPos=aPos;
-	iSize=aSize;
-	Resized(iSize);
-	}
-
-EXPORT_C void CTWin::SetSize(const TSize &aSize)
-	{
-	iWin.SetSize(aSize);
-	iSize=aSize;
-	Resized(iSize);
-	}
-
-EXPORT_C void CTWin::AdjustSize(TInt xMove,TInt yMove,TInt modifiers)
-	{
-	if (modifiers&EModifierCtrl)	// 4 times the movement
-		{
-		xMove<<=2;
-		yMove<<=2;
-		}
-	if (modifiers&EModifierShift)
-		{
-		TSize size(iSize.iWidth+xMove,iSize.iHeight+yMove);
-	
-		if (size.iWidth<0)
-			size.iWidth=0;
-		if (size.iHeight<0)
-			size.iHeight=0;
-		if (modifiers&EModifierCtrl)
-			{
-			TPoint pos(iPos);
-			pos.iX-=(xMove>>1);
-			pos.iY-=(yMove>>1);
-			SetExt(pos,size);
-			}
-		else
-			SetSize(size);
-		Invalidate();
-		}
-	else
-		SetPos(TPoint(iPos+TPoint(xMove,yMove)));
-	}
-
-EXPORT_C RWindowBase *CTWin::BaseWin()
-	{
-	return((RWindowBase *)&iWin);
-	}
-
-EXPORT_C const RWindowBase *CTWin::BaseWin() const
-	{
-	return((const RWindowBase *)&iWin);
-	}
-
-EXPORT_C RDrawableWindow *CTWin::DrawableWin()
-	{
-	return((RDrawableWindow *)&iWin);
-	}
-
-EXPORT_C const RDrawableWindow *CTWin::DrawableWin() const
-	{
-	return((const RDrawableWindow *)&iWin);
-	}
-
-
-EXPORT_C void CTWin::Invalidate()
-	{
-	iWin.Invalidate();
-	}
-
-EXPORT_C void CTWin::Invalidate(const TRect &rect)
-	{
-	iWin.Invalidate(rect);
-	}
-
-EXPORT_C void CTWin::DrawNow()
-	{
-	iWin.Invalidate();
-	iWin.BeginRedraw();
-	iGc->Activate(iWin);
-	iGc->UseFont((CFont *)iFont);
-	Draw();
-	iGc->Deactivate();
-	iWin.EndRedraw();
-	}
-
-EXPORT_C void CTWin::Redraw()
-	{
-	iWin.BeginRedraw();
-	iGc->Activate(iWin);
-	iGc->UseFont((CFont *)iFont);
-	Draw();
-	iGc->Deactivate();
-	iWin.EndRedraw();
-	}
-
-EXPORT_C void CTWin::Redraw(const TRect &aRect)
-	{
-	iWin.BeginRedraw(aRect);
-	iGc->Activate(iWin);
-	iGc->UseFont((CFont *)iFont);
-	Draw();
-	iGc->Deactivate();
-	iWin.EndRedraw();
-	}
-
-//CTBackedUpWin//
-//	Backed up window						   //
-//
-
-EXPORT_C CTBackedUpWin::CTBackedUpWin(TDisplayMode aDisplayMode) : CTDrawableWin(EWinTypeClient), iDisplayMode(aDisplayMode)
-	{
-	__DECLARE_NAME(_S("CTBackedUpWin"));
-	}
-
-EXPORT_C CTBackedUpWin::~CTBackedUpWin()
-	{
-	if (iFont)
-		Client()->iScreen->ReleaseFont(iFont);
-	iWin.Close();
-	}
-
-EXPORT_C TInt CTBackedUpWin::ConstructWin(const CTWinBase &aParent)
-	{
-	iWin=RBackedUpWindow(aParent.Client()->iWs);
-	return(iWin.Construct(*(aParent.WinTreeNode()), iDisplayMode, (TUint32)this));
-	}
-
-EXPORT_C RWindowBase *CTBackedUpWin::BaseWin()
-	{
-	return((RWindowBase *)&iWin);
-	}
-
-EXPORT_C const RWindowBase *CTBackedUpWin::BaseWin() const
-	{
-	return((const RWindowBase *)&iWin);
-	}
-
-EXPORT_C RDrawableWindow *CTBackedUpWin::DrawableWin()
-	{
-	return((RDrawableWindow *)&iWin);
-	}
-
-EXPORT_C const RDrawableWindow *CTBackedUpWin::DrawableWin() const
-	{
-	return((const RDrawableWindow *)&iWin);
-	}
-
-EXPORT_C RBackedUpWindow *CTBackedUpWin::BackedUpWin()
-	{
-	return &iWin;
-	}
-
-EXPORT_C const RBackedUpWindow *CTBackedUpWin::BackedUpWin() const
-	{
-	return &iWin;
-	}
-
-//CTTitledWindow//
-
-EXPORT_C CTTitledWindow::CTTitledWindow() : CTWin(), iWinColor(TRgb(255,255,255)), iPenColor(TRgb(0,0,0))
-	{
-	__DECLARE_NAME(_S("CTTitledWin"));
-	}
-
-EXPORT_C CTTitledWindow::~CTTitledWindow()
-	{
-	}
-
-EXPORT_C void CTTitledWindow::ConstructL(CTWinBase &parent)
-	{
-	CTBaseWin::ConstructL(parent);
-	iTitleHeight=iFont->HeightInPixels()+4;
-	if (iTitle.Length()==0)
-		SetTitle(*Client()->Title());
-	}
-
-EXPORT_C void CTTitledWindow::SetColor(TRgb aRgb)
-	{
-	iWinColor=aRgb;
-	iWin.SetBackgroundColor(aRgb);
-	}
-
-EXPORT_C void CTTitledWindow::Resized(const TSize &aSize)
-	{
-	SetDragRect(TRect(0,0,aSize.iWidth,iTitleHeight));
-	}
-
-EXPORT_C void CTTitledWindow::SetTitle(const TWindowTitle &aTitle)
-	{
-	iTitle=aTitle;
-	}
-
-EXPORT_C void CTTitledWindow::Draw()
-	{
-	iGc->SetPenColor(iPenColor);
-	iGc->SetBrushColor(iWinColor);
-	DrawBorder();
-	iGc->DrawLine(TPoint(0,iTitleHeight),TPoint(iSize.iWidth,iTitleHeight));
-	if (Group()->HasFocus(this))
-		{
-		iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-		iGc->SetPenColor(~iPenColor);
-		iGc->SetBrushColor(~iWinColor);
-		}
-	iGc->DrawText(iTitle, TRect(1,1,iSize.iWidth-1,iTitleHeight),iFont->AscentInPixels()+1,CGraphicsContext::ECenter);
-	iGc->SetPenColor(iPenColor);
-	iGc->SetBrushColor(iWinColor);
-	}
-
-EXPORT_C void CTTitledWindow::FocusChanged(TBool )
-	{
-	iWin.Invalidate(TRect(0,0,iSize.iWidth,iTitleHeight));
-	}
-
-// CTBlankWindow //
-
-EXPORT_C CTBlankWindow::CTBlankWindow() : CTBaseWin(EWinTypeClient)
-	{
-	__DECLARE_NAME(_S("CTBlankWin"));
-	}
-
-EXPORT_C void CTBlankWindow::ConstructL(CTWinBase &aParent)
-	{
-	CTBaseWin::ConstructL(aParent);
-	}
-
-EXPORT_C CTBlankWindow::~CTBlankWindow()
-	{
-	if (iFont)
-		Client()->iScreen->ReleaseFont(iFont);
-	iWin.Close();
-	}
-
-EXPORT_C void CTBlankWindow::SetExt(const TPoint &aPos, const TSize &aSize)
-	{
-	iWin.SetExtent(aPos,aSize);
-	iPos=aPos;
-	iSize=aSize;
-	Resized(iSize);
-	}
-
-EXPORT_C void CTBlankWindow::SetSize(const TSize &aSize)
-	{
-	iWin.SetSize(aSize);
-	iSize=aSize;
-	Resized(iSize);
-	}
-
-EXPORT_C void CTBlankWindow::SetColor(const TRgb &aRgb)
-	{
-	iWin.SetColor(aRgb);
-	}
-
-EXPORT_C TInt CTBlankWindow::ConstructWin(const CTWinBase &aParent)
-	{
-	iWin=RBlankWindow(aParent.Client()->iWs);
-	return(iWin.Construct(*(aParent.WinTreeNode()),(TUint32)this));
-	}
-
-EXPORT_C const RWindowBase *CTBlankWindow::BaseWin() const
-	{
-	return((const RWindowBase *)&iWin);
-	}
-
-EXPORT_C RWindowBase *CTBlankWindow::BaseWin()
-	{
-	return((RWindowBase *)&iWin);
-	}
-
-//CTWindowGroup//
-
-EXPORT_C CTWindowGroup::CTWindowGroup(CTClient *aClient) : CTWinBase(EWinTypeGroup), iGroupWin(aClient->iWs)
-	{
-	__DECLARE_NAME(_S("CTWindowGroup"));
-	iClient=aClient;
-	iOwnerWin=this;
-	}
-
-EXPORT_C CTWindowGroup::~CTWindowGroup()
-	{
-	iGroupWin.Close();
-	}
-
-EXPORT_C const RWindowTreeNode *CTWindowGroup::WinTreeNode() const
-	{
-	return((const RWindowTreeNode *)&iGroupWin);
-	}
-
-EXPORT_C RWindowTreeNode *CTWindowGroup::WinTreeNode()
-	{
-	return((RWindowTreeNode *)&iGroupWin);
-	}
-
-EXPORT_C void CTWindowGroup::ConstructL()
-	{
-	User::LeaveIfError(iGroupWin.Construct((TUint32)this));
-	}
-
-EXPORT_C TSize CTWindowGroup::Size() const
-	{
-	return(iClient->iScreen->SizeInPixels());
-	}
-
-EXPORT_C void CTWindowGroup::WinKeyL(const TKeyEvent &,const TTime&)
-	{
-	}
-
-EXPORT_C void CTWindowGroup::KeyL(const TKeyEvent &aKey,const TTime&aTime)
-	{
-	if (iCurWin)
-		iCurWin->WinKeyL(aKey,aTime);
-	}
-
-EXPORT_C void CTWindowGroup::KeyUpL(const TKeyEvent &,const TTime&)
-	{
-	}
-
-EXPORT_C void CTWindowGroup::KeyDownL(const TKeyEvent &,const TTime&)
-	{
-	}
-
-EXPORT_C void CTWindowGroup::ClearCurrentWindow()
-	{
-	iCurWin=NULL;
-	}
-
-EXPORT_C void CTWindowGroup::SetCurrentWindow(CTBaseWin *aWindow)
-	{
-	SetCurrentWindow(aWindow, EFalse);
-	}
-
-EXPORT_C void CTWindowGroup::SetCurrentWindow(CTBaseWin *aWindow, TBool aLocked)
-	{
-	if (iCurWin!=aWindow)
-		{
-		if (iFocus && iCurWin)
-			iCurWin->FocusChanged(EFalse);
-		iCurWin=aWindow;
-		if (iFocus && iCurWin)
-			iCurWin->FocusChanged(ETrue);
-		}
-	iLocked=aLocked;
-	}
-
-EXPORT_C CTBaseWin *CTWindowGroup::CurWin(void) const
-	{
-	return(iCurWin);
-	}
-
-EXPORT_C void CTWindowGroup::FocusLost()
-	{
-	iFocus=EFalse;
-	if (iCurWin)
-		iCurWin->FocusChanged(EFalse);
-	}
-
-EXPORT_C void CTWindowGroup::FocusGained()
-	{
-	iFocus=ETrue;
-	if (iCurWin)
-		iCurWin->FocusChanged(ETrue);
-	}
-
-EXPORT_C TBool CTWindowGroup::HasFocus(CTBaseWin *aWin) const
-	{
-	return(iFocus && iCurWin==aWin);
-	}
-
-EXPORT_C CTClient *CTWindowGroup::Client() const
-	{
-	return(iClient);
-	}
-
-EXPORT_C CTWindowGroup *CTWindowGroup::Group() const
-	{
-	return((CTWindowGroup *)this);
-	}
-
-EXPORT_C void CTWindowGroup::PasswordL(const TTime &)
-	{
-	TbPanic(ETestBasePanicPassword);
-	}
-
-EXPORT_C void CTWindowGroup::MessageReady(const TWsEvent &)
-//
-// Dummy handler for un-exepected messages (could panic, but better not as the app sending the messages fault really not ours)
-//
-	{
-	}
-
-EXPORT_C void CTWindowGroup::ScreenDeviceChanged()
-	{
-	TPixelsAndRotation sizeAndRotation;
-	Client()->iScreen->GetDefaultScreenSizeAndRotation(sizeAndRotation);
-	Client()->iScreen->SetScreenSizeAndRotation(sizeAndRotation);
-	}
-
-EXPORT_C void CTWindowGroup::UserEvent(TInt /*aEventType*/)
-	{
-	}
-
-
-// CTClient //
-
-EXPORT_C CTClient::CTClient()
-	{
-	__DECLARE_NAME(_S("CTClient"));
-	}
-
-EXPORT_C void CTClient::DestroyWindows()
-	{
-	if (iGroup)
-		{
-		CTBaseWin *win;
-		if (iGroup->GroupWin()->WsHandle()!=0)	// Check it was created okay
-			while((win=iGroup->Child())!=NULL && ((TUint)win)!=ENullWsHandle)
-				CTBaseWin::Delete(win);
-		delete iGroup;
-		iGroup=NULL;
-		}
-	}
-
-EXPORT_C CTClient::~CTClient()
-	{
-	DestroyWindows();
-	delete iGc;
-	delete iEventHandler;
-	delete iRedrawEventHandler;
-	delete iScreen;
-	TInt count=iWs.ResourceCount();
-	__ASSERT_ALWAYS(count==0,TbPanic(ETestBasePanicResourceCount));
-	iWs.Close();
-	}
-
-EXPORT_C void CTClient::ConstructEventHandlerL()
-	{
-	iEventHandler=new(ELeave) CTEvent(&iWs);
-	iEventHandler->Construct();
-	}
-
-EXPORT_C void CTClient::ConstructL()
-	{
-	User::LeaveIfError(iWs.Connect());
-	iScreen=new(ELeave) CWsScreenDevice(iWs);
-	User::LeaveIfError(iScreen->Construct(iScreenNumber));
-	iRedrawEventHandler=new(ELeave) CTRedraw(&iWs);
-	iRedrawEventHandler->Construct();
-	ConstructEventHandlerL();
-	iGc=new(ELeave) CWindowGc(iScreen);
-	User::LeaveIfError(iGc->Construct());
-	iTitle.Copy(RThread().FullName());
-	}
-
-EXPORT_C void CTClient::ResetFocus()
-	{
-	iGroup->ClearCurrentWindow();
-	iGroup->SetCurrentWindow(iGroup->Child());
-	}
-
-EXPORT_C TWindowTitle *CTClient::Title()
-	{
-	return(&iTitle);
-	}
-
-EXPORT_C TBool CTClient::QueueRead()
-	{
-	TBool ret=iEventHandler->IsActive();
-	if (ret==EFalse)
-		iEventHandler->Request();
-	return(ret);
-	}
-
-EXPORT_C void CTClient::CancelRead()
-	{
-	iEventHandler->Cancel();
-	}
-
-EXPORT_C void CTClient::SetCancelFunction(const TCallBack &aCallBack)
-	{
-	iEventHandler->SetCancelFunction(aCallBack);
-	}
-
-EXPORT_C void CTClient::CancelRedrawRead()
-	{
-	iRedrawEventHandler->Cancel();
-	}
-
-EXPORT_C void CTClient::SetRedrawCancelFunction(const TCallBack &aCallBack)
-	{
-	iRedrawEventHandler->SetCancelFunction(aCallBack);
-	}
-
-EXPORT_C void CTClient::RequestRedraw()
-	{
-	iRedrawEventHandler->Request();
-	}
-
-EXPORT_C void CTClient::LogMessage(const TLogMessageText &aMessage)
-	{
-	iWs.LogMessage(aMessage);
-	iWs.Flush();
-	}
-
-EXPORT_C TBool CTClient::IsEventWaiting()
-	{
-	iWs.NumWindowGroups();		//Make sure all asyncronus calls have finished
-	return (iEventHandler->iStatus!=KRequestPending);
-	}
-
-TBool CTClient::WaitUntilEventPending(const TRequestStatus& aStatus)
-	{
-	if (aStatus!=KRequestPending)
-		return ETrue;
-	User::After(2000000);		//Need something smarter than this
-	return (aStatus!=KRequestPending);
-	}
-
-EXPORT_C TBool CTClient::WaitUntilRedrawPending()
-	{
-	return WaitUntilEventPending(iRedrawEventHandler->iStatus);
-	}
-
-EXPORT_C TBool CTClient::WaitUntilEventPending()
-	{
-	return WaitUntilEventPending(iEventHandler->iStatus);
-	}
-
-EXPORT_C TInt CTClient::WaitForRedrawsToFinish()
-	{
-	return WaitForEventsToFinish(EFalse);
-	}
-
-EXPORT_C TInt CTClient::WaitForAllEventProcessingToFinish()
-	{
-	return WaitForEventsToFinish(ETrue);
-	}
-
-TInt CTClient::WaitForEventsToFinish(TBool aAll)
-	{
-	CStopTheScheduler* stop=new CStopTheScheduler(this,ETlibRedrawActivePriority-1,aAll);
-	if (!stop)
-		return KErrNoMemory;
-	stop->Call();
-	CActiveScheduler::Start();
-	delete stop;
-	return KErrNone;
-	}
-
-
-// CStopTheScheduler //
-
-void CStopTheScheduler::RunL()
-	{
-#ifdef __WINS__
-	RDebug::Print(_L("CStopTheScheduler::RunL - enter - %d"), iCStopTheSchedulerRunCount);
-#endif
-	if (iClient)
-	    {
-		iClient->iWs.NumWindowGroups();		//Make sure all asyncronus calls have finished
-	    }
-	
-	if (!iClient || (iClient->RedrawHandler()->iStatus==KRequestPending && (!iAll || iClient->EventHandler()->iStatus==KRequestPending)))
-	    {
-#ifdef __WINS__
-	    RDebug::Print(_L("CStopTheScheduler::RunL - Stop - %d"), iCStopTheSchedulerRunCount);
-#endif
-	    CActiveScheduler::Stop();
-	    }
-	else
-	    {  
-#ifdef __WINS__
-	    RDebug::Print(_L("CStopTheScheduler::RunL - Call - %d"), iCStopTheSchedulerRunCount);
-#endif
-	    Call();
-	    }
-#ifdef __WINS__
-    RDebug::Print(_L("CStopTheScheduler::RunL - exit - %d"), iCStopTheSchedulerRunCount);
-    iCStopTheSchedulerRunCount++;
-#endif
-	}
-
-void WaitForRedrawsToFinish()
-	{
-	CStopTheScheduler* ps=new CStopTheScheduler(ETlibRedrawActivePriority-1);
-	if(ps)
-		{
-		ps->Call();
-		CActiveScheduler::Start();
-		delete ps;
-		}
-	}
-
-
-// CTEventBase //
-
-EXPORT_C CTEventBase::CTEventBase(RWsSession *aWs, TInt aPriority) : CActive(aPriority), iWs(aWs)
-	{
-	}
-
-EXPORT_C CTEventBase::~CTEventBase()
-	{
-	}
-
-EXPORT_C void CTEventBase::Construct()
-	{
-	CActiveScheduler::Add(this);
-	Request();
-	}
-
-EXPORT_C void CTEventBase::RunL()
-	{
-	if (iStatus==KErrNone)
-		{
-		++iCount;
-		TRAPD(err,doRunL());
-		if (err<=0)	// Positive value means this has been destroyed
-			{
-			if (iCancelRequested)
-				CancelHandler();
-			Request();
-//			if (err!=KErrNone)
-//				User::LeaveIfError(err); Should have a guaranteed to work error dialog here I guess
-			}
-		}
-	else if (iStatus==KErrCancel && iCancelRequested)
-		{
-		CancelHandler();
-		Request();
-		}
-	else
-		TbPanic(ETestBasePanicEventStat);
-	}
-
-void CTEventBase::SetCancelFunction(const TCallBack &aCallBack)
-	{
-	if (!IsActive() && iCancelRequested)
-		TbPanic(ETestBasePanicCancelFunction);
-	iCancelCallBack=aCallBack;
-	iCancelRequested=ETrue;
-	DoCancel();
-	}
-
-EXPORT_C void CTEventBase::CancelHandler()
-	{
-	iCancelCallBack.CallBack();
-	iCancelRequested=EFalse;
-	}
-
-// TLibWsEvent //
-
-EXPORT_C CTWindowGroup *TlibWsEvent::WindowGroup()
-	{
-	CTWindowGroup *group=(CTWindowGroup *)Handle();
-	__ASSERT_DEBUG(group->iType==EWinTypeGroup,TbPanic(ETestBasePanicWinType));
-	return(group);
-	}
-
-EXPORT_C CTBaseWin *TlibWsEvent::BaseWin()
-	{
-	CTBaseWin *win=(CTBaseWin *)Handle();
-	__ASSERT_DEBUG(win->iType==EWinTypeClient || win->iType==EWinTypeGroup,TbPanic(ETestBasePanicWinType));
-	return(win);
-	}
-
-// CTEvent //
-
-EXPORT_C CTEvent::CTEvent(RWsSession *aWs) : CTEventBase(aWs, ETlibWsEventActivePriority)
-	{
-	__DECLARE_NAME(_S("CTEvent"));
-	}
-
-EXPORT_C CTEvent::~CTEvent()
- 	{
-	Cancel();
-	}
-
-EXPORT_C void CTEvent::DoCancel()
-	{
-	iWs->EventReadyCancel();
-	}
-
-EXPORT_C void CTEvent::Request()
-	{
-	iWs->EventReady(&iStatus);
-	SetActive();
-	}
-
-EXPORT_C void CTEvent::LogEvent(const TWsEvent &)
-	{
-	}
-
-EXPORT_C void CTEvent::doRunL()
-	{
-	TlibWsEvent event;
-	
-	iWs->GetEvent(event);
-	LogEvent(event);
-	if (event.Handle()!=0 && event.Handle()!=ENullWsHandle)
-		{
-		switch(event.Type())
-			{
-			case EEventKey:
-				event.WindowGroup()->KeyL(*event.Key(),event.Time());
-				break;
-			case EEventKeyDown:
-				__ASSERT_ALWAYS(event.Key()->iCode==0 && event.Key()->iRepeats==0, TbPanic(ETestBasePanicKeyParams));
-				event.WindowGroup()->KeyDownL(*event.Key(),event.Time());
-				break;
-			case EEventKeyUp:
-				__ASSERT_ALWAYS(event.Key()->iCode==0 && event.Key()->iRepeats==0, TbPanic(ETestBasePanicKeyParams));
-				event.WindowGroup()->KeyUpL(*event.Key(),event.Time());
-				break;
-			case EEventModifiersChanged:
-				event.BaseWin()->ModifiersChanged(*event.ModifiersChanged(),event.Time());
-				break;
-			case EEventPointer:
-				event.BaseWin()->PointerL(*event.Pointer(),event.Time());
-				break;
-			case EEventDragDrop:
-				event.BaseWin()->DragDropL(*event.Pointer(),event.Time());
-				break;
-			case EEventPointerEnter:
-				event.BaseWin()->PointerEnter(event.Time());
-				break;
-			case EEventPointerExit:
-				event.BaseWin()->PointerExit(event.Time());
-				break;
-			case EEventPointerBufferReady:
-				event.BaseWin()->PointerBufferReady(event.Time());
-				break;
-			case EEventSwitchOn:
-				event.BaseWin()->SwitchOn(event.Time());
-				break;
-			case EEventFocusLost:
-				event.WindowGroup()->FocusLost();
-				break;
-			case EEventFocusGained:
-				event.WindowGroup()->FocusGained();
-				break;
-			case EEventPassword:
-				event.WindowGroup()->PasswordL(event.Time());
-				break;
-			case EEventMessageReady:
-				event.WindowGroup()->MessageReady(event);
-				break;
-			case EEventErrorMessage:
-				event.WindowGroup()->ErrorMessage(*event.ErrorMessage(), event.Time());
-				break;
-			case EEventSwitchOff:
-			case EEventKeySwitchOff:
-				{
-				TTimeIntervalMicroSeconds32 ii=1000000;
-				User::After(ii);			//WINS does not always work without this!
-				UserHal::SwitchOff();
-				}
-				break;
-			case EEventScreenDeviceChanged:
-				event.WindowGroup()->ScreenDeviceChanged();
-				break;
-			case EEventNull:
-				break;
-			default:
-				if (event.Type()>=EEventUser)
-					{
-					event.WindowGroup()->UserEvent(event.Type());
-					break;
-					}
-				else
-					{
-					//if not in BufferSecurity test - panic
-					TInt value = EFalse;
-					TInt err = RProperty::Get(KUidWServSecurityTesting,EWServSecTestBufferSecurity,value);
-					if ((err != KErrNone) || (value != (TInt)ETrue))
-						TbPanic(ETestBasePanicInvalidEvent);
-					}
-				break;
-			}
-		}
-	}
-
-EXPORT_C CTRedraw::CTRedraw(RWsSession *aWs) : CTEventBase(aWs, ETlibRedrawActivePriority)
-	{
-	__DECLARE_NAME(_S("CTRedraw"));
-	}
-
-EXPORT_C CTRedraw::~CTRedraw()
-	{
-	Cancel();
-	}
-
-EXPORT_C void CTRedraw::Request()
-	{
-	iWs->RedrawReady(&iStatus);
-	SetActive();
-	}
-
-EXPORT_C void CTRedraw::DoCancel()
-	{
-	iWs->RedrawReadyCancel();
-	}
-
-EXPORT_C void CTRedraw::doRunL()
-	{
-	TWsRedrawEvent redraw;
-	iWs->GetRedraw(redraw);
-	if (redraw.Handle()!=0 && redraw.Handle()!=ENullWsHandle)
-		{
-		__ASSERT_ALWAYS(!redraw.Rect().IsEmpty(),TbPanic(ETestBasePanicNullRedraw));
-		((CTWin *)redraw.Handle())->Redraw(redraw.Rect());
-		}
-	}
-
-EXPORT_C void CTUser::Splat(CTClient *aClient, const TRect &aRect, const TRgb &aRgb)
-	{
-	RBlankWindow win(aClient->iWs);
-	win.Construct(*(aClient->iGroup->WinTreeNode()),1);
-	win.SetColor(aRgb);
-	win.SetExtent(aRect.iTl,aRect.Size());
-	win.Activate();
-	aClient->iWs.Flush();
-	win.Close();
-	}
-
-void doTestLibStartUpL(TInt aScreenNumber, CTClient *&aClient, CActiveScheduler *&aActiveScheduler,CTrapCleanup *&aCleanUpStack,TCreateClientFunc aFunc)
-	{
-	User::LeaveIfNull(aCleanUpStack=CTrapCleanup::New());
-	aActiveScheduler=new(ELeave) CActiveScheduler;
-	CActiveScheduler::Install(aActiveScheduler);
-	aClient=aFunc();
-	aClient->SetScreenNumber(aScreenNumber);
-	aClient->ConstructL();
-	CActiveScheduler::Start();
-	}
-
-EXPORT_C TInt TestLibStartUp(TCreateClientFunc aFunc,TInt aScreenNumber)
-	{
-	__UHEAP_MARK;
-	CTrapCleanup* cleanUpStack=NULL;
-	CActiveScheduler *activeScheduler=NULL;
-	CTClient *client=NULL;
-	TRAPD(err,doTestLibStartUpL(aScreenNumber, client,activeScheduler,cleanUpStack,aFunc));
-	delete client;
-	delete activeScheduler;
-	delete cleanUpStack;
-	__UHEAP_MARKEND;
-	return(err);
-	}
-
-EXPORT_C TInt TestLibStartUp(TCreateClientFunc aFunc)
-	{
-	return TestLibStartUp(aFunc, KDefaultScreen);
-	}
-
--- a/windowing/windowserver/tlib/TLDIALOG.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,463 +0,0 @@
-// Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Base classes used for building window server test code
-// 
-//
-
-#include <e32std.h>
-#include <w32std.h>
-#include <e32svr.h>
-#include <e32def_private.h>
-#include "TLIB.H"
-
-const TInt ButtonGap=20;
-const TInt ButtonBorderGap=10;
-const TInt ButtonBorderMargin=3;
-const TInt TextMargin=5;
-const TInt KAutoDelaySeconds=60; 
-
-NONSHARABLE_CLASS(CTAutoKey): public CActive
-	{
-public:
-	static CTAutoKey* NewL(RWsSession& aWs);
-	~CTAutoKey();
-	void Activate(TInt aDelay);
-	
-	void RunL();
-	void DoCancel();
-	
-private:
-	CTAutoKey(RWsSession& aWs);
-	void ConstructL();	
-	
-	RTimer iTimer;
-	TInt iDelay;
-	RWsSession& iWs;
-	};
-
-EXPORT_C CTDialog::CTDialog() : CTTitledWindow(), iNumButtons(1)
-	{
-	iButton[0].Copy(_L("Continue"));	// Default button
-	}
-
-EXPORT_C CTDialog::~CTDialog()
-	{
-	if (iIsActive)
-		CActiveScheduler::Stop();
-	delete iAutoKey;
-	}
-
-EXPORT_C void CTDialog::ConstructLD(CTWinBase &aParent,CWindowGc &aGc)
-	{
-	iOldFocus=aParent.Group()->CurWin();
-	TRAPD(err,CTTitledWindow::ConstructL(aParent));
-	if (err!=KErrNone)
-		{
-		delete this;
-		User::Leave(err);
-		}
-	iActivated=ETrue;
-	iWin.SetBackgroundColor(TRgb::Gray256(238));	// Light gray
-	AssignGC(aGc);
-	iWin.SetPointerCapture(ETrue);
-	Group()->SetCurrentWindow(this, ETrue);
-	iAutoKey=CTAutoKey::NewL(Client()->iWs);
-	}
-
-EXPORT_C void CTDialog::RelinquishFocus()
-	{
-	Group()->SetCurrentWindow(iOldFocus);
-	}
-
-EXPORT_C TInt CTDialog::Display()
-	{
-	TInt result;
-
-	SetWindowSize();
-	if (iWinActive)
-		BaseWin()->SetVisible(ETrue);
-	else
-		{
-		Activate();
-		iWinActive=ETrue;
-		}
-	if (iTakeFocus)
-		Group()->SetCurrentWindow(this);
-	Group()->GroupWin()->SetOrdinalPosition(0);
-	iResultPtr=&result;
-	CTClient *client=Client();
-	if (client->QueueRead())
-		{
-		client->iWs.Flush();
-		client=NULL;
-		}
-	iIsActive=ETrue;
-	iAutoKey->Activate(KAutoDelaySeconds);
-	CActiveScheduler::Start();
-	if (client)
-		client->CancelRead();
-	return(result);
-	}
-
-EXPORT_C void CTDialog::SetFlags(TUint aFlags)
-	{
-	iFlags=aFlags;
-	}
-
-void CTDialog::SetMaxWid(TInt &aMax, TInt aWid)
-	{
-	if (aWid>aMax)
-		aMax=aWid;
-	}
-
-EXPORT_C void CTDialog::SetWindowSize()
-	{
-	if (iActivated)
-		{
-		TInt max=0;
-		SetMaxWid(max,iFont->TextWidthInPixels(iTitle));
-		SetMaxWid(max,iFont->TextWidthInPixels(iLine1));
-		SetMaxWid(max,iFont->TextWidthInPixels(iLine2));
-		max+=TextMargin*2;
-		iButWid=0;
-		if (iNumButtons>0)
-			{
-			for(TInt index=0;index<iNumButtons;index++)
-				SetMaxWid(iButWid,iFont->TextWidthInPixels(iButton[index]));
-			iButWid+=ButtonBorderMargin*2;
-			SetMaxWid(max,iButWid*iNumButtons+ButtonGap*(iNumButtons-1)+ButtonBorderGap*2);
-			}
-		TSize parSize=Parent()->Size();
-		TSize size(max,iFont->HeightInPixels()*8);
-		TPoint pos((parSize.iWidth-size.iWidth)/2,(parSize.iHeight-size.iHeight)/2);
-		if (iFlags&EDialogDisplayAtBottom)
-			pos.iY*=2;
-		if (iFlags&EDialogDisplayAtLeft)
-			pos.iX=0;
-		SetExt(pos,size);
-		Invalidate();
-		}
-	}
-
-EXPORT_C void CTDialog::SetLine1(const TDesC &aLine1)
-	{
-	iLine1.Copy(aLine1);
-	}
-
-EXPORT_C void CTDialog::SetLine2(const TDesC &aLine2)
-	{
-	iLine2.Copy(aLine2);
-	}
-
-EXPORT_C void CTDialog::SetNumButtons(TInt aNum)
-	{
-	if ((TUint)aNum>3)
-		TbPanic(EDialogButtonCount);
-	iNumButtons=aNum;
-	}
-
-EXPORT_C void CTDialog::SetButtonText(TInt aNum,const TDesC &aButton)
-	{
-	if ((TUint)aNum>(TUint)iNumButtons)
-		TbPanic(EDialogButtonIndex);
-	iButton[aNum].Copy(aButton);
-	}
-
-TRect CTDialog::ButtonRect(TInt aIndex) const
-	{
-	TInt chunk=(iSize.iWidth-ButtonBorderMargin*2)/iNumButtons;
-	TInt midPos=ButtonBorderMargin+chunk*aIndex+chunk/2;
-	return(TRect(midPos-iButWid/2,iFont->HeightInPixels()*6,midPos+iButWid/2,iFont->HeightInPixels()*7+ButtonBorderMargin*2));
-	}
-
-EXPORT_C void CTDialog::Draw()
-	{
-	CTTitledWindow::Draw();
-	iGc->SetPenColor(TRgb::Gray16(0));
-	iGc->DrawText(iLine1, TPoint((iSize.iWidth-iFont->TextWidthInPixels(iLine1))/2,iFont->HeightInPixels()*3));
-	iGc->DrawText(iLine2, TPoint((iSize.iWidth-iFont->TextWidthInPixels(iLine2))/2,iFont->HeightInPixels()*4+2));
-	if (iNumButtons!=0)
-		{
-		for(TInt index=0;index<iNumButtons;index++)
-			{
-			TRect rect=ButtonRect(index);
-			iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-			iGc->SetBrushColor(TRgb::Gray256(255));
-			iGc->DrawRect(rect);
-			iGc->DrawRect(rect);
-			iGc->SetBrushStyle(CGraphicsContext::ENullBrush);
-			TInt midPos=(rect.iTl.iX+rect.iBr.iX)/2;
-			iGc->DrawText(iButton[index], TPoint((midPos-iFont->TextWidthInPixels(iButton[index])/2),
-									iFont->HeightInPixels()*6+iFont->AscentInPixels()+ButtonBorderMargin));
-			}
-		}
-	}
-
-EXPORT_C void CTDialog::WinKeyL(const TKeyEvent &aKey,const TTime&)
-	{
-	switch(aKey.iCode)
-		{
-		case EKeyEscape:
-		case '0':
-			ButtonPressL(0);
-			break;
-		case EKeyEnter:
-		case '1':
-			ButtonPressL(iNumButtons>1 ? 1 : 0);	// Same as ESC on a single button dialog
-			break;
-		case ' ':
-		case '2':
-			ButtonPressL(2);
-			break;
-		}
-	}
-
-EXPORT_C void CTDialog::PointerL(const TPointerEvent &aPointer,const TTime &aTime)
-	{
-	if (aPointer.iType==TPointerEvent::EButton1Up)
-		{
-		if (iButtonClickOn>0)
-			{
-			ButtonPressL(iButtonClickOn-1);
-			return;
-			}
-		}
-	else if (aPointer.iType==TPointerEvent::EButton1Down)
-		{
-		for(TInt index=0;index<iNumButtons;index++)
-			if (ButtonRect(index).Contains(aPointer.iPosition))
-				{
-				if (iFlags&EDialogWaitForButtonUp)
-					iButtonClickOn=index+1;
-				else
-					{
-					ButtonPressL(index);
-					return;
-					}
-				}
-		}
-	CTTitledWindow::PointerL(aPointer, aTime);
-	}
-
-EXPORT_C void CTDialog::ButtonPressL(TInt aButton)
-	{
-	if (aButton<iNumButtons)
-		{
-		SetResult(aButton);
-		CTTitledWindow::Delete(this);
-		}
-	}
-
-void CTDialog::SetResult(TInt aButton)
-	{
-	if (iResultPtr)
-		*iResultPtr=aButton;
-	}
-
-// Simple display dialog //
-
-class CDisplayDialog : public CTDialog
-	{		  
-public:
-	CDisplayDialog(CTWindowGroup *aGroupWin,CWindowGc *aGc);
-	void ConstructLD();
-private:
-	CTWindowGroup *iGroupWin;
-	CWindowGc *iGc;
-	};
-
-CDisplayDialog::CDisplayDialog(CTWindowGroup *aGroupWin,CWindowGc *aGc) : CTDialog(),
-	iGroupWin(aGroupWin),
-	iGc(aGc)
-	{
-	}
-
-void CDisplayDialog::ConstructLD()
-	{
-	CTDialog::ConstructLD(*iGroupWin, *iGc);
-	}
-
-EXPORT_C void DisplayDialog(CTClient *aClient, const TWindowTitle &aTitle, const TDesC &aLine1, const TDesC &aLine2)
-	{
-	CDisplayDialog *dialog=NULL;
-	dialog=new(ELeave) CDisplayDialog(aClient->iGroup, aClient->iGc);
-	TRAPD(err,dialog->ConstructLD());
-	if (err==KErrNone)
-		{
-		dialog->SetTitle(aTitle);
-		dialog->SetLine1(aLine1);
-		dialog->SetLine2(aLine2);
-		dialog->SetNumButtons(1);
-		dialog->SetButtonText(0,_L("Okay"));
-		if (dialog->Display()!=0)		// delete dialog
-			TbPanic(EDialogDisplay);
-		}
-	}
-
-void doDisplayDialog(TInt aScreenNumber,const TWindowTitle &aTitle, const TDesC &aLine1, const TDesC &aLine2, CTClient *&aClient, const RWindowGroup *aGroup)
-	{
-	aClient=new(ELeave) CTClient();
-	aClient->SetScreenNumber(aScreenNumber);
-	aClient->ConstructL();
-//
-	aClient->iGroup=new(ELeave) CTWindowGroup(aClient);
-	aClient->iGroup->ConstructL();
-	aClient->iGroup->GroupWin()->SetOrdinalPosition(0,10);
-	if (aGroup)
-		aClient->iGroup->GroupWin()->SetOwningWindowGroup(aGroup->Identifier());
-//
-	TRAP_IGNORE(DisplayDialog(aClient, aTitle, aLine1, aLine2));
-	}
-
-void doDisplayDialog(const TWindowTitle &aTitle, const TDesC &aLine1, const TDesC &aLine2, CTClient *&aClient, const RWindowGroup *aGroup)
-	{
-	doDisplayDialog(KDefaultScreen,aTitle,aLine1,aLine2,aClient,aGroup);
-	}
-
-EXPORT_C void DisplayDialog(TInt aScreenNumber,const TWindowTitle &aTitle, const TDesC &aLine1, const TDesC &aLine2, const RWindowGroup *aGroup)
-	{
-	CTClient *client=NULL;
-	TRAP_IGNORE(doDisplayDialog(aScreenNumber,aTitle,aLine1,aLine2,client,aGroup));
-	delete client;
-	}
-
-EXPORT_C void DisplayDialog(const TWindowTitle &aTitle, const TDesC &aLine1, const TDesC &aLine2, const RWindowGroup *aGroup)
-	{
-	DisplayDialog(KDefaultScreen,aTitle,aLine1,aLine2,aGroup);
-	}
-
-
-
-//CInfoDialog
-
-EXPORT_C CInfoDialog::CInfoDialog(CTWindowGroup *aGroupWin,CWindowGc *aGc) :CTDialog(), iGroupWin(aGroupWin), iGc(aGc)
-	{}
-
-EXPORT_C void CInfoDialog::ButtonPressL(TInt aButton)
-	{
-	if (aButton==0)
-		{
-		SetResult(0);
-		BaseWin()->SetVisible(EFalse);
-		CActiveScheduler::Stop();
-		}
-	}
-
-EXPORT_C void CInfoDialog::ConstructLD()
-	{
-	_LIT(OK,"Okay");
-	CTDialog::ConstructLD(*iGroupWin, *iGc);
-	SetNumButtons(1);
-	SetButtonText(0,OK);
-	SetTakeFocus();
-	}
-
-EXPORT_C void CInfoDialog::TimerResults()
-	{
-	TProfile profile[eTimes];
-	// TProfile only has default constructor -
-	// constructor of TProfile does not initialize its members
-	for (TInt jj=0; jj<eTimes; jj++)
-		{
-		profile[jj].iTime=0;
-		profile[jj].iCount=0;
-		}
-	__PROFILE_DISPLAY(eTimes)
-	TBuf<64> times;
-	TBuf<32> counts;
-	TInt ii=1;
-	FOREVER
-		{
-		AppendProfileTime(times,profile[ii].iTime);
-		AppendProfileCount(counts,profile[ii].iCount);
-		if (++ii==eTimes)
-			break;
-		AddComma(times);
-		AddComma(counts);
-		}
-	SetLine1(times);
-	SetLine2(counts);
-	times.Zero();
-	AppendProfileTime(times,profile[0].iTime);
-	SetTitle(times);
-	}
-
-void CInfoDialog::AppendProfileTime(TDes &aDes, TInt aNum)
-	{
-	_LIT(ThreeDP,"%d.%03d");
-	aDes.AppendFormat(ThreeDP,aNum/eSeconds,(aNum%eSeconds)/1000);
-	}
-
-void CInfoDialog::AppendProfileCount(TDes &aDes, TInt aNum)
-	{
-	_LIT(Int,"%d");
-	aDes.AppendFormat(Int,aNum);
-	}
-
-void CInfoDialog::AddComma(TDes &aDes)
-	{
-	_LIT(Comma,", ");
-	aDes.Append(Comma);
-	}
-
-CTAutoKey::CTAutoKey(RWsSession& aWs): CActive(0), iWs(aWs)
-	{
-	CActiveScheduler::Add(this);
-	}
-	
-CTAutoKey::~CTAutoKey()
-	{
-	Cancel();
-	iTimer.Close();
-	}
-	
-void CTAutoKey::ConstructL()
-	{
-	User::LeaveIfError(iTimer.CreateLocal());
-	}
-	
-CTAutoKey* CTAutoKey::NewL(RWsSession& aWs)
-	{
-	CTAutoKey* self=new(ELeave) CTAutoKey(aWs);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop();
-	return self;
-	}
-	
-void CTAutoKey::Activate(TInt aDelay)
-	{
-	if (IsActive())
-		Cancel();
-	
-	iDelay=aDelay*1000000;
-	iTimer.After(iStatus,iDelay);
-	SetActive();
-	}
-void CTAutoKey::RunL()
-	{
-	// simulate key event, only needed to run once
-	TKeyEvent keyEvent;
-	keyEvent.iCode=EKeyEnter;
-	keyEvent.iScanCode=EKeyEnter;
-	keyEvent.iModifiers=0;
-	keyEvent.iRepeats=0;
-	iWs.SimulateKeyEvent(keyEvent);
-	iWs.Flush();
-	}
-	
-void CTAutoKey::DoCancel()
-	{
-	iTimer.Cancel();
-	}
--- a/windowing/windowserver/tlib/TLEVENT.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,294 +0,0 @@
-// Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Maintains a window displaying last event details
-// 
-//
-
-#include <e32std.h>
-#include <w32std.h>
-#include <e32svr.h>
-#include "testbase.h"
-
-const TInt NumLogLinesPerEvent=2;
-
-
-//
-// Event window //
-//
-
-EXPORT_C CEventWindow::CEventWindow(TInt aLogSize) : CTWin(), iLogSize(aLogSize)
-	{
-	}
-
-EXPORT_C CEventWindow::~CEventWindow()
-	{
-	delete[] iLoggedEvents;
-	RelinquishFocus();
-	}
-
-EXPORT_C void CEventWindow::ConstructL(CTWinBase &parent)
-	{
-	CTWin::ConstructL(parent);
-	iLineHeight=iFont->HeightInPixels()+2;
-	iLoggedEvents=new(ELeave) TWsEvent[iLogSize];
-	iWin.EnableModifierChangedEvents(EModifierFunc|EModifierCapsLock|EModifierNumLock, EEventControlAlways);
-	iWin.EnableOnEvents(EEventControlAlways);
-	}
-
-EXPORT_C void CEventWindow::SetUpL(const TPoint &pos, CTWinBase *parent, CWindowGc &aGc)
-	{
-	TRAPD(err,ConstructL(*parent));
-	if (err!=KErrNone)
-		{
-		delete this;
-		User::Leave(err);
-		}
-	SetExt(pos,TSize(600,iLineHeight*NumLogLinesPerEvent*iLogSize));
-	Activate();
-	AssignGC(aGc);
-	}
-
-void CEventWindow::DrawLine(TInt aLine, const TDesC &aText)
-	{
-	iGc->DrawText(aText, TPoint(10,iLineHeight*aLine+iFont->AscentInPixels()+1));
-	}
-
-void CEventWindow::LogEvent(TInt aLogNum, const TWsEvent &aEvent)
-	{
-	TBuf<0x80> buf1;
-	TBuf<0x80> buf2;
-	TPtrC type(_L("Unknown event type"));
-	TKeyEvent *key=aEvent.Key();
-	switch(aEvent.Type())
-		{
-		case EEventKey:
-			type.Set(_L("EEventKey"));
-			buf2.Format(TRefByValue<const TDesC>(_L("Code=%d [%c], ScanCode=0x%x, Modifiers=0x%04x, repeats=%d")), key->iCode, key->iCode, key->iScanCode,key->iModifiers,key->iRepeats);
-			break;
-		case EEventKeyUp:
-			type.Set(_L("EEventKeyUp"));
-			buf2.Format(TRefByValue<const TDesC>(_L("scanCode=0x%x, Modifiers=0x%04x")), key->iScanCode, key->iModifiers);
-			break;
-		case EEventKeyDown:
-			type.Set(_L("EEventKeyDown"));
-			buf2.Format(TRefByValue<const TDesC>(_L("scanCode=0x%x, Modifiers=0x%04x")), key->iScanCode, key->iModifiers);
-			break;
-		case EEventPointer:
-			{
-			TPointerEvent *pointer=aEvent.Pointer();
-			TPtrC ptrType(_L("Unknown pointer event"));
-			switch(pointer->iType)	
-				{
-				case TPointerEvent::EButton1Up:
-					ptrType.Set(_L("EButton1Up"));
-					break;
-				case TPointerEvent::EButton3Up:
-					ptrType.Set(_L("EButton3Up"));
-					break;
-				case TPointerEvent::EButton2Up:
-					ptrType.Set(_L("EButton2Up"));
-					break;
-				case TPointerEvent::EButton1Down:
-					ptrType.Set(_L("EButton1Down"));
-					break;
-				case TPointerEvent::EButton3Down:
-					ptrType.Set(_L("EButton3Down"));
-					break;
-				case TPointerEvent::EButton2Down:
-					ptrType.Set(_L("EButton2Down"));
-					break;
-				case TPointerEvent::EDrag:
-					ptrType.Set(_L("EDrag"));
-					break;
-				case TPointerEvent::EMove:
-					ptrType.Set(_L("EMove"));
-					break;
-				case TPointerEvent::EButtonRepeat:
-					ptrType.Set(_L("EButtonRepeat"));
-					break;
-				case TPointerEvent::ESwitchOn:
-					ptrType.Set(_L("ESwitchOn"));
-					break;
-				}
-			type.Set(_L("EEventPointer"));
-			buf2.Format(TRefByValue<const TDesC>(_L("Type=%S, state=0x%x, pos={%d,%d}, parent pos={%d,%d}")),&ptrType, pointer->iModifiers,
-				pointer->iPosition.iX,pointer->iPosition.iY,pointer->iParentPosition.iX,pointer->iParentPosition.iY);
-			}
-			break;
-		case EEventPointerEnter:
-			type.Set(_L("EEventPointerEnter"));
-			break;
-		case EEventPointerExit:
-			type.Set(_L("EEventPointerExit"));
-			break;
-		case EEventSwitchOn:
-			type.Set(_L("EEventSwitchOn"));
-			break;
-		case EEventModifiersChanged:
-			type.Set(_L("EEventModifiersChanged"));
-			buf2.Format(TRefByValue<const TDesC>(_L("Changed=0x%x, State=0x%x ")),aEvent.ModifiersChanged()->iChangedModifiers,aEvent.ModifiersChanged()->iModifiers);
-			break;
-		case EEventFocusLost:
-			type.Set(_L("EEventFocusLost"));
-			break;
-		case EEventFocusGained:
-			type.Set(_L("EEventFocusGained"));
-			break;
-		default:;
-		}
-	TBuf<20> timeBuf;
-	_LIT(TimeDisc,"%/0%1%/1%2%/2%3%/3 %:0%H%:1%T%:2%S%:3");
-	TRAPD(err,aEvent.Time().FormatL(timeBuf,TimeDisc));
-	if (err!=KErrNone)
-		{
-		_LIT(DummyTime,"########");
-		timeBuf.Append(DummyTime);
-		}
-	buf1.Format(TRefByValue<const TDesC>(_L("%d: %S [%x], %S")), iCount-aLogNum, &type, aEvent.Handle(), &timeBuf);
-	TInt baseLine=(iLogSize-aLogNum-1)*NumLogLinesPerEvent;
-	DrawLine(baseLine+0,buf1);
-	DrawLine(baseLine+1,buf2);
-	}
-
-EXPORT_C void CEventWindow::Draw()
-	{
-	DrawBorder();
-	for(TInt index=0;index<iNumLogged;index++)
-		LogEvent(index,iLoggedEvents[index]);
-	}
-
-EXPORT_C void CEventWindow::WinKeyL(const TKeyEvent &,const TTime&)
-	{
-	}
-
-EXPORT_C void CEventWindow::LogEvent(const TWsEvent &aEvent)
-	{
-	iCount++;
-	if (iNumLogged<iLogSize)
-		iNumLogged++;
-	for(TInt index=iNumLogged-1;index>0;index--)
-		iLoggedEvents[index]=iLoggedEvents[index-1];
-	iLoggedEvents[0]=aEvent;
-	DrawNow();
-	}
-
-
-//
-// Blank window, just sort of sits there looking blank //
-//
-
-EXPORT_C TBool CheckBlankWindow(TRect aArea,TRgb aColor,const CWsScreenDevice* aScreen)
-//
-// Returns ETrue if the the given rect is all the specified color
-// EFalse if it is not
-//
-	{
-	TInt wid=aArea.Width();
-	TAny *buf2=User::AllocL(wid*sizeof(TRgb));
-	TRgb *pRgb=(TRgb *)buf2;
-	Mem::FillZ(buf2,wid*sizeof(TRgb));
-	//TRgb tmp(TRgb::Gray16(aColor.Gray16()));
-	//Truncate color to match color conversion in EColor64K mode before comparison
-	if (aScreen->DisplayMode()==EColor64K)
-		aColor=TRgb::Color64K(aColor.Color64K());
-	for(TInt i=0;i<wid;i++,pRgb++)
-		*pRgb=aColor;
-	TPtr8 tstBuf(reinterpret_cast<TUint8*>(buf2),wid*sizeof(TRgb),wid*sizeof(TRgb));
-
-	TAny *buf=User::AllocL(wid*sizeof(TRgb));
-	TPtr8 rgbBuf(reinterpret_cast<TUint8*>(buf),wid*sizeof(TRgb));
-
-	TBool ret=ETrue;
-	TPoint offset=aArea.iTl;		//iWin.InquireOffset(*TheClient->iGroup->WinTreeNode());
-	for(;offset.iY<aArea.iBr.iY;offset.iY++)
-		{
-		aScreen->GetScanLine(rgbBuf,offset,wid,EColor16MA);
-		if (rgbBuf.Compare(tstBuf)!=0)
-			{
-			ret=EFalse;
-			break;
-			}
-		}
-	User::FreeZ(buf);
-	User::FreeZ(buf2);
-	return(ret);
-	}
-
-EXPORT_C CBlankWindow::CBlankWindow() : CTWin()
-	{
-	iCol=TRgb::Gray256(128);
-	}
-
-EXPORT_C CBlankWindow::CBlankWindow(TRgb aCol) : CTWin(), iCol(aCol), iRealDraw(EFalse)
-	{
-	}
-
-EXPORT_C void CBlankWindow::ConstructL(CTWinBase &parent)
-	{
-	CTWin::ConstructL(parent);
-	iWin.SetBackgroundColor(iCol);
-	}
-
-EXPORT_C void CBlankWindow::SetColor(TRgb aColor)
-	{
-	iCol=aColor;
-	}
-
-EXPORT_C void CBlankWindow::RealDraw(TBool aRealDraw)
-	{
-	iRealDraw=aRealDraw;
-	}
-
-EXPORT_C void CBlankWindow::Draw()
-	{
-	if (!iRealDraw)
-		iGc->Clear();
-	else
-		{
-		iGc->SetPenStyle(CGraphicsContext::ENullPen);
-		iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-		iGc->SetBrushColor(iCol);
-		iGc->DrawRect(TRect(iSize));
-		}
-	}
-
-EXPORT_C void CBlankWindow::DrawNow()
-	{
-	iWin.Invalidate();
-	iWin.BeginRedraw();
-	iGc->Activate(iWin);
-	Draw();
-	iGc->Deactivate();
-	iWin.EndRedraw();
-	}
-
-EXPORT_C void CBlankWindow::DrawNow(TRect& aRect)
-	{
-	iWin.Invalidate(aRect);
-	iWin.BeginRedraw(aRect);
-	iGc->Activate(iWin);
-	iGc->SetClippingRect(aRect);
-	Draw();
-	iGc->Deactivate();
-	iWin.EndRedraw();
-	}
-
-EXPORT_C TBool CBlankWindow::Check(const CTClient& aClient)
-//
-// Returns ETrue if the window is Ok,
-// EFalse if it is not
-//
-	{
-	return CheckBlankWindow(TRect(iWin.InquireOffset(*aClient.iGroup->WinTreeNode()),Size()),TRgb::Gray16(iCol.Gray16()),aClient.iScreen);
-	}
--- a/windowing/windowserver/tlib/TLIB.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef __TLIB_H__
-#define __TLIB_H__
-
-#include "testbase.h"
-
-GLREF_C void TbPanic(TInt aPanic);
-
-enum TTestBasePanic
-	{
-	ETestBasePanicResourceCount,
-	ETestBasePanicResCountWinFail,
-	ETestBasePanicResCountWinInit,
-	ETestBasePanicEventStat,
-	ETestBasePanicScheduler,
-	ETestBasePanicKeyParams,
-	ETestBasePanicInvalidEvent,
-	ETestBasePanicReadCancelled,
-	ETestBasePanicUnimplementedBaseFunction,
-	ETestBasePanicCancelFunction,
-	ETestBasePanicNullRedraw,
-	ETestBasePanicNullOwnerWin,
-	ETestBasePanicWinType,
-	ETestBasePanicPassword,
-	EDialogButtonCount,
-	EDialogButtonIndex,
-	EDialogDisplay,
-	ETestBasePanicInvalidHeapAddress,
-	};
-
-#endif
--- a/windowing/windowserver/tlib/TLSPRITE.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,223 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Base classes used for building window server test code
-// 
-//
-
-#include <e32std.h>
-#include <w32std.h>
-#include <e32svr.h>
-#include "testbase.h"
-
-EXPORT_C TSpriteCreateParams::TSpriteCreateParams(TSize aSize,TPoint aOffset,CTSpriteBase::TSpriteDrawFunction aDrawFunc,
-								TAny *aDrawFuncParam,TBool aMask,CGraphicsContext::TDrawMode aDrawMode) :
-	iSize(aSize),
-	iOffset(aOffset),
-	iDrawFunc(aDrawFunc),
-	iDrawFuncParam(aDrawFuncParam),
-	iMask(aMask),
-	iDrawMode(aDrawMode),
-	iInterval(0)
-	{}
-
-EXPORT_C TSpriteCreateParams::TSpriteCreateParams() :
-	iDrawFunc(NULL),
-	iDrawMode(CGraphicsContext::EDrawModePEN),
-	iInterval(0)
-	{}
-
-void CTSpriteBase::CreateBitmapL(CFbsBitmap *&aBitmap, CFbsBitmapDevice *&aBitmapDevice, TSpriteCreateParams *aParams, TBool aDoMask)
-	{
-	if (aBitmap==NULL)
-		{
-		aBitmap=new(ELeave) CFbsBitmap();
-		User::LeaveIfError(aBitmap->Create(aParams->iSize,EGray4));
-		}
-	aBitmapDevice=CFbsBitmapDevice::NewL(aBitmap);
-	CFbsBitGc *gc=CFbsBitGc::NewL();
-	gc->Activate(aBitmapDevice);
-	aParams->iDrawFunc(gc,0,aParams->iSize,aDoMask,aParams->iDrawFuncParam);
-	delete gc;
-	}
-
-EXPORT_C void CTSpriteBase::RedrawL(CFbsBitmap *&aBitmap, CFbsBitmap *&aMaskBitmap, TSpriteCreateParams *aParams)
-	{
-	CFbsBitmapDevice *bitmapDevice=NULL;
-	TRAPD(err,CreateBitmapL(aBitmap,bitmapDevice,aParams,EFalse));
-	if (err==KErrNone)
-		{
-		delete bitmapDevice;
-		bitmapDevice=NULL;
-		if (aMaskBitmap)
-			{
-			TRAP(err,CreateBitmapL(aMaskBitmap,bitmapDevice,aParams,ETrue));
-			delete bitmapDevice;
-			}
-		SpriteBase().UpdateMember(0);
-		}
-	User::LeaveIfError(err);
-	}
-
-EXPORT_C void CTSpriteBase::UpdateL(TInt aIndex, TSpriteCreateParams *aParams)
-	{
-	CFbsBitmap *bitmap=NULL;
-	CFbsBitmapDevice *bitmapDevice=NULL;
-	TRAPD(err,CreateBitmapL(bitmap,bitmapDevice,aParams,EFalse));
-	if (err==KErrNone)
-		{
-		delete bitmapDevice;
-		bitmapDevice=NULL;
-		CFbsBitmap *mask=NULL;
-		if (aParams->iMask)
-			TRAP(err,CreateBitmapL(mask,bitmapDevice,aParams,ETrue));
-		if (err==KErrNone)
-			{
-			TSpriteMember sprite;
-			sprite.iBitmap=bitmap;
-			sprite.iMaskBitmap=mask;
-			sprite.iInvertMask=EFalse;
-			sprite.iDrawMode=aParams->iDrawMode;
-			sprite.iInterval=aParams->iInterval;
-			sprite.iOffset=aParams->iOffset;
-			err=SpriteBase().UpdateMember(aIndex,sprite);
-			}
-		delete mask;
-		}
-	delete bitmap;
-	delete bitmapDevice;
-	User::LeaveIfError(err);
-	}
-
-EXPORT_C CTSprite::CTSprite(RWsSession &aWs) : iSprite(aWs)
-	{
-	}
-
-EXPORT_C CTSprite::~CTSprite()
-	{
-	iSprite.Close();
-	}
-
-EXPORT_C RWsSpriteBase &CTSprite::SpriteBase()
-	{
-	return(iSprite);
-	}
-
-EXPORT_C RWsSprite &CTSprite::Sprite()
-	{
-	return(iSprite);
-	}
-
-EXPORT_C void CTSprite::ConstructL(RWindowTreeNode &aWindow, const TPoint &aPos, TInt aCount, TSpriteCreateParams *aParams, TInt aFlags)
-	{
-	User::LeaveIfError(iSprite.Construct(aWindow,aPos,aFlags));
-	for(TInt index=0;index<aCount;index++,aParams++)
-		{
-		CFbsBitmap *bitmap=NULL;
-		CFbsBitmap *mask=NULL;
-		CFbsBitmapDevice *bitmapDevice=NULL;
-		TRAPD(err,CreateBitmapL(bitmap,bitmapDevice,aParams,EFalse));
-		if (err==KErrNone)
-			{
-			delete bitmapDevice;
-			bitmapDevice=NULL;
-			if (aParams->iMask)
-				TRAP(err,CreateBitmapL(mask,bitmapDevice,aParams,ETrue));
-			if (err==KErrNone)
-				{
-				TSpriteMember sprite;
-				sprite.iBitmap=bitmap;
-				sprite.iMaskBitmap=mask;
-				sprite.iInvertMask=EFalse;
-				sprite.iDrawMode=aParams->iDrawMode;
-				sprite.iOffset=aParams->iOffset;
-				sprite.iInterval=aParams->iInterval;
-				err=iSprite.AppendMember(sprite);
-				}
-			}
-		delete mask;
-		delete bitmap;
-		delete bitmapDevice;
-		User::LeaveIfError(err);
-		}
-	User::LeaveIfError(iSprite.Activate());
-	}
-
-EXPORT_C CTPointerCursor::CTPointerCursor(RWsSession &aWs) : iCursor(aWs)
-	{
-	}
-
-EXPORT_C CTPointerCursor::~CTPointerCursor()
-	{
-	iCursor.Close();
-	}
-
-EXPORT_C RWsSpriteBase &CTPointerCursor::SpriteBase()
-	{
-	return(iCursor);
-	}
-
-EXPORT_C RWsPointerCursor &CTPointerCursor::PointerCursor()
-	{
-	return(iCursor);
-	}
-
-EXPORT_C void CTPointerCursor::ConstructL(TInt aFlags)
-	{
-	User::LeaveIfError(iCursor.Construct(aFlags));
-	TSpriteMember sprite;
-	sprite.iBitmap=NULL;
-	User::LeaveIfError(iCursor.AppendMember(sprite));
-	}
-
-EXPORT_C void CTPointerCursor::ConstructL(TInt aCount, TSpriteCreateParams *aParams, TInt aFlags)
-	{
-	CFbsBitmap *bitmap=NULL;
-	CFbsBitmap *mask=NULL;
-	TRAPD(err,ConstructL(aCount, aParams, aFlags, bitmap, mask));
-	delete bitmap;
-	delete mask;
-	User::LeaveIfError(err);
-	}
-
-EXPORT_C void CTPointerCursor::ConstructL(TInt aCount, TSpriteCreateParams *aParams, TInt aFlags, CFbsBitmap *&aBitmap, CFbsBitmap *&aMaskBitmap)
-	{
-	User::LeaveIfError(iCursor.Construct(aFlags));
-	for(TInt index=0;index<aCount;index++,aParams++)
-		{
-		CFbsBitmapDevice *bitmapDevice=NULL;
-		TRAPD(err,CreateBitmapL(aBitmap,bitmapDevice,aParams,EFalse));
-		if (err==KErrNone)
-			{
-			delete bitmapDevice;
-			bitmapDevice=NULL;
-			if (aParams->iMask)
-				TRAP(err,CreateBitmapL(aMaskBitmap,bitmapDevice,aParams,ETrue));
-			if (err==KErrNone)
-				{
-				TSpriteMember sprite;
-				sprite.iBitmap=aBitmap;
-				sprite.iMaskBitmap=aMaskBitmap;
-				sprite.iInvertMask=EFalse;
-				sprite.iDrawMode=aParams->iDrawMode;
-				sprite.iInterval=aParams->iInterval;
-				sprite.iOffset=aParams->iOffset;
-				err=iCursor.AppendMember(sprite);
-				}
-			}
-		delete bitmapDevice;
-		bitmapDevice=NULL;
-		User::LeaveIfError(err);
-		}
-	User::LeaveIfError(iCursor.Activate());
-	}
--- a/windowing/windowserver/tlib/testbase.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,562 +0,0 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Base classes definitions used for building window server test code
-// 
-//
-
-#ifndef __TESTBASE_H__
-#define __TESTBASE_H__
-
-enum TTlibActivePriorities
-	{
-	ETlibRedrawActivePriority=-10,
-	ETlibWsEventActivePriority=0,
-	};
-
-const TInt KDefaultScreen = 0;
-
-//enum {ENullWsHandle=0xFFFFFFFF};	// Events delivered to this handle are thrown away
-const TUint32 ENullWsHandle=0xFFFFFFFF;	// Events delivered to this handle are thrown away
-
-typedef TBuf<KMaxFullName> TWindowTitle;
-typedef TBuf<0x100> TWinCommand;
-
-const TUid KUidWServSecurityTesting={0x10205152};
-enum TWServSecTest
-	{
-	EWServSecTestBufferSecurity
-	};
-
-class CTClient;	// Forward reference
-class CTWindowGroup;
-class CTBaseWin;
-class CTWin;
-
-typedef CTClient *(*TCreateClientFunc)();
-
-IMPORT_C TBool CheckBlankWindow(TRect aArea,TRgb aColor,const CWsScreenDevice* aScreen);
-
-class CTWinBase : public CBase
-	{
-protected:
-public:
-	IMPORT_C CTWinBase(TInt aType);
-	IMPORT_C virtual TPoint Position() const;
-	IMPORT_C virtual void PointerEnter(const TTime &aTime);
-	IMPORT_C virtual void PointerExit(const TTime &aTime);
-	IMPORT_C virtual void PointerBufferReady(const TTime &aTime);
-	IMPORT_C virtual void PointerL(const TPointerEvent &aPointer,const TTime &aTime);
-	IMPORT_C virtual void SwitchOn(const TTime &aTime);
-	IMPORT_C virtual void ModifiersChanged(const TModifiersChangedEvent &aModifiersChanged ,const TTime &aTime);
-	IMPORT_C virtual void ErrorMessage(const TWsErrorMessage &aErrorMessage, const TTime &aTime);
-	IMPORT_C virtual void SetVisible(TBool aState);
-	IMPORT_C CTWinBase *Parent() const;
-	IMPORT_C CTWinBase *NextSibling() const;
-	IMPORT_C CTWinBase *PrevSibling() const;
-	IMPORT_C CTBaseWin *Child() const;
-	IMPORT_C virtual void AdjustOrdinal(TInt adjust);
-	IMPORT_C virtual void AdjustShadow(TInt aAdjust);
-	IMPORT_C virtual TInt SubType();
-// Pure virtual definitions
-	virtual void WinKeyL(const TKeyEvent &aKey,const TTime &aTime)=0;
-	virtual TSize Size() const=0;
-	virtual RWindowTreeNode *WinTreeNode()=0;
-	virtual const RWindowTreeNode *WinTreeNode() const=0;
-	IMPORT_C virtual CTClient *Client() const;
-	virtual CTWindowGroup *Group() const=0;
-	CTWindowGroup *iOwnerWin;
-public:
-	TInt iType;
-	__DECLARE_TEST;
-	};
-
-class CTBaseWin : public CTWinBase
-	{
-public:
-	IMPORT_C CTBaseWin(TInt aType);
-	IMPORT_C ~CTBaseWin();
-	IMPORT_C virtual void ConstructL(CTWinBase &parent);
-	IMPORT_C virtual void ConstructExtLD(CTWinBase &aParent, const TPoint &aPos, const TSize &aSize);
-	virtual TInt ConstructWin(const CTWinBase &aWs)=0;
-	IMPORT_C virtual void InitWin();
-	IMPORT_C virtual void PointerL(const TPointerEvent &aPointer,const TTime &aTime);
-	IMPORT_C virtual void DragDropL(const TPointerEvent &aPointer,const TTime &aTime);
-	IMPORT_C virtual void RelinquishFocus();
-	IMPORT_C void Activate();
-	IMPORT_C virtual void AssignGC(CWindowGc &aGc);
-	IMPORT_C CTBaseWin *Next();
-	IMPORT_C CTBaseWin *Prev();
-	IMPORT_C virtual void SetExtL(const TPoint &aPos, const TSize &aSize);
-	IMPORT_C virtual void SetSizeL(const TSize &aSize);
-	IMPORT_C virtual void SetPos(const TPoint &aPos);
-	IMPORT_C void SetInitialPos(const TPoint &aPos);
-	IMPORT_C virtual void SetDefaultExtL();
-	IMPORT_C virtual void SetFullScreenExtL();
-	IMPORT_C virtual void AdjustSizeL(TInt xMove,TInt yMove,TInt resize);
-	IMPORT_C virtual TSize Size() const;
-	IMPORT_C virtual void Draw();
-	IMPORT_C void DrawBorder();
-//	void FillWindow(TInt inset);
-	IMPORT_C virtual TPoint Position() const;
-	IMPORT_C static void Delete(CTBaseWin *aWin);
-	IMPORT_C void AdjustOrdinal(TInt aAdjust);
-	IMPORT_C virtual void AdjustShadow(TInt aAdjust);
-	IMPORT_C void SetVisible(TBool aState);
-	IMPORT_C RWindowTreeNode *WinTreeNode();
-	IMPORT_C const RWindowTreeNode *WinTreeNode() const;
-	IMPORT_C virtual void WinKeyL(const TKeyEvent &aKey,const TTime &aTime);
-	IMPORT_C virtual void KeyUpL(const TKeyEvent &aKey,const TTime &aTime);
-	IMPORT_C virtual void KeyDownL(const TKeyEvent &aKey,const TTime &aTime);
-	IMPORT_C virtual void SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
-	IMPORT_C virtual void SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc, TDisplayMode *aMode);
-	IMPORT_C void SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc,TBool aVisible);
-	enum 
-		{
-		ENoTransparency=0x100
-		};
-	IMPORT_C virtual void SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc, TDisplayMode *aMode,TBool aVisible,TInt aTransparency=ENoTransparency);
-	IMPORT_C void SetDragRect(const TRect &aRect);
-	IMPORT_C virtual void Resized(const TSize &aSize);
-	IMPORT_C virtual void FocusChanged(TBool aState);
-	IMPORT_C virtual CTWindowGroup *Group() const;
-	virtual RWindowBase *BaseWin()=0;
-	virtual const RWindowBase *BaseWin() const=0;
-	inline CWindowGc *Gc();
-protected:
-	TSize iSize;
-	CWindowGc *iGc;		   	// Not owned by the window, just using it
-	TPoint iPos;
-	TInt iShadow;
-	TRect iDragRect;
-	TBool iDragging;
-	TPoint iDragPos;
-	CFbsFont *iFont;
-	__DECLARE_TEST;
-	};
-
-class CTDrawableWin : public CTBaseWin
-	{
-public:
-	IMPORT_C CTDrawableWin(TInt aType);
-	virtual RDrawableWindow *DrawableWin()=0;
-	virtual const RDrawableWindow *DrawableWin() const=0;
-	};
-
-class CTWin : public CTDrawableWin
-	{
-public:
-	IMPORT_C CTWin();
-	IMPORT_C ~CTWin();
-	inline RWindow *Win() const;
-	IMPORT_C virtual TInt ConstructWin(const CTWinBase &aWs);
-	IMPORT_C void Invalidate();
-	IMPORT_C void Invalidate(const TRect &rect);
-	IMPORT_C virtual void Redraw();
-	IMPORT_C virtual void Redraw(const TRect &aRect);
-	IMPORT_C void DrawNow();
-	IMPORT_C void SetExt(const TPoint &aPos, const TSize &aSize);
-	IMPORT_C void SetSize(const TSize &aSize);
-	IMPORT_C void SetDefaultExt();
-	IMPORT_C void AdjustSize(TInt xMove,TInt yMove,TInt resize);
-	IMPORT_C virtual RWindowBase *BaseWin();
-	IMPORT_C virtual const RWindowBase *BaseWin() const;
-	IMPORT_C virtual RDrawableWindow *DrawableWin();
-	IMPORT_C virtual const RDrawableWindow *DrawableWin() const;
-protected:
-	RWindow iWin;
-	__DECLARE_TEST;
-	};
-
-class CTBackedUpWin : public CTDrawableWin
-	{
-public:
-	IMPORT_C CTBackedUpWin(TDisplayMode aDisplayMode);
-	IMPORT_C ~CTBackedUpWin();
-	IMPORT_C virtual TInt ConstructWin(const CTWinBase &aWs);
-	IMPORT_C virtual RWindowBase *BaseWin();
-	IMPORT_C virtual const RWindowBase *BaseWin() const;
-	IMPORT_C virtual RDrawableWindow *DrawableWin();
-	IMPORT_C virtual const RDrawableWindow *DrawableWin() const;
-	IMPORT_C RBackedUpWindow *BackedUpWin();
-	IMPORT_C const RBackedUpWindow *BackedUpWin() const;
-protected:
-	RBackedUpWindow iWin;
-	TDisplayMode iDisplayMode;
-	__DECLARE_TEST;
-	};
-
-class CTTitledWindow : public CTWin
-	{
-public:
-	IMPORT_C CTTitledWindow();
-	IMPORT_C ~CTTitledWindow();
-	IMPORT_C void ConstructL(CTWinBase &parent);
-	IMPORT_C void Draw();
-	IMPORT_C void FocusChanged(TBool aState);
-	IMPORT_C void SetTitle(const TWindowTitle &aTitle);
-	IMPORT_C void SetColor(TRgb aRgb);
-	inline TRgb Color();
-private:
-	IMPORT_C void Resized(const TSize &aSize);
-protected:
-	TWindowTitle iTitle;
-	TInt iTitleHeight;
-	TBool iFocus;
-	TRgb iWinColor;
-	TRgb iPenColor;
-	};
-
-class CTBlankWindow : public CTBaseWin
-	{
-public:
-	IMPORT_C CTBlankWindow();
-	IMPORT_C ~CTBlankWindow();
-	IMPORT_C void ConstructL(CTWinBase &aParent);
-	IMPORT_C void SetColor(const TRgb &aRgb);
-	IMPORT_C virtual TInt ConstructWin(const class CTWinBase&);
-	IMPORT_C virtual const RWindowBase *BaseWin()const;
-	IMPORT_C virtual RWindowBase *BaseWin();
-	inline const RBlankWindow *BlankWin()const;
-	inline RBlankWindow *BlankWin();
-	IMPORT_C void SetExt(const TPoint &aPos, const TSize &aSize);
-	IMPORT_C void SetSize(const TSize &aSize);
-protected:
-	RBlankWindow iWin;
-	};
-
-class CTWindowGroup : public CTWinBase
-	{
-public:
-	IMPORT_C CTWindowGroup(CTClient *aClient);
-	IMPORT_C ~CTWindowGroup();
-	IMPORT_C virtual void ConstructL();
-	IMPORT_C void WinKeyL(const TKeyEvent &aKey,const TTime &aTime);
-	IMPORT_C virtual TSize Size() const;
-	IMPORT_C RWindowTreeNode *WinTreeNode();
-	IMPORT_C const RWindowTreeNode *WinTreeNode() const;
-	inline RWindowGroup *GroupWin();
-	IMPORT_C virtual void KeyL(const TKeyEvent &aKey,const TTime &aTime);
-	IMPORT_C virtual void KeyUpL(const TKeyEvent &aKey,const TTime &aTime);
-	IMPORT_C virtual void KeyDownL(const TKeyEvent &aKey,const TTime &aTime);
-	IMPORT_C virtual void PasswordL(const TTime &aTime);
-	IMPORT_C virtual void MessageReady(const TWsEvent &aTime);
-	IMPORT_C virtual void ScreenDeviceChanged();
-	IMPORT_C virtual void UserEvent(TInt aEventType);
-	IMPORT_C void SetCurrentWindow(CTBaseWin *aWindow);
-	IMPORT_C void SetCurrentWindow(CTBaseWin *aWindow,TBool aLocked);
-	IMPORT_C CTBaseWin *CurWin(void) const;
-	IMPORT_C void FocusLost();
-	IMPORT_C void FocusGained();
-	IMPORT_C TBool HasFocus(CTBaseWin *aWin) const;
-	IMPORT_C virtual CTWindowGroup *Group() const;
-	IMPORT_C virtual CTClient *Client() const;
-	IMPORT_C void ClearCurrentWindow();
-protected:
-	CTClient *iClient;
-	CTBaseWin *iCurWin;
-	RWindowGroup iGroupWin;
-	TBool iLocked;
-	TBool iFocus;
-	};
-
-inline RWindowGroup *CTWindowGroup::GroupWin()
-	{return(&iGroupWin);}
-
-class CTEventBase : public CActive
-	{
-public:
-	IMPORT_C CTEventBase(RWsSession *aWs, TInt aPriority);
-	IMPORT_C ~CTEventBase();
-	IMPORT_C void Construct();
-	void SetCancelFunction(const TCallBack &aCallBack);
-	virtual void Request()=0;
-	inline TInt Count() {return iCount;}
-protected:
-	virtual void doRunL()=0;
-	IMPORT_C void RunL();
-	IMPORT_C void CancelHandler();
-protected:
-	TBool iCancelRequested;
-	TCallBack iCancelCallBack;
-	RWsSession *iWs;
-	TInt iCount;
-	};
-
-class CTRedraw : public CTEventBase
-	{
-public:
-	IMPORT_C CTRedraw(RWsSession *aWs);
-	IMPORT_C ~CTRedraw();
-	IMPORT_C void Request();
-protected:
-	IMPORT_C void DoCancel();
-	IMPORT_C void doRunL();
-	};
-
-class TlibWsEvent : public TWsEvent
-	{
-public:
-	IMPORT_C CTWindowGroup *WindowGroup();
-	IMPORT_C CTBaseWin *BaseWin();
-	};
-
-class CTEvent : public CTEventBase
-	{
-public:
-	IMPORT_C CTEvent(RWsSession *aWs);
-	IMPORT_C ~CTEvent();
-	IMPORT_C void Request();
-	IMPORT_C virtual void LogEvent(const TWsEvent &aEvent);
-protected:
-	IMPORT_C void DoCancel();
-	IMPORT_C void doRunL();
-	};
-
-class CTClient : public CBase
-	{
-public:
-	IMPORT_C CTClient();
-	IMPORT_C ~CTClient();
-	IMPORT_C virtual void ConstructL();
-	IMPORT_C virtual void ConstructEventHandlerL();
-	IMPORT_C void DestroyWindows();
-	IMPORT_C TWindowTitle *Title();
-	IMPORT_C void ResetFocus();
-	IMPORT_C TBool QueueRead();
-	IMPORT_C void CancelRead();
-	IMPORT_C void CancelRedrawRead();
-	IMPORT_C void SetCancelFunction(const TCallBack &aCallBack);
-	IMPORT_C void SetRedrawCancelFunction(const TCallBack &aCallBack);
-	IMPORT_C void RequestRedraw();
-	IMPORT_C void LogMessage(const TLogMessageText &aMessage);
-	inline void Flush() {iWs.Flush();}
-	inline void SetScreenNumber(TInt aScreenNumber);
-	IMPORT_C TBool IsEventWaiting();
-	IMPORT_C TBool WaitUntilEventPending();
-	IMPORT_C TBool WaitUntilRedrawPending();
-	inline CTEvent* EventHandler();
-	inline CTRedraw* RedrawHandler();
-	IMPORT_C TInt WaitForRedrawsToFinish();
-	IMPORT_C TInt WaitForAllEventProcessingToFinish();
-private:
-	TBool WaitUntilEventPending(const TRequestStatus& aStatus);
-	TInt WaitForEventsToFinish(TBool aAll);
-protected:
-	CTEvent *iEventHandler;
-	CTRedraw *iRedrawEventHandler;
-public:
-	CWindowGc *iGc;
-	CTWindowGroup *iGroup;
-	RWsSession iWs;
-	CWsScreenDevice *iScreen;
-protected:
-	TWindowTitle iTitle;
-	TInt iScreenNumber;
-	};
-
-class CTAutoKey;
-class CTDialog : public CTTitledWindow
-	{
-public:
-	enum
-		{
-		EDialogWaitForButtonUp=0x0001,
-		EDialogDisplayAtBottom=0x0002,
-		EDialogDisplayAtLeft=0x0008,
-		};
-public:
-	IMPORT_C CTDialog();
-	IMPORT_C ~CTDialog();
-	IMPORT_C void ConstructLD(CTWinBase &aParent, CWindowGc &aGc);
-	IMPORT_C void Draw();
-	IMPORT_C void WinKeyL(const TKeyEvent &aKey,const TTime &aTime);
-	IMPORT_C void PointerL(const TPointerEvent &aPointer,const TTime &aTime);
-	IMPORT_C virtual void ButtonPressL(TInt aButton);
-	IMPORT_C void SetLine1(const TDesC &aLine1);
-	IMPORT_C void SetLine2(const TDesC &aLine2);
-	IMPORT_C void SetNumButtons(TInt aNum);
-	IMPORT_C void SetButtonText(TInt aNum,const TDesC &aButton);
-	IMPORT_C void SetWindowSize();
-	IMPORT_C void RelinquishFocus();
-	IMPORT_C TInt Display();
-	IMPORT_C void SetFlags(TUint aFlags);
-protected:
-	void SetResult(TInt aButton);
-	inline void SetTakeFocus() {iTakeFocus=ETrue;}
-private:
-	void SetMaxWid(TInt &aMax, TInt aWid);
-	TRect ButtonRect(TInt aIndex) const;
-private:
-	TBool iIsActive;
-	TBool iActivated;
-	TBool iWinActive;
-	TBool iTakeFocus;
-	TInt iNumButtons;
-	TInt iButWid;
-	CTBaseWin *iOldFocus;
-	TInt *iResultPtr;
-	TBuf<0x40> iLine1;
-	TBuf<0x40> iLine2;
-	TBuf<0x20> iButton[3];
-	TInt iButtonClickOn;
-	TUint iFlags;
-	CTAutoKey* iAutoKey;
-	};
-
-class CInfoDialog : public CTDialog
-	{		  
-private:
-	enum
-		{
-		eSeconds=1000000,
-		eTimes=6,
-		};
-public:
-	IMPORT_C CInfoDialog(CTWindowGroup *aGroupWin,CWindowGc *aGc);
-	IMPORT_C void ConstructLD();
-	IMPORT_C void TimerResults();
-	//Virtual function from CTDialog
-	IMPORT_C void ButtonPressL(TInt aButton);
-private:
-	void AppendProfileTime(TDes &aDes, TInt aNum);
-	void AppendProfileCount(TDes &aDes, TInt aNum);
-	void AddComma(TDes &aDes);
-private:
-	CTWindowGroup *iGroupWin;
-	CWindowGc *iGc;
-	};
-
-class CEventWindow : public CTWin
-	{
-public:
-	IMPORT_C CEventWindow(TInt aLogSize);
-	IMPORT_C ~CEventWindow();
-	IMPORT_C void ConstructL(CTWinBase &parent);
-	IMPORT_C void SetUpL(const TPoint &pos, CTWinBase *parent, CWindowGc &aGc);
-	IMPORT_C void Draw();
-	IMPORT_C void WinKeyL(const TKeyEvent &,const TTime &aTime);
-	IMPORT_C void LogEvent(const TWsEvent &aEvent);
-private:
-	void DrawLine(TInt aLine, const TDesC &aText);
-	void LogEvent(TInt aLogNum, const TWsEvent &aEvent);
-private:
-	TInt iLineHeight;
-	TInt iCount;
-	TInt iLogSize;
-	TInt iNumLogged;
-	TWsEvent *iLoggedEvents;
-	};
-
-class CBlankWindow : public CTWin
-	{
-public:
-	IMPORT_C CBlankWindow(TRgb aCol);
-	IMPORT_C CBlankWindow();
-	IMPORT_C void ConstructL(CTWinBase &parent);
-	IMPORT_C void SetColor(TRgb aColor);
-	IMPORT_C void RealDraw(TBool aRealDraw);
-	IMPORT_C virtual void Draw();
-	IMPORT_C void DrawNow();
-	IMPORT_C void DrawNow(TRect& aRect);
-	IMPORT_C TBool Check(const CTClient& aClient);
-protected:
-	TRgb iCol;
-	TBool iRealDraw;
-	};
-
-struct TSpriteCreateParams;
-
-class CTSpriteBase : public CBase
-	{
-public:
-	typedef void (*TSpriteDrawFunction)(CBitmapContext *aGc,TInt aIndex, const TSize &aSize, TBool aDoMask, TAny *aParam);
-protected:
-	virtual RWsSpriteBase &SpriteBase()=0;
-	void CreateBitmapL(CFbsBitmap *&aBitmap, CFbsBitmapDevice *&aBitmapDevice, TSpriteCreateParams *aParams, TBool aDoMask);
-public:
-	IMPORT_C void UpdateL(TInt aIndex, TSpriteCreateParams *aParams);
-	IMPORT_C void RedrawL(CFbsBitmap *&aBitmap, CFbsBitmap *&aMaskBitmap, TSpriteCreateParams *aParams);
-	};
-
-class CTSprite : public CTSpriteBase
-	{
-public:
-	IMPORT_C CTSprite(RWsSession &aWs);
-	IMPORT_C ~CTSprite();
-	IMPORT_C void ConstructL(RWindowTreeNode &aWindow, const TPoint &aPos, TInt aCount, TSpriteCreateParams *aParams, TInt aFlags);
-	IMPORT_C RWsSpriteBase &SpriteBase();
-	IMPORT_C RWsSprite &Sprite();
-private:
-	RWsSprite iSprite;
-	};
-
-class CTPointerCursor : public CTSpriteBase
-	{
-public:
-	IMPORT_C CTPointerCursor(RWsSession &aWs);
-	IMPORT_C ~CTPointerCursor();
-	IMPORT_C void ConstructL(TInt aFlags);
-	IMPORT_C void ConstructL(TInt aCount, TSpriteCreateParams *aParams, TInt aFlags, CFbsBitmap *&aBitmap, CFbsBitmap *&aMaskBitmap);
-	IMPORT_C void ConstructL(TInt aCount, TSpriteCreateParams *aParams, TInt aFlags);
-	IMPORT_C RWsSpriteBase &SpriteBase();
-	IMPORT_C RWsPointerCursor &PointerCursor();
-private:
-	RWsPointerCursor iCursor;
-	};
-
-struct TSpriteCreateParams
-	{
-public:
-	IMPORT_C TSpriteCreateParams(TSize aSize,TPoint aOffset,CTSpriteBase::TSpriteDrawFunction aDrawFunc,TAny *aDrawFuncParam=NULL, TBool aMask=ETrue,CGraphicsContext::TDrawMode aDrawMode=CGraphicsContext::EDrawModePEN);
-	IMPORT_C TSpriteCreateParams();
-public:
-	TSize iSize;
-	TPoint iOffset;
-	CTSpriteBase::TSpriteDrawFunction iDrawFunc;
-	TAny *iDrawFuncParam;
-	TBool iMask;
-	CGraphicsContext::TDrawMode iDrawMode;
-	TTimeIntervalMicroSeconds32 iInterval;
-	};
-
-class CTUser
-	{
-public:
-	IMPORT_C static void Splat(CTClient *aClient, const TRect &aRect, const TRgb &aRgb);
-	};
-
-IMPORT_C void DisplayDialog(const TWindowTitle &aTitle, const TDesC &aLine1, const TDesC &aLine2, const RWindowGroup *aGroup=NULL);
-IMPORT_C void DisplayDialog(TInt aScreenNumber,const TWindowTitle &aTitle, const TDesC &aLine1, const TDesC &aLine2, const RWindowGroup *aGroup=NULL);
-IMPORT_C void DisplayDialog(CTClient *aClient, const TWindowTitle &aTitle, const TDesC &aLine1, const TDesC &aLine2);
-IMPORT_C TInt TestLibStartUp(TCreateClientFunc aFunc);
-IMPORT_C TInt TestLibStartUp(TCreateClientFunc aFunc,TInt aScreenNumber);
-
-
-inline TRgb CTTitledWindow::Color()
-	{return(iWinColor);}
-inline CWindowGc *CTBaseWin::Gc()
-	{return(iGc);}
-inline RWindow *CTWin::Win() const
-	{return((RWindow *)BaseWin());}
-inline const RBlankWindow *CTBlankWindow::BlankWin()const
-	{return(&iWin);}
-inline RBlankWindow *CTBlankWindow::BlankWin()
-	{return(&iWin);}
-inline void CTClient::SetScreenNumber(TInt aScreenNumber)
-	{iScreenNumber=aScreenNumber;}
-inline CTEvent* CTClient::EventHandler()
-	{return iEventHandler;}
-inline CTRedraw* CTClient::RedrawHandler()
-	{return iRedrawEventHandler;}
-#endif
--- a/windowing/windowserver/tlisten/listener.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,380 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "listener.h"
-#include "wsgraphicdrawercontext.h"
-#include <graphics/wsscreendevice.h>
-#include <fbs.h>
-#include <bitdev.h>
-#include <bitstd.h>
-#ifdef __WINS__
-#include "../debuglog/osbwin.h"
-#endif
-
-const TInt KDefaultScreen 	= 0;
-const TInt KListenDisable 	= 0;
-const TInt KListenEnable  	= 1;
-const TInt KCmdQuery		= 2;
-
-const TUint8 KListenerInfoSig = 0xaa;
-
-NONSHARABLE_STRUCT(TListenerInfo)
-	{
-	TUint8 iSignature;
-	TInt iNumRect;
-	TRect iRect;
-	TInt iWindowGroupId;
-	};
-
-const TInt KMaxColors = 14;
-const TInt KColorList[KMaxColors] =
-	{
-	0x555555,
-	0x000080,
-	0x008000,
-	0x008080,
-	0x800000,
-	0x800080,
-	0x808000,
-	0x0000ff,
-	0x00ff00,
-	0x00ffff,
-	0xff0000,
-	0xff00ff,
-	0xffff00,
-	0xaaaaaa
-	};
-	
-CWsEventListener* CWsEventListener::NewL()
-	{
-	return new(ELeave) CWsEventListener;	
-	}
-	
-CWsEventListener::~CWsEventListener()
-	{
-	if (iEnabled)
-		Env().UnregisterEventHandler(this);
-
-#ifdef __WINS__
-	if (!iDisableWin)
-		delete iWin;
-#endif	
-	delete iGc;
-	delete iDev;
-	delete iBit;
-
-	if (iDrawerContext)
-		{
-		iDrawerContext->Destroy();
-		iDrawerContext = NULL;
-		}
-	}
-
-void CWsEventListener::ConstructL(MWsGraphicDrawerEnvironment& aEnv, const TGraphicDrawerId& aId, MWsClient& aOwner, const TDesC8& aData)
-	{
-	BaseConstructL(aEnv, aId, aOwner);
-
-#ifdef __WINS__
-	if (aData.Length()>0)
-		iDisableWin = aData[0]==1;
-#endif
-
-	iScreen = aEnv.Screen(KDefaultScreen);
-	MWsScreenConfig* screenConfig = iScreen->ObjectInterface<MWsScreenConfig>();
-	if (screenConfig)
-		{// Non NGA
-		iSize = screenConfig->SizeInPixels();
-		iDisplayMode = screenConfig->DisplayMode();
-		iDrawerContext = CWsGraphicDrawerNonNgaContext::NewL();
-		}
-	else
-		{// NGA
-		MWsScreenDevice* screenDevice = iScreen->ObjectInterface<MWsScreenDevice>();
-		User::LeaveIfNull(screenDevice);
-		iSize = screenDevice->SizeInPixels();
-		iDisplayMode = screenDevice->DisplayMode();
-		iDrawerContext = CWsGraphicDrawerNgaContext::NewL();
-		}
-
-	iWindowGroupId = KErrNotFound;
-
-	iBit = new(ELeave) CFbsBitmap;
-	User::LeaveIfError(iBit->Create(iSize,iDisplayMode));
-	iDev = CFbsBitmapDevice::NewL(iBit);
-	User::LeaveIfNull(iDev);
-	User::LeaveIfError(iDev->CreateContext(iGc));
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	iGc->SetPenStyle(CGraphicsContext::ENullPen);
-
-#ifdef __WINS__
-	if (!iDisableWin)	
-		{
-		_LIT(KListener, "EventListener");
-		iWin = CDebugOsbWin::NewL(KListener, iBit->SizeInPixels());
-		}
-#endif	
-	iReady = ETrue;
-	}
-
-void CWsEventListener::HandleMessage(const TDesC8& aData)
-	{
-	// wserv already check data size, and won't invoke this handler if it's empty
-	switch (aData[0])
-		{
-		case KListenEnable:
-		if (!iEnabled)
-			{
-			Env().RegisterEventHandler(this, this, TWservCrEvent::EScreenSizeModeChanged|TWservCrEvent::EWindowVisibilityChanged|TWservCrEvent::EWindowGroupChanged);
-			iEnabled = ETrue;
-			}
-		break;
-		
-		case KListenDisable:
-		if (iEnabled)
-			{
-			iEnabled = EFalse;
-			Env().UnregisterEventHandler(this);
-			}
-		break;
-		
-		case KCmdQuery:
-		SendInfo();
-		break;
-		}
-	}
-	
-void CWsEventListener::DoHandleEvent(const TWservCrEvent& aEvent)
-	{
-	if (!iReady)
-		return;
-	
-	switch (aEvent.Type())
-		{
-	case TWservCrEvent::EScreenSizeModeChanged:
-		OnScreenSizeModeChanged(aEvent.SizeMode());
-		break;
-		
-	case TWservCrEvent::EWindowVisibilityChanged:
-		OnWindowVisibilityChanged(aEvent.VisibleRegion());
-		break;
-
-	case TWservCrEvent::EWindowGroupChanged:
-		OnWindowGroupChanged(aEvent.ScreenNumber(), aEvent.WindowGroupIdentifier());
-		break;
-		}
-	}
-
-void CWsEventListener::DoDraw(MWsGc& aGc, const TRect& aRect, const TDesC8& /*aData*/) const
-	{
-	iDrawerContext->DrawEllipse(aGc, aRect, TRgb(0,255,0,128));
-	}
-
-void CWsEventListener::OnScreenSizeModeChanged(TInt /*aMode*/)
-	{
-	iGc->SetBrushColor(KRgbWhite);
-	iGc->Clear();
-
-#ifdef __WINS__	
-	if (!iDisableWin)
-		{
-		iBit->LockHeap();
-		iWin->Refresh(iBit->SizeInPixels(), iBit->DisplayMode(), iBit->DataAddress());
-		iBit->UnlockHeap();
-		}
-#endif	
-	}
-
-TRgb CWsEventListener::CurrentColor()
-	{
-	iColorIdx = (iColorIdx+1) % KMaxColors;
-	return TRgb(KColorList[iColorIdx]);
-	}
-
-void CWsEventListener::OnWindowVisibilityChanged(const RRegion* aRegion)
-	{
-	if (!aRegion)
-		return;
-	
-	TInt n = aRegion->Count();
-	if (n==0)
-		return;
-	iGc->SetBrushColor(CurrentColor());
-	for (TInt i=0; i<n; ++i)
-		{
-		iGc->DrawRect((*aRegion)[i]);
-		}
-		
-	iSaveNumRect = n;
-	iSaveRect = (*aRegion)[0];
-	
-#ifdef __WINS__
-	if (!iDisableWin)
-		{
-		iBit->LockHeap();
-		iWin->Refresh(iBit->SizeInPixels(), iBit->DisplayMode(), iBit->DataAddress());
-		iBit->UnlockHeap();
-		}
-#endif	
-	}
-
-void CWsEventListener::OnWindowGroupChanged(TInt /*aScreenNumber*/, TInt aWindowGroupId)
-	{
-	iWindowGroupId = aWindowGroupId;
-	}
-
-void CWsEventListener::SendInfo()
-	{
-	TPckgBuf<TListenerInfo> buf;
-	buf().iSignature = KListenerInfoSig;
-	buf().iNumRect = iSaveNumRect;
-	buf().iRect = iSaveRect;
-	buf().iWindowGroupId = iWindowGroupId;
-	TInt err = SendMessage(buf);
-	__ASSERT_ALWAYS(err>=KErrNone, User::Invariant());
-	iSaveNumRect = 0;
-	iSaveRect = TRect();
-	}
-
-CWsEventNotifier* CWsEventNotifier::NewL()
-	{
-	return new(ELeave) CWsEventNotifier;	
-	}
-	
-CWsEventNotifier::~CWsEventNotifier()
-	{
-	Env().UnregisterEventHandler(this);
-	}
-
-void CWsEventNotifier::ConstructL(MWsGraphicDrawerEnvironment& aEnv, const TGraphicDrawerId& aId, MWsClient& aOwner, const TDesC8& /*aData*/)
-	{
-	BaseConstructL(aEnv, aId, aOwner);
-	iEnv = &aEnv;
-	iTestGraphicDrawerEnvironment = EFalse;
-	iReady = ETrue;
-	}
-
-void CWsEventNotifier::HandleMessage(const TDesC8& aData)
-	{
-	// wserv already checked data size, and won't invoke this handler if it's empty
-	switch (aData[0])
-		{				//Set how it will handle the first visibility event
-		case KNotifyRemoveSelf:
-		case KNotifyRemoveThenAddSelf:
-		case KNotifyAddSelf:
-		case KNotifyRemoveOther:
-		case KNotifyRemoveThenAddOther:
-		case KNotifyAddOther:
-		case KNotifyRemoveSelfAndOther:
-		case KNotifyDoNothing:
-			Env().RegisterEventHandler(this, this, TWservCrEvent::EWindowVisibilityChanged);
-			iHandleMethod = aData[0];
-			break;
-		case KNotifyDisable:
-			Env().UnregisterEventHandler(this);
-			iHandleMethod = KNotifyDoNothing;
-			break;
-		default:
-			break;
-		}
-	}
-	
-void CWsEventNotifier::DoHandleEvent(const TWservCrEvent& /*aEvent*/)
-	{
-	if(!iTestGraphicDrawerEnvironment)
-		{
-		iTestGraphicDrawerEnvironment = ETrue;
-		TestGraphicDrawerEnvironment();
-		}
-	
-	if (iHandleMethod == KNotifyRemoveSelf)
-		{
-		Env().UnregisterEventHandler(this);
-		iHandleMethod = KNotifyDoNothing;
-		}
-	else if (iHandleMethod == KNotifyRemoveThenAddSelf)
-		{
-		Env().UnregisterEventHandler(this);
-		Env().RegisterEventHandler(this, this, TWservCrEvent::EWindowVisibilityChanged);
-		iHandleMethod = KNotifyDoNothing;
-		}
-	else if (iHandleMethod == KNotifyAddSelf)
-		{
-		Env().RegisterEventHandler(this, this, TWservCrEvent::EWindowVisibilityChanged);
-		iHandleMethod = KNotifyDoNothing;
-		}
-	else if (iHandleMethod == KNotifyRemoveOther)
-		{
-		iAnotherPluginID.iId = 0x102754c5;		//First method that needs the address of the other plugin
-		iAnotherPluginID.iIsUid = ETrue;
-		iAnotherPlugin = const_cast<CWsGraphicDrawer*>(Env().ResolveGraphic(iAnotherPluginID));
-		Env().UnregisterEventHandler(iAnotherPlugin);
-		iHandleMethod = KNotifyDoNothing;
-		}
-	else if (iHandleMethod == KNotifyRemoveThenAddOther)
-		{
-		Env().UnregisterEventHandler(iAnotherPlugin);
-		Env().RegisterEventHandler(iAnotherPlugin, this, TWservCrEvent::EWindowVisibilityChanged);
-		iHandleMethod = KNotifyDoNothing;
-		}
-	else if (iHandleMethod == KNotifyAddOther)
-		{
-		Env().RegisterEventHandler(iAnotherPlugin, this, TWservCrEvent::EWindowVisibilityChanged);
-		iHandleMethod = KNotifyDoNothing;
-		}
-	else if (iHandleMethod == KNotifyRemoveSelfAndOther)
-		{
-		Env().UnregisterEventHandler(this);
-		Env().UnregisterEventHandler(iAnotherPlugin);
-		iHandleMethod = KNotifyDoNothing;
-		}
-	}
-
-void CWsEventNotifier::DoDraw(MWsGc& /*aGc*/, const TRect& /*aRect*/, const TDesC8& /*aData*/) const
-	{
-	}
-
-void CWsEventNotifier::TestGraphicDrawerEnvironment()
-	{
-	const MWsGraphicDrawerEnvironment* aEnvConst = iEnv; 
-	TInt lowerbound = -1;
-	//-tests Screen methods (const and non const)
-	__ASSERT_ALWAYS(iEnv->Screen(lowerbound)==NULL, SendMessage(_L8("Error:iEnv->Screen(lowerbound) - expected: NULL, actual: !NULL (listener.cpp)")));
-	__ASSERT_ALWAYS(iEnv->Screen(iEnv->ScreenCount())==NULL, SendMessage(_L8("Error:iEnv->Screen(iEnv->ScreenCount()) - expected: NULL, actual: !NULL (listener.cpp)")));
-	__ASSERT_ALWAYS(aEnvConst->Screen(lowerbound)==NULL, SendMessage(_L8("Error:aEnvConst->Screen(lowerbound) - expected: NULL, actual: !NULL (listener.cpp)")));
-	__ASSERT_ALWAYS(aEnvConst->Screen(aEnvConst->ScreenCount())==NULL, SendMessage(_L8("Error:aEnvConst->ScreenCount()) - expected: NULL, actual: !NULL (listener.cpp)")));
-	//+test const screen method
-	const MWsScreen* constScreen = aEnvConst->Screen(aEnvConst->ScreenCount()-1);
-	__ASSERT_ALWAYS(constScreen!=NULL, SendMessage(_L8("Error:constScreen - expected: !NULL, actual: NULL (listener.cpp)")));
-	//+test resolveobjectinterface method
-	MWsActiveSchedulerDebug* scheduler = iEnv->ObjectInterface<MWsActiveSchedulerDebug>();
-	__ASSERT_ALWAYS(scheduler!=NULL, SendMessage(_L8("Error:scheduler - expected: !NULL, actual: NULL (listener.cpp)")));
-	TUint32 eventMask = 0;
-	//-tests for registereventhandler and unregistereventhandler
-	__ASSERT_ALWAYS(iEnv->RegisterEventHandler(NULL,this, TWservCrEvent::EWindowClosing)==KErrArgument, SendMessage(_L8("Error:iEnv->RegisterEventHandler(NULL,this, TWservCrEvent::EWindowClosing) - expected: KErrArgument, actual: !KErrArgument (listener.cpp)")));
-	__ASSERT_ALWAYS(iEnv->RegisterEventHandler(this,NULL, TWservCrEvent::EWindowClosing)==KErrArgument, SendMessage(_L8("Error:iEnv->RegisterEventHandler(this,NULL, TWservCrEvent::EWindowClosing) - expected: KErrArgument, actual: !KErrArgument (listener.cpp)")));
-	__ASSERT_ALWAYS(iEnv->RegisterEventHandler(this,this, eventMask)==KErrArgument, SendMessage(_L8("Error:iEnv->RegisterEventHandler(this,this, eventMask) - expected: KErrArgument, actual: !KErrArgument (listener.cpp)")));
-	__ASSERT_ALWAYS(iEnv->UnregisterEventHandler(NULL)==KErrArgument, SendMessage(_L8("Error:iEnv->UnregisterEventHandler(NULL) - expected: KErrArgument, actual: !KErrArgument (listener.cpp)")));
-	//-tests for registerwseventhandler
-#ifdef SYMBIAN_GRAPHICS_GCE	
-	__ASSERT_ALWAYS(iEnv->RegisterWsEventHandler(this, eventMask)==KErrArgument, SendMessage(_L8("Error:iEnv->RegisterWsEventHandler(this, eventMask) - expected: KErrArgument, actual: !KErrArgument (listener.cpp)")));
-	__ASSERT_ALWAYS(iEnv->RegisterWsEventHandler(NULL, TWservCrEvent::EWindowClosing)==KErrArgument, SendMessage(_L8("Error:iEnv->RegisterWsEventHandler(NULL, TWservCrEvent::EWindowClosing) - expected: KErrArgument, actual: !KErrArgument (listener.cpp)")));
-#endif //SYMBIAN_GRAPHICS_GCE
-	}
--- a/windowing/windowserver/tlisten/listener.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,118 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __LISTENER_H__
-#define __LISTENER_H__
-
-#include <bitstd.h>
-#include "Graphics/WSGRAPHICDRAWER.H"
-#include <Graphics/WSGRAPHICDRAWERINTERFACE.H>
-
-class CFbsBitmap;
-class CFbsBitmapDevice;
-class CFbsBitGc;
-class MWsGraphicDrawerContext;
-#ifdef __WINS__
-class CDebugOsbWin;
-#endif
-
-const TInt KNotifyRemoveSelf = 0;
-const TInt KNotifyRemoveThenAddSelf = 1;
-const TInt KNotifyAddSelf = 2;
-const TInt KNotifyRemoveOther = 3;
-const TInt KNotifyRemoveThenAddOther = 4;
-const TInt KNotifyAddOther = 5;
-const TInt KNotifyRemoveSelfAndOther = 6;
-const TInt KNotifyDoNothing = 7;
-const TInt KNotifyDisable = 8;
-
-NONSHARABLE_CLASS(CWsEventListener): public CWsGraphicDrawer, public MWsEventHandler
-	{
-public:
-	enum {EImplUid = 0x10281fb7};	
-		
-public:		
-	static CWsEventListener* NewL();
-	virtual ~CWsEventListener();
-
-	// override CWsGraphicDrawer
-	virtual void ConstructL(MWsGraphicDrawerEnvironment& aEnv,const TGraphicDrawerId& aId, MWsClient& aOwner, const TDesC8& aData);
-	virtual void HandleMessage(const TDesC8& aData);
-	// override MWsEventHandler
-	virtual void DoHandleEvent(const TWservCrEvent& aEvent);
-private:
-	// override CWsGraphicDrawer
-	virtual void DoDraw(MWsGc& aGc, const TRect& aRect, const TDesC8& aData) const;
-
-	void OnScreenSizeModeChanged(TInt aMode);
-	void OnWindowVisibilityChanged(const RRegion* aRegion);
-	TRgb CurrentColor();
-	void SendInfo();
-	void OnWindowGroupChanged(TInt aScreenNumber, TInt aWindowGroupId);
-private:
-	MWsGraphicDrawerContext* iDrawerContext;
-	CFbsBitmap* iBit;
-	CFbsBitmapDevice* iDev;
-	CFbsBitGc* iGc;
-#ifdef __WINS__	
-	CDebugOsbWin* iWin;
-	TBool iDisableWin;	
-#endif
-	TBool iEnabled;
-	TBool iReady;
-	TSize iSize;
-	TDisplayMode iDisplayMode;
-	MWsScreen* iScreen;
-	TInt iColorIdx;
-	TInt iSaveNumRect;
-	TRect iSaveRect;
-	TInt iWindowGroupId;	
-	};
-
-NONSHARABLE_CLASS(CWsEventNotifier): public CWsGraphicDrawer, public MWsEventHandler
-	{
-public:
-	enum {	EImplUid1 = 0x102754c4,
-			EImplUid2 = 0x102754c6};
-		
-public:		
-	static CWsEventNotifier* NewL();
-	virtual ~CWsEventNotifier();
-
-	// override CWsGraphicDrawer
-	virtual void ConstructL(MWsGraphicDrawerEnvironment& aEnv,const TGraphicDrawerId& aId, MWsClient& aOwner, const TDesC8& aData);
-	virtual void HandleMessage(const TDesC8& aData);
-	// override MWsEventHandler
-	virtual void DoHandleEvent(const TWservCrEvent& aEvent);
-private:
-	// override CWsGraphicDrawer
-	virtual void DoDraw(MWsGc& aGc, const TRect& aRect, const TDesC8& aData) const;
-	void TestGraphicDrawerEnvironment();
-private:
-	TBool iReady;
-	TInt iHandleMethod;
-	TGraphicDrawerId iAnotherPluginID;
-	CWsGraphicDrawer* iAnotherPlugin;
-	TBool iTestGraphicDrawerEnvironment;
-	MWsGraphicDrawerEnvironment* iEnv;
-	};
-
-#endif
--- a/windowing/windowserver/tlisten/listener.rss	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include <ecom/registryinfo.rh>
-
-RESOURCE REGISTRY_INFO registry_info
-	{
-	dll_uid = 0x10281fb5;
-	interfaces =
-		{
-		INTERFACE_INFO
-			{
-			interface_uid = 0x10281fb6;
-			implementations =
-				{
-				IMPLEMENTATION_INFO
-					{
-					implementation_uid = 0x10281fb7;
-					version_no = 1;
-					display_name = "CWsEventListener";
-					default_data = "";
-					opaque_data = "";
-					}
-				};
-			},
-		INTERFACE_INFO
-			{
-			interface_uid = 0x102754c3;
-			implementations =
-				{
-				IMPLEMENTATION_INFO
-					{
-					implementation_uid = 0x102754c4;
-					version_no = 1;
-					display_name = "CWsEventNotifier1";
-					default_data = "";
-					opaque_data = "";
-					}
-				};
-			},
-		INTERFACE_INFO
-			{
-			interface_uid = 0x102754c5;
-			implementations =
-				{
-				IMPLEMENTATION_INFO
-					{
-					implementation_uid = 0x102754c6;
-					version_no = 1;
-					display_name = "CWsEventNotifier2";
-					default_data = "";
-					opaque_data = "";
-					}
-				};
-			}
-		};
-	}
--- a/windowing/windowserver/tlisten/proxy.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include <ecom/implementationproxy.h>
-#include "listener.h"
-
-
-LOCAL_C const TImplementationProxy KImplementationTable[] =
-	{
-	IMPLEMENTATION_PROXY_ENTRY(CWsEventListener::EImplUid, CWsEventListener::NewL),
-	IMPLEMENTATION_PROXY_ENTRY(CWsEventNotifier::EImplUid1, CWsEventNotifier::NewL),
-	IMPLEMENTATION_PROXY_ENTRY(CWsEventNotifier::EImplUid2, CWsEventNotifier::NewL)
-	};
-
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
-	{
-	aTableCount = sizeof(KImplementationTable)/sizeof(TImplementationProxy);
-	return KImplementationTable;
-	}
--- a/windowing/windowserver/tlisten/wsgraphicdrawercontext.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef __WSGRAPHICDRAWERCONTEXT_H__
-#define __WSGRAPHICDRAWERCONTEXT_H__
-
-#include <e32base.h>
-#include <e32std.h>
-
-class MWsGc;
-class TRgb;
-
-class MWsGraphicDrawerContext
-	{
-public:
-	virtual void Destroy() = 0;
-	virtual void DrawEllipse(MWsGc& aGc, const TRect& aRect, const TRgb& aColor) const = 0;
-	};
-
-class CWsGraphicDrawerNgaContext : public CBase, public MWsGraphicDrawerContext
-	{
-public:
-	static MWsGraphicDrawerContext* NewL();
-public:
-	void Destroy();
-	void DrawEllipse(MWsGc& aGc, const TRect& aRect, const TRgb& aColor) const;
-	};
-
-class CWsGraphicDrawerNonNgaContext : public CBase, public MWsGraphicDrawerContext
-	{
-public:
-	static MWsGraphicDrawerContext* NewL();
-public:
-	void Destroy();
-	void DrawEllipse(MWsGc& aGc, const TRect& aRect, const TRgb& aColor) const;
-	};
-
-#endif // __WSGRAPHICDRAWERCONTEXT_H__
--- a/windowing/windowserver/tlisten/wsgraphicdrawerngacontext.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#define SYMBIAN_GRAPHICS_GCE
-
-#include "wsgraphicdrawercontext.h"
-#include <graphics/wsgraphicscontext.h>
-
-MWsGraphicDrawerContext* CWsGraphicDrawerNgaContext::NewL()
-	{
-	return new(ELeave) CWsGraphicDrawerNgaContext();
-	}
-
-void CWsGraphicDrawerNgaContext::Destroy()
-	{
-	delete this;
-	}
-
-void CWsGraphicDrawerNgaContext::DrawEllipse(MWsGc& aGc, const TRect& aRect, const TRgb& aColor) const
-	{
-	MWsGraphicsContext* context = aGc.ObjectInterface<MWsGraphicsContext>();
-	if (context)
-		{
-		context->Push();
-		context->SetBrushStyle(MWsGraphicsContext::ESolidBrush);
-		context->SetBrushColor(aColor);
-		context->DrawEllipse(aRect);
-		context->Pop();
-		}
-	}
--- a/windowing/windowserver/tlisten/wsgraphicdrawernonngacontext.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#undef SYMBIAN_GRAPHICS_GCE
-
-#include "wsgraphicdrawercontext.h"
-#include <graphics/wsgraphicdrawerinterface.h>
-#include <bitstd.h>
-
-MWsGraphicDrawerContext* CWsGraphicDrawerNonNgaContext::NewL()
-	{
-	return new(ELeave) CWsGraphicDrawerNonNgaContext();
-	}
-
-void CWsGraphicDrawerNonNgaContext::Destroy()
-	{
-	delete this;
-	}
-
-void CWsGraphicDrawerNonNgaContext::DrawEllipse(MWsGc& aGc, const TRect& aRect, const TRgb& aColor) const
-	{
-	aGc.PushBitGcSettings();
-	CFbsBitGc& bitGc = aGc.BitGc();
-	bitGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
-	bitGc.SetBrushColor(aColor);
-	bitGc.DrawEllipse(aRect);
-	aGc.PopBitGcSettings();
-	}
--- a/windowing/windowserver/tlisten/wslisten.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,178 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// The plug-in provides the client side CWsGraphic instance CWsListen, which is used in 
-// GRAPHICS-WSERV-0023 and GRAPHICS-WSERV-0024. 
-// This is also used for Test Case GRAPHICS-WSERV-0058 for INC094118: CWsGraphicDrawer::SendMessage panics window server. 
-// The customer incident "INC094118" reports the failure of CWsGraphicDrawer::SendMessage(const TDesC8& aData)
-// when the event message iEventMsg is not ready. The defect is reproduced by calling QueryPlugin(aInfo) 
-// once again to wserv plug-in side in the CWsListen::HandleMessage(const TDesC8& aData), when the event 
-// message has not yet been reset by CWsGraphic::CManager. Certainly in practice there are many other cases
-// which could trigger the defect. 
-// The fix is added in CWsGraphicMessageQueue::Queue(CMessage* aMessage), where we check whether the iEventMsg 
-// is empty or not. As a result, if iEventMsg is not ready we do not signal event but keep message untouched in queue. 
-// nce the iEventMsg is set ready, an event is signaleed immediately if there is a waiting event and message 
-// will be popped out of the queue.
-// The test of defect-fixing INC094118 can be enabled by initialising iTestFlag to ETrue. Setting iTestFlag to
-// EFalse will not trigger the defect. A new test case is written to trigger the defect only once.
-// 
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "wslisten.h"
-
-const TUid KListenerInterfaceId = {0x10281fb6};
-const TUid KListenerImplId = {0x10281fb7};
-const TUid KNotifierInterfaceId1 = {0x102754c3};
-const TUid KNotifierImplId1 = {0x102754c4};
-const TUid KNotifierInterfaceId2 = {0x102754c5};
-const TUid KNotifierImplId2 = {0x102754c6};
-
-const TUint8 KCmdDisable 	= 0;
-const TUint8 KCmdEnable  	= 1;
-const TUint8 KCmdQuery		= 2;	
-
-EXPORT_C CWsListen* CWsListen::NewL()
-	{
-	return NewL(EFalse);
-	}
-
-EXPORT_C CWsListen* CWsListen::NewL(TBool aDisableWin)
-	{
-	CWsListen* self = new(ELeave) CWsListen;
-	CleanupStack::PushL(self);
-	TBuf8<1> data;
-	data.Append((TUint8)aDisableWin);
-	self->BaseConstructL(KListenerInterfaceId, KListenerImplId, data);
-	CleanupStack::Pop(self);
-	//Initialise the test flag to EFalse if dont want to reproduce the INC094118 and test the fix
-	self->iTestFlag = EFalse;
-	self->iIsReady = ETrue;
-	return self;
-	}
-
-EXPORT_C CWsListen::~CWsListen()
-	{
-	iIsReady = EFalse;
-	}
-
-EXPORT_C void CWsListen::SetTestFlag()
-	{
-	//Set the test flag to ETrue if want to reproduce the INC094118 and test the fix
-	iTestFlag = ETrue;
-	}
-
-void CWsListen::HandleMessage(const TDesC8& aData)
-	{
-	if (aData[0]==KListenerInfoSig)
-		Mem::Copy(iReq, aData.Ptr(), aData.Size());
-	//The if-statement allows to call QueryPlugin() in HandleMessage() only once to reproduce the defect INC094118.
-	//Otherwise HandleMessage() will behave as normal. 
-	if (iTestFlag)
-		{
-	    TListenerInfo aInfo;
-		QueryPlugin(aInfo) ;
-		iTestFlag = EFalse;
-		}
-	else
-		{
-		iCallBack.CallBack();
-		}
-	}
-
-void CWsListen::OnReplace()
-	{
-	}
-
-EXPORT_C TInt CWsListen::Enable(TBool aEnabled)
-	{
-	if (!iIsReady)
-		return KErrNotReady;
-	
-	TBuf8<1> cmd;
-	cmd.Append(aEnabled? KCmdEnable : KCmdDisable);
-	SendMessage(cmd);
-	return Flush();
-	}
-
-EXPORT_C TInt CWsListen::QueryPlugin(TListenerInfo& aInfo)
-	{
-	TBuf8<1> cmd;
-	cmd.Append(KCmdQuery);
-	SendMessage(cmd);
-	TInt err = Flush();
-	if (err!=KErrNone)
-		return err;
-	iReq = &aInfo;
-	return KErrNone;	
-	}
-
-EXPORT_C void CWsListen::SetCallBack(TCallBack aCallBack)
-	{
-	iCallBack = aCallBack;
-	}
-
-EXPORT_C CWsNotify* CWsNotify::NewL()
-	{
-	return NewL(EFalse);
-	}
-
-EXPORT_C CWsNotify* CWsNotify::NewL(TBool aPluginOrder)
-	{
-	CWsNotify* self = new(ELeave) CWsNotify;
-	CleanupStack::PushL(self);
-	TBuf8<1> data;
-	data.Append(8);
-	if (!aPluginOrder)				//Different IDs so 2 plugins may be registered at once
-		self->BaseConstructL(KNotifierInterfaceId1, KNotifierImplId1, data);
-	else
-		self->BaseConstructL(KNotifierInterfaceId2, KNotifierImplId2, data);
-	CleanupStack::Pop(self);
-	self->iIsReady = ETrue;
-	self->iResult = ETrue;
-	return self;
-	}
-
-EXPORT_C CWsNotify::~CWsNotify()
-	{
-	iIsReady = EFalse;
-	}
-
-void CWsNotify::HandleMessage(const TDesC8& aData)
-	{
-	TBuf8<100> KTesting(_L8("Error:"));
-	if(aData.Find(KTesting)!=KErrNotFound)
-		{
-		iError.Copy(aData);
-		iResult = EFalse;
-		}
-	}
-
-void CWsNotify::OnReplace()
-	{
-	}
- 
-EXPORT_C TInt CWsNotify::SetBehaviour(TInt aType)
-	{
-	if (!iIsReady)
-		return KErrNotReady;
-	TBuf8<1> cmd;
-	cmd.Append(aType);
-	SendMessage(cmd);
-	return Flush();
-	}
--- a/windowing/windowserver/tlisten/wslisten.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __WSLISTEN_H__
-#define __WSLISTEN_H__
-
-#include <w32std.h>
-
-const TUint8 KListenerInfoSig = 0xaa;
-
-NONSHARABLE_STRUCT(TListenerInfo)
-	{
-	TUint8 iSignature;
-	TInt iNumRect;
-	TRect iRect;
-	TInt iWindowGroupId;
-	};
-
-NONSHARABLE_CLASS(CWsListen): public CWsGraphic
-	{
-public:		
-	IMPORT_C static CWsListen* NewL();
-	IMPORT_C static CWsListen* NewL(TBool aDisableWin);	
-	IMPORT_C ~CWsListen();
-	IMPORT_C TInt Enable(TBool aEnabled);
-	IMPORT_C void SetCallBack(TCallBack aCallBack);
-	IMPORT_C TInt QueryPlugin(TListenerInfo& aInfo);
-	IMPORT_C void SetTestFlag();
-private:
-	// override CWsGraphic
-	virtual void HandleMessage(const TDesC8& aData);
-	virtual void OnReplace();
-private:
-	TBool iIsReady;
-	TCallBack iCallBack;
-	TListenerInfo* iReq;
-	TBool iTestFlag;
-	};
-
-NONSHARABLE_CLASS(CWsNotify): public CWsGraphic
-	{
-public:		
-	IMPORT_C static CWsNotify* NewL();
-	IMPORT_C static CWsNotify* NewL(TBool aPluginOrder);	
-	IMPORT_C ~CWsNotify();
-	IMPORT_C TInt SetBehaviour(TInt aType);
-private:
-	// override CWsGraphic
-	virtual void HandleMessage(const TDesC8& aData);
-	virtual void OnReplace();
-private:
-	TBool iIsReady;
-public:
-	TBool iResult;
-	TBuf16<100> iError; 
-	};
-
-#endif
--- a/windowing/windowserver/tman/DUMMYM.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Simple dummy test, to be used as example for new tests
-// 
-//
-
-#include <e32std.h>
-#include "W32STD.H"
-#include "../tlib/testbase.h"
-#include "TMAN.H"
-
-class TDummyTest : public CTestBase
-	{
-public:
-	TDummyTest();
-	TestState DoTestL();
-	void ConstructL();
-private:
-	TSize iWinSize;
-	TInt iState;
-	};
-
-GLDEF_C CTestBase *CreateDummyTest()
-	{
-	return(new(ELeave) TDummyTest());
-	}
-
-TDummyTest::TDummyTest() : CTestBase(_L("Dummy"))
-	{}
-
-void TDummyTest::ConstructL()
-	{
-	}
-
-TestState TDummyTest::DoTestL()
-	{
-	switch(iState)
-		{
-		case 0:
-			LogSubTest(_L("Dummy 1"),1);
-			TestL(ETrue);
-			iState++;
-			break;
-		default:
-			return(EFinished);
-		}
-	return(ENext);
-	}
-
--- a/windowing/windowserver/tman/HOTKEY2.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,424 +0,0 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test capture key
-// 
-//
-
-#include <e32std.h>
-#include <e32svr.h>
-#include "W32STD.H"
-#include "../tlib/testbase.h"
-#include "TMAN.H"
-
-enum THotKeyRetValues
-	{
-	EHotKeyOkay,
-	EHotKeyRetry,
-	EHotKeyFail,
-	};
-
-struct SHotKeyParams
-	{
-	THotKey hotKey;
-	TUint keyCode;
-	TUint mod_mask;
-	TUint modifiers;
-	};
-
-struct SHotKeyTestParams
-	{
-	TText *txt;			// Text message telling user what to do
-	};
-
-LOCAL_D SHotKeyParams HotKeys[]={
-	{EHotKeyEnableLogging,'e',EModifierFunc|EModifierCtrl|EModifierShift,0},
-	{EHotKeyDisableLogging,'d',EModifierFunc|EModifierCtrl|EModifierShift,EModifierFunc},
-	{EHotKeyOfDeath,'q',0},
-	{EHotKeyOfDeath,'w',0},
-	};
-	
-LOCAL_D SHotKeyTestParams HotKeyTests[]={
-	{(TText *)_S("Use \"e\" to enable logging")},
-	{(TText *)_S("Use \"<Alt>d\" to disable logging")},
-	{(TText *)_S("Use \"q\" to kill the foreground app")},
-	{(TText *)_S("Use \"w\" to kill the foreground app")},
-	{(TText *)_S("Use \"<Cntrl><Alt><Shift>K\" to kill the foreground app")},
-	};
-
-LOCAL_D TBool HotKeyTestIsDeathTest[]={EFalse, EFalse, ETrue, ETrue, ETrue};
-
-struct SErrorHotKey
-	{
-	THotKey hotKey;
-	TUint keyCode;
-	TUint mod_mask;
-	TUint modifiers;
-	};
-
-LOCAL_D SErrorHotKey errorKeys[]={
-	{EHotKeyEnableLogging,'a',EModifierFunc|EModifierShift,EModifierFunc|EModifierCtrl},
-	{EHotKeyDisableLogging,'1',0,EModifierFunc},
-	{EHotKeyEnableLogging,3,EModifierCtrl,EModifierCtrl|EModifierShift},
-	{EHotKeyDisableLogging,'a',EModifierFunc|EModifierShift,EModifierFunc|EModifierCtrl},
-	{(THotKey)100,'1',0,EModifierFunc},
-	{(THotKey)200, 3,EModifierCtrl,EModifierCtrl|EModifierShift},
-	};
-
-const TInt numHotKeys=sizeof(HotKeys)/sizeof(HotKeys[0]);
-const TInt numHotKeyTests=sizeof(HotKeyTests)/sizeof(HotKeyTests[0]);
-const TInt numErrorKeys=sizeof(errorKeys)/sizeof(errorKeys[0]);
-
-class SHKWindow;
-class THotKeyTest;
-class SHKConnection;
-
-class SHKDeath : public CActive
-	{
-public:
-	SHKDeath(TInt aPriority);
-	void SetConnection(SHKConnection *aConn);
-	virtual void DoCancel();
-	virtual void RunL();
-	void Request();
-private:
-	SHKConnection *iConn;
-	};
-
-class SHKWindowGroup : public CTWindowGroup
-	{
-public:
-	SHKWindowGroup(CTClient *aClient);
-	void KeyL(const TKeyEvent &aKey,const TTime &aTime);
-	};
-
-class SHKConnection : public CTClient
-	{
-public:
-	SHKConnection(THotKeyTest *aTest, TInt aMode);
-	~SHKConnection();
-	void ConstructL();
-	void KeyL(const TKeyEvent &aKey);
-	void SubStateChangedL();
-	void CompleteL();
-protected:
-	TInt iMode;
-	SHKDeath iDeath;
-	THotKeyTest *iTest;
-	CTWin *iWin;
-	static TInt iMainWinId;
-	};
-
-class SHKWindow : public CTWin
-	{
-public:
-	SHKWindow(THotKeyTest *aTest);
-	void SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
-	void Draw();
-protected:
-	THotKeyTest *iTest;
-	TRgb iBack;
-	};
-
-class SHKWindow2 : public CTWin
-	{
-public:
-	SHKWindow2();
-	void SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
-	void Draw();
-	};
-
-class THotKeyTest : public CTestBase
-	{
-public:
-	THotKeyTest();
-	~THotKeyTest();
-	TestState DoTestL();
-	void ConstructL();
-	void EndCaptureKeyTest();
-	TInt SubState() const;
-	void IncSubStateL();
-	void BadParamsL();
-private:
-	SHKConnection *iConn1;
-	TSize iWinSize;
-	TInt iState;
-	TInt iSubState;
-	TBool iIsInActiveScheduler;
-	};
-
-TInt SHKConnection::iMainWinId;
-
-TInt SubThread(TAny *);
-
-GLDEF_C CTestBase *CreateHotKeyTest()
-	{
-	return(new(ELeave) THotKeyTest());
-	}
-
-THotKeyTest::THotKeyTest() : CTestBase(_L("Hot Key"))
-	{}
-
-THotKeyTest::~THotKeyTest()
-	{
-	User::SetJustInTime(ETrue);
-	for(TInt index=0;index<numHotKeys;index++)
-		{
-		Client()->iWs.ClearHotKeys(HotKeys[index].hotKey);
-		Client()->iWs.RestoreDefaultHotKey(HotKeys[index].hotKey);
-		}
-	delete iConn1;
-	if (iIsInActiveScheduler)
-		CActiveScheduler::Stop();
-	}
-
-void THotKeyTest::EndCaptureKeyTest()
-	{
-	Request();
-	}
-
-void THotKeyTest::ConstructL()
-	{
-	iConn1=new(ELeave) SHKConnection(this, EFalse);
-	iConn1->ConstructL();
-	for(TInt index=0;index<numHotKeys;index++)
-		User::LeaveIfError(Client()->iWs.SetHotKey(HotKeys[index].hotKey, HotKeys[index].keyCode,HotKeys[index].mod_mask,HotKeys[index].modifiers));
-	User::SetJustInTime(EFalse);
-	}
-
-//
-// SHKDeath //
-//
-
-SHKDeath::SHKDeath(TInt aPriority) : CActive(aPriority)
-	{
-	CActiveScheduler::Add(this);
-	}
-
-void SHKDeath::SetConnection(SHKConnection *aConn)
-	{
-	iConn=aConn;
-	}
-
-void SHKDeath::DoCancel()
-	{
-	}
-
-void SHKDeath::RunL()
-	{
-	iConn->CompleteL();
-	}
-
-void SHKDeath::Request()
-	{
-	SetActive();
-	}
-
-//
-
-SHKWindowGroup::SHKWindowGroup(CTClient *aClient) : CTWindowGroup(aClient)
-	{}
-
-void SHKWindowGroup::KeyL(const TKeyEvent &aKey,const TTime &)
-	{
-	((SHKConnection *)iClient)->KeyL(aKey);
-	}
-
-//
-// SHKConnection
-
-SHKConnection::SHKConnection(THotKeyTest *aTest, TInt aMode) : iMode(aMode), iDeath(100), iTest(aTest)
-	{
-	iDeath.SetConnection(this);
-	}
-
-SHKConnection::~SHKConnection()
-	{
-	iGroup->GroupWin()->EnableReceiptOfFocus(EFalse);
-	CTWin::Delete(iWin);
-	}
-
-void SHKConnection::KeyL(const TKeyEvent &aKey)
-	{
-	if (iTest)
-		{
-		if (aKey.iCode==EKeyEnter && !HotKeyTestIsDeathTest[iTest->SubState()])
-			iTest->IncSubStateL();
-		else if (aKey.iCode==EKeyEscape)
-			iTest->AbortL();
-		}
-	}
-
-void SHKConnection::CompleteL()
-	{
-	iTest->IncSubStateL();
-	}
-
-void SHKConnection::SubStateChangedL()
-	{
-	if (HotKeyTestIsDeathTest[iTest->SubState()])
-		{
-		RThread thread;
-		iMainWinId=iGroup->GroupWin()->Identifier();
-		TInt subState=iTest->SubState();
-		User::After(100000);
-		User::LeaveIfError(thread.Create(_L("SubThread"),SubThread,KDefaultStackSize,0x2000,0x2000,&subState,EOwnerThread));
-		thread.Logon(iDeath.iStatus);
-		iDeath.Request();
-		thread.Resume();
-		thread.Close();
-		}
-	iWin->Invalidate();
-	iWs.Flush();
-	}
-
-void SHKConnection::ConstructL()
-	{
-	CTClient::ConstructL();
-	iGroup=new(ELeave) SHKWindowGroup(this);
-	iGroup->ConstructL();
-	TSize screenSize=iGroup->Size();
-	iGroup->GroupWin()->AutoForeground(EFalse);		// Don't allow clicking to cause foreground, might mess up test
-	TInt winWidth;
-	TInt winHeight;
-	if (iMode==0)
-		{
-		winWidth=screenSize.iWidth/2;
-		winHeight=screenSize.iHeight-10;
-		SHKWindow *win=new(ELeave) SHKWindow(iTest);
-		win->SetUpL(TPoint(5,5),TSize(winWidth,winHeight),iGroup,*iGc);
-		iWin=win;
-		}
-	else
-		{
-		winWidth=150;
-		winHeight=50;
-		iGroup->GroupWin()->SetOwningWindowGroup(iMainWinId);
-		SHKWindow2 *win=new(ELeave) SHKWindow2();
-		win->SetUpL(TPoint((screenSize.iWidth-winWidth)/2,(screenSize.iHeight-winHeight)/2),TSize(winWidth,winHeight),iGroup,*iGc);
-		iWin=win;
-		}
-	iWs.Flush();
-	}
-
-//
-// SHKWindow, class //
-//
-
-SHKWindow::SHKWindow(THotKeyTest *aTest) : CTWin(), iTest(aTest)
-	{
-	iBack=TRgb::Gray256(230);
-	}
-
-void SHKWindow::SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc)
-	{
-	ConstructExtLD(*parent,pos,size);
-	iWin.SetBackgroundColor(iBack);
-	Activate();
-	AssignGC(aGc);
-	}
-
-void SHKWindow::Draw()
-	{
-	iGc->Clear();
-	iGc->DrawText(TPtrC(HotKeyTests[iTest->SubState()].txt), TPoint(10,20));
-	iGc->DrawText(TPtrC(_L("Press <Enter> when tested okay")), TPoint(10,35));
-	iGc->DrawText(TPtrC(_L("or escape to abort tests")), TPoint(10,50));
-	}
-
-//
-// SHKWindow2, class //
-//
-
-SHKWindow2::SHKWindow2() : CTWin()
-	{
-	}
-
-void SHKWindow2::SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc)
-	{
-	ConstructExtLD(*parent,pos,size);
-	iWin.SetBackgroundColor(TRgb(0,0,0));
-	Activate();
-	AssignGC(aGc);
-	}
-
-void SHKWindow2::Draw()
-	{
-	iGc->SetBrushColor(TRgb::Gray4(1));
-	iGc->Clear();
-	iGc->SetPenColor(TRgb::Gray4(3));
-	iGc->DrawText(TPtrC(_L("Kill me!!!")), TPoint(10,15));
-	}
-
-//
-
-TInt THotKeyTest::SubState() const
-	{
-	return(iSubState);
-	}
-
-void THotKeyTest::IncSubStateL()
-	{
-	if (iSubState==(numHotKeyTests-1))
-		EndCaptureKeyTest();
-	else
-		{
-		iSubState++;
-		iConn1->SubStateChangedL();
-		}
-	}
-
-void THotKeyTest::BadParamsL()
-	{
-	TInt resCount=Client()->iWs.ResourceCount();
-	for(TInt index=0;index<numErrorKeys;index++)
-		TestL(Client()->iWs.SetHotKey(errorKeys[index].hotKey, errorKeys[index].keyCode,errorKeys[index].mod_mask,errorKeys[index].modifiers)==KErrArgument);
-	TestL(Client()->iWs.ResourceCount()==resCount);
-	}
-
-TestState THotKeyTest::DoTestL()
-	{
-	switch(iState)
-		{
-		case 0:
-			LogSubTest(_L("Errors"),1);
-			BadParamsL();
-			LogSubTest(_L("CaptureKey"),2);
-			iState++;
-			return(EContinue);
-		default:
-			return(EFinished);
-		}
- 	}
-
-//======================================================//
-// Sub thread to do tests and get shot by window server //
-//======================================================//
-
-void SubThreadMain()
-	{
-	CActiveScheduler *TheActiveScheduler=new(ELeave) CActiveScheduler;
-	CActiveScheduler::Install(TheActiveScheduler);
-	SHKConnection *conn=new(ELeave) SHKConnection(NULL, ETrue);
-	conn->ConstructL();
-	CActiveScheduler::Start();
-	delete TheActiveScheduler;
-	}
-
-TInt SubThread(TAny *)
-	{
-	CTrapCleanup* CleanUpStack=CTrapCleanup::New();
-	TRAPD(err,SubThreadMain());
-	delete CleanUpStack;
-	return(err);
-	}
--- a/windowing/windowserver/tman/MULTICON.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,446 +0,0 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test multiple connections to the window server
-// 
-//
-
-#include <e32std.h>
-#include <e32svr.h>
-#include "W32STD.H"
-#include "../tlib/testbase.h"
-#include "TMAN.H"
-
-const TInt EMaxSubState=3;
-
-class CMcWindowBase;
-class TMultiConTest;
-
-class CMcConnectionBase : public CTClient
-	{
-public:
-	CMcConnectionBase(TMultiConTest *aTest);
-	~CMcConnectionBase();
-	virtual void ConstructL();
-	void SubStateChanged();
-protected:
-	TMultiConTest *iTest;
-	CMcWindowBase *iWin;
-	CWindowGc *iGc;
-	};
-
-class CMcConnection : public CMcConnectionBase	// Sets AutoForeground off
-	{
-public:
-	CMcConnection(TMultiConTest *aTest);
-	void ConstructL();
-	};
-
-class CMcWindowGroupAf : public CTWindowGroup
-	{
-public:
-	CMcWindowGroupAf(CTClient *aClient);
-	void KeyL(const TKeyEvent &aKey, const TTime &aTime);
-	};
-
-class CMcConnectionAf : public CMcConnectionBase	// Sets AutoForeground on
-	{
-public:
-	CMcConnectionAf(TMultiConTest *aTest);
-	void ConstructL();
-	void KeyL(const TKeyEvent &aKey);
-	};
-
-class CMcConnectionDef : public CMcConnectionBase	// Leaves AutoForeground as the default value
-	{
-public:
-	CMcConnectionDef(TMultiConTest *aTest);
-	void ConstructL();
-	};
-
-class CMcWindowBase : public CTWin
-	{
-public:
-	CMcWindowBase(TMultiConTest *aTest);
-	void SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
-	virtual void Draw()=0;
-	virtual void PointerL(const TPointerEvent &pointer,const TTime &)=0;
-protected:
-	TMultiConTest *iTest;
-	TRgb iBack;
-	};
-
-class CMcWindow : public CMcWindowBase
-	{
-public:
-	CMcWindow(TMultiConTest *aTest);
-	virtual void Draw();
-	virtual void PointerL(const TPointerEvent &pointer,const TTime &);
-	};
-
-class CMcWindowAf : public CMcWindowBase
-	{
-public:
-	CMcWindowAf(TMultiConTest *aTest);
-	virtual void Draw();
-	virtual void PointerL(const TPointerEvent &pointer,const TTime &);
-	void ConstructL();
-	};
-
-class CMcWindowDef : public CMcWindowBase
-	{
-public:
-	CMcWindowDef(TMultiConTest *aTest);
-	virtual void Draw();
-	virtual void PointerL(const TPointerEvent &pointer,const TTime &);
-	};
-
-class TMultiConTest : public CTestBase
-	{
-public:
-	TMultiConTest();
-	~TMultiConTest();
-	TestState DoTestL();
-	void ConstructL();
-	void EndAutoForegroundTest();
-	TInt SubState() const;
-	void IncSubState();
-private:
-	CMcConnectionAf *iConn1;
-	CMcConnection *iConn2;
-	CMcConnectionDef *iConn3;
-	TSize iWinSize;
-	TInt iState;
-	TInt iSubState;
-	};
-
-GLDEF_C CTestBase *CreateMultiConTest()
-	{
-	return(new(ELeave) TMultiConTest());
-	}
-
-TMultiConTest::TMultiConTest() : CTestBase(_L("MultiCon"))
-	{}
-
-TMultiConTest::~TMultiConTest()
-	{
-	delete iConn1;
-	delete iConn2;
-	delete iConn3;
-	}
-
-void TMultiConTest::EndAutoForegroundTest()
-	{
-	iConn1->iGroup->GroupWin()->EnableReceiptOfFocus(EFalse);
-	iConn2->iGroup->GroupWin()->EnableReceiptOfFocus(EFalse);
-	iConn3->iGroup->GroupWin()->EnableReceiptOfFocus(EFalse);
-	Request();
-	}
-
-void TMultiConTest::ConstructL()
-	{
-	iConn3=new(ELeave) CMcConnectionDef(this);
-	iConn3->ConstructL();
-	iConn2=new(ELeave) CMcConnection(this);
-	iConn2->ConstructL();
-	iConn1=new(ELeave) CMcConnectionAf(this);
-	iConn1->ConstructL();
-	}
-
-//
-// CMcConnection
-
-CMcConnectionBase::CMcConnectionBase(TMultiConTest *aTest) : iTest(aTest)
-	{
-	}
-
-CMcConnectionBase::~CMcConnectionBase()
-	{
-	CTWin::Delete(iWin);
-	delete iGc;
-	}
-
-void CMcConnectionBase::SubStateChanged()
-	{
-	iWin->Invalidate();
-	iWs.Flush();
-	}
-
-void CMcConnectionBase::ConstructL()
-	{
-	CTClient::ConstructL();
-	User::LeaveIfError(iScreen->CreateContext(iGc));
-	}
-
-CMcConnection::CMcConnection(TMultiConTest *aTest) : CMcConnectionBase(aTest)
-	{
-	}
-
-void CMcConnection::ConstructL()
-	{
-	CMcConnectionBase::ConstructL();
-	iGroup=new(ELeave) CTWindowGroup(this);
-	iGroup->ConstructL();
-	TSize screenSize=iGroup->Size();
-	TInt winWidth=screenSize.iWidth/3;
-	TInt winHeight=screenSize.iHeight/2-10;
-	iGroup->GroupWin()->AutoForeground(EFalse);
-	CMcWindow *win=new(ELeave) CMcWindow(iTest);
-	win->SetUpL(TPoint(5,5),TSize(winWidth,winHeight),iGroup,*iGc);
-	iWin=win;
-	iWs.Flush();
-	}
-
-CMcConnectionAf::CMcConnectionAf(TMultiConTest *aTest) : CMcConnectionBase(aTest)
-	{
-	}
-
-void CMcConnectionAf::ConstructL()
-	{
-	CMcConnectionBase::ConstructL();
-	iGroup=new(ELeave) CMcWindowGroupAf(this);
-	iGroup->ConstructL();
-	TSize screenSize=iGroup->Size();
-	TInt winWidth=screenSize.iWidth/3;
-	TInt winHeight=screenSize.iHeight/2-10;
-	iGroup->GroupWin()->AutoForeground(ETrue);
-	CMcWindowAf *win=new(ELeave) CMcWindowAf(iTest);
-	win->SetUpL(TPoint(winWidth,5),TSize(winWidth,winHeight),iGroup,*iGc);
-	iWin=win;
-	iWs.Flush();
-	}
-
-void CMcConnectionAf::KeyL(const TKeyEvent &aKey)
-	{
-	switch(aKey.iCode)
-		{
-		case ' ':
-			if (iTest->SubState()==0)
-				{
-				iTest->TestL(iGroup->GroupWin()->OrdinalPosition()==0);
-				iTest->IncSubState();
-				}
-			break;
-		case EKeyEscape:
-			iTest->EndAutoForegroundTest();
-			break;
-		}
-	}
-
-CMcConnectionDef::CMcConnectionDef(TMultiConTest *aTest) : CMcConnectionBase(aTest)
-	{
-	}
-
-void CMcConnectionDef::ConstructL()
-	{
-	CMcConnectionBase::ConstructL();
-	iGroup=new(ELeave) CTWindowGroup(this);
-	iGroup->ConstructL();
-	iGroup->GroupWin()->EnableReceiptOfFocus(EFalse);
-	TSize screenSize=iGroup->Size();
-	TInt winWidth=screenSize.iWidth/3-10;
-	TInt winHeight=(screenSize.iHeight/2)-10;
-	CMcWindowDef *win=new(ELeave) CMcWindowDef(iTest);
-	win->SetUpL(TPoint(5+winWidth/2,screenSize.iHeight/2),TSize(winWidth,winHeight),iGroup,*iGc);
-	iWin=win;
-	iWs.Flush();
-	}
-
-//
-// CMcWindow, base class //
-//
-
-CMcWindowBase::CMcWindowBase(TMultiConTest *aTest) : CTWin(), iTest(aTest)
-	{
-	}
-
-void CMcWindowBase::SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc)
-	{
-	ConstructExtLD(*parent,pos,size);
-	iWin.SetBackgroundColor(iBack);
-	Activate();
-	AssignGC(aGc);
-	}
-
-//
-// CMcWindow, window used to test multiple connections //
-//
-
-CMcWindow::CMcWindow(TMultiConTest *aTest) : CMcWindowBase(aTest)
-	{
-	iBack=TRgb::Gray256(221);
-	}
-
-void CMcWindow::PointerL(const TPointerEvent &pointer,const TTime &)
-	{
-	if (pointer.iType==TPointerEvent::EButton1Down)
-		{
-		switch(iTest->SubState())
-			{
-			case 1:
-				iTest->TestL(Client()->iGroup->GroupWin()->OrdinalPosition()==1);
-				iTest->IncSubState();
-				break;
-			}
-		}
-	}
-
-void CMcWindow::Draw()
-	{
-	iGc->Clear();
-	TBuf<0x40> buf;
-	switch(iTest->SubState())
-		{
-		case 1:
-			buf.Copy(_L("Click on me"));
-			break;
-		case 0:
-		case 2:
-		case 3:
-			buf.Copy(_L(""));
-			break;
-		default:
-			buf.Copy(_L("ERROR"));
-		}
-	iGc->DrawText(buf, TPoint(10,20));
-	}
-
-//
-// CMcWindowAf, Auto foreground version of CMcWindow //
-//
-
-CMcWindowAf::CMcWindowAf(TMultiConTest *aTest) : CMcWindowBase(aTest)
-	{
-	iBack=TRgb::Gray256(150);
-	}
-
-void CMcWindowAf::PointerL(const TPointerEvent &pointer,const TTime &)
-	{
-	if (pointer.iType==TPointerEvent::EButton1Down)
-		{
-		switch(iTest->SubState())
-			{
-			case 2:
-				iTest->TestL(Client()->iGroup->GroupWin()->OrdinalPosition()==0);
-				iTest->IncSubState();
-				break;
-			}
-		}
-	}
-
-void CMcWindowAf::Draw()
-	{
-	iGc->Clear();
-	TBuf<0x40> buf;
-	switch(iTest->SubState())
-		{
-		case 1:
-		case 3:
-			break;
-		case 0:
-			buf.Copy(_L("Press <Space>"));
-			break;
-		case 2:
-			buf.Copy(_L("Click on me"));
-			break;
-		default:
-			buf.Copy(_L("ERROR"));
-		}
-	iGc->DrawText(buf, TPoint(10,20));
-	}
-
-//
-
-CMcWindowGroupAf::CMcWindowGroupAf(CTClient *aClient) : CTWindowGroup(aClient)
-	{}
-
-void CMcWindowGroupAf::KeyL(const TKeyEvent &aKey, const TTime &)
-	{
-	((CMcConnectionAf *)iClient)->KeyL(aKey);
-	}
-
-//
-// CMcWindowDef, Default auto foreground version of CMcWindow //
-//
-
-CMcWindowDef::CMcWindowDef(TMultiConTest *aTest) : CMcWindowBase(aTest)
-	{
-	iBack=TRgb::Gray256(236);
-	}
-
-void CMcWindowDef::PointerL(const TPointerEvent &pointer,const TTime &)
-	{
-	if (pointer.iType==TPointerEvent::EButton1Down)
-		{
-		switch(iTest->SubState())
-			{
-			case 3:
-				iTest->TestL(Client()->iGroup->GroupWin()->OrdinalPosition()==0);
-				iTest->IncSubState();
-				break;
-			}
-		}
-	}
-
-void CMcWindowDef::Draw()
-	{
-	iGc->Clear();
-	TBuf<0x40> buf;
-	switch(iTest->SubState())
-		{
-		case 0:
-		case 1:
-		case 2:
-			break;
-		case 3:
-			buf.Copy(_L("Click on me"));
-			break;
-		default:
-			buf.Copy(_L("ERROR"));
-		}
-	iGc->DrawText(buf, TPoint(10,20));
-	}
-
-//
-
-TInt TMultiConTest::SubState() const
-	{
-	return(iSubState);
-	}
-
-void TMultiConTest::IncSubState()
-	{
-	if (iSubState==EMaxSubState)
-		EndAutoForegroundTest();
-	else
-		{
-		iSubState++;
-		iConn1->SubStateChanged();
-		iConn2->SubStateChanged();
-		iConn3->SubStateChanged();
-		}
-	}
-
-TestState TMultiConTest::DoTestL()
-	{
-	switch(iState)
-		{
-		case 0:
-			LogSubTest(_L("MultiCon 1"),1);
-			iState++;
-			return(EContinue);
-		default:
-			return(EFinished);
-		}
-//	return(ENext);
- 	}
--- a/windowing/windowserver/tman/SCALE.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,135 +0,0 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test GDI scaling (pixels<->twips) functions
-// You can probably delete this test as it is now done by TMSCRMOD for each screen mode.
-// 
-//
-
-#include <e32std.h>
-#include "W32STD.H"
-#include "../tlib/testbase.h"
-#include "TMAN.H"
-
-class TScaleTest;
-
-class CScaleWindow : public CTWin
-	{
-public:
-	CScaleWindow(TScaleTest *aTest);
-	void SetUpLD(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
-	void Draw();
-	void WinKeyL(const TKeyEvent &aKey,const TTime &aTime);
-private:
-	TScaleTest *iTest;
-	};
-
-class TScaleTest : public CTestBase
-	{
-public:
-	TScaleTest();
-	~TScaleTest();
-	TestState DoTestL();
-	void ConstructL();
-private:
-	CScaleWindow *iWin;
-	TSize iWinSize;
-	TInt iState;
-	};
-
-GLDEF_C CTestBase *CreateScaleTest()
-	{
-	return(new(ELeave) TScaleTest());
-	}
-
-CScaleWindow::CScaleWindow(TScaleTest *aTest) : CTWin(), iTest(aTest)
-	{}
-
-void CScaleWindow::SetUpLD(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc)
-	{
-	ConstructExtLD(*parent,pos,size);
-	Activate();
-	AssignGC(aGc);
-	}
-
-void CScaleWindow::Draw()
-	{
-	iGc->Clear();
-	TSize twips=Client()->iScreen->SizeInTwips();
-	TSize pixels=Client()->iScreen->SizeInPixels();
-// Horizontal line
-	TInt inches=twips.iWidth/KTwipsPerInch-1;
-	TInt lineLen=Client()->iScreen->HorizontalTwipsToPixels(inches*KTwipsPerInch);
-	TPoint linePos=TPoint((pixels.iWidth-lineLen)/2,pixels.iHeight/2);
-	iGc->DrawLine(linePos,linePos+TPoint(lineLen,0));
-	TBuf<0x20> buf;
-	buf.Format(TRefByValue<const TDesC>(_L("Width %d\"")),inches);
-	iGc->DrawText(buf,TPoint((pixels.iWidth-iFont->TextWidthInPixels(buf))/2,linePos.iY-iFont->HeightInPixels()+iFont->AscentInPixels()-2));
-	TInt index;
-	for(index=0;index<=inches;index++)
-		{
-		TInt dx=Client()->iScreen->HorizontalTwipsToPixels(index*KTwipsPerInch);
-		TInt dy=Client()->iScreen->VerticalTwipsToPixels(KTwipsPerInch/(index==0 || index==inches ? 8 : 16));
-		iGc->DrawLine(linePos+TPoint(dx,1), linePos+TPoint(dx,dy));
-		}
-// Vertical line
-	inches=twips.iHeight/KTwipsPerInch;
-	lineLen=Client()->iScreen->VerticalTwipsToPixels(inches*KTwipsPerInch);
-	linePos.iY=(pixels.iHeight-lineLen)/2;
-	iGc->DrawLine(linePos,linePos+TPoint(0,lineLen));
-	buf.Format(TRefByValue<const TDesC>(_L("Height %d\"")),inches);
-	iGc->DrawText(buf,TPoint(linePos.iX+10, pixels.iHeight/4));
-	for(index=0;index<=inches;index++)
-		{
-		TInt dx=Client()->iScreen->HorizontalTwipsToPixels(KTwipsPerInch/(index==0 || index==inches ? 8 : 16));
-		TInt dy=Client()->iScreen->VerticalTwipsToPixels(index*KTwipsPerInch);
-		iGc->DrawLine(linePos+TPoint(1,dy), linePos+TPoint(dx,dy));
-		}
-	}
-
-void CScaleWindow::WinKeyL(const TKeyEvent &,const TTime &)
-	{
-	CActiveScheduler::Stop();
-	}
-
-TScaleTest::TScaleTest() : CTestBase(_L("Scale"))
-	{}
-
-TScaleTest::~TScaleTest()
-	{
-	CTWin::Delete(iWin);
-	}
-
-void TScaleTest::ConstructL()
-	{
-	CScaleWindow *win=new(ELeave) CScaleWindow(this);
-	win->SetUpLD(TPoint(0,0),Client()->iScreen->SizeInPixels(),Client()->iGroup,*Client()->iGc);
-	iWin=win;
-	Client()->iGroup->SetCurrentWindow(iWin);
-	}
-
-TestState TScaleTest::DoTestL()
-	{
-	switch(iState)
-		{
-		case 0:
-			LogSubTest(_L("Scale 1"),1);
-			CActiveScheduler::Start();
-			iState++;
-			break;
-		default:
-			return(EFinished);
-		}
-	return(ENext);
-	}
-
--- a/windowing/windowserver/tman/TKREPEAT.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,348 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Keyboard repeat test
-// 
-//
-
-#include <e32std.h>
-#include <e32svr.h>
-#include "W32STD.H"
-#include "../tlib/testbase.h"
-#include "TMAN.H"
-
-class CRKWindow;
-
-class TKRepeatTest : public CTestBase
-	{
-public:
-	TKRepeatTest();
-	~TKRepeatTest();
-	TestState DoTestL();
-	void ConstructL();
-	void TestKeyboardRepeatRateL(const TTimeIntervalMicroSeconds32 &aInitialTime, const TTimeIntervalMicroSeconds32 &aTime);
-	TBool CheckReportL();
-public:
-	TBool iAbort;
-private:
-	TTimeIntervalMicroSeconds32 iOldInitialTime;
-	TTimeIntervalMicroSeconds32 iOldTime;
-	CRKWindow *iWin;
-	TSize iWinSize;
-	TInt iState;
-	};
-
-class CRKWindow : public CTWin
-	{
-	enum TRKStates {
-		EStateWaitingForKeyDown,
-		EStateWaitingForKeyCode,
-		EStateWaitingForFirstRepeat,
-		EStateWaitingForNthRepeat,
-		EStateWaitingForKeyUp,
-		EStateInactive,
-		EStateError,
-		};
-public:
-	CRKWindow(TKRepeatTest *aTest);
-	void SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
-	void SetState(TRKStates aState);
-	void SetKeyboardRepeatRate(const TTimeIntervalMicroSeconds32 &aInitialTime, const TTimeIntervalMicroSeconds32 &aTime);
-	void WinKeyL(const TKeyEvent &,const TTime &);
-	void KeyUpL(const TKeyEvent &aKey,const TTime &aTime);
-	void KeyDownL(const TKeyEvent &aKey,const TTime &aTime);
-	void Draw();
-	TDesC& Report();
-	TBool CheckResults();
-protected:
-	TInt iConnIndex;
-	TKRepeatTest *iTest;
-	TRgb iBack;
-	TRKStates iState;
-	TInt iDownCode;
-	TInt iRepCount;
-	TTimeIntervalMicroSeconds32 iInitialRepeatSet;
-	TTimeIntervalMicroSeconds32 iRepeatSet;
-	TTime iPrevTime;
-	TTimeIntervalMicroSeconds32 iInitialGap;
-	TTimeIntervalMicroSeconds32 iTotalGap;
-	TTimeIntervalMicroSeconds32 iMinGap;
-	TTimeIntervalMicroSeconds32 iMaxGap;
-	TBuf<0x40> iReport;
-	};
-
-GLDEF_C CTestBase *CreateKRepeatTest()
-	{
-	return(new(ELeave) TKRepeatTest());
-	}
-
-//
-// CRKWindow, class //
-//
-
-CRKWindow::CRKWindow(TKRepeatTest *aTest) : CTWin(), iTest(aTest)
-	{
-	}
-
-void CRKWindow::SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc)
-	{
-	ConstructExtLD(*parent,pos,size);
-	iWin.SetBackgroundColor(TRgb::Gray256(230));
-	Activate();
-	AssignGC(aGc);
-	}
-
-void CRKWindow::Draw()
-	{
-	iGc->Clear();
-	switch(iState)
-		{
-		case EStateWaitingForKeyDown:
-			iGc->DrawText(_L("Press and hold the space bar"), TPoint(10,20));
-			break;
-		case EStateWaitingForFirstRepeat:
-		case EStateWaitingForNthRepeat:
-			{
-			TBuf<0x40> buf;
-			buf.Format(TRefByValue<const TDesC>(_L("Keep space bar down (%d repeats so far)")),iRepCount);
-			iGc->DrawText(buf, TPoint(10,20));
-			}
-			break;
-		case EStateWaitingForKeyUp:
-			iGc->DrawText(_L("Release space bar"), TPoint(10,20));
-		default:
-			break;
-		}
-	}
-
-void CRKWindow::SetState(TRKStates aState)
-	{
-	iState=aState;
-	DrawNow();
-	}
-
-TBool CRKWindow::CheckResults()
-	{
-//
-// Checks repeat results, first convert everything to 10th's as that what is actually used 
-// for the timer in the window server.
-//
-// Return ETrue if the inacuracy in the average time is greater than 1/10th either way
-// Allow initial 2/10ths either
-// Allow min 2/10ths below
-// Allow max 2/10ths above
-//
-	if (iState!=EStateInactive)
-		return(ETrue);
-	TInt initial=iInitialGap.Int()/100000;
-	TInt initialX=iInitialRepeatSet.Int()/100000;
-	if (initialX==0)
-		initialX=1;
-	TInt average=(iTotalGap.Int()/100000)/(iRepCount-1);
-	TInt repeatX=iRepeatSet.Int()/100000;
-	if (repeatX==0)
-		repeatX=1;
-	TInt min=iMinGap.Int()/100000;
-	TInt max=iMaxGap.Int()/100000;
-	if (average>(repeatX+1) || average<(repeatX-1))
-		return(ETrue);
-	if (initial>(initialX+2) || initial<(initialX-2))
-		return(ETrue);
-	if (min>(repeatX+1) || min<(repeatX-2))
-		return(ETrue);
-	if (max>(repeatX+3) || max<repeatX)
-		return(ETrue);
-	return(EFalse);
-	}
-
-TDesC& CRKWindow::Report()
-	{
-	if (iState!=EStateInactive)
-		{
-		iReport.Format(_L("Error, test not completed"));
-		}
-	else
-		{
-		TInt initial=iInitialGap.Int()/10000;
-		TInt initialX=iInitialRepeatSet.Int()/10000;
-		TInt average=(iTotalGap.Int()/10000/(iRepCount-1));
-		TInt repeatX=iRepeatSet.Int()/10000;
-		TInt min=iMinGap.Int()/10000;
-		TInt max=iMaxGap.Int()/10000;
-		iReport.Format(TRefByValue<const TDesC>(_L("Initial=%d [%d], Av=%d [%d], Min=%d, Max=%d")),initial,initialX,average,repeatX,min,max);
-		}
-	return(iReport);
-	}
-
-void CRKWindow::KeyDownL(const TKeyEvent &aKey,const TTime &)
-	{
-	switch(iState)
-		{
-		case EStateWaitingForKeyDown:
-			SetState(EStateWaitingForKeyCode);
-			iDownCode=aKey.iScanCode;
-			break;
-		default:;
-		}
-	}
-
-void CRKWindow::KeyUpL(const TKeyEvent &aKey,const TTime &)
-	{
-	if (aKey.iScanCode==iDownCode)
-		{
-		switch(iState)
-			{
-			case EStateWaitingForKeyUp:
-				SetState(EStateInactive);
-				break;
-			default:
-				SetState(EStateError);
-				break;
-			}
-		CActiveScheduler::Stop();
-		}
-	}
-
-void CRKWindow::WinKeyL(const TKeyEvent &aKey,const TTime &aTime)
-	{
-	if (aKey.iCode==EKeyEscape)
-		{
-		CActiveScheduler::Stop();
-		iTest->iAbort=ETrue;
-		}
-	if (aKey.iCode==32)
-		{
-		switch(iState)
-			{
-			case EStateWaitingForKeyCode:
-				SetState(EStateWaitingForFirstRepeat);
-				iPrevTime=aTime;
-				break;
-			case EStateWaitingForFirstRepeat:
-				iRepCount=1;
-				iInitialGap = I64LOW(aTime.MicroSecondsFrom(iPrevTime).Int64());
-				SetState(EStateWaitingForNthRepeat);
-				break;
-			case EStateWaitingForNthRepeat:
-				if (iRepCount==5)
-					SetState(EStateWaitingForKeyUp);
-				else
-					{
-					TTimeIntervalMicroSeconds32 gap(I64LOW(aTime.MicroSecondsFrom(iPrevTime).Int64()));
-					if (gap<iMinGap)
-						iMinGap=gap;
-					if (gap>iMaxGap)
-						iMaxGap=gap;
-					iTotalGap=iTotalGap.Int()+gap.Int();	// Horrible way to do a +=
-					iRepCount++;
-					SetState(EStateWaitingForNthRepeat);
-					}
-			case EStateWaitingForKeyUp: 	// Do nothing here
-				break;
-			default:
-				iTest->TestL(EFalse);
-			}
-		iPrevTime=aTime;
-		}
-	}
-
-void CRKWindow::SetKeyboardRepeatRate(const TTimeIntervalMicroSeconds32 &aInitialTime, const TTimeIntervalMicroSeconds32 &aTime)
-	{
-	iInitialRepeatSet=aInitialTime;
-	iRepeatSet=aTime;
-	iMinGap=TTimeIntervalMicroSeconds32(100000000);	// Any very big number will do
-	iMaxGap=TTimeIntervalMicroSeconds32(0);
-	iTotalGap=TTimeIntervalMicroSeconds32(0);
-	SetState(EStateWaitingForKeyDown);
-	Client()->iWs.Flush();
-	}
-
-//
-
-TKRepeatTest::TKRepeatTest() : CTestBase(_L("KRepeat"))
-	{}
-
-TKRepeatTest::~TKRepeatTest()
-	{
-	CTWin::Delete(iWin);
-	Client()->iWs.SetKeyboardRepeatRate(iOldInitialTime, iOldTime);
-	}
-
-void TKRepeatTest::ConstructL()
-	{
-	iWin=new(ELeave) CRKWindow(this);
-	TSize screenSize=Client()->iGroup->Size();
-	iWin->SetUpL(TPoint(5,5),TSize(screenSize.iWidth/2,screenSize.iHeight-10),Client()->iGroup,*Client()->iGc);
-	Client()->iGroup->SetCurrentWindow(iWin);
-	Client()->iWs.GetKeyboardRepeatRate(iOldInitialTime, iOldTime);
-	}
-
-TInt TKRepeatTest::CheckReportL()
-	{
-	if (iWin->CheckResults())
-		{
-		CTDialog *dialog=new(ELeave) CTDialog();
-		dialog->SetTitle(_L("Keyboard repeat innacuracies"));
-		dialog->SetLine1(iWin->Report());
-		dialog->SetNumButtons(2);
-		dialog->SetButtonText(0,_L("Okay"));
-		dialog->SetButtonText(1,_L("Retest"));
-		dialog->SetButtonText(2,_L("Fail"));
-		dialog->ConstructLD(*Client()->iGroup,*Client()->iGc);
-		switch(dialog->Display())
-			{
-			case 0:
-				break;
-			case 1:
-				return(ETrue);	// Redo test
-			case 2:
-				TestL(EFalse);
-				break;
-			}
-		}
-	return(EFalse);
-	}
-
-void TKRepeatTest::TestKeyboardRepeatRateL(const TTimeIntervalMicroSeconds32 &aInitialTime, const TTimeIntervalMicroSeconds32 &aTime)
-	{
-	do
-		{
-		Client()->iWs.SetKeyboardRepeatRate(aInitialTime, aTime);
-		iWin->SetKeyboardRepeatRate(aInitialTime, aTime);
-		CActiveScheduler::Start();
-		if (iAbort)
-			AbortL();
-		} while(CheckReportL());
-	}
-
-TestState TKRepeatTest::DoTestL()
-	{
-	switch(iState)
-		{
-		case 0:
-			LogSubTest(_L("Keyboard Repeat"),1);
-			TestKeyboardRepeatRateL(TTimeIntervalMicroSeconds32(1000000), TTimeIntervalMicroSeconds32(500000));
-			LogSubTest(_L("Keyboard Repeat"),2);
-			TestKeyboardRepeatRateL(TTimeIntervalMicroSeconds32(200000), TTimeIntervalMicroSeconds32(100000));
-			LogSubTest(_L("Keyboard Repeat"),3);
-			TestKeyboardRepeatRateL(TTimeIntervalMicroSeconds32(0), TTimeIntervalMicroSeconds32(100000));
-			LogSubTest(_L("Keyboard Repeat"),4);
-			TestKeyboardRepeatRateL(TTimeIntervalMicroSeconds32(100000), TTimeIntervalMicroSeconds32(100000));
-			iState++;
-			break;
-		default:
-			return(EFinished);
-		}
-	return(ENext);
-	}
-
--- a/windowing/windowserver/tman/TMAN.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,490 +0,0 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Manual window server tests
-// Note: Wherever possible tests should be put into the TAUTO automatic test
-// code test should only go here when manual operation is essential
-// 
-//
-
-#include <e32std.h>
-#include "W32STD.H"
-#include <e32svr.h>
-#include "TMAN.H"
-
-#define LOG_TESTS
-
-class ErrorDialog : public CTDialog
-	{
-public:
-	ErrorDialog(CTestBase *aTest);
-	void ButtonPressL(TInt aButton);
-private:
-	CTestBase *iTest;
-	};
-
-class TestWindowGroup : public CTWindowGroup
-	{
-public:
-	TestWindowGroup(CTClient *aClient);
-	void ConstructL();
-	void KeyL(const TKeyEvent &aKey,const TTime &aTime);
-	void KeyDownL(const TKeyEvent &aKey,const TTime &aTime);
-	void KeyUpL(const TKeyEvent &aKey,const TTime &aTime);
-	};
-
-class CTManScheduler : public CActiveScheduler
-	{
-public:
-	void SetClient(TestClient *aClient);
-	void Error(TInt anError) const;
-private:
-	void doErrorL(TInt anError) const;
-private:
-	TestClient *iClient;
-	};
-
-typedef CTestBase *(*CTestBaseCreate)();
-
-GLREF_C CTestBase *CreateScreenModeTest();
-GLREF_C CTestBase *CreateScaleTest();
-GLREF_C CTestBase *CreateTextTest();
-GLREF_C CTestBase *CreateDummyTest();
-GLREF_C CTestBase *CreateMultiConTest();
-GLREF_C CTestBase *CreateMultiCaptureKeyTest();
-GLREF_C CTestBase *CreateHotKeyTest();
-GLREF_C CTestBase *CreatePointerTest();
-GLREF_C CTestBase *CreatePointerCaptureTest();
-GLREF_C CTestBase *CreatePointerBufferTest();
-GLREF_C CTestBase *CreateModifiersChangedTest();
-GLREF_C CTestBase *CreatePointerKeyTest();
-GLREF_C CTestBase *CreatePasswordTest();
-GLREF_C CTestBase *CreatePointerCursorTest();
-GLREF_C CTestBase *CreateScreenModeTimes();
-
-// Tests that have not been converted to tauto yet
-CTestBaseCreate CreateTestClass[]={
-	CreateScreenModeTimes,
-	CreatePointerCursorTest,
-	CreatePointerTest,			//Mostly converted
-	CreatePointerKeyTest,		//Mostly converted
-	CreateModifiersChangedTest,		//Partially Conerted
-	CreatePointerBufferTest,
-	CreateTextTest,
-	CreateScaleTest,
-	CreateDummyTest,
-	};
-
-LogWindow *LogWin;
-
-void TManPanic(TInt aPanic)
-	{
-	User::Panic(_L("Auto"),aPanic);
-	}
-
-//
-// Log window, logs testing //
-//
-
-LogWindow::LogWindow() : CTWin()
-	{
-	}
-
-void LogWindow::ConstructL(CTWinBase &parent)
-	{
-	CTWin::ConstructL(parent);
-	iTitleHeight=iFont->HeightInPixels()+4;
-	}
-
-void LogWindow::Draw()
-	{
-	iGc->SetPenColor(TRgb::Gray16(8));
-	iGc->SetPenColor(TRgb::Gray16(0));
-	DrawBorder();
-	iGc->DrawLine(TPoint(0,iTitleHeight),TPoint(iSize.iWidth,iTitleHeight));
-	iGc->DrawText(iTestTitle, TPoint((iSize.iWidth-iFont->TextWidthInPixels(iTestTitle))/2,iFont->AscentInPixels()+2));
-	}
-
-void LogWindow::LogTest(TDesC &aTitle,TInt aNum)
-	{
-	iTestTitle.Format(TRefByValue<const TDesC>(_L("Test %d,%S")),aNum,&aTitle);
-	iWin.Invalidate();
-	Client()->iWs.Flush();
-	}
-
-//
-// Test window, simple window used to do test graphics in //
-//
-TestWindow::TestWindow() : CTWin()
-	{
-	}
-
-void TestWindow::SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc)
-	{
-	iBorderWin=new(ELeave) BorderWindow();
-	iBorderWin->SetUpL(pos,size,parent,aGc);
-	CTWin::ConstructExtLD(*iBorderWin,TPoint(2,2),TSize(size.iWidth-4,size.iHeight-4));
-	Activate();
-	AssignGC(aGc);
-	}
-
-void TestWindow::Draw()
-	{
-	iGc->Clear();
-	}
-
-//
-BorderWindow::BorderWindow() : CTWin()
-	{
-	}
-
-void BorderWindow::ConstructL(CTWinBase &parent)
-	{
-	CTWin::ConstructL(parent);
-	}
-
-void BorderWindow::Draw()
-	{
-	iGc->SetBrushColor(TRgb::Gray16(0));
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	iGc->SetPenStyle(CGraphicsContext::ENullPen);
-	iGc->DrawRect(TRect(Size()));
-	}
-
-//
-
-TestWindowGroup::TestWindowGroup(CTClient *aClient) : CTWindowGroup(aClient)
-	{
-	}
-
-void TestWindowGroup::ConstructL()
-	{
-	CTWindowGroup::ConstructL();
-	GroupWin()->EnableScreenChangeEvents();
-	}
-
-void TestWindowGroup::KeyDownL(const TKeyEvent &aKey,const TTime &aTime)
-	{
-	if (iCurWin)
-		iCurWin->KeyDownL(aKey,aTime);
-	}
-
-void TestWindowGroup::KeyUpL(const TKeyEvent &aKey,const TTime &aTime)
-	{
-	if (iCurWin)
-		iCurWin->KeyUpL(aKey,aTime);
-	}
-
-void TestWindowGroup::KeyL(const TKeyEvent &aKey,const TTime &aTime)
-	{
-	if (aKey.iModifiers&EModifierFunc)
-		{
-		switch(aKey.iCode)
-			{
-			case 'f':
-				((TestClient *)Client())->Driver()->iTest->TriggerFail();
-				break;
-			}
-		}
-	else if (iCurWin)
-		iCurWin->WinKeyL(aKey,aTime);
-	}
-
-//
-
-TestClient::TestClient()
-	{
-	}
-
-void TestClient::ConstructL()
-	{
-	CTClient::ConstructL();
-
-	iGroup=new(ELeave) TestWindowGroup(this);
-	iGroup->ConstructL();
-
-	TSize screenSize=iGroup->Size();
-	TInt winWidth=(screenSize.iWidth/3)-10;
-	TInt winHeight=screenSize.iHeight-10;
-	LogWin=new(ELeave) LogWindow();
-	LogWin->SetUpL(TPoint(5+winWidth*2,5),TSize(winWidth,winHeight),iGroup,*iGc);
-	iDriver=new(ELeave) TestDriver(this);
-	}
-
-TestClient::~TestClient()
-	{
-	delete iDriver;
-	}
-
-TestDriver *TestClient::Driver()
-	{
-	return(iDriver);
-	}
-
-//
-// Error dialog //
-//
-
-ErrorDialog::ErrorDialog(CTestBase *aTest) : CTDialog(), iTest(aTest)
-	{}
-
-void ErrorDialog::ButtonPressL(TInt aButton)
-	{
-	switch(aButton)
-		{
-		case 0:
-			{
-			CTestBase *test=iTest;
-			CTDialog::Delete(this);
-			if (test)
-				test->Driver()->DestroyTest();
-			CActiveScheduler::Stop();
-			User::Leave(0);		// Signals RunL not to do another request
-			}
-			break;
-		case 1:
-			CTestBase *test=iTest;
-			CTDialog::Delete(this);
-			if (test)
-				{
-				test->Driver()->TestComplete();
-				test->Driver()->DestroyTest();
-				}
-			break;
-		}
-	}
-
-//
-// TestDriver, drives the test code //
-//
-
-TestDriver::TestDriver(TestClient *aClient) : CActive(-10), iClient(aClient)
-	{
-	CActiveScheduler::Add(this);
-	Request();
-	}
-
-TestClient *TestDriver::Client()
-	{
-	return(iClient);
-	}
-
-TestDriver::~TestDriver()
-	{
-	Cancel();
-	DestroyTest();
-	}
-
-void TestDriver::DoCancel()
-	{
-	TRequestStatus *pStat= &iStatus;
-	RThread().RequestComplete(pStat,KErrCancel);
-	}
-
-void TestDriver::Request()
-	{
-	TRequestStatus *pStat= &iStatus;
-	RThread().RequestComplete(pStat,KErrNone);
-	SetActive();
-	}
-
-void TestDriver::RunL()
-	{
-	iTest=(*CreateTestClass[iTestNum])();
-	iTest->StartTest(iTestNum,this);
-	iTest->ConstructL();
-	}
-
-void TestDriver::TestComplete()
-	{
-	iTestNum++;
-	if (iTestNum==sizeof(CreateTestClass)/sizeof(CreateTestClass[0]))
-		{
-		DisplayDialog(_L("Tests complete"),_L(""),_L(""));
-		CActiveScheduler::Stop();
-		}
-	else
-		Request();
-	}
-
-void TestDriver::DestroyTest()
-	{
-	delete iTest;
-	iTest=NULL;
-	}
-
-// CTestBase //
-
-CTestBase::CTestBase(const TDesC &aTitle) : CActive(-10)
-	{
-	CActiveScheduler::Add(this);
-	iTitle.Copy(aTitle);
-	}
-
-CTestBase::~CTestBase()
-	{
-	User::Free(iBuf1);
-	User::Free(iBuf2);
-	Cancel();
-	}
-
-void CTestBase::DoCancel()
-	{
-	TRequestStatus *pStat= &iStatus;
-	RThread().RequestComplete(pStat,KErrCancel);
-	}
-
-void CTestBase::Request()
-	{
-	TRequestStatus *pStat= &iStatus;
-	RThread().RequestComplete(pStat,KErrNone);
-	SetActive();
-	}
-
-void CTestBase::TriggerFail()
-	{
-	iFail=ETrue;
-	}
-
-TestClient *CTestBase::Client()
-	{
-	return(iDriver->Client());
-	}
-
-void CTestBase::LogLeave(TInt aErr)
-	{
-#if defined(LOG_TESTS)
-	TLogMessageText buf;
-	_LIT(KLeave,"MAN Left with error code %d in sub-test %d: ");
-	buf.AppendFormat(KLeave,aErr,iSubTestNum);
-	buf.Append(iSubTitle);
-	Client()->LogMessage(buf);
-#else
-	aErr=KErrNone;		//To stop a warning
-#endif
-	}
-
-void CTestBase::RunL()
-	{
-	TInt ret=EInvalid;
-	TRAPD(err,ret=DoTestL());
-	if (err!=KErrNone)
-		{
-		LogLeave(err);
-		if (err!=ETestFailed)
-			{
-			User::Leave(err);
-			}
-		}
-	else if (ret==EFinished)
-		{
-		iDriver->TestComplete();
-		iDriver->DestroyTest();
-		}
-	else if (ret==ENext)
-		Request();
-	}
-
-void CTestBase::StartTest(TInt aNum, TestDriver *aDriver)
-	{
-	iDriver=aDriver;
-	iTestNum=aNum;
-	LogWin->LogTest(iTitle,aNum);
-#if defined(LOG_TESTS)
-	TLogMessageText buf;
-	_LIT(ManNewTest,"MAN New Test %d: ");
-	buf.AppendFormat(ManNewTest,aNum);
-	buf.Append(iTitle);
-	Client()->LogMessage(buf);
-#endif
-	Request();
-	}
-
-void CTestBase::LogSubTest(const TDesC &aSubTitle,TInt aNum)
-	{
-	iSubTestNum=aNum;
-	iSubTitle=aSubTitle;
-#if defined(LOG_TESTS)
-	TLogMessageText buf;
-	_LIT(ManSubTest,"MAN SubTest %d: ");
-	buf.AppendFormat(ManSubTest,iSubTestNum);
-	buf.Append(iSubTitle);
-	Client()->LogMessage(buf);
-#endif
-	}
-
-void CTestBase::AbortL()
-	{
-	TestDriver *driver=iDriver;			
-	iDriver->DestroyTest();
-	driver->TestComplete();
-	User::Leave(ETestFailed);
-	}
-
-void CTestBase::TestL(TInt aCondition)
-	{
-	if (!aCondition || iFail)
-		{
-		iFail=EFalse;
-  		ErrorDialog *dialog=new ErrorDialog(this);
-		if (dialog)
-			{
-			dialog->SetTitle(_L("Test failed"));
-			dialog->SetNumButtons(2);
-			dialog->SetButtonText(0,_L("Abort all tests"));
-			dialog->SetButtonText(1,_L("Continue other tests"));
-			dialog->ConstructLD(*Client()->iGroup,*Client()->iGc);
-			dialog->Display();
-			}
-		User::Leave(ETestFailed);
-		}
-	}
-
-void CTManScheduler::SetClient(TestClient *aClient)
-	{
-	iClient=aClient;
-	}
-
-void CTManScheduler::Error(TInt aError) const
-	{
-	TRAP_IGNORE(doErrorL(aError));
-	CActiveScheduler::Stop();
-	}
-
-void CTManScheduler::doErrorL(TInt aError) const
-	{
-	CTDialog *dialog=new(ELeave) CTDialog();
-	if (dialog)
-		{
-		TWindowTitle title;
-		title.Format(TRefByValue<const TDesC>(_L("Error %d")),aError);
-		dialog->SetTitle(title);
-		dialog->SetNumButtons(1);
-		dialog->SetButtonText(0,_L("Abort tests"));
-		dialog->ConstructLD(*iClient->iGroup,*iClient->iGc);
-		dialog->Display();
-		}
-	}
-
-//
-
-GLDEF_C CTClient *CreateClientL()
-	{
-	return(new(ELeave) TestClient());
-	}
-
-
-GLDEF_C TInt E32Main()
-{
-return(TestLibStartUp(CreateClientL));
-}
--- a/windowing/windowserver/tman/TMAN.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,149 +0,0 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Header for window server auto test code
-// 
-//
-
-#include <e32std.h>
-#include <e32math.h>
-#include "W32STD.H"
-#include "../tlib/testbase.h"
-
-class TestClient;
-
-enum TestState
-	{
-	EInvalid,
-	ENext,
-	EContinue,
-	EFinished
-	};
-
-enum TAutoPanics
-	{
-	ETManPanicPcFailed,
-	};
-
-enum TAutoLeaves
-	{
-	ETestFailed=1,
-	};
-
-class LogWindow : public CTWin
-	{
-public:
-	LogWindow();
-	void ConstructL(CTWinBase &parent);
-	void Draw();
-	void LogTest(TDesC &aTitle,TInt aNum);
-private:
-	TBuf<0x40> iTestTitle;
-	TInt iTitleHeight;
-	};
-
-class CTestBase;
-
-class BorderWindow : public CTWin
-	{
-public:
-	BorderWindow();
-	void ConstructL(CTWinBase &parent);
-	void Draw();
-	};
-
-class TestWindow : public CTWin
-	{
-public:
-	TestWindow();
-	void Draw();
-	void SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
-private:
-	BorderWindow *iBorderWin;
-	friend class CTestBase;
-	};
-
-class TestDriver : public CActive
-	{
-public:
-	TestDriver(TestClient *aClient);
-	~TestDriver();
-	void DoCancel();
-	void RunL();
-	void Request();
-	void TestComplete();
-	void DestroyTest();
-	TestClient *Client();
-public:
-	CTestBase *iTest;
-private:
-	TInt iTestNum;
-	TestClient *iClient;
-	};
-
-class CTestBase : public CActive
-	{
-public:
-	CTestBase(const TDesC &aTitle);
-	~CTestBase();
-	void DoCancel();
-	void RunL();
-	void Request();
-	void TestL(TInt aCondition);
-	void StartTest(TInt aNum, TestDriver *aDriver);
-	void LogSubTest(const TDesC &aTitle,TInt aNum);
-	void TestPanic(TThreadFunction aFunction, TAny *aPtr, TInt aExitReason, const TDesC &aCategory);
-	void TestWsPanic(TThreadFunction aFunction, TAny *aPtr, TInt aExitReason);
-	void TestWsPanic(TThreadFunction aFunction, TInt aInt, TInt aExitReason);
-	void TriggerFail();
-	void LogLeave(TInt aErr);
-	void CheckRect(CTWin *aWin1,CTWin *aWin2,const TRect &aRect);
-	void CompareWindows(TRect &aRect);
-	void CompareWindows();
-	void CheckBorder();
-	void DrawTestBackground(TBool aInvertColours);
-	inline TestDriver *Driver();
-	virtual TestState DoTestL()=0;
-	virtual void ConstructL()=0;
-	TestClient *Client();
-	void AbortL();
-protected:
-	TestDriver *iDriver;
-	TAny *iBuf1;
-	TAny *iBuf2;
-private:
-	TInt iTestNum;
-	TInt iSubTestNum;
-	TBuf<0x40> iTitle;
-	TBuf<0x40> iSubTitle;
-	TBool iFail;	// Used to trigger failures to test test code.
-	};
-
-class TestClient : public CTClient
-	{
-public:
-	TestClient();
-	~TestClient();
-	void ConstructL();
-	void KeyL(const TKeyEvent &aKey,const TTime &aTime);
-	void Shutdown();
-	TestDriver *Driver();
-private:
-	TestDriver *iDriver;
-	};
-
-GLREF_D CWindowGc *TheGc;
-GLREF_C void TManPanic(TInt aPanic);
-
-inline TestDriver *CTestBase::Driver()
-	{return(iDriver);}
--- a/windowing/windowserver/tman/TMCAPKEY.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,625 +0,0 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test capture key
-// 
-//
-
-#include <e32std.h>
-#include <e32svr.h>
-#include <e32keys.h>
-#include "W32STD.H"
-#include "../tlib/testbase.h"
-#include "TMAN.H"
-
-enum TTestMode
-	{
-	EModeNormalCapture,
-	EModeWaitingForFirstDown,
-	EModeKeyUpsAndDowns,
-	EModeAbortKeys,
-	};
-enum TCapKeyRetValues
-	{
-	ECapKeyOkay,
-	ECapKeyRetry,
-	ECapKeyFail,
-	};
-
-struct SCapKeyParams
-	{
-	TInt connIndex;		// Connection that should capture this key
-	TUint keyCode;
-	TUint modifier_mask;
-	TUint modifiers;
-	};
-
-struct SCapKeyTestParams
-	{
-	TText *txt;			// Text message telling user what to do
-	TInt connIndex;		// Connection that receive the key press
-	TUint keyCode;		// Expected key code
-	TUint modifier_mask;// Modifiers mask for expected modifiers
-	TUint modifiers;	// Expected modifiers
-	};
-
-struct SAbortKeyTests
-	{
-	TUint keyCode;		// Expected key code
-	TUint modifier_mask;// Modifiers mask for expected modifiers
-	TUint modifiers;	// Expected modifiers
-	};
-
-LOCAL_D SCapKeyParams capKeys[]={
-	{1,19,EModifierFunc|EModifierCtrl,EModifierFunc|EModifierCtrl},
-	{2,'b',EModifierFunc|EModifierCtrl,EModifierFunc},
-	{2,'n',EModifierFunc|EModifierCtrl,EModifierFunc},
-	{0,3,EModifierFunc|EModifierCtrl,EModifierFunc|EModifierCtrl},
-	{2,'q',0,0},
-	{2,'w',0,0},
-	};
-	
-LOCAL_D SCapKeyParams capUpAndDownKeys[]={
-	{2,EStdKeySpace,EModifierFunc|EModifierCtrl|EModifierShift,0},
-	{2,EStdKeyEnter,EModifierFunc|EModifierCtrl|EModifierShift,EModifierShift},
-	};
-	
-LOCAL_D SCapKeyTestParams capKeyTests[]={
-	{(TText *)_S("Press q"),2,'q',EModifierFunc|EModifierCtrl|EModifierShift,0},
-	//{(TText *)_S("Press <Alt>q"),2,'q',EModifierFunc|EModifierCtrl|EModifierShift,EModifierFunc},
-	{(TText *)_S("Press <Alt>w"),2,'w',EModifierFunc|EModifierCtrl|EModifierShift,EModifierFunc},
-	{(TText *)_S("Press a"),0,'a',0},
-	//{(TText *)_S("Press <Ctrl><Alt>a"),1,1,EModifierFunc|EModifierCtrl|EModifierShift,EModifierFunc|EModifierCtrl},
-	{(TText *)_S("Press <Ctrl><Alt>s"),1,19,EModifierFunc|EModifierCtrl|EModifierShift,EModifierFunc|EModifierCtrl},
-	//{(TText *)_S("Press <Alt>b"),2,'b',EModifierFunc|EModifierCtrl|EModifierShift,EModifierFunc},
-	{(TText *)_S("Press <Alt>n"),2,'n',EModifierFunc|EModifierCtrl|EModifierShift,EModifierFunc},
-	{(TText *)_S("Press <Ctrl><Alt>b"),0,2,EModifierFunc|EModifierCtrl|EModifierShift,EModifierFunc|EModifierCtrl},
-	//{(TText *)_S("Press <Alt>c"),0,'c',EModifierFunc|EModifierCtrl|EModifierShift,EModifierFunc},
-	{(TText *)_S("Press <Alt>d"),0,'d',EModifierFunc|EModifierCtrl|EModifierShift,EModifierFunc},
-	{(TText *)_S("Press <Ctrl><Alt>c"),0,3,EModifierFunc|EModifierCtrl|EModifierShift,EModifierFunc|EModifierCtrl},
-//
-// Capture ups and downs
-//
-	{(TText *)_S("Press <Space>"),2,EStdKeySpace,EModifierFunc|EModifierCtrl|EModifierShift,0},
-	{(TText *)_S("Press <Enter>"),0,EStdKeyEnter,EModifierShift,0},
-	{(TText *)_S("Press <Shift><Space>"),0,EStdKeySpace,EModifierFunc|EModifierCtrl|EModifierShift,EModifierShift},
-	{(TText *)_S("Press <Shift><Enter>"),2,EStdKeyEnter,EModifierShift,EModifierShift},
-//
-// Priority keys
-//
-	{(TText *)_S("Press <Ctrl>c"),0,0,0,0},
-	{(TText *)_S("Press <Ctrl>d"),0,0,0,0},
-	{(TText *)_S("Press z"),0,0,0,0},
-	};
-
-LOCAL_D SAbortKeyTests abortKeyTests[]={
-	{3,EModifierCtrl,EModifierCtrl},
-	{4,EModifierCtrl,EModifierCtrl},
-	{'z',EModifierFunc|EModifierCtrl|EModifierShift,0}
-	};
-
-struct SErrorCapKey
-	{
-	TInt keyCode;
-	TUint modifier_mask;
-	TUint modifiers;
-	};
-
-LOCAL_D SErrorCapKey errorKeys[]={
-	{'a',EModifierFunc|EModifierShift,EModifierFunc|EModifierCtrl},
-	{'1',0,EModifierFunc},
-	{3,EModifierCtrl,EModifierCtrl|EModifierShift},
-	};
-
-const TInt numCapKeys=sizeof(capKeys)/sizeof(capKeys[0]);
-const TInt numTests=sizeof(capKeyTests)/sizeof(capKeyTests[0]);
-const TInt numErrorKeys=sizeof(errorKeys)/sizeof(errorKeys[0]);
-const TInt numAbortKeyTests=sizeof(abortKeyTests)/sizeof(abortKeyTests[0]);
-const TInt numUpDownKeys=sizeof(capUpAndDownKeys)/sizeof(capUpAndDownKeys[0]);
-const TInt numUpDownKeyTests=4;
-const TInt numCapKeyTests=numTests-numAbortKeyTests-numUpDownKeyTests;
-
-LOCAL_D TInt capKeyHandle[numCapKeys];
-LOCAL_D TInt capUpDownKeyHandle[numUpDownKeys];
-
-class CCKWindow;
-class TCaptureKeyTest;
-class CCKAbortConnection;
-
-class CCKConnectionBase : public CTClient
-	{
-public:
-	CCKConnectionBase(TCaptureKeyTest *aTest);
-	void ConstructL();
-protected:
-	TCaptureKeyTest *iTest;
-	};
-
-class CCKConnection : public CCKConnectionBase
-	{
-public:
-	CCKConnection(TCaptureKeyTest *aTest, TInt aConnIndex);
-	~CCKConnection();
-	void ConstructL();
-	void CheckKeyL(const SCapKeyTestParams &aKeyTest, const TKeyEvent &aKey);
-	void SubStateChanged();
-	void KeyTestL(TInt aBool);
-	void KeyL(const TKeyEvent &aKey,const TTime &aTime);
-	void CheckUpDownL(const SCapKeyTestParams &aKeyTest, const TKeyEvent &aKey);
-	void CheckUpDownL(const TKeyEvent &aKey);
-	inline TInt Index() {return iConnIndex;}
-protected:
-	TInt iConnIndex;
-	CCKWindow *iWin;
-	};
-
-class CAbortHandler : public CTEventBase
-	{
-public:
-	CAbortHandler(RWsSession *aWs, CCKAbortConnection *aConnection);
-	~CAbortHandler();
-	void Request();
-protected:
-	void DoCancel();
-	void doRunL();
-protected:
-	CCKAbortConnection *iConnection;
-	};
-
-class CCKAbortConnection : public CCKConnectionBase
-	{
-public:
-	CCKAbortConnection(TCaptureKeyTest *aTest);
-	~CCKAbortConnection();
-	void ConstructL();
-	void ReceivedAbortEventL(TInt aHandle, TKeyEvent *aKey);
-	void Foreground();
-protected:
-	CAbortHandler *iAbortHandler;
-	TInt iAbortKeyIndex;
-	};
-
-class CCKWindow : public CTWin
-	{
-public:
-	CCKWindow(TCaptureKeyTest *aTest, TInt aConnIndex);
-	void SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
-	void Draw();
-protected:
-	TInt iConnIndex;
-	TCaptureKeyTest *iTest;
-	TRgb iBack;
-	};
-
-class CCKWindowGroup : public CTWindowGroup
-	{
-public:
-	CCKWindowGroup(CTClient *aClient, TCaptureKeyTest *aTest);
-	void KeyL(const TKeyEvent &aKey,const TTime &aTime);
-	void KeyDownL(const TKeyEvent &aKey,const TTime &);
-	void KeyUpL(const TKeyEvent &aKey,const TTime &);
-	void CheckUpDown(const SCapKeyTestParams &aKeyTest, const TKeyEvent &aKey);
-private:
-	TCaptureKeyTest *iTest;
-	};
-
-class TCaptureKeyTest : public CTestBase
-	{
-public:
-	TCaptureKeyTest();
-	~TCaptureKeyTest();
-	TestState DoTestL();
-	void ConstructL();
-	void EndCaptureKeyTest();
-	TInt SubState() const;
-	void IncSubState();
-	void BadParamsL();
-	void CapKeyPurgingL();
-	void SetUpPriorityKeyTest();
-	void TestComplete();
-	void CaptureUpsAndDownsTest();
-	TTestMode Mode();
-	void SetMode(TTestMode aMode);
-private:
-	CCKConnection *iConn1;
-	CCKConnection *iConn2;
-	CCKConnection *iConn3;
-	CCKAbortConnection *iAbortConn;
-	TSize iWinSize;
-	TInt iState;
-	TInt iSubState;
-	TTestMode iMode;
-	};
-
-GLDEF_C CTestBase *CreateMultiCaptureKeyTest()
-	{
-	return(new(ELeave) TCaptureKeyTest());
-	}
-
-//
-// CAbortHandler
-
-CAbortHandler::CAbortHandler(RWsSession *aWs, CCKAbortConnection *aConnection) : CTEventBase(aWs, 10), iConnection(aConnection)
-	{
-	}
-
-CAbortHandler::~CAbortHandler()
-	{
-	Cancel();
-	}
-
-void CAbortHandler::Request()
-	{
-	iWs->PriorityKeyReady(&iStatus);
-	SetActive();
-	}
-
-void CAbortHandler::DoCancel()
-	{
-	iWs->PriorityKeyReadyCancel();
-	}
-
-void CAbortHandler::doRunL()
-	{
-	TWsPriorityKeyEvent abortEvent;
-	iWs->GetPriorityKey(abortEvent);
-	iConnection->ReceivedAbortEventL(abortEvent.Handle(),abortEvent.Key());
-	}
-
-//
-// CCKConnection
-
-CCKConnectionBase::CCKConnectionBase(TCaptureKeyTest *aTest) : iTest(aTest)
-	{
-	}
-
-void CCKConnectionBase::ConstructL()
-	{
-	CTClient::ConstructL();
-	iGroup=new(ELeave) CCKWindowGroup(this, iTest);
-	iGroup->ConstructL();
-	}
-
-CCKConnection::CCKConnection(TCaptureKeyTest *aTest, TInt aConnIndex) : CCKConnectionBase(aTest), iConnIndex(aConnIndex)
-	{
-	}
-
-CCKConnection::~CCKConnection()
-	{
-	for(TInt index=0;index<numCapKeys;index++)
-		if (capKeys[index].connIndex==iConnIndex)
-			iGroup->GroupWin()->CancelCaptureKey(capKeyHandle[index]);
-	for(TInt index2=0;index2<numUpDownKeys;index2++)
-		if (capUpAndDownKeys[index2].connIndex==iConnIndex)
-			iGroup->GroupWin()->CancelCaptureKeyUpAndDowns(capUpDownKeyHandle[index2]);
-	CTWin::Delete(iWin);
-	}
-
-void CCKConnection::SubStateChanged()
-	{
-	iWin->Invalidate();
-	iWs.Flush();
-	}
-
-void CCKConnection::ConstructL()
-	{
-	CCKConnectionBase::ConstructL();
-	for(TInt index=0;index<numCapKeys;index++)
-		if (capKeys[index].connIndex==iConnIndex)
-			capKeyHandle[index]=User::LeaveIfError(iGroup->GroupWin()->CaptureKey(capKeys[index].keyCode,capKeys[index].modifier_mask,capKeys[index].modifiers));
-	for(TInt index2=0;index2<numUpDownKeys;index2++)
-		if (capUpAndDownKeys[index2].connIndex==iConnIndex)
-			capUpDownKeyHandle[index2]=User::LeaveIfError(iGroup->GroupWin()->CaptureKeyUpAndDowns(capUpAndDownKeys[index2].keyCode,
-								capUpAndDownKeys[index2].modifier_mask,capUpAndDownKeys[index2].modifiers));
-	TSize screenSize=iGroup->Size();
-	TInt winWidth=screenSize.iWidth/2;
-	TInt winHeight=screenSize.iHeight-10;
-	iGroup->GroupWin()->AutoForeground(EFalse);		// Don't allow clicking to cause foreground, might mess up test
-	CCKWindow *win=new(ELeave) CCKWindow(iTest, iConnIndex);
-	win->SetUpL(TPoint(5,5),TSize(winWidth,winHeight),iGroup,*iGc);
-	iWin=win;
-	}
-
-void CCKConnection::KeyTestL(TInt aBool)
-	{
-	if (!aBool)
-		{
-		CTDialog *dialog=new(ELeave) CTDialog();
-		TInt ret=0;
-		dialog->ConstructLD(*iGroup,*iGc);
-		dialog->SetTitle(_L("Invalid key press"));
-		dialog->SetLine1(_L("Try again?"));
-		dialog->SetNumButtons(2);
-		dialog->SetButtonText(0,_L("Fail"));
-		dialog->SetButtonText(1,_L("Retry"));
-		ret=dialog->Display();
-		User::Leave(ret==1 ? ECapKeyRetry : ECapKeyFail);
-		}
-	}
-
-void CCKConnection::CheckKeyL(const SCapKeyTestParams &aKeyTest, const TKeyEvent &aKey)
-	{
-	KeyTestL(aKeyTest.connIndex==iConnIndex);
-	KeyTestL(aKeyTest.keyCode==aKey.iCode);
-	KeyTestL(aKeyTest.modifiers==(aKey.iModifiers&aKeyTest.modifier_mask));
-	}
-
-void CCKConnection::CheckUpDownL(const SCapKeyTestParams &aKeyTest, const TKeyEvent &aKey)
-	{
-	KeyTestL(aKeyTest.connIndex==iConnIndex);
-	KeyTestL(aKeyTest.keyCode==(TUint)aKey.iScanCode);
-	KeyTestL(aKeyTest.modifiers==(aKey.iModifiers&aKeyTest.modifier_mask));
-	}
-
-void CCKConnection::KeyL(const TKeyEvent &aKey,const TTime &)
-	{
-	if (iTest->Mode()==EModeNormalCapture)
-		{
-		if (aKey.iCode==EKeyEscape)
-			iTest->AbortL();
-		TRAPD(ret,CheckKeyL(capKeyTests[iTest->SubState()],aKey));
-		if (ret==ECapKeyOkay)
-			iTest->IncSubState();
-		else
-			iTest->TestL(ret==ECapKeyRetry);
-		}
-	}
-
-void CCKConnection::CheckUpDownL(const TKeyEvent &aKey)
-	{
-	CheckUpDownL(capKeyTests[iTest->SubState()],aKey);
-	}
-
-CCKAbortConnection::CCKAbortConnection(TCaptureKeyTest *aTest) : CCKConnectionBase(aTest)
-	{
-	}
-
-CCKAbortConnection::~CCKAbortConnection()
-	{
-	iGroup->GroupWin()->RemovePriorityKey(3,EModifierCtrl,EModifierCtrl);
-	delete iAbortHandler;
-	}
-
-void CCKAbortConnection::ConstructL()
-	{
-	CCKConnectionBase::ConstructL();
-	User::LeaveIfError(iGroup->GroupWin()->AddPriorityKey(abortKeyTests[0].keyCode,abortKeyTests[0].modifier_mask,abortKeyTests[0].modifiers));
-	User::LeaveIfError(iGroup->GroupWin()->AddPriorityKey(abortKeyTests[1].keyCode,abortKeyTests[1].modifier_mask,abortKeyTests[1].modifiers));
-	User::LeaveIfError(iGroup->GroupWin()->AddPriorityKey(abortKeyTests[2].keyCode,abortKeyTests[2].modifier_mask,abortKeyTests[2].modifiers));
-	iAbortHandler=new(ELeave) CAbortHandler(&iWs, this);
-	iAbortHandler->Construct();
-	iWs.Flush();
-	}
-
-void CCKAbortConnection::ReceivedAbortEventL(TInt aHandle, TKeyEvent *aKey)
-	{
-	iTest->TestL(aHandle==(TInt)iGroup);
-	iTest->TestL(aKey->iCode==abortKeyTests[iAbortKeyIndex].keyCode);
-	iTest->TestL((aKey->iModifiers&abortKeyTests[iAbortKeyIndex].modifier_mask)==abortKeyTests[iAbortKeyIndex].modifiers);
-	iAbortKeyIndex++;
-	iTest->IncSubState();
-	}
-
-void CCKAbortConnection::Foreground()
-	{
-	iGroup->GroupWin()->SetOrdinalPosition(0);
-	iWs.Flush();
-	}
-
-//
-// CCKWindowGroup class //
-//
-
-CCKWindowGroup::CCKWindowGroup(CTClient *aClient, TCaptureKeyTest *aTest) : CTWindowGroup(aClient), iTest(aTest)
-	{}
-
-void CCKWindowGroup::KeyL(const TKeyEvent &aKey,const TTime &time)
-	{
-	/*TLogMessageText buf(_S("##Recieved Key: "));
-	buf.Append(aKey.iScanCode);
-	buf.Append('(');
-	buf.AppendNum(aKey.iScanCode);
-	buf.Append(')');
-	if (!iCurWin)
-		{
-		buf.Append('(');
-		buf.AppendNum(((CCKConnection *)iClient)->Index());
-		buf.Append(')');
-		}
-	iClient->iWs.LogMessage(buf);*/
-	if (iCurWin)
-		iCurWin->WinKeyL(aKey,time);
-	else
-		((CCKConnection *)iClient)->KeyL(aKey,time);
-	}
-
-void CCKWindowGroup::KeyDownL(const TKeyEvent &aKey,const TTime &)
-	{
-	if (aKey.iScanCode!=EStdKeyLeftShift && aKey.iScanCode!=EStdKeyRightShift)
-		{
-		if (iTest->Mode()==EModeWaitingForFirstDown)
-			iTest->SetMode(EModeKeyUpsAndDowns);
-		if (iTest->Mode()==EModeKeyUpsAndDowns)
-			((CCKConnection *)iClient)->CheckUpDownL(aKey);
-		}
-	}
-
-void CCKWindowGroup::KeyUpL(const TKeyEvent &aKey,const TTime &)
-	{
-	if (aKey.iScanCode!=EStdKeyLeftShift && aKey.iScanCode!=EStdKeyRightShift)
-		{
-		if (iTest->Mode()==EModeKeyUpsAndDowns)
-			{
-			((CCKConnection *)iClient)->CheckUpDownL(aKey);
-			iTest->IncSubState();
-			}
-		}
-	}
-
-//
-// CCKWindow, class //
-//
-
-CCKWindow::CCKWindow(TCaptureKeyTest *aTest, TInt aConnIndex) : CTWin(), iConnIndex(aConnIndex), iTest(aTest)
-	{
-	iBack=TRgb::Gray256(230);
-	}
-
-void CCKWindow::SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc)
-	{
-	ConstructExtLD(*parent,pos,size);
-	iWin.SetBackgroundColor(iBack);
-	Activate();
-	AssignGC(aGc);
-	}
-
-void CCKWindow::Draw()
-	{
-	iGc->Clear();
-	if (iConnIndex==0)
-		iGc->DrawText(TPtrC(capKeyTests[iTest->SubState()].txt), TPoint(10,20));
-	}
-
-//
-
-TCaptureKeyTest::TCaptureKeyTest() : CTestBase(_L("Capture Key"))
-	{}
-
-TCaptureKeyTest::~TCaptureKeyTest()
-	{
-	delete iConn1;
-	delete iConn2;
-	delete iConn3;
-	delete iAbortConn;
-	}
-
-void TCaptureKeyTest::ConstructL()
-	{
-	iAbortConn=new(ELeave) CCKAbortConnection(this);
-	iAbortConn->ConstructL();
-	iConn3=new(ELeave) CCKConnection(this,2);
-	iConn3->ConstructL();
-	iConn2=new(ELeave) CCKConnection(this,1);
-	iConn2->ConstructL();
-	iConn1=new(ELeave) CCKConnection(this,0);
-	iConn1->ConstructL();
-	iMode=EModeNormalCapture;
-	}
-
-TInt TCaptureKeyTest::SubState() const
-	{
-	return(iSubState);
-	}
-
-void TCaptureKeyTest::IncSubState()
-	{
-	iSubState++;
-	iConn1->SubStateChanged();
-	iConn2->SubStateChanged();
-	iConn3->SubStateChanged();
-	switch(iMode)
-		{
-		case EModeNormalCapture:
-			if (iSubState==numCapKeyTests)
-				TestComplete();
-			break;
-		case EModeKeyUpsAndDowns:
-			if (iSubState==(numCapKeyTests+numUpDownKeyTests))
-				TestComplete();
-			break;
-		case EModeAbortKeys:
-			if (iSubState==(numCapKeyTests+numUpDownKeyTests+numAbortKeyTests))
-				TestComplete();
-			break;
-		default:
-			break;
-		}
-	}
-
-void TCaptureKeyTest::CapKeyPurgingL()
-	{
-	TInt base=Client()->iWs.ResourceCount();
-	RWindowGroup groupWin(Client()->iWs);
-	User::LeaveIfError(groupWin.Construct(ENullWsHandle));
-	TInt capHandle=User::LeaveIfError(groupWin.CaptureKey('a',EModifierFunc,EModifierFunc));
-	User::LeaveIfError(groupWin.CaptureKey('b',EModifierFunc,EModifierFunc));
-	TestL(Client()->iWs.ResourceCount()==(base+3));
-	groupWin.CancelCaptureKey(capHandle);
-	TestL(Client()->iWs.ResourceCount()==(base+2));
-	groupWin.Close();
-	TestL(Client()->iWs.ResourceCount()==base);		// Check it also freed the extra capture key
-	}
-
-void TCaptureKeyTest::BadParamsL()
-	{
-	TInt resCount=Client()->iWs.ResourceCount();
-	for(TInt index=0;index<numErrorKeys;index++)
-		TestL(Client()->iGroup->GroupWin()->CaptureKey(errorKeys[index].keyCode,errorKeys[index].modifier_mask,errorKeys[index].modifiers)==KErrArgument);
-	TestL(Client()->iWs.ResourceCount()==resCount);
-	}
-
-void TCaptureKeyTest::TestComplete()
-	{
-	Request();
-	}
-
-void TCaptureKeyTest::SetMode(TTestMode aMode)
-	{
-	iMode=aMode;
-	}
-
-TTestMode TCaptureKeyTest::Mode()
-	{
-	return(iMode);
-	}
-
-void TCaptureKeyTest::SetUpPriorityKeyTest()
-	{
-	iMode=EModeAbortKeys;
-	iAbortConn->Foreground();
-	}
-
-void TCaptureKeyTest::CaptureUpsAndDownsTest()
-	{
-	iMode=EModeWaitingForFirstDown;
-	}
-
-TestState TCaptureKeyTest::DoTestL()
-	{
-	switch(iState)
-		{
-		case 0:	// Dummy one to let capture key tests run
-			iState++;
-			return(EContinue);
-		case 1:
-			LogSubTest(_L("Capture ups and downs"),1);
-			CaptureUpsAndDownsTest();
-			iState++;
-			return(EContinue);
-		case 2:
-			LogSubTest(_L("Abort key"),1);
-			SetUpPriorityKeyTest();
-			iState++;
-			return(EContinue);
-		case 3:
-			LogSubTest(_L("Errors"),1);
-			BadParamsL();
-			CapKeyPurgingL();
-			LogSubTest(_L("CaptureKey"),1);
-			iState++;
-			return(ENext);
-		default:
-			return(EFinished);
-		}
-//	return(ENext);
- 	}
--- a/windowing/windowserver/tman/TMMODCHG.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,301 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test modifier changed message
-// 
-//
-
-#include <e32std.h>
-#include <e32svr.h>
-#include "W32STD.H"
-#include "../tlib/testbase.h"
-#include "TMAN.H"
-
-class CTModifiersChangedTest;
-
-class CMCWindow : public CTWin
-	{
-public:
-	CMCWindow(CTModifiersChangedTest *aTest);
-	void SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
-	void Draw();
-	void DrawModSetLine(const TDesC &aDes,TInt aModifier,TInt iSettableModifiers);
-protected:
-	CTModifiersChangedTest *iTest;
-	TRgb iBack;
-	TInt iLineHeight;
-	TInt iFontAscent;
-	TInt iYpos;
-	TInt iXpos1;
-	TInt iXpos2;
-	};
-
-class CTEventWindowGroup : public CTWindowGroup
-	{
-public:
-	CTEventWindowGroup(CTClient *aClient, CTModifiersChangedTest *iTest);
-	void ConstructL();
-	void ModifiersChanged(const TModifiersChangedEvent &aModifiersChanged ,const TTime &aTime);
-	void KeyL(const TKeyEvent &aKey,const TTime &aTime);
-private:
-	CTModifiersChangedTest *iTest;
-	};
-
-class CTModifiersChangedTest : public CTestBase
-	{
-public:
-	CTModifiersChangedTest();
-	~CTModifiersChangedTest();
-	TestState DoTestL();
-	void ConstructL();
-	void EndTest();
-	TInt SubState() const;
-	void IncSubState();
-	void BadParams();
-	void ModifierChangedEventsL();
-	void SetModifiersL();
-	void CheckModifierL(TEventModifier aModifier);
-public:
-	TBool iModSetTest;
-	TInt iSettable;
-private:
-	TSize iWinSize;
-	TInt iState;
-	TInt iSubState;
-	CTEventWindowGroup *iEventGroup;
-	CMCWindow *iWin;
-	};
-
-struct TModifierChangedTestsParams
-	{
-	TText *txt;			// Text message telling user what to do
-	TUint changed;
-	TUint state;
-	TUint stateMask;
-	};
-
-LOCAL_D TModifierChangedTestsParams ModifierChangedTests[]={
-#if defined(__WINS__)
-	{(TText *)_S("Press Caps"),EModifierCapsLock,EModifierCapsLock,EModifierCapsLock},
-	{(TText *)_S("Press Caps (again)"),EModifierCapsLock,0,EModifierCapsLock},
-#endif
-	{(TText *)_S("Press left shift"),EModifierShift|EModifierLeftShift,EModifierShift|EModifierLeftShift,EModifierShift|EModifierLeftShift},
-	{(TText *)_S("Release left shift"),EModifierShift|EModifierLeftShift,0,EModifierShift|EModifierLeftShift},
-	{(TText *)_S("Press right shift"),EModifierShift|EModifierRightShift,EModifierShift|EModifierRightShift,EModifierShift|EModifierRightShift},
-	{(TText *)_S("Release right shift"),EModifierShift|EModifierRightShift,0,EModifierShift|EModifierRightShift},
-	{(TText *)_S("Press (left) func"),EModifierFunc|EModifierLeftFunc,EModifierFunc|EModifierLeftFunc,EModifierFunc|EModifierLeftFunc},
-	{(TText *)_S("Release (left) func"),EModifierFunc|EModifierLeftFunc,0,EModifierFunc|EModifierLeftFunc},
-	{(TText *)_S("Press (left) control"),EModifierCtrl|EModifierLeftCtrl,EModifierCtrl|EModifierLeftCtrl,EModifierCtrl|EModifierLeftCtrl},
-	{(TText *)_S("Release (left) control"),EModifierCtrl|EModifierLeftCtrl,0,EModifierCtrl|EModifierLeftCtrl},
-	};
-
-const TInt numTests=sizeof(ModifierChangedTests)/sizeof(ModifierChangedTests[0]);
-
-GLDEF_C CTestBase *CreateModifiersChangedTest()
-	{
-	return(new(ELeave) CTModifiersChangedTest());
-	}
-
-//
-// CTEventWindowGroup class //
-//
-
-CTEventWindowGroup::CTEventWindowGroup(CTClient *aClient, CTModifiersChangedTest *aTest) : CTWindowGroup(aClient), iTest(aTest)
-	{}
-
-void CTEventWindowGroup::ConstructL()
-	{
-	CTWindowGroup::ConstructL();
-	iGroupWin.EnableModifierChangedEvents(EModifierShift|EModifierLeftShift|EModifierRightShift|EModifierCapsLock|
-							EModifierFunc|EModifierLeftFunc|EModifierCtrl|EModifierLeftCtrl,EEventControlAlways);
-	}
-
-void CTEventWindowGroup::ModifiersChanged(const TModifiersChangedEvent &aModifiersChanged ,const TTime &)
-	{
-	TInt ss=iTest->SubState();
-	TInt getMods=Client()->iWs.GetModifierState();	// Double check the mods with get mods
-	if (aModifiersChanged.iChangedModifiers==ModifierChangedTests[ss].changed && 
-		(aModifiersChanged.iModifiers&ModifierChangedTests[ss].stateMask)==ModifierChangedTests[ss].state &&
-		(getMods&ModifierChangedTests[ss].stateMask)==ModifierChangedTests[ss].state)
-		iTest->IncSubState();
-	}
-
-void CTEventWindowGroup::KeyL(const TKeyEvent &aKey,const TTime &)
-	{
-	if (aKey.iCode==EKeyEscape || (aKey.iCode==' ' && iTest->iModSetTest))
-		iTest->EndTest();
-	}
-
-//
-// CMCWindow, class //
-//
-
-CMCWindow::CMCWindow(CTModifiersChangedTest *aTest) : CTWin(), iTest(aTest)
-	{
-	iBack=TRgb::Gray256(230);
-	}
-
-void CMCWindow::SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc)
-	{
-	ConstructExtLD(*parent,pos,size);
-	iWin.SetBackgroundColor(iBack);
-	Activate();
-	AssignGC(aGc);
-	iLineHeight=iFont->HeightInPixels()*5/4;
-	iFontAscent=iFont->AscentInPixels();
-	iXpos1=4;
-	iXpos2=iXpos1+12*iFont->TextWidthInPixels(_L("M"));
-	}
-
-void CMCWindow::DrawModSetLine(const TDesC &aDes,TInt aModifier,TInt iSettableModifiers)
-	{
-	iYpos+=iLineHeight;
-	iGc->DrawText(aDes, TPoint(iXpos1,iYpos));
-	iGc->DrawText(aModifier&iSettableModifiers ? _L("Yes"):_L("No"), TPoint(iXpos2,iYpos));
-	}
-
-void CMCWindow::Draw()
-	{
-	iGc->Clear();
-	if (iTest->iModSetTest)
-		{
-		iYpos=iFontAscent+3;
-		TBuf<32> buf;
-		buf.Format(TRefByValue<const TDesC>(_L("Settable? [0x%4x]")), iTest->iSettable);
-		iGc->DrawText(_L("Modifier"), TPoint(iXpos1,iYpos));
-		iGc->DrawText(buf, TPoint(iXpos2,iYpos));
-		DrawModSetLine(_L("Shift"),EModifierShift,iTest->iSettable);
-		DrawModSetLine(_L("Left Shift"),EModifierLeftShift,iTest->iSettable);
-		DrawModSetLine(_L("Func"),EModifierFunc,iTest->iSettable);
-		DrawModSetLine(_L("Caps"),EModifierCapsLock,iTest->iSettable);
-		DrawModSetLine(_L("NumLock"),EModifierNumLock,iTest->iSettable);
-		DrawModSetLine(_L("Double Click"),EModifierDoubleClick,iTest->iSettable);
-		}
-	else
-		iGc->DrawText(TPtrC(ModifierChangedTests[iTest->SubState()].txt), TPoint(10,20));
-	}
-
-//
-
-CTModifiersChangedTest::CTModifiersChangedTest() : CTestBase(_L("Capture Key"))
-	{}
-
-CTModifiersChangedTest::~CTModifiersChangedTest()
-	{
-	delete iWin;
-	delete iEventGroup;
-	}
-
-void CTModifiersChangedTest::EndTest()
-	{
-	if (iModSetTest)
-		{
-		iModSetTest=EFalse;
-		iWin->Invalidate();
-		}
-	Request();
-	}
-
-void CTModifiersChangedTest::ConstructL()
-	{
-	iWin=new(ELeave) CMCWindow(this);
-	iWin->SetUpL(TPoint(10,10),TSize(240,200),Client()->iGroup, *Client()->iGc);
-	}
-
-TInt CTModifiersChangedTest::SubState() const
-	{
-	return(iSubState);
-	}
-
-void CTModifiersChangedTest::IncSubState()
-	{
-	if (iSubState==(numTests-1))
-		EndTest();
-	else
-		{
-		iSubState++;
-		iWin->Invalidate();
-		}
-	}
-
-void CTModifiersChangedTest::BadParams()
-	{
-	}
-
-void CTModifiersChangedTest::ModifierChangedEventsL()
-	{
-	iEventGroup=new(ELeave) CTEventWindowGroup(Client(), this);
-	iEventGroup->ConstructL();
-	}
-
-void CTModifiersChangedTest::CheckModifierL(TEventModifier aModifier)
-	{
-	TInt oldMods=Client()->iWs.GetModifierState();
-	Client()->iWs.SetModifierState(aModifier, EToggleModifier);
-	TInt getMods=Client()->iWs.GetModifierState();
-	if (oldMods!=getMods)
-		{
-		iSettable|=aModifier;
-		Client()->iWs.SetModifierState(aModifier, ETurnOffModifier);
-		getMods=Client()->iWs.GetModifierState();
-		TestL(!(getMods&aModifier));
-		Client()->iWs.SetModifierState(aModifier, ETurnOnModifier);
-		getMods=Client()->iWs.GetModifierState();
-		TestL(getMods&aModifier);
-		Client()->iWs.SetModifierState(aModifier, ETurnOffModifier);
-		getMods=Client()->iWs.GetModifierState();
-		TestL(!(getMods&aModifier));
-		if (oldMods&aModifier)
-			Client()->iWs.SetModifierState(aModifier, ETurnOnModifier);
-		}
-	else
-		{
-		Client()->iWs.SetModifierState(aModifier, ETurnOffModifier);
-		TestL(oldMods==Client()->iWs.GetModifierState());
-		Client()->iWs.SetModifierState(aModifier, ETurnOnModifier);
-		TestL(oldMods==Client()->iWs.GetModifierState());
-		}
-	}
-
-void CTModifiersChangedTest::SetModifiersL()
-	{
-	iModSetTest=ETrue;
-	for(TInt mod=1;mod!=0;mod<<=1)
-		CheckModifierL((TEventModifier)mod);
-	iWin->Invalidate();
-	Client()->iWs.Flush();
-	}
-
-TestState CTModifiersChangedTest::DoTestL()
-	{
-	switch(iState)
-		{
-		case 0:		//The first 2 tests have been converted to TAuto test code.
-			ModifierChangedEventsL();
-		/*	iState++;
-			return(EContinue);
-		case 1:
-			LogSubTest(_L("Errors"),1);
-			BadParams();
-			break;
-		case 2:*/
-			LogSubTest(_L("Set modifiers"),1);
-			SetModifiersL();
-			iState++;
-			return(EContinue);
-		default:
-			return(EFinished);
-		}
-	//iState++;
-	//return(ENext);
- 	}
--- a/windowing/windowserver/tman/TMPNTBUF.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,283 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test Pointer move/drag buffer
-// 
-//
-
-#include <e32std.h>
-#include "W32STD.H"
-#include "../tlib/testbase.h"
-#include "TMAN.H"
-
-class CTPntBufTest;
-
-class CPntBufWindow : public CTBackedUpWin
-	{
-private:
-	enum {KPointerMoveBufferSize=32};
-public:
-	CPntBufWindow(CTPntBufTest *aTest);
-	~CPntBufWindow();
-	void SetUpLD(TPoint pos,TSize size,CTWinBase *parent);
-	void PointerBufferReady(const TTime &aTime);
-	void PointerL(const TPointerEvent &pointer,const TTime &aTime);
-	void SetUpState();
-	void NextTest();
-	void WinKeyL(const TKeyEvent &aKey,const TTime &aTime);
-	void ErrorL();
-private:
-	//Virtual functions from CTWinBase
-	void PointerEnter(const TTime&);
-	void PointerExit(const TTime&);
-private:
-	CTPntBufTest *iTest;
-	TBool iDragging;
-	TBool iErrorNest;
-	TBool iDisabled;
-	TBool iDiscard;
-	TInt iMode;
-	TBool iIgnorNextPoint;
-	};
-
-class CTPntBufTest : public CTestBase
-	{
-public:
-	CTPntBufTest();
-	~CTPntBufTest();
-	TestState DoTestL();
-	void FinishedTests();
-	void ConstructL();
-private:
-	CPntBufWindow *iWin;
-	TSize iWinSize;
-	TInt iState;
-	};
-
-GLDEF_C CTestBase *CreatePointerBufferTest()
-	{
-	return(new(ELeave) CTPntBufTest());
-	}
-
-CPntBufWindow::CPntBufWindow(CTPntBufTest *aTest) : CTBackedUpWin(EGray4), iTest(aTest)
-	{}
-
-CPntBufWindow::~CPntBufWindow()
-	{
-	delete iGc;
-	}
-
-void CPntBufWindow::SetUpLD(TPoint pos,TSize size,CTWinBase *parent)
-	{
-	ConstructExtLD(*parent,pos,size);
-	User::LeaveIfError(iWin.AllocPointerMoveBuffer(KPointerMoveBufferSize,0));
-	iWin.SetPointerGrab(ETrue);
-	iWin.PointerFilter(EPointerFilterEnterExit,0);
-	Activate();
-	User::LeaveIfError(Client()->iScreen->CreateContext(iGc));
-	iGc->Activate(iWin);
-	SetUpState();
-	}
-
-void CPntBufWindow::PointerBufferReady(const TTime &)
-	{
-	if (iDiscard)
-		iWin.DiscardPointerMoveBuffer();
-	iGc->SetPenColor(iDragging ? TRgb::Gray4(0) : TRgb::Gray4(1));
-	iGc->SetPenSize(iDragging ? TSize(2,2) : TSize(1,1));
-	TPoint pnts[KPointerMoveBufferSize];
-	TPtr8 ptr((TUint8 *)&pnts,sizeof(pnts));
-	TInt numPnts=iWin.RetrievePointerMoveBuffer(ptr);
-	TInt index=0;
-	if (iIgnorNextPoint)
-		{
-		iGc->MoveTo(pnts[index]);
-		index=1;
-		iIgnorNextPoint=EFalse;
-		}
-	for(;index<numPnts;index++)
-		iGc->DrawLineTo(pnts[index]);
-	}
-
-void CPntBufWindow::ErrorL()
-	{
-	if (!iErrorNest)
-		{
-		iErrorNest=ETrue;
-		iTest->TestL(EFalse);
-		}
-	}
-
-void CPntBufWindow::PointerL(const TPointerEvent &pointer,const TTime &)
-	{
-	switch(pointer.iType)
-		{
-		case TPointerEvent::EButton1Down:
-			iDragging=ETrue;
-			iGc->MoveTo(pointer.iPosition);
-			if (iMode==2)
-				{
-				if (pointer.iModifiers&EModifierShift)
-					{
-					iDisabled=ETrue;
-					iWin.DisablePointerMoveBuffer();
-					}
-				else if (pointer.iModifiers&EModifierCtrl)
-					iDiscard=ETrue;
-				}
-			break;
-		case TPointerEvent::EButton1Up:
-			if (iDisabled)
-				{
-				iDisabled=EFalse;
-				iWin.EnablePointerMoveBuffer();
-				}
-			iDiscard=EFalse;
-			iGc->MoveTo(pointer.iPosition);
-			iDragging=EFalse;
-			break;
-		case TPointerEvent::EDrag:
-			if (iDragging && !iDisabled)
-				ErrorL();
-			break;
-		case TPointerEvent::EMove:
-			if (iDragging && !iDisabled)
-				ErrorL();
-			break;
-		default:;
-		}
-	}
-
-void CPntBufWindow::SetUpState()
-	{
-
-	iGc->Reset();
-	iGc->UseFont((CFont *)iFont);
-	iGc->Clear();
-	switch(iMode)
-		{
-		case 0:
-			iWin.PointerFilter(EPointerFilterMove,EPointerFilterMove);
-			iGc->DrawText(_L("Drag the pointer around the window and check"), TPoint(10,20));
-			iGc->DrawText(_L("a line is drawn following the pointer when"), TPoint(10,40));
-			iGc->DrawText(_L("dragging but not when moving"), TPoint(10,60));
-			iGc->DrawText(_L("Press <Space> when checked"), TPoint(10,90));
-			break;
-		case 1:
-			iWin.PointerFilter(EPointerFilterMove|EPointerFilterDrag,EPointerFilterDrag);
-			iGc->DrawText(_L("If pointer moves are supported move the pointer around the "), TPoint(10,20));
-			iGc->DrawText(_L("window and check a line is drawn following the pointer"), TPoint(10,40));
-			iGc->DrawText(_L("when it is up, and no lines are drawn when dragging"), TPoint(10,60));
-			iGc->DrawText(_L("Press <Esc> if moves not supported or <Space> when checked"), TPoint(10,90));
-			break;
-		case 2:
-			iWin.PointerFilter(EPointerFilterMove|EPointerFilterDrag,0);
-			iGc->DrawText(_L("Drag and move the pointer around the window and check a"), TPoint(10,20));
-			iGc->DrawText(_L("line is drawn following the pointer during both dragging and"), TPoint(10,40));
-			iGc->DrawText(_L("moving, also check drag with the shift or control key down doesn't draw"), TPoint(10,60));
-			iGc->DrawText(_L("Press <Space> when checked"), TPoint(10,90));
-			break;
-		}
-	}
-
-void CPntBufWindow::NextTest()
-	{
-	if (iMode++==2)
-		iTest->FinishedTests();
-	else
-		SetUpState();
-	}
-
-void CPntBufWindow::WinKeyL(const TKeyEvent &aKey,const TTime &)
-	{
-	switch(aKey.iCode)
-		{
-		case ' ':
-			NextTest();
-			break;
-		case EKeyEscape:
-			iTest->FinishedTests();
-			break;
-		case '0':
-			SetUpState();
-			break;
-		case '1':
-		case '2':
-		case '3':
-			{
-			TInt mode=aKey.iCode-'1';
-			if (mode!=iMode)
-				{
-				iMode=mode;
-				SetUpState();
-				}
-			}
-			break;
-		}
-	}
-
-void CPntBufWindow::PointerEnter(const TTime&)
-	{
-	if (iMode==0)
-		iDragging=ETrue;
-	else if (iMode==1)
-		iDragging=EFalse;
-	iIgnorNextPoint=ETrue;
-	}
-
-void CPntBufWindow::PointerExit(const TTime&)
-	{}
-
-
-/*CTPntBufTest*/
-
-CTPntBufTest::CTPntBufTest() : CTestBase(_L("Scale"))
-	{}
-
-CTPntBufTest::~CTPntBufTest()
-	{
-#if defined(__WINS__)
-	Client()->iWs.SimulateXyInputType(EXYInputPointer);
-#endif
-	CTWin::Delete(iWin);
-	}
-
-void CTPntBufTest::FinishedTests()
-	{
-	Request();
-	}
-
-void CTPntBufTest::ConstructL()
-	{
-	CPntBufWindow *win=new(ELeave) CPntBufWindow(this);
-	win->SetUpLD(TPoint(0,0),Client()->iScreen->SizeInPixels(),Client()->iGroup);
-	iWin=win;
-	Client()->iGroup->SetCurrentWindow(iWin);
-#if defined(__WINS__)
-	Client()->iWs.SimulateXyInputType(EXYInputMouse);
-#endif
-	}
-
-TestState CTPntBufTest::DoTestL()
-	{
-	switch(iState)
-		{
-		case 0:
-			LogSubTest(_L("Scale 1"),1);
-			iState++;
-			return(EContinue);
-		default:
-			return(EFinished);
-		}
-//	return(ENext);
-	}
--- a/windowing/windowserver/tman/TMPNTCAP.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,856 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test pointer capture
-// 
-//
-
-#include <e32std.h>
-#include <e32svr.h>
-#include "W32STD.H"
-#include "../tlib/testbase.h"
-#include "TMAN.H"
-
-enum TTestState
-	{
-	ECaptureDisabled,
-	ENormalCapture,
-	ECaptureAllGroups,
-	EDragDropCapture,
-	EDragDropCaptureAllGroups,
-	ENormalCaptureWithoutFocus,
-	};
-
-enum TTestSubState
-	{
-	EMainWindow,
-	EChildWindow,
-	EOtherGroup,
-	EOtherSession,
-	ERootWindow,
-	};
-
-enum TPointerCheckRet
-	{
-	EFailed,
-	EOkay,
-	ENeedsDDEvent,
-	};
-
-const TInt ESubStates1=2;
-const TInt ESubStates2=5;
-const TInt ESubStates3=5;
-const TInt ESubStates4=5;
-const TInt ESubStates5=5;
-const TInt ESubStates6=5;
-
-const TInt EWinBorderSize=10;
-
-class CPcWindowBase;
-class TPointerCaptureTest;
-
-class CPcConnection : public CTClient
-	{
-public:
-	CPcConnection(TPointerCaptureTest *aTest);
-	~CPcConnection();
-	virtual void ConstructL();
-protected:
-	TPointerCaptureTest *iTest;
-	};
-
-class CPcWindowBase : public CTWin
-	{
-public:
-	CPcWindowBase(TPointerCaptureTest *aTest);
-	void SetUpL(TPoint pos,TSize size,CTWinBase *parent);
-	void SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
-	void Draw(TDesC &aBuf);
-	void PointerL(const TPointerEvent &pointer,const TTime &);
-	void DragDropL(const TPointerEvent &pointer,const TTime &);
-	virtual TPointerCheckRet PointerDown()=0;
-	virtual TPointerCheckRet DragDrop()=0;
-	virtual void SubStateChanged();
-protected:
-	TPointerCaptureTest *iTest;
-	TRgb iBack;
-	};
-
-class CPcWindowChild : public CPcWindowBase
-	{
-public:
-	CPcWindowChild(TPointerCaptureTest *aTest);
-	void Draw();
-	TPointerCheckRet PointerDown();
-	TPointerCheckRet DragDrop();
-	};
-
-class CPcWindowMain : public CPcWindowBase
-	{
-public:
-	CPcWindowMain(TPointerCaptureTest *aTest);
-	void Draw();
-	TPointerCheckRet PointerDown();
-	TPointerCheckRet DragDrop();
-	void WinKeyL(const TKeyEvent &aKey,const TTime &aTime);
-	};
-
-class CPcWindowAltGroup : public CPcWindowBase
-	{
-public:
-	CPcWindowAltGroup(TPointerCaptureTest *aTest);
-	void Draw();
-	TPointerCheckRet PointerDown();
-	TPointerCheckRet DragDrop();
-	};
-
-class CPcWindowNickFocusGroup : public CTWindowGroup
-	{
-public:
-	CPcWindowNickFocusGroup(TPointerCaptureTest *aTest, CTClient *aClient);
-	void KeyL(const TKeyEvent &aKey,const TTime &aTime);
-private:
-	TPointerCaptureTest *iTest;
-	};
-
-class CPcWindowAltConnection : public CPcWindowBase
-	{
-public:
-	CPcWindowAltConnection(TPointerCaptureTest *aTest);
-	void Draw();
-	TPointerCheckRet PointerDown();
-	TPointerCheckRet DragDrop();
-	};
-
-class TPointerCaptureTest : public CTestBase
-	{
-private:
-	enum TDState {DDStateNull, DDStateGot, DDStateWaiting};
-public:
-	TPointerCaptureTest();
-	~TPointerCaptureTest();
-	TestState DoTestL();
-	void ConstructL();
-	void NextTest();
-	void AbortTests();
-	TInt State() const;
-	TInt SubState() const;
-	void doIncSubState();
-	void IncSubState(TBool aNeedsDD=EFalse);
-	void GotDD();
-	void StateChanged();
-	void TestFailed();
-	void NickFocusL();
-	void SetCapture(TInt aCaptureFlags);
-	void RestartTest();
-private:
-	TInt doTestFailedL();
-private:
-	CPcConnection *iAltConnection;
-	CTWindowGroup *iMainGroup;
-	CTWindowGroup *iAltGroup;
-	CPcWindowChild *iChildWin;
-	CPcWindowMain *iMainWin;
-	CPcWindowAltGroup *iAltGroupWin;
-	CPcWindowAltConnection *iAltConnectionWin;
-	CPcWindowNickFocusGroup *iNickFocusGroup;
-	CTBlankWindow *iNickFocusBlankWin;
-	TInt iState;
-	TInt iSubState;
-	TDState iDDState;
-public:
-	TBool iFailed;
-	};
-
-GLDEF_C CTestBase *CreatePointerCaptureTest()
-	{
-	return(new(ELeave) TPointerCaptureTest());
-	}
-
-//
-// CMcConnection
-
-CPcConnection::CPcConnection(TPointerCaptureTest *aTest) : iTest(aTest)
-	{
-	}
-
-CPcConnection::~CPcConnection()
-	{
-	}
-
-void CPcConnection::ConstructL()
-	{
-	CTClient::ConstructL();
-	iGroup=new(ELeave) CTWindowGroup(this);
-	iGroup->ConstructL();
-	iGroup->GroupWin()->SetOrdinalPosition(0,1);
-	iGroup->GroupWin()->EnableReceiptOfFocus(EFalse);
-	iWs.Flush();
-	}
-
-//
-// CPcWindow, base class //
-//
-
-CPcWindowBase::CPcWindowBase(TPointerCaptureTest *aTest) : CTWin(), iTest(aTest)
-	{
-	}
-
-void CPcWindowBase::SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc)
-	{
-	ConstructExtLD(*parent,pos,size);
-	iWin.SetBackgroundColor(iBack);
-	Activate();
-	AssignGC(aGc);
-	}
-
-void CPcWindowBase::SetUpL(TPoint pos,TSize size,CTWinBase *parent)
-	{
-	SetUpL(pos,size,parent,*iTest->Client()->iGc);
-	}
-
-void CPcWindowBase::SubStateChanged()
-	{
-	iWin.Invalidate();
-	Client()->iWs.Flush();
-	}
-
-void CPcWindowBase::Draw(TDesC &aBuf)
-	{
-	iGc->Clear();
-	iGc->SetPenColor(iBack.Gray4()>1 ? TRgb(0,0,0) : TRgb(255,255,255));
-	iGc->DrawText(aBuf, TPoint(10,20));
-	}
-
-void CPcWindowBase::PointerL(const TPointerEvent &pointer,const TTime &)
-	{
-	if (pointer.iType==TPointerEvent::EButton1Down && !iTest->iFailed)
-		{
-		if (iTest->SubState()==ERootWindow)	// Root window click, must not be inside this window
-			{
-			if (TRect(Size()).Contains(pointer.iPosition))
-				{
-				iTest->TestFailed();
-				return;
-				}
-			}
-		TInt ret;
-		if ((ret=PointerDown())==EFailed)
-			iTest->TestFailed();
-		else
-			iTest->IncSubState(ret==ENeedsDDEvent);
-		}
-	}
-
-void CPcWindowBase::DragDropL(const TPointerEvent &pointer,const TTime &)
-	{
-	switch(iTest->State())
-		{
-		case ECaptureDisabled:
-		case ENormalCapture:
-		case ECaptureAllGroups:
-		case ENormalCaptureWithoutFocus:
-			iTest->TestFailed();
-			break;
-		}
-	if (pointer.iType==TPointerEvent::EButton1Down && !iTest->iFailed)
-		{
-		if (DragDrop()==EFailed)
-			iTest->TestFailed();
-		else
-			iTest->GotDD();
-		}
-	}
-//
-
-CPcWindowMain::CPcWindowMain(TPointerCaptureTest *aTest) : CPcWindowBase(aTest)
-	{
-	iBack=TRgb::Gray256(236);
-	}
-
-TPointerCheckRet CPcWindowMain::PointerDown()
-	{
-	switch(iTest->State())
-		{
-		case ECaptureDisabled:
-			if (iTest->SubState()==EMainWindow)
-				return(EOkay);
-			break;
-		case ENormalCapture:
-			switch(iTest->SubState())
-				{
-				case EMainWindow:
-				case ERootWindow:
-					return(EOkay);
-				default:
-					break;
-				}
-			break;
-		case ECaptureAllGroups:
-			switch(iTest->SubState())
-				{
-				case EMainWindow:
-				case EOtherGroup:
-				case EOtherSession:
-				case ERootWindow:
-					return(EOkay);
-				default:
-					break;
-				}
-			break;
-		case EDragDropCapture:
-			switch(iTest->SubState())
-				{
-				case EMainWindow:
-					return(ENeedsDDEvent);
-				case ERootWindow:
-					return(EOkay);
-				default:
-					break;
-				}
-			break;
-		case EDragDropCaptureAllGroups:
-			switch(iTest->SubState())
-				{
-				case EMainWindow:
-				case EOtherGroup:
-				case EOtherSession:
-					return(ENeedsDDEvent);
-				case ERootWindow:
-					return(EOkay);
-				default:
-					break;
-				}
-			break;
-		case ENormalCaptureWithoutFocus:
-			switch(iTest->SubState())
-				{
-				case EMainWindow:
-					return(EOkay);
-				default:
-					break;
-				}
-			break;
-		default:
-			break;
-		}
-	return(EFailed);
-	}
-
-TPointerCheckRet CPcWindowMain::DragDrop()
-	{
-	switch(iTest->State())
-		{
-		case EDragDropCapture:
-		case EDragDropCaptureAllGroups:
-			switch(iTest->SubState())
-				{
-				case EMainWindow:
-					return(EOkay);
-				default:
-					break;
-				}
-			break;
-		default:
-			break;
-		}
-	return(EFailed);
-	}
-
-void CPcWindowMain::Draw()
-	{
-	TBuf<0x40> buf;
-	if (iTest->State()==ECaptureDisabled)
-		{
-		switch(iTest->SubState())
-			{
-			case EMainWindow:
-				buf.Copy(_L("Click on me"));
-				break;
-			}
-		}
-	else
-		{
-		switch(iTest->SubState())
-			{
-			case EMainWindow:
-				buf.Copy(_L("Click on me"));
-				break;
-			case EChildWindow:
-			case EOtherGroup:
-			case EOtherSession:
-				break;
-			case ERootWindow:
-				if (iTest->State()==ENormalCaptureWithoutFocus)
-					buf.Copy(_L("Click on the root window, then press <Escape>"));
-				else
-					buf.Copy(_L("Click on the root window"));
-				break;
-			}
-		}
-	CPcWindowBase::Draw(buf);
-	}
-
-void CPcWindowMain::WinKeyL(const TKeyEvent &aKey,const TTime &)
-	{
-	switch(aKey.iCode)
-		{
-		case EKeyEscape:
-			iTest->AbortTests();
-			break;
-		}
-	}
-
-//
-
-CPcWindowChild::CPcWindowChild(TPointerCaptureTest *aTest) : CPcWindowBase(aTest)
-	{
-	iBack=TRgb::Gray256(85);
-	}
-
-TPointerCheckRet CPcWindowChild::PointerDown()
-	{
-	switch(iTest->State())
-		{
-		case ECaptureDisabled:
-			break;
-		default:
-			switch(iTest->SubState())
-				{
-				case EChildWindow:
-					return(EOkay);
-				default:
-					break;
-				}
-			break;
-		}
-	return(EFailed);
-	}
-
-TPointerCheckRet CPcWindowChild::DragDrop()
-	{
-	switch(iTest->State())
-		{
-		case EDragDropCapture:
-		case EDragDropCaptureAllGroups:
-			switch(iTest->SubState())
-				{
-				case EChildWindow:
-					return(EOkay);
-				default:
-					break;
-				}
-			break;
-		default:
-			break;
-		}
-	return(EFailed);
-	}
-
-void CPcWindowChild::Draw()
-	{
-	TBuf<0x40> buf;
-	if (iTest->State()!=ECaptureDisabled)
-		{
-		switch(iTest->SubState())
-			{
-			case EChildWindow:
-				buf.Copy(_L("Click on me"));
-				break;
-			default:
-				break;
-			}
-		}
-	CPcWindowBase::Draw(buf);
-	}
-
-//
-
-CPcWindowNickFocusGroup::CPcWindowNickFocusGroup(TPointerCaptureTest *aTest, CTClient *aClient) : CTWindowGroup(aClient), iTest(aTest)
-	{
-	}
-
-void CPcWindowNickFocusGroup::KeyL(const TKeyEvent &aKey,const TTime &)
-	{
-	if (aKey.iCode==EKeyEscape)
-		iTest->IncSubState(EFalse);
-	}
-
-//
-
-CPcWindowAltGroup::CPcWindowAltGroup(TPointerCaptureTest *aTest) : CPcWindowBase(aTest)
-	{
-	iBack=TRgb::Gray256(236);
-	}
-
-TPointerCheckRet CPcWindowAltGroup::PointerDown()
-	{
-	switch(iTest->State())
-		{
-		case ECaptureDisabled:
-			if (iTest->SubState()==EChildWindow)
-				return(EOkay);
-			break;
-		case ENormalCapture:
-		case EDragDropCapture:
-		case ENormalCaptureWithoutFocus:
-			switch(iTest->SubState())
-				{
-				case EOtherGroup:
-					return(EOkay);
-				default:
-					break;
-				}
-			break;
-		default:
-			break;
-		}
-	return(EFailed);
-	}
-
-TPointerCheckRet CPcWindowAltGroup::DragDrop()
-	{
-	switch(iTest->State())
-		{
-		case EDragDropCapture:
-		case EDragDropCaptureAllGroups:
-			switch(iTest->SubState())
-				{
-				case EOtherGroup:
-					return(EOkay);
-				default:
-					break;
-				}
-			break;
-		default:
-			break;
-		}
-	return(EFailed);
-	}
-
-void CPcWindowAltGroup::Draw()
-	{
-	TBuf<0x40> buf;
-	if (iTest->State()==ECaptureDisabled)
-		{
-		switch(iTest->SubState())
-			{
-			case EMainWindow:
-				break;
-			case EChildWindow:
-				buf.Copy(_L("Click on me"));
-				break;
-			}
-		}
-	else
-		{
-		switch(iTest->SubState())
-			{
-			case EOtherGroup:
-				buf.Copy(_L("Click on me"));
-				break;
-			default:
-				break;
-			}
-		}
-	CPcWindowBase::Draw(buf);
-	}
-
-//
-
-CPcWindowAltConnection::CPcWindowAltConnection(TPointerCaptureTest *aTest) : CPcWindowBase(aTest)
-	{
-	iBack=TRgb::Gray256(236);
-	}
-
-TPointerCheckRet CPcWindowAltConnection::PointerDown()
-	{
-	switch(iTest->State())
-		{
-		case ECaptureDisabled:
-			if (iTest->SubState()==EChildWindow)
-				return(EOkay);
-			break;
-		case ENormalCapture:
-		case EDragDropCapture:
-		case ENormalCaptureWithoutFocus:
-			switch(iTest->SubState())
-				{
-				case EOtherSession:
-					return(EOkay);
-				default:
-					break;
-				}
-			break;
-		default:
-			break;
-		}
-	return(EFailed);
-	}
-
-TPointerCheckRet CPcWindowAltConnection::DragDrop()
-	{
-	switch(iTest->State())
-		{
-		case EDragDropCapture:
-		case EDragDropCaptureAllGroups:
-			switch(iTest->SubState())
-				{
-				case EOtherSession:
-					return(EOkay);
-				default:
-					break;
-				}
-			break;
-		default:
-			break;
-		}
-	return(EFailed);
-	}
-
-void CPcWindowAltConnection::Draw()
-	{
-	TBuf<0x40> buf;
-	if (iTest->State()!=ECaptureDisabled)
-		{
-		switch(iTest->SubState())
-			{
-			case EOtherSession:
-				buf.Copy(_L("Click on me"));
-				break;
-			default:
-				break;
-			}
-		}
-	CPcWindowBase::Draw(buf);
-	}
-
-//
-
-TPointerCaptureTest::TPointerCaptureTest() : CTestBase(_L("Pointer Capture"))
-	{}
-
-TPointerCaptureTest::~TPointerCaptureTest()
-	{
-	delete iNickFocusBlankWin;
-	delete iNickFocusGroup;
-	delete iAltConnectionWin;
-	delete iAltConnection;
-	delete iChildWin;
-	delete iMainWin;
-	delete iMainGroup;
-	delete iAltGroupWin;
-	delete iAltGroup;
-	}
-
-void TPointerCaptureTest::TestFailed()
-	{
-	__ASSERT_DEBUG(iFailed==EFalse,TManPanic(ETManPanicPcFailed));
-	iFailed=ETrue;
-	Client()->iGroup->GroupWin()->SetOrdinalPosition(0,10);	// Put error dialog on top of test windows
-	TInt dRet=1;
-	TRAPD(err,dRet=doTestFailedL());
-	Client()->iGroup->GroupWin()->SetOrdinalPosition(0,0);
-	switch(dRet)
-		{
-		case 0:
-			RestartTest();
-			break;
-		case 1:
-			TRAP(err,TestL(EFalse));
-			break;
-		}
-	}
-
-TInt TPointerCaptureTest::doTestFailedL()
-	{
-	CTDialog *dialog=new(ELeave) CTDialog();
-	dialog->SetTitle(_L("Pointer capture test failed"));
-	dialog->SetNumButtons(2);
-	dialog->SetButtonText(0,_L("Retest"));
-	dialog->SetButtonText(1,_L("Fail"));
-	dialog->ConstructLD(*Client()->iGroup,*Client()->iGc);
-	return dialog->Display();
-	}
-
-TInt TPointerCaptureTest::State() const
-	{
-	return(iState);
-	}
-
-TInt TPointerCaptureTest::SubState() const
-	{
-	return(iSubState);
-	}
-
-void TPointerCaptureTest::doIncSubState()
-	{
-	iSubState++;
-	TInt max=0;
-	switch(iState)
-		{
-		case ECaptureDisabled:
-			max=ESubStates1;
-			break;
-		case ENormalCapture:
-			max=ESubStates2;
-			break;
-		case ECaptureAllGroups:
-			max=ESubStates3;
-			break;
-		case EDragDropCapture:
-			max=ESubStates4;
-			break;
-		case EDragDropCaptureAllGroups:
-			max=ESubStates5;
-			break;
-		case ENormalCaptureWithoutFocus:
-			max=ESubStates6;
-			break;
-		}
-	if (iSubState==max)
-		NextTest();
-	StateChanged();
-	}
-
-void TPointerCaptureTest::GotDD()
-	{
-	if (iDDState==DDStateWaiting)
-		doIncSubState();
-	else
-		iDDState=DDStateGot;
-	}
-
-void TPointerCaptureTest::IncSubState(TBool aNeedsDD)
-	{
-	if (!aNeedsDD)
-		{
-		if (iDDState!=DDStateNull)
-			TestFailed();
-		else
-			doIncSubState();
-		}
-	else if (iDDState==DDStateGot)
-		doIncSubState();
-	else
-		iDDState=DDStateWaiting;
-	}
-
-void TPointerCaptureTest::StateChanged()
-	{
-	iDDState=DDStateNull;
-	iChildWin->SubStateChanged();
-	iMainWin->SubStateChanged();
-	iAltGroupWin->SubStateChanged();
-	iAltConnectionWin->SubStateChanged();
-	}
-
-void TPointerCaptureTest::AbortTests()
-	{
-	iState=99;
-	Request();
-	}
-
-void TPointerCaptureTest::NextTest()
-	{
-	iState++;
-	Request();
-	}
-
-void TPointerCaptureTest::RestartTest()
-	{
-	Request();
-	}
-
-void TPointerCaptureTest::ConstructL()
-	{
-	TSize size(Client()->iGroup->Size());
-	TInt winWidth2=size.iWidth/2-EWinBorderSize*2;
-	TInt winWidth4=size.iWidth/4-EWinBorderSize*2;
-	TInt winHeight=size.iHeight/2-EWinBorderSize*2;
-//
-	iMainGroup=new(ELeave) CTWindowGroup(Client());
-	iMainGroup->ConstructL();
-	iMainGroup->GroupWin()->SetOrdinalPosition(0,1);
-	iMainWin=new(ELeave) CPcWindowMain(this);
-	iMainWin->SetUpL(TPoint(EWinBorderSize,EWinBorderSize) ,TSize(winWidth2,winHeight) ,iMainGroup);
-	iMainGroup->SetCurrentWindow(iMainWin);
-	iChildWin=new(ELeave) CPcWindowChild(this);
-	iChildWin->SetUpL(TPoint(0,winHeight/2) ,TSize(winWidth2,winHeight/2) ,iMainWin);
-//
-	iAltGroup=new(ELeave) CTWindowGroup(Client());
-	iAltGroup->ConstructL();
-	iAltGroup->GroupWin()->SetOrdinalPosition(0,1);
-	iAltGroup->GroupWin()->EnableReceiptOfFocus(EFalse);
-	iAltGroupWin=new(ELeave) CPcWindowAltGroup(this);
-	iAltGroupWin->SetUpL(TPoint(size.iWidth/2+EWinBorderSize,EWinBorderSize) ,TSize(winWidth4,winHeight) ,iAltGroup);
-//
-	iAltConnection=new(ELeave) CPcConnection(this);
-	iAltConnection->ConstructL();
-	iAltConnectionWin=new(ELeave) CPcWindowAltConnection(this);
-	iAltConnectionWin->SetUpL(TPoint(size.iWidth/4*3+EWinBorderSize,EWinBorderSize) ,TSize(winWidth4,winHeight),iAltConnection->iGroup,*iAltConnection->iGc);
-	}
-
-void TPointerCaptureTest::NickFocusL()
-	{
-	iNickFocusGroup=new(ELeave) CPcWindowNickFocusGroup(this,Client());
-	iNickFocusGroup->ConstructL();
-	iNickFocusGroup->GroupWin()->SetOrdinalPosition(0,2);
-	iNickFocusBlankWin=new(ELeave) CTBlankWindow();
-	iNickFocusBlankWin->ConstructL(*iNickFocusGroup);
-	iNickFocusBlankWin->SetSize(TSize(1,1));
-	iNickFocusBlankWin->Activate();
-	}
-
-void TPointerCaptureTest::SetCapture(TInt aCaptureFlags)
-	{
-	iMainWin->Win()->SetPointerCapture(aCaptureFlags);
-	}
-
-TestState TPointerCaptureTest::DoTestL()
-	{
-	iSubState=0;
-	iFailed=EFalse;
-	StateChanged();
-	switch(iState)
-		{
-		case ECaptureDisabled:
-			LogSubTest(_L("No capture"),1);
-			SetCapture(RWindowBase::TCaptureDisabled);
-			break;
-		case ENormalCapture:
-			LogSubTest(_L("Normal capture"),1);
-			SetCapture(RWindowBase::TCaptureEnabled);
-			break;
-		case ECaptureAllGroups:
-			LogSubTest(_L("All groups"),1);
-			SetCapture(RWindowBase::TCaptureEnabled|RWindowBase::TCaptureFlagAllGroups);
-			break;
-		case EDragDropCapture:
-			LogSubTest(_L("Drag & Drop"),1);
-			SetCapture(RWindowBase::TCaptureDragDrop&~RWindowBase::TCaptureFlagAllGroups);
-			break;
-		case EDragDropCaptureAllGroups:
-			LogSubTest(_L("Drag & Drop All groups"),1);
-			SetCapture(RWindowBase::TCaptureDragDrop);
-			break;
-		case ENormalCaptureWithoutFocus:
-			LogSubTest(_L("Without focus"),1);
-			NickFocusL();
-			SetCapture(RWindowBase::TCaptureEnabled);
-			break;
-		default:
-			return(EFinished);
-		}
-	return(EContinue);
- 	}
--- a/windowing/windowserver/tman/TMPNTCUR.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,677 +0,0 @@
-// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Tests for various pointer cursors on different windows
-// 
-//
-
-#include <e32std.h>
-#include <hal.h>
-#include "W32STD.H"
-#include "../tlib/testbase.h"
-#include "TMAN.H"
-
-class CPointerCursorWindow : public CTWin
-	{
-public:
-	~CPointerCursorWindow();
-	void SetChild(CPointerCursorWindow* aChild);
-	inline CPointerCursorWindow* Child() {return iChild;}
-	inline void SetBitmap(CFbsBitmap* aBitmap,TBool aTop=ETrue) {iBitmap=aBitmap;iTop=aTop;}
-	void SetPointerCursor(CTPointerCursor* aCursor);
-	//Virtual function from CTBaseWin
-	void SetUpL(TPoint aPos,TSize aSize,CTWinBase *aParent,CWindowGc &aGc);
-	void Draw();
-	void PointerL(const TPointerEvent &aPointer,const TTime &aTime);
-private:
-	CPointerCursorWindow* iChild;
-	CFbsBitmap* iBitmap;
-	TBool iTop;
-	};
-
-class CPointerCursorWindowGroup : public CTWindowGroup
-	{
-public:
-	CPointerCursorWindowGroup(CTClient *aClient);
-	void SetPointerCursor(CTPointerCursor* aCursor);
-	void ConstructL();
-	};
-
-class CStatusWindow : public CTTitledWindow
-	{
-public:
-	~CStatusWindow();
-	void Construct(CTestBase* aTest);
-	void DoDraw();
-	//virtual functions from CTWinBase overridden by CTBaseWin
-	void WinKeyL(const TKeyEvent &aKey,const TTime &aTime);
-	//virtual functions from CTBaseWin
-	void SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
-	void PointerL(const TPointerEvent &aPointer,const TTime &aTime);
-	//virtual function from CTBaseWin overridden by CTTitledWindow
-	void Draw();
-private:
-	void UpdateString1();
-	void UpdateString2();
-	void UpdateString3();
-	void ChangeXyInputType();
-	void ChangePointerCursorMode();
-private:
-	CTestBase* iTest;
-	TBuf<16> iString1;
-	TBuf<16> iString2;
-	TBuf<16> iString3;
-	TBuf<32> iString4;
-	TRect iRect1;
-	TRect iRect2;
-	TRect iRect3;
-	TRect iRect4;
-	TXYInputType iXyInputType;
-	TXYInputType iOriginalXyInputType;
-	TPointerCursorMode iMode;
-	TPointerCursorMode iOriginalMode;
-	TBool iSimulatedPenDown;
-	TBool iUpdateNeeded;
-	TBool iExit;
-	};
-
-class CPointerCursorTest : public CTestBase
-	{
-	enum {eWindowGap=3,eChildWindowGap=2};
-	enum {eNumPointerCursors=7};
-public:
-	CPointerCursorTest();
-	~CPointerCursorTest();
-	TestState DoTestL();
-	void ConstructL();
-private:
-	CPointerCursorWindow *CreateWindowL(TInt aNum,TRect aLocation,CTWinBase *aGroup);
-	void CreatePointerCursorsL();
-	void CreateWindowsL(TSize aArea);
-private:
-	TSize iWinSize;
-	TInt iState;
-	CStatusWindow *iInfoWindow;
-	CPointerCursorWindowGroup *iGroup1;
-	CPointerCursorWindowGroup *iGroup2;
-	CPointerCursorWindow *iWindows[6];
-	CTPointerCursor *iCursors[eNumPointerCursors];
-	CFbsBitmap *iBitmaps[eNumPointerCursors];
-	};
-
-
-/*CPointerCursorWindow*/
-
-CPointerCursorWindow::~CPointerCursorWindow()
-	{
-	delete iChild;
-	}
-
-void CPointerCursorWindow::SetChild(CPointerCursorWindow* aChild)
-	{
-	iChild=aChild;
-	iWin.SetShadowDisabled(ETrue);
-	}
-
-void CPointerCursorWindow::SetPointerCursor(CTPointerCursor* aCursor)
-	{
-	iWin.SetCustomPointerCursor(aCursor->PointerCursor());
-	}
-
-void CPointerCursorWindow::SetUpL(TPoint aPos,TSize aSize,CTWinBase *aParent,CWindowGc &aGc)
-	{
-	CTWin::SetUpL(aPos,aSize,aParent,aGc);
-	iWin.SetShadowDisabled(ETrue);
-	iWin.SetPointerGrab(EFalse);
-	}
-
-void CPointerCursorWindow::Draw()
-	{
-	iGc->Reset();
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	iGc->DrawRect(Size());
-	if (iBitmap)
-		{
-		TPoint point(3,3);
-		if (!iTop)
-			point.iY=Size().iHeight-iBitmap->SizeInPixels().iHeight-3;
-		iGc->BitBlt(point,iBitmap);
-		}
-	}
-
-void CPointerCursorWindow::PointerL(const TPointerEvent&,const TTime&)
-	{
-	}
-
-
-/*CPointerCursorWindowGroup*/
-
-CPointerCursorWindowGroup::CPointerCursorWindowGroup(CTClient *aClient)
-	:CTWindowGroup(aClient)
-	{}
-
-void CPointerCursorWindowGroup::ConstructL()
-	{
-	CTWindowGroup::ConstructL();
-	iGroupWin.EnableReceiptOfFocus(EFalse);
-	}
-
-void CPointerCursorWindowGroup::SetPointerCursor(CTPointerCursor* aCursor)
-	{
-	iGroupWin.SetCustomPointerCursor(aCursor->PointerCursor());
-	}
-
-
-/*CStatusWindow*/
-
-CStatusWindow::~CStatusWindow()
-	{
-	Client()->iWs.SetPointerCursorMode(iOriginalMode);
-#if defined(__WINS__)
-	Client()->iWs.SimulateXyInputType(iOriginalXyInputType);
-#endif
-	}
-
-void CStatusWindow::Construct(CTestBase* aTest)
-	{
-	_LIT(Title,"StatusWindow");
-	_LIT(String4,"Click here to finish");
-	iTest=aTest;
-	TWindowTitle title(Title);
-	SetTitle(title);
-	TInt yy=iTitleHeight+iFont->HeightInPixels()+7;
-	iRect1.SetRect(3,iTitleHeight+5,iSize.iWidth-1,yy);
-	TInt yy1=yy+iFont->HeightInPixels()+2;
-	iRect2.SetRect(3,yy+3,iSize.iWidth-1,yy1);
-	TInt yy2=yy1+iFont->HeightInPixels()+2;
-	iRect3.SetRect(3,yy1+3,iSize.iWidth-1,yy2);
-	iRect4.SetRect(3,yy2+3,iSize.iWidth-1,yy2+iFont->HeightInPixels()+2);
-	TMachineInfoV1Buf machineInfo;
-	UserHal::MachineInfo(machineInfo);
-	iXyInputType=machineInfo().iXYInputType;
-	iOriginalXyInputType=iXyInputType;
-	iSimulatedPenDown=EFalse;
-	//
-	iString3.Copy(KNullDesC);
-	if (iXyInputType==EXYInputDeltaMouse)
-		{
-		if (HAL::Get(HALData::EMouseState,iSimulatedPenDown)==KErrNone)
-			UpdateString3();
-		}
-	UpdateString1();
-	iMode=Client()->iWs.PointerCursorMode();
-	iOriginalMode=iMode;
-	UpdateString2();
-	iUpdateNeeded=EFalse;
-	iString4.Copy(String4);
-	iExit=EFalse;
-	}
-
-void CStatusWindow::SetUpL(TPoint aPos,TSize aSize,CTWinBase *aParent,CWindowGc &aGc)
-	{
-	CTTitledWindow::SetUpL(aPos,aSize,aParent,aGc);
-	}
-
-void CStatusWindow::WinKeyL(const TKeyEvent &aKey,const TTime&)
-	{
-	switch(aKey.iCode)
-		{
-		case EKeyEscape:
-			iTest->Request();
-			break;
-		case 'M':
-		case 'm':
-			if (iXyInputType==EXYInputDeltaMouse)
-				{
-				if (HAL::Set(HALData::EMouseState,!iSimulatedPenDown)==KErrNone)
-					{
-					iSimulatedPenDown=!iSimulatedPenDown;
-					UpdateString3();
-					DoDraw();
-					}
-				}
-			break;
-	#if defined(__WINS__)
-		case 'I':
-		case 'i':
-		case '1':
-			ChangeXyInputType();
-			Client()->iWs.SimulateXyInputType(iXyInputType);
-			break;
-	#endif
-		case 'C':
-		case 'c':
-		case '2':
-			ChangePointerCursorMode();
-			Client()->iWs.SetPointerCursorMode(iMode);
-			break;
-		default:;
-		}
-	}
-
-void CStatusWindow::PointerL(const TPointerEvent &aPointer,const TTime &aTime)
-	{
-#if defined(__WINS__)
-	if (iRect1.Contains(aPointer.iPosition))
-		{
-		if (aPointer.iType==TPointerEvent::EButton1Down)
-			ChangeXyInputType();
-		}
-	else
-#endif
-        if (iRect2.Contains(aPointer.iPosition))
-		{
-		if (aPointer.iType==TPointerEvent::EButton1Down)
-			ChangePointerCursorMode();
-		}
-	else if (iRect4.Contains(aPointer.iPosition))
-		iExit=ETrue;
-	else
-		CTTitledWindow::PointerL(aPointer,aTime);
-	if ((iUpdateNeeded || iExit) && aPointer.iType==TPointerEvent::EButton1Up)
-		{
-		if (iExit)
-			iTest->Request();
-		else
-			{
-			Client()->iWs.SetPointerCursorMode(iMode);
-		#if defined(__WINS__)
-			Client()->iWs.SimulateXyInputType(iXyInputType);
-		#endif
-			Client()->iWs.Flush();
-			iUpdateNeeded=EFalse;
-			}
-		}
-	}
-
-void CStatusWindow::Draw()
-	{
-	CTTitledWindow::Draw();
-	TInt ascent=iFont->AscentInPixels()+1;
-	iGc->DrawText(iString1,iRect1,ascent,CGraphicsContext::ELeft);
-	iGc->DrawText(iString2,iRect2,ascent,CGraphicsContext::ELeft);
-	iGc->DrawText(iString3,iRect3,ascent,CGraphicsContext::ELeft);
-	iGc->DrawText(iString4,iRect4,ascent,CGraphicsContext::ELeft);
-	}
-
-void CStatusWindow::DoDraw()
-	{
-	iGc->Activate(iWin);
-	iGc->UseFont((CFont *)iFont);
-	Draw();
-	iGc->Deactivate();
-	}
-
-void CStatusWindow::UpdateString1()
-	{
-	_LIT(Text0,"No Pointer");
-	_LIT(Text1,"Pen");
-	_LIT(Text2,"Mouse");
-	_LIT(Text3,"Relative Mouse");
-	switch (iXyInputType)
-		{
-	case EXYInputNone:
-		iString1.Copy(Text0);
-		break;
-	case EXYInputPointer:
-		iString1.Copy(Text1);
-		break;
-	case EXYInputMouse:
-		iString1.Copy(Text2);
-		break;
-	case EXYInputDeltaMouse:
-		iString1.Copy(Text3);
-		break;
-		}
-	}
-
-void CStatusWindow::UpdateString2()
-	{
-	_LIT(Text0,"None");
-	_LIT(Text1,"Fixed");
-	_LIT(Text2,"Normal");
-	_LIT(Text3,"Window");
-	switch (iMode)
-		{
-	case EPointerCursorNone:
-		iString2.Copy(Text0);
-		break;
-	case EPointerCursorFixed:
-		iString2.Copy(Text1);
-		break;
-	case EPointerCursorNormal:
-		iString2.Copy(Text2);
-		break;
-	case EPointerCursorWindow:
-		iString2.Copy(Text3);
-		break;
-		}
-	}
-
-void CStatusWindow::UpdateString3()
-	{
-	if (iSimulatedPenDown)
-		{
-		_LIT(TextD,"Sim Pen Down");
-		iString3.Copy(TextD);
-		}
-	else
-		{
-		_LIT(TextU,"Sim Pen Up");
-		iString3.Copy(TextU);
-		}
-	}
-
-void CStatusWindow::ChangeXyInputType()
-	{
-	if (iXyInputType==EXYInputMouse)
-		iXyInputType=EXYInputPointer;
-	else if (iXyInputType==EXYInputPointer)
-		iXyInputType=EXYInputMouse;
-	UpdateString1();
-	DoDraw();
-	iUpdateNeeded=ETrue;
-	}
-
-void CStatusWindow::ChangePointerCursorMode()
-	{
-	TInt mode=(iMode+1)%(EPointerCursorLastMode+1);
-	iMode=STATIC_CAST(TPointerCursorMode,mode);
-	UpdateString2();
-	DoDraw();
-	iUpdateNeeded=ETrue;
-	}
-
-
-/*Sprite Drawing Functions*/
-
-#if defined(__WINS__)
-	#define DRAW_COLOR 1
-#else
-	#define DRAW_COLOR 0
-#endif
-
-void DrawCross(CBitmapContext *aGc,TInt , const TSize &aSize, TBool aDoMask, TAny *aLineWidth)
-	{
-	TInt halfLineWidth=(*STATIC_CAST(TInt*,aLineWidth)+1)/2;
-	TInt lineWidth=2*halfLineWidth+1;		//Must be odd
-	aGc->SetBrushColor(TRgb::Gray4(aDoMask ? 0 : 3));
-	aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	aGc->SetPenStyle(CGraphicsContext::ENullPen);
-	aGc->DrawRect(TRect(aSize));
-	aGc->SetPenStyle(CGraphicsContext::ESolidPen);
-	aGc->SetPenColor(TRgb::Gray4(aDoMask ? 3 : 0));
-	aGc->SetPenSize(TSize(lineWidth,lineWidth));
-	aGc->DrawLine(TPoint(halfLineWidth,halfLineWidth),TPoint(aSize.iWidth-lineWidth,aSize.iHeight-lineWidth));
-	aGc->DrawLine(TPoint(halfLineWidth,aSize.iHeight-lineWidth),TPoint(aSize.iWidth-lineWidth,halfLineWidth));
-	}
-
-void DrawArrow(CBitmapContext *aGc,TInt , const TSize &aSize, TBool aDoMask, TAny *aLineWidth)
-	{
-	TInt lineWidth=*STATIC_CAST(TInt*,aLineWidth);
-	TInt halfLineWidth=(lineWidth-1)/2;
-	aGc->SetBrushColor(TRgb::Gray4(aDoMask ? 0 : 3));
-	aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	aGc->SetPenStyle(CGraphicsContext::ENullPen);
-	aGc->DrawRect(TRect(aSize));
-	aGc->SetPenStyle(CGraphicsContext::ESolidPen);
-	aGc->SetPenColor(TRgb::Gray4(aDoMask ? 3 : 0));
-	aGc->SetPenSize(TSize(1,1));
-	aGc->DrawLine(TPoint(0,0),TPoint(lineWidth,0));
-	aGc->DrawLine(TPoint(0,0),TPoint(0,lineWidth));
-	aGc->SetPenSize(TSize(lineWidth,lineWidth));
-	aGc->DrawLine(TPoint(halfLineWidth,halfLineWidth),TPoint(aSize.iWidth-halfLineWidth-1,aSize.iHeight-halfLineWidth-1));
-	aGc->DrawLine(TPoint(halfLineWidth,halfLineWidth),TPoint(aSize.iWidth/2,halfLineWidth));
-	aGc->DrawLine(TPoint(halfLineWidth,halfLineWidth),TPoint(halfLineWidth,aSize.iHeight/2));
-	}
-
-void DrawSquare(CBitmapContext *aGc,TInt , const TSize &aSize, TBool aDoMask, TAny *)
-	{
-	aGc->SetBrushColor(TRgb::Gray4(aDoMask ? 0 : 3));
-	aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	aGc->SetPenStyle(CGraphicsContext::ENullPen);
-	aGc->DrawRect(TRect(aSize));
-	aGc->SetBrushColor(TRgb::Gray4(aDoMask ? 3 : DRAW_COLOR));
-	aGc->DrawRect(TRect(1,1,aSize.iWidth-1,aSize.iHeight-1));
-	}
-
-void DrawCircle(CBitmapContext *aGc,TInt , const TSize &aSize, TBool aDoMask, TAny *)
-	{
-	aGc->SetBrushColor(TRgb::Gray4(aDoMask ? 0 : 3));
-	aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	aGc->SetPenStyle(CGraphicsContext::ENullPen);
-	aGc->DrawRect(TRect(aSize));
-	aGc->SetBrushColor(TRgb::Gray4(aDoMask ? 3 : 1));
-	aGc->DrawEllipse(TRect(1,1,aSize.iWidth-1,aSize.iHeight-1));
-	}
-
-void DrawTriangle(CBitmapContext *aGc,TInt , const TSize &aSize, TBool aDoMask, TAny *)
-	{
-	aGc->SetBrushColor(TRgb::Gray4(aDoMask ? 0 : 3));
-	aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	aGc->SetPenStyle(CGraphicsContext::ENullPen);
-	aGc->DrawRect(TRect(aSize));
-	aGc->SetPenStyle(CGraphicsContext::ESolidPen);
-	aGc->SetPenColor(TRgb::Gray4(aDoMask ? 3 : DRAW_COLOR));
-	aGc->SetPenSize(TSize(1,1));
-	for(TInt y=0;y<aSize.iHeight;y++)
-		{
-		TInt xfact=aSize.iWidth*y/aSize.iHeight;
-		aGc->DrawLine(TPoint(aSize.iWidth-xfact-1,y),TPoint(aSize.iWidth-1,y));
-		}
-	}
-
-void DrawOpenSquare(CBitmapContext *aGc,TInt , const TSize &aSize, TBool aDoMask, TAny *aLineWidth)
-	{
-	TInt halfLineWidth=*STATIC_CAST(TInt*,aLineWidth)/2;
-	TInt lineWidth=2*halfLineWidth+1;		//Must be odd
-	aGc->SetBrushColor(TRgb::Gray4(aDoMask ? 0 : 3));
-	aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	aGc->SetPenStyle(CGraphicsContext::ENullPen);
-	aGc->DrawRect(TRect(aSize));
-	aGc->SetBrushStyle(CGraphicsContext::ENullBrush);
-	aGc->SetPenStyle(CGraphicsContext::ESolidPen);
-	aGc->SetPenColor(TRgb::Gray4(aDoMask ? 3 : DRAW_COLOR));
-	aGc->SetPenSize(TSize(lineWidth,lineWidth));
-	TPoint botRig(aSize.iWidth-aSize.iWidth/4-1,aSize.iHeight-aSize.iHeight/4-1);
-	aGc->DrawRect(TRect(aSize.iWidth/4,aSize.iHeight/4,botRig.iX+1,botRig.iY+1));
-	aGc->DrawLine(TPoint(halfLineWidth,halfLineWidth),TPoint(aSize.iWidth/4-halfLineWidth,aSize.iHeight/4-halfLineWidth));
-	aGc->DrawLine(TPoint(aSize.iWidth-1-halfLineWidth,halfLineWidth),TPoint(botRig.iX+halfLineWidth,aSize.iHeight/4-halfLineWidth));
-	aGc->DrawLine(TPoint(aSize.iWidth-1-halfLineWidth,aSize.iHeight-1-halfLineWidth),TPoint(botRig.iX+halfLineWidth,botRig.iY+halfLineWidth));
-	aGc->DrawLine(TPoint(halfLineWidth,aSize.iHeight-1-halfLineWidth),TPoint(aSize.iWidth/4-halfLineWidth,botRig.iY+halfLineWidth));
-	}
-
-void DrawOpenCircle(CBitmapContext *aGc,TInt , const TSize &aSize, TBool aDoMask, TAny *aLineWidth)
-	{
-	TInt halfLineWidth=*STATIC_CAST(TInt*,aLineWidth)/2;
-	TInt lineWidth=2*halfLineWidth+1;		//Must be odd
-	aGc->SetBrushColor(TRgb::Gray4(aDoMask ? 0 : 3));
-	aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	aGc->SetPenStyle(CGraphicsContext::ENullPen);
-	aGc->DrawRect(TRect(aSize));
-	aGc->SetBrushStyle(CGraphicsContext::ENullBrush);
-	aGc->SetPenStyle(CGraphicsContext::ESolidPen);
-	aGc->SetPenColor(TRgb::Gray4(aDoMask ? 3 : DRAW_COLOR));
-	aGc->SetPenSize(TSize(lineWidth,lineWidth));
-	TPoint botRig(aSize.iWidth-aSize.iWidth/4-1,aSize.iHeight-aSize.iHeight/4-1);
-	aGc->DrawEllipse(TRect(aSize.iWidth/4+1,aSize.iHeight/4+1,botRig.iX+1,botRig.iY+1));
-	aGc->DrawLine(TPoint(aSize.iWidth/2,1+halfLineWidth),TPoint(aSize.iWidth/2,aSize.iHeight/4+1-halfLineWidth));
-	aGc->DrawLine(TPoint(aSize.iWidth/2,aSize.iHeight-1-halfLineWidth),TPoint(aSize.iWidth/2,botRig.iY+halfLineWidth));
-	aGc->DrawLine(TPoint(1+halfLineWidth,aSize.iWidth/2),TPoint(aSize.iWidth/4+1-halfLineWidth,aSize.iHeight/2));
-	aGc->DrawLine(TPoint(aSize.iWidth-1-halfLineWidth,aSize.iHeight/2),TPoint(botRig.iX+halfLineWidth,aSize.iWidth/2));
-	}
-
-
-/*CPointerCursorTest*/
-
-GLDEF_C CTestBase *CreatePointerCursorTest()
-	{
-	return(new(ELeave) CPointerCursorTest());
-	}
-
-CPointerCursorTest::CPointerCursorTest() : CTestBase(_L("PointerCursor"))
-	{}
-
-CPointerCursorTest::~CPointerCursorTest()
-	{
-	TInt ii;
-	Client()->iGroup->SetCurrentWindow(NULL);
-	delete iInfoWindow;
-	for(ii=0;ii<6;++ii)
-		{
-		delete iWindows[ii];
-		}
-	for(ii=0;ii<eNumPointerCursors;++ii)
-		{
-		delete iCursors[ii];
-		delete iBitmaps[ii];
-		}
-	delete iGroup1;
-	delete iGroup2;
-	}
-
-void CPointerCursorTest::ConstructL()
-	{
-	TSize size=Client()->iScreen->SizeInPixels();
-	TInt infoWidth=Min(210,5*size.iWidth/12);
-	size.iWidth=Max(Min(415,size.iWidth-infoWidth),85);
-	iInfoWindow=new(ELeave) CStatusWindow();
-	iInfoWindow->SetUpL(TPoint(size.iWidth,50),TSize(infoWidth,180),Client()->iGroup,*Client()->iGc);
-	Client()->iGroup->SetCurrentWindow(iInfoWindow);
-	iInfoWindow->Construct(this);
-	iGroup1=new(ELeave) CPointerCursorWindowGroup(Client());
-	iGroup1->ConstructL();
-	iGroup2=new(ELeave) CPointerCursorWindowGroup(Client());
-	iGroup2->ConstructL();
-	size.iWidth-=5;
-	CreateWindowsL(size);
-	CreatePointerCursorsL();
-	iGroup1->SetPointerCursor(iCursors[0]);
-	iWindows[1]->SetBitmap(iBitmaps[0],EFalse);
-	iWindows[0]->SetPointerCursor(iCursors[1]);
-	iWindows[0]->SetBitmap(iBitmaps[1]);
-	iWindows[0]->Child()->SetPointerCursor(iCursors[2]);
-	iWindows[0]->Child()->SetBitmap(iBitmaps[2]);
-	iWindows[2]->SetPointerCursor(iCursors[3]);
-	iWindows[2]->SetBitmap(iBitmaps[3]);
-	iWindows[2]->Child()->Child()->SetPointerCursor(iCursors[4]);
-	iWindows[2]->Child()->Child()->SetBitmap(iBitmaps[4]);
-	iWindows[3]->Child()->SetPointerCursor(iCursors[5]);
-	iWindows[3]->Child()->SetBitmap(iBitmaps[5]);
-	iWindows[4]->SetPointerCursor(iCursors[6]);
-	iWindows[4]->SetBitmap(iBitmaps[6]);
-	}
-
-void CPointerCursorTest::CreateWindowsL(TSize aArea)
-	{
-	//TSize screenSize=Client()->iScreen->SizeInPixels();
-	TInt height=eWindowGap+(aArea.iHeight-5*eWindowGap)/4;
-	TInt halfWidth=aArea.iWidth/2;
-	TRect rect(5,eWindowGap,halfWidth,height);
-	iWindows[0]=CreateWindowL(2,rect,iGroup1);
-	rect.Move(halfWidth,0);
-	iWindows[1]=CreateWindowL(2,rect,iGroup1);
-	rect.Move(-halfWidth,height);
-	rect.iBr.iX=aArea.iWidth;
-	iWindows[2]=CreateWindowL(4,rect,iGroup2);
-	rect.Move(0,height);
-	rect.iBr.iX=aArea.iWidth-11;
-	iWindows[3]=CreateWindowL(3,rect,iGroup2);
-	rect.Move(0,height);
-	rect.iBr.iX=halfWidth;
-	iWindows[4]=CreateWindowL(2,rect,iGroup2);
-	rect.Move(halfWidth,0);
-	iWindows[5]=CreateWindowL(2,rect,iGroup2);
-	}
-
-CPointerCursorWindow* CPointerCursorTest::CreateWindowL(TInt aNum,TRect aLocation,CTWinBase *aGroup)
-	{
-	CPointerCursorWindow* firstWin=NULL;
-	CPointerCursorWindow* parent=NULL;
-	CPointerCursorWindow* win;
-	TInt xInc=aLocation.Width()/aNum-eChildWindowGap;
-	TInt ii;
-	for (ii=aNum;ii>0;ii--)
-		{
-		win=new(ELeave) CPointerCursorWindow();
-		CleanupStack::PushL(win);
-		win->SetUpL(aLocation.iTl,aLocation.Size(),aGroup,*Client()->iGc);
-		if (!parent)
-			firstWin=win;
-		else
-			{
-			parent->SetChild(win);
-			CleanupStack::Pop();
-			}
-		aLocation.iBr=TPoint(-eChildWindowGap,-eChildWindowGap)+aLocation.Size();
-		aLocation.iTl.iX=xInc;
-		aLocation.iTl.iY=eChildWindowGap;
-		aGroup=win;
-		parent=win;
-		}
-	CleanupStack::Pop();
-	return firstWin;
-	}
-
-void CPointerCursorTest::CreatePointerCursorsL()
-	{
-	const TSize size(32,32);
-	TSpriteCreateParams params(size,TPoint(-16,-16),DrawSquare);
-	TSpriteCreateParams paramarray[eNumPointerCursors];
-	TInt lineWidth1=3;
-	TInt lineWidth2=5;
-	paramarray[2]=params;
-	params.iDrawFunc=DrawCircle;
-	paramarray[3]=params;
-	params.iDrawFunc=DrawOpenSquare;
-	params.iDrawFuncParam=&lineWidth1;
-	paramarray[5]=params;
-	params.iDrawFunc=DrawOpenCircle;
-	paramarray[6]=params;
-	params.iOffset=TPoint(0,0);
-	params.iDrawFunc=DrawArrow;
-	params.iDrawFuncParam=&lineWidth2;
-	paramarray[1]=params;
-	params.iOffset.iX=-31;
-	params.iDrawFunc=DrawTriangle;
-	paramarray[4]=params;
-	params.iOffset=TPoint(-15,-15);
-	params.iDrawFunc=DrawCross;
-	paramarray[0]=params;
-	CFbsBitmap *bitmap;
-	TInt ii,jj;
-	TDisplayMode mode=Client()->iWs.GetDefModeMaxNumColors(ii,jj);
-	for (ii=0;ii<eNumPointerCursors;++ii)
-		{
-		bitmap=NULL;
-		iBitmaps[ii]=new(ELeave) CFbsBitmap();
-		User::LeaveIfError(iBitmaps[ii]->Create(size,mode));
-		iCursors[ii]=new(ELeave) CTPointerCursor(Client()->iWs);
-		iCursors[ii]->ConstructL(1,&paramarray[ii],0,iBitmaps[ii],bitmap);
-		delete bitmap;
-		}
-	}
-
-TestState CPointerCursorTest::DoTestL()
-	{
-	switch(iState)
-		{
-		case 0:
-			LogSubTest(_L("Pointer Cursor"),1);
-			TestL(ETrue);
-			iState++;
-			return(EContinue);
-		default:
-			return(EFinished);
-		}
-	}
--- a/windowing/windowserver/tman/TMPNTKEY.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,305 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test Pointer move/drag buffer
-// 
-//
-
-#include <e32std.h>
-#include <hal.h>
-#include "W32STD.H"
-#include "../tlib/testbase.h"
-#include "TMAN.H"
-
-const TInt ENumPntKeyTests=6;
-const TUint EModifierMask=EModifierCtrl|EModifierShift|EModifierFunc;
-
-class CTPntKeyTest;
-
-class CTPntKeyWindow : public CTWin
-	{
-private:
-	enum {KPointerMoveBufferSize=32};
-public:
-	CTPntKeyWindow(CTPntKeyTest *aTest);
-	~CTPntKeyWindow();
-	void SetUpLD(TPoint pos,TSize size,CTWinBase *parent);
-	void PointerL(const TPointerEvent &pointer,const TTime &aTime);
-	void KeyUpL(const TKeyEvent &aKey,const TTime &);
-	void KeyDownL(const TKeyEvent &aKey,const TTime &);
-	void WinKeyL(const TKeyEvent &aKey,const TTime &);
-	void SwitchOn(const TTime &aTime);
-	void SetState(TInt iState);
-	void NextKey();
-	void Test(TInt aCheck);
-	void Error();
-	void DrawButton(const TRect &aRect, const TDesC &aText);
-	void Draw();
-private:
-	CTPntKeyTest *iTest;
-	TInt iKeyCount;
-	TRect iKey1;
-	TRect iKey2;
-	TRect iKey3;
-	static TInt iTestScanCodes[ENumPntKeyTests];
-	static TUint iTestCodes[ENumPntKeyTests];
-	static TUint iTestModifiers[ENumPntKeyTests];
-	};
-
-class CTPntKeyTest : public CTestBase
-	{
-public:
-	CTPntKeyTest();
-	~CTPntKeyTest();
-	TestState DoTestL();
-	void FinishedTests();
-	void ConstructL();
-	void Failed();
-	inline TBool NoDigitiser() const {return iNoDigitiser;}
-private:
-	CTPntKeyWindow *iWin;
-	TSize iWinSize;
-	TInt iState;
-	TBool iFailed;
-	TBool iOldPointerState;
-	TBool iNoDigitiser;
-	};
-
-TInt CTPntKeyWindow::iTestScanCodes[ENumPntKeyTests]={'A','B',0,'C',EStdKeyEnter,'Y'};
-TUint CTPntKeyWindow::iTestCodes[ENumPntKeyTests]={'a','B',0,'c',EKeyEnter,'y'};
-TUint CTPntKeyWindow::iTestModifiers[ENumPntKeyTests]={0,EModifierShift,0,0,0,0};
-
-GLDEF_C CTestBase *CreatePointerKeyTest()
-	{
-	return(new(ELeave) CTPntKeyTest());
-	}
-
-CTPntKeyWindow::CTPntKeyWindow(CTPntKeyTest *aTest) : iTest(aTest)
-	{}
-
-CTPntKeyWindow::~CTPntKeyWindow()
-	{
-	}
-
-void CTPntKeyWindow::SetUpLD(TPoint pos,TSize size,CTWinBase *parent)
-	{
-	ConstructExtLD(*parent,pos,size);
-	iWin.SetPointerGrab(ETrue);
-	iKey1=TRect(size.iWidth*1/16,size.iHeight/2,size.iWidth*5/16,size.iHeight);
-	iKey2=TRect(size.iWidth*6/16,size.iHeight/2,size.iWidth*10/16,size.iHeight);
-	iKey3=TRect(size.iWidth*11/16,size.iHeight/2,size.iWidth*15/16,size.iHeight);
-	iWin.AddKeyRect(iKey1,'A',EFalse);
-	iWin.AddKeyRect(iKey2,'B',EFalse);
-	AssignGC(*Client()->iGc);
-	BaseWin()->EnableOnEvents();
-	Activate();
-	}
-
-void CTPntKeyWindow::Error()
-	{
-	iTest->Failed();
-	}
-
-void CTPntKeyWindow::SetState(TInt iState)
-	{
-	iKeyCount=iState-1;
-	NextKey();
-	iTest->Client()->Flush();
-	}
-
-void CTPntKeyWindow::NextKey()
-	{
-	if (++iKeyCount==ENumPntKeyTests || iKeyCount>4)
-		iTest->FinishedTests();
-	else
-		{
-		if (iKeyCount==2)
-			iWin.RemoveAllKeyRects();
-		else if (iKeyCount==3)
-			iWin.AddKeyRect(iKey3,'C',EFalse);
-		else if (iKeyCount==4)
-			{
-	#if !defined(__WINS__)
-			if (iTest->NoDigitiser())
-				iTest->FinishedTests();
-	#endif
-			iWin.RemoveAllKeyRects();
-			iWin.AddKeyRect(TRect(Client()->iScreen->SizeInPixels()),'Z',EFalse);
-			}
-		else if (iKeyCount==5)
-			{
-			iWin.RemoveAllKeyRects();
-			Client()->iWs.Flush();
-			User::After(500000);	// Wait half a second
-			iWin.AddKeyRect(TRect(Client()->iScreen->SizeInPixels()),'Y',ETrue);
-			}
-		Invalidate();
-		}
-	}
-
-void CTPntKeyWindow::Test(TInt aCheck)
-	{
-	if (!aCheck)
-		Error();
-	}
-
-void CTPntKeyWindow::KeyUpL(const TKeyEvent &aKey,const TTime&)
-	{
-	if (aKey.iScanCode==iTestScanCodes[iKeyCount])
-		NextKey();
-	}
-
-void CTPntKeyWindow::KeyDownL(const TKeyEvent &aKey,const TTime &)
-	{
-	if (aKey.iScanCode!=EStdKeyLeftFunc && aKey.iScanCode!=EStdKeyRightFunc && 
-		 aKey.iScanCode!=EStdKeyLeftAlt && aKey.iScanCode!=EStdKeyRightAlt &&
-		 aKey.iScanCode!=EStdKeyLeftCtrl && aKey.iScanCode!=EStdKeyRightCtrl &&
-		 aKey.iScanCode!=EStdKeyLeftShift && aKey.iScanCode!=EStdKeyRightShift && 
-		 aKey.iScanCode!=EStdKeyOff &&
-		 aKey.iScanCode!=EStdKeyEscape)
-		Test(aKey.iScanCode==iTestScanCodes[iKeyCount]);
-	}
-
-void CTPntKeyWindow::WinKeyL(const TKeyEvent &aKey,const TTime &)
-	{
-	if (aKey.iCode==EKeyEscape)
-		iTest->FinishedTests();
-	else
-		{
-		Test(aKey.iScanCode==iTestScanCodes[iKeyCount]);
-		Test(aKey.iCode==iTestCodes[iKeyCount]);
-		Test((aKey.iModifiers&EModifierMask)==(iTestModifiers[iKeyCount]&EModifierMask));
-		}
-	}
-
-void CTPntKeyWindow::SwitchOn(const TTime &)
-	{
-	if (iKeyCount==4)
-		NextKey();
-	else if (iKeyCount!=5)
-		Error();
-	}
-
-void CTPntKeyWindow::PointerL(const TPointerEvent &aPointer,const TTime &)
-	{
-	if (aPointer.iType==TPointerEvent::EButton1Down)
-		{
-		if (iKeyCount!=2)
-			Error();
-		else
-			NextKey();
-		}
-	}
-
-void CTPntKeyWindow::DrawButton(const TRect &aRect, const TDesC &aText)
-	{
-	iGc->DrawRect(aRect);
-	iGc->DrawText(aText, TPoint((aRect.iBr.iX+aRect.iTl.iX)/2,(aRect.iBr.iY+aRect.iTl.iY)/2));
-	}
-
-void CTPntKeyWindow::Draw()
-	{
-	iGc->SetBrushColor(TRgb::Gray4(0));
-	iGc->SetPenColor(TRgb::Gray4(3));
-	iGc->Clear();
-	DrawButton(iKey1,_L("A"));
-	DrawButton(iKey2,_L("B"));
-	DrawButton(iKey3,_L("C"));
-	switch(iKeyCount)
-		{
-		case 0:
-			iGc->DrawText(_L("Click on 'A'"), TPoint(10,20));
-			break;
-		case 1:
-			iGc->DrawText(_L("Shift-Click on 'B'"), TPoint(10,20));
-			break;
-		case 2:
-			iGc->DrawText(_L("Click anywhere in this window"), TPoint(10,20));
-			break;
-		case 3:
-			iGc->DrawText(_L("Click on 'C'"), TPoint(10,20));
-			break;
-		case 4:
-#if defined(__WINS__)	// Can't emulate touching dig when switched off under WINS
-			iGc->DrawText(_L("Switch off and on (or press Enter)"), TPoint(10,20));
-#else
-			iGc->DrawText(_L("1st Switch off, then touch the screen to switch on"), TPoint(10,20));
-#endif
-			break;
-		case 5:
-#if defined(__WINS__)	// Can't emulate touching dig when switched off under WINS
-			iGc->DrawText(_L("Touch anywhere in the window"), TPoint(10,20));
-#else
-			iGc->DrawText(_L("2nd Switch off and touch the screen to switch on"), TPoint(10,20));
-#endif
-			break;
-		}
-	}
-
-CTPntKeyTest::CTPntKeyTest() : CTestBase(_L("Pointer Key Test"))
-	{}
-
-CTPntKeyTest::~CTPntKeyTest()
-	{
-	HAL::Set(HALData::EPenDisplayOn,iOldPointerState);
-	CTWin::Delete(iWin);
-	Client()->ResetFocus();
-	}
-
-void CTPntKeyTest::Failed()
-	{
-	if (!iFailed)
-		{
-		iFailed=ETrue;
-		FinishedTests();
-		}
-	}
-
-void CTPntKeyTest::FinishedTests()
-	{
-	Request();
-	}
-
-void CTPntKeyTest::ConstructL()
-	{
-	CTPntKeyWindow *win=new(ELeave) CTPntKeyWindow(this);
-	win->SetUpLD(TPoint(20,20),Client()->iScreen->SizeInPixels()-TSize(40,40),Client()->iGroup);
-	iWin=win;
-	Client()->iGroup->SetCurrentWindow(iWin);
-	iNoDigitiser=EFalse;
-	TInt err=HAL::Get(HALData::EPenDisplayOn,iOldPointerState);
-	if (err==KErrNotSupported)
-		iNoDigitiser=ETrue;
-	else if (err==KErrNone)
-		err=HAL::Set(HALData::EPenDisplayOn,ETrue);
-	if (err==KErrNotSupported)
-		iNoDigitiser=(!iOldPointerState);
-	else
-		TestL(err==KErrNone);
-	}
-
-TestState CTPntKeyTest::DoTestL()
-	{
-	TestL(!iFailed);
-	switch(iState)
-		{
-		case 0:
-			LogSubTest(_L("Key set 1"),1);
-			iWin->SetState(4);
-			iState++;
-			return(EContinue);
-		default:
-			return(EFinished);
-		}
-//	return(ENext);
-	}
--- a/windowing/windowserver/tman/TMPOINTR.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,808 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test pointer event handling
-// 
-//
-
-#include <e32std.h>
-#include <hal.h>
-#include "W32STD.H"
-#include "../tlib/testbase.h"
-#include "TMAN.H"
-
-class CTPointerTest;
-class CGrabWindow;
-
-class CPointerWindow : public CTWin
-	{
-	enum {KRepeatMargin=200000};	// 0.2 Seconds
-	enum {KRepeatCount=4};
-	enum {KRepeatIntervalIncrements=100000};
-	enum {KRepeatRectXExtra=50};
-	enum {KRepeatRectYExtra=50};
-	enum {KStateWaitingForTest1,KStateFailed,KStateTesting1,
-			KStateWaitingForTest2,KStateTesting2,
-			KStateWaitingForTest3,KStateTesting3,
-			KStateWaitingForTest4,KStateTesting4,
-			KStateWaitingForTest5,KStateTesting5,
-			KStateWaitingForTest6,KStateTesting6,
-			KStateWaitingForTest8,KStateTesting8,
-			KStateWaitingForTest7,KStateTesting7,
-			KStateFinished};
-public:
-	CPointerWindow(CTPointerTest *aTest);
-	void SetUpLD(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
-	void Draw();
-	void StartNextRepeatTest();
-	void QueueNextRepeat();
-	void PointerL(const TPointerEvent &aPointer,const TTime&);
-	void WinKeyL(const TKeyEvent &aKey,const TTime &aTime);
-private:
-	void SwitchOn(const TTime &);
-	void ResetTest(TInt aState);
-	void SetState(TInt aState);
-	void FinishedTests();
-	void TestFailed();
-private:
-	CTPointerTest *iTest;
-	TInt iRepeatCount;
-	TInt iState;
-	TTimeIntervalMicroSeconds32 iInterval;
-	TTime iPrevTime;
-	TRect iRepeatRect;
-	};
-
-class CGrabWindow2 : public CTWin
-	{
-public:
-	CGrabWindow2(CGrabWindow *aWindow);
-	void SetUpLD(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
-private:
-	void Draw();
-	void PointerL(const TPointerEvent &aPointer,const TTime&);
-private:
-	CGrabWindow *iGrabWindow;
-	};
-
-class CGrabWindow : public CTWin
-	{
-	enum {KGrabStateWaitingForDown,KGrabStateWaitingForDragOut,KGrabStateWaitingForUp,KGrabStateFinished,
-		KGrabStateWaitingForDown2,KGrabStateWaitingForUp2a,KGrabStateWaitingForDrag2,KGrabStateWaitingForUp2b,
-		KGrabStateWaitingForDown3,KGrabStateWaitingForUp3a,KGrabStateWaitingForUp3b,
-		KGrabStateWaitingForDown4,KGrabStateWaitingForUp4,
-		KGrabStateWaitingForDown5,KGrabStateWaitingForUp5,KGrabStateWaitingForDrag5,
-		KStateFailed};
-public:
-	CGrabWindow(CTPointerTest *aTest);
-	void Pointer2(const TPointerEvent &aPointer);
-	void SetUpLD(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
-	void WinKeyL(const TKeyEvent &aKey,const TTime &aTime);
-private:
-	void Draw();
-	void SetState(TInt aState);
-	void ResetTest();
-	void PointerL(const TPointerEvent &aPointer,const TTime&);
-	void TestFailed();
-	void FinishedTests();
-private:
-	TInt iState;
-	CTPointerTest *iTest;
-	};
-
-class CTPointerTest : public CTestBase
-	{
-public:
-	CTPointerTest();
-	~CTPointerTest();
-	TBool TestFailed();
-	TestState DoTestL();
-	void StartGrabTestL();
-	void ConstructL();
-	CGrabWindow2 *GrabWin2() const;
-	inline TBool Digitiser() const {return !iNoDigitiser;}
-private:
-	TInt doTestFailedL();
-private:
-	CPointerWindow *iRepeatWin;
-	CGrabWindow *iGrabWin;
-	CGrabWindow2 *iGrabWin2;
-	TSize iWinSize;
-	TInt iState;
-	TBool iOldPointerState;
-	TBool iNoDigitiser;
-	};
-
-GLDEF_C CTestBase *CreatePointerTest()
-	{
-	return(new(ELeave) CTPointerTest());
-	}
-
-CPointerWindow::CPointerWindow(CTPointerTest *aTest) : CTWin(), iTest(aTest)
-	{}
-
-void CPointerWindow::SetState(TInt aState)
-	{
-	iState=aState;
-	iWin.Invalidate();
-	switch(aState)
-		{
-		case KStateWaitingForTest1:
-		case KStateWaitingForTest2:
-		case KStateWaitingForTest3:
-		case KStateWaitingForTest4:
-		case KStateWaitingForTest5:
-		case KStateWaitingForTest6:
-		case KStateWaitingForTest8:
-		case KStateWaitingForTest7:
-			iRepeatRect=TRect();
-			break;
-		case KStateTesting8:
-			iWin.Close();
-			Client()->iWs.Flush();
-			User::After(500000);
-			FinishedTests();
-			break;
-		}
-	}
-
-void CPointerWindow::ResetTest(TInt aState)
-	{
-	TInt newState=KStateFinished;
-	switch(aState)
-		{
-		case KStateTesting1:
-			newState=KStateWaitingForTest1;
-			break;
-		case KStateTesting2:
-			newState=KStateWaitingForTest2;
-			break;
-		case KStateTesting3:
-			newState=KStateWaitingForTest3;
-			break;
-		case KStateTesting4:
-			newState=KStateWaitingForTest4;
-			break;
-		case KStateTesting5:
-			newState=KStateWaitingForTest5;
-			break;
-		case KStateTesting6:
-			newState=KStateWaitingForTest6;
-			break;
-		case KStateTesting8:
-			newState=KStateWaitingForTest8;
-			break;
-		case KStateTesting7:
-			newState=KStateWaitingForTest7;
-			break;
-		}
-	SetState(newState);
-	}
-
-void CPointerWindow::SetUpLD(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc)
-	{
-	ConstructExtLD(*parent,pos,size);
-	Activate();
-	AssignGC(aGc);
-	//SetState(KStateWaitingForTest1);
-	SetState(KStateWaitingForTest7);		//Only unconverted test
-	BaseWin()->EnableOnEvents();
-	}
-
-void CPointerWindow::Draw()
-	{
-	iGc->Clear();
-	iGc->DrawRect(Size());
-	iGc->DrawRect(iRepeatRect);
-	TBuf<0x80> buf;
-	TBuf<0x80> buf2;
-	switch(iState)
-		{
-		case KStateWaitingForTest1:
-			buf.Format(_L("Click anywhere in the window and hold the pointer steady"));
-			break;
-		case KStateTesting1:
-			buf.Format(_L("Hold pointer inside the box"));
-			break;
-		case KStateWaitingForTest2:
-			buf.Format(_L("Release the pointer then click in the window and hold the pointer steady"));
-			break;
-		case KStateTesting2:
-			buf.Format(_L("Drag the pointer outside the box"));
-			break;
-		case KStateWaitingForTest3:
-			buf.Format(_L("Release the pointer then click in the window and hold the pointer steady"));
-			break;
-		case KStateTesting3:
-			buf.Format(_L("Release the pointer"));
-			break;
-		case KStateWaitingForTest4:
-			buf.Format(_L("Click anywhere in the window and move the pointer slightly"));
-			break;
-		case KStateTesting4:
-			buf.Format(_L("Release the pointer"));
-			break;
-		case KStateWaitingForTest5:
-			buf.Format(_L("Click anywhere in the window and move the pointer slightly"));
-			break;
-		case KStateTesting5:
-			buf.Format(_L("Release the pointer"));
-			break;
-		case KStateWaitingForTest6:
-			buf.Format(_L("Click anywhere in the window"));
-			break;
-		case KStateTesting6:
-			buf.Format(_L("Move the pointer"));
-			break;
-		case KStateWaitingForTest8:
-			buf.Format(_L("Click anywhere in the window, and keep the pointer pressed"));
-			break;
-		case KStateTesting8:
-			buf.Format(_L(""));
-			break;
-		case KStateWaitingForTest7:
-			buf.Format(_L("Switch off and touch the center of the screen"));
-			break;
-		case KStateTesting7:
-			buf.Format(_L(""));
-			break;
-		}
-	switch(iState)
-		{
-		case KStateTesting1:
-			buf2.Format(TRefByValue<const TDesC>(_L("Repeat (%d/%d), interval=%d.%d")),iRepeatCount,KRepeatCount,iInterval.Int()/1000000,(iInterval.Int()%1000000)/100000);
-			break;
-		case KStateTesting2:
-		case KStateTesting3:
-			buf2.Format(TRefByValue<const TDesC>(_L("Repeat (%d), interval=%d.%d")),iRepeatCount,iInterval.Int()/1000000,(iInterval.Int()%1000000)/100000);
-			break;
-		}
-	iGc->DrawText(buf,TPoint(10,20));
-	iGc->DrawText(buf2,TPoint(10,40));
-	}
-
-void CPointerWindow::FinishedTests()
-	{
-	iState=KStateFinished;
-	iTest->Request();
-	}
-
-void CPointerWindow::StartNextRepeatTest()
-	{
-	iInterval=0;
-	iRepeatCount=0;
-	if (iState==KStateWaitingForTest4)
-		User::After(TTimeIntervalMicroSeconds32(1000000));
-	else if (iState==KStateWaitingForTest5)
-		User::After(TTimeIntervalMicroSeconds32(1000000));
-	QueueNextRepeat();
-	switch(iState)
-		{
-		case KStateWaitingForTest1:
-			SetState(KStateTesting1);
-			break;
-		case KStateWaitingForTest2:
-			SetState(KStateTesting2);
-			break;
-		case KStateWaitingForTest3:
-			SetState(KStateTesting3);
-			break;
-		case KStateWaitingForTest4:
-			SetState(KStateTesting4);
-			break;
-		case KStateWaitingForTest5:
-			SetState(KStateTesting5);
-			break;
-		case KStateWaitingForTest6:
-			SetState(KStateTesting6);
-			break;
-		case KStateWaitingForTest8:
-			SetState(KStateTesting8);
-			break;
-		case KStateWaitingForTest7:
-			SetState(KStateTesting7);
-			break;
-		}
-	}
-
-void CPointerWindow::QueueNextRepeat()
-	{
-	iInterval=iInterval.Int()+KRepeatIntervalIncrements;
-	iWin.RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32(iInterval),TRect(iRepeatRect));
-	iPrevTime.HomeTime();
-	iWin.Invalidate();
-	}
-
-void CPointerWindow::PointerL(const TPointerEvent &aPointer,const TTime &aTime)
-	{
-	if (aPointer.iType==TPointerEvent::EButtonRepeat)
-		{
-		if (iState!=KStateTesting1 && iState!=KStateTesting2 && iState!=KStateTesting3 && iState!=KStateTesting4)
-			TestFailed();
-		else
-			{
-			TTimeIntervalMicroSeconds32 interval(I64LOW(aTime.MicroSecondsFrom(iPrevTime).Int64()));
-			if (interval.Int()<(iInterval.Int()-KRepeatMargin) || interval.Int()>(iInterval.Int()+KRepeatMargin))
-				TestFailed();
-			else
-				{
-				if (!iRepeatRect.Contains(aPointer.iPosition) ||
-					aPointer.iParentPosition!=(aPointer.iPosition+iWin.InquireOffset(*Parent()->WinTreeNode())))
-					TestFailed();
-				else
-					{
-					iRepeatCount++;
-					if (iState==KStateTesting1 && iRepeatCount==KRepeatCount)
-						{
-						QueueNextRepeat();
-						Client()->iWs.Flush();
-						User::After(TTimeIntervalMicroSeconds32(iRepeatCount*KRepeatIntervalIncrements));
-						iWin.CancelPointerRepeatEventRequest();
-						SetState(KStateWaitingForTest2);
-						}
-					else
-						QueueNextRepeat();
-					}
-				}
-			}
-		}
-	else switch(iState)
-		{
-		case KStateWaitingForTest1:
-		case KStateWaitingForTest2:
-		case KStateWaitingForTest3:
-		case KStateWaitingForTest4:
-		case KStateWaitingForTest8:
-			if (aPointer.iType==TPointerEvent::EButton1Down)
-				{
-				iRepeatRect.iTl=aPointer.iPosition-TPoint(KRepeatRectXExtra,KRepeatRectYExtra);
-				iRepeatRect.iBr=aPointer.iPosition+TPoint(KRepeatRectXExtra,KRepeatRectYExtra);
-				StartNextRepeatTest();
-				}
-			break;
-		case KStateWaitingForTest5:
-			if (aPointer.iType==TPointerEvent::EButton1Down)
-				{
-				iRepeatRect.iTl=aPointer.iPosition;
-				iRepeatRect.iBr=aPointer.iPosition+TPoint(1,1);
-				StartNextRepeatTest();
-				}
-			break;
-		case KStateWaitingForTest6:
-			if (aPointer.iType==TPointerEvent::EButton1Down)
-				{
-				iRepeatRect.iTl=aPointer.iPosition+TPoint(KRepeatRectXExtra,KRepeatRectYExtra);
-				iRepeatRect.iBr=aPointer.iPosition+TPoint(2*KRepeatRectXExtra,2*KRepeatRectYExtra);
-				StartNextRepeatTest();
-				}
-			break;
-		case KStateTesting1:
-			TestFailed();
-			break;
-		case KStateTesting2:
-			if (aPointer.iType==TPointerEvent::EDrag)
-				SetState(KStateWaitingForTest3);
-			else
-				TestFailed();
-			break;
-		case KStateTesting3:
-			if (aPointer.iType==TPointerEvent::EButton1Up)
-				SetState(KStateWaitingForTest4);
-			else
-				TestFailed();
-			break;
-		case KStateTesting4:
-			if (aPointer.iType==TPointerEvent::EButton1Up)
-				SetState(KStateWaitingForTest5);
-			else
-				TestFailed();
-			break;
-		case KStateTesting5:
-			if (aPointer.iType==TPointerEvent::EButton1Up)
-				SetState(KStateWaitingForTest6);
-			else if (aPointer.iType!=TPointerEvent::EDrag)
-				TestFailed();
-			break;
-		case KStateTesting6:
-			if (aPointer.iType==TPointerEvent::EDrag)
-				{
-		#if !defined(__WINS__)	// Can't emulate touching dig when switched off under WINS
-				if (iTest->Digitiser())
-					SetState(KStateWaitingForTest7);
-				else
-		#endif
-					SetState(KStateWaitingForTest8);
-				}
-			else
-				TestFailed();
-			break;
-		case KStateWaitingForTest7:
-			if (aPointer.iType==TPointerEvent::EButton1Down || aPointer.iType==TPointerEvent::ESwitchOn)
-				TestFailed();
-			break;
-		case KStateTesting7:
-			if (aPointer.iType!=TPointerEvent::ESwitchOn)
-				TestFailed();
-			else
-				SetState(KStateTesting8);		//Jump straight to end as this is only unconverted test.
-				//SetState(KStateWaitingForTest8);
-			break;
-		case KStateTesting8:
-			break;
-		}
-	}
-
-void CPointerWindow::TestFailed()
-	{
-	if (iState!=KStateFailed)
-		{
-		TInt oldState=iState;
-		iState=KStateFailed;
-		if (iTest->TestFailed())
-			ResetTest(oldState);
-		}
-	}
-
-void CPointerWindow::WinKeyL(const TKeyEvent &aKey,const TTime &)
-	{
-	if (aKey.iCode==EKeyEscape)
-		FinishedTests();	// Simply skip this test if the Escape key is pressed
-	}
-
-void CPointerWindow::SwitchOn(const TTime &)
-	{
-	if (iState==KStateWaitingForTest7)
-		SetState(KStateTesting7);
-	else
-		TestFailed();
-	}
-
-//
-// CGrabWindow //
-//
-
-CGrabWindow::CGrabWindow(CTPointerTest *aTest) : iTest(aTest)
-	{
-	}
-
-void CGrabWindow::SetUpLD(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc)
-	{
-	ConstructExtLD(*parent,pos,size);
-	Activate();
-	AssignGC(aGc);
-	SetState(KGrabStateWaitingForDown);
-	}
-
-void CGrabWindow::Draw()
-	{
-	iGc->Clear();
-	iGc->DrawRect(Size());
-	TBuf<0x80> buf;
-	switch(iState)
-		{
-		case KGrabStateWaitingForDown:
-		case KGrabStateWaitingForDown2:
-		case KGrabStateWaitingForDown5:
-			buf.Copy(_L("Press the pointer inside the window"));
-			break;
-		case KGrabStateWaitingForDown3:
-		case KGrabStateWaitingForUp3a:
-			buf.Copy(_L("Press and release the pointer inside the window"));
-			break;
-		case KGrabStateWaitingForDragOut:
-			buf.Copy(_L("Drag the pointer outside into the outside window"));
-			break;
-		case KGrabStateWaitingForDrag2:
-			buf.Copy(_L("Drag the pointer outside outside both windows"));
-			break;
-		case KGrabStateWaitingForUp:
-		case KGrabStateWaitingForUp2b:
-		case KGrabStateWaitingForUp5:
-			buf.Copy(_L("Release the pointer"));
-			break;
-		case KGrabStateWaitingForDown4:
-			buf.Copy(_L("Press then release the pointer"));
-			break;
-		default:;
-		}
-	iGc->DrawText(buf,TPoint(10,20));
-	}
-
-void CGrabWindow::PointerL(const TPointerEvent &aPointer,const TTime&)
-	{
-	switch(iState)
-		{
-		case KGrabStateWaitingForDown:
-			if (aPointer.iType==TPointerEvent::EButton1Down)
-				SetState(KGrabStateWaitingForDragOut);
-			break;
-		case KGrabStateWaitingForDragOut:
-			if (aPointer.iType!=TPointerEvent::EDrag)
-				TestFailed();
-			else
-				{
-				if (!TRect(Size()).Contains(aPointer.iPosition))
-					SetState(KGrabStateWaitingForUp);
-				}
-			break;
-		case KGrabStateWaitingForUp:
-			if (aPointer.iType==TPointerEvent::EDrag)
-				break;
-			if (aPointer.iType==TPointerEvent::EButton1Up)
-				SetState(KGrabStateWaitingForDown2);
-			else
-				TestFailed();
-			break;
-		case KGrabStateWaitingForDown2:
-			if (aPointer.iType!=TPointerEvent::EButton1Down)
-				TestFailed();
-			else
-				{
-				iTest->GrabWin2()->BaseWin()->ClaimPointerGrab();
-				iTest->GrabWin2()->BaseWin()->ClaimPointerGrab();	// Call twice to check it's harmless
-				SetState(KGrabStateWaitingForUp2a);
-				}
-			break;
-		case KGrabStateWaitingForUp2a:
-			SetState(KGrabStateWaitingForDrag2);
-			break;
-		case KGrabStateWaitingForDrag2:
-			break;
-		case KGrabStateWaitingForUp2b:
-			TestFailed();
-			break;
-		case KGrabStateWaitingForDown3:
-			if (aPointer.iType!=TPointerEvent::EButton1Down)
-				TestFailed();
-			else
-				SetState(KGrabStateWaitingForUp3a);
-			break;
-		case KGrabStateWaitingForUp3a:
-			if (aPointer.iType==TPointerEvent::EButton1Up)
-				{
-				iTest->GrabWin2()->BaseWin()->ClaimPointerGrab();
-				SetState(KGrabStateWaitingForUp3b);
-				}
-			break;
-		case KGrabStateWaitingForUp3b:
-			TestFailed();
-			break;
-		case KGrabStateWaitingForDown5:
-			if (aPointer.iType!=TPointerEvent::EButton1Down)
-				TestFailed();
-			else
-				{
-				iTest->GrabWin2()->BaseWin()->ClaimPointerGrab(EFalse);
-				SetState(KGrabStateWaitingForDrag5);
-				}
-			break;
-		case KGrabStateWaitingForDrag5:
-			if (aPointer.iType==TPointerEvent::EButton1Up)
-				TestFailed();
-			break;
-		case KGrabStateWaitingForUp5:
-			TestFailed();
-			break;
-		case KGrabStateWaitingForDown4:
-			SetState(KGrabStateWaitingForUp4);
-			iWin.Close();	// Close the window with the grab captured in it
-			break;
-		case KGrabStateFinished:
-			break;
-		}
-	}
-
-void CGrabWindow::ResetTest()
-	{
-	SetState(KGrabStateWaitingForDown);
-	}
-
-void CGrabWindow::Pointer2(const TPointerEvent &aPointer)
-	{
-	switch(iState)
-		{
-		case KGrabStateWaitingForDrag2:
-			{
-			if (aPointer.iType==TPointerEvent::EDrag)
-				{
-				SetState(KGrabStateWaitingForUp2b);
-				}
-			else
-				{
-				if (iTest->TestFailed())
-					ResetTest();
-				}
-			break;
-			}
-		case KGrabStateWaitingForUp2b:
-			if (aPointer.iType==TPointerEvent::EDrag)	// Harmless
-				break;
-			if (aPointer.iType==TPointerEvent::EButton1Up)
-				SetState(KGrabStateWaitingForDown3);
-			else
-				TestFailed();
-			break;
-		case KGrabStateWaitingForUp3b:
-			if (aPointer.iType==TPointerEvent::EButton1Up)
-				SetState(KGrabStateWaitingForDown5);
-			else
-				TestFailed();
-			break;
-		case KGrabStateWaitingForUp4:
-			FinishedTests();
-			break;
-		case KGrabStateWaitingForDrag5:
-			{
-			if (aPointer.iType==TPointerEvent::EDrag)
-				SetState(KGrabStateWaitingForUp5);
-			else if (iTest->TestFailed())
-				ResetTest();
-			break;
-			}
-		case KGrabStateWaitingForUp5:
-			if (aPointer.iType==TPointerEvent::EDrag)	// Harmless
-				break;
-			if (aPointer.iType==TPointerEvent::EButton1Up)
-				SetState(KGrabStateWaitingForDown4);
-			else
-				TestFailed();
-			break;
-		default:;
-		}
-	}
-
-void CGrabWindow::SetState(TInt aState)
-	{
-	iState=aState;
-	iWin.Invalidate();
-	}
-
-void CGrabWindow::TestFailed()
-	{
-	if (iState!=KStateFailed)
-		{
-		iState=KStateFailed;
-		if (iTest->TestFailed())
-			ResetTest();
-		}
-	}
-
-void CGrabWindow::FinishedTests()
-	{
-	iState=KGrabStateFinished;
-	iTest->Request();
-	}
-
-void CGrabWindow::WinKeyL(const TKeyEvent &aKey,const TTime &)
-	{
-	if (aKey.iCode==EKeyEscape)
-		FinishedTests();	// Simply skip this test if the Escape key is pressed
-	}
-
-//
-// CGrabWindow2, used as part of grab tests //
-//
-
-CGrabWindow2::CGrabWindow2(CGrabWindow *aWindow) : iGrabWindow(aWindow)
-	{
-	}
-
-void CGrabWindow2::Draw()
-	{
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	iGc->SetBrushColor(TRgb::Gray4(2));
-	iGc->DrawRect(Size());
-	}
-
-void CGrabWindow2::PointerL(const TPointerEvent &aPointer,const TTime&)
-	{
-	iGrabWindow->Pointer2(aPointer);
-	}
-
-//
-// CTPointTest //
-//
-
-CTPointerTest::CTPointerTest() : CTestBase(_L("CTPointerTest"))
-	{}
-
-CTPointerTest::~CTPointerTest()
-	{
-	HAL::Set(HALData::EPenDisplayOn,iOldPointerState);
-	delete iRepeatWin;
-	delete iGrabWin;
-	delete iGrabWin2;
-	Client()->ResetFocus();
-	}
-
-void CTPointerTest::ConstructL()
-	{
-	iRepeatWin=new(ELeave) CPointerWindow(this);
-	TSize screenSize(Client()->iScreen->SizeInPixels());
-	iRepeatWin->SetUpLD(TPoint(screenSize.iWidth/8,screenSize.iHeight/8),TSize(screenSize.iWidth*3/4,screenSize.iHeight*3/4),Client()->iGroup,*Client()->iGc);
-	Client()->iGroup->SetCurrentWindow(iRepeatWin);
-	iNoDigitiser=EFalse;
-	TInt err=HAL::Get(HALData::EPenDisplayOn,iOldPointerState);
-	if (err==KErrNotSupported)
-		iNoDigitiser=ETrue;
-	else if (err==KErrNone)
-		err=HAL::Set(HALData::EPenDisplayOn,ETrue);
-	if (err==KErrNotSupported)
-		iNoDigitiser=(!iOldPointerState);
-	else
-		TestL(err==KErrNone);
-	}
-
-TBool CTPointerTest::TestFailed()
-	{
-	TInt ret=1;
-	TRAP_IGNORE(ret=doTestFailedL());
-	switch(ret)
-		{
-		case 0:
-			return(ETrue);	// Re-try test
-		case 1:
-			Request();
-			break;
-		}
-	return(EFalse);
-	}
-
-TInt CTPointerTest::doTestFailedL()
-	{
-	CTDialog *dialog=new(ELeave) CTDialog();
-	dialog->SetTitle(_L("Pointer repeat test failed"));
-	dialog->SetNumButtons(2);
-	dialog->SetButtonText(0,_L("Retest"));
-	dialog->SetButtonText(1,_L("Fail"));
-	dialog->ConstructLD(*Client()->iGroup,*Client()->iGc);
-	return dialog->Display();
-	}
-
-CGrabWindow2 *CTPointerTest::GrabWin2() const
-	{
-	return(iGrabWin2);
-	}
-
-void CTPointerTest::StartGrabTestL()
-	{
-	iGrabWin=new(ELeave) CGrabWindow(this);
-	iGrabWin2=new(ELeave) CGrabWindow2(iGrabWin);
-//
-	TSize screenSize(Client()->iScreen->SizeInPixels());
-	iGrabWin2->SetUpL(TPoint(screenSize.iWidth/8,screenSize.iHeight/8),TSize(screenSize.iWidth*3/4,screenSize.iHeight*3/4),Client()->iGroup,*Client()->iGc);
-	Client()->iGroup->SetCurrentWindow(iGrabWin2);
-//
-	iGrabWin->SetUpLD(TPoint(screenSize.iWidth/4,screenSize.iHeight/4),TSize(screenSize.iWidth/2,screenSize.iHeight/2),Client()->iGroup,*Client()->iGc);
-	Client()->iGroup->SetCurrentWindow(iGrabWin);
-//
-	}
-
-#pragma warning( disable : 4065 )	//switch statement contains 'default' but no 'case' labels
-TestState CTPointerTest::DoTestL()
-	{
-	switch(iState)
-		{
-	#if !defined(__WINS__)		//Only unconverted test is MARM only
-		case 0:
-			LogSubTest(_L("Repeat tests"),1);
-			iState++;
-			return(EContinue);
-	#endif
-		
-		default:
-			return(EFinished);
-		}
-	}
-#pragma warning( default : 4065 )
-
--- a/windowing/windowserver/tman/TMSCRMOD.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,226 +0,0 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Screen mode changing tests
-// 
-//
-
-#include <e32std.h>
-#include "W32STD.H"
-#include "../tlib/testbase.h"
-#include "TMAN.H"
-
-class CScreenModeTest;
-
-class CScreenModeWindow : public CTWin
-	{
-public:
-	CScreenModeWindow();
-	void SetUpLD(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
-	void WinKeyL(const TKeyEvent &aKey,const TTime &aTime);
-	void Draw();
-	void ScreenDeviceChanged();
-private:
-	TInt iSubState;
-	};
-
-class CScreenModeGroup : public CTWindowGroup
-	{
-public:
-	~CScreenModeGroup();
-	CScreenModeGroup(CTClient *aClient);
-	void ConstructL();
-	void ScreenDeviceChanged();
-private:
-	CScreenModeWindow *iWindow;
-	};
-
-class CScreenModeTest : public CTestBase
-	{
-public:
-	CScreenModeTest();
-	~CScreenModeTest();
-	TestState DoTestL();
-	void ConstructL();
-private:
-	CScreenModeGroup *iScreenModeGroup;
-	TSize iWinSize;
-	TInt iState;
-	};
-
-GLDEF_C CTestBase *CreateScreenModeTest()
-	{
-	return(new(ELeave) CScreenModeTest());
-	}
-
-//
-// CScreenModeWindow
-//
-
-CScreenModeWindow::CScreenModeWindow() : CTWin()
-	{}
-
-void CScreenModeWindow::WinKeyL(const TKeyEvent &aKey,const TTime &)
-	{
-	if (aKey.iCode==EKeyEscape || aKey.iCode==EKeyEnter)
-		{
-		if (iSubState==0)
-			{
-			iSubState=1;
-			ScreenDeviceChanged();
-			Invalidate();
-			}
-		else
-			CActiveScheduler::Stop();
-		}
-	}
-
-void CScreenModeWindow::SetUpLD(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc)
-	{
-	ConstructExtLD(*parent,pos,size);
-	Activate();
-	AssignGC(aGc);
-	}
-
-void CScreenModeWindow::Draw()
-	{
-	iGc->Clear();
-	TSize winSize(Win()->Size());
-	iGc->DrawRect(winSize);
-	iGc->DrawLine(TPoint(0,0),TPoint(winSize.iWidth,winSize.iHeight));
-	iGc->DrawLine(TPoint(0,winSize.iHeight),TPoint(winSize.iWidth,0));
-	TInt xpos=winSize.iWidth/2-100;
-	iGc->DrawText(iSubState==0?_L("Twips not adjusted,"):
-								_L("Twips adjusted,"),TPoint(xpos,20));
-	iGc->DrawText(_L("Cycle through all screen modes,"),TPoint(xpos,40));
-	iGc->DrawText(_L("Check the window is resized and rotated correctly,"),TPoint(xpos,60));
-	iGc->DrawText(_L("Then press <Enter> when finished"),TPoint(xpos,80));
-//
-	TSize twips=Client()->iScreen->SizeInTwips();
-	TSize pixels=Client()->iScreen->SizeInPixels();
-// Horizontal line
-	TInt inches=twips.iWidth/KTwipsPerInch-1;
-	TInt lineLen=Client()->iScreen->HorizontalTwipsToPixels(inches*KTwipsPerInch);
-	TPoint linePos=TPoint((pixels.iWidth-lineLen)/2,pixels.iHeight/2);
-	iGc->DrawLine(linePos,linePos+TPoint(lineLen,0));
-	TBuf<0x20> buf;
-	buf.Format(TRefByValue<const TDesC>(_L("Width %d\"")),inches);
-	iGc->DrawText(buf,TPoint((pixels.iWidth-iFont->TextWidthInPixels(buf))/2,linePos.iY-iFont->HeightInPixels()+iFont->AscentInPixels()-2));
-	TInt index;
-	for(index=0;index<=inches;index++)
-		{
-		TInt dx=Client()->iScreen->HorizontalTwipsToPixels(index*KTwipsPerInch);
-		TInt dy=Client()->iScreen->VerticalTwipsToPixels(KTwipsPerInch/(index==0 || index==inches ? 8 : 16));
-		iGc->DrawLine(linePos+TPoint(dx,1), linePos+TPoint(dx,dy));
-		}
-// Vertical line
-	inches=twips.iHeight/KTwipsPerInch;
-	lineLen=Client()->iScreen->VerticalTwipsToPixels(inches*KTwipsPerInch);
-	linePos.iY=(pixels.iHeight-lineLen)/2;
-	iGc->DrawLine(linePos,linePos+TPoint(0,lineLen));
-	buf.Format(TRefByValue<const TDesC>(_L("Height %d\"")),inches);
-	iGc->DrawText(buf,TPoint(linePos.iX+10, pixels.iHeight/4));
-	for(index=0;index<=inches;index++)
-		{
-		TInt dx=Client()->iScreen->HorizontalTwipsToPixels(KTwipsPerInch/(index==0 || index==inches ? 8 : 16));
-		TInt dy=Client()->iScreen->VerticalTwipsToPixels(index*KTwipsPerInch);
-		iGc->DrawLine(linePos+TPoint(1,dy), linePos+TPoint(dx,dy));
-		}
-
-	}
-
-void CScreenModeWindow::ScreenDeviceChanged()
-	{
-	if (iSubState==0)
-		{
-		TPixelsAndRotation sizeAndRotation;
-		Client()->iScreen->GetDefaultScreenSizeAndRotation(sizeAndRotation);
-		Client()->iScreen->SetScreenSizeAndRotation(sizeAndRotation);
-		}
-	else
-		{
-		TPixelsTwipsAndRotation sizeAndRotation;
-		Client()->iScreen->GetDefaultScreenSizeAndRotation(sizeAndRotation);
-		Client()->iScreen->SetScreenSizeAndRotation(sizeAndRotation);
-		}
-	SetSize(Client()->iScreen->SizeInPixels());
-	}
-
-//
-// CScreenModeGroup
-//
-
-CScreenModeGroup::~CScreenModeGroup()
-	{
-	GroupWin()->EnableReceiptOfFocus(EFalse);
-	ClearCurrentWindow();
-	Client()->iGroup->SetCurrentWindow(NULL);
-	CTWin::Delete(iWindow);
-	}
-
-CScreenModeGroup::CScreenModeGroup(CTClient *aClient) : CTWindowGroup(aClient)
-	{}
-
-void CScreenModeGroup::ConstructL()
-	{
-	CTWindowGroup::ConstructL();
-	iWindow=new(ELeave) CScreenModeWindow;
-	iWindow->SetUpLD(TPoint(0,0),Client()->iScreen->SizeInPixels(),this,*Client()->iGc);
-	SetCurrentWindow(iWindow);
-	GroupWin()->EnableScreenChangeEvents();
-	GroupWin()->SetOrdinalPosition(0);
-	}
-
-void CScreenModeGroup::ScreenDeviceChanged()
-	{
-	iWindow->ScreenDeviceChanged();
-	}
-
-//
-// CScreenModeTest
-//
-
-CScreenModeTest::CScreenModeTest() : CTestBase(_L("Screen mode"))
-	{}
-
-CScreenModeTest::~CScreenModeTest()
-	{
-	Client()->iGroup->GroupWin()->EnableScreenChangeEvents();
-	Client()->iScreen->SetScreenMode(0);
-	delete iScreenModeGroup;
-	}
-
-void CScreenModeTest::ConstructL()
-	{
-	Client()->iGroup->GroupWin()->SetOrdinalPosition(0);
-	Client()->iGroup->GroupWin()->DisableScreenChangeEvents();
-//
-	iScreenModeGroup=new(ELeave) CScreenModeGroup(Client());
-	iScreenModeGroup->ConstructL();
-	}
-
-TestState CScreenModeTest::DoTestL()
-	{
-	switch(iState)
-		{
-		case 0:
-			LogSubTest(_L("Screen mode 1"),1);
- 			CActiveScheduler::Start();
-			iState++;
-			break;
-		default:
-			return(EFinished);
-		}
-	return(ENext);
-	}
-
--- a/windowing/windowserver/tman/TMTScrMd.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,463 +0,0 @@
-// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Screen mode changing tests
-// 
-//
-
-#include <e32std.h>
-#include <e32def_private.h>
-#include "W32STD.H"
-#include "../tlib/testbase.h"
-#include "TMAN.H"
-
-class CTimeWindow;
-
-class CQBlankWindow : public CBlankWindow
-	{
-public:
-	static TInt iInitialColor;
-public:
-	//Virtual function from CTBaseWin
-	void InitWin();
-public:
-	static TSize iSize;
-	TSglQueLink iLink;
-	};
-
-class CFixScreenModeGroup : public CTWindowGroup
-	{
-public:
-	static TInt iNoClientWins;
-public:
-	~CFixScreenModeGroup();
-	CFixScreenModeGroup(CTClient *aClient);
-	void ConstructL();
-public:
-	TSglQueLink iLink;
-private:
-	TSglQue<CQBlankWindow> iWindows;
-	};
-
-class CFlipClient : public CTClient
-	{
-public:
-	void ConstructL();
-private:
-	};
-
-class CScreenModeTimes : public CTestBase
-	{
-public:
-	CScreenModeTimes();
-	~CScreenModeTimes();
-	TestState DoTestL();
-	void ConstructL();
-	void DoTimings();
-private:
-	void CreateGroupL(CTClient* aClient,TSglQue<CFixScreenModeGroup>& aQue);
-	void DeleteGroups(TSglQue<CFixScreenModeGroup>& aQue);
-	void BringToFront(TSglQue<CFixScreenModeGroup>& aQue);
-private:
-	TScreenModeEnforcement iEnforcementMode;
-	CInfoDialog* iDialogue;
-	CTimeWindow* iInfoWindow;
-	CFlipClient* iFlipClient;
-	TSglQue<CFixScreenModeGroup> iNormalGroupQue;
-	TSglQue<CFixScreenModeGroup> iFlipGroupQue;
-	TInt iNoGroupWins;
-	TInt iState;
-	};
-
-class CTimeWindow : public CTTitledWindow
-	{
-public:
-	void Construct(CTestBase* aTest);
-	void SetNumWindows(TInt aGroup,TInt aWin);
-	void SetTime1(TTimeIntervalMicroSeconds& aTime);
-	void SetTime2(TTimeIntervalMicroSeconds& aTime);
-	void DoDraw();
-	//virtual function from CTWinBase overridden by CTBaseWin
-	void WinKeyL(const TKeyEvent &aKey,const TTime &aTime);
-	//virtual functions from CTBaseWin
-	void SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
-	void PointerL(const TPointerEvent &aPointer,const TTime &aTime);
-	//virtual function from CTBaseWin overridden by CTTitledWindow
-	void Draw();
-private:
-	inline CScreenModeTimes* Test() {return STATIC_CAST(CScreenModeTimes*,iTest);}
-	void UpdateString1();
-	void UpdateString2();
-	void UpdateString3();
-private:
-	CTestBase* iTest;
-	TInt iNumGroups;
-	TInt iNumWins;
-	TTimeIntervalMicroSeconds iTime1;
-	TTimeIntervalMicroSeconds iTime2;
-	TBuf<32> iString1;
-	TBuf<32> iString2;
-	TBuf<32> iString3;
-	TBuf<32> iString4;
-	TRect iRect1;
-	TRect iRect2;
-	TRect iRect3;
-	TRect iRect4;
-	TBool iPressed;
-	TBool iExit;
-	};
-
-
-TSize CQBlankWindow::iSize;
-TInt CQBlankWindow::iInitialColor;
-TInt CFixScreenModeGroup::iNoClientWins=0;
-
-
-GLDEF_C CTestBase *CreateScreenModeTimes()
-	{
-	return(new(ELeave) CScreenModeTimes());
-	}
-
-
-//
-// CFlipClient
-//
-
-void CFlipClient::ConstructL()
-	{
-	CTClient::ConstructL();
-	TPixelsAndRotation sizeAndRotation;
-	iScreen->GetScreenModeSizeAndRotation(1,sizeAndRotation);
-	iScreen->SetScreenSizeAndRotation(sizeAndRotation);
-	}
-
-
-//
-// CTimeWindow
-//
-
-void CTimeWindow::Construct(CTestBase* aTest)
-	{
-	_LIT(Title,"StatusWindow");
-	_LIT(String4,"Click here to finish");
-	const TInt fontHeight=iFont->HeightInPixels();
-	iTest=aTest;
-	TWindowTitle title(Title);
-	SetTitle(title);
-	TInt yy=iTitleHeight+fontHeight+7;
-	iRect1.SetRect(3,iTitleHeight+5,iSize.iWidth-1,yy);
-	yy+=fontHeight/2;
-	TInt yy1=yy+fontHeight+2;
-	iRect2.SetRect(3,yy+3,iSize.iWidth-1,yy1);
-	TInt yy2=yy1+iFont->HeightInPixels()+2;
-	iRect3.SetRect(3,yy1+3,iSize.iWidth-1,yy2);
-	yy2+=fontHeight/2;
-	iRect4.SetRect(3,yy2+3,iSize.iWidth-1,yy2+iFont->HeightInPixels()+2);
-	//
-	iString4.Copy(String4);
-	iExit=EFalse;
-	}
-
-void CTimeWindow::SetUpL(TPoint aPos,TSize aSize,CTWinBase *aParent,CWindowGc &aGc)
-	{
-	CTTitledWindow::SetUpL(aPos,aSize,aParent,aGc);
-	}
-
-void CTimeWindow::WinKeyL(const TKeyEvent &aKey,const TTime&)
-	{
-	switch(aKey.iCode)
-		{
-		case EKeyEscape:
-			iTest->Request();
-			break;
-		default:;
-		}
-	}
-
-void CTimeWindow::PointerL(const TPointerEvent &aPointer,const TTime &aTime)
-	{
-	if (iRect2.Contains(aPointer.iPosition) || iRect3.Contains(aPointer.iPosition))
-		{
-		if (aPointer.iType==TPointerEvent::EButton1Down)
-			iPressed=ETrue;
-		}
-	else if (iRect4.Contains(aPointer.iPosition))
-		iExit=ETrue;
-	else
-		CTTitledWindow::PointerL(aPointer,aTime);
-	if ((iExit||iPressed) && aPointer.iType==TPointerEvent::EButton1Up)
-		{
-		if (iExit)
-			iTest->Request();
-		else
-			{
-			Test()->DoTimings();
-			DoDraw();
-			}
-		}
-	}
-
-void CTimeWindow::Draw()
-	{
-	CTTitledWindow::Draw();
-	TInt ascent=iFont->AscentInPixels()+1;
-	iGc->DrawText(iString1,iRect1,ascent,CGraphicsContext::ELeft);
-	iGc->DrawText(iString2,iRect2,ascent,CGraphicsContext::ELeft);
-	iGc->DrawText(iString3,iRect3,ascent,CGraphicsContext::ELeft);
-	iGc->DrawText(iString4,iRect4,ascent,CGraphicsContext::ELeft);
-	}
-
-void CTimeWindow::DoDraw()
-	{
-	iGc->Activate(iWin);
-	iGc->UseFont((CFont *)iFont);
-	Draw();
-	iGc->Deactivate();
-	}
-
-void CTimeWindow::SetNumWindows(TInt aGroups,TInt aWins)
-	{
-	iNumGroups=aGroups;
-	iNumWins=aWins;
-	UpdateString1();
-	}
-
-void CTimeWindow::UpdateString1()
-	{
-	_LIT(NumberWin,"Groups (2x)%d, Windows %d");
-	iString1.Format(NumberWin,iNumGroups,iNumWins);
-	}
-
-void CTimeWindow::SetTime1(TTimeIntervalMicroSeconds& aTime)
-	{
-	iTime1=aTime;
-	UpdateString2();
-	}
-
-void CTimeWindow::SetTime2(TTimeIntervalMicroSeconds& aTime)
-	{
-	iTime2=aTime;
-	UpdateString3();
-	}
-
-_LIT(TimeFormat,"Time%d = %d.%04dsecs");
-
-void CTimeWindow::UpdateString2()
-	{
-	TInt time = I64LOW(iTime1.Int64());
-	iString2.Format(TimeFormat,1,time/1000000,(time%1000000)/100);
-	}
-
-void CTimeWindow::UpdateString3()
-	{
-	TInt time = I64LOW(iTime2.Int64());
-	iString3.Format(TimeFormat,2,time/1000000,(time%1000000)/100);
-	}
-
-
-//
-// CQBlankWindow
-//
-
-void CQBlankWindow::InitWin()
-	{
-	SetColor(TRgb::Gray4(iInitialColor));
-	iWin.SetSize(iSize);
-	}
-
-
-//
-// CFixScreenModeGroup
-//
-
-CFixScreenModeGroup::~CFixScreenModeGroup()
-	{
-	GroupWin()->EnableReceiptOfFocus(EFalse);
-	ClearCurrentWindow();
-	CQBlankWindow* win;
-	while (!iWindows.IsEmpty())
-		{
-		win=iWindows.First();
-		iWindows.Remove(*win);
-		delete win;
-		}
-	}
-
-CFixScreenModeGroup::CFixScreenModeGroup(CTClient *aClient) : CTWindowGroup(aClient), iWindows(_FOFF(CQBlankWindow,iLink))
-	{}
-
-void CFixScreenModeGroup::ConstructL()
-	{
-	CTWindowGroup::ConstructL();
-	CQBlankWindow* win;
-	TInt ii;
-	for(ii=0;ii<iNoClientWins;++ii)
-		{
-		win=new(ELeave) CQBlankWindow();
-		CleanupStack::PushL(win);
-		win->ConstructL(*this);
-		win->Activate();
-		win->AssignGC(*iClient->iGc);
-		iWindows.AddLast(*win);
-		CleanupStack::Pop(win);
-		Client()->Flush();
-		}
-	SetCurrentWindow(iWindows.First());
-	}
-
-/*void CFixScreenModeGroup::ScreenDeviceChanged()
-	{
-	iWindow->ScreenDeviceChanged();
-	}*/
-
-
-//
-// CScreenModeTimes
-//
-
-_LIT(TestName,"Screen Mode Times");
-CScreenModeTimes::CScreenModeTimes() : CTestBase(TestName)
-								,iNormalGroupQue(_FOFF(CFixScreenModeGroup,iLink)),iFlipGroupQue(_FOFF(CFixScreenModeGroup,iLink))
-	{}
-
-CScreenModeTimes::~CScreenModeTimes()
-	{
-	Client()->iGroup->GroupWin()->EnableScreenChangeEvents();
-	Client()->iScreen->SetScreenMode(0);
-	DeleteGroups(iNormalGroupQue);
-	DeleteGroups(iFlipGroupQue);
-	Client()->iGroup->SetCurrentWindow(NULL);
-	delete iFlipClient;
-	delete iInfoWindow;
-	if (iEnforcementMode==ESizeEnforcementNone)
-		 Client()->iScreen->SetScreenModeEnforcement(ESizeEnforcementNone);
-	}
-
-void CScreenModeTimes::ConstructL()
-	{
-	iEnforcementMode=Client()->iScreen->ScreenModeEnforcement();
-	if (iEnforcementMode==ESizeEnforcementNone)
-		 Client()->iScreen->SetScreenModeEnforcement(ESizeEnforcementPixelsAndRotation);
-	iDialogue=new(ELeave) CInfoDialog(Client()->iGroup,Client()->iGc);
-	iDialogue->ConstructLD();
-	iFlipClient=new(ELeave) CFlipClient();
-	iFlipClient->ConstructL();
-	Client()->iGroup->GroupWin()->DisableScreenChangeEvents();
-	iNoGroupWins=12;		//20;
-	CFixScreenModeGroup::iNoClientWins=20;		//30;
-	TSize screenSize=Client()->iScreen->SizeInPixels();
-	CQBlankWindow::iSize.iWidth=Max(screenSize.iHeight,screenSize.iWidth);
-	CQBlankWindow::iSize.iHeight=CQBlankWindow::iSize.iWidth;
-	TInt ii;
-	for(ii=0;ii<iNoGroupWins;++ii)
-		{
-		CQBlankWindow::iInitialColor=1;
-		CreateGroupL(Client(),iNormalGroupQue);
-		CQBlankWindow::iInitialColor=2;
-		CreateGroupL(iFlipClient,iFlipGroupQue);
-		}
-	Client()->iGroup->GroupWin()->SetOrdinalPosition(0);
-	iInfoWindow=new(ELeave) CTimeWindow();
-	iInfoWindow->SetUpL(TPoint(Max(Min(415,screenSize.iWidth-210),0),Min(50,screenSize.iHeight-180)),TSize(210,180),Client()->iGroup,*Client()->iGc);
-	Client()->iGroup->SetCurrentWindow(iInfoWindow);
-	iInfoWindow->Construct(this);
-	iInfoWindow->WinTreeNode()->SetOrdinalPosition(1);
-	iInfoWindow->SetNumWindows(iNoGroupWins,CFixScreenModeGroup::iNoClientWins);
-
-	Client()->iGroup->GroupWin()->DisableScreenChangeEvents();
-	Client()->iWs.SetAutoFlush(ETrue);
-	iFlipClient->iWs.SetAutoFlush(ETrue);
-	Client()->iWs.SetPointerCursorMode(EPointerCursorNone);
-	}
-
-void CScreenModeTimes::CreateGroupL(CTClient *aClient,TSglQue<CFixScreenModeGroup>& aQue)
-	{
-	CFixScreenModeGroup* group;
-	group=new(ELeave) CFixScreenModeGroup(aClient);
-	CleanupStack::PushL(group);
-	group->ConstructL();
-	aQue.AddLast(*group);
-	CleanupStack::Pop(group);
-	}
-
-void CScreenModeTimes::DeleteGroups(TSglQue<CFixScreenModeGroup>& aQue)
-	{
-	CFixScreenModeGroup* group;
-	while (!aQue.IsEmpty())
-		{
-		group=aQue.First();
-		aQue.Remove(*group);
-		delete group;
-		}
-	}
-
-void CScreenModeTimes::BringToFront(TSglQue<CFixScreenModeGroup>& aQue)
-	{
-	TSglQueIter<CFixScreenModeGroup> iter(aQue);
-	CFixScreenModeGroup* group=iter++;
-	group->GroupWin()->SetOrdinalPosition(0);
-	while ((group=iter++)!=NULL)
-		group->GroupWin()->SetOrdinalPosition(1);
-	}
-
-void CScreenModeTimes::DoTimings()
-	{
-	//Timings 1 SCRDEV, DWsScreenDevice::CommandL, around call to SetScreenMode
-	//Timings 2 GROUPWIN, CWsWindowGroup::SetScreenDeviceValidStates, around main body of function including calls to old way
-	//Timings 3 CLIWIN, CWsTopClientWindow::SetScreenDeviceValidState, around call to ResetHiddenFlagAndAdjustRegions
-	//Timings 3 GROUPWIN, CWsWindowGroup::SetScreenDeviceValidStates, around main body of function excluding calls to old way
-	//Timings 4&5 CLIWIN, CWsClientWindow::ResetHiddenFlagAndAdjustRegions, going invisible and becomming visible sections
-	Client()->iGroup->GroupWin()->SetOrdinalPosition(-2);
-	Client()->Flush();
-	TTime startTime;
-	TTime middleTime;
-	TTime endTime;
-__PROFILE_START(0);
-	startTime.HomeTime();
-	BringToFront(iNormalGroupQue);
-	Client()->iScreen->SetScreenMode(1);
-	middleTime.HomeTime();
-	BringToFront(iFlipGroupQue);
-	Client()->iScreen->SetScreenMode(0);
-	endTime.HomeTime();
-__PROFILE_END(0);
-#if defined(__PROFILING__)
-	TProfile profile;
-	RDebug::ProfileResult(&profile,3,1);
-	if (profile.iCount>0)
-		iDialogue->TimerResults(0);
-#endif
-	TTimeIntervalMicroSeconds time=middleTime.MicroSecondsFrom(startTime);
-	iInfoWindow->SetTime1(time);
-	time=endTime.MicroSecondsFrom(middleTime);
-	iInfoWindow->SetTime2(time);
-	Client()->iGroup->GroupWin()->SetOrdinalPosition(0);
-#if defined(__PROFILING__)
-	if (profile.iCount>0)
-		iDialogue->Display();
-#endif
-	}
-
-TestState CScreenModeTimes::DoTestL()
-	{
-	switch(iState)
-		{
-		case 0:
-			LogSubTest(_L("Time ScreenMode Changes"),1);
-			DoTimings();
-			iState++;
-			return EContinue;
-		default:
-			return EFinished;
-		}
-	}
--- a/windowing/windowserver/tman/TPASSWRD.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,429 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Test Wserv password features
-// 
-//
-
-#include <e32std.h>
-#include <e32hal.h>
-#include "W32STD.H"
-#include "../tlib/testbase.h"
-#include "TMAN.H"
-
-//#define LOG_TESTS
-
-#define THE_PASSWORD _L("pass")
-
-enum TPasswordState 
-	{
-	ENotStarted,
-	EWaitForSwitchOff,
-	EWaitForEnter,
-	EWaitForA,
-	EWaitForSwitchOff2,
-	EWaitForSwitchOff3,
-	EWaitForSwitchOff4,
-	EWaitForSwitchOff5,
-	EWaitForEnter2,
-	EPasswordFinished,
-	};
-
-class CPasswordTest;
-
-class CPasswordWindowGroup : public CTWindowGroup
-	{
-public:
-	CPasswordWindowGroup(CTClient *aClient, CPasswordTest *aTest);
-	void ConstructL();
-	void PasswordL(const TTime &aTime);
-	void KeyL(const TKeyEvent &aKey,const TTime &aTime);
-	void SwitchOn(const TTime &aTime);
-private:
-	CPasswordTest *iTest;
-	};
-
-class CPasswordWindowGroup2 : public CTWindowGroup
-	{
-public:
-	CPasswordWindowGroup2(CTClient *aClient, CPasswordTest *aTest);
-	void ConstructL();
-	void KeyL(const TKeyEvent &aKey,const TTime &aTime);
-private:
-	CPasswordTest *iTest;
-	};
-
-class CPasswordWindow : public CTWin
-	{
-public:
-	CPasswordWindow(CPasswordTest *aTest);
-	void Draw();
-private:
-	CPasswordTest *iTest;
-	};
-
-class CPasswordTest : public CTestBase
-	{
-public:
-	CPasswordTest();
-	~CPasswordTest();
-	TestState DoTestL();
-	void ConstructL();
-	void Fail(TInt aWhere);
-	void EnterKeyPressed(TPasswordState aNewState);
-	void SwitchOn();
-	void TestComplete(TPasswordState aNewState);
-	void PasswordMsgReceivedL();
-	TPasswordState PasswordState() const;
-	void SetPassState(TPasswordState aPassState);
-	void StartMainPasswordTestL();
-	void StartOnceADayPasswordTestL();
-	void TurnOffAndOn();
-private:
-	CPasswordWindowGroup *iGroup;
-	CPasswordWindowGroup2 *iGroup2;
-	CPasswordWindow *iPassWin;
-	CTBlankWindow *iBlankWin;
-	TSize iWinSize;
-	TInt iState;
-	TPasswordState iPassState;
-	TBool iPasswordTestFailed;
-	};
-
-GLDEF_C CTestBase *CreatePasswordTest()
-	{
-	return(new(ELeave) CPasswordTest());
-	}
-
-//
-
-CPasswordWindowGroup::CPasswordWindowGroup(CTClient *aClient, CPasswordTest *aTest) :
-	CTWindowGroup(aClient),
-	iTest(aTest)
-	{
-	__DECLARE_NAME(_S("CPasswordWindowGroup"));
-	}
-
-void CPasswordWindowGroup::ConstructL()
-	{
-	CTWindowGroup::ConstructL();
-	GroupWin()->EnableOnEvents();
-	}
-
-void CPasswordWindowGroup::SwitchOn(const TTime &)
-	{
-	iTest->SwitchOn();
-	}
-
-void CPasswordWindowGroup::KeyL(const TKeyEvent &aKey,const TTime &)
-	{
-	if (aKey.iCode==EKeyEscape)
-		iTest->TestComplete(EPasswordFinished);
-	switch(iTest->PasswordState())
-		{
-		case EWaitForEnter:
-			if (aKey.iCode==EKeyEnter)
-				iTest->EnterKeyPressed(EWaitForA);
-			break;
-		case EWaitForEnter2:
-			if (aKey.iCode==EKeyEnter)
-				iTest->TestComplete(EPasswordFinished);
-			break;
-		default:;
-		}
-	}
-
-void CPasswordWindowGroup::PasswordL(const TTime &)
-	{
-	iTest->TestL(iGroupWin.OrdinalPosition()==0);
-	iTest->PasswordMsgReceivedL();
-	}
-
-//
-
-CPasswordWindowGroup2::CPasswordWindowGroup2(CTClient *aClient, CPasswordTest *aTest) :
-	CTWindowGroup(aClient),
-	iTest(aTest)
-	{
-	__DECLARE_NAME(_S("CPasswordWindowGroup"));
-	}
-
-void CPasswordWindowGroup2::ConstructL()
-	{
-	CTWindowGroup::ConstructL();
-	iGroupWin.CaptureKey('a',0,0);
-	}
-
-void CPasswordWindowGroup2::KeyL(const TKeyEvent &aKey,const TTime &)
-	{
-	if (iTest->PasswordState()!=EPasswordFinished)
-		{
-		if (iTest->PasswordState()!=EWaitForA)
-			{
-		#if defined(LOG_TESTS)
-			TLogMessageText buf;
-			_LIT(KBadKey,"Bad Key  Code=%d(%c) Scan=%d(%c) Rep=%d");
-			buf.AppendFormat(KBadKey,aKey.iCode,aKey.iCode,aKey.iScanCode,aKey.iScanCode,aKey.iRepeats);
-			Client()->LogMessage(buf);
-		#endif
-			if (aKey.iRepeats==0)
-				iTest->Fail(1);
-			}
-		else
-			{
-			if (aKey.iCode!='a')
-				iTest->Fail(2);
-			iTest->TestComplete(EWaitForSwitchOff2);
-			}
-		}
-	}
-
-//
-
-CPasswordWindow::CPasswordWindow(CPasswordTest *aTest) :
-	iTest(aTest)
-	{
-	}
-
-void CPasswordWindow::Draw()
-	{
-	iGc->Clear();
-	switch(iTest->PasswordState())
-		{
-		case EWaitForSwitchOff:
-			iGc->DrawText(_L("Please wait, turning off & on [1]"),TPoint(10,20));
-			break;
-		case EWaitForSwitchOff2:
-			iGc->DrawText(_L("Please wait, turning off & on [2]"),TPoint(10,20));
-			break;
-		case EWaitForSwitchOff3:
-			iGc->DrawText(_L("Please wait, turning off & on [3]"),TPoint(10,20));
-			break;
-		case EWaitForSwitchOff4:
-			iGc->DrawText(_L("Please wait, turning off & on [4]"),TPoint(10,20));
-			break;
-		case EWaitForSwitchOff5:
-			iGc->DrawText(_L("Please wait, turning off & on [5]"),TPoint(10,20));
-			break;
-		case EWaitForEnter:
-			iGc->DrawText(_L("Try the key of death, then..."),TPoint(10,20));
-			iGc->DrawText(_L("Press 'a', then..."),TPoint(10,40));
-			iGc->DrawText(_L("Press Enter"),TPoint(10,60));
-			break;
-		case EWaitForEnter2:
-			iGc->DrawText(_L("Press Enter"),TPoint(10,20));
-			break;
-		case EWaitForA:
-			iGc->DrawText(_L("Press 'a'"),TPoint(10,20));
-		case EPasswordFinished:
-			break;
-		default:;
-		}
-	}
-
-//
-
-CPasswordTest::CPasswordTest() : CTestBase(_L("Password"))
-	{}
-
-CPasswordTest::~CPasswordTest()
-	{
-	delete iBlankWin;
-	delete iPassWin;
-	delete iGroup;
-	delete iGroup2;
-	}
-
-#if defined(LOG_TESTS)
-void CPasswordTest::Fail(TInt aWhere)
-#else
-void CPasswordTest::Fail(TInt /*aWhere*/)
-#endif
-	{
-#if defined(LOG_TESTS)
-	TLogMessageText buf;
-	_LIT(KFailed,"Password Failed at %d (%d,%d)");
-	buf.AppendFormat(KFailed,aWhere,iState,iPassState);
-	Client()->LogMessage(buf);
-#endif
-	iPasswordTestFailed=ETrue;
-	Request();
-	}
-
-void CPasswordTest::TurnOffAndOn()
-	{
-/*#if defined(LOG_TESTS)
-	TLogMessageText buf;
-	_LIT(KSettingTime,"Setting Off Timer");
-	buf.Append(KSettingTime);
-	Client()->LogMessage(buf);
-#endif*/
-	RTimer timer;
-	timer.CreateLocal();
-	TTime time;
-	time.HomeTime();
-	time+=TTimeIntervalSeconds(7);	// For some reason the O/S won't switch off for less than 6 seconds
-	TRequestStatus status;
-	timer.At(status,time);
-	UserHal::SwitchOff();
-	User::WaitForRequest(status);
-#if !defined(__WINS__)
-	TRawEvent event;
-	event.Set(TRawEvent::ESwitchOn);
-	UserSvr::AddEvent(event);
-#endif
-/*#if defined(LOG_TESTS)
-	TLogMessageText buf;
-	_LIT(KTimerOff,"Timer Gone Off (P=%d,S=%d)");
-	buf.AppendFormat(KTimerOff,iState,iPassState);
-	Client()->LogMessage(buf);
-#endif*/
-	}
-
-TPasswordState CPasswordTest::PasswordState() const
-	{
-	return(iPassState);
-	}
-
-void CPasswordTest::SetPassState(TPasswordState aPassState)
-	{
-	iPassState=aPassState;
-	iPassWin->DrawNow();
-	Client()->iWs.Flush();
-/*#if defined(LOG_TESTS)
-	TLogMessageText buf;
-	_LIT(PassTestState,"Password Test(%d), State=%d");
-	buf.AppendFormat(PassTestState,iState,aPassState);
-	Client()->LogMessage(buf);
-#endif*/
-	switch(aPassState)
-		{
-		case EWaitForSwitchOff:
-		case EWaitForSwitchOff2:
-		case EWaitForSwitchOff3:
-		case EWaitForSwitchOff4:
-		case EWaitForSwitchOff5:
-			TurnOffAndOn();
-			break;
-		default:;
-		}
-	}
-
-void CPasswordTest::SwitchOn()
-	{
-/*#if defined(LOG_TESTS)
-	TLogMessageText buf;
-	_LIT(KTimerOff,"Switch On (P=%d,S=%d)");
-	buf.AppendFormat(KTimerOff,iState,iPassState);
-	Client()->LogMessage(buf);
-#endif*/
-	switch (iPassState)
-		{
-		case EWaitForSwitchOff:
-			SetPassState(EWaitForEnter);
-			break;
-		case EWaitForSwitchOff2:
-			SetPassState(EWaitForSwitchOff3);
-			break;
-		case EWaitForSwitchOff3:
-			SetPassState(EWaitForSwitchOff4);
-			break;
-		case EWaitForSwitchOff4:
-			{
-			SetPassState(EWaitForSwitchOff5);
-			TTime time;
-			time.HomeTime();
-			time+=TTimeIntervalHours(24);
-			User::SetHomeTime(time);
-			}
-			break;
-		case EWaitForSwitchOff5:
-			SetPassState(EWaitForEnter2);
-			break;
-		default:;
-		}
-	}
-
-void CPasswordTest::PasswordMsgReceivedL()
-	{
-	TestL(iPassWin->BaseWin()->OrdinalPosition()==0);
-	if (iPassState==EWaitForSwitchOff3 || iPassState==EWaitForSwitchOff4)
-		Fail(3);
-	}
-
-void CPasswordTest::EnterKeyPressed(TPasswordState aNewState)
-	{
-	iPassWin->BaseWin()->SetOrdinalPosition(-1);
-	SetPassState(aNewState);
-	Client()->iWs.PasswordEntered();
-	}
-
-void CPasswordTest::TestComplete(TPasswordState aNewState)
-	{
-	Request();
-	SetPassState(aNewState);
-	iPassState=aNewState;
-	}
-
-void CPasswordTest::ConstructL()
-	{
-	iGroup2=new(ELeave) CPasswordWindowGroup2(Client(),this);
-	iGroup2->ConstructL();
-	iGroup=new(ELeave) CPasswordWindowGroup(Client(),this);
-	iGroup->ConstructL();
-	iPassWin=new(ELeave) CPasswordWindow(this);
-	iPassWin->ConstructL(*iGroup);
-	iPassWin->AssignGC(*Client()->iGc);
-	iPassWin->Activate();
-	iBlankWin=new(ELeave) CTBlankWindow();
-	iBlankWin->ConstructL(*iGroup);
-	iBlankWin->SetVisible(EFalse);
-	iBlankWin->Activate();
-	iState=ENotStarted;
-	}
-
-void CPasswordTest::StartMainPasswordTestL()
-	{
-	if (iPassWin->BaseWin()->PasswordWindow(EPasswordAlways)!=KErrNone)
-		{
-		DisplayDialog(_L("Can't do password tests"),_L("Password window"),_L("already exists"), Client()->iGroup->GroupWin());
-		AbortL();
-		}
-	SetPassState(EWaitForSwitchOff);
-	}
-
-void CPasswordTest::StartOnceADayPasswordTestL()
-	{
-	TestL(iPassWin->BaseWin()->PasswordWindow(EPasswordOnceADay)==KErrNone);
-	}
-
-TestState CPasswordTest::DoTestL()
-	{
-	if (iPasswordTestFailed)
-		TestL(ETrue);
-	switch(iState)
-		{
-		case 0:
-			LogSubTest(_L("Password 1"),1);
-			StartMainPasswordTestL();
-			iState++;
-			return(EContinue);
-		case 1:
-			LogSubTest(_L("Password 2"),2);
-			StartOnceADayPasswordTestL();
-			iState++;
-			return(EContinue);
-		default:
-			return(EFinished);
-		}
-	}
--- a/windowing/windowserver/tman/TTEXT.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,265 +0,0 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Print some text, to be checked by eye
-// 
-//
-
-#include <e32std.h>
-#include <e32svr.h>
-#include "W32STD.H"
-#include "../tlib/testbase.h"
-#include "TMAN.H"
-
-class TTextTest;
-
-enum {EDrawModeFonts,EDrawModeCharJust,EDrawModeWordJust};
-
-_LIT(KTestFontTypefaceName,"DejaVu Sans Condensed");
-
-class CTextWindow : public CTWin
-	{
-public:
-	CTextWindow(TTextTest *aTest);
-	void SetUpLD(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
-	void Draw();
-	void WinKeyL(const TKeyEvent &aKey,const TTime &aTime);
-	void ResetPrintLine();
-	void Print(const CFont *aFont, const TDesC &aText);
-	void PrintLine(const CFont *aFont, const TDesC &aText);
-	void PrintDivider();
-	void PrintStylesL(const TDesC &aText, TFontSpec &aFontSpec, const TFontStyle &aFontStyle);
-	void DrawCharJustified(const TDesC &aText);
-	void DrawWordJustified(const TDesC &aText);
-	TBool NextPage();
-	void SetDrawMode(TInt aMode);
-private:
-	TInt iDrawMode;
-	TTextTest *iTest;
-	CFbsFont *iTmpFont;
-	TInt iNumTypeFaces;
-	TInt iTypeFaceIndex;
-	TInt iXStartPos;
-	TInt iYpos;
-	TInt iXpos;
-	};
-
-class TTextTest : public CTestBase
-	{
-public:
-	TTextTest();
-	~TTextTest();
-	TestState DoTestL();
-	void ConstructL();
-private:
-	CTextWindow *iWin;
-	TSize iWinSize;
-	TInt iState;
-	};
-
-GLDEF_C CTestBase *CreateTextTest()
-	{
-	return(new(ELeave) TTextTest());
-	}
-
-CTextWindow::CTextWindow(TTextTest *aTest) : CTWin(), iDrawMode(EDrawModeWordJust), iTest(aTest)
-	{}
-
-void CTextWindow::SetUpLD(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc)
-	{
-	ConstructExtLD(*parent,pos,size);
-	Activate();
-	AssignGC(aGc);
-	iNumTypeFaces=Client()->iScreen->NumTypefaces();
-	}
-
-void CTextWindow::ResetPrintLine()
-	{
-	iXpos=iXStartPos=5;
-	iYpos=2;
-	}
-
-void CTextWindow::PrintDivider()
-	{
-	iGc->DrawLine(TPoint(0,iYpos+5),TPoint(Size().iWidth,iYpos+5));
-	iYpos+=10;
-	}
-
-void CTextWindow::Print(const CFont *aFont, const TDesC &aText)
-	{
-	iGc->DrawText(aText, TPoint(iXpos, iYpos+aFont->AscentInPixels()));
-	iXpos+=aFont->TextWidthInPixels(aText);
-	}
-
-void CTextWindow::PrintLine(const CFont *aFont, const TDesC &aText)
-	{
-	iGc->DrawText(aText, TPoint(iXpos, iYpos+aFont->AscentInPixels()));
-	iXpos=iXStartPos;
-	iYpos+=aFont->HeightInPixels()+2;
-	}
-
-TBool CTextWindow::NextPage()
-	{
-	if (iTypeFaceIndex==(iNumTypeFaces-1))
-		return(ETrue);
-	++iTypeFaceIndex;
-	return(EFalse);
-	}
-
-void CTextWindow::PrintStylesL(const TDesC &aText, TFontSpec &aFontSpec, const TFontStyle &aFontStyle)
-	{
-	aFontSpec.iFontStyle=aFontStyle;
-	User::LeaveIfError(Client()->iScreen->GetNearestFontToDesignHeightInTwips((CFont *&)iTmpFont, aFontSpec));
-	iGc->UseFont(iTmpFont);
-	Print(iTmpFont,aText);
-	iGc->SetUnderlineStyle(EUnderlineOn);
-	Print(iTmpFont,_L("Underline, "));
-	iGc->SetStrikethroughStyle(EStrikethroughOn);
-	Print(iTmpFont,_L("Strikethrough/underline, "));
-	iGc->SetUnderlineStyle(EUnderlineOff);
-	PrintLine(iTmpFont,_L("Strikethrough"));
-	iGc->SetStrikethroughStyle(EStrikethroughOff);
-	Client()->iScreen->ReleaseFont(iTmpFont);
-	iTmpFont=NULL;
-	}
-
-void CTextWindow::DrawCharJustified(const TDesC &aText)
-	{
-	iGc->SetCharJustification(Size().iWidth-10-iTmpFont->TextWidthInPixels(aText),aText.Length()-1);
-	PrintLine(iTmpFont, aText);
-	}
-
-void CTextWindow::DrawWordJustified(const TDesC &aText)
-	{
-	TInt count=0;
-	for(TInt index=0;index<aText.Length();index++)
-		if (aText[index]==' ')
-			count++;
-	iGc->SetWordJustification(Size().iWidth-10-iTmpFont->TextWidthInPixels(aText),count);
-	PrintLine(iTmpFont, aText);
-	}
-
-void CTextWindow::Draw()
-//This function is virtual and so cannot have an 'L' at the end of it's name
-	{
-	iGc->Clear();
-	ResetPrintLine();
-	switch(iDrawMode)
-		{
-	case EDrawModeWordJust:
-		User::LeaveIfError(Client()->iScreen->GetNearestFontToDesignHeightInTwips((CFont *&)iTmpFont, TFontSpec(KTestFontTypefaceName,200)));
-		iGc->UseFont(iTmpFont);
-		DrawWordJustified(_L("Hello World"));
-		DrawWordJustified(_L("One Two Three Four Five Six Seven"));
-		DrawWordJustified(_L("AA    B        CC D"));
-		DrawWordJustified(_L("ONEWORD"));
-		iGc->DiscardFont();
-		Client()->iScreen->ReleaseFont(iTmpFont);
-		iTmpFont=NULL;
-		break;
-	case EDrawModeCharJust:
-		User::LeaveIfError(Client()->iScreen->GetNearestFontToDesignHeightInTwips((CFont *&)iTmpFont, TFontSpec(KTestFontTypefaceName,200)));
-		iGc->UseFont(iTmpFont);
-		DrawCharJustified(_L("Hello World"));
-		DrawCharJustified(_L("One Two Three Four Five Six Seven"));
-		DrawCharJustified(_L("AA    B        CC D"));
-		DrawCharJustified(_L("ONEWORD"));
-		iGc->DiscardFont();
-		Client()->iScreen->ReleaseFont(iTmpFont);
-		iTmpFont=NULL;
-		break;
-	case EDrawModeFonts:
-		{
-		TTypefaceSupport typefaceSupport;
-		Client()->iScreen->TypefaceSupport(typefaceSupport,iTypeFaceIndex);
-		TBuf<0x40> title;
-		TBuf16<KMaxTypefaceNameLength> tmpBuf;
-		tmpBuf.Copy(typefaceSupport.iTypeface.iName);
-		title.Append(tmpBuf);
-		title.AppendFormat(TRefByValue<const TDesC>(_L(", Heights (Min=%d, Max=%d, Num=%d)")),typefaceSupport.iMinHeightInTwips,typefaceSupport.iMaxHeightInTwips,typefaceSupport.iNumHeights);
-		PrintLine(iFont,title);
-		PrintDivider();
-		for (TInt tfHeight=0;tfHeight<typefaceSupport.iNumHeights;tfHeight++)
-			{
-			TFontSpec fspec(typefaceSupport.iTypeface.iName,Client()->iScreen->FontHeightInTwips(iTypeFaceIndex,tfHeight));
-			PrintStylesL(_L("Normal, "), fspec, TFontStyle());
-			PrintStylesL(_L("Bold, "), fspec, TFontStyle(EPostureUpright,EStrokeWeightBold,EPrintPosNormal));
-			PrintStylesL(_L("Italic, "), fspec, TFontStyle(EPostureItalic,EStrokeWeightNormal,EPrintPosNormal));
-			PrintStylesL(_L("Bold/italic, "), fspec, TFontStyle(EPostureItalic,EStrokeWeightBold,EPrintPosNormal));
-			if (iYpos>Size().iHeight)
-				break;
-			}
-		}
-		break;
-		}
-	}
-
-void CTextWindow::WinKeyL(const TKeyEvent &aKey,const TTime &)
-	{
-	if (iDrawMode!=EDrawModeFonts || (aKey.iCode==EKeyEscape || NextPage()))
-		CActiveScheduler::Stop();
-	else
-		iWin.Invalidate();
-	}
-
-void CTextWindow::SetDrawMode(TInt aDrawMode)
-	{
-	iDrawMode=aDrawMode;
-	iWin.Invalidate();
-	}
-
-TTextTest::TTextTest() : CTestBase(_L("Text"))
-	{}
-
-TTextTest::~TTextTest()
-	{
-	CTWin::Delete(iWin);
-	}
-
-void TTextTest::ConstructL()
-	{
-	CTextWindow *win=new(ELeave) CTextWindow(this);
-	win->SetUpLD(TPoint(0,0),Client()->iScreen->SizeInPixels(),Client()->iGroup,*Client()->iGc);
-	iWin=win;
-	Client()->iGroup->SetCurrentWindow(iWin);
-	Client()->iGroup->GroupWin()->SetOrdinalPosition(0);
-	}
-
-TestState TTextTest::DoTestL()
-	{
-	switch(iState)
-		{
-		case 0:
-			LogSubTest(_L("SetWordJustification"),1);
-			iWin->SetDrawMode(EDrawModeWordJust);
- 			CActiveScheduler::Start();
-			iState++;
-			break;
-		case 1:
-			LogSubTest(_L("SetCharJustification"),2);
-			iWin->SetDrawMode(EDrawModeCharJust);
-			CActiveScheduler::Start();
-			iState++;
-			break;
-		case 2:
-			LogSubTest(_L("Text 1"),3);
-			iWin->SetDrawMode(EDrawModeFonts);
-			CActiveScheduler::Start();
-			iState++;
-			break;
-		default:
-			return(EFinished);
-		}
-	return(ENext);
-	}
-
--- a/windowing/windowserver/tredir/proxy.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include <ecom/implementationproxy.h>
-#include "redirector.h"
-
-
-LOCAL_C const TImplementationProxy KImplementationTable[] =
-	{
-	IMPLEMENTATION_PROXY_ENTRY(CWsGcRedirector::EImplUid, CWsGcRedirector::NewL)
-	};
-
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
-	{
-	aTableCount = sizeof(KImplementationTable)/sizeof(TImplementationProxy);
-	return KImplementationTable;
-	}
--- a/windowing/windowserver/tredir/redirector.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,374 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "redirector.h"
-#include <fbs.h>
-#include <bitdev.h>
-#include <bitstd.h>
-#include <gdi.h>
-#ifdef __WINS__
-#include "../debuglog/osbwin.h"
-#endif
-
-const TInt KDefaultScreen = 0;
-
-const TUint8 KCmdQuery			= 0;
-const TUint8 KCmdSetGcFront 	= 1;
-const TUint8 KCmdSetGcBack  	= 2;
-const TUint8 KCmdResetGcFront	= 3;
-const TUint8 KCmdResetGcBack 	= 4;
-const TUint8 KCmdSetBackObject 	= 5;
-const TUint8 KCmdResetBackObject= 6;
-
-const TUint8 KRedirectorInfoSig = 0x7e;
-
-NONSHARABLE_STRUCT(TRedirectorInfo)
-	{
-	TUint8 iSignature;
-	TAny* iFrontBufferInterface;
-	TAny* iBackBufferInterface;
-	TAny* iScreenConfigInterface;
-	TInt iScreenBitmapHandle;
-	TInt iFlickerBitmapHandle; 
-	TInt iUpdateCounter;
-	};
-
-NONSHARABLE_STRUCT(TWsBackBuffer): public MWsBackBuffer
-	{
-public:
-	TWsBackBuffer(CFbsBitmap* aBit,CFbsBitGc* aGc): iBit(aBit), iGc(aGc)
-		{}
-	virtual CFbsBitmap* GetBitmap() 
-		{return iBit;}
-	virtual CFbsBitGc* GetBitGc() 
-		{return iGc;}
-	virtual TInt SetBitGc(CFbsBitGc*)
-		{return KErrNotSupported;}
-	virtual TInt RedirectTo(MWsBackBuffer*)
-		{return KErrNotSupported;}
-	virtual void SetObserver(MWsFlickerFreeBufferObserver* /*aObserver*/)
-		{ASSERT(0);}
-	virtual MWsFlickerFreeBufferObserver* Observer()
-		{
-		 ASSERT(0);
-		 return NULL;
-		}
-	virtual CFbsBitGc* GetBitGcCurrent()
-		{
-		ASSERT(0);
-		return NULL;
-		}
-
-private:
-	CFbsBitmap* iBit;
-	CFbsBitGc* iGc;	
-	};
-
-//
-CWsGcRedirector* CWsGcRedirector::NewL()
-	{
-	return new(ELeave) CWsGcRedirector;	
-	}
-	
-CWsGcRedirector::~CWsGcRedirector()
-	{
-#ifdef __WINS__
-	delete iFrontWin;
-	delete iBackWin;
-	delete iUpdateDebugWinsTimer;
-#endif
-
-	if (iFrontBuf)
-		iFrontBuf->SetBitGc(NULL);
-	if (iBackBuf)
-		iBackBuf->SetBitGc(NULL);
-	
-	delete iFrontGc;
-	delete iFrontDev;
-	delete iFrontBit;
-	delete iBackGc;
-	delete iBackDev;
-	delete iBackBit;
-	delete iBadGc;
-	delete iBackObj;
-	}
-	
-void CWsGcRedirector::ConstructL(MWsGraphicDrawerEnvironment& aEnv, const TGraphicDrawerId& aId, MWsClient& aOwner, const TDesC8& aData)
-	{
-	BaseConstructL(aEnv, aId, aOwner);
-
-#ifdef __WINS__
-	if (aData.Length()>1)
-		iDisableWin = aData[1]==1;
-#endif
-	iScreenId = KDefaultScreen;
-	if (aData.Length()>0)
-		iScreenId = aData[0];
-	MWsScreen* scr = aEnv.Screen(iScreenId);
-	User::LeaveIfNull(scr);
-
-	MWsScreenConfig* cfg = scr->ObjectInterface<MWsScreenConfig>();
-	User::LeaveIfNull(cfg);
-
-	iFrontBuf = scr->ObjectInterface<MWsFrontBuffer>();
-	User::LeaveIfNull(iFrontBuf);
-	iBackBuf = scr->ObjectInterface<MWsBackBuffer>();
-	
-	iFrontBit = new(ELeave) CFbsBitmap;
-	iDefaultSize=cfg->SizeInPixels();
-	User::LeaveIfError(iFrontBit->Create(iDefaultSize,EColor64K));
-	iFrontDev = CFbsBitmapDevice::NewL(iFrontBit);
-	User::LeaveIfNull(iFrontDev);
-	User::LeaveIfError(iFrontDev->CreateContext(iFrontGc));
-	
-	User::LeaveIfError(iFrontDev->CreateContext(iBadGc));
-	iBadGc->ChangeDevice(NULL);
-
-#ifdef __WINS__
-	if (!iDisableWin)
-		{
-		iUpdateDebugWinsTimer = CPeriodic::NewL(0);
-		iUpdateDebugWinsTimer->Start(0, 300 * 1000, TCallBack(UpdateDebugWindowsCallback, this));
-
-		_LIT(KRedFront, "RedFront");
-		iFrontWin = CDebugOsbWin::NewL(KRedFront, iFrontBit->SizeInPixels());
-		}
-#endif	
-
-	if (iBackBuf)
-		{
-		CFbsBitmap* bit = iBackBuf->GetBitmap();
-		User::LeaveIfNull(bit);
-		iBackBit = new(ELeave) CFbsBitmap;
-		User::LeaveIfError(iBackBit->Create(bit->SizeInPixels(),EColor64K));
-		iBackDev = CFbsBitmapDevice::NewL(iBackBit);
-		User::LeaveIfNull(iBackDev);
-		User::LeaveIfError(iBackDev->CreateContext(iBackGc));
-		
-		iBackObj = new(ELeave) TWsBackBuffer(iBackBit,iBackGc);
-#ifdef __WINS__		
-		if (!iDisableWin)
-			{
-			_LIT(KRedBack, "RedBack");
-			iBackWin = CDebugOsbWin::NewL(KRedBack, iBackBit->SizeInPixels());
-			}
-#endif		
-		}
-		
-	// compile check, non-const interface access
-	MWsGraphicDrawerEnvironment& ee = Env();
-	MWsScreen* ss = ee.Screen(iScreenId);
-	MWsScreenConfig* cc = ss->ObjectInterface<MWsScreenConfig>();
-	}
-
-void CWsGcRedirector::HandleMessage(const TDesC8& aData)
-	{
-	// wserv already check data size, and won't invoke this handler if it's empty
-	TBuf8<1> ack;
-	ack.Append(KRedirectorInfoSig);
-	
-	switch (aData[0])
-		{
-		case KCmdQuery:
-		SendInfo();
-		break;
-		
-		case KCmdSetGcFront:
-		Env().RegisterEventHandler(this,this,TWservCrEvent::EScreenUpdated|TWservCrEvent::EScreenOrientationChanged|TWservCrEvent::EDeviceOrientationChanged);
-
-		// -test bad gc
-		__ASSERT_ALWAYS(iFrontBuf->SetBitGc(iBadGc)==KErrArgument, User::Invariant());	
-		// -test bad gc
-		__ASSERT_ALWAYS(iFrontBuf->SetBitGc(iBadGc,ETrue)==KErrArgument, User::Invariant());
-		// +test
-		__ASSERT_ALWAYS(iFrontBuf->SetBitGc(iFrontGc,EFalse)==KErrNone, User::Invariant());
-		// -test duplicate calls
-		__ASSERT_ALWAYS(iFrontBuf->SetBitGc(iFrontGc)==KErrAlreadyExists, User::Invariant());
-		
-		SendMessage(ack);
-		break;
-		
-		case KCmdSetGcBack:
-		if (iBackBuf)
-			{
-			// -test bad gc
-			__ASSERT_ALWAYS(iBackBuf->SetBitGc(iBadGc)==KErrArgument, User::Invariant());
-			// +test
-			__ASSERT_ALWAYS(iBackBuf->SetBitGc(iBackGc)==KErrNone, User::Invariant());
-			// -test duplicate calls
-			__ASSERT_ALWAYS(iBackBuf->SetBitGc(iBackGc)==KErrAlreadyExists, User::Invariant());
-			// -test double redirection
-			__ASSERT_ALWAYS(iBackBuf->RedirectTo(iBackObj)==KErrInUse, User::Invariant());
-			}
-		SendMessage(ack);
-		break;
-		
-		case KCmdResetGcFront:
-		Env().UnregisterEventHandler(this);
-		iUpdateCounter = 0;
-
-		__ASSERT_ALWAYS(iFrontBuf->SetBitGc(NULL,EFalse)==KErrNone, User::Invariant());
-		// -test duplicate calls
-		__ASSERT_ALWAYS(iFrontBuf->SetBitGc(NULL,EFalse)==KErrNone, User::Invariant());
-		SendMessage(ack);
-		break;
-		
-		case KCmdResetGcBack:
-		if (iBackBuf)
-			{
-			// +test
-			__ASSERT_ALWAYS(iBackBuf->SetBitGc(NULL)==KErrNone, User::Invariant());
-			// -test duplicate calls
-			__ASSERT_ALWAYS(iBackBuf->SetBitGc(NULL)==KErrNone, User::Invariant());
-			}
-		SendMessage(ack);
-		break;
-
-		case KCmdSetBackObject:
-		if (iBackBuf)
-			{
-			TWsBackBuffer badObj1(NULL,iBackGc);
-			// -test bad obj (null bitmap)
-			__ASSERT_ALWAYS(iBackBuf->RedirectTo(&badObj1)==KErrArgument, User::Invariant());
-			// -test bad obj (null gc)
-			TWsBackBuffer badObj2(iBackBit,NULL);
-			__ASSERT_ALWAYS(iBackBuf->RedirectTo(&badObj2)==KErrArgument, User::Invariant());			
-			// -test bad obj (null device)
-			TWsBackBuffer badObj3(iBackBit,iBadGc);			
-			__ASSERT_ALWAYS(iBackBuf->RedirectTo(&badObj3)==KErrArgument, User::Invariant());
-			// +test
-			__ASSERT_ALWAYS(iBackBuf->RedirectTo(iBackObj)==KErrNone, User::Invariant());
-			// -test duplicate calls
-			__ASSERT_ALWAYS(iBackBuf->RedirectTo(iBackObj)==KErrAlreadyExists, User::Invariant());
-			// -test double redirection
-			__ASSERT_ALWAYS(iBackBuf->SetBitGc(iBackGc)==KErrInUse, User::Invariant());
-			}
-		SendMessage(ack);
-		break;
-
-		case KCmdResetBackObject:
-		if (iBackBuf)
-			{
-			// +test
-			__ASSERT_ALWAYS(iBackBuf->RedirectTo(NULL)==KErrNone, User::Invariant());
-			// -test duplicate calls
-			__ASSERT_ALWAYS(iBackBuf->RedirectTo(NULL)==KErrNone, User::Invariant());
-			}
-		SendMessage(ack);
-		break;
-		}
-	}
-	
-void CWsGcRedirector::DoDraw(MWsGc& aGc, const TRect& aRect, const TDesC8& aData) const
-	{
-	aGc.PushBitGcSettings();
-	CFbsBitGc& bc = aGc.BitGc();	
-	bc.SetBrushStyle(CGraphicsContext::ESolidBrush);
-	bc.SetBrushColor(TRgb(255,0,0,128));
-	bc.DrawRect(aRect);
-	TGraphicDrawerId id;
-	id.iId = 0x10281fb6;
-	id.iIsUid = ETrue;
-	const CWsGraphicDrawer* listener = Env().ResolveGraphic(id);
-	if (listener)
-		listener->Draw(aGc, aRect, aData);
-	aGc.PopBitGcSettings();
-	
-	// compile check, const interface access
-	const MWsGraphicDrawerEnvironment& env = Env(); // Env() const
-	const MWsScreen* scr = env.Screen(iScreenId); // Screen(TInt) const
-	const MWsScreenConfig* cfg = scr->ObjectInterface<MWsScreenConfig>(); // ObjectInterface() const
-	}
-
-void CWsGcRedirector::SendInfo()
-	{
-	TPckgBuf<TRedirectorInfo> buf;
-	MWsScreen* scr = Env().Screen(iScreenId);
-	if (scr)
-		{
-		buf().iSignature = KRedirectorInfoSig;
-		buf().iFrontBufferInterface = scr->ObjectInterface<MWsFrontBuffer>();
-		buf().iBackBufferInterface = scr->ObjectInterface<MWsBackBuffer>();
-		buf().iScreenConfigInterface = scr->ObjectInterface<MWsScreenConfig>();
-		buf().iScreenBitmapHandle = iFrontBit->Handle();
-		buf().iFlickerBitmapHandle = iBackBit? iBackBit->Handle() : 0;
-		buf().iUpdateCounter = iUpdateCounter;
-		}
-	TInt err = SendMessage(buf);
-	__ASSERT_ALWAYS(err>=KErrNone, User::Invariant());
-	}
-
-void CWsGcRedirector::DoHandleEvent(const TWservCrEvent& aEvent)
-	{
-	if (aEvent.ScreenNumber()==iScreenId)
-		{
-		switch(aEvent.Type())
-			{
-		case TWservCrEvent::EScreenUpdated:
-			++iUpdateCounter;
-			break;
-		case TWservCrEvent::EDeviceOrientationChanged:
-		case TWservCrEvent::EScreenOrientationChanged:
-			{
-			CFbsBitGc::TGraphicsOrientation orientation=aEvent.Orientation();
-			TSize bmpSize;
-			if (orientation==CFbsBitGc::EGraphicsOrientationNormal || orientation==CFbsBitGc::EGraphicsOrientationRotated180)
-				bmpSize=iDefaultSize;
-			else
-				bmpSize.SetSize(iDefaultSize.iHeight,iDefaultSize.iWidth);
-			const TSize fBufSize(iFrontBit->SizeInPixels());
-			if (fBufSize!=bmpSize)
-				{
-				__ASSERT_DEBUG(fBufSize.iWidth==bmpSize.iHeight && fBufSize.iHeight==bmpSize.iWidth, User::Invariant());
-				iFrontDev->SwapWidthAndHeight();
-				iFrontGc->Activate(iFrontDev);
-				}
-			}
-			break;
-			}
-		}
-	}
-
-#ifdef __WINS__
-TInt CWsGcRedirector::UpdateDebugWindowsCallback(TAny* aSelf)
-	{
-	CWsGcRedirector* self = static_cast<CWsGcRedirector*>(aSelf);
-	if(!self)
-		return KErrArgument;
-
-	if(self->iFrontWin && self->iFrontBit)
-		{
-		CFbsBitmap* bitmap = self->iFrontBit;
-		bitmap->LockHeap();
-		self->iFrontWin->Refresh(bitmap->SizeInPixels(), bitmap->DisplayMode(), bitmap->DataAddress());
-		bitmap->UnlockHeap();
-		}
-
-	if(self->iBackWin && self->iBackBit)
-		{
-		CFbsBitmap* bitmap = self->iBackBit;
-		bitmap->LockHeap();
-		self->iBackWin->Refresh(bitmap->SizeInPixels(), bitmap->DisplayMode(), bitmap->DataAddress());
-		bitmap->UnlockHeap();
-		}
-	return KErrNone;
-	}
-#endif
--- a/windowing/windowserver/tredir/redirector.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __REDIRECTOR_H__
-#define __REDIRECTOR_H__
-
-#include "Graphics/WSGRAPHICDRAWER.H"
-#include <Graphics/WSGRAPHICDRAWERINTERFACE.H>
-
-class CFbsBitmap;
-class CFbsBitmapDevice;
-class CFbsBitGc;
-#ifdef __WINS__
-class CDebugOsbWin;
-#endif
-
-class TWsBackBuffer;
-
-NONSHARABLE_CLASS(CWsGcRedirector): public CWsGraphicDrawer, public MWsEventHandler
-	{
-public:
-	enum {EImplUid = 0x10281e1e};	
-		
-public:		
-	static CWsGcRedirector* NewL();
-	virtual ~CWsGcRedirector();
-
-	// override CWsGraphicDrawer
-	virtual void ConstructL(MWsGraphicDrawerEnvironment& aEnv,const TGraphicDrawerId& aId, MWsClient& aOwner, const TDesC8& aData);
-	virtual void HandleMessage(const TDesC8& aData);
-	virtual void DoHandleEvent(const TWservCrEvent& aEvent);
-private:
-	// override CWsGraphicDrawer
-	virtual void DoDraw(MWsGc& aGc, const TRect& aRect, const TDesC8& aData) const;
-	void SendInfo();
-	void OnScreenUpdated();
-#ifdef __WINS__
-	static TInt UpdateDebugWindowsCallback(TAny* aSelf);
-#endif
-	
-private:
-	MWsFrontBuffer* iFrontBuf;
-	MWsBackBuffer* iBackBuf;
-	CFbsBitmap* iFrontBit;
-	CFbsBitmapDevice* iFrontDev;
-	CFbsBitGc* iFrontGc;
-	CFbsBitmap* iBackBit;
-	CFbsBitmapDevice* iBackDev;
-	CFbsBitGc* iBackGc;
-	CFbsBitGc* iBadGc;
-	TWsBackBuffer* iBackObj;
-#ifdef __WINS__
-	CDebugOsbWin* iFrontWin;
-	CDebugOsbWin* iBackWin;
-	CPeriodic* iUpdateDebugWinsTimer;
-	TBool iDisableWin;
-#endif
-	TInt iScreenId;
-	TInt iUpdateCounter;
-	TSize iDefaultSize;
-	};
-
-#endif
--- a/windowing/windowserver/tredir/redirector.rss	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include <ecom/registryinfo.rh>
-
-RESOURCE REGISTRY_INFO registry_info
-	{
-	dll_uid = 0x10281e1c;
-	interfaces =
-		{
-		INTERFACE_INFO
-			{
-			interface_uid = 0x10281e1d;
-			implementations =
-				{
-				IMPLEMENTATION_INFO
-					{
-					implementation_uid = 0x10281e1e;
-					version_no = 1;
-					display_name = "CWsGcRedirector";
-					default_data = "";
-					opaque_data = "";
-					}
-				};
-			}
-		};
-	}
--- a/windowing/windowserver/tredir/wsredir.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,129 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include "wsredir.h"
-
-const TUint8 KCmdQuery			= 0;
-const TUint8 KCmdSetGcFront 	= 1;
-const TUint8 KCmdSetGcBack  	= 2;
-const TUint8 KCmdResetGcFront	= 3;
-const TUint8 KCmdResetGcBack 	= 4;
-const TUint8 KCmdSetBackObject 	= 5;
-const TUint8 KCmdResetBackObject= 6;
-
-const TUid KRedirectorInterfaceId = {0x10281e1d};
-const TUid KRedirectorImplId = {0x10281e1e};
-
-EXPORT_C CWsRedir* CWsRedir::NewL()
-	{
-	return NewL(0);
-	}
-
-EXPORT_C CWsRedir* CWsRedir::NewL(TInt aScreenId)
-	{
-	return NewL(aScreenId, EFalse);
-	}
-
-EXPORT_C CWsRedir* CWsRedir::NewL(TInt aScreenId, TBool aDisableWin)
-	{
-	CWsRedir* self = new(ELeave) CWsRedir;
-	CleanupStack::PushL(self);
-	TBuf8<2> data;
-	data.Append((TUint8)aScreenId);
-	data.Append((TUint8)aDisableWin);
-	self->BaseConstructL(KRedirectorInterfaceId, KRedirectorImplId, data);
-	CleanupStack::Pop(self);
-	self->iIsReady = ETrue;
-	return self;
-	}
-
-EXPORT_C CWsRedir::~CWsRedir()
-	{
-	iIsReady = EFalse;
-	}
-
-void CWsRedir::HandleMessage(const TDesC8& aData)
-	{
-	if (aData.Size()>1 && aData[0]==KRedirectorInfoSig)
-		Mem::Copy(iReq, aData.Ptr(), aData.Size());
-	iCallBack.CallBack();
-	}
-
-void CWsRedir::OnReplace()
-	{
-	}
-
-EXPORT_C TInt CWsRedir::Redirect(TBufferType aWhich, TBool aHow)
-	{
-	if (!iIsReady)
-		return KErrNotReady;
-	
-	TBuf8<1> cmd;
-	if (aWhich==EFrontBuffer)
-		{
-		if (iIsFrontRedirected && aHow)
-			return KErrArgument;
-		iIsFrontRedirected = aHow;
-		cmd.Append(iIsFrontRedirected? KCmdSetGcFront : KCmdResetGcFront);
-		}
-	else
-		{
-		if (iIsBackRedirected && aHow)
-			return KErrArgument;
-		iIsBackRedirected = aHow;
-		cmd.Append(iIsBackRedirected? KCmdSetGcBack : KCmdResetGcBack);
-		}
-		
-	SendMessage(cmd);
-	return Flush();
-	}
-
-EXPORT_C TInt CWsRedir::RedirectUsingWsBackBuffer(TBool aHow)
-	{
-	if (!iIsReady)
-		return KErrNotReady;
-	
-	TBuf8<1> cmd;
-	if (iIsBackRedirected && aHow)
-		return KErrArgument;
-	iIsBackRedirected = aHow;
-	cmd.Append(iIsBackRedirected? KCmdSetBackObject : KCmdResetBackObject);
-		
-	SendMessage(cmd);
-	return Flush();
-	}
-	
-EXPORT_C TInt CWsRedir::QueryPlugin(TRedirectorInfo& aInfo)	
-	{
-	TBuf8<1> cmd;
-	cmd.Append(KCmdQuery);
-	SendMessage(cmd);
-	TInt err = Flush();
-	if (err!=KErrNone)
-		return err;
-	iReq = &aInfo;
-	return KErrNone;
-	}
-
-EXPORT_C void CWsRedir::SetCallBack(TCallBack aCallBack)
-	{
-	iCallBack = aCallBack;
-	}
--- a/windowing/windowserver/tredir/wsredir.h	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#ifndef __WSREDIR_H__
-#define __WSREDIR_H__
-
-#include <w32std.h>
-
-const TUint8 KRedirectorInfoSig = 0x7e;
-
-NONSHARABLE_STRUCT(TRedirectorInfo)
-	{
-	TUint8 iSignature;
-	TAny* iFrontBufferInterface;
-	TAny* iBackBufferInterface;
-	TAny* iScreenConfigInterface;
-	TInt iScreenBitmapHandle;
-	TInt iFlickerBitmapHandle; 
-	TInt iUpdateCounter;
-	};
-
-NONSHARABLE_CLASS(CWsRedir): public CWsGraphic
-	{
-public:
-	enum TBufferType
-		{
-		EFrontBuffer,
-		EBackBuffer
-		};
-public:		
-	IMPORT_C static CWsRedir* NewL();
-	IMPORT_C static CWsRedir* NewL(TInt aScreenId);
-	IMPORT_C static CWsRedir* NewL(TInt aScreenId, TBool aDisableWin);	
-	IMPORT_C ~CWsRedir();
-	IMPORT_C TInt Redirect(TBufferType aWhich, TBool aHow);
-	IMPORT_C TInt RedirectUsingWsBackBuffer(TBool aHow);
-	IMPORT_C TInt QueryPlugin(TRedirectorInfo& aInfo);
-	IMPORT_C void SetCallBack(TCallBack aCallBack);
-private:
-	// override CWsGraphic
-	virtual void HandleMessage(const TDesC8& aData);
-	virtual void OnReplace();
-private:
-	TBool iIsFrontRedirected;
-	TBool iIsBackRedirected;
-	TBool iIsReady;
-	TRedirectorInfo* iReq;
-	TCallBack iCallBack;
-	};
-
-#endif
--- a/windowing/windowserver/ttime/TTDRWBIT.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// used for timing text printing
-// 
-//
-
-#include "ttime.h"
-
--- a/windowing/windowserver/ttime/TTGENRAL.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,352 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// used for timing graphics
-// 
-//
-
-#include "TTIME.H"
-
-#define TEST_ROM_BITMAP_NAME _L("Z:\\WSTEST\\TROM.MBM")
-
-enum TFuncType
-	{
-	ESimpleFlush,
-	ESpriteSetting,
-	EBitmapDevice,
-	ETrivialFunctions,
-	ELoadBitmap,
-	};
-
-class TWsTest : public CBase
-	{
-public:
-	void DoTestL(TInt aOwningGroup, TFuncType aFunc, TInt aParam1, TAny *aParam2);
-	void SimpleFlush(TInt aParam1, TAny *aParam2);
-	void SpriteSettingL(TInt aParam1, TAny *aParam2);
-	void BitmapDeviceL(TInt aParam, TAny *);
-	void TrivialFunctions(TInt aParam1, TAny *aParam2);
-	void LoadBitmapL(TInt aParam1, TAny *aParam2);
-private:
-	void createSpriteBitmapL(CFbsBitmap *aBitmap, CFbsBitmapDevice *&aBitmapDevice, const TSize &aSize, TBool aDoMask);
-private:
-	RWsSession iWs;
-	RWindowGroup iGroup;
-	RWindow iWindow;
-	CWsScreenDevice *iDevice;
-	CWindowGc *iGc;
-	};
-	
-TInt CreateWsTest(TInt aOwningGroup, TFuncType aFunc, TInt aParam1, TAny *aParam2)
-	{
-	TWsTest *iTest=NULL;
-	TRAPD(err,iTest=new(ELeave) TWsTest());
-	if (err==KErrNone)
-		{
-		TRAP(err,iTest->DoTestL(aOwningGroup, aFunc, aParam1, aParam2));
-		delete iTest;
-		}
-	return(err);
-	}
-
-void TWsTest::DoTestL(TInt aOwningGroup, TFuncType aFunc, TInt aParam1, TAny *aParam2)
-	{
-	iWs.Connect();
-	iDevice=new(ELeave) CWsScreenDevice(iWs);
-	iDevice->Construct();
-	iGroup=RWindowGroup(iWs);
-	iGroup.Construct(ENullWsHandle);
-	iGroup.SetOwningWindowGroup(aOwningGroup);
-//
-	iWindow=RWindow(iWs);
-	iWindow.Construct(iGroup,ENullWsHandle);
-	iWindow.SetExtent(TPoint(), iDevice->SizeInPixels());
-	iWindow.Activate();
-//
-	iDevice->CreateContext(iGc);
-	iWindow.BeginRedraw();
-	iGc->Activate(iWindow);
-	iGc->Clear();
-	iWindow.EndRedraw();
-//
-	switch(aFunc)
-		{
-		case ESimpleFlush:
-			SimpleFlush(aParam1, aParam2);
-			break;
-		case ESpriteSetting:
-			SpriteSettingL(aParam1, aParam2);
-			break;
-		case EBitmapDevice:
-			BitmapDeviceL(aParam1, aParam2);
-			break;
-		case ETrivialFunctions:
-			TrivialFunctions(aParam1, aParam2);
-			break;
-		case ELoadBitmap:
-			LoadBitmapL(aParam1, aParam2);
-			break;
-		default:;
-		}
-	delete iGc;
-	iWindow.Close();
-	iGroup.Close();
-	delete iDevice;
-	iWs.Close();
-	}
-
-// Flush //
-
-void TWsTest::SimpleFlush(TInt aParam, TAny *)
-	{
-	TTimeIntervalMicroSeconds32 interval(100000);
-	TInt distance=10;
-	if (aParam==0)
-		{
-		TTimeIntervalMicroSeconds32 origInterval;
-		TInt origDistance;
-		iWs.GetDoubleClickSettings(origInterval,origDistance);
-		for(TInt nTimes=0;nTimes<5000-1;nTimes++)
-			{
-			iWs.SetDoubleClick(interval,distance);
-			iWs.Flush();
-			}
-		iWs.SetDoubleClick(origInterval,origDistance);
-		}
-	else
-		{
-		for(TInt nTimes=0;nTimes<5000;nTimes++)
-			iWs.GetDoubleClickSettings(interval,distance);
-		}
-	}
-
-TInt SimpleFlushTestFunc(TInt aOwningGroup)
-	{
-	return(CreateWsTest(aOwningGroup, ESimpleFlush, 0, NULL));
-	}
-
-TInt SimpleFlushTestFunc2(TInt aOwningGroup)
-	{
-	return(CreateWsTest(aOwningGroup, ESimpleFlush, 1, NULL));
-	}
-
-GLDEF_D TTimeTestHeader SimpleFlushTest={_S("Simple Flush[1] x5000"),SimpleFlushTestFunc};
-GLDEF_D TTimeTestHeader SimpleFlushTest2={_S("Simple Flush[2] x5000"),SimpleFlushTestFunc2};
-
-// IP Read/Write //
-
-#if 0
-TInt ReadWriteThreadFunc(TAny *aParams)
-	{
-	TWinCommand command;
-	RProcess().CommandLine(command);
-	TDesC8 *cmd=&command;
-	RThread thread;
-	thread.Open(_L("TimeTest"));
-	TAny *remotePtr=*(TAny **)aCmd->Ptr();
-	TBuf<0x10> buf;
-	for(TInt count=0;count<100000;count++)
-		thread.ReadL(remotePtr,buf,0);
-	}
-
-void TWsTest::IPReadWriteL(TInt aParam, TAny *)
-	{
-	TBuf<0x10> srcData;
-	srcData.Append(_L("1234567890ABCDEF"));
-	RProcess process;
-	TWinCommand command;
-	*((TAny **)command.Ptr())=&srcData;
-	User::LeaveIfError(process.Create(_L("TimeThread1"),);
-	TRequestStatus status;
-	process.Logon(status);
-	process.Resume();
-	User::WaitForRequest(status);
-	process.Close();
-	}
-
-TInt SimpleFlushTestFunc(TInt aOwningGroup)
-	{
-	return(CreateWsTest(aOwningGroup, ESimpleFlush, 0, NULL));
-	}
-
-TInt SimpleFlushTestFunc2(TInt aOwningGroup)
-	{
-	return(CreateWsTest(aOwningGroup, ESimpleFlush, 1, NULL));
-	}
-
-GLDEF_D TTimeTestHeader SimpleFlushTest={_S("Simple Flush[1] x5000"),SimpleFlushTestFunc};
-GLDEF_D TTimeTestHeader SimpleFlushTest2={_S("Simple Flush[2] x5000"),SimpleFlushTestFunc2};
-#endif
-// Bitmap device //
-
-void TWsTest::BitmapDeviceL(TInt aParam, TAny *)
-	{
-	CFbsBitmap *bitmap=new(ELeave) CFbsBitmap();
-	User::LeaveIfError(bitmap->Create(TSize(10,10),EGray4));
-	CFbsBitmapDevice *bitmapDevicePerm=NULL;
-	if (aParam==1)
-		bitmapDevicePerm=CFbsBitmapDevice::NewL(bitmap);
-	for(TInt nTimes=0;nTimes<100;nTimes++)
-		{
-		CFbsBitmapDevice *bitmapDevice=CFbsBitmapDevice::NewL(bitmap);
-		delete bitmapDevice;
-		}
-	delete bitmapDevicePerm;
-	delete bitmap;
-	}
-
-TInt BitmapDeviceTestFunc1(TInt aOwningGroup)
-	{
-	return(CreateWsTest(aOwningGroup, EBitmapDevice, 0, NULL));
-	}
-
-TInt BitmapDeviceTestFunc2(TInt aOwningGroup)
-	{
-	return(CreateWsTest(aOwningGroup, EBitmapDevice, 1, NULL));
-	}
-
-GLDEF_D TTimeTestHeader BitmapDeviceTest1={_S("Bitmap Device (reload)"),BitmapDeviceTestFunc1};
-GLDEF_D TTimeTestHeader BitmapDeviceTest2={_S("Bitmap Device "),BitmapDeviceTestFunc2};
-
-// Sprite Setting //
-
-void TWsTest::createSpriteBitmapL(CFbsBitmap *aBitmap, CFbsBitmapDevice *&aBitmapDevice, const TSize &aSize, TBool aDoMask)
-	{
-	User::LeaveIfError(aBitmap->Create(aSize,EGray4));
-	aBitmapDevice=CFbsBitmapDevice::NewL(aBitmap);
-	CFbsBitGc *gc=CFbsBitGc::NewL();
-	gc->Activate(aBitmapDevice);
-	gc->SetBrushColor(TRgb::Gray4(aDoMask ? 0 : 2));
-	gc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	gc->SetPenStyle(CGraphicsContext::ENullPen);
-	gc->DrawRect(TRect(aSize));
-	gc->SetPenStyle(CGraphicsContext::ESolidPen);
-	gc->SetPenColor(TRgb::Gray4(aDoMask ? 3 : 0));
-	gc->SetBrushColor(TRgb::Gray4(aDoMask ? 3 : 1));
-	gc->DrawEllipse(TRect(aSize));
-	delete gc;
-	}
-
-void TWsTest::SpriteSettingL(TInt , TAny *)
-	{
-	RWsSprite sprite;
-	TSize size(32,32);
-	sprite=RWsSprite(iWs);
-	CFbsBitmap *bitmap=new(ELeave) CFbsBitmap();
-	CFbsBitmap *mask=new(ELeave) CFbsBitmap();
-	CFbsBitmapDevice *bitmapDevice=NULL;		//To stop warning
-	TRAPD(err,createSpriteBitmapL(bitmap,bitmapDevice,size,EFalse));
-	delete bitmapDevice;
-	TRAP(err,createSpriteBitmapL(mask,bitmapDevice,size,ETrue));
-	delete bitmapDevice;
-	TSpriteMember spriteData;
-	spriteData.iBitmap=bitmap;
-	spriteData.iMaskBitmap=mask;
-	spriteData.iInvertMask=EFalse;
-	spriteData.iInterval=TTimeIntervalMicroSeconds32(0);
-	User::LeaveIfError(sprite.Construct(iWindow,TPoint(0,0),0));
-	User::LeaveIfError(sprite.AppendMember(spriteData));
-	User::LeaveIfError(sprite.Activate());
-	for(TInt i=0;i<500;i++)
-		sprite.SetPosition(TPoint(i&0x7f,i&0x7f));
-	sprite.Close();
-	delete mask;
-	delete bitmap;
-	}
-
-TInt SpriteSettingTestFunc(TInt aOwningGroup)
-	{
-	return(CreateWsTest(aOwningGroup, ESpriteSetting, 0, NULL));
-	}
-
-GLDEF_D TTimeTestHeader SpriteTest={_S("Sprite Setting"),SpriteSettingTestFunc};
-
-void TWsTest::TrivialFunctions(TInt , TAny *)
-	{
-	for(TInt i=0;i<100000;i++)
-		iWs.FreeSystemPointerCursorList();
-	}
-
-TInt TrivialFunctionsTestFunc(TInt aOwningGroup)
-	{
-	return(CreateWsTest(aOwningGroup, ETrivialFunctions, 0, NULL));
-	}
-
-GLDEF_D TTimeTestHeader TrivialFunctionsTest={_S("TrivialFunctions"),TrivialFunctionsTestFunc};
-
-void TWsTest::LoadBitmapL(TInt aMode, TAny *)
-	{
-	if (aMode<2)
-		{
-		for(TInt count=0;count<10;count++)
-			{
-			if (aMode==0)
-				{
-				CFbsBitmap *bit=new(ELeave) CFbsBitmap();
-				User::LeaveIfError(bit->Load(TEST_ROM_BITMAP_NAME,0));
-				delete bit;
-				}
-			else
-				{
-				CWsBitmap *bit=new(ELeave) CWsBitmap(iWs);
-				User::LeaveIfError(bit->Load(TEST_ROM_BITMAP_NAME,0));
-				delete bit;
-				}
-			}
-		}
-	else for(TInt count=0;count<100;count++)
-		{
-	//__PROFILE_START(1)
-		RFs fs;
-		User::LeaveIfError(fs.Connect());
-		fs.SetNotifyUser(EFalse);
-	//__PROFILE_END(1)
-	//__PROFILE_START(2)
-		TParse parse;
-		User::LeaveIfError(fs.Parse(TEST_ROM_BITMAP_NAME,parse));
-	//__PROFILE_END(2)
-	//__PROFILE_START(3)
-		TInt drive;
-		User::LeaveIfError(RFs::CharToDrive(parse.Drive()[0],drive));
-		TDriveInfo driveinfo;
-		User::LeaveIfError(fs.Drive(driveinfo,drive));
-	//__PROFILE_END(3)
-	//__PROFILE_START(4)
-		RFile tempfile;
-		User::LeaveIfError(tempfile.Open(fs,TEST_ROM_BITMAP_NAME,EFileShareAny));
-		TInt aAddress;
-		tempfile.Seek(ESeekAddress,aAddress);
-	//__PROFILE_END(4)
-	//__PROFILE_START(5)
-		tempfile.Close();
-		fs.Close();
-	//__PROFILE_END(5)
-		}
-	}
-
-TInt LoadBitmapTestFunc(TInt aOwningGroup)
-	{
-	return(CreateWsTest(aOwningGroup, ELoadBitmap, 0, NULL));
-	}
-TInt LoadWsBitmapTestFunc(TInt aOwningGroup)
-	{
-	return(CreateWsTest(aOwningGroup, ELoadBitmap, 1, NULL));
-	}
-TInt LoadRomFileTestFunc(TInt aOwningGroup)
-	{
-	return(CreateWsTest(aOwningGroup, ELoadBitmap, 3, NULL));
-	}
-
-GLDEF_D TTimeTestHeader BitmapLoadTest={_S("Load Bitmap"),LoadBitmapTestFunc};
-GLDEF_D TTimeTestHeader WsBitmapLoadTest={_S("Load WsBitmap"),LoadWsBitmapTestFunc};
-GLDEF_D TTimeTestHeader RomFileTest={_S("Rom File"),LoadRomFileTestFunc};
--- a/windowing/windowserver/ttime/TTGRAPH.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,443 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// used for timing graphics
-// 
-//
-
-#include "TTIME.H"
-
-#define TEST_BITMAP_NAME _L("Z:\\WSTEST\\TEST.MBM")
-
-GLREF_C void Panic(TInt aPanic);
-
-enum TFuncType
-	{
-	EBitmapTest,
-	EXorTest,
-	ESmallClearTest,
-	ERectCompareTest,
-	EUseFontTest,
-	EBitBltTest,
-	EFullScreenBitBltTest,
-	EMaskedBitBltTest,
-	EFillPatternTest,
-	EBackupWindowDrawingTest,
-	};
-
-class TGraphicsTest : public CBase
-	{
-public:
-	void DoTestL(TInt aOwningGroup, TFuncType aFunc, TInt aParam1, TAny *aParam2);
-	void DrawBitmapTestL(TInt aParam1, TAny *aParam2);
-	void XorTest(TInt aParam1, TAny *aParam2);
-	void SmallClearTest(TInt , TAny *);
-	void RectCompareTest(TInt , TAny *);
-	void UseFontTestL(TInt , TAny *);
-	void BitBltTestL(TInt , TAny *);
-	void FullScreenBitBltTestL(TInt , TAny *);
-	void MaskedBitBltTestL(TInt , TAny *);
-	void FillPatternTestL(TInt , TAny *);
-	void BackedUpWindowDrawingL(TInt aMode, TAny *);
-private:
-	RWsSession iWs;
-	CWsScreenDevice *iDevice;
-	RWindowGroup iGroup;
-	RWindow iWindow;
-	RBackedUpWindow iBackedUpWindow;
-	RDrawableWindow *iWindowPtr;
-	CWindowGc *iGc;
-	};
-	
-TInt CreateGraphicsTest(TInt aOwningGroup, TFuncType aFunc, TInt aParam1, TAny *aParam2)
-	{
-	TGraphicsTest *iTest=NULL;
-	TRAPD(err,iTest=new(ELeave) TGraphicsTest());
-	if (err==KErrNone)
-		{
-		TRAP(err,iTest->DoTestL(aOwningGroup, aFunc, aParam1, aParam2));
-		delete iTest;
-		}
-	return(err);
-	}
-
-void TGraphicsTest::DoTestL(TInt aOwningGroup, TFuncType aFunc, TInt aParam1, TAny *aParam2)
-	{
-	iWs.Connect();
-	iDevice=new(ELeave) CWsScreenDevice(iWs);
-	iDevice->Construct();
-	iGroup=RWindowGroup(iWs);
-	iGroup.Construct(ENullWsHandle);
-	iGroup.SetOwningWindowGroup(aOwningGroup);
-//
-	if (aFunc==EBackupWindowDrawingTest)
-		{
-		iBackedUpWindow=RBackedUpWindow(iWs);
-		iWindowPtr=&iBackedUpWindow;
-		iBackedUpWindow.Construct(iGroup,EGray4,ENullWsHandle);
-		}
-	else
-		{
-		iWindow=RWindow(iWs);
-		iWindowPtr=&iWindow;
-		iWindow.Construct(iGroup,ENullWsHandle);
-		}
-	User::LeaveIfError(iWindowPtr->SetExtentErr(TPoint(), iDevice->SizeInPixels()));
-	iWindowPtr->Activate();
-	//
-	iDevice->CreateContext(iGc);
-	iGc->Activate(*iWindowPtr);
-	if (iWindowPtr==&iWindow)
-		{
-		iWindow.BeginRedraw();
-		iGc->Clear();
-		iWindow.EndRedraw();
-		}
-	switch(aFunc)
-		{
-		case EBitmapTest:
-			DrawBitmapTestL(aParam1, aParam2);
-			break;
-		case EXorTest:
-			XorTest(aParam1, aParam2);
-			break;
-		case ESmallClearTest:
-			SmallClearTest(aParam1, aParam2);
-			break;
-		case ERectCompareTest:
-			RectCompareTest(aParam1, aParam2);
-			break;
-		case EUseFontTest:
-			UseFontTestL(aParam1, aParam2);
-			break;
-		case EBitBltTest:
-			BitBltTestL(aParam1, aParam2);
-			break;
-		case EFullScreenBitBltTest:
-			FullScreenBitBltTestL(aParam1, aParam2);
-			break;
-		case EMaskedBitBltTest:
-			MaskedBitBltTestL(aParam1, aParam2);
-			break;
-		case EFillPatternTest:
-			FillPatternTestL(aParam1, aParam2);
-			break;
-		case EBackupWindowDrawingTest:
-			BackedUpWindowDrawingL(aParam1, aParam2);
-			break;
-		default:;
-		}
-//
-	delete iGc;
-	iWindowPtr->Close();
-	iGroup.Close();
-	delete iDevice;
-	iWs.Close();
-	}
-
-// Draw bitmap //
-
-void TGraphicsTest::DrawBitmapTestL(TInt , TAny *)
-	{
-	CFbsBitmap *bitmap=new(ELeave) CFbsBitmap;
-	User::LeaveIfError(bitmap->Load(TEST_BITMAP_NAME,0));
-	for(TInt nTimes=0;nTimes<10;nTimes++)
-		{
-		iGc->Clear();
-		TSize size(iDevice->SizeInPixels());
-		iGc->DrawBitmap(TRect(-size.iWidth,-size.iHeight,size.iWidth<<1,size.iHeight<<1),bitmap);
-		iWs.Flush();
-		}
-	delete bitmap;
-	}
-
-TInt DrawBitmapTestFunc(TInt aOwningGroup)
-	{
-	return(CreateGraphicsTest(aOwningGroup, EBitmapTest, 0, NULL));
-	}
-
-GLDEF_D TTimeTestHeader DrawBitmapTest={_S("Draw bitmap"),DrawBitmapTestFunc};
-
-// XOR Test //
-
-void TGraphicsTest::XorTest(TInt , TAny *)
-	{
-	iGc->SetDrawMode(CGraphicsContext::EDrawModeXOR);
-	iGc->SetBrushColor(TRgb::Gray256(255));
-	iGc->SetPenStyle(CGraphicsContext::ENullPen);
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	for(TInt count=0;count<10;count++)
-		{
-		for(TInt wid=1;wid<320;wid+=3)
-			{
-			iGc->DrawRect(TRect(10,10,10+wid,150));
-	//		iWs.Flush();
-			}
-		}
-	}
-
-TInt XorIngTestFunc(TInt aOwningGroup)
-	{
-	return(CreateGraphicsTest(aOwningGroup, EXorTest, 0, NULL));
-	}
-
-GLDEF_D TTimeTestHeader XorIngTest={_S("Xor'ing"),XorIngTestFunc};
-
-// XOR Test //
-
-void TGraphicsTest::SmallClearTest(TInt , TAny *)
-	{
-	iGc->SetBrushColor(TRgb::Gray256(255));
-	iGc->SetPenStyle(CGraphicsContext::ENullPen);
-	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	for(TInt count=0;count<500;count++)
-		{
-		for(TInt wid=1;wid<30;wid++)
-			{
-			iGc->DrawRect(TRect(1,0,10+wid,100));
-//			iWs.Flush();
-			}
-		}
-	}
-
-TInt SmallClearTestFunc(TInt aOwningGroup)
-	{
-	return(CreateGraphicsTest(aOwningGroup, ESmallClearTest, 0, NULL));
-	}
-
-GLDEF_D TTimeTestHeader SmallClearTest={_S("Small clear rect"),SmallClearTestFunc};
-
-// XOR Test //
-
-enum {EMaxWidth=100};
-
-void TGraphicsTest::RectCompareTest(TInt , TAny *)
-	{
-	TSize size(iDevice->SizeInPixels());
-	for(TInt count=0;count<10;count++)
-		iDevice->RectCompare(TRect(0,0,size.iWidth>>1,size.iHeight),TRect(size.iWidth>>1,0,size.iWidth,size.iHeight));
-	}
-
-TInt RectCompareTestFunc(TInt aOwningGroup)
-	{
-	return(CreateGraphicsTest(aOwningGroup, ERectCompareTest, 0, NULL));
-	}
-
-GLDEF_D TTimeTestHeader RectCompareTest={_S("RectCompare"),RectCompareTestFunc};
-
-// Use Font //
-
-void TGraphicsTest::UseFontTestL(TInt , TAny *)
-	{
-	CFbsFont *font;
-	TFontSpec fspec(KTestFontTypefaceName,200);
-	User::LeaveIfError(iDevice->GetNearestFontToDesignHeightInTwips((CFont *&)font, fspec));
-	for(TInt count=0;count<1000;count++)
-		iGc->UseFont(font);
-	iDevice->ReleaseFont(font);
-	}
-
-TInt UseFontTestFunc(TInt aOwningGroup)
-	{
-	return(CreateGraphicsTest(aOwningGroup, EUseFontTest, 0, NULL));
-	}
-
-GLDEF_D TTimeTestHeader UseFontTest={_S("UseFont(x1000)"),UseFontTestFunc};
-
-// Small BitBlt //
-
-void TGraphicsTest::BitBltTestL(TInt , TAny *)
-	{
-	CWsBitmap *bitmap=new(ELeave) CWsBitmap(iWs);
-	TSize size(25,50);
-	bitmap->Create(size,EGray4);
-	CFbsDevice *bitmapDevice=CFbsBitmapDevice::NewL(bitmap);
-	CFbsBitGc *gc=CFbsBitGc::NewL();
-	gc->Activate(bitmapDevice);
-	gc->DrawEllipse(TRect(size));
-	delete gc;
-	delete bitmapDevice;
-	for(TInt count=0;count<10;count++)
-		{
-		iGc->Clear();
-		TPoint pos(0,0);
-		for(TInt xcount=0;xcount<25;xcount++,pos.iX+=size.iWidth)
-			{
-			pos.iY=0;
-			for(TInt ycount=0;ycount<4;ycount++,pos.iY+=size.iHeight)
-				iGc->BitBlt(pos,bitmap);
-			}
-		}
-	delete bitmap;
-	}
-
-TInt BitBltTestFunc(TInt aOwningGroup)
-	{
-	return(CreateGraphicsTest(aOwningGroup, EBitBltTest, 0, NULL));
-	}
-
-GLDEF_D TTimeTestHeader BitBltTest={_S("BitBlt"),BitBltTestFunc};
-
-// Full Screen BitBlt //
-
-void TGraphicsTest::FullScreenBitBltTestL(TInt , TAny *)
-	{
-	CWsBitmap *bitmap=new(ELeave) CWsBitmap(iWs);
-	TSize size(640,240);
-	User::LeaveIfError(bitmap->Create(size,EGray4));
-	CFbsDevice *bitmapDevice=CFbsBitmapDevice::NewL(bitmap);
-	CFbsBitGc *gc=CFbsBitGc::NewL();
-	gc->Activate(bitmapDevice);
-	for(TInt pos=0;pos<size.iWidth;pos+=8)
-		{
-		gc->DrawRect(TRect(pos,0,pos+16,size.iHeight));
-		iGc->BitBlt(TPoint(0,0),bitmap);
-		iWs.Flush();
-		}
-	delete gc;
-	delete bitmapDevice;
-	delete bitmap;
-	}
-
-TInt FullScreenBitBltTestFunc(TInt aOwningGroup)
-	{
-	return(CreateGraphicsTest(aOwningGroup, EFullScreenBitBltTest, 0, NULL));
-	}
-
-GLDEF_D TTimeTestHeader FullScreenBitBltTest={_S("FullScreenBitBlt"),FullScreenBitBltTestFunc};
-
-// Masked BitBlt //
-
-void TGraphicsTest::MaskedBitBltTestL(TInt , TAny *)
-	{
-	TSize size(24,48);
-	CWsBitmap *bitmap=new(ELeave) CWsBitmap(iWs);
-	bitmap->Create(size,EGray4);
-	CFbsDevice *bitmapDevice=CFbsBitmapDevice::NewL(bitmap);
-	CFbsBitGc *gc=CFbsBitGc::NewL();
-	gc->Activate(bitmapDevice);
-	gc->DrawEllipse(TRect(size));
-	delete bitmapDevice;
-// Now do the mask
-	CWsBitmap *mask=new(ELeave) CWsBitmap(iWs);
-	mask->Create(size,EGray4);
-	bitmapDevice=CFbsBitmapDevice::NewL(mask);
-	gc->Activate(bitmapDevice);
-	gc->SetPenColor(TRgb::Gray4(3));
-	gc->DrawEllipse(TRect(size));
-	delete bitmapDevice;
-//
-	delete gc;
-	for(TInt count=0;count<10;count++)
-		{
-		iGc->Clear();
-		TPoint pos(0,0);
-		for(TInt xcount=0;xcount<25;xcount++,pos.iX+=size.iWidth+1)
-			{
-			pos.iY=0;
-			for(TInt ycount=0;ycount<4;ycount++,pos.iY+=size.iHeight)
-				iGc->BitBltMasked(pos,bitmap,TRect(size),mask,EFalse);
-			}
-		}
-	delete bitmap;
-	delete mask;
-	}
-
-TInt MaskedBitBltTestFunc(TInt aOwningGroup)
-	{
-	return(CreateGraphicsTest(aOwningGroup, EMaskedBitBltTest, 0, NULL));
-	}
-
-GLDEF_D TTimeTestHeader MaskedBitBltTest={_S("MaskedBitBlt"),MaskedBitBltTestFunc};
-
-// Fill Pattern //
-
-void TGraphicsTest::FillPatternTestL(TInt , TAny *)
-	{
-	TSize scrSize(iDevice->SizeInPixels());
-	TSize rectSize(scrSize.iWidth/5-1,scrSize.iHeight/2);
-
-	CWsBitmap *bitmap=new(ELeave) CWsBitmap(iWs);
-
-	TSize bitmapSize(50,40);
-	bitmap->Create(bitmapSize,EGray4);
-	CFbsDevice *bitmapDevice=CFbsBitmapDevice::NewL(bitmap);
-	CFbsBitGc *gc=CFbsBitGc::NewL();
-	gc->Activate(bitmapDevice);
-	gc->SetBrushColor(TRgb::Gray4(2));
-	gc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-	gc->DrawEllipse(TRect(bitmapSize));
-	delete bitmapDevice;
-	delete gc;
-//
-	iGc->UseBrushPattern(bitmap);
-	iGc->SetBrushStyle(CGraphicsContext::EPatternedBrush);
-	iGc->SetPenStyle(CGraphicsContext::ESolidPen);
-	for(TInt count=0;count<50;count++)
-		{
-		iGc->Clear();
-		TPoint pos(0,0);
-		for(TInt xcount=0;xcount<5;xcount++,pos.iX+=rectSize.iWidth)
-			{
-			pos.iY=0;
-			for(TInt ycount=0;ycount<2;ycount++,pos.iY+=rectSize.iHeight)
-				iGc->DrawRect(TRect(pos,rectSize));
-			}
-		}
-	delete bitmap;
-	}
-
-TInt FillPatternTestFunc(TInt aOwningGroup)
-	{
-	return(CreateGraphicsTest(aOwningGroup, EFillPatternTest, 0, NULL));
-	}
-
-GLDEF_D TTimeTestHeader FillPatternTest={_S("FillPattern"),FillPatternTestFunc};
-
-// Backup Window Drawing //
-
-void TGraphicsTest::BackedUpWindowDrawingL(TInt aMode, TAny *)
-	{
-	TSize scrSize(iDevice->SizeInPixels());
-	CFbsFont *font=NULL;
-	if (aMode==1)
-		{
-		TFontSpec fspec(KTestFontTypefaceName,200);
-		User::LeaveIfError(iDevice->GetNearestFontToDesignHeightInTwips((CFont *&)font, fspec));
-		iGc->UseFont(font);
-		}
-	iGc->SetPenStyle(CGraphicsContext::ESolidPen);
-	TPoint pos;
-	for(TInt count=0;count<10;count++)
-		{
-		iGc->Clear();
-		for(pos.iY=0;pos.iY<scrSize.iHeight;pos.iY++)
-			iGc->DrawLine(pos,pos+TSize(scrSize.iWidth,0));
-		}
-	if (aMode==1)
-		iDevice->ReleaseFont(font);
-	}
-
-TInt BackupWindowDrawingFunc1(TInt aOwningGroup)
-	{
-	return(CreateGraphicsTest(aOwningGroup, EBackupWindowDrawingTest, 0, NULL));
-	}
-
-GLDEF_D TTimeTestHeader BackupWindowDrawingCreate1={_S("BackupWindowDrawing 1"),BackupWindowDrawingFunc1};
-
-TInt BackupWindowDrawingFunc2(TInt aOwningGroup)
-	{
-	return(CreateGraphicsTest(aOwningGroup, EBackupWindowDrawingTest, 1, NULL));
-	}
-
-GLDEF_D TTimeTestHeader BackupWindowDrawingCreate2={_S("BackupWindowDrawing 2"),BackupWindowDrawingFunc2};
--- a/windowing/windowserver/ttime/TTIME.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,554 +0,0 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Functions to act as bench marks for various window server features
-// 
-//
-
-#include "TTIME.H"
-#include <e32svr.h>
-#include <e32def_private.h>
-typedef TBuf<32> TestNameBuf;
-
-LOCAL_D const TUint KHeapSize=0x10000;
-
-class CTimeClient;
-
-class CResultDialog : public CTDialog
-	{		  
-public:
-	CResultDialog(CTWindowGroup *aGroupWin,CWindowGc *aGc);
-	void ButtonPressL(TInt aButton);
-	void ConstructLD();
-private:
-	CTWindowGroup *iGroupWin;
-	CWindowGc *iGc;
-	};
-
-class CListWindow : public CTTitledWindow
-	{
-public:
-	CListWindow();
-	void CloseWindow();
-	void ConstructL(CTWinBase &parent, TBool aExitOnEscape);
-	void Draw();
-	virtual void SelectedL(TInt aIndex)=0;
-	virtual void WinKeyL(const TKeyEvent &aKey,const TTime& aTime);
-	void SetExt(const TPoint &aPos, const TSize &aSize);
-	void SetSize(const TSize &);
-protected:
-	virtual TPtrC GetText(TInt aLine)=0;
-	virtual TInt ListCount()=0;
-	void SetSize();
-private:
-	void Resized(const TSize &aSize);
-	void SetListPos(TInt aNewPos);
-	TInt TextRowHeight() const;
-	void RowBox(TRect &aRect, TInt aRow) const;
-	void PointerL(const TPointerEvent &aPointer,const TTime& aTime);
-private:
-	TInt iListPos;
-	TTime iPrevTime;
-	TBool iExitOnEscape;
-	};
-
-class CTestList : public CListWindow
-	{
-public:
-	CTestList();
-	~CTestList();
-	void ConstructL(CTWinBase &parent);
-	static void AppendProfileNum(TDes &aDes, TInt aNum);
-	static void AppendProfileCount(TDes &aDes, TInt aNum);
-	void SelectedL(TInt aIndex);
-	virtual void WinKeyL(const TKeyEvent &aKey,const TTime& aTime);
-	void ForegroundAppDialog();
-	void AppendToListL(const TDesC &aDesc);
-private:
-	virtual TPtrC GetText(TInt aLine);
-	virtual TInt ListCount();
-private:
-	TInt iCount;
-	CArrayFixSeg<TestNameBuf> iTestNames;
-	RThread iTimeTest;
-	};
-
-class CTimeTestWindowGroup : public CTWindowGroup
-	{
-public:
-	CTimeTestWindowGroup(CTClient *aClient);
-	void KeyL(const TKeyEvent &aKey,const TTime &aTime);
-	};
-
-class CTimeClient : public CTClient
-	{
-public:
-	CTimeClient();
-	void ConstructL();
-	void KeyL(const TKeyEvent &aKey,const TTime &aTime);
-	void Exit();
-	CTWin *CreateTestWindowL(TPoint pos,CTWinBase *parent);
-private:
-	TInt iNum;
-	};
-
-const TInt Xmove=8;
-const TInt Ymove=6;
-
-GLREF_D TTimeTestHeader MovingWindowTest1;
-GLREF_D TTimeTestHeader MovingWindowTest2;
-GLREF_D TTimeTestHeader StackedWindowCreate;
-GLREF_D TTimeTestHeader WindowCreateDestroy;
-GLREF_D TTimeTestHeader LoadsaText;
-GLREF_D TTimeTestHeader DrawBitmapTest;
-GLREF_D TTimeTestHeader XorIngTest;
-GLREF_D TTimeTestHeader SmallClearTest;
-GLREF_D TTimeTestHeader RectCompareTest;
-GLREF_D TTimeTestHeader SimpleFlushTest;
-GLREF_D TTimeTestHeader SimpleFlushTest2;
-GLREF_D TTimeTestHeader UseFontTest;
-GLREF_D TTimeTestHeader BitBltTest;
-GLREF_D TTimeTestHeader FullScreenBitBltTest;
-GLREF_D TTimeTestHeader MaskedBitBltTest;
-GLREF_D TTimeTestHeader SpriteTest;
-GLREF_D TTimeTestHeader BitmapDeviceTest1;
-GLREF_D TTimeTestHeader BitmapDeviceTest2;
-GLREF_D TTimeTestHeader FillPatternTest;
-GLREF_D TTimeTestHeader BitmapLoadTest;
-GLREF_D TTimeTestHeader WsBitmapLoadTest;
-GLREF_D TTimeTestHeader RomFileTest;
-GLREF_D TTimeTestHeader TrivialFunctionsTest;
-GLREF_D TTimeTestHeader BackupWindowDrawingCreate1;
-GLREF_D TTimeTestHeader BackupWindowDrawingCreate2;
-GLREF_D TTimeTestHeader MenuEmulationCreate;
-GLREF_D TTimeTestHeader MenuEmulationCreate2;
-
-TTimeTestHeader *tests[]={
-	&MenuEmulationCreate,
-	&MenuEmulationCreate2,
-	&BitmapLoadTest,
-	&WsBitmapLoadTest,
-	&RomFileTest,
-	&TrivialFunctionsTest,
-	&BackupWindowDrawingCreate1,
-	&BackupWindowDrawingCreate2,
-	&MovingWindowTest1,
-	&MovingWindowTest2,
-	&StackedWindowCreate,
-//	&WindowCreateDestroy,
-	&LoadsaText,
-	&DrawBitmapTest,
-//	&BitmapDeviceTest1,
-//	&BitmapDeviceTest2,
-//	&XorIngTest,		List getting too big
-//	&SmallClearTest,	List getting too big
-//	&RectCompareTest,
-	&SpriteTest,
-//	&SimpleFlushTest,
-//	&SimpleFlushTest2,
-//	&UseFontTest,
-	&BitBltTest,
-//	&FullScreenBitBltTest,
-	&MaskedBitBltTest,
-//	&FillPatternTest,
-	};
-
-void Panic(TInt aPanic)
-	{
-	User::Panic(_L("TimeTest"),aPanic);
-	}
-
-struct TThreadParams
-	{
-	TInt iIndex;
-	TInt iGroupId;
-	};
-
-TInt TimeThread(TAny *aParams)
-	{
-	CTrapCleanup* CleanUpStack=CTrapCleanup::New();
-	//__PROFILE_START(0)
-	TInt ret=tests[((TThreadParams *)aParams)->iIndex]->function(((TThreadParams *)aParams)->iGroupId);
-	//__PROFILE_END(0)
-	delete CleanUpStack;
-	return ret;
-	}
-
-//
-// List Window //
-//
-
-CListWindow::CListWindow() : CTTitledWindow(), iPrevTime(0)
-	{
-	}
-
-void CListWindow::CloseWindow()
-	{
-	CTClient *client=((CTimeClient *)Client());
-	delete this;
-	client->ResetFocus();
-	}
-
-void CListWindow::SetExt(const TPoint &aPos, const TSize &)
-	{
-	SetPos(aPos);
-	}
-
-void CListWindow::SetSize(const TSize &)
-	{
-	}
-
-void CListWindow::SetSize()
-	{
-	iSize.iHeight=ListCount()*(iFont->HeightInPixels()+1)+iTitleHeight+2;
-	iSize.iWidth=iFont->TextWidthInPixels(*Client()->Title())+30;
-	for(TInt index=0;index<ListCount();index++)
-		{
-		TInt wid=iFont->TextWidthInPixels(GetText(index));
-		if (wid>iSize.iWidth)
-			iSize.iWidth=wid;
-		}
-	iSize.iWidth+=4;
-	iWin.SetSize(iSize);
-	Resized(iSize);
-	}
-
-void CListWindow::ConstructL(CTWinBase &parent, TBool aExitOnEscape)
-	{
-	iExitOnEscape=aExitOnEscape;
-	CTTitledWindow::ConstructL(parent);
-	}
-
-void CListWindow::SetListPos(TInt aNewPos)
-	{
-	if (aNewPos>=0 && aNewPos<ListCount())
-		{
-		iListPos=aNewPos;
-		Invalidate();
-		}
-	}
-
-void CListWindow::WinKeyL(const TKeyEvent &aKey, const TTime&)
-	{
-	switch(aKey.iCode)
-		{
-		case EKeyUpArrow:
-			SetListPos(iListPos-1);
-			break;
-		case EKeyDownArrow:
-			SetListPos(iListPos+1);
-			break;
-		case EKeyEnter:
-			SelectedL(iListPos);
-			break;
-		case EKeyEscape:		// Fall through from EKeyEnter
-			if (iExitOnEscape)
-				CloseWindow();
-			break;
-		}
-	}
-
-void CListWindow::PointerL(const TPointerEvent &aPointer,const TTime& aTime)
-	{
-	if (aPointer.iType==TPointerEvent::EButton1Down)
-		{
-		TRect rect;
-		for(TInt index=0;index<ListCount();index++)
-			{
-			RowBox(rect,index);
-			if (rect.Contains(aPointer.iPosition))
-				{
-				if (index==iListPos && aPointer.iModifiers&EModifierDoubleClick)
-					SelectedL(iListPos);
-				else
-					{
-					iPrevTime=aTime;
-					SetListPos(index);
-					}
-				return;
-				}
-			}
-		}
-	CTTitledWindow::PointerL(aPointer,aTime);
-	}
-
-TInt CListWindow::TextRowHeight() const
-	{
-	return(iFont->HeightInPixels()+1);
-	}
-
-void CListWindow::RowBox(TRect &aRect, TInt aRow) const
-	{
-	aRect.iTl.iX=2;
-	aRect.iTl.iY=iTitleHeight+TextRowHeight()*aRow;
-	aRect.iBr.iX=iSize.iWidth-2;
-	aRect.iBr.iY=aRect.iTl.iY+TextRowHeight();
-	}
-
-void CListWindow::Draw()
-	{
-	CTTitledWindow::Draw();
-	iGc->SetPenColor(TRgb::Gray16(0));
-	TPoint pos(2,iTitleHeight+iFont->AscentInPixels()+2);
-	TInt gap=TextRowHeight();
-	for(TInt index=0;index<ListCount();index++,pos.iY+=gap)
-		{
-		iGc->DrawText(GetText(index), pos);
-		if (index==iListPos)
-			{
-			iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-			iGc->SetBrushColor(TRgb::Gray256(255));
-			iGc->SetPenStyle(CGraphicsContext::ENullPen);
-			iGc->SetDrawMode(CGraphicsContext::EDrawModeXOR);
-			TRect rect;
-			RowBox(rect,index);
-			iGc->DrawRect(rect);
-			iGc->SetBrushStyle(CGraphicsContext::ENullBrush);
-			iGc->SetPenStyle(CGraphicsContext::ESolidPen);
-			iGc->SetDrawMode(CGraphicsContext::EDrawModePEN);
-			}
-		}
-	}
-
-void CListWindow::Resized(const TSize &aSize)
-	{
-	SetDragRect(TRect(0,0,aSize.iWidth,iTitleHeight));
-	}
-
-//
-// Test list window
-//
-
-CTestList::CTestList() : CListWindow(), iTestNames(4)
-	{
-	}
-
-CTestList::~CTestList()
-	{
-	}
-
-void CTestList::ConstructL(CTWinBase &parent)
-	{
-	CListWindow::ConstructL(parent, EFalse);
-	for(TUint index=0;index<(sizeof(tests)/sizeof(tests[0]));index++)
-		AppendToListL(TPtrC(tests[index]->title));
-	SetSize();
-	/*for(TUint index1=0;index1<(sizeof(tests)/sizeof(tests[0]));index1++)
-		Selected(index1);*/
-	}
-
-void CTestList::AppendProfileNum(TDes &aDes, TInt aNum)
-	{
-	aDes.AppendFormat(_L("%d.%02d, "),aNum/1000000,(aNum%1000000)/10000);
-	}
-
-void CTestList::AppendProfileCount(TDes &aDes, TInt aNum)
-	{
-	aDes.AppendFormat(_L("%d, "),aNum);
-	}
-
-#define USE_PROCESS 1
-
-void CTestList::SelectedL(TInt aIndex)
-	{
-#if USE_PROCESS
-	TThreadParams params;
-	params.iIndex=aIndex;
-	TName name;
-	name.Format(_L("TimeTest-%x"),iCount++);
-	params.iGroupId=Client()->iGroup->GroupWin()->Identifier();
-	User::LeaveIfError(iTimeTest.Create(name,TimeThread,KDefaultStackSize*2,KHeapSize,KHeapSize,&params,EOwnerThread));
-	TRequestStatus status;
-	iTimeTest.Logon(status);
-	__PROFILE_RESET(8);
-	iTimeTest.Resume();
-	User::WaitForRequest(status);
-#else
-	TThreadParams params;
-	params.iIndex=aIndex;
-	TimeThread(&params);
-#endif
-	TBuf<64> buf;
-	TBuf<64> buf2;
-	TBuf<64> buf3;
-	CResultDialog *dialog=new(ELeave) CResultDialog(Client()->iGroup, iGc);
-	dialog->ConstructLD();
-#if USE_PROCESS
-	if (status.Int()==KErrNone)
-		{
-#endif
-#if !defined(__PROFILING__)
-		buf=_L("Profiling information not available");
-#else
-		TProfile profile[6];
-		__PROFILE_DISPLAY(6);
-		for (TInt index=1;index<6;index++)
-			AppendProfileNum(buf2,profile[index].iTime);
-		for (TInt index2=1;index2<6;index2++)
-			AppendProfileCount(buf3,profile[index2].iCount);
-		buf.Format(_L("Time=%d.%2d"),profile[0].iTime/1000000,(profile[0].iTime%1000000)/10000);
-#endif
-		dialog->SetTitle(buf);
-#if USE_PROCESS
-		}
-	else
-		{
-		dialog->SetTitle(_L("Error in test"));
-		buf.Format(_L("Error=%d"),status.Int());
-		buf2=iTimeTest.ExitCategory();
-		}
-#endif
-	dialog->SetLine1(buf2);
-	dialog->SetLine2(buf3);
-	dialog->SetNumButtons(1);
-	dialog->SetButtonText(0,_L("Okay"));
-	if (dialog->Display()!=0)
-		Panic(0);
-	}
-
-TPtrC CTestList::GetText(TInt aLine)
-	{
-	return(TPtrC(iTestNames[aLine]));
-	}
-
-TInt CTestList::ListCount()
-	{
-	return(iTestNames.Count());
-	}
-
-void CTestList::WinKeyL(const TKeyEvent &aKey,const TTime& aTime)
-	{
-	if (aKey.iModifiers&EModifierFunc)
-		{
-		switch(aKey.iCode)
-			{
-			case EKeyLeftArrow:
-				AdjustSize(-Xmove,0,aKey.iModifiers);
-				break;
-			case EKeyRightArrow:
-				AdjustSize(Xmove,0,aKey.iModifiers);
-				break;
-			case EKeyUpArrow:
-				AdjustSize(0,-Ymove,aKey.iModifiers);
-				break;
-			case EKeyDownArrow:
-				AdjustSize(0,Ymove,aKey.iModifiers);
-				break;
-			default:
-				goto not_used;
-			}
-		}
-	else
-		goto not_used;
-	return;
-not_used:
-	CListWindow::WinKeyL(aKey,aTime);
-	}
-
-void CTestList::AppendToListL(const TDesC &aDesc)
-	{
-	TestNameBuf buf(aDesc);	
-	iTestNames.AppendL(buf);
-	}
-
-//
-
-CResultDialog::CResultDialog(CTWindowGroup *aGroupWin,CWindowGc *aGc) : CTDialog(),
-	iGroupWin(aGroupWin),
-	iGc(aGc)
-	{
-	}
-
-void CResultDialog::ButtonPressL(TInt aButton)
-	{
-	if (aButton==0)
-		CTDialog::ButtonPressL(aButton);
-	}
-
-void CResultDialog::ConstructLD()
-	{
-	CTDialog::ConstructLD(*iGroupWin, *iGc);
-	}
-
-//
-// CTimeTestWindowGroup class //
-//
-
-CTimeTestWindowGroup::CTimeTestWindowGroup(CTClient *aClient) : CTWindowGroup(aClient)
-	{
-	}
-
-void CTimeTestWindowGroup::KeyL(const TKeyEvent &aKey,const TTime &aTime)
-	{
-	if (aKey.iModifiers&EModifierFunc)
-		{
-		switch(aKey.iCode)
-			{
-			case 'x':
-				((CTimeClient *)Client())->Exit();
-				break;
-			}
-		}
-	else
-		iCurWin->WinKeyL(aKey,aTime);
-	}
-
-//
-
-CTimeClient::CTimeClient()
-	{
-	}
-
-CTWin *CTimeClient::CreateTestWindowL(TPoint pos,CTWinBase *parent)
-	{
-	CTWin *win=new(ELeave) CTestList();
-	TRAPD(err,win->ConstructL(*parent));
-	if (err!=KErrNone)
-		goto ctw_err;
-	TRAP(err,win->SetPos(pos));
-	if (err!=KErrNone)
-		{
-ctw_err:
-		delete win;
-		User::Leave(err);
-		}
-	win->Activate();
-	win->AssignGC(*iGc);
-	return(win);
-	}
-
-void CTimeClient::ConstructL()
-	{
-	CTClient::ConstructL();
-
-	iGroup=new(ELeave) CTimeTestWindowGroup(this);
-	iGroup->ConstructL();
-
-	CreateTestWindowL(TPoint(30,4),iGroup);
-	iGroup->SetCurrentWindow(iGroup->Child());
-	}
-
-void CTimeClient::Exit()
-	{
-	CActiveScheduler::Stop();
-	}
-
-GLDEF_C CTClient *CreateClientL()
-	{
-	return(new(ELeave) CTimeClient());
-	}
-
-GLDEF_C TInt E32Main()
-	{
-	return(TestLibStartUp(CreateClientL));
-	}
--- a/windowing/windowserver/ttime/TTIME.H	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Header for window server timing tests
-// 
-//
-
-#include <e32std.h>
-#include "W32STD.H"
-#include "../tlib/testbase.h"
-
-enum TTimePanic
-	{
-	TTPanicDisplayMode1,
-	TTPanicDisplayMode2,
-	};
-typedef TInt (*TTimeTestFunction)(TInt aOwningGroup);
-struct TTimeTestHeader
-	{
-	const TText *title;
-	TTimeTestFunction function;
-	};
-
-_LIT(KTestFontTypefaceName,"DejaVu Sans Condensed");
-
--- a/windowing/windowserver/ttime/TTMOVWIN.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,302 +0,0 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Functions to act as bench marks for various window server features
-// 
-//
-
-#include "TTIME.H"
-
-void SetUp(RWindowTreeNode &aParent, RBlankWindow &aBlank, const TPoint &aPos, const TSize &aSize, TInt aColor)
-	{
-	aBlank.Construct(aParent,ENullWsHandle);
-	aBlank.SetColor(TRgb::Gray256(aColor));
-	aBlank.SetExtent(aPos, aSize);
-	aBlank.SetShadowHeight(1);
-	aBlank.Activate();
-	}
-
-void doMovingWindowTest(TInt aMode, TInt aOwningGroup)
-	{
-	RWsSession ws;
-	ws.Connect();
-	CWsScreenDevice *device=new(ELeave) CWsScreenDevice(ws);
-	device->Construct();
-	TPoint pos(10,10);
-	TSize size(100,100);
-	TSize scrSize(device->SizeInPixels());
-	RBlankWindow blank(ws);
-	RWindowGroup group(ws);
-	group.Construct(ENullWsHandle);
-	group.SetOwningWindowGroup(aOwningGroup);
-//
-	RBlankWindow back(ws);
-	SetUp(group, back, TPoint(0,0),TSize(640,240), 255);
-//
-	RBlankWindow blank2(ws);
-	RBlankWindow blank3(ws);
-	RBlankWindow blank4(ws);
-	RBlankWindow blank5(ws);
-	if (aMode==1)
-		{
-		SetUp(group, blank2, TPoint(10,10),TSize(240,150), 128);
-		SetUp(blank2, blank3, TPoint(10,10),TSize(220,130), 255);
-		SetUp(group, blank4, TPoint(340,-10),TSize(200,70), 64);
-		SetUp(group, blank5, TPoint(390,-10),TSize(30,250), 128);
-		}
-//
-	SetUp(group, blank,pos,size, 128);
-//
-	for(pos.iX=10;pos.iX<(scrSize.iWidth-10-size.iWidth);pos.iX+=1)
-		{
-		blank.SetPosition(pos);
-//		ws.Flush();
-		}
-//
-	if (aMode==1)
-		{
-		blank2.Close();
-		blank3.Close();
-		blank4.Close();
-		blank5.Close();
-		}
-	blank.Close();
-	back.Close();
-	group.Close();
-	delete device;
-	ws.Close();
-	}
-
-TInt MovingWindowTest1Func(TInt aOwningGroup)
-	{
-	doMovingWindowTest(0,aOwningGroup);
-	return(KErrNone);
-	}
-
-GLDEF_D TTimeTestHeader MovingWindowTest1={_S("Moving window test 1"),MovingWindowTest1Func};
-
-TInt MovingWindowTest2Func(TInt aOwningGroup)
-	{
-	doMovingWindowTest(1,aOwningGroup);
-	return(KErrNone);
-	}
-
-GLDEF_D TTimeTestHeader MovingWindowTest2={_S("Moving window test 2"),MovingWindowTest2Func};
-
-TInt CreateAndDestroy(TInt aOwningGroup)
-	{
-	RWsSession ws;
-	ws.Connect();
-	CWsScreenDevice *device=new(ELeave) CWsScreenDevice(ws);
-	device->Construct();
-	RWindowGroup group(ws);
-	group.Construct(ENullWsHandle);
-	group.SetOwningWindowGroup(aOwningGroup);
-//
-	for (TInt count=0;count<100;count++)
-		{
-		RBlankWindow blank(ws);
-		blank.Construct(group,ENullWsHandle);
-		blank.SetExtent(TPoint(10,10), TSize(20,20));
-		blank.Activate();
-		blank.Close();
-		}
-	group.Close();
-	delete device;
-	ws.Close();
-	return(KErrNone);
-	}
-
-GLDEF_D TTimeTestHeader WindowCreateDestroy={_S("Window create destroy"),CreateAndDestroy};
-
-//
-
-TInt WindowCreate2(TInt aOwningGroup)
-	{
-enum {KNumWindows=20};
-	RWsSession ws;
-	ws.Connect();
-	CWsScreenDevice *device=new(ELeave) CWsScreenDevice(ws);
-	device->Construct();
-	RWindowGroup group(ws);
-	group.Construct(ENullWsHandle);
-	group.SetOwningWindowGroup(aOwningGroup);
-	RBlankWindow shield(ws);
-	shield.Construct(group,ENullWsHandle);
-	shield.Activate();
-	CWindowGc *gc=new(ELeave) CWindowGc(device);
-	User::LeaveIfError(gc->Construct());
-//
-	for(TInt times=0;times<2;times++)
-		{
-#if 1
-		TSize size(200,100);
-		RBlankWindow win[KNumWindows];
-		TInt count;
-		for (count=0;count<KNumWindows;count++)
-			{
-			win[count]=RBlankWindow(ws);
-			win[count].Construct(group,ENullWsHandle);
-			win[count].SetExtent(TPoint(count<<2,count<<3), size);
-			win[count].SetShadowHeight(1);
-			win[count].SetColor(TRgb::Gray4(count&3));
-			win[count].Activate();
-			}
-#else
-		TSize size(400,200);
-		RBackedUpWindow win[KNumWindows];
-		TInt count;
-		for (count=0;count<KNumWindows;count++)
-			{
-			win[count]=RBackedUpWindow(ws);
-			win[count].Construct(group,EGray2,ENullWsHandle);
-			win[count].SetExtent(TPoint(count<<2,count<<3), size);
-			win[count].SetShadowHeight(1);
-			gc->Activate(win[count]);
-			gc->SetBrushColor(TRgb::Gray4(count&3));
-			gc->Clear();
-			gc->Deactivate();
-			win[count].Activate();
-			}
-#endif
-		ws.Flush();
-		for (count=0;count<KNumWindows;count++)
-			{
-			win[count].SetOrdinalPosition(0);
-			ws.Flush();
-			}
-		for (count=0;count<KNumWindows;count++)
-			{
-			win[count].Close();
-			ws.Flush();
-			}
-		}
-	shield.Close();
-	group.Close();
-	delete device;
-	ws.Close();
-	return(KErrNone);
-	}
-
-GLDEF_D TTimeTestHeader StackedWindowCreate={_S("Stacked window creating"),WindowCreate2};
-
-TInt BackedUpWindowCreateTest(TInt aOwningGroup)
-	{
-	RWsSession ws;
-	ws.Connect();
-	CWsScreenDevice *device=new(ELeave) CWsScreenDevice(ws);
-	device->Construct();
-	RWindowGroup group(ws);
-	group.Construct(ENullWsHandle);
-	group.SetOwningWindowGroup(aOwningGroup);
-	RBlankWindow shield(ws);
-	shield.Construct(group,ENullWsHandle);
-	shield.Activate();
-	CWindowGc *gc=new(ELeave) CWindowGc(device);
-	User::LeaveIfError(gc->Construct());
-//
-	RWindow win;
-	TInt count;
-	for (count=0;count<100;count++)
-		{
-		win=RWindow(ws);
-		win.Construct(group,ENullWsHandle);
-		win.EnableBackup();
-		win.SetExtent(TPoint(10,10), TSize(200,100));
-		win.Activate();
-		ws.Flush();
-		win.Close();
-		}
-	shield.Close();
-	group.Close();
-	delete device;
-	ws.Close();
-	return(KErrNone);
-	}
-
-GLDEF_D TTimeTestHeader BackedUpWindowCreate={_S("Backed up window creating"),BackedUpWindowCreateTest};
-
-TInt BackedUpWindowMenuTest(TInt aOwningGroup)
-//
-// Test designed to emulate menus
-//
-	{
-	RWsSession ws;
-	ws.Connect();
-	CWsScreenDevice *device=new(ELeave) CWsScreenDevice(ws);
-	device->Construct();
-	RWindowGroup group(ws);
-	group.Construct(ENullWsHandle);
-	group.SetOwningWindowGroup(aOwningGroup);
-	RBlankWindow shield(ws);
-	shield.Construct(group,ENullWsHandle);
-	shield.Activate();
-	CWindowGc *gc=new(ELeave) CWindowGc(device);
-	User::LeaveIfError(gc->Construct());
-//
-	RWindow win;
-	win=RWindow(ws);
-	win.Construct(group,ENullWsHandle);
-	win.EnableBackup();
-	win.Activate();
-	TInt count;
-	TInt state=0;
-	for (count=0;count<200;count++)
-		{
-		win.SetVisible(EFalse);
-		if (state==0)
-			{
-			state=1;
-			win.SetExtent(TPoint(10,10), TSize(200,160));
-			}
-		else
-			{
-			state=0;
-			win.SetExtent(TPoint(100,10), TSize(150,200));
-			}
-		win.SetVisible(ETrue);
-		win.BeginRedraw();
-		gc->Activate(win);
-		gc->SetBrushStyle(CGraphicsContext::ESolidBrush);
-		gc->SetBrushColor(TRgb::Gray4((state+1)));
-		gc->Clear();
-		gc->Deactivate();
-		win.EndRedraw();
-		ws.Flush();
-		}
-	win.Close();
-	shield.Close();
-	group.Close();
-	delete device;
-	ws.Close();
-	return(KErrNone);
-	}
-
-GLDEF_D TTimeTestHeader MenuEmulationCreate={_S("Menu emulation"),BackedUpWindowMenuTest};
-
-TInt BackedUpWindowMenuTest2(TInt aOwningGroup)
-	{
-	CFbsBitmap *bitmaps[1000];
-	TInt index;
-	for(index=0;index<1000;index++)
-		{
-		bitmaps[index]=new(ELeave) CFbsBitmap();
-		bitmaps[index]->Create(TSize(10,10),EGray4);
-		}
-	BackedUpWindowMenuTest(aOwningGroup);
-	for(index=0;index<1000;index++)
-		delete bitmaps[index];
-	return(KErrNone);
-	}
-
-GLDEF_D TTimeTestHeader MenuEmulationCreate2={_S("Menu emulation 2"),BackedUpWindowMenuTest2};
--- a/windowing/windowserver/ttime/TTTEXT.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// LOADSTXT.CPP
-// used for timing text printing
-// 
-//
-
-#include "TTIME.H"
-
-TInt LoadsOfText(TInt aOwningGroup)
-	{
-	RWsSession ws;
-	ws.Connect();
-	CWsScreenDevice *device=new(ELeave) CWsScreenDevice(ws);
-	device->Construct();
-	RWindowGroup group(ws);
-	group.Construct(ENullWsHandle);
-	group.SetOwningWindowGroup(aOwningGroup);
-	TSize scrSize(device->SizeInPixels());
-//
-	RWindow window(ws);
-	window.Construct(group,ENullWsHandle);
-	window.SetExtent(TPoint(), scrSize);
-	window.Activate();
-//
-	CWindowGc *gc;
-	device->CreateContext(gc);
-	window.BeginRedraw();
-	gc->Activate(window);
-	gc->Clear();
-	window.EndRedraw();
-	TFontSpec fspec(KTestFontTypefaceName,200);
-	CFbsFont *font;
-	User::LeaveIfError(device->GetNearestFontToDesignHeightInTwips((CFont *&)font, fspec));
-	gc->UseFont(font);
-	TBuf<100> loadsatext(_L("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890zyxwvutsrqponmlkjihgfedcba"));
-	TInt ascent=font->AscentInPixels();
-	TInt fheight=font->HeightInPixels();
-	for(TInt nTimes=0;nTimes<10;nTimes++)
-		{
-		TPoint pos;
-//		for(pos.iY=ascent;pos.iY<scrSize.iHeight;pos.iY+=font->HeightInPixels())
-//			gc->DrawText(loadsatext,pos);
-		for(pos.iY=0;pos.iY<scrSize.iHeight;pos.iY+=fheight)
-			gc->DrawText(loadsatext,TRect(pos,TPoint(scrSize.iWidth,pos.iY+fheight)),ascent);
-		gc->Clear();
-		}
-	gc->Deactivate();
-//
-	ws.Flush();
-	delete gc;
-	device->ReleaseFont(font);
-	window.Close();
-	group.Close();
-	delete device;
-	ws.Close();
-	return(KErrNone);
-	}
-
-GLDEF_D TTimeTestHeader LoadsaText={_S("Loads of text"),LoadsOfText};
--- a/windowing/windowserver/twsgraphic/TWsGraphicShareTest.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,182 +0,0 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include <w32stdgraphic.h>
-
-// bitmap to load for comparison
-#define MY_TEST_BITMAP _L("Z:\\WSTEST\\MYTEST.MBM")
-
-const TUint32 ENullWsHandle=0xFFFFFFFF;
-const TInt KErrTestExeFailure = -666;
-
-// class to check if a shared CWsGraphic can be drawn correctly
-class CWsGraphicShareBase : public CBase
-	{
-public:
-	CWsGraphicShareBase();
-	~CWsGraphicShareBase();
-	void ConstructL();
-	void DoTestDrawGraphicCompareL(TPtrC aShare);
-private :
-	void Test(TInt aCondition);
-	
-	
-private :
-	TInt iScreenNumber;
-	CWindowGc *iGc;
-	RWsSession iWs;
-	RWindowGroup *iGroupWin;
-	CWsScreenDevice *iScreen;
-	RWindow *iWin;	
-	};
-
-CWsGraphicShareBase::CWsGraphicShareBase() 
-	{
-		iScreenNumber = 0;
-	}
-	
-CWsGraphicShareBase::~CWsGraphicShareBase() 
-	{
-		iWin->Close();
-		delete iWin;
-		delete iScreen;
-		delete iGc;
-		delete iGroupWin;
-		iWs.Close();
-	}
-	
-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();
-	}	
-
-// Checks that the shared graphic is drawn or not. This is done by creating a new graphic in this process
-// which looks the same as the shared graphic. The new graphic is then drawn to the screen followed by an 
-// attempt to draw the shared graphic. The two graphics are then compared. In cases where the shared graphic
-// should be drawn the two graphics should compare exactly. In cases where the shared graphic should not be 
-// drawn the comparison will fail.
-   
-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;
-	}
-
-// Failures are written to WSERV.log
-void CWsGraphicShareBase::Test(TInt aCondition)
-	{
-	if(!aCondition)
-		{
-		TLogMessageText buf;
-		_LIT(Fail,"AUTO Failed in WsGraphics Test : DrawSharedGraphic");
-		buf.Format(Fail);
-		iWs.LogMessage(buf);
-		iWs.Flush();
-		RProcess().Terminate(KErrTestExeFailure); // terminate this process immediately. Expect TWsGraph test step (TAutoServer.exe) to capture this
-		}
-	}
-	
-void MainL()
-	{
-	// read the argument from the command line of whether the graphic should be shared or not
-	TBuf<256> commandLine;
-    User::CommandLine(commandLine);
-    TLex lex(commandLine);
-    TPtrC toShare = lex.NextToken();    
-    
-    CActiveScheduler* activeScheduler=new(ELeave) CActiveScheduler;
-	CActiveScheduler::Install(activeScheduler);
-	CleanupStack::PushL(activeScheduler);
-
-    CWsGraphicShareBase testBase;
-    testBase.ConstructL();
-       
-    testBase.DoTestDrawGraphicCompareL(toShare);
-    
-	CleanupStack::PopAndDestroy(activeScheduler);
-	}
-
-GLDEF_C TInt E32Main()
-	{
-	CTrapCleanup* cleanUpStack=CTrapCleanup::New();
-	if(cleanUpStack==NULL)
-		{
-		return KErrNoMemory;
-		}
-	TRAP_IGNORE(MainL())
-	delete cleanUpStack;
-	
-	return(KErrNone);
-	}
--- a/windowing/windowserver/twsgraphic/TWsGraphicTest.CPP	Tue Jun 22 15:21:29 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1610 +0,0 @@
-// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @test
- @internalComponent - Internal Symbian test code
-*/
-
-#include <w32stdgraphic.h>
-#include <imageconversion.h>
-#include "testbase.h"
-#include "testbase.h"
-
-// Bitmap to load for tests
-#define MY_TEST_BITMAP _L("Z:\\WSTEST\\MYTEST.MBM")
-
-// Animation to load for tests
-_LIT(KSymBallFile, "Z:\\WSTEST\\symball.gif");
-
-// Executables for different sharing of graphic tests
-_LIT(KTestExe1, "TWSGRAPHICSHARETEST.exe");
-_LIT(KTestExe2, "TWSGRAPHICSHAREGLOBALTEST.exe");
-_LIT(KTestExe3, "TWSGRAPHICUNSHAREGLOBALTEST.exe");
-_LIT(KTestExe4, "TWSGRAPHICSHARESECURETEST.exe");
-_LIT(KTestExe5, "TWSGRAPHICUNSHARESECURETEST.exe");
-
-// Graphic is shared or not in executeable
-_LIT(KShare, " true");
-_LIT(KNoShare, " false");
-
-TUid KUidTestAnimation = {0x87654321};
-const TInt KDummyGraphicId = 99;
-const TInt KMaxLogLength = 256;
-const TInt KAnimationRunTime = 5000000; // 5 seconds max time to run a single animation loop
-
-// Animation loader
-class CIclLoader: public CActive
-	{
-public:
-	CIclLoader();
-	~CIclLoader();
-	void ConstructL(const TDesC& aFileName, TBool aUseUID, TBool aReplace);
-	const TWsGraphicId GetId();	
-	inline TInt FrameCount() const {return iTotalFrames;};
-	inline TBool Ok() const {return !iFailed;};
-protected:
-	void RunL();
-	TInt RunError(TInt aError);
-	void DoCancel();
-private:
-	void TestL(TInt aCondition);
-	CImageDecoder* iDecoder;
-	CWsGraphicBitmapAnimation* iTestAnimation;
-	TLogMessageText iTestLog;
-	TBool iUseUID;
-	TBool iReplace;
-	RPointerArray<CWsGraphicBitmapAnimation::CFrame> iFrames;
-	TInt iTotalFrames;
-	void NextL();
-	RFs iFs;
-	TBool iFailed;
-	};
-	
-CIclLoader::CIclLoader():
-	CActive(CActive::EPriorityLow)
-	{
-	CActiveScheduler::Add(this);
-	}
-
-CIclLoader::~CIclLoader()
-	{
-	if (iTestAnimation)
-		{
-		delete iTestAnimation;
-		iTestAnimation = NULL;
-		}
-	if (iDecoder)
-		{
-		delete iDecoder;
-		iDecoder = NULL;
-		}
-	iFrames.ResetAndDestroy();
-	iFs.Close();
-	}
-	
-const TWsGraphicId CIclLoader::GetId()
-	{
-	if (iTestAnimation)
-		{
-		return iTestAnimation->Id();
-		}
-	else
-		{
-		TWsGraphicId id(KDummyGraphicId);
-		return id;
-		}
-	}
-	
-void CIclLoader::TestL(TInt aCondition)
-	{
-	if(!aCondition)
-		{
-		RWsSession rWs;
-		User::LeaveIfError(rWs.Connect());
-		TBuf<KMaxLogLength> buf;
-		_LIT(Fail,"AUTO Failed in WsGraphics Test : CIclLoader");
-		buf.Append(Fail);
-		buf.Append(iTestLog);
-		rWs.LogMessage(buf);
-		rWs.Flush();
-		rWs.Close();
-		User::Leave(KErrGeneral);
-		}
-	}
-
-void CIclLoader::ConstructL(const TDesC& aFileName, TBool aUseUID,TBool aReplace)
-	{
-	iUseUID = aUseUID;
-	iReplace = aReplace;
-	
-	User::LeaveIfError(iFs.Connect());
-		
-	iDecoder = CImageDecoder::FileNewL(iFs,aFileName);
-	if(!iDecoder->IsImageHeaderProcessingComplete()) 
-		{
-		User::Leave(KErrGeneral);
-		}
-	NextL();
-	}
-	
-void CIclLoader::NextL()
-	{
-	// Load a frame from the animation
-	if (iDecoder && (iDecoder->FrameCount() > iFrames.Count()))
-		{
-		const TFrameInfo& info = iDecoder->FrameInfo(iFrames.Count());
-		CWsGraphicBitmapAnimation::CFrame* frame = CWsGraphicBitmapAnimation::CFrame::NewL();
-		CleanupStack::PushL(frame);
-		iFrames.AppendL(frame);
-		CleanupStack::Pop(frame);
-		frame->SetFrameInfo(info);
-		TFrameInfo copiedInfo = frame->FrameInfo();
-		TestL(info.iFlags==copiedInfo.iFlags);
-		
-		TSize bmpSize(info.iFrameCoordsInPixels.Size());
-		CFbsBitmap* bitmap = new(ELeave) CFbsBitmap;
-		frame->SetBitmap(bitmap); //takes ownership
-		User::LeaveIfError(bitmap->Create(bmpSize,info.iFrameDisplayMode));
-		
-		TDisplayMode maskDispMode;
-		CFbsBitmap* mask = new(ELeave) CFbsBitmap;
-		frame->SetMask(mask); //takes ownership
-		if((TFrameInfo::EAlphaChannel|TFrameInfo::ETransparencyPossible) & info.iFlags)
-			{
-			maskDispMode = EGray256;
-			}
-		else
-			{
-			maskDispMode = EGray2;
-			}
-		
-		User::LeaveIfError(mask->Create(info.iFrameCoordsInPixels.Size(),maskDispMode));
-		iDecoder->Convert(&iStatus,*bitmap,*mask,iFrames.Count()-1);
-	
-		SetActive();
-		}
-		
-	// if a frame loaded
-	else if(iFrames.Count())
-		{
-		_LIT_SECURE_ID(KTestSecId,0x12345678);
-		
-		// The extra code around the NewL is checking that no heap failures occur when 
-		// creating the CWsGraphicBitmapAnimation
-		TInt failRate = 1;
-		const TInt KMaxIteration = 1000;
-		for (;failRate < KMaxIteration; failRate++)
-		    {
-		    __UHEAP_RESET;
-		    __UHEAP_SETFAIL(RHeap::EDeterministic,failRate);
-		    __UHEAP_MARK;
-
-		    TInt err = KErrGeneral;
-			if (iUseUID)
-				{// creating animation using UID
-				TRAP(err, iTestAnimation = CWsGraphicBitmapAnimation::NewL(KUidTestAnimation,iFrames.Array()););
-				}
-			else
-				{// creating using transient ID allocated by wserv
-				TRAP(err, iTestAnimation = CWsGraphicBitmapAnimation::NewL(iFrames.Array()););
-				}
-			
-			TestL((err==KErrNone || err==KErrNoMemory));
-			
-			if (err != KErrNone)
-		        {
-		        __UHEAP_MARKEND;
-		        TestL(iTestAnimation == NULL);
-		        }
-		    else
-		        {
-		        break;
-		        }
-			}
-		__UHEAP_RESET;
-		TestL(iTestAnimation != NULL); 
-		TestL(failRate > 1); //Ensure the udeb version of euser.dll is available (i.e. that the rom was build with the -D_DEBUG option)
-		RDebug::Printf("TWSGraphicTest.CPP: Heapfailure loop completed after %d allocs.", failRate-1);
-			
-		// if testing that a created animation can be replaced	
-		if (iReplace)
-			{	
-			// replace the animation just created with another
-			TWsGraphicId testId = iTestAnimation->Id();
-			TInt testInt = testId.Id();  
-	    
-	   		CWsGraphicBitmapAnimation* testReplacement = CWsGraphicBitmapAnimation::NewL(testId,iFrames.Array());
-	
-			delete iTestAnimation;
-
-			iTestAnimation = testReplacement;
-		
-			TestL(iTestAnimation->Id().Id()==testInt); 
-			}
-			
-		delete iDecoder;
-		iDecoder = NULL;
-		iTotalFrames = iFrames.Count();
-		iFrames.ResetAndDestroy();
-		
-		// test that the animation methods can be used without error
-		TestL(iTestAnimation->ShareGlobally()==KErrNone);
-		TestL(iTestAnimation->UnShareGlobally()==KErrNone);
-		TestL(iTestAnimation->Share(KTestSecId)==KErrNone);
-		TestL(iTestAnimation->UnShare(KTestSecId)==KErrNone);
-		TestL(iTestAnimation->UnShare(KTestSecId)==KErrNotFound);	
-		}
-	}
-
-void CIclLoader::RunL()
-	{
-	if (iStatus == KErrNone)
-		{
-		NextL();
-		}
-	else
-		{
-		TestL(EFalse); // kill the test
-		}
-	}
-
-TInt CIclLoader::RunError(TInt aError)
-	{
-	RDebug::Printf("CIclLoader::RunError, aError %d", aError);
-	iFailed = ETrue;
-	return KErrNone;
-	}
-
-void CIclLoader::DoCancel()
-	{
-	if(iDecoder)
-		{
-		iDecoder->Cancel();
-		}
-	}
-
-// Class for testing CWsGraphics
-class CActiveWait;
-class CRedrawAO;
-class CWsGraphicBase : public CBase
-	{
-public:
-	CWsGraphicBase();
-	CWsGraphicBase(TInt aScreenNumber);
-	~CWsGraphicBase();
-	void ConstructL();
-	void DoTestL(TInt aTestNo);
-	void RedrawMe(TRect aRedrawRect, TInt aFrame);
-
-	enum TTestCases
-		{
-		ETestCreateGraphicUID,
-		ETestCreateGraphicID,
-		ETestUpdateGraphic,
-		ETestDeleteGraphic,
-		ETestDrawInvalideBitmapID,
-		ETestDrawGraphic,
-		ETestDrawGraphicID,
-		ETestDrawGraphicCompare,
-		ETestDrawGraphicSessionHandle,
-		ETestDrawAnimatedGraphicUID,
-		ETestDrawAnimatedGraphicID,
-		ETestCreateMsgGraphicMsgBuf,
-		ETestDrawReplaceGraphicID,
-		ETestDrawInvalidAnimationID,
-		ETestDrawSharedGraphic,
-		// additional cases to be added here, before ETestMaxNumberOfTests
-		ETestMaxNumberOfTests
-		};
-
-private :
-	void PrepGc();
-	void RetireGc();
-	void RunAnimation(TInt aFrameCount);
-	void LaunchNewProcessL(const TDesC& aExecutable, TBool aShare);
-	inline void TestForIdenticalBitmaps(){Test(iScreen->RectCompare(iPosition1,iPosition2));};
-	inline void TestForDifferentBitmaps(){Test(!iScreen->RectCompare(iPosition1,iPosition2));};
-	void Test(TInt aCondition);
-	void DoTestCreateGraphicUidL();	
-	void DoTestCreateGraphicIdL();
-	void DoTestUpdateGraphicL();
-	void DoTestDrawSharedGraphicL();
-	void DoTestDeleteGraphicL();
-	void DoTestDrawGraphicL();
-	void DoTestDrawGraphicIDL();
-	void DoTestDrawGraphicCompareL();
-	void DoTestDrawAnimatedGraphicUIDL();
-	void DoTestDrawAnimatedGraphicIDL();
-	void DoTestDrawGraphicSessionHandleL();
-	void DoTestCreateMsgGraphicMsgBufL();
-	void DoTestDrawReplaceGraphicIDL();
-	void DoTestDrawInvalidBitmapIDL();
-	void DoTestDrawInvalidAnimationIDL();
-private :
-	TInt iScreenNumber;
-	CWindowGc *iGc;
-	RWsSession iWs;
-	RWindowGroup *iGroupWin;
-	CWsScreenDevice *iScreen;
-	RWindow *iWin;	
-	TLogMessageText iTestLog;
-	TRect iPosition1;
-	TRect iPosition2;
-	CActiveWait* iTimer;
-	CRedrawAO* iRedrawListener;
-	TWsGraphicId iAnimId;
-	TWsGraphicAnimation iAnimData;
-	};
-
-// 
-// class CRedrawAO
-// request & listen for redraw events from wserv
-// if a redraw event is received, notify the observing class
-// 
-class CRedrawAO : public CActive
-	{
-public:
-	static CRedrawAO* NewL(RWsSession* aWs);
-	~CRedrawAO();
-	// from CActive:
-	void RunL();
-	void DoCancel();	
-	TInt RunError(TInt aError);
-	void RequestRedraw();
-	inline void SetFrameCount(TInt aCount){iFrameCount = aCount;};
-	inline TInt GetFrameCount() const {return iFrameCount;};
-private:
-	CRedrawAO(RWsSession* aWs);
-	void ConstructL();
-private:
-	RWsSession* iWs;
-	TInt iFrameCount;
-	};
-
-CRedrawAO* CRedrawAO::NewL(RWsSession* aWs)
-	{
-	CRedrawAO* self = new (ELeave) CRedrawAO(aWs);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self; 
-	}
-
-CRedrawAO::CRedrawAO(RWsSession* aWs):
-CActive(CActive::EPriorityHigh), iWs(aWs)
-	{
-	CActiveScheduler::Add(this);
-	}
-
-CRedrawAO::~CRedrawAO()
-	{
-	// cleanup 
-	Cancel();
-	}
-
-void CRedrawAO::ConstructL()
-	{
-	// nothing to construct 
-	}
-
-void CRedrawAO::RunL()
-	{
-	// leave if status is not ok. RunError will process this result
-	User::LeaveIfError(iStatus.Int());
-	TWsRedrawEvent redraw;
-	iWs->GetRedraw(redraw);
-	TUint redrawHandle = redraw.Handle();
-	if (redrawHandle == ENullWsHandle)
-		{
-		User::Leave(KErrBadHandle); // sanity check the client handle isn't a dummy 
-		}
-	else if (redrawHandle)
-		{
-		--iFrameCount;
-		(reinterpret_cast<CWsGraphicBase *>(redrawHandle))->RedrawMe(redraw.Rect(), iFrameCount); // handle the redraw signal
-		}
-	
-	if (iFrameCount > 0) 
-		{
-		RequestRedraw();
-		}
-	}
-
-TInt CRedrawAO::RunError(TInt aError)
-	{
-	if (aError != KErrBadHandle)
-		{
-		RequestRedraw();
-		}
-	return KErrNone;
-	}
-
-void CRedrawAO::DoCancel()
-	{
-	// kill all outstanding asynch. wserv requests
-	iWs->RedrawReadyCancel();
-	iFrameCount = KErrNone;	
-	}
-
-void CRedrawAO::RequestRedraw()
-	{
-	if (!IsActive())
-		{
-		iWs->RedrawReady(&iStatus);
-		SetActive();
-		}
-	}
-
-//
-
-class CActiveWait : public CActive
-	{
-public:
-	static CActiveWait* NewL();
-	~CActiveWait();
-	void Wait(TInt aDelay);
-	// From CActive:
-	void RunL();
-	void DoCancel();
-	TInt RunError(TInt aError);
-protected:
-	CActiveWait();
-	void ConstructL();
-protected:
-	RTimer iTimer;
-	TTime iFromTime;
-	};
-
-CActiveWait* CActiveWait::NewL()
-	{
-	CActiveWait* self = new (ELeave) CActiveWait;
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
-	}
-	
-void CActiveWait::ConstructL()
-	{
-	User::LeaveIfError(iTimer.CreateLocal());
-	CActiveScheduler::Add(this);
-	}
-	
-CActiveWait::CActiveWait() : CActive(CActive::EPriorityStandard)
-	{
-	iFromTime.HomeTime();
-	}
-
-CActiveWait::~CActiveWait()
-	{
-	Cancel();
-	iTimer.Close();
-	}
-
-void CActiveWait::DoCancel()
-	{
-	iTimer.Cancel();
-	CActiveScheduler::Stop();
-	}
-
-void CActiveWait::RunL()
-	{
-	CActiveScheduler::Stop();
-	}
-	
-TInt CActiveWait::RunError(TInt aError)
-	{
-	return aError; // exists so a break point can be placed on it.
-	}
-
-void CActiveWait::Wait(TInt aDelay)
-
-
-	{
-	iTimer.After(iStatus, aDelay);
-	SetActive();
-	CActiveScheduler::Start();
-	}
-	
-//
-
-CWsGraphicBase::CWsGraphicBase(TInt aScreenNumber) : iScreenNumber(aScreenNumber), iAnimId(KDummyGraphicId)
-	{
-	}
-	
-CWsGraphicBase::~CWsGraphicBase() 
-	{
-	iWin->Close();
-	delete iWin;
-	delete iScreen;
-	delete iGc;
-	delete iGroupWin;
-	iWs.Close();
-	if (iTimer)
-		{
-		delete iTimer;
-		iTimer = NULL;
-		}
-	if (iRedrawListener)
-		{
-		delete iRedrawListener;
-		iRedrawListener = NULL;
-		}
-	}
-	
-void CWsGraphicBase::ConstructL()
-	{
-	User::LeaveIfError(iWs.Connect());
-	iScreen=new(ELeave) CWsScreenDevice(iWs);
-	User::LeaveIfError(iScreen->Construct(iScreenNumber));
-
-	TSize screenSize = iScreen->SizeInPixels();
-	iPosition1.SetRect(0,0,screenSize.iWidth/2,screenSize.iHeight);
-	iPosition2.SetRect(screenSize.iWidth/2,0,screenSize.iWidth,screenSize.iHeight);
-
-	iTimer = CActiveWait::NewL();
-	iRedrawListener = CRedrawAO::NewL(&iWs);
-
-	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, (TUint32)this);
-	iWin->EnableRedrawStore(EFalse);	// disable the redraw store for these tests
-	iWin->SetRequiredDisplayMode(EColor256);
-	iWin->SetExtent(TPoint(0,0),iScreen->SizeInPixels());
-	iWin->Activate();
-	iWin->BeginRedraw();
-	iWin->EndRedraw();
-	iWs.Flush();
-	}
-	
-// To test whether sharing of graphics works a new process has to be launched.
-// The argument is set whether the graphic should be shared or not.	
-void CWsGraphicBase::LaunchNewProcessL(const TDesC& aExecutable, TBool aShare)
-	{
-	TBuf<128> args;
-	RProcess pr;
-	TRequestStatus status;
-	
-	if (aShare)
-		{
-		args.Append(KShare);
-		}
-	else
-		{
-		args.Append(KNoShare);
-		}
-		
-	User::LeaveIfError(pr.Create(aExecutable,args));
-	pr.Logon(status);
-	pr.Resume();
-	User::WaitForRequest(status);
-	pr.Close();
-	
-	if (status != KErrNone)
-		{
-		User::Leave(status.Int());
-		}
-	}
-
-//
-// CWsGraphicBase::PrepGc
-// activate a gc & clear the two rects
-//
-void CWsGraphicBase::PrepGc()
-	{
-	iGc->Activate(*iWin);
-	iWin->Invalidate();
-	iWin->BeginRedraw();
-	iGc->Clear(iPosition1);
-	iGc->Clear(iPosition2);
-	iWs.Flush();
-	}
-
-//
-// CWsGraphicBase::RetireGc
-// deactivate a gc & flush any outstanding RWindow requests
-void CWsGraphicBase::RetireGc()
-	{
-	iGc->Deactivate();
-	iWin->EndRedraw();
-	iWs.Flush();
-	}
-
-//
-// CWsGraphicBase::RedrawMe
-// called from the redraw listener AO, triggered by a redraw event
-// Invalidates the area requiring a redraw & 
-// initiates a redraw of the CWsGraphicBitmapAnimation's window
-// 
-void CWsGraphicBase::RedrawMe(TRect aRedrawRect, TInt aFrame)
-	{
-	// do draw with next frame
-	if (iAnimData.IsPlaying())
-		{
-		iGc->Activate(*iWin);
-		iWin->Invalidate(aRedrawRect);
-		iWin->BeginRedraw();
-		iWs.Flush();
-		iGc->DrawWsGraphic(iAnimId,iPosition1,iAnimData.Pckg());
-		iGc->Deactivate();
-		iWin->EndRedraw();
-		iWs.Flush();
-		
-		// check for last frame
-		if (aFrame == 0)
-			{
-			iTimer->Cancel();
-			}
-		}
-	}
-			
-/**
-   @SYMTestCaseID GRAPHICS-WSERV-0001
-  
-   @SYMPREQ	PREQ1246
-
-   @SYMTestCaseDesc Create Globally and Locally Shared Graphic Bitmaps from UIDs.
-   
-   @SYMTestPriority High
-   
-   @SYMTestStatus Implemented
-   
-   @SYMTestActions First test that TWsGraphicIds can be created from UIDs. Then create CWsGraphicBitmap objects through 
-   	CWsGraphicBitmap::NewL, passing a UID from a TWsGraphicId. Two different objects are created
-		1.	Globally shared available to all applications
-		2.	Locally shared available to selected clients
-   
-   @SYMTestExpectedResults The CWsGraphicBitmap objects are created and no errors are reported.
- */	
-void CWsGraphicBase::DoTestCreateGraphicUidL()
-	{
-	iTestLog.Append(_L("CreateGraphicUid"));
-	
-	_LIT_SECURE_ID(KTestSecId,0x12345678);
-			
-	// Test the creation of TWsGraphicIds from UIDs
-	TUid uid1 = {0x10000001};
-	TUid uid2 = {0x10000002};
-	 
-	TWsGraphicId twsGraphicId1(uid1);
-	Test(twsGraphicId1.Uid()==uid1);
-	
-	TWsGraphicId twsGraphicId2(uid2);
-	Test(twsGraphicId2.Uid()==uid2);
-	
-	TWsGraphicId twsGraphicId3(twsGraphicId2);
-	Test(twsGraphicId3.Uid()==uid2);
-	
-	TWsGraphicId twsGraphicId4(1);
-	twsGraphicId4.Set(uid1);
-	Test(twsGraphicId4.Uid()==uid1);		
-	
-	// Create globally shared CWsGraphicBitmap		
-	CFbsBitmap bitmap1;
-	CFbsBitmap mask1;		
-	
-	TSize screenSize = iScreen->SizeInPixels();
-	bitmap1.Create(screenSize,iScreen->DisplayMode());
-	mask1.Create(bitmap1.SizeInPixels(),iScreen->DisplayMode());
-	
-	CWsGraphicBitmap* bTest = CWsGraphicBitmap::NewL(twsGraphicId1.Uid(), &bitmap1,&mask1);		
-	Test(bTest->IsActive());
-	
-	TWsGraphicId tid1 = bTest->Id();
-	Test(tid1.Uid()==uid1);
-	
-	Test(bTest->ShareGlobally()==KErrNone);
-	
-	// Create local shared CWsGraphicBitmap		
-	CFbsBitmap bitmap2;
-	CFbsBitmap mask2;		
-	
-	bitmap2.Create(screenSize,iScreen->DisplayMode());
-	mask2.Create(bitmap2.SizeInPixels(),iScreen->DisplayMode());
-	
-	CWsGraphicBitmap* bTest2 = CWsGraphicBitmap::NewL(twsGraphicId2.Uid(), &bitmap2,&mask2);		
- 
-	TWsGraphicId tid2 = bTest2->Id();
-	Test(tid2.Uid()==uid2);
-	
-	Test(bTest2->Share(KTestSecId)==KErrNone);
-	
-	// Test the unsharing of the CWsGraphicBitmaps
-	Test(bTest->UnShareGlobally()==KErrNone);
-	Test(bTest2->UnShare(KTestSecId)==KErrNone);
-	Test(bTest2->UnShare(KTestSecId)==KErrNotFound);
-	
-	delete bTest;	
-	delete bTest2;
-	}
-	
-/**
-   @SYMTestCaseID GRAPHICS-WSERV-0002
-  
-   @SYMPREQ	PREQ1246
-
-   @SYMTestCaseDesc Create Globally and Locally Shared Graphic Bitmaps.
-   
-   @SYMTestPriority High
-   
-   @SYMTestStatus Implemented
-   
-   @SYMTestActions First test that TWsGraphicIds can be created from IDs. Then create CWsGraphicBitmap objects through 
-   	CWsGraphicBitmap::NewL. Two different objects are created
-		1.	Globally shared available to all applications
-		2.	Locally shared available to selected clients
-   
-   @SYMTestExpectedResults The CWsGraphicBitmap objects are created and no errors are reported.
- */
-void CWsGraphicBase::DoTestCreateGraphicIdL()
-	{
-	iTestLog.Append(_L("CreateGraphicId"));
- 		
-	_LIT_SECURE_ID(KTestSecId,0x12345678);
-	
-	// Test creating TWsGraphicIds from ids first
-	TUid uid1 = {0x10000001};
-	 
-	TWsGraphicId twsGraphicId1(uid1);
-	
-	twsGraphicId1.Set(9);
-	Test(twsGraphicId1.Id()==9);
-	
-	TWsGraphicId twsGraphicId2(twsGraphicId1);
-	Test(twsGraphicId2.Id()==9);
-	
-	TWsGraphicId twsGraphicId3(7);
-	Test(twsGraphicId3.Id()==7);
-	
-	// Create globally shared CWsGraphicBitmap
-	CFbsBitmap bitmap1;
-	CFbsBitmap mask1;
-
-	TSize screenSize = iScreen->SizeInPixels();
-	bitmap1.Create(screenSize,iScreen->DisplayMode());
-	mask1.Create(bitmap1.SizeInPixels(),iScreen->DisplayMode());
-	
-	CWsGraphicBitmap* bTest = CWsGraphicBitmap::NewL(&bitmap1,&mask1);
-	Test(bTest->IsActive());
-	
-	TWsGraphicId tid1 = bTest->Id();
-	
-	Test(bTest->ShareGlobally()==KErrNone);
-	
-	// Create local shared CWsGraphicBitmap	
-	CFbsBitmap bitmap2;
-	CFbsBitmap mask2;
-	
-	bitmap2.Create(screenSize,iScreen->DisplayMode());
-	mask2.Create(bitmap2.SizeInPixels(),iScreen->DisplayMode());
- 		
-	CWsGraphicBitmap* bTest2 = CWsGraphicBitmap::NewL(&bitmap2,&mask2);
-	
-	TWsGraphicId tid2 = bTest2->Id();
-	
-	Test(bTest2->Share(KTestSecId)==KErrNone);
-	
-	// Test the unsharing of the CWsGraphicBitmaps
-	Test(bTest->UnShareGlobally()==KErrNone);
-	Test(bTest2->UnShare(KTestSecId)==KErrNone);
-	Test(bTest2->UnShare(KTestSecId)==KErrNotFound);
- 	
-	delete bTest2;	
-	delete bTest;		
-	}
-	
-	/**
-   @SYMTestCaseID GRAPHICS-WSERV-0003
-  
-   @SYMPREQ	PREQ1246
-
-   @SYMTestCaseDesc Update an existing graphic bitmap with new data.
-   
-   @SYMTestPriority High
-   
-   @SYMTestStatus Implemented
-   
-   @SYMTestActions The test calls CWsGraphicBitmap::NewL method with new data passed to the CWsGraphicBitmap object. 
-   		
-   
-   @SYMTestExpectedResults The CWsGraphicBitmap object is updated with no errors reported.
- */
-void CWsGraphicBase::DoTestUpdateGraphicL()
-	{
-	iTestLog.Append(_L("UpdateGraphic"));
- 		
-	CFbsBitmap bitmap1;
-	CFbsBitmap mask1;
-	CFbsBitmap bitmap2;
-	CFbsBitmap mask2;
-	
-	TSize screenSize = iScreen->SizeInPixels();
-	bitmap1.Create(screenSize,iScreen->DisplayMode());
-	mask1.Create(bitmap1.SizeInPixels(),iScreen->DisplayMode());
- 	
-	CWsGraphic* bTest = CWsGraphicBitmap::NewL(&bitmap1,&mask1);
-
-	bitmap2.Create(screenSize,iScreen->DisplayMode());
-	mask2.Create(bitmap2.SizeInPixels(),iScreen->DisplayMode());
- 	
-	TWsGraphicId tid1 = bTest->Id();
-	TInt testInt = tid1.Id(); 
-    
-   	CWsGraphic* testReplacement = CWsGraphicBitmap::NewL(tid1, &bitmap2,&mask2);
-
-	delete bTest;
-	bTest = testReplacement;
-	
-	Test(bTest->Id().Id()==testInt); 
-	
-	delete bTest;		
-	}
-	
-
-	
-	/**
-   @SYMTestCaseID GRAPHICS-WSERV-0004
-  
-   @SYMPREQ	PREQ1246
-
-   @SYMTestCaseDesc Try to delete an existing graphic.
-   
-   @SYMTestPriority High
-   
-   @SYMTestStatus Implemented
-   
-   @SYMTestActions The test app calls CWsGraphic::Destroy() method, 
-   
-   @SYMTestExpectedResults The CWsGraphicBitmap object is removed from the Window Server with no 
-   		errors reported
- */
-void CWsGraphicBase::DoTestDeleteGraphicL()
-	{
-	iTestLog.Append(_L("DeleteGraphic"));
- 		
-	CFbsBitmap bitmap1;
-	CFbsBitmap mask1;
-	
-	TSize screenSize = iScreen->SizeInPixels();
-	bitmap1.Create(screenSize,iScreen->DisplayMode());
-	mask1.Create(bitmap1.SizeInPixels(),iScreen->DisplayMode());
-	
-	CWsGraphic* bTest = CWsGraphicBitmap::NewL(&bitmap1,&mask1);
-	
-	bTest->Destroy();
-	
-	Test(!bTest->IsActive());
- 
-	delete bTest; 
-	}
-	
-		/**
-   @SYMTestCaseID GRAPHICS-WSERV-0005
-  
-   @SYMPREQ	PREQ1246
-
-   @SYMTestCaseDesc Check a bitmap is not drawn if the bitmap and mask it uses are invalid
-   
-   @SYMTestPriority High
-   
-   @SYMTestStatus Implemented
-   
-   @SYMTestActions The test app creates a valid and invalid bitmap and attempts to draw them
-   
-   @SYMTestExpectedResults The valid bitmap is drawn but the invalid bitmap is not drawn
- */	
-void CWsGraphicBase::DoTestDrawInvalidBitmapIDL()
-	{
-	iTestLog.Append(_L("DrawInvalidBitmapID"));
- 		
-	CFbsBitmap bitmap1;
-	CFbsBitmap mask1;
-	CFbsBitmap *bitmap2 = NULL;
-	CFbsBitmap *mask2 = NULL;
-	
-	User::LeaveIfError(bitmap1.Load(MY_TEST_BITMAP,0));
-	mask1.Create(bitmap1.SizeInPixels(),iScreen->DisplayMode());
-	
-	// valid bitmap
-	CWsGraphicBitmap* bTest = CWsGraphicBitmap::NewL(&bitmap1,&mask1);
-	
-	// invalid bitmap
-	CWsGraphicBitmap* bTest2 = CWsGraphicBitmap::NewL(bitmap2,mask2);
- 	
-	PrepGc();
-	iGc->DrawWsGraphic(bTest->Id(),iPosition1);
-	iGc->DrawWsGraphic(bTest2->Id(),iPosition2);
-	RetireGc();
-	
-	// compare the graphic in both positions, should only be graphic in position 1
-	TestForDifferentBitmaps();
-	
-	delete bTest2;
-	delete bTest;
-	}
-	
-		/**
-   @SYMTestCaseID GRAPHICS-WSERV-0006
-  
-   @SYMPREQ	PREQ1246
-
-   @SYMTestCaseDesc Draw a graphic within a rectangle on the screen, then try to draw with a non-existant graphic
-   
-   @SYMTestPriority High
-   
-   @SYMTestStatus Implemented
-   
-   @SYMTestActions The test app calls CWindowGC::DrawWsGraphic() method using the TWGraphicId object, to draw within a rectangle on the screen
-   		 
-   @SYMTestExpectedResults The graphic is drawn on the screen with no errors reported. Drawing with a non-existant graphic causes
-   		nothing to be drawn and no error reported
- */
-void CWsGraphicBase::DoTestDrawGraphicL()
-	{
-	iTestLog.Append(_L("DrawGraphic"));
-	
-	_LIT8(KTestData,"HelloWorld");
-	
-	CFbsBitmap bitmap1;
-	CFbsBitmap mask1;
-
-	User::LeaveIfError(bitmap1.Load(MY_TEST_BITMAP,0));
-	mask1.Create(bitmap1.SizeInPixels(),iScreen->DisplayMode());
-	
-	CWsGraphicBitmap* bTest = CWsGraphicBitmap::NewL(&bitmap1,&mask1);
-
-	PrepGc();	
-	iGc->DrawWsGraphic(bTest->Id(),iPosition1,KTestData);
-	TWsGraphicId twsGraphicId1(KDummyGraphicId); // create unrecognised wsbitmap id & attempt to draw it
-	iGc->DrawWsGraphic(twsGraphicId1,iPosition2,KTestData);
-	RetireGc();
-
-	// compare the graphic in both positions, should only be graphic in position 1
-	TestForDifferentBitmaps();
-	
-	delete bTest;  	
-	}
-	
-			/**
-   @SYMTestCaseID GRAPHICS-WSERV-0007
-  
-   @SYMPREQ	PREQ1246
-
-   @SYMTestCaseDesc Draw a graphic using a transient ID within a rectangle on the screen
-   
-   @SYMTestPriority High
-   
-   @SYMTestStatus Implemented
-   
-   @SYMTestActions The test app calls CWindowGC::DrawWsGraphic() using a TWsGraphic object, to draw within
-   		a rectangle on the screen
-   
-   @SYMTestExpectedResults The graphic is drawn.
- */
-void CWsGraphicBase::DoTestDrawGraphicIDL()
-	{
-	iTestLog.Append(_L("DrawGraphicID"));
-		
-	CFbsBitmap bitmap1;
-	CFbsBitmap mask1;
-
-	User::LeaveIfError(bitmap1.Load(MY_TEST_BITMAP,0));
-	mask1.Create(bitmap1.SizeInPixels(),iScreen->DisplayMode());
-	
-	CWsGraphicBitmap* bTest = CWsGraphicBitmap::NewL(&bitmap1,&mask1);
-	 			
-	PrepGc();
-	iGc->DrawWsGraphic(bTest->Id(),iPosition1);
-	RetireGc();
-	
-	// compare the graphic in both positions, should only be graphic in position 1
-	TestForDifferentBitmaps();
- 	
-	delete bTest;
-	}
-	
-
-	
-			/**
-   @SYMTestCaseID GRAPHICS-WSERV-0008
-  
-   @SYMPREQ	PREQ1246
-
-   @SYMTestCaseDesc Draw a graphic in two different rectangles on the screen and compare them
-   
-   @SYMTestPriority High
-   
-   @SYMTestStatus Implemented
-   
-   @SYMTestActions The test app calls CWindowGC::DrawWsGraphic() using the TWsGraphic object, to draw a known bitmap
-   		rectangle on the screen twice in different places. The bitmaps are then compared.
-   
-   @SYMTestExpectedResults The two bitmaps are identical
- */
-void CWsGraphicBase::DoTestDrawGraphicCompareL()
-	{
-	iTestLog.Append(_L("DrawGraphicCompare"));
-
-	_LIT8(KTestData,"HelloWorld");
-	
-	CFbsBitmap bitmap1;
-	CFbsBitmap mask1;
-	
-	CFbsBitmap bitmap2;
-	CFbsBitmap mask2;
-	
-	User::LeaveIfError(bitmap1.Load(MY_TEST_BITMAP,0));
-	mask1.Create(bitmap1.SizeInPixels(),iScreen->DisplayMode());
-	
-	User::LeaveIfError(bitmap2.Load(MY_TEST_BITMAP,0));
-	mask2.Create(bitmap2.SizeInPixels(),iScreen->DisplayMode());
-
-	CWsGraphicBitmap* bTest = CWsGraphicBitmap::NewL(&bitmap1,&mask1);
-	CWsGraphicBitmap* bTest2 = CWsGraphicBitmap::NewL(&bitmap2,&mask2);
-	
-	PrepGc();
-	//draw the graphic in the two different rectangles	
-	iGc->DrawWsGraphic(bTest->Id(),iPosition1,KTestData);
-	iGc->DrawWsGraphic(bTest2->Id(),iPosition2,KTestData);
-	RetireGc();
-
-	// compare the graphic in both positions. Contents of each rect should be identical
-	TestForIdenticalBitmaps();
-			
-	delete bTest2;
-	delete bTest;
-	}
-	
-		/**
-   @SYMTestCaseID GRAPHICS-WSERV-0009
-  
-   @SYMPREQ	PREQ1246
-
-   @SYMTestCaseDesc Draw a global and local graphic in two different rectangles on the screen and compare them
-   
-   @SYMTestPriority High
-   
-   @SYMTestStatus Implemented
-   
-   @SYMTestActions The test app calls CWindowGC::DrawGraphic() using the TWsGraphic object, to draw a known 
-   		global and local bitmap rectangle on the screen twice in different places. The bitmaps are then compared.
-   
-   @SYMTestExpectedResults The two bitmaps are identical
- */
-void CWsGraphicBase::DoTestDrawGraphicSessionHandleL()
-	{
-	iTestLog.Append(_L("DrawGraphicSessionHandle"));
-	_LIT_SECURE_ID(KTestSecId,0x12345678);
-	
-	// test TWsGraphicControlState first
-	_LIT8(KTestData,"HelloWorld");
-
-	CFbsBitmap bitmap1;
-	CFbsBitmap mask1;
-	
-	CFbsBitmap bitmap2;
-	CFbsBitmap mask2;
-	
-	User::LeaveIfError(bitmap1.Load(MY_TEST_BITMAP,0));
-	mask1.Create(bitmap1.SizeInPixels(),iScreen->DisplayMode());
-	
-	User::LeaveIfError(bitmap2.Load(MY_TEST_BITMAP,0));
-	mask2.Create(bitmap2.SizeInPixels(),iScreen->DisplayMode());
-	
-	CWsGraphicBitmap* bTest = CWsGraphicBitmap::NewL(&bitmap1,&mask1);
-	CWsGraphicBitmap* bTest2 = CWsGraphicBitmap::NewL(&bitmap2,&mask2);
-	
-	Test(bTest->ShareGlobally()==KErrNone);
-	Test(bTest2->Share(KTestSecId)==KErrNone);
-	
-	PrepGc();
-	iGc->DrawWsGraphic(bTest->Id(),iPosition1,KTestData);
-	iGc->DrawWsGraphic(bTest2->Id(),iPosition2,KTestData);	
-	RetireGc();
-
-	// compare the graphic in both positions. Contents of each rect should be identical
-	TestForIdenticalBitmaps();
- 		
-	delete bTest2;
-	delete bTest;
-	}
-
-	/**
-   @SYMTestCaseID GRAPHICS-WSERV-0010
-  
-   @SYMPREQ	PREQ1246
-
-   @SYMTestCaseDesc Check an animation can be constructed using a UID, manipulated and then drawn
-   
-   @SYMTestPriority High
-   
-   @SYMTestStatus Implemented
-   
-   @SYMTestActions The test app creates CWsGraphicBitmapAnimation object via a UID and then draws the object to the screen
-   
-   @SYMTestExpectedResults The object is drawn
- */	
-void CWsGraphicBase::DoTestDrawAnimatedGraphicUIDL()
-	{
-	iTestLog.Append(_L("DrawAnimatedGraphicUID"));
-
-	// test TWsGraphicAnimation first
-	iAnimData.Play(EFalse);
-
-	// load the animation via a UID
-	CIclLoader*	iclLoader;		
-	iclLoader = new(ELeave) CIclLoader();
-	iclLoader->ConstructL(KSymBallFile,ETrue,EFalse); // this is actually an asynchronous operation, so we give it a chance to execute below
-
-	while (iclLoader->Ok() && iclLoader->GetId().Id() == KDummyGraphicId)
-		{
-		iTimer->Wait(1000);
-		}
-	
-	Test(iclLoader->Ok()); // fail test if iclLoder experienced problems
-	
-	iAnimId = iclLoader->GetId();
-	
-	// animation is ready to be drawn. draw to the 1st position only	
-	PrepGc();
-	iGc->DrawWsGraphic(iAnimId,iPosition1,iAnimData.Pckg());	
-	RetireGc();
-	
-	// run the animation
-	RunAnimation(iclLoader->FrameCount());
-
-	// compare the graphic in both positions. 
-	TestForDifferentBitmaps();
- 	
-	iTimer->Cancel();
-	iclLoader->Cancel();
-	delete iclLoader;
-	}
-
-	/**
-   @SYMTestCaseID GRAPHICS-WSERV-0011
-  
-   @SYMPREQ	PREQ1246
-
-   @SYMTestCaseDesc Check an animation can be constructed using an ID, manipulated and then drawn
-   
-   @SYMTestPriority High
-   
-   @SYMTestStatus Implemented
-   
-   @SYMTestActions The test app creates CWsGraphicBitmapAnimation object via an ID and then draws the object to the screen
-   
-   @SYMTestExpectedResults The object is drawn
- */	
-void CWsGraphicBase::DoTestDrawAnimatedGraphicIDL()
-	{
-	iTestLog.Append(_L("DrawAnimatedGraphicID"));	
-	iAnimData.Play(ETrue);
-	iAnimData.Play(ETrue);
-	Test(iAnimData.Loops());
-	iAnimData.Pause();
-	Test(!iAnimData.IsPlaying());
-	Test(iAnimData.IsPaused());
-	iAnimData.Pause();
-	Test(iAnimData.Loops());
-	iAnimData.Play(EFalse);
-	Test(!iAnimData.Loops());
-	Test(!iAnimData.IsStopping());
-	Test(!iAnimData.IsStopped());		
- 		
-	// load the animation via an ID
-	CIclLoader*	iclLoader;
-	iclLoader = new(ELeave) CIclLoader();
-	iclLoader->ConstructL(KSymBallFile,EFalse,EFalse);
-	
-	while (iclLoader->GetId().Id() == KDummyGraphicId)
-		{
-		iTimer->Wait(1000);
-		}
-	iAnimId = iclLoader->GetId();
-	
-	PrepGc();
-	iGc->DrawWsGraphic(iAnimId,iPosition1,iAnimData.Pckg());	
-	RetireGc();
-
-	// run the animation
-	RunAnimation(iclLoader->FrameCount());
-
-	// compare the graphic in both positions
-	TestForDifferentBitmaps();
-	
-	iAnimData.Stop(ETrue);
-	Test(iAnimData.IsStopped());
-	iAnimData.Pause();
-	iAnimData.Play(EFalse);
-	iAnimData.Stop(EFalse);
-	Test(!iAnimData.IsStopped());
-
-	iTimer->Cancel();	
-	iclLoader->Cancel();
-	delete iclLoader;
-	}
-
-	/**
-   @SYMTestCaseID GRAPHICS-WSERV-0012
-  
-   @SYMPREQ	PREQ1246
-
-   @SYMTestCaseDesc Check an animation can be constructed and then replaced, manipulated and then drawn
-   
-   @SYMTestPriority High
-   
-   @SYMTestStatus Implemented
-   
-   @SYMTestActions The test app creates CWsGraphicBitmapAnimation object, the replaces it, and then draws the object 
-   		to the screen
-   
-   @SYMTestExpectedResults The object is drawn
- */		
-void CWsGraphicBase::DoTestDrawReplaceGraphicIDL()
-	{
-	// test TWsGraphicControlStateTimed first
-	iTestLog.Append(_L("DrawAnimatedGraphicID"));	
-	_LIT8(KTestData,"HelloWorld");
-	iAnimData.Stop(ETrue);
-			
-	// load and replace the animation 	
-	CIclLoader*	iclLoader;
-	iclLoader = new(ELeave) CIclLoader();
-	iclLoader->ConstructL(KSymBallFile,false,true);
-	
-	while (iclLoader->GetId().Id() == KDummyGraphicId)
-		{
-		iTimer->Wait(1000);
-		}
-	iAnimId = iclLoader->GetId();
-
-	// draw the animation in two positions
-	PrepGc();
-	iGc->DrawWsGraphic(iAnimId,iPosition1,KTestData);	
-	RetireGc();
-	
-	// run the animation
-	RunAnimation(iclLoader->FrameCount());
-
-	// compare the graphic in both positions
-	// Expect identical, as the command buffer used in position1 animation is invalid, therefore never drawn
-	TestForIdenticalBitmaps();
-	
-	iTimer->Cancel();
-	iclLoader->Cancel();
-	delete iclLoader;			
-	}
-
-	/**
-   @SYMTestCaseID GRAPHICS-WSERV-0013
-  
-   @SYMPREQ	PREQ1246
-
-   @SYMTestCaseDesc Check the creation and manipulation of an RWsGraphicMsgBuf object
-   
-   @SYMTestPriority High
-   
-   @SYMTestStatus Implemented
-   
-   @SYMTestActions Creates and manipulates an RWsGraphicMsgBuf object
-   
-   @SYMTestExpectedResults RWsGraphicMsgBuf functions correctly
- */		
-void CWsGraphicBase::DoTestCreateMsgGraphicMsgBufL()
-	{
-	iTestLog.Append(_L("CreateMsgGraphicMsgBuf"));
-	
-	_LIT(KNebraska,"Nebraska");
-	_LIT8(KTesting,"Testing");
-	RWsGraphicMsgBuf msgBuf;
-	msgBuf.CleanupClosePushL();
-	msgBuf.Append(TUid::Uid(0x12345670),KTesting());
-	msgBuf.Append(TUid::Uid(0x12345671),KNebraska());
-	msgBuf.Append(TUid::Uid(0x12345670),KTesting());
-	
-	Test(TUid::Uid(0x12345670)==msgBuf.TypeId(0));
-
-	msgBuf.Remove(0);
-	const TInt count = msgBuf.Count();
-	Test(count == 2);
-			
-	iAnimData.Play(ETrue);
-	msgBuf.Append(iAnimData);
-	Test(msgBuf.Count() == 3);
-	
-	CleanupStack::Pop();
-	
-	// load the animation via a UID
-	CIclLoader*	iclLoader;		
-	iclLoader = new(ELeave) CIclLoader();
-	iclLoader->ConstructL(KSymBallFile,true,false);
-
-	while (iclLoader->GetId().Id() == KDummyGraphicId)
-		{
-		iTimer->Wait(1000);
-		}
-	iAnimId = iclLoader->GetId();
-
-	PrepGc();
-	iGc->DrawWsGraphic(iAnimId,iPosition1,msgBuf.Pckg());	
-	RetireGc();
- 	
-	// run the animation
-	RunAnimation(iclLoader->FrameCount());
-
-	// compare the graphic in both positions
-	TestForDifferentBitmaps();
- 	
-	iTimer->Cancel();
-	iclLoader->Cancel();
-	delete iclLoader;
-	msgBuf.Close();
-	}
-
-	
-	
-	/**
-   @SYMTestCaseID GRAPHICS-WSERV-0014
-  
-   @SYMPREQ	PREQ1246
-
-   @SYMTestCaseDesc Check an animation is not drawn if the command buffer it uses is invalid
-   
-   @SYMTestPriority High
-   
-   @SYMTestStatus Implemented
-   
-   @SYMTestActions The test app creates CWsGraphicBitmapAnimation object then draws the animation using
-   		a valid and invalid command buffer
-   
-   @SYMTestExpectedResults The animation is drawn while using the valid command buffer but not drawn
-   		when the command buffer is invalid
- */		
-void CWsGraphicBase::DoTestDrawInvalidAnimationIDL()
-	{
-	// test TWsGraphicControlStateTimed first, a valid command buffer
-	iTestLog.Append(_L("DrawInvalidAnimationID"));	
-	iAnimData.Play(ETrue);
-	
-	// invalid command buffer
-	_LIT8(KTestData2,"12345678");
-			
-	// load and replace the animation 	
-	CIclLoader*	iclLoader;
-	iclLoader = new(ELeave) CIclLoader();
-	iclLoader->ConstructL(KSymBallFile,false,false);
-	
-	while (iclLoader->GetId().Id() == KDummyGraphicId)
-		{
-		iTimer->Wait(1000);
-		}
-	iAnimId = iclLoader->GetId();
-
-	PrepGc();
-	iGc->DrawWsGraphic(iAnimId,iPosition1,iAnimData.Pckg());	
-	iGc->DrawWsGraphic(iAnimId,iPosition2,KTestData2);
-	RetireGc();
-	
-	// run the animation
-	RunAnimation(iclLoader->FrameCount());
-
-	// compare the graphic in both positions
-	TestForDifferentBitmaps();
-
-	iAnimData.Stop(ETrue);	
-	iTimer->Cancel();
-	iclLoader->Cancel();
-	delete iclLoader;			
-	}
-	
-	/**
-   @SYMTestCaseID GRAPHICS-WSERV-0015
-  
-   @SYMPREQ	PREQ1246
-
-   @SYMTestCaseDesc Check the sharing of graphics with other clients.
-   
-   @SYMTestPriority High
-   
-   @SYMTestStatus Implemented
-   
-   @SYMTestActions The test app creates CWsGraphicBitmap object an then tests the sharing of the object with
-   			different clients
-   
-   @SYMTestExpectedResults The CWsGraphicBitmap object is shared correctly
- */
-void CWsGraphicBase::DoTestDrawSharedGraphicL()
-	{
-	iTestLog.Append(_L("DrawSharedGraphic"));
-	_LIT_SECURE_ID(KTestSecId,0x10003a4b);
-
-	TUid uid1 = {0x12000021};
-	TWsGraphicId twsGraphicId1(uid1);
-	
-	CFbsBitmap bitmap1;
-	CFbsBitmap mask1;
-	
-	User::LeaveIfError(bitmap1.Load(MY_TEST_BITMAP,0));
-	mask1.Create(bitmap1.SizeInPixels(),iScreen->DisplayMode());
-	
-	CWsGraphicBitmap* bTest = CWsGraphicBitmap::NewL(twsGraphicId1.Uid(), &bitmap1,&mask1);
-	
-	// Try to draw the graphic in an client. Should fail as graphic is not shared 
-	TRAPD(err, LaunchNewProcessL(KTestExe1, EFalse));
-	Test(err == KErrNone);
-
-	// Share the graphic globally and try to draw the graphic in an client. Should pass
-	Test(bTest->ShareGlobally()==KErrNone);
-	TRAP(err, LaunchNewProcessL(KTestExe2, ETrue));
-	Test(err == KErrNone);
-	
-	// Unshare the graphic globally and try to draw the graphic in an client. Should fail
-	Test(bTest->UnShareGlobally()==KErrNone);
-	TRAP(err, LaunchNewProcessL(KTestExe3, EFalse));
-	Test(err == KErrNone);
-	
-	// Share the graphic to a client and try to draw the graphic in the client. Should pass
-	Test(bTest->Share(KTestSecId)==KErrNone);		
-	TRAP(err, LaunchNewProcessL(KTestExe4, ETrue));
-	Test(err == KErrNone);
-	
-	// Unshare the graphic to a client and try to draw the graphic in the client. Should fail
-	Test(bTest->UnShare(KTestSecId)==KErrNone);
-	TRAP(err, LaunchNewProcessL(KTestExe5, EFalse));
-	Test(err == KErrNone);
-			
-	delete bTest;	
-	}
-
-	
-void CWsGraphicBase::DoTestL(TInt aTestNo)
-	{
-	switch (aTestNo)
-		{
-		case ETestCreateGraphicUID:
-			DoTestCreateGraphicUidL();
-			break;
-		case ETestCreateGraphicID:
-			DoTestCreateGraphicIdL();
-			break;
-		case ETestUpdateGraphic:
-			DoTestUpdateGraphicL();
-			break;
-		case ETestDeleteGraphic:
-			DoTestDeleteGraphicL();
-			break;
-		case ETestDrawInvalideBitmapID:
-			DoTestDrawInvalidBitmapIDL();
-			break;
-		case ETestDrawGraphic:
-			DoTestDrawGraphicL();
-			break;
-		case ETestDrawGraphicID:
-			DoTestDrawGraphicIDL();
-			break;
-		case ETestDrawGraphicCompare:
-			DoTestDrawGraphicCompareL();
-			break;
-		case ETestDrawGraphicSessionHandle:
-			DoTestDrawGraphicSessionHandleL();
-			break;	
-#ifdef _DEBUG
-      // These tests require debug-only API to simulate OOM. Running
-      // the tests in non-debug environments invalidates the tests.
-		case ETestDrawAnimatedGraphicUID:
-			DoTestDrawAnimatedGraphicUIDL();
-			break;
-		case ETestDrawAnimatedGraphicID:
-			DoTestDrawAnimatedGraphicIDL();
-			break;
-		case ETestCreateMsgGraphicMsgBuf:
-			DoTestCreateMsgGraphicMsgBufL();
-			break;
-		case ETestDrawReplaceGraphicID:
-			DoTestDrawReplaceGraphicIDL();
-			break;
-		case ETestDrawInvalidAnimationID:
-			DoTestDrawInvalidAnimationIDL();
-			break;
-#endif
-		case ETestDrawSharedGraphic:
-			DoTestDrawSharedGraphicL();
-			break;
-		}
-	RDebug::Print(iTestLog);
-	iTestLog.Delete(0,256);	
-	}
-	
-// writes out to WSERV.log if error
-void CWsGraphicBase::Test(TInt aCondition)
-	{
-	if(!aCondition)
-		{
-		TBuf<KMaxLogLength> buf;
-		_LIT(Fail,"AUTO Failed in WsGraphics Test : ");
-		buf.Append(Fail);
-		buf.Append(iTestLog);
-		RDebug::Print(buf);
-		RProcess().Terminate(KErrGeneral);
-		}
-	}
-	
-//
-// CWsGraphicBase::RunAnimation
-// Redraw event listener is launched & the 
-// animation is given a total of KAnimationRunTime (25 seconds) to run a single loop
-// 
-void CWsGraphicBase::RunAnimation(TInt aFrameCount)
-	{
-	--aFrameCount; // account for the fact the initial frame is already displayed
-	iRedrawListener->SetFrameCount(aFrameCount);
-	iRedrawListener->RequestRedraw();
-	iTimer->Wait(KAnimationRunTime);
-	if (iAnimData.IsPlaying())
-		{
-		iAnimData.Stop(ETrue);
-		}
-	iRedrawListener->Cancel();
-	iAnimData.Stop(EFalse);
-	Test(iRedrawListener->GetFrameCount() == 0); // ensure the animation ran through until last frame
-	}
-
-void MainL()
-	{
-	TInt testCount = KErrNone;
-
-    //Read the argument from the command line for current screen number
-	TBuf<256> commandLine;
-	User::CommandLine(commandLine);
-	TLex lex(commandLine);
-	lex.NextToken();
-	lex.SkipSpace();
-	TInt screenNumber=(TInt)lex.Get();
-
-	CActiveScheduler* activeScheduler=new(ELeave) CActiveScheduler;
-	CActiveScheduler::Install(activeScheduler);
-	CleanupStack::PushL(activeScheduler);
-
-    CWsGraphicBase testBase(screenNumber);
-    testBase.ConstructL();
-    
-    // run through all the tests   
-    while (testCount < CWsGraphicBase::ETestMaxNumberOfTests)
-    	{
-    	testBase.DoTestL(testCount);
-    	testCount++;
-    	}
-    
-	CleanupStack::PopAndDestroy(activeScheduler);
-	}
-
-GLDEF_C TInt E32Main()
-	{
-	CTrapCleanup* cleanUpStack=CTrapCleanup::New();
-	if(cleanUpStack==NULL)
-		{
-		return KErrNoMemory;
-		}
-	TRAPD(err, MainL());
-	delete cleanUpStack;
-	return(err);
-	}
--- a/windowing/windowserver/wins_switching/ws32_stubs.h	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserver/wins_switching/ws32_stubs.h	Fri Jul 16 11:45:55 2010 +0300
@@ -5292,6 +5292,15 @@
 	_asm jmp common_dispatch
 	}
 
+__declspec(dllexport)
+__declspec(naked)
+void call_vector_587 ()
+	{
+	// ; void RWsSession::IndicateAppOrientation(enum TRenderOrientation)
+	_asm mov eax, 587
+	_asm jmp common_dispatch
+	}
+
 }
-#define MAX_ORDINAL 587
-
+#define MAX_ORDINAL 588
+
--- a/windowing/windowserverplugins/group/bld.inf	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserverplugins/group/bld.inf	Fri Jul 16 11:45:55 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -30,6 +30,8 @@
 
 PRJ_MMPFILES
 
+#include "../keyeventrouting/group/bld.inf"
+
 #ifndef SYMBIAN_GRAPHICS_BUILD_OPENWF_WSERV
 #include "../restricted/group/BLD.INF"
 #else
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/windowing/windowserverplugins/keyeventrouting/bwins/keyrouteru.def	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+	?NewL@CKeyEventRouter@@SAPAV1@XZ @ 1 NONAME ; class CKeyEventRouter * CKeyEventRouter::NewL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/windowing/windowserverplugins/keyeventrouting/eabi/keyrouteru.def	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+	_ZN15CKeyEventRouter4NewLEv @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/windowing/windowserverplugins/keyeventrouting/group/bld.inf	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,29 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Key Event Routing plug-in for Window Server
+//
+
+PRJ_EXPORTS
+../bwins/keyrouteru.def	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/def/bwins/keyrouteru.def)
+../eabi/keyrouteru.def	SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(graphics/def/eabi/keyrouteru.def)
+keyeventrouting.iby		/epoc32/rom/include/keyeventrouting.iby
+
+PRJ_TESTEXPORTS
+keyeventrouting_test.iby		/epoc32/rom/include/keyeventrouting_test.iby
+
+PRJ_MMPFILES
+keyeventrouting.mmp
+
+PRJ_TESTMMPFILES
+keyeventrouting_test.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/windowing/windowserverplugins/keyeventrouting/group/keyeventrouting.iby	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,22 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+// Key Event Routing plug-in for Window Server
+//
+
+#ifndef __KEYEVENTROUTING_IBY__
+#define __KEYEVENTROUTING_IBY__
+
+file=ABI_DIR\BUILD_DIR\keyrouter.dll		System\Libs\keyrouter.dll
+
+#endif // __KEYEVENTROUTING_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/windowing/windowserverplugins/keyeventrouting/group/keyeventrouting.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,28 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Key Event Routing plug-in for Window Server
+//
+
+TARGET		keyrouter.dll
+TARGETTYPE	dll
+CAPABILITY  PowerMgmt ReadDeviceData WriteDeviceData ProtServ
+UID			0x102872e1 0x102872e2
+VENDORID	0x70000001
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+SOURCEPATH	../src
+SOURCE		keyrouter.cpp
+
+LIBRARY		euser.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/windowing/windowserverplugins/keyeventrouting/group/keyeventrouting_test.iby	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,22 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: 
+// Key Event Routing plug-in for Window Server: test version
+//
+
+#ifndef __KEYEVENTROUTING_TEST_IBY__
+#define __KEYEVENTROUTING_TEST_IBY__
+
+file=ABI_DIR\BUILD_DIR\keyrouter_test.dll		System\Libs\keyrouter_test.dll
+
+#endif // __KEYEVENTROUTING_TEST_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/windowing/windowserverplugins/keyeventrouting/group/keyeventrouting_test.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,32 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Key Event Routing plug-in for Window Server: test version
+//
+
+TARGET		keyrouter_test.dll
+TARGETTYPE	dll
+CAPABILITY  PowerMgmt ReadDeviceData WriteDeviceData ProtServ
+UID			0x102872e1 0x102872e6
+VENDORID	0x70000001
+
+MACRO		KEYROUTER_TEST
+
+DEFFILE		keyrouter.def
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+SOURCEPATH	../src
+SOURCE		keyrouter.cpp
+
+LIBRARY		euser.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/windowing/windowserverplugins/keyeventrouting/src/keyaliases.h	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,110 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Key code and scan code aliases for platform specific keys.
+// The definitions are as per S60 <mw/eikon.hrh> with the addition of the
+// full set of scan codes.
+
+/**
+@file
+@internalTechnology
+@prototype
+*/
+
+#include <e32keys.h>
+
+/**
+TStdScanCode aliases
+*/
+#define EStdKeyPhoneSend		EStdKeyYes
+#define EStdKeyPhoneEnd			EStdKeyNo
+#define EStdKeyCBA1				EStdKeyDevice0
+#define EStdKeyCBA2				EStdKeyDevice1
+#define EStdKeyPowerOff			EStdKeyDevice2
+#define EStdKeyOK				EStdKeyDevice3
+#define EStdKeyGripOpen			EStdKeyDevice4
+#define EStdKeyGripClose		EStdKeyDevice5
+#define EStdKeySide				EStdKeyDevice6	// Voice key
+#define EStdKeyCamera			EStdKeyDevice7
+#define EStdKeyTwistOpen		EStdKeyDevice8
+#define EStdKeyTwistClose		EStdKeyDevice9
+#define EStdKeyFlipOpen			EStdKeyDeviceA
+#define EStdKeyFlipClose		EStdKeyDeviceB
+#define EStdKeyLock				EStdKeyDeviceF
+#define EStdKeyLeftUpArrow		EStdKeyDevice10	// Diagonal arrow event
+#define EStdKeyRightUpArrow		EStdKeyDevice11	// Diagonal arrow event
+#define EStdKeyRightDownArrow	EStdKeyDevice12	// Diagonal arrow event
+#define EStdKeyLeftDownArrow	EStdKeyDevice13	// Diagonal arrow event
+#define EStdKeyVolumeUp			EStdKeyIncVolume
+#define EStdKeyVolumeDown		EStdKeyDecVolume
+#define EStdKeyApplication		EStdKeyApplication0
+#define EStdKeyPoC				EStdKeyApplication1
+#define EStdKeyPlay				EStdKeyApplication2
+#define EStdKeyStop				EStdKeyApplication3
+#define EStdKeyForward			EStdKeyApplication4
+#define EStdKeyRewind			EStdKeyApplication5
+#define EStdKeyOperator			EStdKeyApplication6
+#define EStdKeyQwertyOn			EStdKeyApplication7
+#define EStdKeyQwertyOff		EStdKeyApplication8
+#define EStdKeyNext				EStdKeyApplication9
+#define EStdKeyPrevious			EStdKeyApplicationA
+#define EStdKeyHoldSwitch		EStdKeyApplicationB
+#define EStdKeyZoomIn			EStdKeyApplicationC
+#define EStdKeyZoomOut			EStdKeyApplicationD
+#define EStdKey4x10QwertyOn		EStdKeyApplicationE
+#define EStdKey3x11QwertyOn		EStdKeyApplication10
+#define EStdKeyHalfQwertyOn		EStdKeyApplication11
+#define EStdKeyCustomKeyboardOn	EStdKeyApplication12
+
+/**
+TKeyCode aliases
+*/
+#define EKeyPhoneSend			EKeyYes
+#define EKeyPhoneEnd			EKeyNo
+#define EKeyCBA1				EKeyDevice0
+#define EKeyCBA2				EKeyDevice1
+#define EKeyPowerOff			EKeyDevice2
+#define EKeyOK					EKeyDevice3
+#define EKeyGripOpen			EKeyDevice4
+#define EKeyGripClose			EKeyDevice5
+#define EKeySide				EKeyDevice6		// Voice key
+#define EKeyCamera				EKeyDevice7
+#define EKeyTwistOpen			EKeyDevice8
+#define EKeyTwistClose			EKeyDevice9
+#define EKeyFlipOpen			EKeyDeviceA
+#define EKeyFlipClose			EKeyDeviceB
+#define EKeyLock				EKeyDeviceF
+#define EKeyLeftUpArrow			EKeyDevice10	// Diagonal arrow event
+#define EKeyRightUpArrow		EKeyDevice11	// Diagonal arrow event
+#define EKeyRightDownArrow		EKeyDevice12	// Diagonal arrow event
+#define EKeyLeftDownArrow		EKeyDevice13	// Diagonal arrow event
+#define EKeyVolumeUp			EKeyIncVolume
+#define EKeyVolumeDown			EKeyDecVolume
+#define EKeyApplication 		EKeyApplication0
+#define EKeyPoC					EKeyApplication1
+#define EKeyPlay				EKeyApplication2
+#define EKeyStop				EKeyApplication3
+#define EKeyForward				EKeyApplication4
+#define EKeyRewind				EKeyApplication5
+#define EKeyOperator			EKeyApplication6
+#define EKeyQwertyOn			EKeyApplication7
+#define EKeyQwertyOff			EKeyApplication8
+#define EKeyNext				EKeyApplication9
+#define EKeyPrevious			EKeyApplicationA
+#define EKeyHoldSwitch			EKeyApplicationB
+#define EKeyZoomIn				EKeyApplicationC
+#define EKeyZoomOut				EKeyApplicationD
+#define EKey4x10QwertyOn		EKeyApplicationE
+#define EKey3x11QwertyOn		EKeyApplication10
+#define EKeyHalfQwertyOn		EKeyApplication11
+#define EKeyCustomKeyboardOn	EKeyApplication12
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/windowing/windowserverplugins/keyeventrouting/src/keyrouter.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,543 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Reference implementation of Key Event Routing plug-in
+
+/**
+@file
+@internalTechnology
+@prototype
+*/
+
+#include <e32cmn.h>
+#include <e32debug.h>
+#include "keyrouterimpl.h"
+#include "keyaliases.h"
+
+#ifndef KEYROUTER_TEST
+// Temporary: to be made configurable
+#define COMBINED_POWER_END_KEY
+#endif
+
+/**
+Privileged application UIDs
+*/
+#ifdef KEYROUTER_TEST
+const TInt KUidTAutoServer = 0x10205152;
+const TInt KUidReservedApp = 0x102872e3;
+#else
+const TInt KUidPhoneApp = 0x100058b3;
+const TInt KUidSysAp = 0x100058f3;
+const TInt KUidAutoLock = 0x100059b5;
+const TInt KUidHomeScreen = 0x20022f35;
+const TInt KUidAknCapServer = 0x10207218;
+#endif
+
+#if defined(KEYROUTER_TEST) || defined(COMBINED_POWER_END_KEY)
+/**
+Key Capture Translation Table
+
+The following scan codes and key codes are translated at capture-request time.
+
+@note	The data in this table is for example/test purposes only.
+*/
+const TTranslationEntry KTranslations[] =
+	{
+		// Req. scancode,	Capture scancode,	Req. keycode,	Capture keycode
+#ifndef KEYROUTER_TEST
+		// On devices with a combined Power and End key, that key produces a
+		// PowerOff code. Map capture requests for the End key to PowerOff.
+		// At routing time, an End key event will automatically be delivered
+		// to the capturing application.
+		{ EStdKeyPhoneEnd,	EStdKeyPowerOff,	EKeyPhoneEnd,	EKeyPowerOff }
+#else
+		// Entry for TEvent test case GRAPHICS-WSERV-0751.
+		// Capture requests for psuedo key Device0 are mapped to capture
+		// the real key Device1.
+		{ EStdKeyDevice0,	EStdKeyDevice1,		EKeyDevice0,	EKeyDevice1 }
+#endif
+	};
+
+const TInt KNumTranslations = TABLE_SIZE(KTranslations);
+#endif // defined(KEYROUTER_TEST) || defined(COMBINED_POWER_END_KEY)
+
+/**
+Restricted Key Table
+
+The following keys may be captured only by the specified applications.
+More than one application may be listed for a given key-type combination.
+*/
+const TRestrictedKeyEntry KRestrictedKeys[] =
+	{
+#ifndef KEYROUTER_TEST
+		// Short Apps key events may only be captured by HomeScreen, SysApp,
+		// AutoLock, Phone and AknCapServer.
+		{ EStdKeyApplication,	ECaptureTypeKeyUpDown,	KUidHomeScreen },
+		{ EKeyApplication,		ECaptureTypeKey,		KUidHomeScreen },
+		{ EStdKeyApplication,	ECaptureTypeKeyUpDown,	KUidSysAp },
+		{ EKeyApplication,		ECaptureTypeKey,		KUidSysAp },
+		{ EStdKeyApplication,	ECaptureTypeKeyUpDown,	KUidAutoLock },
+		{ EKeyApplication,		ECaptureTypeKey,		KUidAutoLock },
+		{ EStdKeyApplication,	ECaptureTypeKeyUpDown,	KUidPhoneApp },
+		{ EKeyApplication,		ECaptureTypeKey,		KUidPhoneApp },
+		{ EStdKeyApplication,	ECaptureTypeKeyUpDown,	KUidAknCapServer },
+		{ EKeyApplication,		ECaptureTypeKey,		KUidAknCapServer },
+
+		// Long Apps key events may only be captured by SysAp (for launching
+		// the task switcher), AutoLock and Phone.
+		{ EKeyApplication,		ECaptureTypeLongKey,	KUidSysAp },
+		{ EKeyApplication,		ECaptureTypeLongKey,	KUidAutoLock },
+		{ EKeyApplication,		ECaptureTypeLongKey,	KUidPhoneApp },
+
+		// Only SysAp and AutoLock are allowed to capture Power key events
+		{ EKeyPowerOff,			ECaptureTypeKey,		KUidSysAp },
+		{ EKeyPowerOff,			ECaptureTypeLongKey,	KUidSysAp },
+		{ EStdKeyPowerOff,		ECaptureTypeKeyUpDown,	KUidSysAp },
+		{ EKeyPowerOff,			ECaptureTypeKey,		KUidAutoLock },
+		{ EKeyPowerOff,			ECaptureTypeLongKey,	KUidAutoLock },
+		{ EStdKeyPowerOff,		ECaptureTypeKeyUpDown,	KUidAutoLock },
+
+		// Only AutoLock is allowed to capture Lock key events
+		{ EKeyLock,				ECaptureTypeKey,		KUidAutoLock },
+		{ EKeyLock,				ECaptureTypeLongKey,	KUidAutoLock },
+		{ EStdKeyLock,			ECaptureTypeKeyUpDown,	KUidAutoLock }
+#else
+		// The following entries are for test purposes only.
+		// Test Case GRAPHICS-WSERV-0754. Only a reserved UID is allowed to
+		// capture F20 key events.
+		{ EKeyF20,				ECaptureTypeKey,		KUidReservedApp },
+		{ EKeyF20,				ECaptureTypeLongKey,	KUidReservedApp },
+		{ EStdKeyF20,			ECaptureTypeKeyUpDown,	KUidReservedApp },
+		// Only the reserved UID and the TAuto tests are allowed to capture
+		// F21 key events
+		{ EKeyF21,				ECaptureTypeKey,		KUidReservedApp },
+		{ EKeyF21,				ECaptureTypeLongKey,	KUidReservedApp },
+		{ EStdKeyF21,			ECaptureTypeKeyUpDown,	KUidReservedApp },
+		{ EKeyF21,				ECaptureTypeKey,		KUidTAutoServer },
+		{ EKeyF21,				ECaptureTypeLongKey,	KUidTAutoServer },
+		{ EStdKeyF21,			ECaptureTypeKeyUpDown,	KUidTAutoServer }
+#endif
+	};
+
+/**
+Application Priority Table
+
+The following applications have fixed priorities for capture of the associated
+key. The priority specified in this table overrides the priority in the capture
+request. When any other application captures a key listed here, the priority is
+forced to zero.
+
+@note	If a key should be never be delivered to any other application, then
+		it should be placed in KRestrictedKeys[] instead.
+*/
+const TAppPriorityEntry KAppPriorityKeys[] =
+	{
+#ifndef KEYROUTER_TEST
+		// The Phone app has priority for capture of Send key events
+		{ EStdKeyPhoneSend,	ECaptureTypeKeyUpDown,	KUidPhoneApp, 1 },
+		{ EKeyPhoneSend,	ECaptureTypeKey,		KUidPhoneApp, 1 },
+		{ EKeyPhoneSend,	ECaptureTypeLongKey,	KUidPhoneApp, 1 },
+
+		// The Phone app has the highest priority for capture of End key
+		// events. Note: any applications that capture these events apart
+		// from those listed here (e.g. other telephony apps) will effectively
+		// have priority 0.
+		{ EStdKeyPhoneEnd,	ECaptureTypeKeyUpDown,	KUidPhoneApp, 1 },
+		{ EKeyPhoneEnd,		ECaptureTypeKey,		KUidPhoneApp, 1 },
+		{ EKeyPhoneEnd,		ECaptureTypeLongKey,	KUidPhoneApp, 1 },
+
+		// The Home Screen app has low priority for capture of End key events
+		{ EStdKeyPhoneEnd,	ECaptureTypeKeyUpDown,	KUidHomeScreen, -1 },
+		{ EKeyPhoneEnd,		ECaptureTypeKey,		KUidHomeScreen, -1 },
+		{ EKeyPhoneEnd,		ECaptureTypeLongKey,	KUidHomeScreen, -1 },
+
+		// SysAp has the lowest priority for capture of End key events
+		{ EStdKeyPhoneEnd,	ECaptureTypeKeyUpDown,	KUidSysAp, -2 },
+		{ EKeyPhoneEnd,		ECaptureTypeKey,		KUidSysAp, -2 },
+		{ EKeyPhoneEnd,		ECaptureTypeLongKey,	KUidSysAp, -2 },
+
+#ifdef COMBINED_POWER_END_KEY
+		// SysAp has the same priority for capture of Power key events as
+		// it does for End key events. This is necessary to maintain correct
+		// relative priorities when there is a combined Power and End key.
+		{ EStdKeyPowerOff,	ECaptureTypeKeyUpDown,	KUidSysAp, -2 },
+		{ EKeyPowerOff,		ECaptureTypeKey,		KUidSysAp, -2 },
+		{ EKeyPowerOff,		ECaptureTypeLongKey,	KUidSysAp, -2 }
+#endif
+
+#else // KEYROUTER_TEST
+		// The following entries are for test purposes only.
+		// Test Case GRAPHICS-WSERV-0757. TAuto tests have priority for
+		// capture of F22 key events.
+		{ EStdKeyF22,		ECaptureTypeKeyUpDown,	KUidTAutoServer, 1 },
+		{ EKeyF22,			ECaptureTypeKey,		KUidTAutoServer, 1 },
+		{ EKeyF22,			ECaptureTypeLongKey,	KUidTAutoServer, 1 }
+#endif // KEYROUTER_TEST
+	};
+
+#ifdef KEYROUTER_TEST
+/**
+Blocked key table.
+
+The following keys are not routed by default.
+
+@note	The data in this table is for example/test purposes only.
+		Since long key events are never routed by default, there is no need
+		to list them here.
+*/
+const TBlockedKeyEntry KBlockedKeys[] =
+	{
+		// Entries for TEvent test case GRAPHICS-WSERV-0760
+		{ EStdKeyDevice3,	ECaptureTypeKeyUpDown },
+		{ EKeyDevice3,		ECaptureTypeKey }
+	};
+
+const TInt KNumBlockedKeys = TABLE_SIZE(KBlockedKeys);
+#endif // KEYROUTER_TEST
+
+const TInt KNumRestrictedKeys = TABLE_SIZE(KRestrictedKeys);
+const TInt KNumAppPriorityKeys = TABLE_SIZE(KAppPriorityKeys);
+const TInt KCaptureKeyArrayGranularity = 5;
+
+/**
+Create and return an instance of CKeyEventRouter
+
+@return	Pointer to new router instance
+*/
+EXPORT_C CKeyEventRouter* CKeyEventRouter::NewL()
+	{
+	return new(ELeave) CKeyEventRouterImpl;
+	}
+
+CKeyEventRouterImpl::CKeyEventRouterImpl()
+: iCaptureKeys(KCaptureKeyArrayGranularity, _FOFF(TKeyCaptureRequest, iHandle))
+	{
+	}
+
+CKeyEventRouterImpl::~CKeyEventRouterImpl()
+	{
+	iCaptureKeys.Close();
+	}
+
+/**
+Add a new key capture request
+
+@param	aRequest	Capture request details
+
+@see CKeyEventRouter::AddCaptureKeyL
+*/
+void CKeyEventRouterImpl::AddCaptureKeyL(const TKeyCaptureRequest& aRequest)
+	{
+	CheckCaptureKeyL(aRequest);
+	iCaptureKeys.InsertL(aRequest, 0);
+	ProcessAppPriorities(iCaptureKeys[0]);
+	TranslateCaptureKey(aRequest.iType, iCaptureKeys[0].iInputCode);
+	}
+
+   
+/**
+Update an existing key capture request
+
+@param	aRequest	Updated capture request details
+
+@note	This function is used only for window server hotkeys, hence key/scan
+		code translation and processing of special application priorities are
+		omitted.
+
+@see CKeyEventRouter::UpdateCaptureKeyL
+*/
+void CKeyEventRouterImpl::UpdateCaptureKeyL(const TKeyCaptureRequest& aRequest)
+	{
+	ASSERT(!aRequest.iWindowGroup);
+	CheckCaptureKeyL(aRequest);
+
+	TInt index = iCaptureKeys.Find(aRequest);
+	ASSERT(index != KErrNotFound);
+
+	if (index != KErrNotFound)
+		{
+		iCaptureKeys[index] = aRequest;
+		}
+	}
+
+/**
+Cancel a key capture request
+
+@param	aType		Capture type
+@param	aHandle		Opaque handle of request to be cancelled
+
+@see CKeyEventRouter::CancelCaptureKey
+
+Note: aType is unused in this implementation, but is present to permit
+implementations that use separate lists for each of the three capture types.
+*/
+void CKeyEventRouterImpl::CancelCaptureKey(TKeyCaptureType /*aType*/, TAny* aHandle)
+	{
+	TKeyCaptureRequest request;
+	request.iHandle = aHandle;
+
+	TInt index = iCaptureKeys.Find(request);
+	if (index != KErrNotFound)
+		{
+		iCaptureKeys.Remove(index);
+		}
+	}
+
+/**
+Route the key event described by aInput and return its destination in iOutput
+
+@param	aInput		Input data with key event to be routed
+@param	aOutput		Output key event and routing results
+
+@see CKeyEventRouter::RouteKey
+*/
+void CKeyEventRouterImpl::RouteKey(const TKeyEventRouterInput& aInput, TKeyEventRouterOutput& aOutput)
+	{
+	TUint inputCode = (aInput.iType == ECaptureTypeKeyUpDown) ?
+						aInput.iKeyEvent.iScanCode : aInput.iKeyEvent.iCode;
+	TInt priority = KMinTInt;
+	TInt captureCount = iCaptureKeys.Count();
+	TKeyCaptureRequest* matchRequest = NULL;
+
+	// Find the highest priority matching capture request. If there are
+	// multiple entries with the same priority then use the first one, i.e.
+	// the most recent request.
+	for (TInt index = 0; index < captureCount; index++)
+		{
+		TKeyCaptureRequest& request = iCaptureKeys[index];
+		if (request.iType == aInput.iType &&
+			request.iInputCode == inputCode &&
+		    (aInput.iKeyEvent.iModifiers & request.iModifierMask) == request.iModifiers &&
+			(request.iPriority > priority))
+			{
+			matchRequest = &request;
+			priority = request.iPriority;
+			}
+		}
+
+	if (matchRequest)
+		{
+		// Found matching capture request. Route the key event to the window
+		// group that made the capture request.
+		aOutput.iWindowGroup = matchRequest->iWindowGroup;
+		if (aInput.iType == ECaptureTypeKeyUpDown)
+			{
+			aOutput.iKeyEvent.iScanCode = matchRequest->iOutputCode;
+			aOutput.iKeyEvent.iCode = aInput.iKeyEvent.iCode;
+#ifdef COMBINED_POWER_END_KEY
+			// When routing to SysAp on devices with a combined Power and End
+			// key, deliver this event as PowerOff if the HomeScreen currently
+			// has focus, otherwise as End. (Note that when the HomeScreen app
+			// is showing the application library, it will capture the End key
+			// itself with higher priority.)
+			if (matchRequest->iAppUid.iUid == KUidSysAp &&
+				aInput.iKeyEvent.iScanCode == EStdKeyPowerOff)
+				{
+				aOutput.iKeyEvent.iScanCode =
+					(aInput.iFocusAppUid.iUid == KUidHomeScreen) ?
+					EStdKeyPowerOff : EStdKeyPhoneEnd;
+				}
+#endif
+			}
+		else
+			{
+			aOutput.iKeyEvent.iScanCode = aInput.iKeyEvent.iScanCode;
+			aOutput.iKeyEvent.iCode = matchRequest->iOutputCode;
+#ifdef COMBINED_POWER_END_KEY
+			if (matchRequest->iAppUid.iUid == KUidSysAp &&
+				aInput.iKeyEvent.iCode == EKeyPowerOff)
+				{
+				aOutput.iKeyEvent.iCode =
+					(aInput.iFocusAppUid.iUid == KUidHomeScreen) ?
+					EKeyPowerOff : EKeyPhoneEnd;
+				}
+#endif
+			}
+		aOutput.iKeyEvent.iModifiers = aInput.iKeyEvent.iModifiers;
+		aOutput.iCaptureHandle = matchRequest->iHandle;
+		aOutput.iResult = ECaptured;
+		}
+#ifdef KEYROUTER_TEST
+	else if (IsKeyBlocked(aInput.iType, inputCode))
+		{
+		// No matching capture request and key is blocked. Do not route.
+		aOutput.iResult = EConsumed;
+		}
+#endif
+	else
+		{
+		// No matching capture request. Route the key event to the current
+		// focussed window group.
+		aOutput.iWindowGroup = aInput.iFocusWindowGroup;
+		aOutput.iKeyEvent = aInput.iKeyEvent;
+		aOutput.iCaptureHandle = NULL;
+		aOutput.iResult = ERouted;
+		}
+	}
+
+/**
+Check that capture request arguments are sane and capture is allowed
+
+@param	aRequest	Capture request details
+
+@leave	KErrArgument if modifier state contains bits that are not in the
+		modifier mask or modifier mask contains EModifierLongKey or priority
+		is KMinTInt.
+		KErrPermissionDenied if key is restricted to capture by a specific
+		application UID and the UID of the requesting app does not match.
+
+@note	Requests with a priority of KMinTint would never be captured: this was
+		also true of the previous implementation in ektran.dll but was ignored.
+		Client code must use the appropriate API function to capture short or
+		long key events, so including EModifierLongKey in the modifier mask is
+		not allowed. (Hotkeys are excepted since a mask of 0xffffffff is used
+		to disable them).
+*/
+void CKeyEventRouterImpl::CheckCaptureKeyL(const TKeyCaptureRequest& aRequest)
+	{
+	if ((aRequest.iModifiers & ~aRequest.iModifierMask) != 0 ||
+		(aRequest.iModifierMask & EModifierLongKey) != 0 && aRequest.iWindowGroup != NULL ||
+		aRequest.iPriority == KMinTInt)
+		{
+		User::Leave(KErrArgument);
+		}
+
+	if (aRequest.iWindowGroup != NULL && IsRestrictedKey(aRequest))
+		{
+		User::Leave(KErrPermissionDenied);
+		}
+	}
+
+/**
+Check if the requested key capture is restricted by application UID
+
+@param	aRequest	Capture request details
+
+@return	ETrue if the key-type combination in aRequest is listed in
+		KRestrictedKeys[] but the requesting application UID does not match
+		any entry in the table; otherwise EFalse.
+*/
+TBool CKeyEventRouterImpl::IsRestrictedKey(const TKeyCaptureRequest& aRequest)
+	{
+	TBool foundKey = EFalse;
+
+	for (const TRestrictedKeyEntry* entry = KRestrictedKeys; entry < &KRestrictedKeys[KNumRestrictedKeys]; entry++)
+		{
+		if (entry->iCode == aRequest.iInputCode &&
+			entry->iType == aRequest.iType)
+			{
+			foundKey = ETrue;
+			if (entry->iAppUidValue == aRequest.iAppUid.iUid)
+				{
+				return EFalse;
+				}
+			}
+		}
+
+	return foundKey;
+	}
+
+/**
+Process special application priorities
+
+@param	aRequest	Capture request details. If the key-type combination is
+					listed in KAppPriorityKeys[], then the capture priority is
+					replaced with the configured priority for the requesting
+					application, or with zero if the application UID does not
+					match any entry in the table.
+*/
+void CKeyEventRouterImpl::ProcessAppPriorities(TKeyCaptureRequest& aRequest)
+	{
+	TBool foundKey = EFalse;
+
+	for (const TAppPriorityEntry* entry = KAppPriorityKeys; entry < &KAppPriorityKeys[KNumAppPriorityKeys]; entry++)
+		{
+		if (entry->iCode == aRequest.iInputCode &&
+			entry->iType == aRequest.iType)
+			{
+			foundKey = ETrue;
+			if (entry->iAppUidValue == aRequest.iAppUid.iUid)
+				{
+				aRequest.iPriority = entry->iAppPriority;
+				return;
+				}
+			}
+		}
+
+	if (foundKey)
+		{
+		aRequest.iPriority = 0;
+		}
+	}
+
+#ifdef KEYROUTER_TEST
+/**
+Check if the specified key is blocked from default routing
+
+@param	aType		Key capture type
+@param	aCode		Scan code or key code
+
+@return	ETrue if key is blocked, otherwise EFalse.
+*/
+TBool CKeyEventRouterImpl::IsKeyBlocked(TKeyCaptureType aType, TUint aCode)
+	{
+	for (const TBlockedKeyEntry* entry = KBlockedKeys; entry < &KBlockedKeys[KNumBlockedKeys]; entry++)
+		{
+		if (entry->iCode == aCode && entry->iType == aType)
+			{
+			return ETrue;
+			}
+		}
+
+		return EFalse;
+	}
+#endif // KEYROUTER_TEST
+
+/**
+Translate the scan or key code of a capture request
+
+@param	aType	Key capture type
+@param	aCode	Key code or scan code, updated to translated value (if any)
+
+@note	This function is used to translate the input key or scan code of a
+		capture request on addition to the capture list. When a key event that
+		matches the list entry is routed, the output code will be taken from
+		TKeyCaptureRequest.iOutputCode and hence automatically translated again
+		(typically back to the original input code of the request, unless the
+		input and output codes were different). For example, a request to
+		capture key code A will be translated to key code B in the capture list.
+		When RouteKey() processes an event with key code B and selects that
+		list entry, it will output key code A for delivery to the application.
+*/
+void CKeyEventRouterImpl::TranslateCaptureKey(TKeyCaptureType aType, TUint& aCode)
+	{
+#if defined(KEYROUTER_TEST) || defined(COMBINED_POWER_END_KEY)
+	for (const TTranslationEntry* entry = KTranslations; entry < &KTranslations[KNumTranslations]; entry++)
+		{
+		if (aType == ECaptureTypeKeyUpDown)
+			{
+			if (aCode == entry->iRequestScanCode)
+				{
+				aCode = entry->iCaptureScanCode;
+				}
+			}
+		else
+			{
+			if (aCode == entry->iRequestKeyCode)
+				{
+				aCode = entry->iCaptureKeyCode;
+				}
+			}
+		}
+#endif
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/windowing/windowserverplugins/keyeventrouting/src/keyrouterimpl.h	Fri Jul 16 11:45:55 2010 +0300
@@ -0,0 +1,92 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// Reference implementation of Key Event Routing plug-in
+
+/**
+@file
+@internalTechnology
+@prototype
+*/
+
+#ifndef KEYROUTERIMPL_H
+#define KEYROUTERIMPL_H
+
+#include <graphics/wskeyrouter.h>
+
+/** Key Capture Translation Table entry */
+struct TTranslationEntry
+	{
+	TUint	iRequestScanCode;
+	TUint	iCaptureScanCode;
+	TUint	iRequestKeyCode;
+	TUint	iCaptureKeyCode;
+	};
+
+/** Restricted Key Table entry */
+struct TRestrictedKeyEntry
+	{
+	TUint			iCode;
+	TKeyCaptureType	iType;
+	TInt			iAppUidValue;
+	};
+
+/** Application Priority Table entry */
+struct TAppPriorityEntry
+	{
+	TUint			iCode;
+	TKeyCaptureType	iType;
+	TInt			iAppUidValue;
+	TInt			iAppPriority;
+	};
+
+#ifdef KEYROUTER_TEST
+/** Blocked Key Table entry */
+struct TBlockedKeyEntry
+	{
+	TUint			iCode;
+	TKeyCaptureType	iType;
+	};
+#endif // KEYROUTER_TEST
+
+#define TABLE_SIZE(table) (sizeof(table) / sizeof((table)[0]))
+
+/**
+Key Event Router implementation class
+*/
+NONSHARABLE_CLASS(CKeyEventRouterImpl) : public CKeyEventRouter
+	{
+public:
+	CKeyEventRouterImpl();
+	~CKeyEventRouterImpl();
+
+	// From CKeyEventRouter
+	void AddCaptureKeyL(const TKeyCaptureRequest& aRequest);
+	void UpdateCaptureKeyL(const TKeyCaptureRequest& aRequest);
+	void CancelCaptureKey(TKeyCaptureType aType, TAny* aHandle);
+	void RouteKey(const TKeyEventRouterInput& aInput,
+				  TKeyEventRouterOutput& aOutput);
+private:
+	void CheckCaptureKeyL(const TKeyCaptureRequest& aRequest);
+	void ProcessAppPriorities(TKeyCaptureRequest& aRequest);
+	void TranslateCaptureKey(TKeyCaptureType aType, TUint& aCode);
+	TBool IsRestrictedKey(const TKeyCaptureRequest& aRequest);
+#ifdef KEYROUTER_TEST
+	TBool IsKeyBlocked(TKeyCaptureType aType, TUint aCode);
+#endif
+
+private:
+	RArray<TKeyCaptureRequest>	iCaptureKeys;
+	};
+
+#endif // KEYROUTERIMPL_H
--- a/windowing/windowserverplugins/openwfc/group/stdplugin.mmp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserverplugins/openwfc/group/stdplugin.mmp	Fri Jul 16 11:45:55 2010 +0300
@@ -75,6 +75,7 @@
 LIBRARY     wfcinterop.lib
 LIBRARY     surfacemanager.lib
 LIBRARY	 	libEGL.lib
+LIBRARY	 	bitgdi.lib
 //TODO Change the following line once eglsynchelper has been corrected
 //     to be available as a dynamic library
 STATICLIBRARY  eglsynchelper.lib
--- a/windowing/windowserverplugins/openwfc/group/wserv_std_plugins.iby	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserverplugins/openwfc/group/wserv_std_plugins.iby	Fri Jul 16 11:45:55 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -30,4 +30,6 @@
 ECOM_PLUGIN(10286378.dll,10286378.rsc)
 #endif
 
+#include <keyeventrouting.iby>
+
 #endif // __WSERV_STD_PLUGINS_IBY__
--- a/windowing/windowserverplugins/openwfc/src/displayrenderstage.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserverplugins/openwfc/src/displayrenderstage.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -312,7 +312,10 @@
 
 TDisplayMode CDisplayRenderStage::DisplayMode() const
 	{
-	return iRenderTarget->DisplayMode();
+	const TInt KThirtyTwoBpp = 32;
+	const TDisplayMode dm = iRenderTarget->DisplayMode();
+	const TInt bpp = TDisplayModeUtils::NumDisplayModeBitsPerPixel(dm);
+	return bpp == KThirtyTwoBpp ? CFbsDevice::DisplayMode16M() : dm;
 	}
 
 TSize CDisplayRenderStage::SizeInPixels() const
--- a/windowing/windowserverplugins/openwfc/src/fbrenderstage.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/windowing/windowserverplugins/openwfc/src/fbrenderstage.cpp	Fri Jul 16 11:45:55 2010 +0300
@@ -18,6 +18,7 @@
 #include "panic.h"
 #include <graphics/wsdisplaycontrol.h>
 #include "displaypolicy.h"
+#include <graphics/sgutils.h>
 #include "utils.h"
 
 #if defined(__WINS__) && defined(_DEBUG)
@@ -154,7 +155,18 @@
 	if (iniFile->FindVar(iNextScreenDevice->ScreenNumber(), KFlickerBufferMode, flickerBufferModeName))
 		displayMode = ParseDisplayMode(flickerBufferModeName);
 	if (displayMode == ENone)
-		displayMode = iNextScreenDevice->DisplayMode();
+		{
+		// Display render stage MWsScreenDevice::DisplayMode now reports the supported screendriver display mode in 32bpp. 
+		// It is necessary in order to maintain BC with 3rd party apps and DSA framework.
+		// The reported display mode may be different from the actual UI surface pixel format, so flicker buffer
+	    // must not rely on DisplayMode() to determine pixel format for its rendering target.
+		//
+		MWsUiBuffer* uiBuf = aNextStage->ObjectInterface<MWsUiBuffer>();
+		if (uiBuf)
+			{
+			displayMode = SgUtils::PixelFormatToDisplayMode(uiBuf->PixelFormat());
+			}
+		}
 	STD_ASSERT_DEBUG(displayMode!=ENone, EPluginPanicNoDisplayModeFound);
 	
 	const TUint32 usage = ESgUsageDirectGdiTarget | ESgUsageWindowGcSource;